gongdecai hace 2 años
padre
commit
af0c2a07ce
Se han modificado 16 ficheros con 303 adiciones y 280 borrados
  1. 0 136
      src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ShortFillingInfo.java
  2. 0 16
      src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/ShortFillingInfoMapper.java
  3. 0 16
      src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IShortFillingInfoService.java
  4. 0 20
      src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ShortFillingInfoServiceImpl.java
  5. 1 1
      winsea-haixin-platform-backend/src/main/resources/application.yml
  6. 1 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/GeneratorCodeByTables.java
  7. 4 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/BatchReviewInfoController.java
  8. 68 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/BatchReviewInfo.java
  9. 4 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/TranSettlementReport.java
  10. 16 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/BatchReviewInfoMapper.java
  11. 16 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IBatchReviewInfoService.java
  12. 20 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/BatchReviewInfoServiceImpl.java
  13. 116 70
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranProcessInfoServiceImpl.java
  14. 1 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranSettlementReportServiceImpl.java
  15. 55 14
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/TranSettlementReportListener.java
  16. 1 1
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/BatchReviewInfoMapper.xml

+ 0 - 136
src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ShortFillingInfo.java

@@ -1,136 +0,0 @@
-package com.yh.saas.plugin.yiliangyiyun.entity;
-
-import java.util.Date;
-import com.baomidou.mybatisplus.activerecord.Model;
-import BaseModel;
-import java.io.Serializable;
-
-import com.baomidou.mybatisplus.annotations.Version;
-
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-
-/**
- * <p>
- * 记录短途加油信息
- * </p>
- *
- * @author Gdc
- * @since 2022-07-07
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-@Accessors(chain = true)
-public class ShortFillingInfo extends BaseModel<ShortFillingInfo> {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 主键id
-     */
-    private String id;
-    /**
-     * 公司id
-     */
-    private String compId;
-    /**
-     * 用户id
-     */
-    private String commonId;
-    /**
-     * 加油id
-     */
-    private String fillingId;
-    /**
-     * 车牌号
-     */
-    private String carNo;
-    /**
-     * 仓库名称
-     */
-    private String warehouseName;
-    /**
-     * 发货库
-     */
-    private String sendWarehouse;
-    /**
-     * 收货库
-     */
-    private String receiveWarehouse;
-    /**
-     * 始发地省
-     */
-    private String originProvince;
-    /**
-     * 始发地市
-     */
-    private String originCity;
-    /**
-     * 始发地区
-     */
-    private String originArea;
-    /**
-     * 始发地经度
-     */
-    private String originLongitude;
-    /**
-     * 始发地纬度
-     */
-    private String originLatitude;
-    /**
-     * 终到地省
-     */
-    private String destinationProvince;
-    /**
-     * 终到地市
-     */
-    private String destinationCity;
-    /**
-     * 终到地区
-     */
-    private String destinationArea;
-    /**
-     * 终到地经度
-     */
-    private String destinationLongitude;
-    /**
-     * 终到地纬度
-     */
-    private String destinationLatitude;
-    /**
-     * 请款日期
-     */
-    private Date amountDeadline;
-    /**
-     * 里程(公里)
-     */
-    private Double mileage;
-    /**
-     * 请款金额(元)
-     */
-    private Double amountRequested;
-    /**
-     * 行程状态(1已开始3已结束5已报销)
-     */
-    private String travelStatus;
-    /**
-     * 行程状态标识
-     */
-    private String travelStatusFlag;
-    /**
-     * 审核状态
-     */
-    private String approveStatus;
-    /**
-     * 工作流ID
-     */
-    private String workflowId;
-
-
-    @Override
-    protected Serializable pkVal() {
-        return this.id;
-    }
-
-}

+ 0 - 16
src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/ShortFillingInfoMapper.java

@@ -1,16 +0,0 @@
-package com.yh.saas.plugin.yiliangyiyun.mapper;
-
-import com.yh.saas.plugin.yiliangyiyun.entity.ShortFillingInfo;
-import com.baomidou.mybatisplus.mapper.BaseMapper;
-
-/**
- * <p>
- * 记录短途加油信息 Mapper 接口
- * </p>
- *
- * @author Gdc
- * @since 2022-07-07
- */
-public interface ShortFillingInfoMapper extends BaseMapper<ShortFillingInfo> {
-
-}

