|
@@ -130,8 +130,8 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
|
|
|
//启动超时删除线程
|
|
|
taskService.removeWaitTimeOutTask(task);
|
|
|
Map<String, Object> map = new HashMap<>(4);
|
|
|
- map.put("taskId", task.getId());
|
|
|
- map.put("tree", getApprovalTreePost(task.getBaseGroupId(), task.getBaseId()));
|
|
|
+ map.put("taskId" , task.getId());
|
|
|
+ map.put("tree" , getApprovalTreePost(task.getBaseGroupId(), task.getBaseId()));
|
|
|
return map;
|
|
|
}
|
|
|
|
|
@@ -167,7 +167,7 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
|
|
|
"<p>申请数量:" + formData.get("apply_amount") + "</p>";
|
|
|
}
|
|
|
//异步生成审批消息列表
|
|
|
- userMsgService.saveApprovalMsgAndPush("1",
|
|
|
+ userMsgService.saveApprovalMsgAndPush("1" ,
|
|
|
String.valueOf(formData.get("title")), content, taskId,
|
|
|
candidate, applyUserName, new Date());
|
|
|
} catch (ParseException e) {
|
|
@@ -265,6 +265,7 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
|
|
|
List<Operators.OperatorDto> assignedUser = operators.getAssignedUser();
|
|
|
StringBuilder sbUid = new StringBuilder();
|
|
|
StringBuilder sbUname = new StringBuilder();
|
|
|
+
|
|
|
if (0 != assignedUser.size()) {
|
|
|
for (int i = 0; i < assignedUser.size(); i++) {
|
|
|
if (i != (assignedUser.size() - 1)) {
|
|
@@ -277,16 +278,34 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
|
|
|
}
|
|
|
cc.setUsers(sbUid.toString());
|
|
|
}
|
|
|
+ List<HsAppUserMsg> msgs = new ArrayList<>();
|
|
|
+ //先持久化抄送数据
|
|
|
flowCcService.save(cc);
|
|
|
- if (StringUtils.isBlank(nextFlowBase.getDownStepId())) {
|
|
|
- if (resultTrue) {
|
|
|
- wxMsgService.sendResultMsg("审批抄送 - " + formData.get("title"), "已通过", String.valueOf(formData.get("apply_user_id")));
|
|
|
+ //再发送推送和生成审批结果消息列表
|
|
|
+ if (0 != assignedUser.size()) {
|
|
|
+ for (Operators.OperatorDto operatorDto : assignedUser) {
|
|
|
+ //再发送推送和生成审批结果消息列表
|
|
|
+ HsAppUserMsg appUserMsg = new HsAppUserMsg();
|
|
|
+ appUserMsg.setMsgContent(String.valueOf(formData.get("apply_user_name")) + "的" + formData.get("title"));
|
|
|
+ appUserMsg.setMsgTitle("审批抄送");
|
|
|
+ appUserMsg.setMsgIsRead("0");
|
|
|
+ appUserMsg.setUserCode(operatorDto.getId());
|
|
|
+ appUserMsg.setMsgType("4");
|
|
|
+ appUserMsg.setRemark(hsFlowTask.getId());
|
|
|
+ appUserMsg.setCreateTime(new Date());
|
|
|
+ msgs.add(appUserMsg);
|
|
|
+ if (StringUtils.isBlank(nextFlowBase.getDownStepId())) {
|
|
|
+ if (resultTrue) {
|
|
|
+ wxMsgService.sendResultMsg("审批抄送 - " + formData.get("title"), "已通过" , operatorDto.getId());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ stepId = nextFlowBase.getDownStepId();
|
|
|
+ nextFlowBase = flowBaseService.getFlowTaskBaseByGroupIdAndBaseId(hsFlowTask.getBaseGroupId(), stepId);
|
|
|
+ baseName = nextFlowBase.getFlowModuleName();
|
|
|
+ wxMsgService.sendResultMsg("审批抄送 - " + formData.get("title"), "进行中" , operatorDto.getId());
|
|
|
+ }
|
|
|
}
|
|
|
- } else {
|
|
|
- stepId = nextFlowBase.getDownStepId();
|
|
|
- nextFlowBase = flowBaseService.getFlowTaskBaseByGroupIdAndBaseId(hsFlowTask.getBaseGroupId(), stepId);
|
|
|
- baseName = nextFlowBase.getFlowModuleName();
|
|
|
- wxMsgService.sendResultMsg("审批抄送 - " + formData.get("title"), "进行中", String.valueOf(formData.get("apply_user_id")));
|
|
|
+ userMsgService.saveBatch(msgs);
|
|
|
}
|
|
|
HsFlowRunningRecord frrCc = new HsFlowRunningRecord();
|
|
|
frrCc.setBaseId(flow.getBaseId());
|
|
@@ -366,7 +385,7 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
|
|
|
appUserMsg.setCreateTime(new Date());
|
|
|
userMsgService.save(appUserMsg);
|
|
|
//推送微信审批结果通知
|
|
|
- wxMsgService.sendResultMsg(String.valueOf(formData.get("title")), resultTrue ? "已通过" : "已拒绝", String.valueOf(formData.get("apply_user_id")));
|
|
|
+ wxMsgService.sendResultMsg(String.valueOf(formData.get("title")), resultTrue ? "已通过" : "已拒绝" , String.valueOf(formData.get("apply_user_id")));
|
|
|
} else {
|
|
|
//任务继续
|
|
|
hsFlowTask.setMsgIsRead("0");
|
|
@@ -401,7 +420,7 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
|
|
|
WxMsgTemplateApproval wxMsgTemplateApproval = new WxMsgTemplateApproval();
|
|
|
wxMsgTemplateApproval.setThing5(wxUtils.getFormat(String.valueOf(formData.get("title"))));
|
|
|
wxMsgTemplateApproval.setThing11(wxUtils.getFormat(String.valueOf(formData.get("apply_user_name"))));
|
|
|
- wxMsgTemplateApproval.setTime12(wxUtils.getFormat(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date())));
|
|
|
+ wxMsgTemplateApproval.setTime12(wxUtils.getFormat(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss" , new Date())));
|
|
|
wxMsgService.sendQRCodeMsg(hsFlowTask.getOperator(), wxMsgTemplateApproval, WxTemplateKeyEnum.APPROVAL_WAIT, true);
|
|
|
}
|
|
|
hsFlowTaskMapper.updateById(hsFlowTask);
|
|
@@ -439,7 +458,7 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
|
|
|
if (conditionModelService.executeConditionJudgment(item, params.get(paramName))) {
|
|
|
//对应条件组件
|
|
|
HsFlowBase termModule = hsFlowBaseMapper.selectOne(
|
|
|
- new QueryWrapper<HsFlowBase>().eq("term_module_id", item.getId()));
|
|
|
+ new QueryWrapper<HsFlowBase>().eq("term_module_id" , item.getId()));
|
|
|
if (null == termModule) {
|
|
|
throw new BaseException("流程条件配置出错");
|
|
|
}
|
|
@@ -458,7 +477,7 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
|
|
|
}
|
|
|
hsFlowTaskMapper.deleteById(taskId);
|
|
|
flowRunningRecordService.remove(new QueryWrapper<HsFlowRunningRecord>()
|
|
|
- .eq("task_id", taskId));
|
|
|
+ .eq("task_id" , taskId));
|
|
|
throw new BaseException("流程条件未满足,流程关闭,请重新发起");
|
|
|
} else {
|
|
|
return hsFlowBase;
|
|
@@ -471,7 +490,7 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
|
|
|
return null;
|
|
|
}
|
|
|
List<HsFlowTask> hsFlowTasks = hsFlowTaskMapper.selectList(new QueryWrapper<HsFlowTask>()
|
|
|
- .eq("id", taskId));
|
|
|
+ .eq("id" , taskId));
|
|
|
return getHsFlowTasks(hsFlowTasks);
|
|
|
}
|
|
|
|
|
@@ -514,8 +533,8 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
|
|
|
.selectBusinessCase(example.getBusinessTableName(), businessId);
|
|
|
if (ObjectUtils.isNotNull(stringObjectMap)) {
|
|
|
if ("biz_leave".equals(example.getBusinessTableName())) {
|
|
|
- List<Map<String, Object>> leaveImgs = leaveImgService.getBaseMapper().selectMaps(new QueryWrapper<BizLeaveImg>().eq("biz_leave_id", businessId));
|
|
|
- stringObjectMap.put("imgUrls", leaveImgs);
|
|
|
+ List<Map<String, Object>> leaveImgs = leaveImgService.getBaseMapper().selectMaps(new QueryWrapper<BizLeaveImg>().eq("biz_leave_id" , businessId));
|
|
|
+ stringObjectMap.put("imgUrls" , leaveImgs);
|
|
|
}
|
|
|
//统一时间类型字段处理
|
|
|
Set<String> strings = stringObjectMap.keySet();
|
|
@@ -557,7 +576,7 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
|
|
|
hsFlowRunningRecord.setYesOrNo("LAUNCH");
|
|
|
flowRunningRecords.add(hsFlowRunningRecord);
|
|
|
List<HsFlowRunningRecord> records = flowRunningRecordService.getBaseMapper().selectList(new QueryWrapper<HsFlowRunningRecord>()
|
|
|
- .eq("task_id", taskId).last("AND yes_or_no = 'RESULT_TRUE' GROUP BY base_id"));
|
|
|
+ .eq("task_id" , taskId).last("AND yes_or_no = 'RESULT_TRUE' GROUP BY base_id"));
|
|
|
records.forEach(flowRunningRecord -> {
|
|
|
String comment = flowRunningRecord.getComment();
|
|
|
flowRunningRecord.setComment(comment.substring(0, comment.indexOf("-")));
|
|
@@ -572,7 +591,7 @@ public class HsFlowEngineServiceImpl implements HsFlowEngineService {
|
|
|
public int revoke(String taskId) {
|
|
|
if (StringUtils.isNotBlank(taskId)) {
|
|
|
long selectCount = flowRunningRecordService.getBaseMapper().selectCount(new QueryWrapper<HsFlowRunningRecord>()
|
|
|
- .eq("task_id", taskId));
|
|
|
+ .eq("task_id" , taskId));
|
|
|
if (selectCount > 0) {
|
|
|
throw new BaseException("已有审批结果无法撤销");
|
|
|
}
|