Browse Source

添加节点类型、标签等

master
陈裕财 4 years ago
parent
commit
0b4d3c6f95
  1. 3
      xm-core/src/main/java/com/xm/core/ctrl/XmProjectGroupController.java
  2. 33
      xm-core/src/main/java/com/xm/core/entity/XmQuestion.java
  3. 1
      xm-core/src/main/java/com/xm/core/service/XmProjectGroupService.java
  4. 87
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmQuestionMapper.xml

3
xm-core/src/main/java/com/xm/core/ctrl/XmProjectGroupController.java

@ -270,6 +270,9 @@ public class XmProjectGroupController {
return m;
}
}
if(StringUtils.hasText(xmProjectGroup.getBranchId())){
xmProjectGroup.setBranchId(u.getBranchId());
}
this.xmProjectGroupService.parentIdPathsCalcBeforeSave(xmProjectGroup);
xmProjectGroupService.insert(xmProjectGroup);
if("1".equals(xmProjectGroup.getPgClass())){

33
xm-core/src/main/java/com/xm/core/entity/XmQuestion.java

@ -8,9 +8,9 @@ import java.math.BigDecimal;
/**
* 组织 com 顶级模块 xm 大模块 core 小模块 <br>
* 实体 XmQuestion所有属性名: <br>
* id,name,projectId,projectName,caseId,caseName,endTime,askUserid,askUsername,handlerUserid,handlerUsername,priority,solution,description,createUserid,createUsername,createTime,bugStatus,bizProcInstId,bizFlowState,menuId,menuName,planWorkload,planCostAmount,totalActWorkload,totalActCostAmount,expectResult,opStep,currResult,refRequire,bugSeverity,bugType,tagIds,tagNames,urls,ltime,qtype,taskId,taskName,iterationId,iterationName,caseExecId,lremark;<br>
* XM.xm_question xm_question的所有字段名: <br>
* id,name,project_id,project_name,case_id,case_name,end_time,ask_userid,ask_username,handler_userid,handler_username,priority,solution,description,create_userid,create_username,create_time,bug_status,biz_proc_inst_id,biz_flow_state,menu_id,menu_name,plan_workload,plan_cost_amount,total_act_workload,total_act_cost_amount,expect_result,op_step,curr_result,ref_require,bug_severity,bug_type,tag_ids,tag_names,urls,ltime,qtype,task_id,task_name,iteration_id,iteration_name,case_exec_id,lremark;<br>
* id,name,projectId,projectName,caseId,caseName,endTime,askUserid,askUsername,handlerUserid,handlerUsername,priority,solution,description,createUserid,createUsername,createTime,bugStatus,bizProcInstId,bizFlowState,menuId,menuName,planWorkload,planCostAmount,totalActWorkload,totalActCostAmount,expectResult,opStep,currResult,refRequire,bugSeverity,bugType,tagIds,tagNames,urls,ltime,qtype,taskId,taskName,iterationId,iterationName,caseExecId,lremark,productId;<br>
* xm_question xm_question的所有字段名: <br>
* id,name,project_id,project_name,case_id,case_name,end_time,ask_userid,ask_username,handler_userid,handler_username,priority,solution,description,create_userid,create_username,create_time,bug_status,biz_proc_inst_id,biz_flow_state,menu_id,menu_name,plan_workload,plan_cost_amount,total_act_workload,total_act_cost_amount,expect_result,op_step,curr_result,ref_require,bug_severity,bug_type,tag_ids,tag_names,urls,ltime,qtype,task_id,task_name,iteration_id,iteration_name,case_exec_id,lremark,product_id;<br>
* 当前主键(包括多主键):<br>
* id;<br>
*/
@ -80,10 +80,10 @@ public class XmQuestion implements java.io.Serializable {
@ApiModelProperty(notes="当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除",allowEmptyValue=true,example="",allowableValues="")
String bizFlowState;
@ApiModelProperty(notes="需求编号",allowEmptyValue=true,example="",allowableValues="")
@ApiModelProperty(notes="故事编号",allowEmptyValue=true,example="",allowableValues="")
String menuId;
@ApiModelProperty(notes="需求名称",allowEmptyValue=true,example="",allowableValues="")
@ApiModelProperty(notes="故事名称",allowEmptyValue=true,example="",allowableValues="")
String menuName;
@ApiModelProperty(notes="预估工时单位人时",allowEmptyValue=true,example="",allowableValues="")
@ -149,6 +149,9 @@ public class XmQuestion implements java.io.Serializable {
@ApiModelProperty(notes="最后更新说明",allowEmptyValue=true,example="",allowableValues="")
String lremark;
@ApiModelProperty(notes="产品编号",allowEmptyValue=true,example="",allowableValues="")
String productId;
/**问题编号**/
public XmQuestion(String id) {
this.id = id;
@ -279,13 +282,13 @@ public class XmQuestion implements java.io.Serializable {
this.bizFlowState = bizFlowState;
}
/**
* 需求编号
* 故事编号
**/
public void setMenuId(String menuId) {
this.menuId = menuId;
}
/**
* 需求名称
* 故事名称
**/
public void setMenuName(String menuName) {
this.menuName = menuName;
@ -416,6 +419,12 @@ public class XmQuestion implements java.io.Serializable {
public void setLremark(String lremark) {
this.lremark = lremark;
}
/**
* 产品编号
**/
public void setProductId(String productId) {
this.productId = productId;
}
/**
* 问题编号
@ -538,13 +547,13 @@ public class XmQuestion implements java.io.Serializable {
return this.bizFlowState;
}
/**
* 需求编号
* 故事编号
**/
public String getMenuId() {
return this.menuId;
}
/**
* 需求名称
* 故事名称
**/
public String getMenuName() {
return this.menuName;
@ -675,5 +684,11 @@ public class XmQuestion implements java.io.Serializable {
public String getLremark() {
return this.lremark;
}
/**
* 产品编号
**/
public String getProductId() {
return this.productId;
}
}

1
xm-core/src/main/java/com/xm/core/service/XmProjectGroupService.java

@ -738,6 +738,7 @@ public class XmProjectGroupService extends BaseService {
Tips tips = new Tips("成功");
if (!StringUtils.hasText(currNode.getPgroupId()) || "0".equals(currNode.getPgroupId())) {
currNode.setPidPaths("0," + currNode.getId() + ",");
currNode.setLvl(1);
return tips;
} else {
List<XmProjectGroup> parentList=this.getParentList(currNode);

87
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmQuestionMapper.xml

@ -3,11 +3,37 @@
<mapper namespace="com.xm.core.entity.XmQuestion">
<!--开始 自定sql函数区域 -->
<!--请在此区域添加自定义函数-->
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 -->
<sql id="whereForMap">
<if test=" ids != null"> and (res.id) in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
( #{item})
</foreach>
</if>
<if test=" tagIdList != null"> and
<foreach collection="tagIdList" item="item" index="index" open="(" separator=" or " close=")" >
find_in_set(#{item},res.tag_ids)
</foreach>
</if>
<if test="hisHandlerUserid !=null "> and exists (select 1 from xm_question_handle h where h.question_id = res.id and h.handler_userid=#{hisHandlerUserid} and handle_status=#{hisHandleStatus})</if>
<if test=" createTimeStart !=null "> and res.create_time between #{createTimeStart} and #{createTimeEnd} </if>
<if test=" ltimeStart !=null "> and res.ltime between #{ltimeStart} and #{ltimeEnd} </if>
<include refid="where"/>
<if test=" productId !=null and productId!='' "> and exists( select 1 from xm_menu m where m.menu_id=res.menu_id and m.product_id=#{productId}) </if>
<if test="myUserid != null and myUserid != ''"> and ( res.create_userid=#{myUserid} or res.handler_userid=#{myUserid}) </if>
<if test="menuIds != null"> and
res.menu_id in
<foreach collection="menuIds" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
<if test="compete !=null and compete!=''">
and exists ( select 1 from xm_project_group_user gu where gu.userid=#{compete} and gu.project_id=res.project_id )
</if>
<if test="key != null and key !='' "> and res.name like #{key} </if>
<if test="work != null and work != ''"> and res.status != 'resolved' </if>
</sql>
<!-- 插入流程审批表数据 -->
<insert id="insertProcessApprova"
parameterType="HashMap"
@ -58,37 +84,10 @@
<!-- 通过条件查询获取数据列表 返回list<map> -->
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap">
select res.*,pa.proc_inst_id,pa.assignee,pa.assignee_name,pa.main_title,pa.flow_branch_id,pa.task_name,pa.agree,pa.flow_last_time,pa.comment_msg,pa.proc_def_id,pa.flow_state from xm_question res left join xm_question_process_approva pa on res.id=pa.question_id and res.biz_proc_inst_id=pa.proc_inst_id
select * from xm_question res
<where>
<if test="ids != null"> and
id in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
<if test=" tagIdList != null"> and
<foreach collection="tagIdList" item="item" index="index" open="(" separator=" or " close=")" >
find_in_set(#{item},res.tag_ids)
</foreach>
</if>
<if test="hisHandlerUserid !=null "> and exists (select 1 from xm_question_handle h where h.question_id = res.id and h.handler_userid=#{hisHandlerUserid} and handle_status=#{hisHandleStatus})</if>
<if test=" createTimeStart !=null "> and res.create_time between #{createTimeStart} and #{createTimeEnd} </if>
<if test=" ltimeStart !=null "> and res.ltime between #{ltimeStart} and #{ltimeEnd} </if>
<include refid="whereForMap"/>
<include refid="where"/>
<if test=" productId !=null and productId!='' "> and exists( select 1 from xm_menu m where m.menu_id=res.menu_id and m.product_id=#{productId}) </if>
<if test="myUserid != null and myUserid != ''"> and ( res.create_userid=#{myUserid} or res.handler_userid=#{myUserid}) </if>
<if test="menuIds != null"> and
res.menu_id in
<foreach collection="menuIds" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
<if test="compete !=null and compete!=''">
and exists ( select 1 from xm_project_group_user gu where gu.userid=#{compete} and gu.project_id=res.project_id )
</if>
<if test="key != null and key !='' "> and res.name like #{key} </if>
<if test="work != null and work != ''"> and res.status != 'resolved' </if>
</where>
</select>
@ -125,15 +124,15 @@
insert into xm_question(
<include refid="columns"/>
) values (
#{id},#{name},#{projectId},#{projectName},#{caseId},#{caseName},#{endTime},#{askUserid},#{askUsername},#{handlerUserid},#{handlerUsername},#{priority},#{solution},#{description},#{createUserid},#{createUsername},#{createTime},#{bugStatus},#{bizProcInstId},#{bizFlowState},#{menuId},#{menuName},#{planWorkload},#{planCostAmount},#{totalActWorkload},#{totalActCostAmount},#{expectResult},#{opStep},#{currResult},#{refRequire},#{bugSeverity},#{bugType},#{tagIds},#{tagNames},#{urls},#{ltime},#{qtype},#{taskId},#{taskName},#{iterationId},#{iterationName},#{caseExecId},#{lremark}
#{id},#{name},#{projectId},#{projectName},#{caseId},#{caseName},#{endTime},#{askUserid},#{askUsername},#{handlerUserid},#{handlerUsername},#{priority},#{solution},#{description},#{createUserid},#{createUsername},#{createTime},#{bugStatus},#{bizProcInstId},#{bizFlowState},#{menuId},#{menuName},#{planWorkload},#{planCostAmount},#{totalActWorkload},#{totalActCostAmount},#{expectResult},#{opStep},#{currResult},#{refRequire},#{bugSeverity},#{bugType},#{tagIds},#{tagNames},#{urls},#{ltime},#{qtype},#{taskId},#{taskName},#{iterationId},#{iterationName},#{caseExecId},#{lremark},#{productId}
)
</insert>
<!-- 按条件删除若干条记录-->
<delete id="deleteByWhere" parameterType="com.xm.core.entity.XmQuestion">
delete from xm_question
delete from xm_question res
<where>
1=2
<include refid="where"/>
</where>
</delete>
@ -179,18 +178,16 @@
<delete id="batchDelete" parameterType="List">
delete from xm_question
where
(id)
in
(id) in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
( #{item.id}
)
( #{item.id} )
</foreach>
</delete>
<!--sql片段 列-->
<sql id="columns">
id,name,project_id,project_name,case_id,case_name,end_time,ask_userid,ask_username,handler_userid,handler_username,priority,solution,description,create_userid,create_username,create_time,bug_status,biz_proc_inst_id,biz_flow_state,menu_id,menu_name,plan_workload,plan_cost_amount,total_act_workload,total_act_cost_amount,expect_result,op_step,curr_result,ref_require,bug_severity,bug_type,tag_ids,tag_names,urls,ltime,qtype,task_id,task_name,iteration_id,iteration_name,case_exec_id,lremark
id,name,project_id,project_name,case_id,case_name,end_time,ask_userid,ask_username,handler_userid,handler_username,priority,solution,description,create_userid,create_username,create_time,bug_status,biz_proc_inst_id,biz_flow_state,menu_id,menu_name,plan_workload,plan_cost_amount,total_act_workload,total_act_cost_amount,expect_result,op_step,curr_result,ref_require,bug_severity,bug_type,tag_ids,tag_names,urls,ltime,qtype,task_id,task_name,iteration_id,iteration_name,case_exec_id,lremark,product_id
</sql>
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS-->
@ -238,6 +235,7 @@
<if test="iterationName != null and iterationName != ''"> and res.iteration_name = #{iterationName} </if>
<if test="caseExecId != null and caseExecId != ''"> and res.case_exec_id = #{caseExecId} </if>
<if test="lremark != null and lremark != ''"> and res.lremark = #{lremark} </if>
<if test="productId != null and productId != ''"> and res.product_id = #{productId} </if>
</sql>
<!--sql片段 更新字段 -->
<sql id="set">
@ -282,7 +280,8 @@
iteration_id = #{iterationId},
iteration_name = #{iterationName},
case_exec_id = #{caseExecId},
lremark = #{lremark}
lremark = #{lremark},
product_id = #{productId}
</sql>
<sql id="someFieldSet">
<if test="name != null and name != ''"> name = #{name}, </if>
@ -327,6 +326,7 @@
<if test="iterationName != null and iterationName != ''"> iteration_name = #{iterationName}, </if>
<if test="caseExecId != null and caseExecId != ''"> case_exec_id = #{caseExecId}, </if>
<if test="lremark != null and lremark != ''"> lremark = #{lremark}, </if>
<if test="productId != null and productId != ''"> product_id = #{productId}, </if>
</sql>
<!--sql片段 批量更新 -->
<sql id="batchSet">
@ -371,6 +371,7 @@
iteration_id = #{item.iterationId},
iteration_name = #{item.iterationName},
case_exec_id = #{item.caseExecId},
lremark = #{item.lremark}
lremark = #{item.lremark},
product_id = #{item.productId}
</sql>
</mapper>
Loading…
Cancel
Save