Browse Source

1.个贷产品完成时间更新改为审核后更新

GouGengquan 4 months ago
parent
commit
642bc9a34a

+ 16 - 7
service/src/main/java/com/dayou/workflow/handler/PersonalNodeHandler.java

@@ -73,6 +73,9 @@ public class PersonalNodeHandler extends WorkNodeProcessable {
     @Autowired
     private IPersonalProductionService personalProductionService;
 
+    @Autowired
+    private IWorkFlowNodeInstanceService workFlowNodeInstanceService;
+
 
     @Override
     public boolean forward(WorkNodeCommit workNodeCommit) {
@@ -217,23 +220,29 @@ public class PersonalNodeHandler extends WorkNodeProcessable {
                 .eq(PersonalTarget::getDeleted, false));
         // 通用的更新wrapper
         LambdaUpdateWrapper<PersonalProduction> productionTimeUpdateWrapper = new LambdaUpdateWrapper<PersonalProduction>()
-                .set(PersonalProduction::getProductionTime, new Date())
                 .eq(BaseEntity::getDeleted, false)
                 .eq(PersonalProduction::getTargetId, target.getId());
+        Date nodeFinishedTime;
         switch (WorkflowNodeEnum.valueOf(currentInstanceNode.getNodeCode())){
             // 撰写意见书
-            case GENERATE_STATEMENT:
-                productionTimeUpdateWrapper.eq(PersonalProduction::getProduction, STATEMENT.getCode());
+            case REVIEW_STATEMENT:
+                nodeFinishedTime = workFlowNodeInstanceService.getNodeFinishedTime(PERSONAL_BUSINESS, GENERATE_STATEMENT, currentInstanceNode.getBusinessId(), currentInstanceNode.getBusinessSubId(), null);
+                productionTimeUpdateWrapper.eq(PersonalProduction::getProduction, STATEMENT.getCode())
+                        .set(PersonalProduction::getProductionTime, nodeFinishedTime);
                 personalProductionService.update(productionTimeUpdateWrapper);
                 break;
             // 撰写报告报告(包含技术报告和结果报告)
-            case WRITE_REPORT:
-                productionTimeUpdateWrapper.and(temp->temp.eq(PersonalProduction::getProduction,TECHNIC.getCode()).or().eq(PersonalProduction::getProduction,FINAL.getCode()));
+            case CHECK_REPORT:
+                nodeFinishedTime = workFlowNodeInstanceService.getNodeFinishedTime(PERSONAL_BUSINESS, WRITE_REPORT, currentInstanceNode.getBusinessId(), currentInstanceNode.getBusinessSubId(), null);
+                productionTimeUpdateWrapper.and(temp->temp.eq(PersonalProduction::getProduction,TECHNIC.getCode()).or().eq(PersonalProduction::getProduction,FINAL.getCode()))
+                        .set(PersonalProduction::getProductionTime, nodeFinishedTime);
                 personalProductionService.update(productionTimeUpdateWrapper);
                 break;
             // 撰写复评函
-            case WRITE_LETTER:
-                productionTimeUpdateWrapper.eq(PersonalProduction::getProduction, LETTER.getCode());
+            case CHECK_LETTER:
+                nodeFinishedTime = workFlowNodeInstanceService.getNodeFinishedTime(PERSONAL_BUSINESS, WRITE_LETTER, currentInstanceNode.getBusinessId(), currentInstanceNode.getBusinessSubId(), null);
+                productionTimeUpdateWrapper.eq(PersonalProduction::getProduction, LETTER.getCode())
+                        .set(PersonalProduction::getProductionTime, nodeFinishedTime);
                 personalProductionService.update(productionTimeUpdateWrapper);
                 break;
         }