+ 0 - 16
src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IShortFillingInfoService.java

@@ -1,16 +0,0 @@
-package com.yh.saas.plugin.yiliangyiyun.service;
-
-import com.yh.saas.plugin.yiliangyiyun.entity.ShortFillingInfo;
-import com.baomidou.mybatisplus.service.IService;
-
-/**
- * <p>
- * 记录短途加油信息 服务类
- * </p>
- *
- * @author Gdc
- * @since 2022-07-07
- */
-public interface IShortFillingInfoService extends IService<ShortFillingInfo> {
-
-}

+ 0 - 20
src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ShortFillingInfoServiceImpl.java

@@ -1,20 +0,0 @@
-package com.yh.saas.plugin.yiliangyiyun.service.impl;
-
-import com.yh.saas.plugin.yiliangyiyun.entity.ShortFillingInfo;
-import com.yh.saas.plugin.yiliangyiyun.mapper.ShortFillingInfoMapper;
-import com.yh.saas.plugin.yiliangyiyun.service.IShortFillingInfoService;
-import com.baomidou.mybatisplus.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- * 记录短途加油信息 服务实现类
- * </p>
- *
- * @author Gdc
- * @since 2022-07-07
- */
-@Service
-public class ShortFillingInfoServiceImpl extends ServiceImpl<ShortFillingInfoMapper, ShortFillingInfo> implements IShortFillingInfoService {
-
-}

+ 1 - 1
winsea-haixin-platform-backend/src/main/resources/application.yml

@@ -12,7 +12,7 @@ spring:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8
   profiles:
-    active: prod
+    active: local
   resources:
     static-locations: file:///winsea/static/
   thymeleaf:

+ 1 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/GeneratorCodeByTables.java

@@ -53,7 +53,7 @@ public class GeneratorCodeByTables {
     }
 
     public static void main(String[] args) throws IOException {
-        generateByTables("Gdc", "com.yh.saas.plugin.yiliangyiyun","short_filling_info");
+        generateByTables("Gdc", "com.yh.saas.plugin.yiliangyiyun","batch_review_info");
     }
 
     /**

+ 4 - 4
src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/ShortFillingInfoController.java → winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/BatchReviewInfoController.java

@@ -7,15 +7,15 @@ import org.springframework.web.bind.annotation.RestController;
 
 /**
  * <p>
- * 记录短途加油信息 前端控制器
+ * 批次审核信息 前端控制器
  * </p>
  *
  * @author Gdc
- * @since 2022-07-07
+ * @since 2022-09-03
  */
 @RestController
-@RequestMapping("/shortFillingInfo")
-public class ShortFillingInfoController {
+@RequestMapping("/batchReviewInfo")
+public class BatchReviewInfoController {
 
 }
 

+ 68 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/BatchReviewInfo.java

@@ -0,0 +1,68 @@
+package com.yh.saas.plugin.yiliangyiyun.entity;
+
+import com.baomidou.mybatisplus.activerecord.Model;
+import java.io.Serializable;
+
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.annotations.Version;
+
+import com.baomidou.mybatisplus.enums.IdType;
+import com.yh.saas.common.support.entity.BaseModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 批次审核信息
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-09-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("batch_review_info")
+public class BatchReviewInfo extends BaseModel<BatchReviewInfo> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.UUID)
+    private String id;
+    /**
+     * 公司id
+     */
+    private String compId;
+    /**
+     * 状态标识
+     */
+    private String statusFlag;
+    /**
+     * 状态
+     */
+    private String status;
+    /**
+     * 状态英文
+     */
+    private String statusEn;
+    /**
+     * 审核状态
+     */
+    private String approveStatus;
+    /**
+     * 审核流id
+     */
+    private String workflowId;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 4 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/TranSettlementReport.java

