Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev-1.9.0' into dev-1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanzhou11 committed Oct 18, 2024
2 parents 861ebef + b65b320 commit 675a515
Show file tree
Hide file tree
Showing 14 changed files with 405 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dss-framework/dss-framework-workspace-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@
<version>2.1.210</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.21</version>
</dependency>

</dependencies>


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
package com.webank.wedatasphere.dss.framework.workspace.bean.itsm;

import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import org.springframework.util.StringUtils;

import java.lang.reflect.Type;
import java.util.Collections;
import java.util.List;
import java.util.Map;

public class ItsmRequest {

private static final String dataKey = "dataList";

private String createDate;
private String createUser;
private String data;
private String externalId;
private String flowId;
private String operateUser;
private String requestTitle;
private String style;
private String taskId;


// getters和setters
public String getCreateDate() {
return createDate;
}

public void setCreateDate(String createDate) {
this.createDate = createDate;
}

public String getCreateUser() {
return createUser;
}

public void setCreateUser(String createUser) {
this.createUser = createUser;
}

public String getData() {
return data;
}

public void setData(String data) {
this.data = data;
}

public String getExternalId() {
return externalId;
}

public void setExternalId(String externalId) {
this.externalId = externalId;
}

public String getFlowId() {
return flowId;
}

public void setFlowId(String flowId) {
this.flowId = flowId;
}

public String getOperateUser() {
return operateUser;
}

public void setOperateUser(String operateUser) {
this.operateUser = operateUser;
}

public String getRequestTitle() {
return requestTitle;
}

public void setRequestTitle(String requestTitle) {
this.requestTitle = requestTitle;
}

public String getStyle() {
return style;
}

public void setStyle(String style) {
this.style = style;
}

public String getTaskId() {
return taskId;
}

public void setTaskId(String taskId) {
this.taskId = taskId;
}

public List<Map<String,String>> getDataList(){
String dataStr = getData();
if(!StringUtils.isEmpty(dataStr))
{
Gson gson = new Gson();
JsonObject jsonObject = gson.fromJson(dataStr, JsonObject.class);
JsonArray dataList = jsonObject.getAsJsonArray("dataList");

Type listType = new TypeToken<List<Map<String, String>>>(){}.getType();
return gson.fromJson(dataList.toString(), listType);
}
return Collections.emptyList();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package com.webank.wedatasphere.dss.framework.workspace.bean.itsm;

public class ItsmResponse {

private String data;
private int retCode;
private String retDetail;

public String getData() {
return data;
}

public void setData(String data) {
this.data = data;
}

public ItsmResponse data(String data) {
this.data = data;
return this;
}

public int getRetCode() {
return retCode;
}

public void setRetCode(int retCode) {
this.retCode = retCode;
}

public ItsmResponse retCode(int retCode) {
this.retCode = retCode;
return this;
}

public String getRetDetail() {
return retDetail;
}

public void setRetDetail(String retDetail) {
this.retDetail = retDetail;
}

public ItsmResponse retDetail(String retDetail) {
this.retDetail = retDetail;
return this;
}

public static ItsmResponse ok(){
ItsmResponse itsmResponse = new ItsmResponse();
return itsmResponse.retCode(0);
}
public static ItsmResponse error(){
ItsmResponse itsmResponse = new ItsmResponse();
return itsmResponse.retCode(-1);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ public class ApplicationConf {

public static final CommonVars<String> HOMEPAGE_URL =
CommonVars.apply("wds.linkis.special.homepage.module.url", "/newHome?workspaceId=");

public static final CommonVars<String> ITSM_SECRETKEY = CommonVars.apply("wds.dss.itsm.secretkey","350965f1d6dfc38757cba3c34478163176aafcb2ed5ff2478d94a43b40d3ae42");
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,8 @@ public interface DSSComponentRoleMapper extends BaseMapper<DSSComponentRole> {

public void insertBatch(@Param("list") List<DSSWorkspaceComponentPriv> list);

List<DSSWorkspaceComponentPriv> queryDSSComponentRole(@Param("workspaceId") int workspaceId,@Param("updateBy") String updateBy);

void updateDSSComponentRoleById(@Param("list") List<Integer> idList,@Param("updateBy") String updateBy);

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ public interface DSSMenuRoleMapper extends BaseMapper<DSSMenuRole> {

public void insertBatch(@Param("list") List<DSSWorkspaceMenuRole> menuRoles);

List<DSSWorkspaceMenuRole> queryWorkspaceMenuRole(@Param("workspaceId") int workspaceId,@Param("updateBy") String updateBy);

void updateWorkspaceMenuRoleById(@Param("list") List<Integer> idList,@Param("updateBy") String updateBy);

}
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,7 @@ void updateDepartmentsForWorkspace(@Param("workspaceId") Long workspaceId, @Para

@Select("select * from dss_workspace_associate_departments")
List<DSSWorkspaceAssociateDepartments> getWorkspaceAssociateDepartments();


void updateWorkSpace(DSSWorkspace dssWorkspace);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.webank.wedatasphere.dss.framework.workspace.dao.DSSComponentRoleMapper">

<resultMap id="dss_workspace_appconn_role" type="com.webank.wedatasphere.dss.framework.workspace.bean.DSSWorkspaceComponentPriv">
<id property="id" column="id"/>
<id property="workspace_id" column="workspaceId"/>
<id property="appconn_id" column="componentId"/>
<id property="role_id" column="roleId"/>
<id property="priv" column="priv"/>
<id property="update_time" column="updateTime"/>
<id property="updateby" column="updateBy"/>
</resultMap>


<insert id="insertBatch" parameterType="java.util.List">
insert into dss_workspace_appconn_role (workspace_id, appconn_id, role_id,
priv, update_time, updateby)
Expand All @@ -28,4 +39,17 @@
</foreach>
</insert>


<select id="queryDSSComponentRole" resultMap="dss_workspace_appconn_role">
select * from dss_workspace_appconn_role where workspace_id = #{workspaceId} and updateby= #{updateBy}
</select>

<update id="updateDSSComponentRoleById">
update dss_workspace_appconn_role set update_time = now(),updateby=#{updateBy} where id in
<foreach collection="list" index="index" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</update>


</mapper>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.webank.wedatasphere.dss.framework.workspace.dao.DSSMenuRoleMapper">

<resultMap id="dss_workspace_menu_role" type="com.webank.wedatasphere.dss.framework.workspace.bean.DSSWorkspaceMenuRole">
<id property="id" column="id"/>
<id property="workspace_id" column="workspaceId"/>
<id property="menu_id" column="menuId"/>
<id property="role_id" column="roleId"/>
<id property="priv" column="priv"/>
<id property="update_time" column="updateTime"/>
<id property="updateby" column="updateBy"/>
</resultMap>


<insert id="insertBatch" parameterType="java.util.List">
insert into dss_workspace_menu_role (workspace_id,menu_id,role_id,priv, update_time,updateby)
values
Expand All @@ -27,5 +38,15 @@
</foreach>
</insert>

<select id="queryWorkspaceMenuRole" resultMap="dss_workspace_menu_role">
select * from dss_workspace_menu_role where workspace_id = #{workspaceId} and updateby=#{updateBy}
</select>

<update id="updateWorkspaceMenuRoleById">
update dss_workspace_menu_role set update_time = now(),updateby=#{updateBy} where id in
<foreach collection="list" index="index" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</update>

</mapper>
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,8 @@
SELECT * from dss_workspace_menu_role where workspace_id = #{workspaceId}
</select>

<update id="updateWorkSpace" parameterType="com.webank.wedatasphere.dss.framework.workspace.bean.DSSWorkspace">
update dss_workspace set create_by = #{createBy},last_update_time=#{lastUpdateTime},last_update_user=#{lastUpdateUser} where id = #{workspaceId}
</update>

</mapper>
Loading

0 comments on commit 675a515

Please sign in to comment.