|
@@ -55,7 +55,6 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
-import java.time.LocalDate;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -92,11 +91,26 @@ public class RequestFundsV2FlowServiceImpl implements IRequestFundsV2FlowService
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- private FlowConstructor flowConstructor() {
|
|
|
+ private FlowConstructor flowConstructor(Integer type) {
|
|
|
return FlowConstructor.init(
|
|
|
new ExampleAbstract() {
|
|
|
@Override
|
|
|
public String getCode() {
|
|
|
+ if (type == null) {
|
|
|
+ return MessageNoticeEnum.MESSAGE_NOTICE_TYPE_15.getValue();
|
|
|
+ }
|
|
|
+
|
|
|
+ switch (type) {
|
|
|
+ case 1:
|
|
|
+ return MessageNoticeEnum.MESSAGE_NOTICE_TYPE_27.getValue();
|
|
|
+ case 2:
|
|
|
+ return MessageNoticeEnum.MESSAGE_NOTICE_TYPE_28.getValue();
|
|
|
+ case 3:
|
|
|
+ return MessageNoticeEnum.MESSAGE_NOTICE_TYPE_29.getValue();
|
|
|
+ case 4:
|
|
|
+ return MessageNoticeEnum.MESSAGE_NOTICE_TYPE_30.getValue();
|
|
|
+ }
|
|
|
+
|
|
|
return MessageNoticeEnum.MESSAGE_NOTICE_TYPE_15.getValue();
|
|
|
}
|
|
|
|
|
@@ -222,24 +236,25 @@ public class RequestFundsV2FlowServiceImpl implements IRequestFundsV2FlowService
|
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
|
@Override
|
|
|
public void start(RequestFundsV2 entity) {
|
|
|
- //初始化业务数据ID
|
|
|
+ // 初始化业务数据ID
|
|
|
String uuid = IdUtils.fastSimpleUUID();
|
|
|
if (StringUtils.isNotBlank(entity.getId())) {
|
|
|
uuid = entity.getId();
|
|
|
}
|
|
|
|
|
|
- //流程标题
|
|
|
- String title = AuthUtil.getUserName() + " 在" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "发起了 请款审批流程";
|
|
|
+ // 流程标题
|
|
|
+ String title = AuthUtil.getUserName() + " 在" +
|
|
|
+ new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "发起了 请款审批流程";
|
|
|
|
|
|
ExampleResult exampleResult = null;
|
|
|
if (StringUtils.isBlank(entity.getProcessInstanceId())) {
|
|
|
- //启动流程
|
|
|
- exampleResult = flowConstructor().create(uuid, title, entity.getFlowRemark());
|
|
|
+ // 启动流程
|
|
|
+ exampleResult = flowConstructor(entity.getType()).create(uuid, title, entity.getFlowRemark());
|
|
|
} else {
|
|
|
- //获取当前节点对应的按钮ID
|
|
|
+ // 获取当前节点对应的按钮ID
|
|
|
Long buttonId = iFlowClient.getButtonId(entity.getProcessInstanceId());
|
|
|
- //审批操作(用于驳回后重新提交)
|
|
|
- exampleResult = flowConstructor().jump(entity.getId(), buttonId, entity.getFlowRemark());
|
|
|
+ // 审批操作(用于驳回后重新提交)
|
|
|
+ exampleResult = flowConstructor(entity.getType()).jump(entity.getId(), buttonId, entity.getFlowRemark());
|
|
|
}
|
|
|
|
|
|
//事务回滚
|
|
@@ -393,7 +408,7 @@ public class RequestFundsV2FlowServiceImpl implements IRequestFundsV2FlowService
|
|
|
}
|
|
|
|
|
|
//审批操作
|
|
|
- ExampleResult exampleResult = flowConstructor().jump(entity.getId(), condition.getButtonId(), condition.getFlowRemark());
|
|
|
+ ExampleResult exampleResult = flowConstructor(entity.getType()).jump(entity.getId(), condition.getButtonId(), condition.getFlowRemark());
|
|
|
exampleResult.after(() -> {
|
|
|
//获取下一节点处理人信息
|
|
|
JSONObject nextNodeHandleUserInfo = new JSONObject();
|