@@ -177,6 +177,10 @@ public class TranSettlementReport extends BaseModel<TranSettlementReport> {
      * 银行卡号
      */
     private String cardNo;
+    /**
+     * 批次id
+     */
+    private String batchId;
     /**
      * 通过1驳回2
      */

+ 16 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/BatchReviewInfoMapper.java

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.mapper;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.BatchReviewInfo;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 批次审核信息 Mapper 接口
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-09-03
+ */
+public interface BatchReviewInfoMapper extends BaseMapper<BatchReviewInfo> {
+
+}

+ 16 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IBatchReviewInfoService.java

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.service;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.BatchReviewInfo;
+import com.baomidou.mybatisplus.service.IService;
+
+/**
+ * <p>
+ * 批次审核信息 服务类
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-09-03
+ */
+public interface IBatchReviewInfoService extends IService<BatchReviewInfo> {
+
+}

+ 20 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/BatchReviewInfoServiceImpl.java

@@ -0,0 +1,20 @@
+package com.yh.saas.plugin.yiliangyiyun.service.impl;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.BatchReviewInfo;
+import com.yh.saas.plugin.yiliangyiyun.mapper.BatchReviewInfoMapper;
+import com.yh.saas.plugin.yiliangyiyun.service.IBatchReviewInfoService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 批次审核信息 服务实现类
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-09-03
+ */
+@Service
+public class BatchReviewInfoServiceImpl extends ServiceImpl<BatchReviewInfoMapper, BatchReviewInfo> implements IBatchReviewInfoService {
+
+}

+ 116 - 70
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranProcessInfoServiceImpl.java

@@ -75,6 +75,8 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
     private IContractManagementInfoService contractManagementInfoService;
     @Autowired
     private ICommonStaffRoleService commonStaffRoleService;
+    @Autowired
+    private IBatchReviewInfoService batchReviewInfoService;
     /**
      * 汽运调度分页列表查询
      *
@@ -205,6 +207,9 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
     public String insertTranCar(TranProcessInfo tranProcessInfo) {
         this.updateById(tranProcessInfo);
         List<TranCarInfo> tranCarInfoList = tranProcessInfo.getTranCarInfoList();
+        BatchReviewInfo batchReviewInfo = new BatchReviewInfo();
+        batchReviewInfo.setId(IdGenerator.generateUUID());
+        String flagBatch = "0";
         if (!CollectionUtils.isEmpty(tranCarInfoList)) {
             for (TranCarInfo tranCarInfo : tranCarInfoList) {
                 if (tranCarInfo.getLoadNetWeight() == null) {
@@ -319,31 +324,29 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
                                 tranSettlementReport.setLoadingWeight(tranCarInfo.getLoadNetWeight());
                                 tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
                                 tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
+                                tranSettlementReport.setBatchId(batchReviewInfo.getId());
                                 tranSettlementReportService.insert(tranSettlementReport);
-                                boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranSettlementReport.getWorkflowId());
-                                // 不是退回的单子
-                                if (isStartWorkflow) {
-                                    Workflow workflow = workflowService
-                                            .findLatestWorkflowByBusinessCodeByApp(tranSettlementReport.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
-                                    // 没配置审核流程,直接结束并处理信息
-                                    if (workflow == null) {
-                                        throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
-                                    }
-                                    // 开启审核流
-                                    else {
 
-                                        // 设置状态 已提交审核
-                                        tranSettlementReport.setWorkflowId(workflow.getId());
-                                        tranSettlementReportService.updateById(tranSettlementReport);
-                                        workflowService.startInstance(workflow.getId(), tranSettlementReport.getId());
-                                    }
-                                }
-                                // 退回的单子 再启用
-                                else {
+                                flagBatch = "1";
 
-                                    tranSettlementReportService.updateById(tranSettlementReport);
-                                    workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
-                                }
+//                                boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranSettlementReport.getWorkflowId());
+//                                // 不是退回的单子
+//                                if (isStartWorkflow) {
+//                                    Workflow workflow = workflowService
+//                                            .findLatestWorkflowByBusinessCodeByApp(tranSettlementReport.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
+//                                    // 没配置审核流程,直接结束并处理信息
+//                                    if (workflow == null) {
+//                                        throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
+//                                    }
+//                                    // 开启审核流
+//                                    else {
+//
+//                                        // 设置状态 已提交审核
+//                                        tranSettlementReport.setWorkflowId(workflow.getId());
+//                                        tranSettlementReportService.updateById(tranSettlementReport);
+//                                        workflowService.startInstance(workflow.getId(), tranSettlementReport.getId());
+//                                    }
+//                                }
                             }
                         }
                         //火运类型
@@ -381,31 +384,33 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
                                 tranSettlementReport.setAmountNotPayable(tranProcessInfo1.getTranPrice());
                                 tranSettlementReport.setLoadingWeight(tranCarInfo.getLoadNetWeight());
                                 tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
+                                tranSettlementReport.setBatchId(batchReviewInfo.getId());
                                 tranSettlementReportService.insert(tranSettlementReport);
-                                boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranSettlementReport.getWorkflowId());
-                                // 不是退回的单子
-                                if (isStartWorkflow) {
-                                    Workflow workflow = workflowService
-                                            .findLatestWorkflowByBusinessCodeByApp(tranSettlementReport.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
-                                    // 没配置审核流程,直接结束并处理信息
-                                    if (workflow == null) {
-                                        throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
-                                    }
-                                    // 开启审核流
-                                    else {
-
-                                        // 设置状态 已提交审核
-                                        tranSettlementReport.setWorkflowId(workflow.getId());
-                                        tranSettlementReportService.updateById(tranSettlementReport);
-                                        workflowService.startInstance(workflow.getId(), tranSettlementReport.getId());
-                                    }
-                                }
-                                // 退回的单子 再启用
-                                else {
-
-                                    tranSettlementReportService.updateById(tranSettlementReport);
-                                    workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
-                                }
+                                flagBatch = "1";
+//                                boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranSettlementReport.getWorkflowId());
+//                                // 不是退回的单子
+//                                if (isStartWorkflow) {
+//                                    Workflow workflow = workflowService
+//                                            .findLatestWorkflowByBusinessCodeByApp(tranSettlementReport.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
+//                                    // 没配置审核流程,直接结束并处理信息
+//                                    if (workflow == null) {
+//                                        throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
+//                                    }
+//                                    // 开启审核流
+//                                    else {
+//
+//                                        // 设置状态 已提交审核
+//                                        tranSettlementReport.setWorkflowId(workflow.getId());
+//                                        tranSettlementReportService.updateById(tranSettlementReport);
+//                                        workflowService.startInstance(workflow.getId(), tranSettlementReport.getId());
+//                                    }
+//                                }
+//                                // 退回的单子 再启用
+//                                else {
+//
+//                                    tranSettlementReportService.updateById(tranSettlementReport);
+//                                    workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
+//                                }
                             }
                         }
                         //船运类型
@@ -451,31 +456,33 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
                                 tranSettlementReport.setLoadingWeight(tranCarInfo.getLoadNetWeight());
                                 tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
                                 tranSettlementReport.setTransportPrice(tranProcessInfo.getTranPrice());
+                                tranSettlementReport.setBatchId(batchReviewInfo.getId());
                                 tranSettlementReportService.insert(tranSettlementReport);
-                                boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranSettlementReport.getWorkflowId());
-                                // 不是退回的单子
-                                if (isStartWorkflow) {
-                                    Workflow workflow = workflowService
-                                            .findLatestWorkflowByBusinessCodeByApp(tranSettlementReport.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
-                                    // 没配置审核流程,直接结束并处理信息
-                                    if (workflow == null) {
-                                        throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
-                                    }
-                                    // 开启审核流
-                                    else {
-
-                                        // 设置状态 已提交审核
-                                        tranSettlementReport.setWorkflowId(workflow.getId());
-                                        tranSettlementReportService.updateById(tranSettlementReport);
-                                        workflowService.startInstance(workflow.getId(), tranSettlementReport.getId());
-                                    }
-                                }
-                                // 退回的单子 再启用
-                                else {
-
-                                    tranSettlementReportService.updateById(tranSettlementReport);
-                                    workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
-                                }
+                                flagBatch = "1";
+//                                boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranSettlementReport.getWorkflowId());
+//                                // 不是退回的单子
+//                                if (isStartWorkflow) {
+//                                    Workflow workflow = workflowService
+//                                            .findLatestWorkflowByBusinessCodeByApp(tranSettlementReport.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
+//                                    // 没配置审核流程,直接结束并处理信息
+//                                    if (workflow == null) {
+//                                        throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
+//                                    }
+//                                    // 开启审核流
+//                                    else {
+//
+//                                        // 设置状态 已提交审核
+//                                        tranSettlementReport.setWorkflowId(workflow.getId());
+//                                        tranSettlementReportService.updateById(tranSettlementReport);
+//                                        workflowService.startInstance(workflow.getId(), tranSettlementReport.getId());
+//                                    }
+//                                }
+//                                // 退回的单子 再启用
+//                                else {
+//
+//                                    tranSettlementReportService.updateById(tranSettlementReport);
+//                                    workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
+//                                }
                             }
                         }
                     }
@@ -683,6 +690,45 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
                     tranCarInfoService.updateById(tranCarInfo);
                 }
             }
+
+            // 批次开启审核流
+            if("1".equals(flagBatch)){
+                batchReviewInfoService.insert(batchReviewInfo);
+                boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(batchReviewInfo.getWorkflowId());
+                // 不是退回的单子
+                if (isStartWorkflow) {
+                    Workflow workflow = workflowService
+                            .findLatestWorkflowByBusinessCodeByApp(batchReviewInfo.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
+                    // 没配置审核流程,直接结束并处理信息
+                    if (workflow == null) {
+                        throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
+                    }
+                    // 开启审核流
+                    else {
+
+                        // 设置状态 已提交审核
+                        batchReviewInfo.setWorkflowId(workflow.getId());
+                        batchReviewInfoService.updateById(batchReviewInfo);
+                        workflowService.startInstance(workflow.getId(), batchReviewInfo.getId());
+                    }
+                }
+                //  更新详细状态
+                batchReviewInfo = batchReviewInfoService.selectById(batchReviewInfo.getId());
+                List<TranSettlementReport> tranSettlementReports = tranSettlementReportService.selectList(new EntityWrapper<TranSettlementReport>()
+                .eq("batch_id",batchReviewInfo.getId()));
+                if(!CollectionUtils.isEmpty(tranSettlementReports)){
+                    for(int i=0;i<tranSettlementReports.size();i++){
+                        TranSettlementReport settlementReport = tranSettlementReports.get(i);
+                        settlementReport.setWorkflowId(batchReviewInfo.getWorkflowId());
+                        settlementReport.setStatus(batchReviewInfo.getStatus());
+                        settlementReport.setApproveStatus(batchReviewInfo.getApproveStatus());
+
+                    }
+                    tranSettlementReportService.insertBatch(tranSettlementReports);
+
+                }
+
+            }
         }
         return tranProcessInfo.getId();
     }

+ 1 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranSettlementReportServiceImpl.java

@@ -122,7 +122,7 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
                 String taskId = "";
                 // 只有待审核状态才有taskId
                 if (StringUtils.isNotBlank(tranSettlementReport1.getWorkflowId())) {
-                    JSONObject jsonObject = workflowService.getActiveTask(Lists.newArrayList(tranSettlementReport1.getWorkflowId()), tranSettlementReport1.getId());
+                    JSONObject jsonObject = workflowService.getActiveTask(Lists.newArrayList(tranSettlementReport1.getWorkflowId()), tranSettlementReport1.getBatchId());
                     taskId = jsonObject.getString("taskId");
                     tranSettlementReport1.setTaskId(taskId);
                 }

+ 55 - 14
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/TranSettlementReportListener.java

@@ -1,13 +1,19 @@
 package com.yh.saas.plugin.yiliangyiyun.workflow;
 
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.yh.saas.common.support.workflow.AbstractWorkflowTaskListener;
 import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
+import com.yh.saas.plugin.yiliangyiyun.entity.BatchReviewInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
 import com.yh.saas.plugin.yiliangyiyun.entity.TranSettlementReport;
+import com.yh.saas.plugin.yiliangyiyun.service.IBatchReviewInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.ITranSettlementReportService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
 
 @WorkflowTaskListener(name = "统计报表", group = "运输结算统计")
 public class TranSettlementReportListener extends AbstractWorkflowTaskListener {
@@ -16,34 +22,69 @@ public class TranSettlementReportListener extends AbstractWorkflowTaskListener {
 
     @Autowired
     private ITranSettlementReportService tranSettlementReportService;
+    @Autowired
+    private IBatchReviewInfoService batchReviewInfoService;
 
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
-        TranSettlementReport tranSettlementReport = tranSettlementReportService.selectById(businessKey);
-        if (tranSettlementReport == null) {
+//        TranSettlementReport tranSettlementReport = tranSettlementReportService.selectById(businessKey);
+        BatchReviewInfo batchReviewInfo = batchReviewInfoService.selectById(businessKey);
+        if (batchReviewInfo == null) {
             return;
         }
         if (processIsEnd) {
-            tranSettlementReport.setStatusFlag(StatusEnum.ORDER_PASSED.getFlag());
-            tranSettlementReport.setStatus(StatusEnum.ORDER_PASSED.getName());
-            tranSettlementReport.setWorkflowId(null);
-            tranSettlementReport.setApproveStatus(null);
+            batchReviewInfo.setStatusFlag(StatusEnum.ORDER_PASSED.getFlag());
+            batchReviewInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
+            batchReviewInfo.setWorkflowId(null);
+            batchReviewInfo.setApproveStatus(null);
         } else {
-            tranSettlementReport.setApproveStatus(status);
+            batchReviewInfo.setApproveStatus(status);
+        }
+        batchReviewInfoService.updateAllColumnById(batchReviewInfo);
+
+        //  更新详细状态
+//        batchReviewInfo = batchReviewInfoService.selectById(batchReviewInfo.getId());
+        List<TranSettlementReport> tranSettlementReports = tranSettlementReportService.selectList(new EntityWrapper<TranSettlementReport>()
+                .eq("batch_id",batchReviewInfo.getId()));
+        if(!CollectionUtils.isEmpty(tranSettlementReports)){
+            for(int i=0;i<tranSettlementReports.size();i++){
+                TranSettlementReport settlementReport = tranSettlementReports.get(i);
+                settlementReport.setWorkflowId(batchReviewInfo.getWorkflowId());
+                settlementReport.setStatus(batchReviewInfo.getStatus());
+                settlementReport.setApproveStatus(batchReviewInfo.getApproveStatus());
+
+            }
+            tranSettlementReportService.insertBatch(tranSettlementReports);
+
         }
-        tranSettlementReportService.updateAllColumnById(tranSettlementReport);
     }
 
     @Override
     public void handleRejectApplicationRepulsed(String workflowId, String businessKey, boolean needReapply) {
-        TranSettlementReport tranSettlementReport = tranSettlementReportService.selectById(businessKey);
-        if (tranSettlementReport == null) {
+//        TranSettlementReport tranSettlementReport = tranSettlementReportService.selectById(businessKey);
+        BatchReviewInfo batchReviewInfo = batchReviewInfoService.selectById(businessKey);
+        if (batchReviewInfo == null) {
             return;
         }
-        tranSettlementReport.setStatusFlag(StatusEnum.TASK_RETURN.getFlag());
-        tranSettlementReport.setStatus(StatusEnum.TASK_RETURN.getName());
-        tranSettlementReport.setApproveStatus(null);
-        tranSettlementReportService.updateAllColumnById(tranSettlementReport);
+        batchReviewInfo.setStatusFlag(StatusEnum.TASK_RETURN.getFlag());
+        batchReviewInfo.setStatus(StatusEnum.TASK_RETURN.getName());
+        batchReviewInfo.setApproveStatus(null);
+        batchReviewInfoService.updateAllColumnById(batchReviewInfo);
+        //  更新详细状态
+//        batchReviewInfo = batchReviewInfoService.selectById(batchReviewInfo.getId());
+        List<TranSettlementReport> tranSettlementReports = tranSettlementReportService.selectList(new EntityWrapper<TranSettlementReport>()
+                .eq("batch_id",batchReviewInfo.getId()));
+        if(!CollectionUtils.isEmpty(tranSettlementReports)){
+            for(int i=0;i<tranSettlementReports.size();i++){
+                TranSettlementReport settlementReport = tranSettlementReports.get(i);
+                settlementReport.setWorkflowId(batchReviewInfo.getWorkflowId());
+                settlementReport.setStatus(batchReviewInfo.getStatus());
+                settlementReport.setApproveStatus(batchReviewInfo.getApproveStatus());
+
+            }
+            tranSettlementReportService.insertBatch(tranSettlementReports);
+
+        }
 
     }
 

+ 1 - 1
src/main/resources/mapper/ShortFillingInfoMapper.xml → winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/BatchReviewInfoMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.yh.saas.plugin.yiliangyiyun.mapper.ShortFillingInfoMapper">
+<mapper namespace="com.yh.saas.plugin.yiliangyiyun.mapper.BatchReviewInfoMapper">
 
 </mapper>