From 7f1f32289f3a746bf14b4fa853345f8e65cd3b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Sat, 17 Jul 2021 15:17:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8C=89=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E3=80=81=E8=BF=AD=E4=BB=A3=E3=80=81=E4=BA=A7=E5=93=81=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=A1=B9=E7=9B=AE=E3=80=81=E8=BF=AD=E4=BB=A3=E3=80=81?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E3=80=81=E4=BB=BB=E5=8A=A1=E3=80=81=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E3=80=81=E7=BC=BA=E9=99=B7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/service/XmTaskExecuserService.java | 11 ++++++++- .../mapper/xm/core/dao/XmIterationMapper.xml | 5 ++++ .../mapper/xm/core/dao/XmMenuMapper.xml | 24 ++++++++++++++----- .../mapper/xm/core/dao/XmProductMapper.xml | 3 +++ .../mapper/xm/core/dao/XmProjectMapper.xml | 11 ++++++++- .../mapper/xm/core/dao/XmTaskMapper.xml | 3 +++ 6 files changed, 49 insertions(+), 8 deletions(-) diff --git a/xm-core/src/main/java/com/xm/core/service/XmTaskExecuserService.java b/xm-core/src/main/java/com/xm/core/service/XmTaskExecuserService.java index c8c3b5f5..d2ceff7a 100644 --- a/xm-core/src/main/java/com/xm/core/service/XmTaskExecuserService.java +++ b/xm-core/src/main/java/com/xm/core/service/XmTaskExecuserService.java @@ -502,7 +502,6 @@ public class XmTaskExecuserService extends BaseService { super.deleteByPk(xmTaskExecuser); this.updateXmTaskExeUseridsAndUsernamesByTaskId(xmTaskExecuser.getTaskId()); } - /** * 将执行人编号,姓名同步到task中的exe_userids,exe_usernames两个字段 * @param taskId @@ -510,6 +509,16 @@ public class XmTaskExecuserService extends BaseService { public void updateXmTaskExeUseridsAndUsernamesByTaskId(String taskId) { this.update("updateXmTaskExeUseridsAndUsernamesByTaskId", taskId); } + /** + * 将执行人编号,姓名同步到task中的exe_userids,exe_usernames两个字段 + * @param taskId + */ + public void updateXmTaskExeUseridsAndUsernamesAndTaskStateByTaskId(String taskId,String targetTaskState) { + Map task=new HashMap<>(); + task.put("targetTaskState",targetTaskState); + task.put("taskId",taskId); + this.update("updateXmTaskExeUseridsAndUsernamesAndTaskStateByTaskId", task); + } public void updateFlowStateByProcInst(String flowState,Map flowVars) { flowVars.put("flowState", flowState); diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationMapper.xml index 23afc190..f1e823d6 100644 --- a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationMapper.xml +++ b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationMapper.xml @@ -30,6 +30,11 @@ and im.menu_id=#{menuId} ) + + and exists( select 1 from XM.xm_task t inner join xm_iteration_menu im on t.menu_id=im.menu_id + where t.project_id=#{projectId} and im.iteration_id =res.id + ) + and ( res.admin_userid=#{compete} or exists (select 1 from XM.xm_iteration_menu im left join xm.xm_menu m on im.product_id=m.product_id where m.mm_userid=#{compete} and im.iteration_id=res.id) diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMenuMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMenuMapper.xml index 46acbad6..12ea5af3 100644 --- a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMenuMapper.xml +++ b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMenuMapper.xml @@ -28,15 +28,22 @@ - - and not - exists ( select 1 from XM.xm_iteration_menu im where im.menu_id=res.menu_id) + + and exists ( select 1 from XM.xm_iteration_menu im where im.menu_id=res.menu_id + and im.iteration_id=#{iterationId} + ) + + + and not exists ( select 1 from XM.xm_iteration_menu im where im.menu_id=res.menu_id) and not exists ( select 1 from XM.xm_task t where t.menu_id=res.menu_id) + + and exists ( select 1 from XM.xm_task t where t.menu_id =res.id and t.project_id=#{projectId}) + and ( exists ( select 1 from XM.xm_menu m1 where m.mm_userid=#{compete} and m.product_id=res.product_id) or exists ( select 1 from xm_product p where p.pm_userid=#{compete} and res.product_id=p.id) @@ -57,14 +64,19 @@ and plan.project_id=#{projectId} - - and not - exists ( select 1 from XM.xm_iteration_menu im where im.menu_id=res.menu_id) + + and exists ( select 1 from XM.xm_iteration_menu im where im.menu_id=res.menu_id + and im.iteration_id=#{iterationId} + ) + + + and not exists ( select 1 from XM.xm_iteration_menu im where im.menu_id=res.menu_id) and not exists ( select 1 from XM.xm_task t where t.menu_id=res.menu_id) + and ( exists ( select 1 from XM.xm_menu m1 where m.mm_userid=#{compete} and m.product_id=res.product_id) or exists ( select 1 from xm_product p where p.pm_userid=#{compete} and res.product_id=p.id) diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml index cbaf1880..d87472ca 100644 --- a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml +++ b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml @@ -23,6 +23,9 @@ or exists ( select 1 from xm_menu m where m.mm_userid=#{compete} and m.product_id=res.id) ) + + and exists( select 1 from xm_iteration_menu im where im.product_id =res.id ) + and res.product_name like #{key} diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectMapper.xml index 99d82ac3..8fa86b9d 100644 --- a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectMapper.xml +++ b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectMapper.xml @@ -118,8 +118,17 @@ and exists ( select 1 from XM.xm_my_focus f where f.userid=#{userid} and f.project_id=res.id ) - and exists ( select 1 from XM.xm_task t left join XM.xm_menu m on t.menu_id=m.menu_id and m.product_id=#{productId} where m.product_id=#{productId} and t.project_id=res.id) + + and exists ( select 1 from XM.xm_task t left join XM.xm_menu m on t.menu_id=m.menu_id and m.product_id=#{productId} + where m.product_id=#{productId} and t.project_id=res.id + ) + + + and exists( select 1 from XM.xm_task t inner join xm_iteration_menu im on t.menu_id=im.menu_id + where t.project_id=res.id and im.iteration_id =#{iterationId} + ) + and res.name like #{key} diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml index c3789daf..2cef73b5 100644 --- a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml +++ b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml @@ -151,6 +151,9 @@ ) + + and exists ( select 1 from xm_iteration_menu im where im.menu_id=res.menu_id and im.iteration_id=#{iterationId}) + and res.name like #{key} and res.rate != '100'