|
@@ -18,6 +18,7 @@ import com.jpsoft.shinestar.modules.workflow.entity.ProcinstActivity;
|
|
|
import com.jpsoft.shinestar.modules.workflow.service.ProcinstActUserService;
|
|
|
import com.jpsoft.shinestar.modules.workflow.service.ProcinstActivityService;
|
|
|
import com.jpsoft.shinestar.modules.workflow.service.ProcinstService;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.joda.time.DateTime;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -109,7 +110,7 @@ public class CarryThingsOutFactoryServiceImpl implements CarryThingsOutFactorySe
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String submitCarryThings(PersonPopedom personPopedom, String date, String images, String content, String formId) throws Exception {
|
|
|
+ public String submitCarryThings(PersonPopedom personPopedom, String date, String images, String content, String formId,String ids,String draft) throws Exception {
|
|
|
|
|
|
|
|
|
CarryThingsOutFactory carryThingsOutFactory = new CarryThingsOutFactory();
|
|
@@ -118,38 +119,43 @@ public class CarryThingsOutFactoryServiceImpl implements CarryThingsOutFactorySe
|
|
|
carryThingsOutFactory.setLeaveFactoryTime(DateUtil.parse(date));
|
|
|
carryThingsOutFactory.setLeaveFactoryReason(content);
|
|
|
carryThingsOutFactory.setImage(images);
|
|
|
- carryThingsOutFactory.setAuditStatus("0");
|
|
|
+ carryThingsOutFactory.setAuditStatus("-99");
|
|
|
carryThingsOutFactory.setCreateTime(new Date());
|
|
|
|
|
|
+ if(StringUtils.isNotEmpty(ids)){
|
|
|
+ update(carryThingsOutFactory);
|
|
|
+ }else {
|
|
|
+ insert(carryThingsOutFactory);
|
|
|
+ }
|
|
|
|
|
|
- String procinstId = procinstService.addProcinst(carryThingsOutFactory.getId(),null,"携物出厂",formId,personPopedom,null);
|
|
|
+ if (draft == "1") {
|
|
|
+ String procinstId = procinstService.addProcinst(carryThingsOutFactory.getId(), null, "携物出厂", formId, personPopedom, null);
|
|
|
|
|
|
- carryThingsOutFactory.setProcinstId(procinstId);
|
|
|
- insert(carryThingsOutFactory);
|
|
|
+ carryThingsOutFactory.setProcinstId(procinstId);
|
|
|
+ update(carryThingsOutFactory);
|
|
|
+ carryThingsOutFactory.setAuditStatus("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=" + carryThingsOutFactory.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=" + carryThingsOutFactory.getId() + "&procinstActUserId=" + procinstActUser.getId() + "&formId=" + formId + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return carryThingsOutFactory.getId();
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@Override
|