|
@@ -43,8 +43,10 @@ import com.jeeplus.modules.workbidproject.dao.WorkBidProjectDao;
|
|
|
import com.jeeplus.modules.workbidproject.entity.WorkBidProject;
|
|
|
import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
|
|
|
import com.jeeplus.modules.workclientinfo.dao.WorkClientInfoDao;
|
|
|
+import com.jeeplus.modules.workclientinfo.dao.WorkClientLinkmanDao;
|
|
|
import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
|
|
|
import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
|
|
|
+import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
|
|
|
import com.jeeplus.modules.workclientinfo.service.WorkClientInfoService;
|
|
|
import com.jeeplus.modules.workcontractinfo.dao.*;
|
|
|
import com.jeeplus.modules.workcontractinfo.entity.*;
|
|
@@ -149,9 +151,21 @@ public class WorkContractInfoService extends CrudService<WorkContractInfoDao, Wo
|
|
|
private WorkContractBorrowDao workContractBorrowDao;
|
|
|
@Autowired
|
|
|
private StatementCompanyComprehensiveService statementCompanyComprehensiveService;
|
|
|
+ @Autowired
|
|
|
+ private WorkClientLinkmanDao workClientLinkmanDao;
|
|
|
|
|
|
private static byte[] SYN_BYTE = new byte[0];
|
|
|
|
|
|
+ /**
|
|
|
+ * 通过contractNum查询联系人
|
|
|
+ * @param contractNum
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<WorkClientLinkman> getClientList(String contractNum){
|
|
|
+ return workContractInfoDao.getList(contractNum);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
public WorkContractInfo get(String id) {
|
|
|
WorkContractInfo workContractInfo = super.get(id);
|
|
|
/*合同投标项目,则查投标。不是投标项目,不去查*/
|
|
@@ -622,7 +636,7 @@ public class WorkContractInfoService extends CrudService<WorkContractInfoDao, Wo
|
|
|
}
|
|
|
}
|
|
|
@Transactional(readOnly = false)
|
|
|
- public synchronized String save(WorkContractInfo workContractInfo,Map<String, Object> variables, String contextPath,String urls) {
|
|
|
+ public synchronized String save(WorkClientLinkman workClientLinkman,WorkContractInfo workContractInfo,Map<String, Object> variables, String contextPath,String urls) {
|
|
|
long begin = System.currentTimeMillis();
|
|
|
String processInstanceId = workContractInfo.getProcessInstanceId();
|
|
|
String contractTypeCode = workContractInfo.getContractTypeDoc();
|
|
@@ -635,192 +649,207 @@ public class WorkContractInfoService extends CrudService<WorkContractInfoDao, Wo
|
|
|
contractTypeId = mainDictDetail.getValue();
|
|
|
}
|
|
|
}
|
|
|
- if (StringUtils.isBlank(workContractInfo.getContractNum())) {
|
|
|
- //根据合同类型生成合同编号
|
|
|
- String type = null;
|
|
|
- if("100".equals(contractTypeId)){
|
|
|
- type = WorkContractInfo.SERIAL_CONSULT;
|
|
|
- }else if("101".equals(contractTypeId)){
|
|
|
- type = WorkContractInfo.SERIAL_CHECK;
|
|
|
- }else if("102".equals(contractTypeId)){
|
|
|
- type = WorkContractInfo.SERIAL_AGENCY;
|
|
|
- }else if("103".equals(contractTypeId)){
|
|
|
- type = WorkContractInfo.SERIAL_AUDIT;
|
|
|
- }else {
|
|
|
- type = WorkContractInfo.SERIAL_ELST;
|
|
|
- }
|
|
|
- synchronized (SYN_BYTE){
|
|
|
- workContractInfo.setContractNum(serialNumTplService.genSerialNum(UserUtils.get(workContractInfo.getCreateBy().getId()).getCompany(), type).replace("TYPE",contractType));
|
|
|
- }
|
|
|
+// WorkClientLinkman temp = workContractInfo.getWorkClientLinkman();
|
|
|
+// temp.preInsert();
|
|
|
+// temp.setContractNum(workContractInfo.getContractNum());
|
|
|
+// System.out.println("------------------------------->" + workClientLinkmanDao.insertLinkman(temp));
|
|
|
+ workContractInfo.preInsert();
|
|
|
+ System.out.println("------------------------------>" + workContractInfoDao.insert(workContractInfo));
|
|
|
+ //获取联系人信息并添加
|
|
|
+ List<WorkClientLinkman> linkmanList = workContractInfo.getWorkClientLinkmanList();
|
|
|
+ for (WorkClientLinkman clientLinkman : linkmanList) {
|
|
|
+ clientLinkman.setContractNum(workContractInfo.getContractNum());
|
|
|
+ clientLinkman.preInsert();
|
|
|
+ workClientLinkmanDao.insertLinkman(clientLinkman);
|
|
|
|
|
|
-
|
|
|
- /*//生成合同编号
|
|
|
- workContractInfo.setContractNum(serialNumTplService.genSerialNumNotNum(UserUtils.get(workContractInfo.getCreateBy().getId()).getCompany(), WorkContractInfo.SERIAL_CONSULT).replace("TYPE",contractType));
|
|
|
- //根据当前合同编号查询对应最后一条合同编号
|
|
|
- String contractLastNumStr = dao.getContractLastNum(workContractInfo.getContractNum());
|
|
|
- if(StringUtils.isNotBlank(contractLastNumStr)) {
|
|
|
- //获取最新的后缀编号
|
|
|
- Integer num = Integer.parseInt(contractLastNumStr.substring(workContractInfo.getContractNum().length(), contractLastNumStr.length())) + 1;
|
|
|
- //更新合同编号
|
|
|
- workContractInfo.setContractNum(workContractInfo.getContractNum() + String.format("%04d", num));
|
|
|
- }else {
|
|
|
- //更新合同编号
|
|
|
- workContractInfo.setContractNum(workContractInfo.getContractNum() + String.format("%04d", 1));
|
|
|
- }*/
|
|
|
- long end2 = System.currentTimeMillis();
|
|
|
- logger.info("合同送审-项目编码设置任务结束,共耗时:[" + (end2-begin) / 1000 + "]秒");
|
|
|
}
|
|
|
- long begin2 = System.currentTimeMillis();
|
|
|
- if (StringUtils.isBlank(workContractInfo.getContractNumPath())) {
|
|
|
- String num=workContractInfo.getContractNum();
|
|
|
- long time = System.currentTimeMillis();
|
|
|
- String picNamePhoto = time + ".png";
|
|
|
- ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
|
|
|
- WordToPic.TextToAliyunPic(num, 500, 80, 25,new Color(0,188,212), byteArrayOutputStream);
|
|
|
-
|
|
|
- byte[] buf = byteArrayOutputStream.toByteArray();
|
|
|
- ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(buf);
|
|
|
- OSSClientUtil ossUtil = new OSSClientUtil();
|
|
|
- ossUtil.uploadFile2OSS(byteArrayInputStream, Global.getContractNumPath(), picNamePhoto);
|
|
|
- workContractInfo.setContractNumPath(Global.getAliyunUrl()+"/"+Global.getContractNumPath()+picNamePhoto);
|
|
|
- }
|
|
|
- workContractInfo.setContractState("2");
|
|
|
+// if (StringUtils.isBlank(workContractInfo.getContractNum())) {
|
|
|
+// //根据合同类型生成合同编号
|
|
|
+// String type = null;
|
|
|
+// if("100".equals(contractTypeId)){
|
|
|
+// type = WorkContractInfo.SERIAL_CONSULT;
|
|
|
+// }else if("101".equals(contractTypeId)){
|
|
|
+// type = WorkContractInfo.SERIAL_CHECK;
|
|
|
+// }else if("102".equals(contractTypeId)){
|
|
|
+// type = WorkContractInfo.SERIAL_AGENCY;
|
|
|
+// }else if("103".equals(contractTypeId)){
|
|
|
+// type = WorkContractInfo.SERIAL_AUDIT;
|
|
|
+// }else {
|
|
|
+// type = WorkContractInfo.SERIAL_ELST;
|
|
|
+// }
|
|
|
+// synchronized (SYN_BYTE){
|
|
|
+// workContractInfo.setContractNum(serialNumTplService.genSerialNum(UserUtils.get(workContractInfo.getCreateBy().getId()).getCompany(), type).replace("TYPE",contractType));
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// /*//生成合同编号
|
|
|
+// workContractInfo.setContractNum(serialNumTplService.genSerialNumNotNum(UserUtils.get(workContractInfo.getCreateBy().getId()).getCompany(), WorkContractInfo.SERIAL_CONSULT).replace("TYPE",contractType));
|
|
|
+// //根据当前合同编号查询对应最后一条合同编号
|
|
|
+// String contractLastNumStr = dao.getContractLastNum(workContractInfo.getContractNum());
|
|
|
+// if(StringUtils.isNotBlank(contractLastNumStr)) {
|
|
|
+// //获取最新的后缀编号
|
|
|
+// Integer num = Integer.parseInt(contractLastNumStr.substring(workContractInfo.getContractNum().length(), contractLastNumStr.length())) + 1;
|
|
|
+// //更新合同编号
|
|
|
+// workContractInfo.setContractNum(workContractInfo.getContractNum() + String.format("%04d", num));
|
|
|
+// }else {
|
|
|
+// //更新合同编号
|
|
|
+// workContractInfo.setContractNum(workContractInfo.getContractNum() + String.format("%04d", 1));
|
|
|
+// }*/
|
|
|
+// long end2 = System.currentTimeMillis();
|
|
|
+// logger.info("合同送审-项目编码设置任务结束,共耗时:[" + (end2-begin) / 1000 + "]秒");
|
|
|
+// }
|
|
|
+// long begin2 = System.currentTimeMillis();
|
|
|
+// if (StringUtils.isBlank(workContractInfo.getContractNumPath())) {
|
|
|
+// String num=workContractInfo.getContractNum();
|
|
|
+// long time = System.currentTimeMillis();
|
|
|
+// String picNamePhoto = time + ".png";
|
|
|
+// ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
|
|
|
+// WordToPic.TextToAliyunPic(num, 500, 80, 25,new Color(0,188,212), byteArrayOutputStream);
|
|
|
+//
|
|
|
+// byte[] buf = byteArrayOutputStream.toByteArray();
|
|
|
+// ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(buf);
|
|
|
+// OSSClientUtil ossUtil = new OSSClientUtil();
|
|
|
+// ossUtil.uploadFile2OSS(byteArrayInputStream, Global.getContractNumPath(), picNamePhoto);
|
|
|
+// workContractInfo.setContractNumPath(Global.getAliyunUrl()+"/"+Global.getContractNumPath()+picNamePhoto);
|
|
|
+// }
|
|
|
+ workContractInfo.setContractState("5");
|
|
|
this.save(workContractInfo);
|
|
|
- Office office = UserUtils.getUser().getOffice();
|
|
|
- String title = "合同【"+workContractInfo.getName() +"】登记待审批";
|
|
|
- String str = "合同【"+workContractInfo.getName() +"】登记待审批,合同编号:"+workContractInfo.getContractNum();
|
|
|
- identityService.setAuthenticatedUserId(workContractInfo.getCreateBy().getId());
|
|
|
- String businessKey = workContractInfo.getId().toString();
|
|
|
- WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("zth3125f1f194c82bdea93555c750905", office);
|
|
|
- // 启动流程
|
|
|
- String processType = workActivityMenu.getProcessType();
|
|
|
- StringBuffer buffer = new StringBuffer();
|
|
|
- Activity activity = new Activity();
|
|
|
- WorkProjectNotify workProjectNotify = UtilNotify
|
|
|
- .saveNotify(workContractInfo.getId(),
|
|
|
- null,
|
|
|
- workContractInfo.getCompanyId(),
|
|
|
- title,
|
|
|
- str,
|
|
|
- "16",
|
|
|
- "0",
|
|
|
- "待审批",
|
|
|
- ""
|
|
|
- );
|
|
|
- List<User> users = new ArrayList<>();
|
|
|
- String officeId = UserUtils.getSelectOffice().getId();
|
|
|
- List<User> bmzrs = UserUtils.getByRoleActivityEnname("bmzr",2,office.getId(),"2",workContractInfo.getCreateBy());
|
|
|
-// List<User> scyfglbzrs = UserUtils.getByRoleActivityEnname("scyfglbzr",1,office.getId(),"2",workContractInfo.getCreateBy());
|
|
|
-// List<User> fglds = UserUtils.getByRoleActivityEnname("scfgld",3,office.getId(),"2",workContractInfo.getCreateBy());
|
|
|
- long end3 = System.currentTimeMillis();
|
|
|
- logger.info("合同送审-查找人员审核任务结束,共耗时:[" + (end3-begin2) / 1000 + "]秒");
|
|
|
- long begin3 = System.currentTimeMillis();
|
|
|
- if (StringUtils.isNotBlank(workActivityMenu.getId())) {
|
|
|
- workProjectNotify.setNotifyRole("");
|
|
|
- workActivityMenu = workActivityMenuService.get(workActivityMenu.getId());
|
|
|
- List<Activity> activities = workActivityMenu.getActivities();
|
|
|
- for (Activity a : activities) {
|
|
|
- String encount = a.getEncount();
|
|
|
- String enlist = a.getEnlist();
|
|
|
- if (a.getRole() != null && StringUtils.isNotBlank(a.getRole().getEnname())) {
|
|
|
- List enusers = UserUtils.getByRoleActivityEnnames(a.getRole().getEnname(), office.getId(), "2", workContractInfo.getCreateBy());
|
|
|
- if (enusers.size() == 0) {
|
|
|
- workContractInfo.setContractState("1");
|
|
|
- this.save(workContractInfo);
|
|
|
- return "流程审批人不能为空,角色部门负责人下无用户,请联系管理员!";
|
|
|
- }
|
|
|
- variables.put(enlist, enusers);
|
|
|
- variables.put(encount, enusers.size());
|
|
|
- }
|
|
|
- if (a.getDelFlag().equals("0") && a.getCount() == 1) {
|
|
|
- activity = a;
|
|
|
- }
|
|
|
- }
|
|
|
- buffer.append(activity.getRole().getEnname());
|
|
|
- if (activity != null && StringUtils.isNotBlank(activity.getId())) {
|
|
|
- //角色审批
|
|
|
- if (StringUtils.isNotBlank(activity.getRole().getEnname())) {
|
|
|
- users = UserUtils.getByRoleActivityEnnames(activity.getRole().getEnname(), office.getId(), "2", workContractInfo.getCreateBy());
|
|
|
- }
|
|
|
- //人员审批
|
|
|
- if (StringUtils.isNotBlank(activity.getUser().getId())) {
|
|
|
- users.add(activity.getUser());
|
|
|
- }
|
|
|
- }
|
|
|
- workProjectNotify.setId("");
|
|
|
- } else {
|
|
|
- processType = "contractCheck";
|
|
|
- if(bmzrs==null||bmzrs.size()==0){
|
|
|
- workContractInfo.setContractState("1");
|
|
|
- this.save(workContractInfo);
|
|
|
- return "流程审批人不能为空,角色部门负责人下无用户,请联系管理员!";
|
|
|
- }
|
|
|
- variables.put("bmzrList", bmzrs);
|
|
|
- variables.put("bmzrCount",bmzrs.size());
|
|
|
- users.addAll(bmzrs);
|
|
|
- }
|
|
|
-
|
|
|
- for (User u : users) {
|
|
|
- workProjectNotify.setUser(u);
|
|
|
- workProjectNotify.setId("");
|
|
|
- workProjectNotify.setNotifyRole("部门主任审批");
|
|
|
- workProjectNotifyService
|
|
|
- .save(workProjectNotify);
|
|
|
- Map<String,Object> extras = new HashMap<>();
|
|
|
- extras.put("type","7002");
|
|
|
- extras.put("id",workProjectNotify.getId());
|
|
|
- extras.put("procDefKey","16");
|
|
|
- UserUtils.pushInfoToApp(title,str,extras,u.getId());
|
|
|
- UserUtils.pushIm(u.getId(),str);
|
|
|
- }
|
|
|
- variables.put("type", processType);
|
|
|
- variables.put("busId", businessKey);
|
|
|
-// variables.put("count",users.size());
|
|
|
-// variables.put("assigneeList",users);
|
|
|
- variables.put("title", "合同名称:" + workContractInfo.getName());//设置标题;
|
|
|
- long s1 = System.currentTimeMillis();
|
|
|
- ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
|
|
|
- long s2 = System.currentTimeMillis();
|
|
|
- workContractInfo.setProcessInstance(processInstance);
|
|
|
- if (StringUtils.isNotBlank(processInstanceId)) {
|
|
|
- workActivityProcessService.updateProcessInstanceId(processInstance.getId(),processInstanceId);
|
|
|
- workActivityProcessService.deleteProcessInstanceId(processInstanceId);
|
|
|
- workActivityProcessService.deleteProcessIdAuditUsers(processInstanceId);
|
|
|
- }
|
|
|
- // 更新流程实例ID
|
|
|
- workContractInfo.setProcessInstanceId(processInstance.getId());
|
|
|
- workContractInfoDao.updateProcessInstanceId(workContractInfo);
|
|
|
- //通知添加流程实例ID
|
|
|
- workProjectNotify.setProcessInstanceId(processInstance.getId());
|
|
|
- workProjectNotifyService.save(workProjectNotify);
|
|
|
-
|
|
|
- List<Activity> list = workActivityMenu.getActivities();
|
|
|
- if (list != null && list.size() != 0) {
|
|
|
- workActivityProcessService.saveList(list, processInstance.getId());
|
|
|
- } else {
|
|
|
- WorkActivityProcess workActivityProcess = new WorkActivityProcess();
|
|
|
- workActivityProcess.setProcessKey("contractCheck");
|
|
|
- workActivityProcess.setCount(1);
|
|
|
- workActivityProcess.setProcessInstanceId(processInstance.getId());
|
|
|
- workActivityProcess.setIsApproval("0");
|
|
|
- workActivityProcessService.save(workActivityProcess);
|
|
|
-// workActivityProcess.setCount(2);
|
|
|
-// workActivityProcess.setId("");
|
|
|
-// workActivityProcessService.save(workActivityProcess);
|
|
|
-// workActivityProcess.setCount(3);
|
|
|
-// workActivityProcess.setId("");
|
|
|
+// Office office = UserUtils.getUser().getOffice();
|
|
|
+// String title = "合同【"+workContractInfo.getName() +"】登记待审批";
|
|
|
+// String str = "合同【"+workContractInfo.getName() +"】登记待审批,合同编号:"+workContractInfo.getContractNum();
|
|
|
+// identityService.setAuthenticatedUserId(workContractInfo.getCreateBy().getId());
|
|
|
+// String businessKey = workContractInfo.getId().toString();
|
|
|
+// WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("zth3125f1f194c82bdea93555c750905", office);
|
|
|
+// // 启动流程
|
|
|
+// String processType = workActivityMenu.getProcessType();
|
|
|
+// StringBuffer buffer = new StringBuffer();
|
|
|
+// Activity activity = new Activity();
|
|
|
+// WorkProjectNotify workProjectNotify = UtilNotify
|
|
|
+// .saveNotify(workContractInfo.getId(),
|
|
|
+// null,
|
|
|
+// workContractInfo.getCompanyId(),
|
|
|
+// title,
|
|
|
+// str,
|
|
|
+// "16",
|
|
|
+// "0",
|
|
|
+// "待审批",
|
|
|
+// ""
|
|
|
+// );
|
|
|
+// List<User> users = new ArrayList<>();
|
|
|
+// String officeId = UserUtils.getSelectOffice().getId();
|
|
|
+// List<User> bmzrs = UserUtils.getByRoleActivityEnname("bmzr",2,office.getId(),"2",workContractInfo.getCreateBy());
|
|
|
+//// List<User> scyfglbzrs = UserUtils.getByRoleActivityEnname("scyfglbzr",1,office.getId(),"2",workContractInfo.getCreateBy());
|
|
|
+//// List<User> fglds = UserUtils.getByRoleActivityEnname("scfgld",3,office.getId(),"2",workContractInfo.getCreateBy());
|
|
|
+// long end3 = System.currentTimeMillis();
|
|
|
+// logger.info("合同送审-查找人员审核任务结束,共耗时:[" + (end3-begin2) / 1000 + "]秒");
|
|
|
+// long begin3 = System.currentTimeMillis();
|
|
|
+// if (StringUtils.isNotBlank(workActivityMenu.getId())) {
|
|
|
+// workProjectNotify.setNotifyRole("");
|
|
|
+// workActivityMenu = workActivityMenuService.get(workActivityMenu.getId());
|
|
|
+// List<Activity> activities = workActivityMenu.getActivities();
|
|
|
+// for (Activity a : activities) {
|
|
|
+// String encount = a.getEncount();
|
|
|
+// String enlist = a.getEnlist();
|
|
|
+// if (a.getRole() != null && StringUtils.isNotBlank(a.getRole().getEnname())) {
|
|
|
+// List enusers = UserUtils.getByRoleActivityEnnames(a.getRole().getEnname(), office.getId(), "2", workContractInfo.getCreateBy());
|
|
|
+// if (enusers.size() == 0) {
|
|
|
+// workContractInfo.setContractState("1");
|
|
|
+// this.save(workContractInfo);
|
|
|
+// return "流程审批人不能为空,角色部门负责人下无用户,请联系管理员!";
|
|
|
+// }
|
|
|
+// variables.put(enlist, enusers);
|
|
|
+// variables.put(encount, enusers.size());
|
|
|
+// }
|
|
|
+// if (a.getDelFlag().equals("0") && a.getCount() == 1) {
|
|
|
+// activity = a;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// buffer.append(activity.getRole().getEnname());
|
|
|
+// if (activity != null && StringUtils.isNotBlank(activity.getId())) {
|
|
|
+// //角色审批
|
|
|
+// if (StringUtils.isNotBlank(activity.getRole().getEnname())) {
|
|
|
+// users = UserUtils.getByRoleActivityEnnames(activity.getRole().getEnname(), office.getId(), "2", workContractInfo.getCreateBy());
|
|
|
+// }
|
|
|
+// //人员审批
|
|
|
+// if (StringUtils.isNotBlank(activity.getUser().getId())) {
|
|
|
+// users.add(activity.getUser());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// workProjectNotify.setId("");
|
|
|
+// } else {
|
|
|
+// processType = "contractCheck";
|
|
|
+// if(bmzrs==null||bmzrs.size()==0){
|
|
|
+// workContractInfo.setContractState("1");
|
|
|
+// this.save(workContractInfo);
|
|
|
+// return "流程审批人不能为空,角色部门负责人下无用户,请联系管理员!";
|
|
|
+// }
|
|
|
+// variables.put("bmzrList", bmzrs);
|
|
|
+// variables.put("bmzrCount",bmzrs.size());
|
|
|
+// users.addAll(bmzrs);
|
|
|
+// }
|
|
|
+//
|
|
|
+// for (User u : users) {
|
|
|
+// workProjectNotify.setUser(u);
|
|
|
+// workProjectNotify.setId("");
|
|
|
+// workProjectNotify.setNotifyRole("部门主任审批");
|
|
|
+// workProjectNotifyService
|
|
|
+// .save(workProjectNotify);
|
|
|
+// Map<String,Object> extras = new HashMap<>();
|
|
|
+// extras.put("type","7002");
|
|
|
+// extras.put("id",workProjectNotify.getId());
|
|
|
+// extras.put("procDefKey","16");
|
|
|
+// UserUtils.pushInfoToApp(title,str,extras,u.getId());
|
|
|
+// UserUtils.pushIm(u.getId(),str);
|
|
|
+// }
|
|
|
+// variables.put("type", processType);
|
|
|
+// variables.put("busId", businessKey);
|
|
|
+//// variables.put("count",users.size());
|
|
|
+//// variables.put("assigneeList",users);
|
|
|
+// variables.put("title", "合同名称:" + workContractInfo.getName());//设置标题;
|
|
|
+// long s1 = System.currentTimeMillis();
|
|
|
+// ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
|
|
|
+// long s2 = System.currentTimeMillis();
|
|
|
+// workContractInfo.setProcessInstance(processInstance);
|
|
|
+// if (StringUtils.isNotBlank(processInstanceId)) {
|
|
|
+// workActivityProcessService.updateProcessInstanceId(processInstance.getId(),processInstanceId);
|
|
|
+// workActivityProcessService.deleteProcessInstanceId(processInstanceId);
|
|
|
+// workActivityProcessService.deleteProcessIdAuditUsers(processInstanceId);
|
|
|
+// }
|
|
|
+// // 更新流程实例ID
|
|
|
+// workContractInfo.setProcessInstanceId(processInstance.getId());
|
|
|
+// workContractInfoDao.updateProcessInstanceId(workContractInfo);
|
|
|
+// //通知添加流程实例ID
|
|
|
+// workProjectNotify.setProcessInstanceId(processInstance.getId());
|
|
|
+// workProjectNotifyService.save(workProjectNotify);
|
|
|
+//
|
|
|
+// List<Activity> list = workActivityMenu.getActivities();
|
|
|
+// if (list != null && list.size() != 0) {
|
|
|
+// workActivityProcessService.saveList(list, processInstance.getId());
|
|
|
+// } else {
|
|
|
+// WorkActivityProcess workActivityProcess = new WorkActivityProcess();
|
|
|
+// workActivityProcess.setProcessKey("contractCheck");
|
|
|
+// workActivityProcess.setCount(1);
|
|
|
+// workActivityProcess.setProcessInstanceId(processInstance.getId());
|
|
|
+// workActivityProcess.setIsApproval("0");
|
|
|
// workActivityProcessService.save(workActivityProcess);
|
|
|
- workActivityProcessService.insertAuditsByType(bmzrs,processInstance.getId(),1,1);
|
|
|
-// workActivityProcessService.insertAuditsByType(scyfglbzrs,processInstance.getId(),2,0);
|
|
|
-// workActivityProcessService.insertAuditsByType(fglds,processInstance.getId(),3,0);
|
|
|
- }
|
|
|
- long end = System.currentTimeMillis();
|
|
|
- logger.info("合同送审任务结束,共耗时:[" + (end-begin) / 1000 + "]秒,流程启动时间:"+(s2-s1)+"ms");
|
|
|
+//// workActivityProcess.setCount(2);
|
|
|
+//// workActivityProcess.setId("");
|
|
|
+//// workActivityProcessService.save(workActivityProcess);
|
|
|
+//// workActivityProcess.setCount(3);
|
|
|
+//// workActivityProcess.setId("");
|
|
|
+//// workActivityProcessService.save(workActivityProcess);
|
|
|
+// workActivityProcessService.insertAuditsByType(bmzrs,processInstance.getId(),1,1);
|
|
|
+//// workActivityProcessService.insertAuditsByType(scyfglbzrs,processInstance.getId(),2,0);
|
|
|
+//// workActivityProcessService.insertAuditsByType(fglds,processInstance.getId(),3,0);
|
|
|
+// }
|
|
|
+// long end = System.currentTimeMillis();
|
|
|
+// logger.info("合同送审任务结束,共耗时:[" + (end-begin) / 1000 + "]秒,流程启动时间:"+(s2-s1)+"ms");
|
|
|
+//
|
|
|
return "";
|
|
|
}
|
|
|
|
|
|
@Transactional(readOnly = false)
|
|
|
- public synchronized String newSave( WorkClientInfo workClientInfo,WorkContractInfo workContractInfo,Map<String, Object> variables, String contextPath,String urls) {
|
|
|
+ public synchronized String newSave( WorkClientLinkman workClientLinkman,WorkContractInfo workContractInfo,Map<String, Object> variables, String contextPath,String urls) {
|
|
|
long begin = System.currentTimeMillis();
|
|
|
String processInstanceId = workContractInfo.getProcessInstanceId();
|
|
|
String contractTypeCode = workContractInfo.getContractTypeDoc();
|
|
@@ -833,7 +862,18 @@ public class WorkContractInfoService extends CrudService<WorkContractInfoDao, Wo
|
|
|
contractTypeId = mainDictDetail.getValue();
|
|
|
}
|
|
|
}
|
|
|
- if (StringUtils.isBlank(workContractInfo.getContractNum())) {
|
|
|
+
|
|
|
+ //添加联系人集合
|
|
|
+ List<WorkClientLinkman> linkmanList = workContractInfo.getWorkClientLinkmanList();
|
|
|
+ for (WorkClientLinkman clientLinkman : linkmanList) {
|
|
|
+ clientLinkman.setContractNum(workContractInfo.getContractNum());
|
|
|
+ clientLinkman.preInsert();
|
|
|
+ workClientLinkmanDao.insertLinkman(clientLinkman);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+// System.out.println("===============================<<<<<<<<<<<<<<<<"+linkmanList);
|
|
|
+ /*if (StringUtils.isBlank(workContractInfo.getContractNum())) {
|
|
|
//根据合同类型生成合同编号
|
|
|
String type = null;
|
|
|
if("100".equals(contractTypeId)){
|
|
@@ -847,8 +887,7 @@ public class WorkContractInfoService extends CrudService<WorkContractInfoDao, Wo
|
|
|
}else {
|
|
|
type = WorkContractInfo.SERIAL_ELST;
|
|
|
}
|
|
|
- System.out.println("=============================****************************************************");
|
|
|
- workClientInfoDao.insert(workClientInfo);
|
|
|
+
|
|
|
// synchronized (SYN_BYTE){
|
|
|
// workContractInfo.setContractNum(serialNumTplService.genSerialNum(UserUtils.get(workContractInfo.getCreateBy().getId()).getCompany(), type).replace("TYPE",contractType));
|
|
|
// }
|
|
@@ -883,7 +922,7 @@ public class WorkContractInfoService extends CrudService<WorkContractInfoDao, Wo
|
|
|
// OSSClientUtil ossUtil = new OSSClientUtil();
|
|
|
// ossUtil.uploadFile2OSS(byteArrayInputStream, Global.getContractNumPath(), picNamePhoto);
|
|
|
// workContractInfo.setContractNumPath(Global.getAliyunUrl()+"/"+Global.getContractNumPath()+picNamePhoto);
|
|
|
- }
|
|
|
+ }*/
|
|
|
workContractInfo.setContractState("5");
|
|
|
this.save(workContractInfo);
|
|
|
// Office office = UserUtils.getUser().getOffice();
|