gongdecai 4 лет назад
Родитель
Сommit
374d49fdaa

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

@@ -4,6 +4,7 @@ package com.yh.saas.plugin.yiliangyiyun.service.impl;
 import com.alipay.sofa.runtime.api.annotation.SofaService;
 import com.winsea.svc.base.base.util.DateUtils;
 import com.yh.saas.common.support.util.IdGenerator;
+import com.yh.saas.plugin.base.service.ICommonBillOperateHisService;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ContractProcessInfo;
 import com.yh.saas.plugin.yiliangyiyun.mapper.ContractManagementInfoMapper;
@@ -47,7 +48,8 @@ import java.net.URLDecoder;
 public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManagementInfoMapper, ContractManagementInfo> implements IContractManagementInfoService {
     @Autowired
     private IContractGoodsInfoService contractGoodsInfoService;
-
+    @Autowired
+    private ICommonBillOperateHisService billOperateHisService;
     @Autowired
     private IContractProcessInfoService contractProcessInfoService;
     @Value("${file-root-path}")
@@ -75,6 +77,12 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
         boolean one = this.insert(contractManagementInfo);
         boolean two = contractGoodsInfoService.insert(contractGoodsInfo);
         boolean three = contractProcessInfoService.insert(contractProcessInfo);
+
+        // 插入操作历史
+        String staffName = this.billOperateHisService.getStaffAndName();
+        // 插入操作历史
+        this.billOperateHisService.saveBillOperateHis(contractManagementInfo.getId(), "CONTRACT", staffName, null,
+                StatusEnum.CONTRACT_WAIT.getName(), StatusEnum.CONTRACT_WAIT.getName(), "");
         // 假如 都成功返回ok
         if (one && two && three) {
             return "OK";
@@ -168,6 +176,11 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
                 contractManagementInfo.setStatus(StatusEnum.CONTRACT_DO.getName());
             }
             this.updateById(contractManagementInfo);
+            // 插入操作历史
+            String staffName = this.billOperateHisService.getStaffAndName();
+            // 插入操作历史
+            this.billOperateHisService.saveBillOperateHis(contractManagementInfo.getId(), "CONTRACT", staffName, null,
+                    contractManagementInfo.getStatus(), null, "");
             return "OK";
         }
         return "NG";