2 次代码提交 5492079a2c ... c9be68cd65

作者 SHA1 备注 提交日期
  gongdecai c9be68cd65 Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun 1 年之前
  gongdecai 8eae0584ed 我发起状态 1 年之前
共有 46 个文件被更改,包括 1454 次插入105 次删除
  1. 21 0
      src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/StatusRecordController.java
  2. 59 0
      src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/StatusRecord.java
  3. 16 0
      src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/StatusRecordMapper.java
  4. 16 0
      src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IStatusRecordService.java
  5. 20 0
      src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/StatusRecordServiceImpl.java
  6. 5 0
      src/main/resources/mapper/StatusRecordMapper.xml
  7. 1 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/GeneratorCodeByTables.java
  8. 21 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/StatusRecordController.java
  9. 64 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/StatusRecord.java
  10. 4 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/CommonUserMapper.java
  11. 16 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/StatusRecordMapper.java
  12. 16 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IStatusRecordService.java
  13. 12 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CommonUserServiceImpl.java
  14. 20 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/StatusRecordServiceImpl.java
  15. 37 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/AcquisitionListener.java
  16. 37 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/AcquisitionPayListener.java
  17. 37 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/BukaListener.java
  18. 37 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/BuyContractListener.java
  19. 37 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/ContractCostInfoListener.java
  20. 37 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/DcContractListener.java
  21. 38 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/DsContractListListener.java
  22. 38 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/DsContractListener.java
  23. 38 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/ExepenseInfoListener.java
  24. 38 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/ExepenseListener.java
  25. 38 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/ExepenseYunListener.java
  26. 56 9
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/FuelFingListener.java
  27. 38 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/GeneralAuditInfoListener.java
  28. 38 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/GoodsPurchaseReceiptReportListener.java
  29. 38 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/InOutWharehoseTaskListener.java
  30. 38 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/NonContractExpensesListener.java
  31. 38 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/ProcurementOrderListener.java
  32. 38 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/PurchaseClosingReportListener.java
  33. 38 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/PurchaseReceiptReportListener.java
  34. 38 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/QingjiaListener.java
  35. 38 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/SaleCloseReportListener.java
  36. 38 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/SaleContractListener.java
  37. 37 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/SaleOrderListener.java
  38. 37 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/SaleOutReportListener.java
  39. 37 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/ShouContractListener.java
  40. 37 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/TradeServicesListener.java
  41. 37 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/TranProessListener.java
  42. 37 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/TranSettlementReportListener.java
  43. 38 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/WarehousingDebitListener.java
  44. 27 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/WarehousingOrderListener.java
  45. 23 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/CommonUserMapper.xml
  46. 5 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/StatusRecordMapper.xml

+ 21 - 0
src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/StatusRecordController.java

@@ -0,0 +1,21 @@
+package com.yh.saas.plugin.yiliangyiyun.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 记录状态 前端控制器
+ * </p>
+ *
+ * @author Gdc
+ * @since 2023-02-17
+ */
+@RestController
+@RequestMapping("/statusRecord")
+public class StatusRecordController {
+
+}
+

+ 59 - 0
src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/StatusRecord.java

@@ -0,0 +1,59 @@
+package com.yh.saas.plugin.yiliangyiyun.entity;
+
+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 2023-02-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+public class StatusRecord extends BaseModel<StatusRecord> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private String id;
+    /**
+     * 公司id
+     */
+    private String compId;
+    /**
+     * 单据id
+     */
+    private String infoId;
+    /**
+     * 单据类型
+     */
+    private String infoType;
+    /**
+     * 状态
+     */
+    private String status;
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

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

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.mapper;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 记录状态 Mapper 接口
+ * </p>
+ *
+ * @author Gdc
+ * @since 2023-02-17
+ */
+public interface StatusRecordMapper extends BaseMapper<StatusRecord> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.service;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
+import com.baomidou.mybatisplus.service.IService;
+
+/**
+ * <p>
+ * 记录状态 服务类
+ * </p>
+ *
+ * @author Gdc
+ * @since 2023-02-17
+ */
+public interface IStatusRecordService extends IService<StatusRecord> {
+
+}

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

@@ -0,0 +1,20 @@
+package com.yh.saas.plugin.yiliangyiyun.service.impl;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
+import com.yh.saas.plugin.yiliangyiyun.service.IStatusRecordService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 记录状态 服务实现类
+ * </p>
+ *
+ * @author Gdc
+ * @since 2023-02-17
+ */
+@Service
+public class StatusRecordServiceImpl extends ServiceImpl<StatusRecordMapper, StatusRecord> implements IStatusRecordService {
+
+}

+ 5 - 0
src/main/resources/mapper/StatusRecordMapper.xml

@@ -0,0 +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.StatusRecordMapper">
+
+</mapper>

+ 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","petty_cash_info");
+        generateByTables("Gdc", "com.yh.saas.plugin.yiliangyiyun","status_record");
     }
 
     /**

+ 21 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/StatusRecordController.java

@@ -0,0 +1,21 @@
+package com.yh.saas.plugin.yiliangyiyun.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 记录状态 前端控制器
+ * </p>
+ *
+ * @author Gdc
+ * @since 2023-02-17
+ */
+@RestController
+@RequestMapping("/statusRecord")
+public class StatusRecordController {
+
+}
+

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

@@ -0,0 +1,64 @@
+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 2023-02-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("status_record")
+public class StatusRecord extends BaseModel<StatusRecord> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.UUID)
+    private String id;
+    /**
+     * 公司id
+     */
+    private String compId;
+    /**
+     * 单据id
+     */
+    private String infoId;
+    /**
+     * 单据类型
+     */
+    private String infoType;
+    /**
+     * 状态
+     */
+    private String status;
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

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

