|
@@ -1,48 +1,41 @@
|
|
|
package com.yh.saas.plugin.yiliangyiyun.workflow;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
-import com.winsea.svc.base.base.entity.AuditHistory;
|
|
|
import com.winsea.svc.base.base.service.IAuditHistoryService;
|
|
|
import com.yh.saas.common.support.workflow.AbstractWorkflowTaskListener;
|
|
|
import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.PurchasePrice;
|
|
|
-import com.yh.saas.plugin.yiliangyiyun.entity.SaleOrder;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.SalesTransferInfo;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IPurchasePriceService;
|
|
|
-import com.yh.saas.plugin.yiliangyiyun.service.ISaleOrderService;
|
|
|
-import com.yh.saas.toolkit.workflow.service.IWorkflowHistoryService;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.service.ISalesTransferInfoService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
-@WorkflowTaskListener(name = "收购管理", group = "仓库设置")
|
|
|
-public class AcquisitionListener extends AbstractWorkflowTaskListener {
|
|
|
+@WorkflowTaskListener(name = "仓库管理", group = "销售转移")
|
|
|
+public class SalesTransferInfoListener extends AbstractWorkflowTaskListener {
|
|
|
|
|
|
private static final long serialVersionUID = 4103656734835351132L;
|
|
|
|
|
|
@Autowired
|
|
|
- private IPurchasePriceService purchasePriceService;
|
|
|
- @Autowired
|
|
|
- private IAuditHistoryService auditHistoryService;
|
|
|
- @Autowired
|
|
|
- private CommonUserMapper commonUserMapper;
|
|
|
+ private ISalesTransferInfoService salesTransferInfoService;
|
|
|
@Autowired
|
|
|
private StatusRecordMapper statusRecordMapper;
|
|
|
|
|
|
@Override
|
|
|
public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
|
|
|
- PurchasePrice purchasePrice = purchasePriceService.selectById(businessKey);
|
|
|
+ SalesTransferInfo salesTransferInfo = salesTransferInfoService.selectById(businessKey);
|
|
|
StatusRecord statusRecord = new StatusRecord();
|
|
|
StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
|
|
|
- if (purchasePrice == null) {
|
|
|
+ if (salesTransferInfo == null) {
|
|
|
return;
|
|
|
}
|
|
|
if (processIsEnd) {
|
|
|
- purchasePrice.setStatusFlag(StatusEnum.ORDER_PASSED.getFlag());
|
|
|
- purchasePrice.setStatus(StatusEnum.ORDER_PASSED.getName());
|
|
|
- purchasePrice.setWorkflowId(null);
|
|
|
- purchasePrice.setApproveStatus(null);
|
|
|
+ salesTransferInfo.setStatusFlag(StatusEnum.ORDER_PASSED.getFlag());
|
|
|
+ salesTransferInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
|
|
|
+ salesTransferInfo.setWorkflowId(null);
|
|
|
+ salesTransferInfo.setApproveStatus(null);
|
|
|
|
|
|
if(statusRecord1 != null){
|
|
|
statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
|
|
@@ -54,7 +47,7 @@ public class AcquisitionListener extends AbstractWorkflowTaskListener {
|
|
|
statusRecordMapper.insert(statusRecord);
|
|
|
}
|
|
|
} else {
|
|
|
- purchasePrice.setApproveStatus(status);
|
|
|
+ salesTransferInfo.setApproveStatus(status);
|
|
|
|
|
|
if(statusRecord1 != null){
|
|
|
statusRecord1.setStatus(status);
|
|
@@ -66,19 +59,19 @@ public class AcquisitionListener extends AbstractWorkflowTaskListener {
|
|
|
statusRecordMapper.insert(statusRecord);
|
|
|
}
|
|
|
}
|
|
|
- purchasePriceService.updateAllColumnById(purchasePrice);
|
|
|
+ salesTransferInfoService.updateAllColumnById(salesTransferInfo);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void handleRejectApplicationRepulsed(String workflowId, String businessKey, boolean needReapply) {
|
|
|
- PurchasePrice purchasePrice = purchasePriceService.selectById(businessKey);
|
|
|
- if (purchasePrice == null) {
|
|
|
+ SalesTransferInfo salesTransferInfo = salesTransferInfoService.selectById(businessKey);
|
|
|
+ if (salesTransferInfo == null) {
|
|
|
return;
|
|
|
}
|
|
|
- purchasePrice.setStatusFlag(StatusEnum.PURCHASE_FAILED.getFlag());
|
|
|
- purchasePrice.setStatus(StatusEnum.PURCHASE_FAILED.getName());
|
|
|
- purchasePrice.setApproveStatus(null);
|
|
|
- purchasePriceService.updateAllColumnById(purchasePrice);
|
|
|
+ salesTransferInfo.setStatusFlag(StatusEnum.PURCHASE_FAILED.getFlag());
|
|
|
+ salesTransferInfo.setStatus(StatusEnum.PURCHASE_FAILED.getName());
|
|
|
+ salesTransferInfo.setApproveStatus(null);
|
|
|
+ salesTransferInfoService.updateAllColumnById(salesTransferInfo);
|
|
|
StatusRecord statusRecord = new StatusRecord();
|
|
|
StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
|
|
|
if(statusRecord1 != null){
|