Forráskód Böngészése

Merge branch 'master' of http://114.55.67.98:8070/Natural_p1/zjugis_OA

songxy 1 éve
szülő
commit
fa81c5663d

+ 30 - 5
zjugis-business/src/main/java/com/zjugis/business/flow/commoncost/event/CommonCostEvent.java

@@ -143,7 +143,7 @@ public class CommonCostEvent extends BaseController {
                 entity.setFlowFinishtime(LocalDateTime.now());
                 commonCostService.updateCommonCost(CommonCostConvert.INSTANCE.convert(entity));
                 //如果是代办,更新一下固定资产和外购存货的状态
-                if (entity.getIsAgent()==1) {
+                if (entity.getIsAgent() == 1) {
                     AssetProcureDO asset = new AssetProcureDO();
                     asset.setCommonCostId(flowInstanceId);
                     asset.setCommonCostStatus(FLOW_FINISHED);
@@ -155,7 +155,7 @@ public class CommonCostEvent extends BaseController {
                 }
                 List<CommonCostDetailDO> detailList = commonCostDetailService.getListByCommonCostId(entity.getId());
                 for (CommonCostDetailDO commonCostDetailDO : detailList) {
-                    projectCostService.updateCommonCost(commonCostDetailDO.getAmount(),commonCostDetailDO.getProjectId());
+                    projectCostService.updateCommonCost(commonCostDetailDO.getAmount(), commonCostDetailDO.getProjectId());
                     projectService.calcProject(commonCostDetailDO.getProjectId());
                     commonCostDetailDO.setFlowStatus(FLOW_FINISHED);
                     commonCostDetailService.updateCommonCostDetail(commonCostDetailDO);
@@ -187,7 +187,7 @@ public class CommonCostEvent extends BaseController {
                 entity.setFlowStatus(FLOW_NULLY);
                 entity.setIsvalid(0);
                 commonCostService.updateCommonCost(CommonCostConvert.INSTANCE.convert(entity));
-                if (entity.getIsAgent()==1) {
+                if (entity.getIsAgent() == 1) {
                     AssetProcureDO asset = new AssetProcureDO();
                     asset.setCommonCostId(flowInstanceId);
                     asset.setCommonCostStatus(0);
@@ -609,10 +609,10 @@ public class CommonCostEvent extends BaseController {
                 Set<String> zrbmIdList = new HashSet<>();
                 detailList.forEach(x -> {
                     Project project = projectService.selectById(x.getProjectId());
-                    if(project.getId().equals("31414c5bef38ca7eb9ce31612e84e8e8") || project.getId().equals("3ce706b5a67bb175929cda0117c11620") ){
+                    if (project.getId().equals("31414c5bef38ca7eb9ce31612e84e8e8") || project.getId().equals("3ce706b5a67bb175929cda0117c11620")) {
                         //卓一瑞
                         HashMap<String, String> map = new HashMap<>();
-                        map.put("id","d05dc4f4-ead4-4925-9aaa-0c4d3bc470b6");
+                        map.put("id", "d05dc4f4-ead4-4925-9aaa-0c4d3bc470b6");
                         userMaps.add(map);
                         return;
                     }
@@ -782,4 +782,29 @@ public class CommonCostEvent extends BaseController {
             throw new BusinessException("执行事件出错,请联系管理员!");
         }
     }
+
+    /**
+     * 出纳退件事件
+     *
+     * @param flowInstance 流程实例
+     * @return
+     */
+    @PostMapping("/cashierRejectEvent")
+    public String cashierRejectEvent(@ParamModel Map flowInstance) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                CommonCostDO entity = commonCostService.findByInstanceId(flowInstanceId);
+                entity.setFlowStatus(FLOW_PROCESS);
+                entity.setFlowFinishtime(LocalDateTime.now());
+                commonCostService.updateCommonCost(CommonCostConvert.INSTANCE.convert(entity));
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
 }

+ 26 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/travelcost/event/TravelCostEvent.java

@@ -554,4 +554,30 @@ public class TravelCostEvent extends BaseController {
         }
     }
 
+    /**
+     * 出纳退件事件
+     *
+     * @param flowInstance 流程实例
+     * @return
+     */
+    @PostMapping("/cashierRejectEvent")
+    public String cashierRejectEvent(@ParamModel Map flowInstance) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                TravelCostDO entity = travelCostService.findByInstanceId(flowInstanceId);
+                entity.setFlowStatus(FLOW_PROCESS);
+                entity.setFlowFinishtime(LocalDateTime.now());
+                travelCostService.updateTravelCost(TravelCostConvert.INSTANCE.convert(entity));
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+
 }