|
@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
|
|
+import com.jeeplus.common.config.Global;
|
|
|
|
+import com.jeeplus.common.oss.OSSClientUtil;
|
|
import com.jeeplus.common.persistence.Page;
|
|
import com.jeeplus.common.persistence.Page;
|
|
import com.jeeplus.common.service.CrudService;
|
|
import com.jeeplus.common.service.CrudService;
|
|
import com.jeeplus.common.utils.*;
|
|
import com.jeeplus.common.utils.*;
|
|
@@ -49,6 +51,7 @@ import com.jeeplus.modules.sys.service.WorkattachmentService;
|
|
import com.jeeplus.modules.sys.utils.DictUtils;
|
|
import com.jeeplus.modules.sys.utils.DictUtils;
|
|
import com.jeeplus.modules.sys.utils.UserUtils;
|
|
import com.jeeplus.modules.sys.utils.UserUtils;
|
|
import com.jeeplus.modules.tools.utils.HttpPostTool;
|
|
import com.jeeplus.modules.tools.utils.HttpPostTool;
|
|
|
|
+import com.jeeplus.modules.tools.utils.SignaturePostUtil;
|
|
import com.jeeplus.modules.utils.Aestool;
|
|
import com.jeeplus.modules.utils.Aestool;
|
|
import com.jeeplus.modules.utils.Rsatool;
|
|
import com.jeeplus.modules.utils.Rsatool;
|
|
import com.jeeplus.modules.utils.SftpClientUtil;
|
|
import com.jeeplus.modules.utils.SftpClientUtil;
|
|
@@ -194,6 +197,8 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
|
|
private ProjectTemplateDao projectTemplateDao;
|
|
private ProjectTemplateDao projectTemplateDao;
|
|
@Autowired
|
|
@Autowired
|
|
private ProjectPlanDao projectPlanDao;
|
|
private ProjectPlanDao projectPlanDao;
|
|
|
|
+ @Autowired
|
|
|
|
+ private RuralProjectMessageService ruralProjectMessageService;
|
|
|
|
|
|
private static byte[] SYN_BYTE = new byte[0];
|
|
private static byte[] SYN_BYTE = new byte[0];
|
|
|
|
|
|
@@ -661,7 +666,21 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
|
|
//判定如果是B类紧急项目 则不进行流程,直接通过
|
|
//判定如果是B类紧急项目 则不进行流程,直接通过
|
|
if("1".equals(ruralProjectRecords.getSubmitMoney()) && "1".equals(ruralProjectRecords.getEmergencyProject())){
|
|
if("1".equals(ruralProjectRecords.getSubmitMoney()) && "1".equals(ruralProjectRecords.getEmergencyProject())){
|
|
// saveReviewAudit(projectReportData,projectRecord,infoId);
|
|
// saveReviewAudit(projectReportData,projectRecord,infoId);
|
|
- this.exigenceProjectSave(projectReportData);
|
|
|
|
|
|
+ //判断,如果项目类别为审定(内)则走审定内的质量复核流程
|
|
|
|
+ if(null != ruralProjectRecords.getAttachmentProjectSort() && "8".equals(ruralProjectRecords.getAttachmentProjectSort())){
|
|
|
|
+ //启动流程
|
|
|
|
+ String str = null;
|
|
|
|
+ try {
|
|
|
|
+ str = this.startJudgementAudit(projectReportData, variables, processInstanceId, projectcontentinfo.getProject().getProjectLeaders());
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ if (!str.equals("true")){
|
|
|
|
+ return str;
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ this.exigenceProjectSave(projectReportData);
|
|
|
|
+ }
|
|
}else{
|
|
}else{
|
|
//启动流程
|
|
//启动流程
|
|
String str="";
|
|
String str="";
|
|
@@ -698,12 +717,15 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
|
|
workattachment.setDivIdType("_gistdata");
|
|
workattachment.setDivIdType("_gistdata");
|
|
}else if ("153".equals(workattachment.getAttachmentFlag())){
|
|
}else if ("153".equals(workattachment.getAttachmentFlag())){
|
|
workattachment.setDivIdType("_other");
|
|
workattachment.setDivIdType("_other");
|
|
|
|
+ }else if ("105".equals(workattachment.getAttachmentFlag())){
|
|
|
|
+ workattachment.setDivIdType("_judgement");
|
|
}
|
|
}
|
|
if (workattachment.getId() == null) {
|
|
if (workattachment.getId() == null) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- if (workattachment.DEL_FLAG_NORMAL.equals(workattachment.getDelFlag())) {
|
|
|
|
|
|
+ /*if (workattachment.DEL_FLAG_NORMAL.equals(workattachment.getDelFlag())) {
|
|
workattachment.setAttachmentId(infoId);
|
|
workattachment.setAttachmentId(infoId);
|
|
|
|
+ workattachment.setProjectId(projectcontentinfo.getProject().getId());
|
|
workattachment.setAttachmentUser(UserUtils.getUser().getId());
|
|
workattachment.setAttachmentUser(UserUtils.getUser().getId());
|
|
if (com.jeeplus.common.utils.StringUtils.isBlank(workattachment.getId()) || "null".equals(workattachment.getId())) {
|
|
if (com.jeeplus.common.utils.StringUtils.isBlank(workattachment.getId()) || "null".equals(workattachment.getId())) {
|
|
workattachment.preInsert();
|
|
workattachment.preInsert();
|
|
@@ -712,24 +734,194 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
|
|
}
|
|
}
|
|
|
|
|
|
workattachmentDao.insert(workattachment);
|
|
workattachmentDao.insert(workattachment);
|
|
- if (projectcontentinfo.getProjectReportData()!=null && com.jeeplus.common.utils.StringUtils.isNotBlank(projectcontentinfo.getProjectReportData().getId())) {
|
|
|
|
|
|
+ *//*if (projectcontentinfo.getProjectReportData()!=null && com.jeeplus.common.utils.StringUtils.isNotBlank(projectcontentinfo.getProjectReportData().getId())) {
|
|
try {
|
|
try {
|
|
signatureDocumentService.createIsignature(workattachment.getUrl(), workattachment.getAttachmentName(), workattachment.getId(), projectcontentinfo.getProjectReportData().getName());
|
|
signatureDocumentService.createIsignature(workattachment.getUrl(), workattachment.getAttachmentName(), workattachment.getId(), projectcontentinfo.getProjectReportData().getName());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
logger.info("PDF转换失败:" + e);
|
|
logger.info("PDF转换失败:" + e);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }*//*
|
|
} else {
|
|
} else {
|
|
workattachment.preUpdate();
|
|
workattachment.preUpdate();
|
|
workattachmentDao.update(workattachment);
|
|
workattachmentDao.update(workattachment);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
workattachmentDao.delete(workattachment);
|
|
workattachmentDao.delete(workattachment);
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+ if (WorkClientAttachment.DEL_FLAG_NORMAL.equals(workattachment.getDelFlag())){
|
|
|
|
+ workattachment.setAttachmentId(projectcontentinfo.getProject().getId());
|
|
|
|
+ workattachment.setProjectId(projectcontentinfo.getProject().getId());
|
|
|
|
+ workattachment.setAttachmentFlag("105");
|
|
|
|
+ workattachment.setAttachmentUser(UserUtils.getUser().getId());
|
|
|
|
+ if (com.jeeplus.common.utils.StringUtils.isBlank(workattachment.getId()) || "null".equals(workattachment.getId())){
|
|
|
|
+ workattachmentService.insertOnWorkAttachment(workattachment);
|
|
|
|
+ }else{
|
|
|
|
+ workattachmentService.updateOnWorkAttachment(workattachment);
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ workattachmentDao.delete(workattachment);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return "true";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 审定(内)启动审批流程
|
|
|
|
+ * @param projectReportData
|
|
|
|
+ * @param variables
|
|
|
|
+ * @param processInstanceId
|
|
|
|
+ * @param masters
|
|
|
|
+ * @return
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ private String startJudgementAudit(ProjectReportData projectReportData,Map<String, Object> variables,String processInstanceId,List<User> masters) throws Exception {
|
|
|
|
+ User user = UserUtils.get(projectReportData.getCreateBy().getId());
|
|
|
|
+ Boolean insert = false;
|
|
|
|
+ if (StringUtils.isBlank(projectReportData.getId())){
|
|
|
|
+ projectReportData.preInsert();
|
|
|
|
+ insert = true;
|
|
|
|
+ }
|
|
|
|
+ String num = projectReportData.getNumber();
|
|
|
|
+ if(com.jeeplus.common.utils.StringUtils.isNotBlank(num)){
|
|
|
|
+ projectReportNumService.updateNum(num);
|
|
|
|
+ }
|
|
|
|
+ ProjectRecords projectRecords = dao.getRuralProjectRecords(projectReportData.getProject().getId());
|
|
|
|
+ Office recordsOffice =officeService.get(projectRecords.getOffice());
|
|
|
|
+ String title = "项目【"+projectRecords.getProjectName()+"】报告质量复核待审批";
|
|
|
|
+ String str = "项目【"+projectRecords.getProjectName()+"】报告质量复核待审批";
|
|
|
|
+ // 用来设置启动流程的人员ID,引擎会自动把用户ID保存到activiti:initiator中
|
|
|
|
+ identityService.setAuthenticatedUserId(user.getId());
|
|
|
|
+ // 启动流程
|
|
|
|
+ String businessKey = projectReportData.getId().toString();
|
|
|
|
+ WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("9764872f45b84acd893010e66a3db2c8", recordsOffice);
|
|
|
|
+ // 启动流程
|
|
|
|
+ String processType = workActivityMenu.getProcessType();
|
|
|
|
+ StringBuffer buffer = new StringBuffer();
|
|
|
|
+ Activity activity = new Activity();
|
|
|
|
+ WorkProjectNotify workProjectNotify = UtilNotify
|
|
|
|
+ .saveNotify(projectReportData.getId(),
|
|
|
|
+ null,
|
|
|
|
+ projectReportData.getCompanyId(),
|
|
|
|
+ title,
|
|
|
|
+ str,
|
|
|
|
+ "105",
|
|
|
|
+ "0",
|
|
|
|
+ "待审批",
|
|
|
|
+ ""
|
|
|
|
+ );
|
|
|
|
+ List<User> users = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ //部门主任
|
|
|
|
+ List<User> bmzrs = UserUtils.getByRoleActivityEnname("bmzr",2,projectReportData.getOfficeId(),"4",projectRecords.getCreateBy());
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if (insert) {
|
|
|
|
+ projectReportDataService.insert(projectReportData);
|
|
|
|
+ }else {
|
|
|
|
+ projectReportDataService.save(projectReportData);
|
|
|
|
+ }
|
|
|
|
+ if (com.jeeplus.common.utils.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 && com.jeeplus.common.utils.StringUtils.isNotBlank(a.getRole().getEnname())){
|
|
|
|
+ List enusers = UserUtils.getByRoleActivityEnnames(a.getRole().getEnname(),recordsOffice.getId(),"8",projectReportData.getCreateBy());
|
|
|
|
+ if (enusers.size()==0){
|
|
|
|
+ projectReportData.setStatus("1");
|
|
|
|
+ projectReportDataService.save(projectReportData);
|
|
|
|
+ return "流程审批人不能为空,角色"+a.getRole().getName()+"下无用户,请联系管理员!";
|
|
|
|
+ }
|
|
|
|
+ variables.put(encount, enusers.size());
|
|
|
|
+ variables.put(enlist, enusers);
|
|
|
|
+ }
|
|
|
|
+ if (a.getDelFlag().equals("0") && a.getCount() == 1) {
|
|
|
|
+ activity = a;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ buffer.append(activity.getRole().getEnname());
|
|
|
|
+ if (activity != null && com.jeeplus.common.utils.StringUtils.isNotBlank(activity.getId())) {
|
|
|
|
+ //人员审批
|
|
|
|
+ if (com.jeeplus.common.utils.StringUtils.isNotBlank(activity.getUser().getId())) {
|
|
|
|
+ users.add(activity.getUser());
|
|
}
|
|
}
|
|
|
|
+ //角色审批
|
|
|
|
+ if (com.jeeplus.common.utils.StringUtils.isNotBlank(activity.getRole().getEnname())) {
|
|
|
|
+ users = UserUtils.getByRoleActivityEnnames(activity.getRole().getEnname(),recordsOffice.getId(),"8",projectReportData.getCreateBy());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ workProjectNotify.setId("");
|
|
|
|
+ } else {
|
|
|
|
+ if (bmzrs.size()==0 ){
|
|
|
|
+ projectReportData.setStatus("1");
|
|
|
|
+ projectReportDataService.save(projectReportData);
|
|
|
|
+ }
|
|
|
|
+ if (bmzrs.size()==0){
|
|
|
|
+ return "流程审批人不能为空,部门主任下无用户,请联系管理员!";
|
|
|
|
+ }
|
|
|
|
+ processType = "judgementReport";
|
|
|
|
+ users.addAll(bmzrs);
|
|
|
|
+ variables.put("bmzrList", bmzrs);
|
|
|
|
+ variables.put("bmzrcount", bmzrs.size());
|
|
|
|
+ }
|
|
|
|
+ for (User u : users){
|
|
|
|
+ workProjectNotify.setUser(u);
|
|
|
|
+ workProjectNotify.setNotifyRole("部门主任审批");
|
|
|
|
+ workProjectNotify.setId("");
|
|
|
|
+ workProjectNotifyService
|
|
|
|
+ .save(workProjectNotify);
|
|
|
|
+ Map<String,Object> extras = new HashMap<>();
|
|
|
|
+ extras.put("type","7001");
|
|
|
|
+ extras.put("id",workProjectNotify.getId());
|
|
|
|
+ extras.put("procDefKey","105");
|
|
|
|
+ UserUtils.pushInfoToApp(title,str,extras,u.getId());
|
|
|
|
+ UserUtils.pushIm(u.getId(),str);
|
|
|
|
+ }
|
|
|
|
+ variables.put("type", processType);
|
|
|
|
+ variables.put("busId", businessKey);
|
|
|
|
+ variables.put("title", "审批单:" + projectReportData.getNumber());//设置标题;
|
|
|
|
+
|
|
|
|
+ ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
|
|
|
|
+ projectReportData.setProcessInstance(processInstance);
|
|
|
|
+ if (com.jeeplus.common.utils.StringUtils.isNotBlank(processInstanceId)) {
|
|
|
|
+ workActivityProcessService.updateProcessInstanceId(processInstance.getId(),processInstanceId);
|
|
|
|
+ workActivityProcessService.deleteProcessInstanceId(processInstanceId);
|
|
|
|
+ workActivityProcessService.deleteProcessIdAuditUsers(processInstanceId);
|
|
|
|
+ }
|
|
|
|
+ // 更新流程实例ID
|
|
|
|
+ projectReportData.setProcessInstanceId(processInstance.getId());
|
|
|
|
+ projectReportDataDao.updateProcessInstanceId(projectReportData);
|
|
|
|
+ //通知添加流程实例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(processType);
|
|
|
|
+ workActivityProcess.setCount(1);
|
|
|
|
+ workActivityProcess.setProcessInstanceId(processInstance.getId());
|
|
|
|
+ workActivityProcess.setIsApproval("0");
|
|
|
|
+ workActivityProcess.setCreateBy(user);
|
|
|
|
+ workActivityProcess.setUpdateBy(user);
|
|
|
|
+ if (StringUtils.isBlank(workActivityProcess.getId())){
|
|
|
|
+ workActivityProcess.setId(IdGen.uuid());
|
|
}
|
|
}
|
|
|
|
+ workActivityProcess.setUpdateDate(new Date());
|
|
|
|
+ workActivityProcess.setCreateDate(new Date());
|
|
|
|
+ workActivityProcessService.adminInsert(workActivityProcess);
|
|
|
|
+ workActivityProcessService.insertAuditsByType(bmzrs,processInstance.getId(),1,1);
|
|
}
|
|
}
|
|
return "true";
|
|
return "true";
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
@Transactional(readOnly = false)
|
|
@Transactional(readOnly = false)
|
|
public Boolean saveReportTree(Projectcontentinfo projectcontentinfo,Boolean save,String infoId,String review,int type) {
|
|
public Boolean saveReportTree(Projectcontentinfo projectcontentinfo,Boolean save,String infoId,String review,int type) {
|
|
if (!save){
|
|
if (!save){
|
|
@@ -1315,6 +1507,519 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
|
|
return "保存审核意见成功!";
|
|
return "保存审核意见成功!";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 审核流程
|
|
|
|
+ * @param reportData
|
|
|
|
+ */
|
|
|
|
+ @Transactional(readOnly = false)
|
|
|
|
+ public String auditJudgementSave(ProjectReportData reportData,List<User> auditUsers) {
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isNotBlank(reportData.getConsultantRemarks())){
|
|
|
|
+ while (reportData.getConsultantRemarks().endsWith(",")){
|
|
|
|
+ reportData.setConsultantRemarks(reportData.getConsultantRemarks().substring(0,reportData.getConsultantRemarks().length()-1));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isNotBlank(reportData.getPrincipalRemarks())){
|
|
|
|
+ while(reportData.getPrincipalRemarks().endsWith(",")){
|
|
|
|
+ reportData.setPrincipalRemarks(reportData.getPrincipalRemarks().substring(0,reportData.getPrincipalRemarks().length()-1));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isNotBlank(reportData.getTechnicistRemarks())){
|
|
|
|
+ while(reportData.getTechnicistRemarks().endsWith(",")){
|
|
|
|
+ reportData.setTechnicistRemarks(reportData.getTechnicistRemarks().substring(0,reportData.getTechnicistRemarks().length()-1));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ String flag = reportData.getAct().getFlag();
|
|
|
|
+ // 对不同环节的业务逻辑进行操作
|
|
|
|
+ Act act = reportData.getAct();
|
|
|
|
+ String taskDefKey = act.getTaskDefKey();
|
|
|
|
+ ProjectReportData projectReportData = null;
|
|
|
|
+ if (!"modifyApply".equals(taskDefKey) && !taskDefKey.contains("audit") ) {
|
|
|
|
+ actTaskService.claim(act.getTaskId(), UserUtils.getUser().getId());
|
|
|
|
+ projectReportData = projectReportDataDao.get(reportData.getId());
|
|
|
|
+ }else {
|
|
|
|
+ projectReportData = reportData;
|
|
|
|
+ flag = "yes";
|
|
|
|
+ }
|
|
|
|
+ User user= UserUtils.get(projectReportData.getCreateBy().getId());
|
|
|
|
+ ProjectRecords projectRecords = projectRecordsService.getRuralMasters(projectReportData.getProject().getId());
|
|
|
|
+ //获取项目信息
|
|
|
|
+ RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectReportData.getProject().getId());
|
|
|
|
+
|
|
|
|
+ Office recordsOffice =officeService.get(projectRecords.getOffice());
|
|
|
|
+ String title = "报告名称:"+projectReportData.getName();
|
|
|
|
+ String str = "报告名称:"+projectReportData.getName()+",工作内容类型:"+ WorkContentTypeController.getContentTypeName(projectReportData.getType(),"")+",项目所属部门:"+recordsOffice.getName()+",负责人:"+user.getName();
|
|
|
|
+
|
|
|
|
+ if (com.jeeplus.common.utils.StringUtils.isBlank(act.getComment())){
|
|
|
|
+ act.setComment(flag.equals("yes")?"同意":"驳回");
|
|
|
|
+ }
|
|
|
|
+ String comment = "";
|
|
|
|
+ if (projectReportData.getStatus().equals("4")){
|
|
|
|
+ comment = ("yes".equals(flag)?"[重新申请] ":"[已撤销] ");
|
|
|
|
+ }else {
|
|
|
|
+ comment = ("yes".equals(flag)?"[同意] ":"[驳回] ")+act.getComment();
|
|
|
|
+ }
|
|
|
|
+ //yes 的时候状态为审核通过 否则为未通过
|
|
|
|
+ //1 审核中 2 未通过
|
|
|
|
+ projectReportData.setStatus(("yes".equals(flag) ? "2" : "4"));
|
|
|
|
+ Map<String, Object> vars = Maps.newHashMap();
|
|
|
|
+ //业务逻辑对应的条件表达式
|
|
|
|
+ String exp = "";
|
|
|
|
+ String taskCount = "";
|
|
|
|
+ String notifyRole = "";
|
|
|
|
+ int key = 0;
|
|
|
|
+ String enname = "";
|
|
|
|
+ List<Activity> activitieList = activityService.getByProcessInstanceId(projectReportData.getProcessInstanceId());
|
|
|
|
+ WorkActivityMenu workActivityMenu = new WorkActivityMenu();
|
|
|
|
+ if (activitieList != null && activitieList.size() != 0) {
|
|
|
|
+ //判断上面act流程的流程图key是不是空 不是空则使用该流程图key信息
|
|
|
|
+ if(StringUtils.isNotBlank(act.getProcDefKey())){
|
|
|
|
+ workActivityMenu.setProcessType(act.getProcDefKey());
|
|
|
|
+ }else{
|
|
|
|
+ workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
|
|
|
|
+ }
|
|
|
|
+ workActivityMenu.setActivities(activitieList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ WorkActivityProcess workActivityProcess = new WorkActivityProcess();
|
|
|
|
+ WorkActivityProcess selectProcess = new WorkActivityProcess();
|
|
|
|
+ selectProcess.setProcessInstanceId(projectReportData.getProcessInstanceId());
|
|
|
|
+ List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
|
|
|
|
+ List<Activity> activities = workActivityMenu.getActivities();
|
|
|
|
+ if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("judgementReport")) {
|
|
|
|
+ key = 1;
|
|
|
|
+ for (int i = 0; i < workActivityProcesses.size(); i++) {
|
|
|
|
+ WorkActivityProcess activityProcess = workActivityProcesses.get(i);
|
|
|
|
+ if (taskDefKey.equals(activityProcess.getActivityTask()) && !taskDefKey.equals("modifyApply")) {
|
|
|
|
+ taskCount = activityProcess.getCount()+"";
|
|
|
|
+ workActivityProcess = activityProcess;
|
|
|
|
+ if (!workActivityProcess.getIsApproval().equals("0")) {
|
|
|
|
+ workActivityProcess.setId("");
|
|
|
|
+ }
|
|
|
|
+ exp = "pass";
|
|
|
|
+ if (!"yes".equals(flag)) {
|
|
|
|
+ workActivityProcess.setIsApproval("2");
|
|
|
|
+ projectReportData.setStatus("4");
|
|
|
|
+ String returnBack = "-1";
|
|
|
|
+ for (Activity activity : activities) {
|
|
|
|
+ if (activity.getCount() == activityProcess.getCount()) {
|
|
|
|
+ returnBack = activity.getReturnBack();
|
|
|
|
+ notifyRole = activity.getName();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (returnBack.equals("0")) {
|
|
|
|
+ workActivityProcess.setId("");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ workActivityProcess.setIsApproval("1");
|
|
|
|
+ }
|
|
|
|
+ }else if(taskDefKey.equals("modifyApply")){
|
|
|
|
+ notifyRole = "调整报告";
|
|
|
|
+ taskCount = "0";
|
|
|
|
+ exp = "pass";
|
|
|
|
+ workActivityProcess.setId("");
|
|
|
|
+ workActivityProcess.setCount(0);
|
|
|
|
+ if (!"yes".equals(flag)) {
|
|
|
|
+ projectReportData.setStatus("3");
|
|
|
|
+ workActivityProcess.setIsApproval("2");
|
|
|
|
+ } else {
|
|
|
|
+ workActivityProcess.setIsApproval("1");
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ workActivityMenu.setProcessType("judgementReport");
|
|
|
|
+ for (int i = 0; i < workActivityProcesses.size(); i++) {
|
|
|
|
+ WorkActivityProcess activityProcess = workActivityProcesses.get(i);
|
|
|
|
+ String count = activityProcess.getCount() + "";
|
|
|
|
+ workActivityProcess = activityProcess;
|
|
|
|
+ if (!workActivityProcess.getIsApproval().equals("0")) {
|
|
|
|
+ workActivityProcess.setId("");
|
|
|
|
+ }
|
|
|
|
+ // 审核环节
|
|
|
|
+ if ("bmzr".equals(taskDefKey) && count.contains("1")) {
|
|
|
|
+ taskCount = "1";
|
|
|
|
+ exp = "pass";
|
|
|
|
+ if ("yes".equals(flag)) {
|
|
|
|
+ projectReportData.setTechnicistDate(new Date());
|
|
|
|
+ notifyRole = "审批通过";
|
|
|
|
+ synchronized (SYN_BYTE) {
|
|
|
|
+ /*String reportNo = createReportNo(reportData.getConditionType());
|
|
|
|
+ projectReportData.setNumber(reportNo);*/
|
|
|
|
+
|
|
|
|
+ //下载审定单文件
|
|
|
|
+ String deleteFile = null;
|
|
|
|
+ try {
|
|
|
|
+ //进行签章处理
|
|
|
|
+ //根据项目id查询是否已经提交过了审定单签章
|
|
|
|
+ if(null == ruralProjectRecords){
|
|
|
|
+ return "查询不到该项目信息";
|
|
|
|
+ }
|
|
|
|
+ if(null!= ruralProjectRecords.getQualitySignatureFlag() && 1 == ruralProjectRecords.getQualitySignatureFlag()){
|
|
|
|
+ return "该项目已经报告盖章完成";
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isBlank(ruralProjectRecords.getProjectMasterId())){
|
|
|
|
+ return "项目负责人为空,无法进行签章";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //根据项目id和附件类型的
|
|
|
|
+ Workattachment workClientAttachment = new Workattachment();
|
|
|
|
+ workClientAttachment.setAttachmentFlag("105");
|
|
|
|
+ workClientAttachment.setAttachmentId(ruralProjectRecords.getId());
|
|
|
|
+ workClientAttachment.setProjectId(ruralProjectRecords.getId());
|
|
|
|
+ workClientAttachment.setDivIdType("_judgement");
|
|
|
|
+ List<Workattachment> fileList = workattachmentService.findList(workClientAttachment);
|
|
|
|
+ if(fileList.size()>0){
|
|
|
|
+ Workattachment workattachment = fileList.get(0);
|
|
|
|
+ if(StringUtils.isBlank(workattachment.getUrl())){
|
|
|
|
+ return "报告签章文件存储路径为空,无法进行签章操作,请驳回后重新上传审定单";
|
|
|
|
+ }
|
|
|
|
+ //下载审定单文件
|
|
|
|
+ String path = null;
|
|
|
|
+ if(System.getProperty("os.name").toLowerCase().contains("win")){
|
|
|
|
+ path = "D:/attachment-file/";
|
|
|
|
+ }else{
|
|
|
|
+ path = "/attachment-file/";
|
|
|
|
+ }
|
|
|
|
+ String file = workattachment.getUrl();
|
|
|
|
+ file = file.replace("amp;","");
|
|
|
|
+ String fileName = file.substring(file.lastIndexOf("/") + 1, file.length());
|
|
|
|
+ String aliyunUrl = Global.getAliyunUrl();
|
|
|
|
+ String aliDownloadUrl = Global.getAliDownloadUrl();
|
|
|
|
+ String cons = "";
|
|
|
|
+ if (file.contains(aliyunUrl)){
|
|
|
|
+ cons = aliyunUrl;
|
|
|
|
+ }else if (file.contains("http://gangwan-app.oss-cn-hangzhou.aliyuncs.com")){
|
|
|
|
+ cons = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com";
|
|
|
|
+ }else {
|
|
|
|
+ cons = aliDownloadUrl;
|
|
|
|
+ }
|
|
|
|
+ String ossKey = file.split(cons+"/")[1];
|
|
|
|
+ new OSSClientUtil().downByStreamSaveLocal(ossKey,fileName,path+fileName);
|
|
|
|
+ //将下载下来的文件转换为file文件
|
|
|
|
+ File srcFile = new File(path+fileName);
|
|
|
|
+ deleteFile = path+fileName;
|
|
|
|
+
|
|
|
|
+ //截取文件名称
|
|
|
|
+ String srcFileName = srcFile.getName().substring(0,srcFile.getName().lastIndexOf("."));
|
|
|
|
+ //截取文件后缀名
|
|
|
|
+ String substring = srcFile.getName().substring(srcFile.getName().lastIndexOf(".")+1, srcFile.getName().length());
|
|
|
|
+ if(!"doc".equals(substring.toLowerCase()) && !"docx".equals(substring.toLowerCase()) && !"pdf".equals(substring.toLowerCase()) && !"xls".equals(substring.toLowerCase()) && !"xlsx".equals(substring.toLowerCase())){
|
|
|
|
+ return "请上传doc、docx、xls、xlsx或者pdf文件进行签章操作";
|
|
|
|
+ }
|
|
|
|
+ //获取真签单的documentId
|
|
|
|
+ HashMap hashMap = SignaturePostUtil.getDocument(srcFile);
|
|
|
|
+ String code = hashMap.get("code").toString();
|
|
|
|
+ String documentId = "";
|
|
|
|
+ if("0".equals(code)){
|
|
|
|
+ String result = hashMap.get("result").toString();
|
|
|
|
+ HashMap documentIdMap = JSON.parseObject(result, HashMap.class);
|
|
|
|
+ documentId = documentIdMap.get("documentId").toString();
|
|
|
|
+ if("".equals(documentId)){
|
|
|
|
+ return "签章文件创建失败";
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ String message = hashMap.get("message").toString();
|
|
|
|
+ return message;
|
|
|
|
+ }
|
|
|
|
+ List<String> documentList = Lists.newArrayList();
|
|
|
|
+ documentList.add(documentId);
|
|
|
|
+ //根据项目id 和 documentId生成合同id
|
|
|
|
+ long s1 = System.currentTimeMillis();
|
|
|
|
+ HashMap contractIdHashMap = new HashMap();
|
|
|
|
+ if("doc".equals(substring.toLowerCase()) || "docx".equals(substring.toLowerCase()) || "pdf".equals(substring.toLowerCase()) ){
|
|
|
|
+ contractIdHashMap = ruralProjectMessageService.getSignatureContractId(ruralProjectRecords.getId(), documentList,ruralProjectRecords.getProjectMasterId(),"");
|
|
|
|
+ }else if("xls".equals(substring.toLowerCase()) || "xlsx".equals(substring.toLowerCase())){
|
|
|
|
+ contractIdHashMap = ruralProjectMessageService.getSignatureExcelContractId(ruralProjectRecords.getId(), documentList,ruralProjectRecords.getProjectMasterId(),"");
|
|
|
|
+ }
|
|
|
|
+ String contractIdCode = contractIdHashMap.get("code").toString();
|
|
|
|
+ String contractId = "";
|
|
|
|
+ if("0".equals(contractIdCode)){
|
|
|
|
+ contractId = contractIdHashMap.get("contractId").toString();
|
|
|
|
+ if("".equals(contractId)){
|
|
|
|
+ return "签章文件创建失败";
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ return contractIdHashMap.get("message").toString();
|
|
|
|
+ }
|
|
|
|
+ long s2 = System.currentTimeMillis();
|
|
|
|
+ System.out.println("创建签章合同用时:" + (s2-s1));
|
|
|
|
+
|
|
|
|
+ //进行静默签署
|
|
|
|
+ long s3 = System.currentTimeMillis();
|
|
|
|
+ HashMap signbyCompanyHashMap = ruralProjectMessageService.signbyCompanyByKeyWord(contractId,documentList);
|
|
|
|
+ if(null != signbyCompanyHashMap){
|
|
|
|
+ String signbyCompanyCode = signbyCompanyHashMap.get("code").toString();
|
|
|
|
+ String signbyCompanyMessage = signbyCompanyHashMap.get("message").toString();
|
|
|
|
+ if(!"0".equals(signbyCompanyCode) && (!"3001009".equals(signbyCompanyCode) || !"文件状态不是“签署中”".equals(signbyCompanyMessage))){
|
|
|
|
+ return signbyCompanyMessage;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ long s4 = System.currentTimeMillis();
|
|
|
|
+ System.out.println("进行静默签署用时:" + (s4-s3));
|
|
|
|
+ //将documentId 和contractId存储到质量复核对应的数据种
|
|
|
|
+ //签章完成则进行数据的保存
|
|
|
|
+ ruralProjectRecords.setQualitySignatureFlag(1);
|
|
|
|
+ ruralProjectRecords.setQualitySignatureDocumentId(documentId);
|
|
|
|
+ ruralProjectRecords.setQualitySignatureContractId(contractId);
|
|
|
|
+ ruralProjectRecords.setQualitySignatureFileName(srcFileName);
|
|
|
|
+ ruralProjectRecords.setQualitySignatureUploadFileUser(UserUtils.getUser());
|
|
|
|
+ ruralProjectRecords.setQualitySignatureUploadDate(new Date());
|
|
|
|
+ //修改签章对应信息文件
|
|
|
|
+ projectReportDataService.updateJudgementSignatureInfo(ruralProjectRecords);
|
|
|
|
+ }else{
|
|
|
|
+ return "质量复核审定单文件未找到,无法进行签章操作";
|
|
|
|
+ }
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+
|
|
|
|
+ }finally {
|
|
|
|
+ if(StringUtils.isNotBlank(deleteFile)){
|
|
|
|
+ //根据路径创建文件对象
|
|
|
|
+ File file = new File(deleteFile);
|
|
|
|
+ //路径是个文件且不为空时删除文件
|
|
|
|
+ if(file.isFile()&&file.exists()){
|
|
|
|
+ file.delete();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //添加审核通过日期
|
|
|
|
+ projectReportData.setAuditPassDate(new Date());
|
|
|
|
+ }
|
|
|
|
+ workActivityProcess.setIsApproval("1");
|
|
|
|
+ } else {
|
|
|
|
+ notifyRole = "调整报告";
|
|
|
|
+ workActivityProcess.setIsApproval("2");
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ } else if ("modifyApply".equals(taskDefKey)&& count.contains("0")) {
|
|
|
|
+ notifyRole = "部门主任审批";
|
|
|
|
+ taskCount = "0";
|
|
|
|
+ exp = "pass";
|
|
|
|
+ workActivityProcess.setCount(0);
|
|
|
|
+ enname = "master";
|
|
|
|
+ if (!"yes".equals(flag)) {
|
|
|
|
+ projectReportData.setStatus("3");
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 设置意见
|
|
|
|
+ act.setComment(("yes".equals(flag) ? "[同意] " : "[驳回] ") + act.getComment());
|
|
|
|
+ projectReportData.preUpdate();
|
|
|
|
+ // 提交流程任务
|
|
|
|
+ vars.put(exp, "yes".equals(flag) ? true : false);
|
|
|
|
+ vars.put("passs", true);
|
|
|
|
+ workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,projectReportData.getProcessInstanceId(),taskDefKey,"modifyApply",flag,comment, activities);
|
|
|
|
+ // 提交流程任务
|
|
|
|
+ actTaskService.complete(act.getTaskId(), act.getProcInsId(), act.getComment(), vars);
|
|
|
|
+ boolean state = actTaskService.isProcessEnd(act.getProcInsId());
|
|
|
|
+ ProjectReportData projectReportDataInfo = projectReportDataService.get(projectReportData.getId());
|
|
|
|
+ List<User> users = new ArrayList<>();
|
|
|
|
+ List<User> userList = new ArrayList<>();
|
|
|
|
+ if (!state) {
|
|
|
|
+ users.add(projectReportData.getCreateBy());
|
|
|
|
+ if ("yes".equals(flag)) {
|
|
|
|
+ String titleStr = "项目【"+projectRecords.getProjectName()+"】报告质量复核审批通过";
|
|
|
|
+ String content = "项目【"+projectRecords.getProjectName()+"】报告质量复核审批通过";
|
|
|
|
+ if(StringUtils.isNotBlank(projectReportData.getNumber())){
|
|
|
|
+ titleStr = "报告号:"+projectReportData.getNumber()+"。项目【"+projectRecords.getProjectName()+"】报告质量复核审批通过";
|
|
|
|
+ content = "报告号:"+projectReportData.getNumber()+"。项目【"+projectRecords.getProjectName()+"】报告质量复核审批通过";
|
|
|
|
+ }
|
|
|
|
+ str = "报告名称:"+projectReportData.getName()+",工作内容类型:"+ WorkContentTypeController.getContentTypeName(projectReportData.getType(),"")+",项目所属部门:"+recordsOffice.getName();
|
|
|
|
+ projectReportData.setStatus("5");
|
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
|
+ notify.setNotifyId(projectReportData.getId());
|
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
|
+ workProjectNotifyService
|
|
|
|
+ .save(UtilNotify
|
|
|
|
+ .saveNotify(projectReportData.getId(),
|
|
|
|
+ projectReportData.getCreateBy(),
|
|
|
|
+ projectReportData.getCompanyId(),
|
|
|
|
+ titleStr,
|
|
|
|
+ content,
|
|
|
|
+ "105",
|
|
|
|
+ "0",
|
|
|
|
+ "待通知",
|
|
|
|
+ notifyRole));
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
|
+ notify.setNotifyId(projectReportData.getId());
|
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
|
+ if (com.jeeplus.common.utils.StringUtils.isNotBlank(projectReportData.getStatus()) && !projectReportData.getStatus().equals("3")){
|
|
|
|
+ projectReportData.setStatus("4");
|
|
|
|
+ workProjectNotifyService
|
|
|
|
+ .save(UtilNotify
|
|
|
|
+ .saveNotify(projectReportData.getId(),
|
|
|
|
+ projectReportData.getCreateBy(),
|
|
|
|
+ projectReportData.getCompanyId(),
|
|
|
|
+ title,
|
|
|
|
+ str,
|
|
|
|
+ "105",
|
|
|
|
+ "0",
|
|
|
|
+ "待通知",
|
|
|
|
+ notifyRole));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ workActivityProcessService.deleteProcessIdAuditUsers(projectReportData.getProcessInstanceId());
|
|
|
|
+ } else {
|
|
|
|
+ if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("judgementReport")) {
|
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
|
+ notify.setNotifyId(projectReportData.getId());
|
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
|
+ WorkProjectNotify workProjectNotify = UtilNotify
|
|
|
|
+ .saveNotify(projectReportData.getId(),
|
|
|
|
+ new User(),
|
|
|
|
+ projectReportData.getCompanyId(),
|
|
|
|
+ title,
|
|
|
|
+ str,
|
|
|
|
+ "105",
|
|
|
|
+ "0",
|
|
|
|
+ "待审批",
|
|
|
|
+ notifyRole);
|
|
|
|
+ List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
|
|
|
|
+ activities,
|
|
|
|
+ workProjectNotify,
|
|
|
|
+ taskDefKey,
|
|
|
|
+ flag,
|
|
|
|
+ taskCount,
|
|
|
|
+ projectReportData.getCreateBy(),
|
|
|
|
+ user.getOffice().getId(),
|
|
|
|
+ "8");
|
|
|
|
+ for (WorkProjectNotify workProjectNotify1:workProjectNotifys){
|
|
|
|
+ users.add(workProjectNotify1.getUser());
|
|
|
|
+ workProjectNotify1.setId("");
|
|
|
|
+ workProjectNotify1.setIsNewRecord(false);
|
|
|
|
+ workProjectNotifyService
|
|
|
|
+ .save(workProjectNotify1);
|
|
|
|
+ if (!"modifyApply".equals(taskDefKey)){
|
|
|
|
+ Map<String,Object> extras = new HashMap<>();
|
|
|
|
+ if ("glyda".equals(taskDefKey)){
|
|
|
|
+ extras.put("type","7003");
|
|
|
|
+ }else if("zlfgld".equals(taskDefKey) ){
|
|
|
|
+ extras.put("type","7002");
|
|
|
|
+ }else {
|
|
|
|
+ extras.put("type","7001");
|
|
|
|
+ }
|
|
|
|
+ extras.put("id",workProjectNotify.getId());
|
|
|
|
+ extras.put("procDefKey","105");
|
|
|
|
+ UserUtils.pushInfoToApp(title,str,extras,workProjectNotify1.getUser().getId());
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ if (!"yes".equals(flag)) {//报告驳回待办提醒
|
|
|
|
+ title = "项目【"+ projectRecords.getProjectName()+"】新增报告质量复核被驳回";
|
|
|
|
+ str = "项目【"+ projectRecords.getProjectName()+"】新增报告质量复核被驳回,请选择重新申请或删除报告";
|
|
|
|
+ if(StringUtils.isNotBlank(projectReportData.getNumber())){
|
|
|
|
+ title = "报告号:"+projectReportData.getNumber()+"。项目【"+projectRecords.getProjectName()+"】新增报告质量复核被驳回";
|
|
|
|
+ str = "报告号:"+projectReportData.getNumber()+"。项目【"+projectRecords.getProjectName()+"】新增报告质量复核被驳回,请选择重新申请或删除报告";
|
|
|
|
+ }
|
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
|
+ notify.setNotifyId(projectReportData.getId());
|
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
|
+ workProjectNotifyService
|
|
|
|
+ .save(UtilNotify
|
|
|
|
+ .saveNotify(projectReportData.getId(),
|
|
|
|
+ projectReportData.getCreateBy(),
|
|
|
|
+ projectReportData.getCompanyId(),
|
|
|
|
+ title,
|
|
|
|
+ str,
|
|
|
|
+ "105",
|
|
|
|
+ "0",
|
|
|
|
+ "重新申请",
|
|
|
|
+ notifyRole));
|
|
|
|
+ users.add( projectReportData.getCreateBy());
|
|
|
|
+ } else {
|
|
|
|
+ if (com.jeeplus.common.utils.StringUtils.isNotBlank(enname)) {//驳回重新申请待办信息
|
|
|
|
+ str = "项目【"+ projectRecords.getProjectName()+"】报告质量复核待审批";
|
|
|
|
+ title = "项目【"+ projectRecords.getProjectName()+"】报告质量复核待审批";
|
|
|
|
+ if(StringUtils.isNotBlank(projectReportData.getNumber())){
|
|
|
|
+ title = "报告号:"+projectReportData.getNumber()+"。项目【"+projectRecords.getProjectName()+"】报告质量复核待审批";
|
|
|
|
+ str = "报告号:"+projectReportData.getNumber()+"。项目【"+projectRecords.getProjectName()+"】报告质量复核待审批";
|
|
|
|
+ }
|
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
|
+ notify.setNotifyId(projectReportData.getId());
|
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
|
+ WorkProjectNotify workProjectNotify = UtilNotify
|
|
|
|
+ .saveNotify(projectReportData.getId(),
|
|
|
|
+ new User(),
|
|
|
|
+ projectReportData.getCompanyId(),
|
|
|
|
+ title,
|
|
|
|
+ str,
|
|
|
|
+ "105",
|
|
|
|
+ "0",
|
|
|
|
+ "待审批",
|
|
|
|
+ notifyRole);
|
|
|
|
+ users.addAll(auditUsers);
|
|
|
|
+ for (User user1 : users) {
|
|
|
|
+ workProjectNotify.setUser(user1);
|
|
|
|
+ workProjectNotify.setId("");
|
|
|
|
+ workProjectNotify.setIsNewRecord(false);
|
|
|
|
+ workProjectNotifyService
|
|
|
|
+ .save(workProjectNotify);
|
|
|
|
+ if (!"modifyApply".equals(taskDefKey)){
|
|
|
|
+ Map<String,Object> extras = new HashMap<>();
|
|
|
|
+ if ("glyda".equals(taskDefKey)){
|
|
|
|
+ extras.put("type","7003");
|
|
|
|
+ }else if("zlfgld".equals(taskDefKey) ){
|
|
|
|
+ extras.put("type","7002");
|
|
|
|
+ }else {
|
|
|
|
+ extras.put("type","7001");
|
|
|
|
+ }
|
|
|
|
+ extras.put("id",workProjectNotify.getId());
|
|
|
|
+ extras.put("procDefKey","105");
|
|
|
|
+ UserUtils.pushInfoToApp(title,str,extras,user1.getId());
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
|
+ notify.setNotifyId(projectReportData.getId());
|
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
|
+ users.add(projectReportData.getCreateBy());
|
|
|
|
+ workProjectNotifyService
|
|
|
|
+ .save(UtilNotify
|
|
|
|
+ .saveNotify(projectReportData.getId(),
|
|
|
|
+ projectReportData.getCreateBy(),
|
|
|
|
+ projectReportData.getCompanyId(),
|
|
|
|
+ title,
|
|
|
|
+ str,
|
|
|
|
+ "105",
|
|
|
|
+ "0",
|
|
|
|
+ "重新申请",
|
|
|
|
+ notifyRole));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (users!=null && users.size()!=0) {
|
|
|
|
+ for (User u : users) {
|
|
|
|
+ UserUtils.pushIm(u.getId(),title);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (users!=null && userList.size()!=0) {
|
|
|
|
+ for (User u : userList) {
|
|
|
|
+ UserUtils.pushMeIm(u.getId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!"yes".equals(flag)){
|
|
|
|
+ workReviewAuditDao.delReviewAudit(projectReportData.getId());
|
|
|
|
+ }
|
|
|
|
+ projectReportData.setTechnicist(reportData.getTechnicist());
|
|
|
|
+ projectReportData.setTechnicistRemarks(reportData.getTechnicistRemarks());
|
|
|
|
+ projectReportData.setConsultantRemarks(reportData.getConsultantRemarks());
|
|
|
|
+ projectReportData.setPrincipalRemarks(reportData.getPrincipalRemarks());
|
|
|
|
+ projectReportDataDao.update(projectReportData);
|
|
|
|
+
|
|
|
|
+ return "保存审核意见成功!";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|