wucl 10 месяцев назад
Родитель
Сommit
8bde54e4c1

+ 0 - 2
dao/src/main/java/com/dayou/mapper/MajorProductionMapper.java

@@ -58,8 +58,6 @@ public interface MajorProductionMapper extends CustomBaseMapper<MajorProduction>
 
     List<String> getProductionNosByMajorId(@Param("majorId") Long majorId);
 
-    void saveSecondCheckId(@Param("secondCheckId")Long secondCheckId, @Param("businessId")Long businessId, @Param("businessMinId")String businessMinId);
-
     Long getSecondCheckId( @Param("businessId")Long businessId, @Param("businessMinId")String businessMinId);
 
     MajorProduction getEvaluateAmountByProductionNo(@Param("toMergeNumber") String toMergeNumber);

+ 6 - 6
dao/src/main/resources/mapper/MajorProductionMapper.xml

@@ -757,10 +757,6 @@
         select report_no from major_production where major_id = #{majorId} and deleted = 0
     </select>
 
-    <update id="saveSecondCheckId">
-        update major_production set second_check_id = #{secondCheckId}
-                                where major_id =#{businessId} and report_no = #{businessMinId} and deleted = 0
-    </update>
 
     <select id="getSecondCheckId" resultType="java.lang.Long">
         select second_check_id from major_production where major_id =#{businessId} and report_no = #{businessMinId} and deleted = 0
@@ -769,12 +765,16 @@
     <select id="getEvaluateAmountByProductionNo" parameterType="java.lang.String" resultType="com.dayou.entity.MajorProduction">
         SELECT
             mp.id,
-            m.evaluate_aim,
-            mp.evaluate_amount
+            mp.work_purpose,
+            mp.evaluate_amount,
+            m.business_object_type,
+            mp.production,
+            mp.is_record
         FROM
             major_production mp
                 LEFT JOIN major m ON m.id = mp.major_id
         WHERE
             mp.report_no =  #{toMergeNumber} and mp.deleted = 0
+
     </select>
 </mapper>

+ 2 - 0
domain/src/main/java/com/dayou/common/Constants.java

