瀏覽代碼

普通报销和差旅报销在修改时就添加流程描述

chenjun 1 年之前
父節點
當前提交
10ccd7ba5a

+ 22 - 25
zjugis-business/src/main/java/com/zjugis/business/flow/commoncost/service/CommonCostServiceImpl.java

@@ -218,31 +218,6 @@ public class CommonCostServiceImpl implements CommonCostService {
         // 更新
         CommonCostDO updateObj = CommonCostConvert.INSTANCE.convert(updateReqVO);
         commonCostDao.updateById(updateObj);
-        //发生核减后修改流程描述z
-        if(StringUtils.isNotEmpty(updateReqVO.getBz2())){
-            CommonCostDO entity = commonCostDao.selectById(updateReqVO.getId());
-            List<CommonCostDetailDO> detailList = commonCostDetailService.getListByCommonCostId(updateObj.getId());
-            StringBuilder projectName = new StringBuilder();
-            Set<String> projectNameList = new HashSet<>();
-            detailList.forEach(x -> {
-                Project project = projectService.selectById(x.getProjectId());
-                projectNameList.add(project.getXmmc());
-            });
-            projectNameList.forEach(name -> {
-                projectName.append(name);
-                projectName.append(";");
-            });
-            projectName.setLength(projectName.length() - 1);
-            Integer agent = entity.getIsAgent();
-            String applyTime = LocalDateTimeUtils.format(entity.getApplyTime(), null);
-            String flowDesc = "";
-            if (agent == 0) {
-                flowDesc = StringUtils.join(Arrays.asList(entity.getUserNickname(), applyTime, "¥" + entity.getTotalAmount(), projectName), "/");
-            } else {
-                flowDesc = StringUtils.join(Arrays.asList(entity.getUserNickname(), applyTime, "¥" + entity.getTotalAmount()), "/");
-            }
-            workflowClient.saveFlowDescribe(entity.getInstanceId(), flowDesc);
-        }
         if (CollectionUtil.isNotEmpty(updateReqVO.getDetailList())) {
             Set<String> idList = convertSet(commonCostDetailService.getListByCommonCostId(updateObj.getId()), CommonCostDetailDO::getId);
             if (CollectionUtil.isNotEmpty(idList)) {
@@ -255,6 +230,28 @@ public class CommonCostServiceImpl implements CommonCostService {
             });
             commonCostDetailDao.insertBatch(detailDOS);
         }
+        CommonCostDO entity = commonCostDao.selectById(updateReqVO.getId());
+        List<CommonCostDetailDO> detailList = commonCostDetailService.getListByCommonCostId(updateObj.getId());
+        StringBuilder projectName = new StringBuilder();
+        Set<String> projectNameList = new HashSet<>();
+        detailList.forEach(x -> {
+            Project project = projectService.selectById(x.getProjectId());
+            projectNameList.add(project.getXmmc());
+        });
+        projectNameList.forEach(name -> {
+            projectName.append(name);
+            projectName.append(";");
+        });
+        projectName.setLength(projectName.length() - 1);
+        Integer agent = entity.getIsAgent();
+        String applyTime = LocalDateTimeUtils.format(entity.getApplyTime(), null);
+        String flowDesc = "";
+        if (agent == 0) {
+            flowDesc = StringUtils.join(Arrays.asList(entity.getUserNickname(), applyTime, "¥" + entity.getTotalAmount(), projectName), "/");
+        } else {
+            flowDesc = StringUtils.join(Arrays.asList(entity.getUserNickname(), applyTime, "¥" + entity.getTotalAmount()), "/");
+        }
+        workflowClient.saveFlowDescribe(entity.getInstanceId(), flowDesc);
     }
 
     private void validateCommonCostExists(String id) {

+ 5 - 8
zjugis-business/src/main/java/com/zjugis/business/flow/travelcost/service/TravelCostServiceImpl.java

@@ -217,14 +217,6 @@ public class TravelCostServiceImpl implements TravelCostService {
         // 更新
         TravelCostDO updateObj = TravelCostConvert.INSTANCE.convert(updateReqVO);
         travelCostDao.updateById(updateObj);
-        //发生核减后修改流程描述
-        if(StringUtils.isNotEmpty(updateReqVO.getBz2())){
-            TravelCostDO entity = travelCostDao.selectById(updateReqVO.getId());
-            Project project = projectService.selectById(entity.getProjectId());
-            String applyTime = LocalDateTimeUtils.format(entity.getApplyTime(), null);
-            String flowDesc = StringUtils.join(Arrays.asList(entity.getUserNickname(), applyTime, "¥" + entity.getTotalAmount(), project.getXmmc()), "/");
-            workflowClient.saveFlowDescribe(entity.getInstanceId(), flowDesc);
-        }
         if (CollectionUtil.isNotEmpty(updateReqVO.getBoatCarList())) {
             Set<String> idList = convertSet(travelCostBoatCarService.getListByTravelCostId(updateObj.getId()), TravelCostBoatCarDO::getId);
             if (CollectionUtil.isNotEmpty(idList)) {
@@ -247,6 +239,11 @@ public class TravelCostServiceImpl implements TravelCostService {
             });
             travelCostOtherDao.insertBatch(otherList);
         }
+        TravelCostDO entity = travelCostDao.selectById(updateReqVO.getId());
+        Project project = projectService.selectById(entity.getProjectId());
+        String applyTime = LocalDateTimeUtils.format(entity.getApplyTime(), null);
+        String flowDesc = StringUtils.join(Arrays.asList(entity.getUserNickname(), applyTime, "¥" + entity.getTotalAmount(), project.getXmmc()), "/");
+        workflowClient.saveFlowDescribe(entity.getInstanceId(), flowDesc);
     }
 
     private void validateTravelCostExists(String id) {