Browse Source

报销-报销时间按照孔璐审核通过的时间进行计算调整

徐滕 3 ngày trước cách đây
mục cha
commit
55bb4675f9

+ 10 - 1
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementInfoMapper.xml

@@ -62,7 +62,7 @@
 				  WHEN a.source_type = 4 THEN b4.dept_id
 				  ELSE b5.dept_id END) AS dept_id,
 			a.user_name,
-			a.reim_date,
+			ht_role.end_time AS reim_date,
 			a.type,
 			a.proc_ins_id,
 			a.process_definition_id,
@@ -106,6 +106,15 @@
 
 			LEFT JOIN sys_user c ON a.create_by_id =  c.id
 			left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+			LEFT JOIN (
+				SELECT ht.PROC_INST_ID_, MAX(ht.END_TIME_) AS end_time
+				FROM act_hi_taskinst ht
+				INNER JOIN sys_user u ON ht.ASSIGNEE_ = u.id AND u.del_flag = 0
+				INNER JOIN sys_user_role ur ON u.id = ur.user_id
+				INNER JOIN sys_role r ON ur.role_id = r.id AND r.del_flag = 0
+				WHERE r.name = '综合管理部主任'
+				GROUP BY ht.PROC_INST_ID_
+			) ht_role ON a.proc_ins_id = ht_role.PROC_INST_ID_
 			LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
 -- 			left join material_management_pruchase_request_basics pru on pru.id = a.purchase_id and pru.del_flag = '0'
 			${ew.customSqlSegment}

+ 3 - 2
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/service/ReimbursementInfoService.java

@@ -118,9 +118,10 @@ public class ReimbursementInfoService {
             queryWrapper.or().apply("(b5.project_id = {0} OR b5.project_name LIKE {1}))", dto.getProject(), "%" + dto.getProject() + "%");
 
         }
-        // 报销时间
+        // 报销时间 - 根据综合管理部主任角色审核时间筛选
         if (dto.getDates() != null && dto.getDates().length > 0) {
-            queryWrapper.between("a.approval_time", dto.getDates()[0], dto.getDates()[1]);
+            queryWrapper.apply("ht_role.end_time >= {0}", dto.getDates()[0] + " 00:00:00");
+            queryWrapper.apply("ht_role.end_time <= {0}", dto.getDates()[1] + " 23:59:59");
         }
         // 经办人
         if (StringUtils.isNotEmpty(dto.getHandled())) {

+ 11 - 1
jeeplus-modules/jeeplus-ccpm/src/main/java/com/jeeplus/ccpm/approvalInfo/mapper/xml/CcpmReimbursementInfoMapper.xml

@@ -160,7 +160,7 @@
                                 END
                             )          AS `dept_id`,
                         a.user_name,
-                        a.reim_date,
+                        ht_role.end_time AS reim_date,
                         a.type,
                         a.proc_ins_id,
                         a.process_definition_id,
@@ -217,6 +217,16 @@
             AND us5.del_flag = 0
                  LEFT JOIN sys_user c ON a.create_by_id = c.id
                  LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+
+                 LEFT JOIN (
+            SELECT ht.PROC_INST_ID_, MAX(ht.END_TIME_) AS end_time
+            FROM act_hi_taskinst ht
+                     INNER JOIN sys_user u ON ht.ASSIGNEE_ = u.id AND u.del_flag = 0
+                     INNER JOIN sys_user_role ur ON u.id = ur.user_id
+                     INNER JOIN sys_role r ON ur.role_id = r.id AND r.del_flag = 0
+            WHERE r.name = '综合管理部主任'
+            GROUP BY ht.PROC_INST_ID_
+        ) ht_role ON a.proc_ins_id = ht_role.PROC_INST_ID_
                  LEFT JOIN material_management_pruchase_request_basics pru ON pru.id = a.purchase_id
             AND pru.del_flag = '0'
             ${ew.customSqlSegment}

+ 4 - 9
jeeplus-modules/jeeplus-ccpm/src/main/java/com/jeeplus/ccpm/approvalInfo/service/CcpmReimbursementInfoService.java