@@ -136,6 +136,8 @@ public interface Constants {
 
     String PLEDGE = "抵押";
 
+    String RENT = "租金";
+
     String PNG = ".png";
 
     String PERSONAL_DEPARTMENT = "个贷部";

+ 0 - 5
domain/src/main/java/com/dayou/dto/WorkNodeCommit.java

@@ -91,11 +91,6 @@ public class WorkNodeCommit {
     private Boolean landIsRecord;
 
     /**
-     * 复审人
-     */
-    private Long secondCheckId;
-
-    /**
      * 跳过下一节点
      */
     private Boolean ifSkip;

+ 2 - 5
domain/src/main/java/com/dayou/entity/MajorProduction.java

@@ -273,11 +273,6 @@ public class MajorProduction extends BaseEntity {
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     private String smallWorkerNo;
 
-    /**
-     * 复审人id
-     */
-    private Long secondCheckId;
-
 
     @TableField(exist = false)
     private List<Long> signatoryId;
@@ -328,5 +323,7 @@ public class MajorProduction extends BaseEntity {
     private Long orderFundId;
     @TableField(exist = false)
     private String evaluateAim;
+    @TableField(exist = false)
+    private String businessObjectType;
 
 }

+ 56 - 36
service/src/main/java/com/dayou/service/impl/MajorProductionServiceImpl.java

@@ -13,6 +13,7 @@ import com.dayou.entity.*;
 import com.dayou.enums.MainBusinessEnum;
 import com.dayou.enums.ProductionEnum;
 import com.dayou.enums.ReportStatus;
+import com.dayou.enums.TakeNumberEnum;
 import com.dayou.enums.workflow.NodeLogEnum;
 import com.dayou.exception.ErrorCode;
 import com.dayou.mapper.*;
@@ -173,25 +174,10 @@ public class MajorProductionServiceImpl extends ServiceImpl<MajorProductionMappe
     @Override
     public Boolean update(MajorProduction taskData) {
         String reportNo = taskData.getReportNo();
-        MajorProduction production = this.getById(taskData.getId());
-        BigDecimal evaluateAmount = taskData.getEvaluateAmount();
-        Major major = majorService.getOne(new LambdaQueryWrapper<Major>().eq(BaseEntity::getId, production.getMajorId())
-                .select(BaseEntity::getId, Major::getEvaluateAim));
-        //抵押类是否需要复审和三审逻辑 ?
-        if (major.getEvaluateAim().equals(PLEDGE)){
-            if (evaluateAmount.compareTo(EVALUATE_MIN)<=0){
-                taskData.setSecondCheck(ReportStatus.不审.name());
-                taskData.setThirdCheck(ReportStatus.不审.name());
-            }
-            if (evaluateAmount.compareTo(EVALUATE_MIN)>0 && evaluateAmount.compareTo(EVALUATE_MAX)<=0){
-                taskData.setSecondCheck(ReportStatus.待审核.name());
-                taskData.setThirdCheck(ReportStatus.不审.name());
-            }
-            if (evaluateAmount.compareTo(EVALUATE_MAX)>0){
-                taskData.setSecondCheck(ReportStatus.待审核.name());
-                taskData.setThirdCheck(ReportStatus.待审核.name());
-            }
-        }
+        Major major = majorService.getOne(new LambdaQueryWrapper<Major>().eq(BaseEntity::getId, taskData.getMajorId())
+                .select(BaseEntity::getId, Major::getEvaluateAim,Major::getBusinessObjectType));
+        taskData.setBusinessObjectType(major.getBusinessObjectType());
+        checkingRule(taskData);
         List<MajorTarget> targets = null;
         String productionType = taskData.getProduction();
 
@@ -493,23 +479,8 @@ public class MajorProductionServiceImpl extends ServiceImpl<MajorProductionMappe
 
     @Override
     public void updateEvaluateAmountAndCheckState(MajorProduction majorProduction) {
-        BigDecimal evaluateAmount = majorProduction.getEvaluateAmount();
-        if (majorProduction.getEvaluateAim().equals(PLEDGE)) {
-            //抵押类是否需要复审和三审逻辑 ?
-            if (evaluateAmount.compareTo(EVALUATE_MIN) <= 0) {
-                majorProduction.setSecondCheck(ReportStatus.不审.name());
-                majorProduction.setThirdCheck(ReportStatus.不审.name());
-            }
-            if (evaluateAmount.compareTo(EVALUATE_MIN) > 0 && evaluateAmount.compareTo(EVALUATE_MAX) <= 0) {
-                majorProduction.setSecondCheck(ReportStatus.待审核.name());
-                majorProduction.setThirdCheck(ReportStatus.不审.name());
-            }
-            if (evaluateAmount.compareTo(EVALUATE_MAX) > 0) {
-                majorProduction.setSecondCheck(ReportStatus.待审核.name());
-                majorProduction.setThirdCheck(ReportStatus.待审核.name());
-            }
-        }
-        this.update(new LambdaUpdateWrapper<MajorProduction>().set(MajorProduction::getEvaluateAmount,evaluateAmount)
+        checkingRule(majorProduction);
+        this.update(new LambdaUpdateWrapper<MajorProduction>().set(MajorProduction::getEvaluateAmount,majorProduction.getEvaluateAmount())
                 .set(MajorProduction::getSecondCheck,majorProduction.getSecondCheck())
                 .set(MajorProduction::getThirdCheck,majorProduction.getThirdCheck()).eq(BaseEntity::getId,majorProduction.getId()));
     }
@@ -521,6 +492,55 @@ public class MajorProductionServiceImpl extends ServiceImpl<MajorProductionMappe
         return ret;
     }
 
+    /**
+     * 复审三审规则
+     * @param majorProduction
+     */
+    private void checkingRule(MajorProduction majorProduction) {
+        String evaluateAim = majorProduction.getWorkPurpose();
+        BigDecimal evaluateAmount = majorProduction.getEvaluateAmount();
+        String businessObjectType = majorProduction.getBusinessObjectType();
+        String production = majorProduction.getProduction();
+        if (evaluateAim.equals(RENT)){
+            majorProduction.setSecondCheck(ReportStatus.不审.name());
+            majorProduction.setThirdCheck(ReportStatus.不审.name());
+        }else {
+            //土地审核规则
+            if (businessObjectType.equals(TakeNumberEnum.LAND_NUMBER.getType()) && REPORT.name().equals(production)){
+                if (majorProduction.getIsRecord()){
+                    //要备案
+                    if (evaluateAmount.compareTo(EVALUATE_MAX)<=0){
+                        majorProduction.setSecondCheck(ReportStatus.待审核.name());
+                        majorProduction.setThirdCheck(ReportStatus.不审.name());
+                    }else{
+                        majorProduction.setSecondCheck(ReportStatus.待审核.name());
+                        majorProduction.setThirdCheck(ReportStatus.待审核.name());
+                    }
+                }else{
+                    //不备案
+                    majorProduction.setSecondCheck(ReportStatus.待审核.name());
+                    majorProduction.setThirdCheck(ReportStatus.待审核.name());
+                }
+            }else{
+                //房地产审核规则 抵押类是否需要复审和三审逻辑 ?
+                if (evaluateAim.equals(PLEDGE)){
+                    if (evaluateAmount.compareTo(EVALUATE_MIN)<=0){
+                        majorProduction.setSecondCheck(ReportStatus.不审.name());
+                        majorProduction.setThirdCheck(ReportStatus.不审.name());
+                    }
+                    if (evaluateAmount.compareTo(EVALUATE_MIN)>0 && evaluateAmount.compareTo(EVALUATE_MAX)<=0){
+                        majorProduction.setSecondCheck(ReportStatus.待审核.name());
+                        majorProduction.setThirdCheck(ReportStatus.不审.name());
+                    }
+                    if (evaluateAmount.compareTo(EVALUATE_MAX)>0){
+                        majorProduction.setSecondCheck(ReportStatus.待审核.name());
+                        majorProduction.setThirdCheck(ReportStatus.待审核.name());
+                    }
+                }
+            }
+        }
+    }
+
     @Override
     @Transactional
     public Boolean batchSaveFile(List<TaskTodoVO> todoVOList) {

+ 1 - 1
service/src/main/java/com/dayou/workflow/config/WorkNodeProcessable.java

@@ -114,7 +114,7 @@ public class WorkNodeProcessable {
         //寻找下一个节点,有可能下一个节点并非流程配置的节点,需根据业务数据变动
         WorkNodeDTO nextWorkNode = workNodeService.getNextWorkNode(currentInstanceNode.getFlowId(), currentInstanceNode.getNodeId());
 
-        if (commit.getIfSkip()){
+        if (commit.getIfSkip()!=null && commit.getIfSkip()){
             nextWorkNode = workNodeService.getNextWorkNode(currentInstanceNode.getFlowId(), nextWorkNode.getId());
         }
 

+ 2 - 18
service/src/main/java/com/dayou/workflow/handler/MajorNodeHandler.java

@@ -89,24 +89,8 @@ public class MajorNodeHandler extends WorkNodeProcessable {
                     List<ProductionEnum> production = workNodeCommit.getProduction();
                     switch (callback){
                         case CHECK_PRODUCTION_CHECK:
-                            if (workNodeCommit.getLandIsRecord()!=null && workNodeCommit.getLandIsRecord()){
-                                //备案的话才获取审核的节点
-                                nextWorkNode = workNodeService.getNextWorkNodeByCheckState(currentInstanceNode.getFlowId(),currentInstanceNode.getNodeCode(),
-                                        workNodeCommit.getDoSecondCheck(),workNodeCommit.getDoThirdCheck(),1);
-                                //将复审人设置为下一节点处理人
-                                workNodeCommit.setNextHandlerId(workNodeCommit.getSecondCheckId());
-                            } else {
-                              //保存复审人
-                                majorProductionMapper.saveSecondCheckId(workNodeCommit.getSecondCheckId(),currentInstanceNode.getBusinessId(),currentInstanceNode.getBusinessMinId());
-                            }
-                            break;
-                        case CHECK_LAND_REPORT_IS_RECORD:
-                                nextWorkNode = workNodeService.getNextWorkNodeByCheckState(currentInstanceNode.getFlowId(),currentInstanceNode.getNodeCode(),
-                                        workNodeCommit.getDoSecondCheck(),workNodeCommit.getDoThirdCheck(),0);
-                                //获取复审人
-                                if (RECHECK_REPORT.name().equals(nextWorkNode.getCode())){
-                                    workNodeCommit.setNextHandlerId(majorProductionMapper.getSecondCheckId(currentInstanceNode.getBusinessId(),currentInstanceNode.getBusinessMinId()));
-                                }
+                            nextWorkNode = workNodeService.getNextWorkNodeByCheckState(currentInstanceNode.getFlowId(),currentInstanceNode.getNodeCode(),
+                                    workNodeCommit.getDoSecondCheck(),workNodeCommit.getDoThirdCheck(),0);
                             break;
                         case CHECK_PRODUCTION_TYPE:
                             //1. 获取业务上出具的产品类型。