|
@@ -405,14 +405,14 @@ public class BusinessOutServiceImpl implements BusinessOutService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String submitBusiness(PersonPopedom personPopedom, String type, String destination, String startTime,String endTime,String days, String estimatedTime, String content,String formId) throws Exception {
|
|
|
+ public String submitBusiness(PersonPopedom personPopedom, String type, String destination, String startTime,String endTime,String days, String estimatedTime, String content,String formId,String ids,String draft) throws Exception {
|
|
|
|
|
|
|
|
|
BusinessOut businessOut = new BusinessOut();
|
|
|
businessOut.setId(UUID.randomUUID().toString());
|
|
|
businessOut.setPersonPopedomId(personPopedom.getId());
|
|
|
businessOut.setType(type);
|
|
|
- businessOut.setStatus("0");
|
|
|
+ businessOut.setStatus("-99");
|
|
|
businessOut.setDestination(destination);
|
|
|
businessOut.setStartTime(DateUtil.parse(startTime));
|
|
|
// businessOut.setEstimatedTime(estimatedTime);
|
|
@@ -453,31 +453,38 @@ public class BusinessOutServiceImpl implements BusinessOutService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if(StringUtils.isNotEmpty(ids)){
|
|
|
+ update(businessOut);
|
|
|
+ }else {
|
|
|
+ insert(businessOut);
|
|
|
+ }
|
|
|
|
|
|
+ if (draft == "1") {
|
|
|
+ String procinstId = procinstService.addProcinst(businessOut.getId(), null, "出差", formId, personPopedom, null);
|
|
|
|
|
|
- String procinstId = procinstService.addProcinst(businessOut.getId(),null,"出差",formId,personPopedom,null);
|
|
|
-
|
|
|
- businessOut.setProcinstId(procinstId);
|
|
|
+ businessOut.setProcinstId(procinstId);
|
|
|
|
|
|
- insert(businessOut);
|
|
|
+ insert(businessOut);
|
|
|
|
|
|
+ businessOut.setStatus("0");
|
|
|
|
|
|
- ProcinstActivity procinstActivity = procinstActivityService.findByActivityIndexAndProcinstId(1, procinstId);
|
|
|
+ ProcinstActivity procinstActivity = procinstActivityService.findByActivityIndexAndProcinstId(1, procinstId);
|
|
|
|
|
|
- if (procinstActivity != null) {
|
|
|
- List<ProcinstActUser> procinstActUserList = procinstActUserService.findByProcinstActivityIdActionType(procinstActivity.getId(), "0", "1");
|
|
|
- if (procinstActUserList.size() > 0) {
|
|
|
+ if (procinstActivity != null) {
|
|
|
+ List<ProcinstActUser> procinstActUserList = procinstActUserService.findByProcinstActivityIdActionType(procinstActivity.getId(), "0", "1");
|
|
|
+ if (procinstActUserList.size() > 0) {
|
|
|
|
|
|
- new Thread(() -> {
|
|
|
- for (ProcinstActUser procinstActUser : procinstActUserList) {
|
|
|
- PersonInfo personInfo = personInfoService.get(Long.parseLong(procinstActUser.getUserId()));
|
|
|
+ new Thread(() -> {
|
|
|
+ for (ProcinstActUser procinstActUser : procinstActUserList) {
|
|
|
+ PersonInfo personInfo = personInfoService.get(Long.parseLong(procinstActUser.getUserId()));
|
|
|
|
|
|
- //提交人
|
|
|
- PersonInfo personInfo1 = personInfoService.get(personPopedom.getPersonId());
|
|
|
- String accessToken = JwtUtil2.createToken(jwtSecret, personInfo.getId() + "", DateTime.now().plusHours(30 * 24).toDate());
|
|
|
- WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的出差信息待审核", personInfo1.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + businessOut.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId+"&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
|
|
|
- }
|
|
|
- }).start();
|
|
|
+ //提交人
|
|
|
+ PersonInfo personInfo1 = personInfoService.get(personPopedom.getPersonId());
|
|
|
+ String accessToken = JwtUtil2.createToken(jwtSecret, personInfo.getId() + "", DateTime.now().plusHours(30 * 24).toDate());
|
|
|
+ WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的出差信息待审核", personInfo1.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + businessOut.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return businessOut.getId();
|