@@ -53,6 +53,10 @@ public interface CommonUserMapper extends BaseMapper<CommonUser> {
      * @return
      */
     List<NoticeTaskInfo> getListByConditionMy(Map<String, Object> pageView);
+
+
+
+   List<String> getLastStatus(Map<String, Object> pageView);
     /**
      * 根据条件查询未完成任务总数
      *

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

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.mapper;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 记录状态 Mapper 接口
+ * </p>
+ *
+ * @author Gdc
+ * @since 2023-02-17
+ */
+public interface StatusRecordMapper extends BaseMapper<StatusRecord> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.service;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
+import com.baomidou.mybatisplus.service.IService;
+
+/**
+ * <p>
+ * 记录状态 服务类
+ * </p>
+ *
+ * @author Gdc
+ * @since 2023-02-17
+ */
+public interface IStatusRecordService extends IService<StatusRecord> {
+
+}

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

@@ -11,6 +11,7 @@ import com.winsea.svc.notice.service.*;
 import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.exception.*;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import org.apache.commons.collections.CollectionUtils;
 import com.google.common.collect.Sets;
 import com.winsea.svc.base.base.entity.*;
@@ -83,6 +84,8 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
     private IStaffVesselBizService staffVesselService;
     @Autowired
     private StringRedisTemplate userRedisTemplate;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
 
     @Autowired
     private IIdentityAuthenticationInfoService iIdentityAuthenticationInfoService;
@@ -900,6 +903,15 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
         // 查询总数
         Integer dataCount = baseMapper.getCountByConditionMy(pageView);
         List<NoticeTaskInfo> dataList = baseMapper.getListByConditionMy(pageView);
+        if(CollectionUtils.isNotEmpty(dataList)){
+            for(int i=0;i<dataList.size();i++){
+                StatusRecord statusRecord = statusRecordMapper.selectById(dataList.get(i).getBusinessId());
+                if(statusRecord != null){
+                    dataList.get(i).setMessageTitleEn(statusRecord.getStatus());
+                }
+            }
+        }
+
         Page<NoticeTaskInfo> page = new Page<>();
         page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
         page.setTotal(dataCount == null ? 0 : dataCount);

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

@@ -0,0 +1,20 @@
+package com.yh.saas.plugin.yiliangyiyun.service.impl;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
+import com.yh.saas.plugin.yiliangyiyun.service.IStatusRecordService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 记录状态 服务实现类
+ * </p>
+ *
+ * @author Gdc
+ * @since 2023-02-17
+ */
+@Service
+public class StatusRecordServiceImpl extends ServiceImpl<StatusRecordMapper, StatusRecord> implements IStatusRecordService {
+
+}

+ 37 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/AcquisitionListener.java

@@ -8,7 +8,9 @@ import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchasePrice;
 import com.yh.saas.plugin.yiliangyiyun.entity.SaleOrder;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchasePriceService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISaleOrderService;
 import com.yh.saas.toolkit.workflow.service.IWorkflowHistoryService;
@@ -25,10 +27,14 @@ public class AcquisitionListener extends AbstractWorkflowTaskListener {
     private IAuditHistoryService auditHistoryService;
     @Autowired
     private CommonUserMapper commonUserMapper;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
 
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         PurchasePrice purchasePrice = purchasePriceService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (purchasePrice == null) {
             return;
         }
@@ -37,8 +43,28 @@ public class AcquisitionListener extends AbstractWorkflowTaskListener {
             purchasePrice.setStatus(StatusEnum.ORDER_PASSED.getName());
             purchasePrice.setWorkflowId(null);
             purchasePrice.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             purchasePrice.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         purchasePriceService.updateAllColumnById(purchasePrice);
     }
@@ -53,9 +79,17 @@ public class AcquisitionListener extends AbstractWorkflowTaskListener {
         purchasePrice.setStatus(StatusEnum.PURCHASE_FAILED.getName());
         purchasePrice.setApproveStatus(null);
         purchasePriceService.updateAllColumnById(purchasePrice);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//        .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 37 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/AcquisitionPayListener.java

@@ -8,7 +8,9 @@ import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.PaymentManagement;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchasePrice;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IPaymentManagementService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchasePriceService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,6 +19,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 public class AcquisitionPayListener extends AbstractWorkflowTaskListener {
 
     private static final long serialVersionUID = 4103656734835351132L;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
 
     @Autowired
     private IPaymentManagementService paymentManagementService;
@@ -27,6 +31,8 @@ public class AcquisitionPayListener extends AbstractWorkflowTaskListener {
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         PaymentManagement paymentManagement = paymentManagementService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (paymentManagement == null) {
             return;
         }
@@ -35,8 +41,28 @@ public class AcquisitionPayListener extends AbstractWorkflowTaskListener {
             paymentManagement.setStatus(StatusEnum.ORDER_PASSED.getName());
             paymentManagement.setWorkflowId(null);
             paymentManagement.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             paymentManagement.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         paymentManagementService.updateAllColumnById(paymentManagement);
     }
@@ -51,9 +77,17 @@ public class AcquisitionPayListener extends AbstractWorkflowTaskListener {
         paymentManagement.setStatus(StatusEnum.TASK_RETURN.getName());
         paymentManagement.setApproveStatus(null);
         paymentManagementService.updateAllColumnById(paymentManagement);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 37 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/BukaListener.java

@@ -7,7 +7,9 @@ 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.ClockInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IClockInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -15,6 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 public class BukaListener extends AbstractWorkflowTaskListener {
 
     private static final long serialVersionUID = 4103656734835351132L;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
 
     @Autowired
     private IClockInfoService clockInfoService;
@@ -25,6 +29,8 @@ public class BukaListener extends AbstractWorkflowTaskListener {
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ClockInfo clockInfo = clockInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (clockInfo == null) {
             return;
         }
@@ -33,8 +39,28 @@ public class BukaListener extends AbstractWorkflowTaskListener {
             clockInfo.setStatus(StatusEnum.SUPP_SUCCESS.getName());
             clockInfo.setWorkflowId(null);
             clockInfo.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             clockInfo.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         clockInfoService.updateAllColumnById(clockInfo);
     }
@@ -49,9 +75,17 @@ public class BukaListener extends AbstractWorkflowTaskListener {
         clockInfo.setStatus(StatusEnum.SUPP_FAIL.getName());
         clockInfo.setApproveStatus(null);
         clockInfoService.updateAllColumnById(clockInfo);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 37 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/BuyContractListener.java

@@ -7,7 +7,9 @@ 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.ContractManagementInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -15,6 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 public class BuyContractListener extends AbstractWorkflowTaskListener {
 
     private static final long serialVersionUID = 4103656734835351132L;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
 
     @Autowired
     private IContractManagementInfoService contractManagementInfoService;
@@ -25,6 +29,8 @@ public class BuyContractListener extends AbstractWorkflowTaskListener {
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (contractManagementInfo == null) {
             return;
         }
@@ -33,8 +39,28 @@ public class BuyContractListener extends AbstractWorkflowTaskListener {
             contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
             contractManagementInfo.setWorkflowId(null);
             contractManagementInfo.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             contractManagementInfo.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
     }
@@ -49,9 +75,17 @@ public class BuyContractListener extends AbstractWorkflowTaskListener {
         contractManagementInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractManagementInfo.setApproveStatus(null);
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 37 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/ContractCostInfoListener.java

@@ -7,7 +7,9 @@ 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.ContractCostInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractCostInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -15,6 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 public class ContractCostInfoListener extends AbstractWorkflowTaskListener {
 
     private static final long serialVersionUID = 4103656734835351132L;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
 
     @Autowired
     private IContractCostInfoService contractCostInfoService;
@@ -25,6 +29,8 @@ public class ContractCostInfoListener extends AbstractWorkflowTaskListener {
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ContractCostInfo contractCostInfo = contractCostInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (contractCostInfo == null) {
             return;
         }
@@ -33,8 +39,28 @@ public class ContractCostInfoListener extends AbstractWorkflowTaskListener {
             contractCostInfo.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
             contractCostInfo.setWorkflowId(null);
             contractCostInfo.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             contractCostInfo.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         contractCostInfoService.updateAllColumnById(contractCostInfo);
     }
@@ -49,9 +75,17 @@ public class ContractCostInfoListener extends AbstractWorkflowTaskListener {
         contractCostInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractCostInfo.setApproveStatus(null);
         contractCostInfoService.updateAllColumnById(contractCostInfo);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 37 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/DcContractListener.java

@@ -7,7 +7,9 @@ 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.ContractManagementInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -15,6 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 public class DcContractListener extends AbstractWorkflowTaskListener {
 
     private static final long serialVersionUID = 4103656734835351132L;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
 
     @Autowired
     private IContractManagementInfoService contractManagementInfoService;
@@ -25,6 +29,8 @@ public class DcContractListener extends AbstractWorkflowTaskListener {
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (contractManagementInfo == null) {
             return;
         }
@@ -33,8 +39,28 @@ public class DcContractListener extends AbstractWorkflowTaskListener {
             contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
             contractManagementInfo.setWorkflowId(null);
             contractManagementInfo.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             contractManagementInfo.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
     }
@@ -49,9 +75,17 @@ public class DcContractListener extends AbstractWorkflowTaskListener {
         contractManagementInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractManagementInfo.setApproveStatus(null);
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 38 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/DsContractListListener.java

@@ -8,7 +8,9 @@ import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.CollectionWarehousingRecord;
 import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.ICollectionWarehousingRecordService;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +25,14 @@ public class DsContractListListener extends AbstractWorkflowTaskListener {
     private ICollectionWarehousingRecordService collectionWarehousingRecordService;
     @Autowired
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         CollectionWarehousingRecord collectionWarehousingRecord = collectionWarehousingRecordService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (collectionWarehousingRecord == null) {
             return;
         }
@@ -34,8 +41,28 @@ public class DsContractListListener extends AbstractWorkflowTaskListener {
             collectionWarehousingRecord.setStatus(StatusEnum.PASSED_COMP.getName());
             collectionWarehousingRecord.setWorkflowId(null);
             collectionWarehousingRecord.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             collectionWarehousingRecord.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         collectionWarehousingRecordService.updateAllColumnById(collectionWarehousingRecord);
     }
@@ -50,9 +77,17 @@ public class DsContractListListener extends AbstractWorkflowTaskListener {
         collectionWarehousingRecord.setStatus(StatusEnum.TASK_RETURN.getName());
         collectionWarehousingRecord.setApproveStatus(null);
         collectionWarehousingRecordService.updateAllColumnById(collectionWarehousingRecord);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 38 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/DsContractListener.java

@@ -7,7 +7,9 @@ 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.ContractManagementInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -21,9 +23,14 @@ public class DsContractListener extends AbstractWorkflowTaskListener {
     private IContractManagementInfoService contractManagementInfoService;
     @Autowired
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (contractManagementInfo == null) {
             return;
         }
@@ -32,8 +39,28 @@ public class DsContractListener extends AbstractWorkflowTaskListener {
             contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
             contractManagementInfo.setWorkflowId(null);
             contractManagementInfo.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             contractManagementInfo.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
     }
@@ -48,9 +75,17 @@ public class DsContractListener extends AbstractWorkflowTaskListener {
         contractManagementInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractManagementInfo.setApproveStatus(null);
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 38 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/ExepenseInfoListener.java

@@ -7,7 +7,9 @@ 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.ExpenseInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IExpenseInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchasePriceService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,9 +24,14 @@ public class ExepenseInfoListener extends AbstractWorkflowTaskListener {
     private IExpenseInfoService expenseInfoService;
     @Autowired
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ExpenseInfo expenseInfo = expenseInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (expenseInfo == null) {
             return;
         }
@@ -33,8 +40,28 @@ public class ExepenseInfoListener extends AbstractWorkflowTaskListener {
             expenseInfo.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
             expenseInfo.setWorkflowId(null);
             expenseInfo.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             expenseInfo.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         expenseInfoService.updateAllColumnById(expenseInfo);
     }
@@ -49,9 +76,17 @@ public class ExepenseInfoListener extends AbstractWorkflowTaskListener {
         expenseInfo.setStatus(StatusEnum.PURCHASE_FAILED.getName());
         expenseInfo.setApproveStatus(null);
         expenseInfoService.updateAllColumnById(expenseInfo);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 38 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/ExepenseListener.java

@@ -7,7 +7,9 @@ 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.ExpenseInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IExpenseInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -21,9 +23,14 @@ public class ExepenseListener extends AbstractWorkflowTaskListener {
     private IExpenseInfoService expenseInfoService;
     @Autowired
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ExpenseInfo expenseInfo = expenseInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (expenseInfo == null) {
             return;
         }
@@ -32,8 +39,28 @@ public class ExepenseListener extends AbstractWorkflowTaskListener {
             expenseInfo.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
             expenseInfo.setWorkflowId(null);
             expenseInfo.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             expenseInfo.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         expenseInfoService.updateAllColumnById(expenseInfo);
     }
@@ -48,9 +75,17 @@ public class ExepenseListener extends AbstractWorkflowTaskListener {
         expenseInfo.setStatus(StatusEnum.PURCHASE_FAILED.getName());
         expenseInfo.setApproveStatus(null);
         expenseInfoService.updateAllColumnById(expenseInfo);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 38 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/ExepenseYunListener.java

@@ -7,8 +7,10 @@ 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.ExpenseInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.entity.TranSettlementReport;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IExpenseInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.ITranSettlementReportService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,9 +30,14 @@ public class ExepenseYunListener extends AbstractWorkflowTaskListener {
     private ITranSettlementReportService tranSettlementReportService;
     @Autowired
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ExpenseInfo expenseInfo = expenseInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (expenseInfo == null) {
             return;
         }
@@ -48,8 +55,28 @@ public class ExepenseYunListener extends AbstractWorkflowTaskListener {
                     tranSettlementReportService.updateById(tranSettlementReport);
                 }
             }
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             expenseInfo.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         expenseInfoService.updateAllColumnById(expenseInfo);
     }
@@ -73,9 +100,17 @@ public class ExepenseYunListener extends AbstractWorkflowTaskListener {
             }
         }
         expenseInfoService.updateAllColumnById(expenseInfo);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 56 - 9
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/FuelFingListener.java

@@ -9,7 +9,9 @@ import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ExpenseInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.FuelFillingInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.ShortFillingInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IExpenseInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IFuelFillingInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IShortFillingInfoService;
@@ -29,9 +31,14 @@ public class FuelFingListener extends AbstractWorkflowTaskListener {
     private IExpenseInfoService expenseInfoService;
     @Autowired
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         FuelFillingInfo fuelFillingInfo = fuelFillingInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (fuelFillingInfo == null) {
             ShortFillingInfo shortFillingInfo = shortFillingInfoService.selectById(businessKey);
             if (processIsEnd) {
@@ -39,8 +46,28 @@ public class FuelFingListener extends AbstractWorkflowTaskListener {
 //                shortFillingInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
                 shortFillingInfo.setWorkflowId(null);
                 shortFillingInfo.setApproveStatus(null);
+
+                if(statusRecord1 != null){
+                    statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                    statusRecordMapper.updateById(statusRecord1);
+                }
+                else{
+                    statusRecord.setId(businessKey);
+                    statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                    statusRecordMapper.insert(statusRecord);
+                }
             } else {
                 shortFillingInfo.setApproveStatus(status);
+
+                if(statusRecord1 != null){
+                    statusRecord1.setStatus(status);
+                    statusRecordMapper.updateById(statusRecord1);
+                }
+                else{
+                    statusRecord.setId(businessKey);
+                    statusRecord.setStatus(status);
+                    statusRecordMapper.insert(statusRecord);
+                }
             }
             shortFillingInfoService.updateAllColumnById(shortFillingInfo);
             if (shortFillingInfo == null) {
@@ -52,14 +79,26 @@ public class FuelFingListener extends AbstractWorkflowTaskListener {
             fuelFillingInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
             fuelFillingInfo.setWorkflowId(null);
             fuelFillingInfo.setApproveStatus(null);
-//            ExpenseInfo expenseInfo=expenseInfoService.selectById(fuelFillingInfo.getExpenseId());
-//            if (expenseInfo!=null){
-//                expenseInfo.setStatusFlag(StatusEnum.COST_PAYMENT.getFlag());
-//                expenseInfo.setStatus(StatusEnum.COST_PAYMENT.getName());
-//                expenseInfoService.updateAllColumnById(expenseInfo);
-//            }
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             fuelFillingInfo.setApproveStatus(status);
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         fuelFillingInfoService.updateAllColumnById(fuelFillingInfo);
     }
@@ -85,9 +124,17 @@ public class FuelFingListener extends AbstractWorkflowTaskListener {
 //            expenseInfoService.updateAllColumnById(expenseInfo);
 //        }
         fuelFillingInfoService.updateAllColumnById(fuelFillingInfo);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 38 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/GeneralAuditInfoListener.java

@@ -8,7 +8,9 @@ import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.GeneralAuditInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchasePrice;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IGeneralAuditInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -22,9 +24,14 @@ public class GeneralAuditInfoListener extends AbstractWorkflowTaskListener {
     private IGeneralAuditInfoService generalAuditInfoService;
     @Autowired
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         GeneralAuditInfo generalAuditInfo = generalAuditInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (generalAuditInfo == null) {
             return;
         }
@@ -33,8 +40,28 @@ public class GeneralAuditInfoListener extends AbstractWorkflowTaskListener {
             generalAuditInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
             generalAuditInfo.setWorkflowId(null);
             generalAuditInfo.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             generalAuditInfo.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         generalAuditInfoService.updateAllColumnById(generalAuditInfo);
     }
@@ -49,9 +76,17 @@ public class GeneralAuditInfoListener extends AbstractWorkflowTaskListener {
         generalAuditInfo.setStatus(StatusEnum.PURCHASE_FAILED.getName());
         generalAuditInfo.setApproveStatus(null);
         generalAuditInfoService.updateAllColumnById(generalAuditInfo);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 38 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/GoodsPurchaseReceiptReportListener.java

@@ -7,8 +7,10 @@ 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.PurchaseReceiptReport;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.entity.StockPurchaseReceiptReport;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.IStockPurchaseReceiptReportService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +25,14 @@ public class GoodsPurchaseReceiptReportListener extends AbstractWorkflowTaskList
     private IStockPurchaseReceiptReportService stockPurchaseReceiptReportService;
     @Autowired
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd  ) {
         StockPurchaseReceiptReport purchaseReceiptReport = stockPurchaseReceiptReportService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (purchaseReceiptReport == null) {
             return;
         }
@@ -34,8 +41,28 @@ public class GoodsPurchaseReceiptReportListener extends AbstractWorkflowTaskList
             purchaseReceiptReport.setStatus(StatusEnum.ORDER_PASSED.getName());
             purchaseReceiptReport.setWorkflowId(null);
             purchaseReceiptReport.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             purchaseReceiptReport.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         stockPurchaseReceiptReportService.updateAllColumnById(purchaseReceiptReport);
     }
@@ -50,9 +77,17 @@ public class GoodsPurchaseReceiptReportListener extends AbstractWorkflowTaskList
         purchaseReceiptReport.setStatus(StatusEnum.TASK_RETURN.getName());
         purchaseReceiptReport.setApproveStatus(null);
         stockPurchaseReceiptReportService.updateAllColumnById(purchaseReceiptReport);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 38 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/InOutWharehoseTaskListener.java

@@ -8,7 +8,9 @@ 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.InOutWarehouseTask;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IInOutWarehouseTaskService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +25,14 @@ public class InOutWharehoseTaskListener extends AbstractWorkflowTaskListener {
     private IInOutWarehouseTaskService iInOutWarehouseTaskService;
     @Autowired
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         InOutWarehouseTask inOutWarehouseTask = iInOutWarehouseTaskService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (inOutWarehouseTask == null) {
             return;
         }
@@ -34,8 +41,28 @@ public class InOutWharehoseTaskListener extends AbstractWorkflowTaskListener {
             inOutWarehouseTask.setTaskStatus(StatusEnum.TASK_DO.getName());
             inOutWarehouseTask.setWorkflowId(null);
             inOutWarehouseTask.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             inOutWarehouseTask.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         iInOutWarehouseTaskService.updateAllColumnById(inOutWarehouseTask);
     }
@@ -50,9 +77,17 @@ public class InOutWharehoseTaskListener extends AbstractWorkflowTaskListener {
         inOutWarehouseTask.setTaskStatus(StatusEnum.TASK_RETURN.getName());
         inOutWarehouseTask.setApproveStatus(null);
         iInOutWarehouseTaskService.updateAllColumnById(inOutWarehouseTask);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 38 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/NonContractExpensesListener.java

@@ -8,7 +8,9 @@ import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ContractCostInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.NonContractExpenses;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractCostInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.INonContractExpensesService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +25,14 @@ public class NonContractExpensesListener extends AbstractWorkflowTaskListener {
     private INonContractExpensesService nonContractExpensesService;
     @Autowired
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         NonContractExpenses nonContractExpenses = nonContractExpensesService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (nonContractExpenses == null) {
             return;
         }
@@ -34,8 +41,28 @@ public class NonContractExpensesListener extends AbstractWorkflowTaskListener {
             nonContractExpenses.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
             nonContractExpenses.setWorkflowId(null);
             nonContractExpenses.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             nonContractExpenses.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         nonContractExpensesService.updateAllColumnById(nonContractExpenses);
     }
@@ -50,9 +77,17 @@ public class NonContractExpensesListener extends AbstractWorkflowTaskListener {
         nonContractExpenses.setStatus(StatusEnum.TASK_RETURN.getName());
         nonContractExpenses.setApproveStatus(null);
         nonContractExpensesService.updateAllColumnById(nonContractExpenses);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 38 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/ProcurementOrderListener.java

@@ -8,7 +8,9 @@ import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.InOutWarehouseTask;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseOrder;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IInOutWarehouseTaskService;
 import com.yh.saas.plugin.yiliangyiyun.service.IProcurementPlanInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseOrderService;
@@ -24,9 +26,14 @@ public class ProcurementOrderListener extends AbstractWorkflowTaskListener {
     private IPurchaseOrderService iPurchaseOrderService;
     @Autowired
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         PurchaseOrder purchaseOrder = iPurchaseOrderService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (purchaseOrder == null) {
             return;
         }
@@ -35,8 +42,28 @@ public class ProcurementOrderListener extends AbstractWorkflowTaskListener {
             purchaseOrder.setStatus(StatusEnum.ORDER_PASSED.getName());
             purchaseOrder.setWorkflowId(null);
             purchaseOrder.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             purchaseOrder.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         iPurchaseOrderService.updateAllColumnById(purchaseOrder);
     }
@@ -51,9 +78,17 @@ public class ProcurementOrderListener extends AbstractWorkflowTaskListener {
         purchaseOrder.setStatus(StatusEnum.TASK_RETURN.getName());
         purchaseOrder.setApproveStatus(null);
         iPurchaseOrderService.updateAllColumnById(purchaseOrder);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 38 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/PurchaseClosingReportListener.java

@@ -8,7 +8,9 @@ import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseClosingReport;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseClosingReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +25,14 @@ public class PurchaseClosingReportListener extends AbstractWorkflowTaskListener
     private IPurchaseClosingReportService purchaseClosingReportService;
     @Autowired
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         PurchaseClosingReport purchaseReceiptReport = purchaseClosingReportService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (purchaseReceiptReport == null) {
             return;
         }
@@ -34,8 +41,28 @@ public class PurchaseClosingReportListener extends AbstractWorkflowTaskListener
             purchaseReceiptReport.setStatus(StatusEnum.ORDER_PASSED.getName());
             purchaseReceiptReport.setWorkflowId(null);
             purchaseReceiptReport.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             purchaseReceiptReport.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         purchaseClosingReportService.updateAllColumnById(purchaseReceiptReport);
     }
@@ -50,9 +77,17 @@ public class PurchaseClosingReportListener extends AbstractWorkflowTaskListener
         purchaseReceiptReport.setStatus(StatusEnum.TASK_RETURN.getName());
         purchaseReceiptReport.setApproveStatus(null);
         purchaseClosingReportService.updateAllColumnById(purchaseReceiptReport);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 38 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/PurchaseReceiptReportListener.java

@@ -8,7 +8,9 @@ import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseOrder;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseOrderService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +25,14 @@ public class PurchaseReceiptReportListener extends AbstractWorkflowTaskListener
     private IPurchaseReceiptReportService purchaseReceiptReportService;
     @Autowired
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         PurchaseReceiptReport purchaseReceiptReport = purchaseReceiptReportService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (purchaseReceiptReport == null) {
             return;
         }
@@ -34,8 +41,28 @@ public class PurchaseReceiptReportListener extends AbstractWorkflowTaskListener
             purchaseReceiptReport.setStatus(StatusEnum.ORDER_PASSED.getName());
             purchaseReceiptReport.setWorkflowId(null);
             purchaseReceiptReport.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             purchaseReceiptReport.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         purchaseReceiptReportService.updateAllColumnById(purchaseReceiptReport);
     }
@@ -50,9 +77,17 @@ public class PurchaseReceiptReportListener extends AbstractWorkflowTaskListener
         purchaseReceiptReport.setStatus(StatusEnum.TASK_RETURN.getName());
         purchaseReceiptReport.setApproveStatus(null);
         purchaseReceiptReportService.updateAllColumnById(purchaseReceiptReport);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 38 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/QingjiaListener.java

@@ -7,7 +7,9 @@ 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.LeaveInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.ILeaveInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -21,9 +23,14 @@ public class QingjiaListener extends AbstractWorkflowTaskListener {
     private ILeaveInfoService leaveInfoService;
     @Autowired
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         LeaveInfo leaveInfo = leaveInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (leaveInfo == null) {
             return;
         }
@@ -32,8 +39,28 @@ public class QingjiaListener extends AbstractWorkflowTaskListener {
             leaveInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
             leaveInfo.setWorkflowId(null);
             leaveInfo.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             leaveInfo.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         leaveInfoService.updateAllColumnById(leaveInfo);
     }
@@ -48,9 +75,17 @@ public class QingjiaListener extends AbstractWorkflowTaskListener {
         leaveInfo.setStatus(StatusEnum.PURCHASE_FAILED.getName());
         leaveInfo.setApproveStatus(null);
         leaveInfoService.updateAllColumnById(leaveInfo);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 38 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/SaleCloseReportListener.java

@@ -8,7 +8,9 @@ import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseClosingReport;
 import com.yh.saas.plugin.yiliangyiyun.entity.SalesClosingReport;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseClosingReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISalesClosingReportService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +25,14 @@ public class SaleCloseReportListener extends AbstractWorkflowTaskListener {
     private ISalesClosingReportService salesClosingReportService;
     @Autowired
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         SalesClosingReport salesClosingReport = salesClosingReportService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (salesClosingReport == null) {
             return;
         }
@@ -34,8 +41,28 @@ public class SaleCloseReportListener extends AbstractWorkflowTaskListener {
             salesClosingReport.setStatus(StatusEnum.ORDER_PASSED.getName());
             salesClosingReport.setWorkflowId(null);
             salesClosingReport.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             salesClosingReport.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         salesClosingReportService.updateAllColumnById(salesClosingReport);
     }
@@ -50,9 +77,17 @@ public class SaleCloseReportListener extends AbstractWorkflowTaskListener {
         salesClosingReport.setStatus(StatusEnum.TASK_RETURN.getName());
         salesClosingReport.setApproveStatus(null);
         salesClosingReportService.updateAllColumnById(salesClosingReport);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 38 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/SaleContractListener.java

@@ -8,7 +8,9 @@ import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.SaleOrder;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISaleOrderService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +25,14 @@ public class SaleContractListener extends AbstractWorkflowTaskListener {
     private IContractManagementInfoService contractManagementInfoService;
     @Autowired
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (contractManagementInfo == null) {
             return;
         }
@@ -34,8 +41,28 @@ public class SaleContractListener extends AbstractWorkflowTaskListener {
             contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
             contractManagementInfo.setWorkflowId(null);
             contractManagementInfo.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             contractManagementInfo.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
     }
@@ -50,9 +77,17 @@ public class SaleContractListener extends AbstractWorkflowTaskListener {
         contractManagementInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractManagementInfo.setApproveStatus(null);
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 37 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/SaleOrderListener.java

@@ -8,7 +8,9 @@ import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseOrder;
 import com.yh.saas.plugin.yiliangyiyun.entity.SaleOrder;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseOrderService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISaleOrderService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,10 +24,13 @@ public class SaleOrderListener extends AbstractWorkflowTaskListener {
     @Autowired
     private ISaleOrderService saleOrderService;
     @Autowired
-    private IAuditHistoryService auditHistoryService;
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         SaleOrder saleOrder = saleOrderService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (saleOrderService == null) {
             return;
         }
@@ -34,8 +39,28 @@ public class SaleOrderListener extends AbstractWorkflowTaskListener {
             saleOrder.setStatus(StatusEnum.ORDER_PASSED.getName());
             saleOrder.setWorkflowId(null);
             saleOrder.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             saleOrder.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         saleOrderService.updateAllColumnById(saleOrder);
     }
@@ -50,9 +75,17 @@ public class SaleOrderListener extends AbstractWorkflowTaskListener {
         saleOrder.setStatus(StatusEnum.TASK_RETURN.getName());
         saleOrder.setApproveStatus(null);
         saleOrderService.updateAllColumnById(saleOrder);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 37 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/SaleOutReportListener.java

@@ -8,7 +8,9 @@ import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
 import com.yh.saas.plugin.yiliangyiyun.entity.SalesDeliveryReport;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISalesDeliveryReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISearchRecordsInfoService;
@@ -23,10 +25,13 @@ public class SaleOutReportListener extends AbstractWorkflowTaskListener {
     @Autowired
     private ISalesDeliveryReportService salesDeliveryReportService;
     @Autowired
-    private IAuditHistoryService auditHistoryService;
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         SalesDeliveryReport salesDeliveryReport = salesDeliveryReportService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (salesDeliveryReport == null) {
             return;
         }
@@ -35,8 +40,28 @@ public class SaleOutReportListener extends AbstractWorkflowTaskListener {
             salesDeliveryReport.setStatus(StatusEnum.ORDER_PASSED.getName());
             salesDeliveryReport.setWorkflowId(null);
             salesDeliveryReport.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             salesDeliveryReport.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         salesDeliveryReportService.updateAllColumnById(salesDeliveryReport);
     }
@@ -51,9 +76,17 @@ public class SaleOutReportListener extends AbstractWorkflowTaskListener {
         salesDeliveryReport.setStatus(StatusEnum.TASK_RETURN.getName());
         salesDeliveryReport.setApproveStatus(null);
         salesDeliveryReportService.updateAllColumnById(salesDeliveryReport);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 37 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/ShouContractListener.java

@@ -7,7 +7,9 @@ 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.ContractManagementInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -20,10 +22,13 @@ public class ShouContractListener extends AbstractWorkflowTaskListener {
     @Autowired
     private IContractManagementInfoService contractManagementInfoService;
     @Autowired
-    private IAuditHistoryService auditHistoryService;
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (contractManagementInfo == null) {
             return;
         }
@@ -32,8 +37,28 @@ public class ShouContractListener extends AbstractWorkflowTaskListener {
             contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
             contractManagementInfo.setWorkflowId(null);
             contractManagementInfo.setApproveStatus(null);
+
+          if(statusRecord1 != null){
+              statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+              statusRecordMapper.updateById(statusRecord1);
+          }
+          else{
+              statusRecord.setId(businessKey);
+              statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+              statusRecordMapper.insert(statusRecord);
+          }
         } else {
             contractManagementInfo.setApproveStatus(status);
+
+          if(statusRecord1 != null){
+              statusRecord1.setStatus(status);
+              statusRecordMapper.updateById(statusRecord1);
+          }
+          else{
+              statusRecord.setId(businessKey);
+              statusRecord.setStatus(status);
+              statusRecordMapper.insert(statusRecord);
+          }
       }
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
     }
@@ -48,9 +73,17 @@ public class ShouContractListener extends AbstractWorkflowTaskListener {
         contractManagementInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractManagementInfo.setApproveStatus(null);
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 37 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/TradeServicesListener.java

@@ -6,8 +6,10 @@ import com.winsea.svc.base.base.service.IAuditHistoryService;
 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.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.entity.TradeWarehouseReceiptAppl;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.ITradeWarehouseReceiptApplService;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -20,10 +22,13 @@ public class TradeServicesListener extends AbstractWorkflowTaskListener {
     @Autowired
     private ITradeWarehouseReceiptApplService tradeWarehouseReceiptApplService;
     @Autowired
-    private IAuditHistoryService auditHistoryService;
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         TradeWarehouseReceiptAppl tradeWarehouseReceiptAppl = tradeWarehouseReceiptApplService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (tradeWarehouseReceiptAppl == null) {
             return;
         }
@@ -32,8 +37,28 @@ public class TradeServicesListener extends AbstractWorkflowTaskListener {
             tradeWarehouseReceiptAppl.setStatus(StatusEnum.TO_BE_TRADERETURN.getName());
             tradeWarehouseReceiptAppl.setWorkflowId(null);
             tradeWarehouseReceiptAppl.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             tradeWarehouseReceiptAppl.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         tradeWarehouseReceiptApplService.updateAllColumnById(tradeWarehouseReceiptAppl);
     }
@@ -48,9 +73,17 @@ public class TradeServicesListener extends AbstractWorkflowTaskListener {
         tradeWarehouseReceiptAppl.setStatus(StatusEnum.RETURN_TRADE_WAREHOUSE_RECEIPT.getName());
         tradeWarehouseReceiptAppl.setApproveStatus(null);
         tradeWarehouseReceiptApplService.updateAllColumnById(tradeWarehouseReceiptAppl);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 37 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/TranProessListener.java

@@ -7,9 +7,11 @@ import com.yh.saas.common.support.util.IdGenerator;
 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.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.entity.TranPriceApprove;
 import com.yh.saas.plugin.yiliangyiyun.entity.TranProcessInfo;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.ITranPriceApproveService;
 import com.yh.saas.plugin.yiliangyiyun.service.ITranProcessInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,10 +27,13 @@ public class TranProessListener extends AbstractWorkflowTaskListener {
     @Autowired
     private ITranPriceApproveService tranPriceApproveService;
     @Autowired
-    private IAuditHistoryService auditHistoryService;
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         TranProcessInfo tranProcessInfo = tranProcessInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (tranProcessInfo == null) {
             return;
         }
@@ -59,8 +64,28 @@ public class TranProessListener extends AbstractWorkflowTaskListener {
                 tranPriceApprove.setTranPrice(tranProcessInfo.getTranPrice() != 0 ? tranProcessInfo.getTranPrice() : tranProcessInfo.getTranPriceCar());
                 tranPriceApproveService.insert(tranPriceApprove);
             }
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             tranProcessInfo.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         tranProcessInfoService.updateAllColumnById(tranProcessInfo);
     }
@@ -75,9 +100,17 @@ public class TranProessListener extends AbstractWorkflowTaskListener {
         tranProcessInfo.setPriceStatusCar(StatusEnum.GRAIN_ADOPT.getName());
         tranProcessInfo.setApproveStatus(null);
         tranProcessInfoService.updateAllColumnById(tranProcessInfo);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

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

@@ -8,8 +8,10 @@ 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.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.entity.TranSettlementReport;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IBatchReviewInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.ITranSettlementReportService;
@@ -29,11 +31,14 @@ public class TranSettlementReportListener extends AbstractWorkflowTaskListener {
     @Autowired
     private IBatchReviewInfoService batchReviewInfoService;
     @Autowired
-    private IAuditHistoryService auditHistoryService;
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
 //        TranSettlementReport tranSettlementReport = tranSettlementReportService.selectById(businessKey);
         BatchReviewInfo batchReviewInfo = batchReviewInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (batchReviewInfo == null) {
             return;
         }
@@ -43,9 +48,29 @@ public class TranSettlementReportListener extends AbstractWorkflowTaskListener {
             batchReviewInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
             batchReviewInfo.setWorkflowId(null);
             batchReviewInfo.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
             flag =1;
         } else {
             batchReviewInfo.setApproveStatus(status);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         batchReviewInfoService.updateAllColumnById(batchReviewInfo);
 
@@ -97,9 +122,17 @@ public class TranSettlementReportListener extends AbstractWorkflowTaskListener {
                 tranSettlementReportService.updateAllColumnById(settlementReport);
             }
         }
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 38 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/WarehousingDebitListener.java

@@ -6,8 +6,10 @@ import com.winsea.svc.base.base.service.IAuditHistoryService;
 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.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.entity.WarehousingOrder;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IWarehousingOrderService;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -20,10 +22,13 @@ public class WarehousingDebitListener extends AbstractWorkflowTaskListener {
     @Autowired
     private IWarehousingOrderService warehousingOrderService;
     @Autowired
-    private IAuditHistoryService auditHistoryService;
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         WarehousingOrder warehousingOrder = warehousingOrderService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (warehousingOrder == null) {
             return;
         }
@@ -32,8 +37,29 @@ public class WarehousingDebitListener extends AbstractWorkflowTaskListener {
             warehousingOrder.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
             warehousingOrder.setWorkflowId(null);
             warehousingOrder.setApproveStatus(null);
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                statusRecordMapper.insert(statusRecord);
+            }
         } else {
             warehousingOrder.setApproveStatus(status);
+
+
+            if(statusRecord1 != null){
+                statusRecord1.setStatus(status);
+                statusRecordMapper.updateById(statusRecord1);
+            }
+            else{
+                statusRecord.setId(businessKey);
+                statusRecord.setStatus(status);
+                statusRecordMapper.insert(statusRecord);
+            }
         }
         warehousingOrderService.updateAllColumnById(warehousingOrder);
     }
@@ -48,9 +74,17 @@ public class WarehousingDebitListener extends AbstractWorkflowTaskListener {
         warehousingOrder.setStatus(StatusEnum.TASK_RETURN.getName());
         warehousingOrder.setApproveStatus(null);
         warehousingOrderService.updateAllColumnById(warehousingOrder);
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 27 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/WarehousingOrderListener.java

@@ -6,8 +6,10 @@ import com.winsea.svc.base.base.service.IAuditHistoryService;
 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.StatusRecord;
 import com.yh.saas.plugin.yiliangyiyun.entity.WarehousingOrder;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IWarehousingOrderService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,10 +25,13 @@ public class WarehousingOrderListener extends AbstractWorkflowTaskListener {
     @Autowired
     private IWarehousingOrderService warehousingOrderService;
     @Autowired
-    private IAuditHistoryService auditHistoryService;
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         List<WarehousingOrder> list = warehousingOrderService.selectList(new EntityWrapper<WarehousingOrder>().eq("batch_id",businessKey));
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         for(WarehousingOrder warehousingOrder : list){
             if (warehousingOrder == null) {
                 return;
@@ -36,6 +41,16 @@ public class WarehousingOrderListener extends AbstractWorkflowTaskListener {
                 warehousingOrder.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
                 warehousingOrder.setWorkflowId(null);
                 warehousingOrder.setApproveStatus(null);
+
+                if(statusRecord1 != null){
+                    statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
+                    statusRecordMapper.updateById(statusRecord1);
+                }
+                else{
+                    statusRecord.setId(businessKey);
+                    statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
+                    statusRecordMapper.insert(statusRecord);
+                }
             } else {
                 warehousingOrder.setApproveStatus(status);
             }
@@ -58,9 +73,17 @@ public class WarehousingOrderListener extends AbstractWorkflowTaskListener {
             warehousingOrderService.updateAllColumnById(warehousingOrder);
         }
 
-//        auditHistoryService.delete(new EntityWrapper<AuditHistory>()
-//                .eq("business_id",businessKey));
-//        commonUserMapper.deleteWorkHis(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
+        if(statusRecord1 != null){
+            statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.updateById(statusRecord1);
+        }
+        else{
+            statusRecord.setId(businessKey);
+            statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
+            statusRecordMapper.insert(statusRecord);
+        }
     }
 
 }

+ 23 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/CommonUserMapper.xml

@@ -143,6 +143,27 @@
     </select>
 
 
+
+    <select id="getLastStatus" parameterType="Map" resultType="java.lang.String">
+        SELECT
+        hit.NAME_
+        FROM
+        ACT_HI_PROCINST hip
+        left join
+        ACT_HI_TASKINST hit
+        on
+        hip.PROC_INST_ID_ = hit.PROC_INST_ID_
+        WHERE
+        hip.BUSINESS_KEY_ = #{businessId}
+        and
+        hit.NAME_ != '_PLACEHOLDER_'
+         ORDER BY
+        hit.END_TIME_ DESC
+    </select>
+
+
+
+
     <select id="getListByConditionMy" parameterType="Map"
             resultType="com.winsea.svc.notice.entity.NoticeTaskInfo">
         SELECT
@@ -192,6 +213,8 @@
             LIMIT ${startRecord}, ${pageSize}
         </if>
     </select>
+
+
     <select id="getTaskCountByCondition" parameterType="Map" resultType="java.lang.Integer">
         SELECT
         count(id)

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/StatusRecordMapper.xml

@@ -0,0 +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.StatusRecordMapper">
+
+</mapper>