新增生产计划模块审批回调监听
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package com.zt.plat.module.bpm.service.mes.plan;
|
||||
|
||||
import com.zt.plat.module.bpm.api.event.BpmProcessInstanceStatusEvent;
|
||||
import com.zt.plat.module.bpm.api.event.BpmProcessInstanceStatusEventListener;
|
||||
import com.zt.plat.module.product.api.dto.MesApprovalCallbackVO;
|
||||
import com.zt.plat.module.product.api.plan.MesCompanyPlanApi;
|
||||
import com.zt.plat.module.product.enums.plan.CompanyPlanTypeEnums;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class MesCompanyPlanStatusListener extends BpmProcessInstanceStatusEventListener {
|
||||
|
||||
@Resource
|
||||
private MesCompanyPlanApi mesCompanyPlanApi;
|
||||
|
||||
@Override
|
||||
protected List<String> getProcessDefinitionKey() {
|
||||
return Arrays.stream(CompanyPlanTypeEnums.values()).map(CompanyPlanTypeEnums::getProcessKey).toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onEvent(BpmProcessInstanceStatusEvent event) {
|
||||
mesCompanyPlanApi.updateApprovalStatus(new MesApprovalCallbackVO()
|
||||
.setInstanceId(event.getId())
|
||||
.setBusinessKey(event.getBusinessKey())
|
||||
.setStatus(event.getStatus())
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.zt.plat.module.bpm.service.mes.plan;
|
||||
|
||||
import com.zt.plat.module.bpm.api.event.BpmProcessInstanceStatusEvent;
|
||||
import com.zt.plat.module.bpm.api.event.BpmProcessInstanceStatusEventListener;
|
||||
import com.zt.plat.module.product.api.dto.MesApprovalCallbackVO;
|
||||
import com.zt.plat.module.product.api.plan.MesFactoryPlanApi;
|
||||
import com.zt.plat.module.product.enums.plan.FactoryPlanTypeEnums;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class MesFactoryPlanStatusListener extends BpmProcessInstanceStatusEventListener {
|
||||
|
||||
@Resource
|
||||
private MesFactoryPlanApi mesFactoryPlanApi;
|
||||
|
||||
@Override
|
||||
protected List<String> getProcessDefinitionKey() {
|
||||
return Arrays.stream(FactoryPlanTypeEnums.values()).map(FactoryPlanTypeEnums::getProcessKey).toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onEvent(BpmProcessInstanceStatusEvent event) {
|
||||
mesFactoryPlanApi.updateApprovalStatus(new MesApprovalCallbackVO()
|
||||
.setInstanceId(event.getId())
|
||||
.setBusinessKey(event.getBusinessKey())
|
||||
.setStatus(event.getStatus())
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user