Commit b7cb92d0 by 杨清松

合并冲突

parents b6a0d7ba 0f03a8a5
......@@ -69,11 +69,32 @@ public class ContractConfiguration {
return configuration;
}
@Bean("com.xyst.dinas.contract.query.processor.ContractPerformWarningProcessor")
public ContractPerformWarningProcessor performWarningProcessor() {
return new ContractPerformWarningProcessor();
}
//合同变更审批工作流
@Bean
public BizTypeWorkflowConfiguration contractUpdateWorkflowConfig() {
//1.根据业务主体初始化配置类
BizTypeInfo bizTypeInfo = new BizTypeInfo(ContractConstant.BIZ_TYPE_UPDATE,ContractConstant.BIZ_TITLE_UPDATE, ContractConstant.ENTITY_CONTRACT);
BizTypeWorkflowConfiguration configuration = new BizTypeWorkflowConfiguration(bizTypeInfo);
//2.配置触发动作
TriggerCondition triggerCondition = new TriggerCondition();
List<TriggerAction> triggerActions = new ArrayList<>();
triggerActions.add(new TriggerAction("SUBMIT","提交"));
triggerCondition.setTriggerActions(triggerActions);
configuration.setTriggerCondition(triggerCondition);
//3.配置流程监听器
ProcessConfiguration processConfig = new ProcessConfiguration();
processConfig.setProcessEventListener(ContractConstant.CONTRACT_UPDATE_LISTENER);
configuration.setProcessConfiguration(processConfig);
return configuration;
}
@Bean("com.xyst.dinas.contract.query.processor.ContractWarnSettingProcessor")
public ContractWarnSettingProcessor cContractWarnSettingProcessor() {
return new ContractWarnSettingProcessor();
......
......@@ -35,14 +35,20 @@ public class ContractConstant {
/** 流程配置 */
/** 业务类型名称 */
/** 业务类型名称:合同 */
public static final String BIZ_TYPE = "Contract";
/** 业务类型标题 */
public static final String BIZ_TITLE = "合同";
/** 流程监听器 */
public static final String CONTRACT_LISTENER = "com.xyst.dinas.contract.listene.ContractProcessEventListener";
/** 业务类型名称:合同变更 */
public static final String BIZ_TYPE_UPDATE = "ContractUpdate";
/** 业务类型标题 */
public static final String BIZ_TITLE_UPDATE = "合同变更";
/** 流程监听器 */
public static final String CONTRACT_LISTENER = "com.xyst.dinas.contract.listene.ContractProcessEventListener";
public static final String CONTRACT_UPDATE_LISTENER = "com.xyst.dinas.contract.listene.ContractUpdateProcessListener";
}
......@@ -86,25 +86,32 @@ public class ContractServiceImpl implements ContractService {
return obj;
}
@Override
@Transactional
@Override
public void submitFlow(UUID id) {
KObject kobject = contractInfoDao.load(id);
if (needSubmitFlow(kobject)) {
// 调用流程接口发起流程
inzWorkflowService.startWorkflow("SUBMIT", ContractConstant.BIZ_TYPE, kobject.getString("lendReason"),
kobject);
if (needSubmitFlow(ContractConstant.BIZ_TYPE,kobject)) {
inzWorkflowService.startWorkflow("SUBMIT", ContractConstant.BIZ_TYPE, kobject.getString("lendReason"),kobject);
}
}
//变更合同的工作流
public void submitFlowForUpdate(UUID id) {
KObject kobject = contractInfoDao.load(id);
if (needSubmitFlow(ContractConstant.BIZ_TYPE_UPDATE,kobject)) {
inzWorkflowService.startWorkflow("SUBMIT", ContractConstant.BIZ_TYPE_UPDATE, kobject.getString("lendReason"),kobject);
}
}
/**
* 判断提交是否需要走流程
*
* @param bizTypeName 业务类型标识
* @param data
* @return
*/
private boolean needSubmitFlow(KObject data) {
return inzWorkflowService.canStartWotkflow("SUBMIT", ContractConstant.BIZ_TYPE, data);
private boolean needSubmitFlow(String bizTypeName ,KObject data) {
return inzWorkflowService.canStartWotkflow("SUBMIT", bizTypeName, data);
}
@Override
......
package com.xyst.dinas.contract.listener;
import org.springframework.beans.factory.annotation.Autowired;
import com.beecode.bap.workflow.core.BizProcessState;
import com.beecode.inz.workflow.listener.InzBizProcessEvent;
import com.beecode.inz.workflow.listener.InzBizProcessEventListener;
import com.xyst.dinas.contract.service.ContractWarnService;
public class ContractUpdateProcessListener implements InzBizProcessEventListener {
// @Autowired
// private ContractWarnService contractWarnService;
@Override
public void beforeProcessStarted(InzBizProcessEvent event) {
//do nothing
}
@Override
public void afterProcessStarted(InzBizProcessEvent event) {
//do nothing
}
@Override
public void beforeProcessCompleted(InzBizProcessEvent event) {
//do nothing
}
@Override
public void afterProcessCompleted(InzBizProcessEvent event) {
//自动新增合同预警条目
if(event.getInzBizProcess().getWorkflowState() == BizProcessState.DONE_WITH_AGREE.getValue()){
// contractWarnService.afterApproved(event.getInzBizProcess().getBizDataObject());
}
}
}
......@@ -16,7 +16,17 @@ public interface ContractService {
KObject queryContractInfo(UUID id);
/**
* 新增合同工作流
* @param id
*/
void submitFlow(UUID id);
/**
* 变更合同工作流
* @param id
*/
void submitFlowForUpdate(UUID id);
/**
* 根据购砂单位ID 查询所有合同列表里的项目ID列表
......
......@@ -68,6 +68,13 @@ public class ContractController {
return baseEntity;
}
@PostMapping("/contract/update/submitFlow")
public Object submitFlowForUpdate(@RequestBody BaseEntity baseEntity) {
UUID id = UUID.fromString(baseEntity.getId());
contractService.submitFlowForUpdate(id);
return baseEntity;
}
//根据购砂单位ID 查询所有合同列表里的项目ID列表
@PostMapping("/sand/user/projectList")
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<id>0a3a2028-202f-431a-8388-78da40c0509b</id>
<id>d2d7ed24-6e02-4257-a4cb-ef6e797b3e91</id>
<name>com.xyst.dinas.contract.bill.ContractBill$sequence</name>
<title>合同单据$sequence</title>
<description>合同单据</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<id>3160f123-4c30-44a0-ad10-d975c1e9c060</id>
<id>eb5c7a0c-3f4d-4f83-9679-eb2d1e621ef2</id>
<name>com.xyst.dinas.contract.bill.ContractBill$serial</name>
<title>合同单据$serial</title>
<description>合同单据</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<id>fd46d816-b781-4be9-afcd-b8511718df07</id>
<id>bde748fe-ee10-4027-806a-de8833be4f2d</id>
<name>com.xyst.dinas.contract.bill.ContractBill</name>
<title>合同单据</title>
<description>合同单据</description>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment