Browse Source

项目任务查询增加默认按本机构号查询,如果查询的是众包任务,则按全域查询

master
陈裕财 5 years ago
parent
commit
a2a03daab6
  1. 18
      xm-core/src/main/java/com/xm/core/ctrl/XmTaskController.java
  2. 34
      xm-core/src/main/java/com/xm/core/entity/XmTask.java
  3. 16
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml

18
xm-core/src/main/java/com/xm/core/ctrl/XmTaskController.java

@ -107,6 +107,16 @@ public class XmTaskController {
RequestUtils.transformArray(xmTask, "ids"); RequestUtils.transformArray(xmTask, "ids");
RequestUtils.transformArray(xmTask, "skillIds"); RequestUtils.transformArray(xmTask, "skillIds");
PageUtils.startPage(xmTask); PageUtils.startPage(xmTask);
String taskOut= (String) xmTask.get("taskOut");
if(!"1".equals(taskOut)){
String projectId= (String) xmTask.get("projectId");
String projectPhaseId= (String) xmTask.get("projectPhaseId");
String userid= (String) xmTask.get("userid");
if( !(StringUtils.hasText(projectId) || StringUtils.hasText(projectPhaseId)|| StringUtils.hasText(userid) ) ){
User user = LoginUtils.getCurrentUserInfo();
xmTask.put("cbranchId",user.getBranchId());
}
}
List<Map<String,Object>> xmTaskVoList = xmTaskService.getTask(xmTask); //列出XmTask列表 List<Map<String,Object>> xmTaskVoList = xmTaskService.getTask(xmTask); //列出XmTask列表
PageUtils.responePage(m,xmTaskVoList); PageUtils.responePage(m,xmTaskVoList);
m.put("data",xmTaskVoList); m.put("data",xmTaskVoList);
@ -254,10 +264,16 @@ public class XmTaskController {
Map<String,Object> m = new HashMap<>(); Map<String,Object> m = new HashMap<>();
RequestUtils.transformArray(xmTask, "ids"); RequestUtils.transformArray(xmTask, "ids");
PageUtils.startPage(xmTask); PageUtils.startPage(xmTask);
String taskOut= (String) xmTask.get("taskOut"); String taskOut= (String) xmTask.get("taskOut");
if(!"1".equals(taskOut)){ if(!"1".equals(taskOut)){
String projectId= (String) xmTask.get("projectId");
String projectPhaseId= (String) xmTask.get("projectPhaseId");
String userid= (String) xmTask.get("userid");
if( !(StringUtils.hasText(projectId) || StringUtils.hasText(projectPhaseId)|| StringUtils.hasText(userid) ) ){
User user = LoginUtils.getCurrentUserInfo(); User user = LoginUtils.getCurrentUserInfo();
xmTask.put("branchId",user.getBranchId());
xmTask.put("cbranchId",user.getBranchId());
}
} }
List<Map<String,Object>> xmTaskList = xmTaskService.selectListMapByWhere(xmTask); //列出XmTask列表 List<Map<String,Object>> xmTaskList = xmTaskService.selectListMapByWhere(xmTask); //列出XmTask列表
PageUtils.responePage(m, xmTaskList); PageUtils.responePage(m, xmTaskList);

34
xm-core/src/main/java/com/xm/core/entity/XmTask.java

@ -8,9 +8,9 @@ import java.math.BigDecimal;
/** /**
* 组织 com 顶级模块 xm 大模块 core 小模块 <br> * 组织 com 顶级模块 xm 大模块 core 小模块 <br>
* 实体 XmTask所有属性名: <br> * 实体 XmTask所有属性名: <br>
* id,name,parentTaskid,parentTaskname,projectId,projectName,level,sortLevel,executorUserid,executorUsername,preTaskid,preTaskname,startTime,endTime,milestone,description,remarks,createUserid,createUsername,createTime,rate,budgetCost,budgetWorkload,actCost,actWorkload,taskState,taskType,taskClass,toTaskCenter,actStartTime,actEndTime,bizProcInstId,bizFlowState,projectPhaseId,projectPhaseName,taskSkillNames,exeUsernames,taskSkillIds,exeUserids,taskOut,planType,settleSchemel,menuId,menuName,iterationId,iterationName,productId,productName;<br>
* id,name,parentTaskid,parentTaskname,projectId,projectName,level,sortLevel,executorUserid,executorUsername,preTaskid,preTaskname,startTime,endTime,milestone,description,remarks,createUserid,createUsername,createTime,rate,budgetCost,budgetWorkload,actCost,actWorkload,taskState,taskType,taskClass,toTaskCenter,actStartTime,actEndTime,bizProcInstId,bizFlowState,projectPhaseId,projectPhaseName,taskSkillNames,exeUsernames,taskSkillIds,exeUserids,taskOut,planType,settleSchemel,menuId,menuName,iterationId,iterationName,productId,productName,cbranchId,cdeptid;<br>
* XM.xm_task xm_task的所有字段名: <br> * XM.xm_task xm_task的所有字段名: <br>
* id,name,parent_taskid,parent_taskname,project_id,project_name,level,sort_level,executor_userid,executor_username,pre_taskid,pre_taskname,start_time,end_time,milestone,description,remarks,create_userid,create_username,create_time,rate,budget_cost,budget_workload,act_cost,act_workload,task_state,task_type,task_class,to_task_center,act_start_time,act_end_time,biz_proc_inst_id,biz_flow_state,project_phase_id,project_phase_name,task_skill_names,exe_usernames,task_skill_ids,exe_userids,task_out,plan_type,settle_schemel,menu_id,menu_name,iteration_id,iteration_name,product_id,product_name;<br>
* id,name,parent_taskid,parent_taskname,project_id,project_name,level,sort_level,executor_userid,executor_username,pre_taskid,pre_taskname,start_time,end_time,milestone,description,remarks,create_userid,create_username,create_time,rate,budget_cost,budget_workload,act_cost,act_workload,task_state,task_type,task_class,to_task_center,act_start_time,act_end_time,biz_proc_inst_id,biz_flow_state,project_phase_id,project_phase_name,task_skill_names,exe_usernames,task_skill_ids,exe_userids,task_out,plan_type,settle_schemel,menu_id,menu_name,iteration_id,iteration_name,product_id,product_name,cbranch_id,cdeptid;<br>
* 当前主键(包括多主键):<br> * 当前主键(包括多主键):<br>
* id;<br> * id;<br>
*/ */
@ -164,6 +164,12 @@ public class XmTask implements java.io.Serializable {
@ApiModelProperty(notes="产品名称",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="产品名称",allowEmptyValue=true,example="",allowableValues="")
String productName; String productName;
@ApiModelProperty(notes="创建机构",allowEmptyValue=true,example="",allowableValues="")
String cbranchId;
@ApiModelProperty(notes="创建部门",allowEmptyValue=true,example="",allowableValues="")
String cdeptid;
/**任务编号**/ /**任务编号**/
public XmTask(String id) { public XmTask(String id) {
this.id = id; this.id = id;
@ -461,6 +467,18 @@ public class XmTask implements java.io.Serializable {
public void setProductName(String productName) { public void setProductName(String productName) {
this.productName = productName; this.productName = productName;
} }
/**
* 创建机构
**/
public void setCbranchId(String cbranchId) {
this.cbranchId = cbranchId;
}
/**
* 创建部门
**/
public void setCdeptid(String cdeptid) {
this.cdeptid = cdeptid;
}
/** /**
* 任务编号 * 任务编号
@ -750,5 +768,17 @@ public class XmTask implements java.io.Serializable {
public String getProductName() { public String getProductName() {
return this.productName; return this.productName;
} }
/**
* 创建机构
**/
public String getCbranchId() {
return this.cbranchId;
}
/**
* 创建部门
**/
public String getCdeptid() {
return this.cdeptid;
}
} }

16
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml

@ -181,7 +181,7 @@
insert into XM.xm_task( insert into XM.xm_task(
<include refid="columns"/> <include refid="columns"/>
) values ( ) values (
#{id},#{name},#{parentTaskid},#{parentTaskname},#{projectId},#{projectName},#{level},#{sortLevel},#{executorUserid},#{executorUsername},#{preTaskid},#{preTaskname},#{startTime},#{endTime},#{milestone},#{description},#{remarks},#{createUserid},#{createUsername},#{createTime},#{rate},#{budgetCost},#{budgetWorkload},#{actCost},#{actWorkload},#{taskState},#{taskType},#{taskClass},#{toTaskCenter},#{actStartTime},#{actEndTime},#{bizProcInstId},#{bizFlowState},#{projectPhaseId},#{projectPhaseName},#{taskSkillNames},#{exeUsernames},#{taskSkillIds},#{exeUserids},#{taskOut},#{planType},#{settleSchemel},#{menuId},#{menuName},#{iterationId},#{iterationName},#{productId},#{productName}
#{id},#{name},#{parentTaskid},#{parentTaskname},#{projectId},#{projectName},#{level},#{sortLevel},#{executorUserid},#{executorUsername},#{preTaskid},#{preTaskname},#{startTime},#{endTime},#{milestone},#{description},#{remarks},#{createUserid},#{createUsername},#{createTime},#{rate},#{budgetCost},#{budgetWorkload},#{actCost},#{actWorkload},#{taskState},#{taskType},#{taskClass},#{toTaskCenter},#{actStartTime},#{actEndTime},#{bizProcInstId},#{bizFlowState},#{projectPhaseId},#{projectPhaseName},#{taskSkillNames},#{exeUsernames},#{taskSkillIds},#{exeUserids},#{taskOut},#{planType},#{settleSchemel},#{menuId},#{menuName},#{iterationId},#{iterationName},#{productId},#{productName},#{cbranchId},#{cdeptid}
) )
</insert> </insert>
@ -246,7 +246,7 @@
<!--sql片段 列--> <!--sql片段 列-->
<sql id="columns"> <sql id="columns">
id,name,parent_taskid,parent_taskname,project_id,project_name,level,sort_level,executor_userid,executor_username,pre_taskid,pre_taskname,start_time,end_time,milestone,description,remarks,create_userid,create_username,create_time,rate,budget_cost,budget_workload,act_cost,act_workload,task_state,task_type,task_class,to_task_center,act_start_time,act_end_time,biz_proc_inst_id,biz_flow_state,project_phase_id,project_phase_name,task_skill_names,exe_usernames,task_skill_ids,exe_userids,task_out,plan_type,settle_schemel,menu_id,menu_name,iteration_id,iteration_name,product_id,product_name
id,name,parent_taskid,parent_taskname,project_id,project_name,level,sort_level,executor_userid,executor_username,pre_taskid,pre_taskname,start_time,end_time,milestone,description,remarks,create_userid,create_username,create_time,rate,budget_cost,budget_workload,act_cost,act_workload,task_state,task_type,task_class,to_task_center,act_start_time,act_end_time,biz_proc_inst_id,biz_flow_state,project_phase_id,project_phase_name,task_skill_names,exe_usernames,task_skill_ids,exe_userids,task_out,plan_type,settle_schemel,menu_id,menu_name,iteration_id,iteration_name,product_id,product_name,cbranch_id,cdeptid
</sql> </sql>
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> <!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS-->
@ -299,6 +299,8 @@
<if test="iterationName != null and iterationName != ''"> and res.iteration_name = #{iterationName} </if> <if test="iterationName != null and iterationName != ''"> and res.iteration_name = #{iterationName} </if>
<if test="productId != null and productId != ''"> and res.product_id = #{productId} </if> <if test="productId != null and productId != ''"> and res.product_id = #{productId} </if>
<if test="productName != null and productName != ''"> and res.product_name = #{productName} </if> <if test="productName != null and productName != ''"> and res.product_name = #{productName} </if>
<if test="cbranchId != null and cbranchId != ''"> and res.cbranch_id = #{cbranchId} </if>
<if test="cdeptid != null and cdeptid != ''"> and res.cdeptid = #{cdeptid} </if>
</sql> </sql>
<!--sql片段 更新字段 --> <!--sql片段 更新字段 -->
<sql id="set"> <sql id="set">
@ -348,7 +350,9 @@
iteration_id = #{iterationId}, iteration_id = #{iterationId},
iteration_name = #{iterationName}, iteration_name = #{iterationName},
product_id = #{productId}, product_id = #{productId},
product_name = #{productName}
product_name = #{productName},
cbranch_id = #{cbranchId},
cdeptid = #{cdeptid}
</sql> </sql>
<sql id="someFieldSet"> <sql id="someFieldSet">
<if test="name != null and name != ''"> name = #{name}, </if> <if test="name != null and name != ''"> name = #{name}, </if>
@ -398,6 +402,8 @@
<if test="iterationName != null and iterationName != ''"> iteration_name = #{iterationName}, </if> <if test="iterationName != null and iterationName != ''"> iteration_name = #{iterationName}, </if>
<if test="productId != null and productId != ''"> product_id = #{productId}, </if> <if test="productId != null and productId != ''"> product_id = #{productId}, </if>
<if test="productName != null and productName != ''"> product_name = #{productName}, </if> <if test="productName != null and productName != ''"> product_name = #{productName}, </if>
<if test="cbranchId != null and cbranchId != ''"> cbranch_id = #{cbranchId}, </if>
<if test="cdeptid != null and cdeptid != ''"> cdeptid = #{cdeptid}, </if>
</sql> </sql>
<!--sql片段 批量更新 --> <!--sql片段 批量更新 -->
<sql id="batchSet"> <sql id="batchSet">
@ -447,6 +453,8 @@
iteration_id = #{item.iterationId}, iteration_id = #{item.iterationId},
iteration_name = #{item.iterationName}, iteration_name = #{item.iterationName},
product_id = #{item.productId}, product_id = #{item.productId},
product_name = #{item.productName}
product_name = #{item.productName},
cbranch_id = #{item.cbranchId},
cdeptid = #{item.cdeptid}
</sql> </sql>
</mapper> </mapper>
Loading…
Cancel
Save