@@ -133,15 +133,10 @@ public class CcpmReimbursementInfoService {
             queryWrapper.or().apply("(b5.project_id = {0} OR b5.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
 
         }
-        // 报销时间
-        if (dto.getDates() != null
-                && dto.getDates().length == 2
-                && dto.getDates()[0] != null
-                && dto.getDates()[1] != null
-                && !dto.getDates()[0].toString().isEmpty()
-                && !dto.getDates()[1].toString().isEmpty()) {
-
-            queryWrapper.between("a.reim_date", dto.getDates()[0], dto.getDates()[1]);
+        // 报销时间 - 根据综合管理部主任角色审核时间筛选
+        if (dto.getDates() != null && dto.getDates().length > 0) {
+            queryWrapper.apply("ht_role.end_time >= {0}", dto.getDates()[0] + " 00:00:00");
+            queryWrapper.apply("ht_role.end_time <= {0}", dto.getDates()[1] + " 23:59:59");
         }
         // 报销编号
         if (com.jeeplus.utils.StringUtils.isNotEmpty(dto.getNo())) {

+ 11 - 1
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/mapper/xml/ZsReimbursementInfoMapper.xml

@@ -184,7 +184,7 @@
 					END
 				) AS `dept_id`,
 			a.user_name,
-			a.reim_date,
+			ht_role.end_time AS reim_date,
 			a.type,
 			a.proc_ins_id,
 			a.process_definition_id,
@@ -253,6 +253,16 @@
 				AND us3.del_flag = 0
 				LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
 				LEFT JOIN sys_user c ON a.create_by_id = c.id
+
+				LEFT JOIN (
+				SELECT ht.PROC_INST_ID_, MAX(ht.END_TIME_) AS end_time
+				FROM act_hi_taskinst ht
+						 INNER JOIN sys_user u ON ht.ASSIGNEE_ = u.id AND u.del_flag = 0
+						 INNER JOIN sys_user_role ur ON u.id = ur.user_id
+						 INNER JOIN sys_role r ON ur.role_id = r.id AND r.del_flag = 0
+				WHERE r.name = '综合管理部主任'
+				GROUP BY ht.PROC_INST_ID_
+			) ht_role ON a.proc_ins_id = ht_role.PROC_INST_ID_
 				LEFT JOIN material_management_pruchase_request_basics pru ON pru.id = a.purchase_id
 				AND pru.del_flag = '0'
 			${ew.customSqlSegment}

+ 5 - 9
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/service/ZsReimbursementInfoService.java

@@ -130,15 +130,11 @@ public class ZsReimbursementInfoService {
             queryWrapper.or().apply("(b3.project_id = {0} OR p3.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
             queryWrapper.or().apply("(b4.project_id = {0} OR b4.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
         }
-        // 报销时间
-        if (dto.getDates() != null
-                && dto.getDates().length == 2
-                && dto.getDates()[0] != null
-                && dto.getDates()[1] != null
-                && !dto.getDates()[0].toString().isEmpty()
-                && !dto.getDates()[1].toString().isEmpty()) {
-
-            queryWrapper.between("a.reim_date", dto.getDates()[0], dto.getDates()[1]);
+
+        // 报销时间 - 根据综合管理部主任角色审核时间筛选
+        if (dto.getDates() != null && dto.getDates().length > 0) {
+            queryWrapper.apply("ht_role.end_time >= {0}", dto.getDates()[0] + " 00:00:00");
+            queryWrapper.apply("ht_role.end_time <= {0}", dto.getDates()[1] + " 23:59:59");
         }
         // 报销编号
         if (com.jeeplus.utils.StringUtils.isNotEmpty(dto.getNo())) {

+ 11 - 1
jeeplus-modules/jeeplus-consult/src/main/java/com/jeeplus/consultancy/approvalInfo/mapper/xml/ConsultancyReimbursementInfoMapper.xml

@@ -147,7 +147,7 @@
 							 END
 						 )          AS `dept_id`,
 			a.user_name,
-			a.reim_date,
+			 ht_role.end_time AS reim_date,
 			a.type,
 			a.proc_ins_id,
 			a.process_definition_id,
@@ -205,6 +205,16 @@
 			AND us5.del_flag = 0
 			LEFT JOIN sys_user c ON a.create_by_id = c.id
 			LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+
+			LEFT JOIN (
+				SELECT ht.PROC_INST_ID_, MAX(ht.END_TIME_) AS end_time
+				FROM act_hi_taskinst ht
+						 INNER JOIN sys_user u ON ht.ASSIGNEE_ = u.id AND u.del_flag = 0
+						 INNER JOIN sys_user_role ur ON u.id = ur.user_id
+						 INNER JOIN sys_role r ON ur.role_id = r.id AND r.del_flag = 0
+				WHERE r.name = '综合管理部主任'
+				GROUP BY ht.PROC_INST_ID_
+			) ht_role ON a.proc_ins_id = ht_role.PROC_INST_ID_
 			LEFT JOIN material_management_pruchase_request_basics pru ON pru.id = a.purchase_id
 			AND pru.del_flag = '0'
 			${ew.customSqlSegment}

+ 4 - 9
jeeplus-modules/jeeplus-consult/src/main/java/com/jeeplus/consultancy/approvalInfo/service/ConsultancyReimbursementInfoService.java

@@ -133,15 +133,10 @@ public class ConsultancyReimbursementInfoService {
             queryWrapper.or().apply("(b5.project_id = {0} OR b5.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
 
         }
-        // 报销时间
-        if (dto.getDates() != null
-                && dto.getDates().length == 2
-                && dto.getDates()[0] != null
-                && dto.getDates()[1] != null
-                && !dto.getDates()[0].toString().isEmpty()
-                && !dto.getDates()[1].toString().isEmpty()) {
-
-            queryWrapper.between("a.reim_date", dto.getDates()[0], dto.getDates()[1]);
+        // 报销时间 - 根据综合管理部主任角色审核时间筛选
+        if (dto.getDates() != null && dto.getDates().length > 0) {
+            queryWrapper.apply("ht_role.end_time >= {0}", dto.getDates()[0] + " 00:00:00");
+            queryWrapper.apply("ht_role.end_time <= {0}", dto.getDates()[1] + " 23:59:59");
         }
         // 报销编号
         if (com.jeeplus.utils.StringUtils.isNotEmpty(dto.getNo())) {

+ 2 - 1
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/mapper/xml/CwProjectReportArchiveMapper.xml

@@ -671,7 +671,8 @@
             void_reason = #{voidReason},
         </if>
         update_by_id = #{updateById},
-        update_time = #{updateTime}
+        update_time = #{updateTime},
+        create_by_id = #{updateById}
         where id = #{id} ;
     </update>
     <update id="updateBorrowTypeById">