1
0

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 {
     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
      * @return
      */
      */
     List<NoticeTaskInfo> getListByConditionMy(Map<String, Object> pageView);
     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.NumberConstant;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.exception.*;
 import com.yh.saas.plugin.yiliangyiyun.exception.*;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.CollectionUtils;
 import com.google.common.collect.Sets;
 import com.google.common.collect.Sets;
 import com.winsea.svc.base.base.entity.*;
 import com.winsea.svc.base.base.entity.*;
@@ -83,6 +84,8 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
     private IStaffVesselBizService staffVesselService;
     private IStaffVesselBizService staffVesselService;
     @Autowired
     @Autowired
     private StringRedisTemplate userRedisTemplate;
     private StringRedisTemplate userRedisTemplate;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
 
 
     @Autowired
     @Autowired
     private IIdentityAuthenticationInfoService iIdentityAuthenticationInfoService;
     private IIdentityAuthenticationInfoService iIdentityAuthenticationInfoService;
@@ -900,6 +903,15 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
         // 查询总数
         // 查询总数
         Integer dataCount = baseMapper.getCountByConditionMy(pageView);
         Integer dataCount = baseMapper.getCountByConditionMy(pageView);
         List<NoticeTaskInfo> dataList = baseMapper.getListByConditionMy(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<NoticeTaskInfo> page = new Page<>();
         page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
         page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
         page.setTotal(dataCount == null ? 0 : dataCount);
         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.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchasePrice;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchasePrice;
 import com.yh.saas.plugin.yiliangyiyun.entity.SaleOrder;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchasePriceService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchasePriceService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISaleOrderService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISaleOrderService;
 import com.yh.saas.toolkit.workflow.service.IWorkflowHistoryService;
 import com.yh.saas.toolkit.workflow.service.IWorkflowHistoryService;
@@ -25,10 +27,14 @@ public class AcquisitionListener extends AbstractWorkflowTaskListener {
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
     @Autowired
     @Autowired
     private CommonUserMapper commonUserMapper;
     private CommonUserMapper commonUserMapper;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
 
 
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         PurchasePrice purchasePrice = purchasePriceService.selectById(businessKey);
         PurchasePrice purchasePrice = purchasePriceService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (purchasePrice == null) {
         if (purchasePrice == null) {
             return;
             return;
         }
         }
@@ -37,8 +43,28 @@ public class AcquisitionListener extends AbstractWorkflowTaskListener {
             purchasePrice.setStatus(StatusEnum.ORDER_PASSED.getName());
             purchasePrice.setStatus(StatusEnum.ORDER_PASSED.getName());
             purchasePrice.setWorkflowId(null);
             purchasePrice.setWorkflowId(null);
             purchasePrice.setApproveStatus(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 {
         } else {
             purchasePrice.setApproveStatus(status);
             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);
         purchasePriceService.updateAllColumnById(purchasePrice);
     }
     }
@@ -53,9 +79,17 @@ public class AcquisitionListener extends AbstractWorkflowTaskListener {
         purchasePrice.setStatus(StatusEnum.PURCHASE_FAILED.getName());
         purchasePrice.setStatus(StatusEnum.PURCHASE_FAILED.getName());
         purchasePrice.setApproveStatus(null);
         purchasePrice.setApproveStatus(null);
         purchasePriceService.updateAllColumnById(purchasePrice);
         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.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.PaymentManagement;
 import com.yh.saas.plugin.yiliangyiyun.entity.PaymentManagement;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchasePrice;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IPaymentManagementService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPaymentManagementService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchasePriceService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchasePriceService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,6 +19,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 public class AcquisitionPayListener extends AbstractWorkflowTaskListener {
 public class AcquisitionPayListener extends AbstractWorkflowTaskListener {
 
 
     private static final long serialVersionUID = 4103656734835351132L;
     private static final long serialVersionUID = 4103656734835351132L;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
 
 
     @Autowired
     @Autowired
     private IPaymentManagementService paymentManagementService;
     private IPaymentManagementService paymentManagementService;
@@ -27,6 +31,8 @@ public class AcquisitionPayListener extends AbstractWorkflowTaskListener {
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         PaymentManagement paymentManagement = paymentManagementService.selectById(businessKey);
         PaymentManagement paymentManagement = paymentManagementService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (paymentManagement == null) {
         if (paymentManagement == null) {
             return;
             return;
         }
         }
@@ -35,8 +41,28 @@ public class AcquisitionPayListener extends AbstractWorkflowTaskListener {
             paymentManagement.setStatus(StatusEnum.ORDER_PASSED.getName());
             paymentManagement.setStatus(StatusEnum.ORDER_PASSED.getName());
             paymentManagement.setWorkflowId(null);
             paymentManagement.setWorkflowId(null);
             paymentManagement.setApproveStatus(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 {
         } else {
             paymentManagement.setApproveStatus(status);
             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);
         paymentManagementService.updateAllColumnById(paymentManagement);
     }
     }
@@ -51,9 +77,17 @@ public class AcquisitionPayListener extends AbstractWorkflowTaskListener {
         paymentManagement.setStatus(StatusEnum.TASK_RETURN.getName());
         paymentManagement.setStatus(StatusEnum.TASK_RETURN.getName());
         paymentManagement.setApproveStatus(null);
         paymentManagement.setApproveStatus(null);
         paymentManagementService.updateAllColumnById(paymentManagement);
         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.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ClockInfo;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IClockInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IClockInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 
 
@@ -15,6 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 public class BukaListener extends AbstractWorkflowTaskListener {
 public class BukaListener extends AbstractWorkflowTaskListener {
 
 
     private static final long serialVersionUID = 4103656734835351132L;
     private static final long serialVersionUID = 4103656734835351132L;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
 
 
     @Autowired
     @Autowired
     private IClockInfoService clockInfoService;
     private IClockInfoService clockInfoService;
@@ -25,6 +29,8 @@ public class BukaListener extends AbstractWorkflowTaskListener {
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ClockInfo clockInfo = clockInfoService.selectById(businessKey);
         ClockInfo clockInfo = clockInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (clockInfo == null) {
         if (clockInfo == null) {
             return;
             return;
         }
         }
@@ -33,8 +39,28 @@ public class BukaListener extends AbstractWorkflowTaskListener {
             clockInfo.setStatus(StatusEnum.SUPP_SUCCESS.getName());
             clockInfo.setStatus(StatusEnum.SUPP_SUCCESS.getName());
             clockInfo.setWorkflowId(null);
             clockInfo.setWorkflowId(null);
             clockInfo.setApproveStatus(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 {
         } else {
             clockInfo.setApproveStatus(status);
             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);
         clockInfoService.updateAllColumnById(clockInfo);
     }
     }
@@ -49,9 +75,17 @@ public class BukaListener extends AbstractWorkflowTaskListener {
         clockInfo.setStatus(StatusEnum.SUPP_FAIL.getName());
         clockInfo.setStatus(StatusEnum.SUPP_FAIL.getName());
         clockInfo.setApproveStatus(null);
         clockInfo.setApproveStatus(null);
         clockInfoService.updateAllColumnById(clockInfo);
         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.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 
 
@@ -15,6 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 public class BuyContractListener extends AbstractWorkflowTaskListener {
 public class BuyContractListener extends AbstractWorkflowTaskListener {
 
 
     private static final long serialVersionUID = 4103656734835351132L;
     private static final long serialVersionUID = 4103656734835351132L;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
 
 
     @Autowired
     @Autowired
     private IContractManagementInfoService contractManagementInfoService;
     private IContractManagementInfoService contractManagementInfoService;
@@ -25,6 +29,8 @@ public class BuyContractListener extends AbstractWorkflowTaskListener {
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
         ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (contractManagementInfo == null) {
         if (contractManagementInfo == null) {
             return;
             return;
         }
         }
@@ -33,8 +39,28 @@ public class BuyContractListener extends AbstractWorkflowTaskListener {
             contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
             contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
             contractManagementInfo.setWorkflowId(null);
             contractManagementInfo.setWorkflowId(null);
             contractManagementInfo.setApproveStatus(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 {
         } else {
             contractManagementInfo.setApproveStatus(status);
             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);
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
     }
     }
@@ -49,9 +75,17 @@ public class BuyContractListener extends AbstractWorkflowTaskListener {
         contractManagementInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractManagementInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractManagementInfo.setApproveStatus(null);
         contractManagementInfo.setApproveStatus(null);
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
         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.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ContractCostInfo;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractCostInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractCostInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 
 
@@ -15,6 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 public class ContractCostInfoListener extends AbstractWorkflowTaskListener {
 public class ContractCostInfoListener extends AbstractWorkflowTaskListener {
 
 
     private static final long serialVersionUID = 4103656734835351132L;
     private static final long serialVersionUID = 4103656734835351132L;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
 
 
     @Autowired
     @Autowired
     private IContractCostInfoService contractCostInfoService;
     private IContractCostInfoService contractCostInfoService;
@@ -25,6 +29,8 @@ public class ContractCostInfoListener extends AbstractWorkflowTaskListener {
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ContractCostInfo contractCostInfo = contractCostInfoService.selectById(businessKey);
         ContractCostInfo contractCostInfo = contractCostInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (contractCostInfo == null) {
         if (contractCostInfo == null) {
             return;
             return;
         }
         }
@@ -33,8 +39,28 @@ public class ContractCostInfoListener extends AbstractWorkflowTaskListener {
             contractCostInfo.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
             contractCostInfo.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
             contractCostInfo.setWorkflowId(null);
             contractCostInfo.setWorkflowId(null);
             contractCostInfo.setApproveStatus(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 {
         } else {
             contractCostInfo.setApproveStatus(status);
             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);
         contractCostInfoService.updateAllColumnById(contractCostInfo);
     }
     }
@@ -49,9 +75,17 @@ public class ContractCostInfoListener extends AbstractWorkflowTaskListener {
         contractCostInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractCostInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractCostInfo.setApproveStatus(null);
         contractCostInfo.setApproveStatus(null);
         contractCostInfoService.updateAllColumnById(contractCostInfo);
         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.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 
 
@@ -15,6 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 public class DcContractListener extends AbstractWorkflowTaskListener {
 public class DcContractListener extends AbstractWorkflowTaskListener {
 
 
     private static final long serialVersionUID = 4103656734835351132L;
     private static final long serialVersionUID = 4103656734835351132L;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
 
 
     @Autowired
     @Autowired
     private IContractManagementInfoService contractManagementInfoService;
     private IContractManagementInfoService contractManagementInfoService;
@@ -25,6 +29,8 @@ public class DcContractListener extends AbstractWorkflowTaskListener {
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
         ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (contractManagementInfo == null) {
         if (contractManagementInfo == null) {
             return;
             return;
         }
         }
@@ -33,8 +39,28 @@ public class DcContractListener extends AbstractWorkflowTaskListener {
             contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
             contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
             contractManagementInfo.setWorkflowId(null);
             contractManagementInfo.setWorkflowId(null);
             contractManagementInfo.setApproveStatus(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 {
         } else {
             contractManagementInfo.setApproveStatus(status);
             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);
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
     }
     }
@@ -49,9 +75,17 @@ public class DcContractListener extends AbstractWorkflowTaskListener {
         contractManagementInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractManagementInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractManagementInfo.setApproveStatus(null);
         contractManagementInfo.setApproveStatus(null);
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
         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.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.CollectionWarehousingRecord;
 import com.yh.saas.plugin.yiliangyiyun.entity.CollectionWarehousingRecord;
 import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.ICollectionWarehousingRecordService;
 import com.yh.saas.plugin.yiliangyiyun.service.ICollectionWarehousingRecordService;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +25,14 @@ public class DsContractListListener extends AbstractWorkflowTaskListener {
     private ICollectionWarehousingRecordService collectionWarehousingRecordService;
     private ICollectionWarehousingRecordService collectionWarehousingRecordService;
     @Autowired
     @Autowired
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         CollectionWarehousingRecord collectionWarehousingRecord = collectionWarehousingRecordService.selectById(businessKey);
         CollectionWarehousingRecord collectionWarehousingRecord = collectionWarehousingRecordService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (collectionWarehousingRecord == null) {
         if (collectionWarehousingRecord == null) {
             return;
             return;
         }
         }
@@ -34,8 +41,28 @@ public class DsContractListListener extends AbstractWorkflowTaskListener {
             collectionWarehousingRecord.setStatus(StatusEnum.PASSED_COMP.getName());
             collectionWarehousingRecord.setStatus(StatusEnum.PASSED_COMP.getName());
             collectionWarehousingRecord.setWorkflowId(null);
             collectionWarehousingRecord.setWorkflowId(null);
             collectionWarehousingRecord.setApproveStatus(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 {
         } else {
             collectionWarehousingRecord.setApproveStatus(status);
             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);
         collectionWarehousingRecordService.updateAllColumnById(collectionWarehousingRecord);
     }
     }
@@ -50,9 +77,17 @@ public class DsContractListListener extends AbstractWorkflowTaskListener {
         collectionWarehousingRecord.setStatus(StatusEnum.TASK_RETURN.getName());
         collectionWarehousingRecord.setStatus(StatusEnum.TASK_RETURN.getName());
         collectionWarehousingRecord.setApproveStatus(null);
         collectionWarehousingRecord.setApproveStatus(null);
         collectionWarehousingRecordService.updateAllColumnById(collectionWarehousingRecord);
         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.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 
 
@@ -21,9 +23,14 @@ public class DsContractListener extends AbstractWorkflowTaskListener {
     private IContractManagementInfoService contractManagementInfoService;
     private IContractManagementInfoService contractManagementInfoService;
     @Autowired
     @Autowired
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
         ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (contractManagementInfo == null) {
         if (contractManagementInfo == null) {
             return;
             return;
         }
         }
@@ -32,8 +39,28 @@ public class DsContractListener extends AbstractWorkflowTaskListener {
             contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
             contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
             contractManagementInfo.setWorkflowId(null);
             contractManagementInfo.setWorkflowId(null);
             contractManagementInfo.setApproveStatus(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 {
         } else {
             contractManagementInfo.setApproveStatus(status);
             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);
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
     }
     }
@@ -48,9 +75,17 @@ public class DsContractListener extends AbstractWorkflowTaskListener {
         contractManagementInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractManagementInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractManagementInfo.setApproveStatus(null);
         contractManagementInfo.setApproveStatus(null);
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
         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.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ExpenseInfo;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IExpenseInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IExpenseInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchasePriceService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchasePriceService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,9 +24,14 @@ public class ExepenseInfoListener extends AbstractWorkflowTaskListener {
     private IExpenseInfoService expenseInfoService;
     private IExpenseInfoService expenseInfoService;
     @Autowired
     @Autowired
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ExpenseInfo expenseInfo = expenseInfoService.selectById(businessKey);
         ExpenseInfo expenseInfo = expenseInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (expenseInfo == null) {
         if (expenseInfo == null) {
             return;
             return;
         }
         }
@@ -33,8 +40,28 @@ public class ExepenseInfoListener extends AbstractWorkflowTaskListener {
             expenseInfo.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
             expenseInfo.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
             expenseInfo.setWorkflowId(null);
             expenseInfo.setWorkflowId(null);
             expenseInfo.setApproveStatus(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 {
         } else {
             expenseInfo.setApproveStatus(status);
             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);
         expenseInfoService.updateAllColumnById(expenseInfo);
     }
     }
@@ -49,9 +76,17 @@ public class ExepenseInfoListener extends AbstractWorkflowTaskListener {
         expenseInfo.setStatus(StatusEnum.PURCHASE_FAILED.getName());
         expenseInfo.setStatus(StatusEnum.PURCHASE_FAILED.getName());
         expenseInfo.setApproveStatus(null);
         expenseInfo.setApproveStatus(null);
         expenseInfoService.updateAllColumnById(expenseInfo);
         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.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ExpenseInfo;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IExpenseInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IExpenseInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 
 
@@ -21,9 +23,14 @@ public class ExepenseListener extends AbstractWorkflowTaskListener {
     private IExpenseInfoService expenseInfoService;
     private IExpenseInfoService expenseInfoService;
     @Autowired
     @Autowired
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ExpenseInfo expenseInfo = expenseInfoService.selectById(businessKey);
         ExpenseInfo expenseInfo = expenseInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (expenseInfo == null) {
         if (expenseInfo == null) {
             return;
             return;
         }
         }
@@ -32,8 +39,28 @@ public class ExepenseListener extends AbstractWorkflowTaskListener {
             expenseInfo.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
             expenseInfo.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
             expenseInfo.setWorkflowId(null);
             expenseInfo.setWorkflowId(null);
             expenseInfo.setApproveStatus(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 {
         } else {
             expenseInfo.setApproveStatus(status);
             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);
         expenseInfoService.updateAllColumnById(expenseInfo);
     }
     }
@@ -48,9 +75,17 @@ public class ExepenseListener extends AbstractWorkflowTaskListener {
         expenseInfo.setStatus(StatusEnum.PURCHASE_FAILED.getName());
         expenseInfo.setStatus(StatusEnum.PURCHASE_FAILED.getName());
         expenseInfo.setApproveStatus(null);
         expenseInfo.setApproveStatus(null);
         expenseInfoService.updateAllColumnById(expenseInfo);
         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.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ExpenseInfo;
 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.entity.TranSettlementReport;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
 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.IExpenseInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.ITranSettlementReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.ITranSettlementReportService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,9 +30,14 @@ public class ExepenseYunListener extends AbstractWorkflowTaskListener {
     private ITranSettlementReportService tranSettlementReportService;
     private ITranSettlementReportService tranSettlementReportService;
     @Autowired
     @Autowired
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ExpenseInfo expenseInfo = expenseInfoService.selectById(businessKey);
         ExpenseInfo expenseInfo = expenseInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (expenseInfo == null) {
         if (expenseInfo == null) {
             return;
             return;
         }
         }
@@ -48,8 +55,28 @@ public class ExepenseYunListener extends AbstractWorkflowTaskListener {
                     tranSettlementReportService.updateById(tranSettlementReport);
                     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 {
         } else {
             expenseInfo.setApproveStatus(status);
             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);
         expenseInfoService.updateAllColumnById(expenseInfo);
     }
     }
@@ -73,9 +100,17 @@ public class ExepenseYunListener extends AbstractWorkflowTaskListener {
             }
             }
         }
         }
         expenseInfoService.updateAllColumnById(expenseInfo);
         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.ExpenseInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.FuelFillingInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.FuelFillingInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.ShortFillingInfo;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IExpenseInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IExpenseInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IFuelFillingInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IFuelFillingInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IShortFillingInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IShortFillingInfoService;
@@ -29,9 +31,14 @@ public class FuelFingListener extends AbstractWorkflowTaskListener {
     private IExpenseInfoService expenseInfoService;
     private IExpenseInfoService expenseInfoService;
     @Autowired
     @Autowired
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         FuelFillingInfo fuelFillingInfo = fuelFillingInfoService.selectById(businessKey);
         FuelFillingInfo fuelFillingInfo = fuelFillingInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (fuelFillingInfo == null) {
         if (fuelFillingInfo == null) {
             ShortFillingInfo shortFillingInfo = shortFillingInfoService.selectById(businessKey);
             ShortFillingInfo shortFillingInfo = shortFillingInfoService.selectById(businessKey);
             if (processIsEnd) {
             if (processIsEnd) {
@@ -39,8 +46,28 @@ public class FuelFingListener extends AbstractWorkflowTaskListener {
 //                shortFillingInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
 //                shortFillingInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
                 shortFillingInfo.setWorkflowId(null);
                 shortFillingInfo.setWorkflowId(null);
                 shortFillingInfo.setApproveStatus(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 {
             } else {
                 shortFillingInfo.setApproveStatus(status);
                 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);
             shortFillingInfoService.updateAllColumnById(shortFillingInfo);
             if (shortFillingInfo == null) {
             if (shortFillingInfo == null) {
@@ -52,14 +79,26 @@ public class FuelFingListener extends AbstractWorkflowTaskListener {
             fuelFillingInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
             fuelFillingInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
             fuelFillingInfo.setWorkflowId(null);
             fuelFillingInfo.setWorkflowId(null);
             fuelFillingInfo.setApproveStatus(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 {
         } else {
             fuelFillingInfo.setApproveStatus(status);
             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);
         fuelFillingInfoService.updateAllColumnById(fuelFillingInfo);
     }
     }
@@ -85,9 +124,17 @@ public class FuelFingListener extends AbstractWorkflowTaskListener {
 //            expenseInfoService.updateAllColumnById(expenseInfo);
 //            expenseInfoService.updateAllColumnById(expenseInfo);
 //        }
 //        }
         fuelFillingInfoService.updateAllColumnById(fuelFillingInfo);
         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.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.GeneralAuditInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.GeneralAuditInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchasePrice;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IGeneralAuditInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IGeneralAuditInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 
 
@@ -22,9 +24,14 @@ public class GeneralAuditInfoListener extends AbstractWorkflowTaskListener {
     private IGeneralAuditInfoService generalAuditInfoService;
     private IGeneralAuditInfoService generalAuditInfoService;
     @Autowired
     @Autowired
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         GeneralAuditInfo generalAuditInfo = generalAuditInfoService.selectById(businessKey);
         GeneralAuditInfo generalAuditInfo = generalAuditInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (generalAuditInfo == null) {
         if (generalAuditInfo == null) {
             return;
             return;
         }
         }
@@ -33,8 +40,28 @@ public class GeneralAuditInfoListener extends AbstractWorkflowTaskListener {
             generalAuditInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
             generalAuditInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
             generalAuditInfo.setWorkflowId(null);
             generalAuditInfo.setWorkflowId(null);
             generalAuditInfo.setApproveStatus(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 {
         } else {
             generalAuditInfo.setApproveStatus(status);
             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);
         generalAuditInfoService.updateAllColumnById(generalAuditInfo);
     }
     }
@@ -49,9 +76,17 @@ public class GeneralAuditInfoListener extends AbstractWorkflowTaskListener {
         generalAuditInfo.setStatus(StatusEnum.PURCHASE_FAILED.getName());
         generalAuditInfo.setStatus(StatusEnum.PURCHASE_FAILED.getName());
         generalAuditInfo.setApproveStatus(null);
         generalAuditInfo.setApproveStatus(null);
         generalAuditInfoService.updateAllColumnById(generalAuditInfo);
         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.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
 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.entity.StockPurchaseReceiptReport;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
 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.IPurchaseReceiptReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.IStockPurchaseReceiptReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.IStockPurchaseReceiptReportService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +25,14 @@ public class GoodsPurchaseReceiptReportListener extends AbstractWorkflowTaskList
     private IStockPurchaseReceiptReportService stockPurchaseReceiptReportService;
     private IStockPurchaseReceiptReportService stockPurchaseReceiptReportService;
     @Autowired
     @Autowired
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd  ) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd  ) {
         StockPurchaseReceiptReport purchaseReceiptReport = stockPurchaseReceiptReportService.selectById(businessKey);
         StockPurchaseReceiptReport purchaseReceiptReport = stockPurchaseReceiptReportService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (purchaseReceiptReport == null) {
         if (purchaseReceiptReport == null) {
             return;
             return;
         }
         }
@@ -34,8 +41,28 @@ public class GoodsPurchaseReceiptReportListener extends AbstractWorkflowTaskList
             purchaseReceiptReport.setStatus(StatusEnum.ORDER_PASSED.getName());
             purchaseReceiptReport.setStatus(StatusEnum.ORDER_PASSED.getName());
             purchaseReceiptReport.setWorkflowId(null);
             purchaseReceiptReport.setWorkflowId(null);
             purchaseReceiptReport.setApproveStatus(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 {
         } else {
             purchaseReceiptReport.setApproveStatus(status);
             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);
         stockPurchaseReceiptReportService.updateAllColumnById(purchaseReceiptReport);
     }
     }
@@ -50,9 +77,17 @@ public class GoodsPurchaseReceiptReportListener extends AbstractWorkflowTaskList
         purchaseReceiptReport.setStatus(StatusEnum.TASK_RETURN.getName());
         purchaseReceiptReport.setStatus(StatusEnum.TASK_RETURN.getName());
         purchaseReceiptReport.setApproveStatus(null);
         purchaseReceiptReport.setApproveStatus(null);
         stockPurchaseReceiptReportService.updateAllColumnById(purchaseReceiptReport);
         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.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.InOutWarehouseTask;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IInOutWarehouseTaskService;
 import com.yh.saas.plugin.yiliangyiyun.service.IInOutWarehouseTaskService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +25,14 @@ public class InOutWharehoseTaskListener extends AbstractWorkflowTaskListener {
     private IInOutWarehouseTaskService iInOutWarehouseTaskService;
     private IInOutWarehouseTaskService iInOutWarehouseTaskService;
     @Autowired
     @Autowired
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         InOutWarehouseTask inOutWarehouseTask = iInOutWarehouseTaskService.selectById(businessKey);
         InOutWarehouseTask inOutWarehouseTask = iInOutWarehouseTaskService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (inOutWarehouseTask == null) {
         if (inOutWarehouseTask == null) {
             return;
             return;
         }
         }
@@ -34,8 +41,28 @@ public class InOutWharehoseTaskListener extends AbstractWorkflowTaskListener {
             inOutWarehouseTask.setTaskStatus(StatusEnum.TASK_DO.getName());
             inOutWarehouseTask.setTaskStatus(StatusEnum.TASK_DO.getName());
             inOutWarehouseTask.setWorkflowId(null);
             inOutWarehouseTask.setWorkflowId(null);
             inOutWarehouseTask.setApproveStatus(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 {
         } else {
             inOutWarehouseTask.setApproveStatus(status);
             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);
         iInOutWarehouseTaskService.updateAllColumnById(inOutWarehouseTask);
     }
     }
@@ -50,9 +77,17 @@ public class InOutWharehoseTaskListener extends AbstractWorkflowTaskListener {
         inOutWarehouseTask.setTaskStatus(StatusEnum.TASK_RETURN.getName());
         inOutWarehouseTask.setTaskStatus(StatusEnum.TASK_RETURN.getName());
         inOutWarehouseTask.setApproveStatus(null);
         inOutWarehouseTask.setApproveStatus(null);
         iInOutWarehouseTaskService.updateAllColumnById(inOutWarehouseTask);
         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.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ContractCostInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.ContractCostInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.NonContractExpenses;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractCostInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractCostInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.INonContractExpensesService;
 import com.yh.saas.plugin.yiliangyiyun.service.INonContractExpensesService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +25,14 @@ public class NonContractExpensesListener extends AbstractWorkflowTaskListener {
     private INonContractExpensesService nonContractExpensesService;
     private INonContractExpensesService nonContractExpensesService;
     @Autowired
     @Autowired
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         NonContractExpenses nonContractExpenses = nonContractExpensesService.selectById(businessKey);
         NonContractExpenses nonContractExpenses = nonContractExpensesService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (nonContractExpenses == null) {
         if (nonContractExpenses == null) {
             return;
             return;
         }
         }
@@ -34,8 +41,28 @@ public class NonContractExpensesListener extends AbstractWorkflowTaskListener {
             nonContractExpenses.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
             nonContractExpenses.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
             nonContractExpenses.setWorkflowId(null);
             nonContractExpenses.setWorkflowId(null);
             nonContractExpenses.setApproveStatus(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 {
         } else {
             nonContractExpenses.setApproveStatus(status);
             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);
         nonContractExpensesService.updateAllColumnById(nonContractExpenses);
     }
     }
@@ -50,9 +77,17 @@ public class NonContractExpensesListener extends AbstractWorkflowTaskListener {
         nonContractExpenses.setStatus(StatusEnum.TASK_RETURN.getName());
         nonContractExpenses.setStatus(StatusEnum.TASK_RETURN.getName());
         nonContractExpenses.setApproveStatus(null);
         nonContractExpenses.setApproveStatus(null);
         nonContractExpensesService.updateAllColumnById(nonContractExpenses);
         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.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.InOutWarehouseTask;
 import com.yh.saas.plugin.yiliangyiyun.entity.InOutWarehouseTask;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseOrder;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IInOutWarehouseTaskService;
 import com.yh.saas.plugin.yiliangyiyun.service.IInOutWarehouseTaskService;
 import com.yh.saas.plugin.yiliangyiyun.service.IProcurementPlanInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IProcurementPlanInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseOrderService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseOrderService;
@@ -24,9 +26,14 @@ public class ProcurementOrderListener extends AbstractWorkflowTaskListener {
     private IPurchaseOrderService iPurchaseOrderService;
     private IPurchaseOrderService iPurchaseOrderService;
     @Autowired
     @Autowired
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         PurchaseOrder purchaseOrder = iPurchaseOrderService.selectById(businessKey);
         PurchaseOrder purchaseOrder = iPurchaseOrderService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (purchaseOrder == null) {
         if (purchaseOrder == null) {
             return;
             return;
         }
         }
@@ -35,8 +42,28 @@ public class ProcurementOrderListener extends AbstractWorkflowTaskListener {
             purchaseOrder.setStatus(StatusEnum.ORDER_PASSED.getName());
             purchaseOrder.setStatus(StatusEnum.ORDER_PASSED.getName());
             purchaseOrder.setWorkflowId(null);
             purchaseOrder.setWorkflowId(null);
             purchaseOrder.setApproveStatus(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 {
         } else {
             purchaseOrder.setApproveStatus(status);
             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);
         iPurchaseOrderService.updateAllColumnById(purchaseOrder);
     }
     }
@@ -51,9 +78,17 @@ public class ProcurementOrderListener extends AbstractWorkflowTaskListener {
         purchaseOrder.setStatus(StatusEnum.TASK_RETURN.getName());
         purchaseOrder.setStatus(StatusEnum.TASK_RETURN.getName());
         purchaseOrder.setApproveStatus(null);
         purchaseOrder.setApproveStatus(null);
         iPurchaseOrderService.updateAllColumnById(purchaseOrder);
         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.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseClosingReport;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseClosingReport;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseClosingReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseClosingReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +25,14 @@ public class PurchaseClosingReportListener extends AbstractWorkflowTaskListener
     private IPurchaseClosingReportService purchaseClosingReportService;
     private IPurchaseClosingReportService purchaseClosingReportService;
     @Autowired
     @Autowired
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         PurchaseClosingReport purchaseReceiptReport = purchaseClosingReportService.selectById(businessKey);
         PurchaseClosingReport purchaseReceiptReport = purchaseClosingReportService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (purchaseReceiptReport == null) {
         if (purchaseReceiptReport == null) {
             return;
             return;
         }
         }
@@ -34,8 +41,28 @@ public class PurchaseClosingReportListener extends AbstractWorkflowTaskListener
             purchaseReceiptReport.setStatus(StatusEnum.ORDER_PASSED.getName());
             purchaseReceiptReport.setStatus(StatusEnum.ORDER_PASSED.getName());
             purchaseReceiptReport.setWorkflowId(null);
             purchaseReceiptReport.setWorkflowId(null);
             purchaseReceiptReport.setApproveStatus(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 {
         } else {
             purchaseReceiptReport.setApproveStatus(status);
             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);
         purchaseClosingReportService.updateAllColumnById(purchaseReceiptReport);
     }
     }
@@ -50,9 +77,17 @@ public class PurchaseClosingReportListener extends AbstractWorkflowTaskListener
         purchaseReceiptReport.setStatus(StatusEnum.TASK_RETURN.getName());
         purchaseReceiptReport.setStatus(StatusEnum.TASK_RETURN.getName());
         purchaseReceiptReport.setApproveStatus(null);
         purchaseReceiptReport.setApproveStatus(null);
         purchaseClosingReportService.updateAllColumnById(purchaseReceiptReport);
         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.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseOrder;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseOrder;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseOrderService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseOrderService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +25,14 @@ public class PurchaseReceiptReportListener extends AbstractWorkflowTaskListener
     private IPurchaseReceiptReportService purchaseReceiptReportService;
     private IPurchaseReceiptReportService purchaseReceiptReportService;
     @Autowired
     @Autowired
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         PurchaseReceiptReport purchaseReceiptReport = purchaseReceiptReportService.selectById(businessKey);
         PurchaseReceiptReport purchaseReceiptReport = purchaseReceiptReportService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (purchaseReceiptReport == null) {
         if (purchaseReceiptReport == null) {
             return;
             return;
         }
         }
@@ -34,8 +41,28 @@ public class PurchaseReceiptReportListener extends AbstractWorkflowTaskListener
             purchaseReceiptReport.setStatus(StatusEnum.ORDER_PASSED.getName());
             purchaseReceiptReport.setStatus(StatusEnum.ORDER_PASSED.getName());
             purchaseReceiptReport.setWorkflowId(null);
             purchaseReceiptReport.setWorkflowId(null);
             purchaseReceiptReport.setApproveStatus(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 {
         } else {
             purchaseReceiptReport.setApproveStatus(status);
             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);
         purchaseReceiptReportService.updateAllColumnById(purchaseReceiptReport);
     }
     }
@@ -50,9 +77,17 @@ public class PurchaseReceiptReportListener extends AbstractWorkflowTaskListener
         purchaseReceiptReport.setStatus(StatusEnum.TASK_RETURN.getName());
         purchaseReceiptReport.setStatus(StatusEnum.TASK_RETURN.getName());
         purchaseReceiptReport.setApproveStatus(null);
         purchaseReceiptReport.setApproveStatus(null);
         purchaseReceiptReportService.updateAllColumnById(purchaseReceiptReport);
         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.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.LeaveInfo;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.ILeaveInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.ILeaveInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 
 
@@ -21,9 +23,14 @@ public class QingjiaListener extends AbstractWorkflowTaskListener {
     private ILeaveInfoService leaveInfoService;
     private ILeaveInfoService leaveInfoService;
     @Autowired
     @Autowired
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         LeaveInfo leaveInfo = leaveInfoService.selectById(businessKey);
         LeaveInfo leaveInfo = leaveInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (leaveInfo == null) {
         if (leaveInfo == null) {
             return;
             return;
         }
         }
@@ -32,8 +39,28 @@ public class QingjiaListener extends AbstractWorkflowTaskListener {
             leaveInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
             leaveInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
             leaveInfo.setWorkflowId(null);
             leaveInfo.setWorkflowId(null);
             leaveInfo.setApproveStatus(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 {
         } else {
             leaveInfo.setApproveStatus(status);
             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);
         leaveInfoService.updateAllColumnById(leaveInfo);
     }
     }
@@ -48,9 +75,17 @@ public class QingjiaListener extends AbstractWorkflowTaskListener {
         leaveInfo.setStatus(StatusEnum.PURCHASE_FAILED.getName());
         leaveInfo.setStatus(StatusEnum.PURCHASE_FAILED.getName());
         leaveInfo.setApproveStatus(null);
         leaveInfo.setApproveStatus(null);
         leaveInfoService.updateAllColumnById(leaveInfo);
         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.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseClosingReport;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseClosingReport;
 import com.yh.saas.plugin.yiliangyiyun.entity.SalesClosingReport;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseClosingReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseClosingReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISalesClosingReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISalesClosingReportService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +25,14 @@ public class SaleCloseReportListener extends AbstractWorkflowTaskListener {
     private ISalesClosingReportService salesClosingReportService;
     private ISalesClosingReportService salesClosingReportService;
     @Autowired
     @Autowired
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         SalesClosingReport salesClosingReport = salesClosingReportService.selectById(businessKey);
         SalesClosingReport salesClosingReport = salesClosingReportService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (salesClosingReport == null) {
         if (salesClosingReport == null) {
             return;
             return;
         }
         }
@@ -34,8 +41,28 @@ public class SaleCloseReportListener extends AbstractWorkflowTaskListener {
             salesClosingReport.setStatus(StatusEnum.ORDER_PASSED.getName());
             salesClosingReport.setStatus(StatusEnum.ORDER_PASSED.getName());
             salesClosingReport.setWorkflowId(null);
             salesClosingReport.setWorkflowId(null);
             salesClosingReport.setApproveStatus(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 {
         } else {
             salesClosingReport.setApproveStatus(status);
             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);
         salesClosingReportService.updateAllColumnById(salesClosingReport);
     }
     }
@@ -50,9 +77,17 @@ public class SaleCloseReportListener extends AbstractWorkflowTaskListener {
         salesClosingReport.setStatus(StatusEnum.TASK_RETURN.getName());
         salesClosingReport.setStatus(StatusEnum.TASK_RETURN.getName());
         salesClosingReport.setApproveStatus(null);
         salesClosingReport.setApproveStatus(null);
         salesClosingReportService.updateAllColumnById(salesClosingReport);
         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.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.SaleOrder;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISaleOrderService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISaleOrderService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +25,14 @@ public class SaleContractListener extends AbstractWorkflowTaskListener {
     private IContractManagementInfoService contractManagementInfoService;
     private IContractManagementInfoService contractManagementInfoService;
     @Autowired
     @Autowired
     private IAuditHistoryService auditHistoryService;
     private IAuditHistoryService auditHistoryService;
+    @Autowired
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
         ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (contractManagementInfo == null) {
         if (contractManagementInfo == null) {
             return;
             return;
         }
         }
@@ -34,8 +41,28 @@ public class SaleContractListener extends AbstractWorkflowTaskListener {
             contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
             contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
             contractManagementInfo.setWorkflowId(null);
             contractManagementInfo.setWorkflowId(null);
             contractManagementInfo.setApproveStatus(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 {
         } else {
             contractManagementInfo.setApproveStatus(status);
             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);
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
     }
     }
@@ -50,9 +77,17 @@ public class SaleContractListener extends AbstractWorkflowTaskListener {
         contractManagementInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractManagementInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractManagementInfo.setApproveStatus(null);
         contractManagementInfo.setApproveStatus(null);
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
         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.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseOrder;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseOrder;
 import com.yh.saas.plugin.yiliangyiyun.entity.SaleOrder;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseOrderService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseOrderService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISaleOrderService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISaleOrderService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,10 +24,13 @@ public class SaleOrderListener extends AbstractWorkflowTaskListener {
     @Autowired
     @Autowired
     private ISaleOrderService saleOrderService;
     private ISaleOrderService saleOrderService;
     @Autowired
     @Autowired
-    private IAuditHistoryService auditHistoryService;
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         SaleOrder saleOrder = saleOrderService.selectById(businessKey);
         SaleOrder saleOrder = saleOrderService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (saleOrderService == null) {
         if (saleOrderService == null) {
             return;
             return;
         }
         }
@@ -34,8 +39,28 @@ public class SaleOrderListener extends AbstractWorkflowTaskListener {
             saleOrder.setStatus(StatusEnum.ORDER_PASSED.getName());
             saleOrder.setStatus(StatusEnum.ORDER_PASSED.getName());
             saleOrder.setWorkflowId(null);
             saleOrder.setWorkflowId(null);
             saleOrder.setApproveStatus(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 {
         } else {
             saleOrder.setApproveStatus(status);
             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);
         saleOrderService.updateAllColumnById(saleOrder);
     }
     }
@@ -50,9 +75,17 @@ public class SaleOrderListener extends AbstractWorkflowTaskListener {
         saleOrder.setStatus(StatusEnum.TASK_RETURN.getName());
         saleOrder.setStatus(StatusEnum.TASK_RETURN.getName());
         saleOrder.setApproveStatus(null);
         saleOrder.setApproveStatus(null);
         saleOrderService.updateAllColumnById(saleOrder);
         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.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
 import com.yh.saas.plugin.yiliangyiyun.entity.SalesDeliveryReport;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISalesDeliveryReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISalesDeliveryReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISearchRecordsInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISearchRecordsInfoService;
@@ -23,10 +25,13 @@ public class SaleOutReportListener extends AbstractWorkflowTaskListener {
     @Autowired
     @Autowired
     private ISalesDeliveryReportService salesDeliveryReportService;
     private ISalesDeliveryReportService salesDeliveryReportService;
     @Autowired
     @Autowired
-    private IAuditHistoryService auditHistoryService;
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         SalesDeliveryReport salesDeliveryReport = salesDeliveryReportService.selectById(businessKey);
         SalesDeliveryReport salesDeliveryReport = salesDeliveryReportService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (salesDeliveryReport == null) {
         if (salesDeliveryReport == null) {
             return;
             return;
         }
         }
@@ -35,8 +40,28 @@ public class SaleOutReportListener extends AbstractWorkflowTaskListener {
             salesDeliveryReport.setStatus(StatusEnum.ORDER_PASSED.getName());
             salesDeliveryReport.setStatus(StatusEnum.ORDER_PASSED.getName());
             salesDeliveryReport.setWorkflowId(null);
             salesDeliveryReport.setWorkflowId(null);
             salesDeliveryReport.setApproveStatus(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 {
         } else {
             salesDeliveryReport.setApproveStatus(status);
             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);
         salesDeliveryReportService.updateAllColumnById(salesDeliveryReport);
     }
     }
@@ -51,9 +76,17 @@ public class SaleOutReportListener extends AbstractWorkflowTaskListener {
         salesDeliveryReport.setStatus(StatusEnum.TASK_RETURN.getName());
         salesDeliveryReport.setStatus(StatusEnum.TASK_RETURN.getName());
         salesDeliveryReport.setApproveStatus(null);
         salesDeliveryReport.setApproveStatus(null);
         salesDeliveryReportService.updateAllColumnById(salesDeliveryReport);
         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.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
 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.CommonUserMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 
 
@@ -20,10 +22,13 @@ public class ShouContractListener extends AbstractWorkflowTaskListener {
     @Autowired
     @Autowired
     private IContractManagementInfoService contractManagementInfoService;
     private IContractManagementInfoService contractManagementInfoService;
     @Autowired
     @Autowired
-    private IAuditHistoryService auditHistoryService;
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
         ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (contractManagementInfo == null) {
         if (contractManagementInfo == null) {
             return;
             return;
         }
         }
@@ -32,8 +37,28 @@ public class ShouContractListener extends AbstractWorkflowTaskListener {
             contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
             contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
             contractManagementInfo.setWorkflowId(null);
             contractManagementInfo.setWorkflowId(null);
             contractManagementInfo.setApproveStatus(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 {
         } else {
             contractManagementInfo.setApproveStatus(status);
             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);
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
     }
     }
@@ -48,9 +73,17 @@ public class ShouContractListener extends AbstractWorkflowTaskListener {
         contractManagementInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractManagementInfo.setStatus(StatusEnum.TASK_RETURN.getName());
         contractManagementInfo.setApproveStatus(null);
         contractManagementInfo.setApproveStatus(null);
         contractManagementInfoService.updateAllColumnById(contractManagementInfo);
         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.AbstractWorkflowTaskListener;
 import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 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.entity.TradeWarehouseReceiptAppl;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
 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 com.yh.saas.plugin.yiliangyiyun.service.ITradeWarehouseReceiptApplService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 
 
@@ -20,10 +22,13 @@ public class TradeServicesListener extends AbstractWorkflowTaskListener {
     @Autowired
     @Autowired
     private ITradeWarehouseReceiptApplService tradeWarehouseReceiptApplService;
     private ITradeWarehouseReceiptApplService tradeWarehouseReceiptApplService;
     @Autowired
     @Autowired
-    private IAuditHistoryService auditHistoryService;
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         TradeWarehouseReceiptAppl tradeWarehouseReceiptAppl = tradeWarehouseReceiptApplService.selectById(businessKey);
         TradeWarehouseReceiptAppl tradeWarehouseReceiptAppl = tradeWarehouseReceiptApplService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (tradeWarehouseReceiptAppl == null) {
         if (tradeWarehouseReceiptAppl == null) {
             return;
             return;
         }
         }
@@ -32,8 +37,28 @@ public class TradeServicesListener extends AbstractWorkflowTaskListener {
             tradeWarehouseReceiptAppl.setStatus(StatusEnum.TO_BE_TRADERETURN.getName());
             tradeWarehouseReceiptAppl.setStatus(StatusEnum.TO_BE_TRADERETURN.getName());
             tradeWarehouseReceiptAppl.setWorkflowId(null);
             tradeWarehouseReceiptAppl.setWorkflowId(null);
             tradeWarehouseReceiptAppl.setApproveStatus(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 {
         } else {
             tradeWarehouseReceiptAppl.setApproveStatus(status);
             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);
         tradeWarehouseReceiptApplService.updateAllColumnById(tradeWarehouseReceiptAppl);
     }
     }
@@ -48,9 +73,17 @@ public class TradeServicesListener extends AbstractWorkflowTaskListener {
         tradeWarehouseReceiptAppl.setStatus(StatusEnum.RETURN_TRADE_WAREHOUSE_RECEIPT.getName());
         tradeWarehouseReceiptAppl.setStatus(StatusEnum.RETURN_TRADE_WAREHOUSE_RECEIPT.getName());
         tradeWarehouseReceiptAppl.setApproveStatus(null);
         tradeWarehouseReceiptAppl.setApproveStatus(null);
         tradeWarehouseReceiptApplService.updateAllColumnById(tradeWarehouseReceiptAppl);
         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.AbstractWorkflowTaskListener;
 import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 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.TranPriceApprove;
 import com.yh.saas.plugin.yiliangyiyun.entity.TranProcessInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.TranProcessInfo;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
 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.ITranPriceApproveService;
 import com.yh.saas.plugin.yiliangyiyun.service.ITranProcessInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.ITranProcessInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,10 +27,13 @@ public class TranProessListener extends AbstractWorkflowTaskListener {
     @Autowired
     @Autowired
     private ITranPriceApproveService tranPriceApproveService;
     private ITranPriceApproveService tranPriceApproveService;
     @Autowired
     @Autowired
-    private IAuditHistoryService auditHistoryService;
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         TranProcessInfo tranProcessInfo = tranProcessInfoService.selectById(businessKey);
         TranProcessInfo tranProcessInfo = tranProcessInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (tranProcessInfo == null) {
         if (tranProcessInfo == null) {
             return;
             return;
         }
         }
@@ -59,8 +64,28 @@ public class TranProessListener extends AbstractWorkflowTaskListener {
                 tranPriceApprove.setTranPrice(tranProcessInfo.getTranPrice() != 0 ? tranProcessInfo.getTranPrice() : tranProcessInfo.getTranPriceCar());
                 tranPriceApprove.setTranPrice(tranProcessInfo.getTranPrice() != 0 ? tranProcessInfo.getTranPrice() : tranProcessInfo.getTranPriceCar());
                 tranPriceApproveService.insert(tranPriceApprove);
                 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 {
         } else {
             tranProcessInfo.setApproveStatus(status);
             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);
         tranProcessInfoService.updateAllColumnById(tranProcessInfo);
     }
     }
@@ -75,9 +100,17 @@ public class TranProessListener extends AbstractWorkflowTaskListener {
         tranProcessInfo.setPriceStatusCar(StatusEnum.GRAIN_ADOPT.getName());
         tranProcessInfo.setPriceStatusCar(StatusEnum.GRAIN_ADOPT.getName());
         tranProcessInfo.setApproveStatus(null);
         tranProcessInfo.setApproveStatus(null);
         tranProcessInfoService.updateAllColumnById(tranProcessInfo);
         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.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.BatchReviewInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.BatchReviewInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
 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.entity.TranSettlementReport;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
 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.IBatchReviewInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.ITranSettlementReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.ITranSettlementReportService;
@@ -29,11 +31,14 @@ public class TranSettlementReportListener extends AbstractWorkflowTaskListener {
     @Autowired
     @Autowired
     private IBatchReviewInfoService batchReviewInfoService;
     private IBatchReviewInfoService batchReviewInfoService;
     @Autowired
     @Autowired
-    private IAuditHistoryService auditHistoryService;
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
 //        TranSettlementReport tranSettlementReport = tranSettlementReportService.selectById(businessKey);
 //        TranSettlementReport tranSettlementReport = tranSettlementReportService.selectById(businessKey);
         BatchReviewInfo batchReviewInfo = batchReviewInfoService.selectById(businessKey);
         BatchReviewInfo batchReviewInfo = batchReviewInfoService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (batchReviewInfo == null) {
         if (batchReviewInfo == null) {
             return;
             return;
         }
         }
@@ -43,9 +48,29 @@ public class TranSettlementReportListener extends AbstractWorkflowTaskListener {
             batchReviewInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
             batchReviewInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
             batchReviewInfo.setWorkflowId(null);
             batchReviewInfo.setWorkflowId(null);
             batchReviewInfo.setApproveStatus(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;
             flag =1;
         } else {
         } else {
             batchReviewInfo.setApproveStatus(status);
             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);
         batchReviewInfoService.updateAllColumnById(batchReviewInfo);
 
 
@@ -97,9 +122,17 @@ public class TranSettlementReportListener extends AbstractWorkflowTaskListener {
                 tranSettlementReportService.updateAllColumnById(settlementReport);
                 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.AbstractWorkflowTaskListener;
 import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 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.entity.WarehousingOrder;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
 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 com.yh.saas.plugin.yiliangyiyun.service.IWarehousingOrderService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 
 
@@ -20,10 +22,13 @@ public class WarehousingDebitListener extends AbstractWorkflowTaskListener {
     @Autowired
     @Autowired
     private IWarehousingOrderService warehousingOrderService;
     private IWarehousingOrderService warehousingOrderService;
     @Autowired
     @Autowired
-    private IAuditHistoryService auditHistoryService;
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         WarehousingOrder warehousingOrder = warehousingOrderService.selectById(businessKey);
         WarehousingOrder warehousingOrder = warehousingOrderService.selectById(businessKey);
+        StatusRecord statusRecord = new StatusRecord();
+        StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
         if (warehousingOrder == null) {
         if (warehousingOrder == null) {
             return;
             return;
         }
         }
@@ -32,8 +37,29 @@ public class WarehousingDebitListener extends AbstractWorkflowTaskListener {
             warehousingOrder.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
             warehousingOrder.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
             warehousingOrder.setWorkflowId(null);
             warehousingOrder.setWorkflowId(null);
             warehousingOrder.setApproveStatus(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 {
         } else {
             warehousingOrder.setApproveStatus(status);
             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);
         warehousingOrderService.updateAllColumnById(warehousingOrder);
     }
     }
@@ -48,9 +74,17 @@ public class WarehousingDebitListener extends AbstractWorkflowTaskListener {
         warehousingOrder.setStatus(StatusEnum.TASK_RETURN.getName());
         warehousingOrder.setStatus(StatusEnum.TASK_RETURN.getName());
         warehousingOrder.setApproveStatus(null);
         warehousingOrder.setApproveStatus(null);
         warehousingOrderService.updateAllColumnById(warehousingOrder);
         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.AbstractWorkflowTaskListener;
 import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 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.entity.WarehousingOrder;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
 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.IContractManagementInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IWarehousingOrderService;
 import com.yh.saas.plugin.yiliangyiyun.service.IWarehousingOrderService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,10 +25,13 @@ public class WarehousingOrderListener extends AbstractWorkflowTaskListener {
     @Autowired
     @Autowired
     private IWarehousingOrderService warehousingOrderService;
     private IWarehousingOrderService warehousingOrderService;
     @Autowired
     @Autowired
-    private IAuditHistoryService auditHistoryService;
+    private StatusRecordMapper statusRecordMapper;
+
     @Override
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
         List<WarehousingOrder> list = warehousingOrderService.selectList(new EntityWrapper<WarehousingOrder>().eq("batch_id",businessKey));
         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){
         for(WarehousingOrder warehousingOrder : list){
             if (warehousingOrder == null) {
             if (warehousingOrder == null) {
                 return;
                 return;
@@ -36,6 +41,16 @@ public class WarehousingOrderListener extends AbstractWorkflowTaskListener {
                 warehousingOrder.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
                 warehousingOrder.setStatus(StatusEnum.NOT_COLLECTION_PAY.getName());
                 warehousingOrder.setWorkflowId(null);
                 warehousingOrder.setWorkflowId(null);
                 warehousingOrder.setApproveStatus(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 {
             } else {
                 warehousingOrder.setApproveStatus(status);
                 warehousingOrder.setApproveStatus(status);
             }
             }
@@ -58,9 +73,17 @@ public class WarehousingOrderListener extends AbstractWorkflowTaskListener {
             warehousingOrderService.updateAllColumnById(warehousingOrder);
             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>
 
 
 
 
+
+    <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"
     <select id="getListByConditionMy" parameterType="Map"
             resultType="com.winsea.svc.notice.entity.NoticeTaskInfo">
             resultType="com.winsea.svc.notice.entity.NoticeTaskInfo">
         SELECT
         SELECT
@@ -192,6 +213,8 @@
             LIMIT ${startRecord}, ${pageSize}
             LIMIT ${startRecord}, ${pageSize}
         </if>
         </if>
     </select>
     </select>
+
+
     <select id="getTaskCountByCondition" parameterType="Map" resultType="java.lang.Integer">
     <select id="getTaskCountByCondition" parameterType="Map" resultType="java.lang.Integer">
         SELECT
         SELECT
         count(id)
         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>