|
@@ -340,7 +340,14 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
|
|
|
public String saveNotify(OaNotify oaNotify) {
|
|
|
oaNotify.setCloseStatus(0);
|
|
|
this.save(oaNotify);
|
|
|
- return this.startAudit(oaNotify,oaNotify.getProcessInstanceId());
|
|
|
+ //判断当前登陆人是否为办公室人员
|
|
|
+ if("ff48ec7fc3bc4b909d5eab2322bb53bf".equals(UserUtils.getUser().getOffice().getId())){
|
|
|
+ //办公室发起审批
|
|
|
+ return this.startAudit(oaNotify,oaNotify.getProcessInstanceId());
|
|
|
+ }else{
|
|
|
+ //普通部门发起审批
|
|
|
+ return this.startDepartmentAudit(oaNotify,oaNotify.getProcessInstanceId());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private String startAudit(OaNotify oaNotify, String processInstanceId) {
|
|
@@ -465,6 +472,138 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 普通部门流程
|
|
|
+ * @param oaNotify
|
|
|
+ * @param processInstanceId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private String startDepartmentAudit(OaNotify oaNotify, String processInstanceId) {
|
|
|
+ Map<String, Object> variables = new HashMap<String, Object>();
|
|
|
+ identityService.setAuthenticatedUserId(oaNotify.getCurrentUser().getId());
|
|
|
+ String contentStr = "公告编号:"+oaNotify.getNumber()+",公告类型:"+ DictUtils.getMainDictLabel(oaNotify.getType(),"oa_notify_type","")+",公告日期:"+ DateUtils.formatDate(oaNotify.getCreateDate());
|
|
|
+ String titleStr = "公告标题:"+ oaNotify.getTitle();
|
|
|
+
|
|
|
+ String businessKey = oaNotify.getId();
|
|
|
+ Office office = UserUtils.getSelectOffice();
|
|
|
+ WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("gg3125f1f194582bdda9abcew750904", office);
|
|
|
+ // 启动流程
|
|
|
+ String processType = workActivityMenu.getProcessType();
|
|
|
+ StringBuffer buffer = new StringBuffer();
|
|
|
+ Activity activity = new Activity();
|
|
|
+ WorkProjectNotify workProjectNotify = UtilNotify
|
|
|
+ .saveNotify(oaNotify.getId(),
|
|
|
+ null,
|
|
|
+ oaNotify.getCompany().getId(),
|
|
|
+ titleStr,
|
|
|
+ contentStr,
|
|
|
+ "89",
|
|
|
+ "0",
|
|
|
+ "待审批",
|
|
|
+ ""
|
|
|
+ );
|
|
|
+
|
|
|
+ List<User> users = new ArrayList<>();
|
|
|
+ //部门主任
|
|
|
+ List<User> bmzrs = UserUtils.getByRoleActivityEnname("bmzr",2,office.getId(),"4",oaNotify.getCreateBy());
|
|
|
+
|
|
|
+ List<User> zjlList = UserUtils.getByRoleActivityEnname("bgsquhe",3,oaNotify.getOffice().getId(),"11",oaNotify.getCreateBy());
|
|
|
+ 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(),"11",oaNotify.getCreateBy());
|
|
|
+ if (enusers.size()==0){
|
|
|
+ oaNotify.setStatus(String.valueOf(ProjectStatusEnum.TSTORE.getValue()));
|
|
|
+ dao.updateStatusById(oaNotify);
|
|
|
+ return "流程审批人不能为空,角色"+a.getRole().getName()+"下无用户,请联系管理员!";
|
|
|
+ }
|
|
|
+ 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(),"11",oaNotify.getCreateBy());
|
|
|
+ }
|
|
|
+ //人员审批
|
|
|
+ if (StringUtils.isNotBlank(activity.getUser().getId())) {
|
|
|
+ users.add(activity.getUser());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ workProjectNotify.setId("");
|
|
|
+ } else {
|
|
|
+ variables.put("bmzrs", bmzrs);
|
|
|
+ if (bmzrs.size()==0 ){
|
|
|
+ oaNotify.setStatus(String.valueOf(ProjectStatusEnum.TSTORE.getValue()));
|
|
|
+ dao.updateStatusById(oaNotify);
|
|
|
+ }
|
|
|
+ if (bmzrs.size()==0){
|
|
|
+ return "流程审批人不能为空,部门主任下无用户,请联系管理员!";
|
|
|
+ }
|
|
|
+
|
|
|
+ processType = "oaNotifyDepartment";
|
|
|
+ variables.put("applyUserId", oaNotify.getCreateBy().getId());
|
|
|
+ variables.put("bmzrCount",bmzrs.size());
|
|
|
+ variables.put("bmzrList",bmzrs);
|
|
|
+ users.addAll(bmzrs);
|
|
|
+ }
|
|
|
+ List<String> userIds = new ArrayList<>(users.size());
|
|
|
+ for (User u : users){
|
|
|
+ userIds.add(u.getId());
|
|
|
+ workProjectNotify.setUser(u);
|
|
|
+ workProjectNotify.setId("");
|
|
|
+ workProjectNotify.setNotifyRole("部门主任审批");
|
|
|
+ workProjectNotifyService.save(workProjectNotify);
|
|
|
+ Map<String,Object> extras = new HashMap<>();
|
|
|
+ extras.put("type","7002");
|
|
|
+ extras.put("procDefKey","89");
|
|
|
+ extras.put("id",workProjectNotify.getId());
|
|
|
+ UserUtils.pushInfoToApp(titleStr, contentStr,extras,u.getId());
|
|
|
+ }
|
|
|
+ UserUtils.pushIm(userIds,contentStr);
|
|
|
+
|
|
|
+ variables.put("busId", businessKey);
|
|
|
+ variables.put("type", processType);
|
|
|
+ variables.put("title", "审批单:" + oaNotify.getNumber());//设置标题;
|
|
|
+
|
|
|
+ ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
|
|
|
+ // workReceiptsSettle.setProcessInstance(processInstance);
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isNotBlank(processInstanceId)) {
|
|
|
+ workActivityProcessService.updateProcessInstanceId(processInstance.getId(),processInstanceId);
|
|
|
+ workActivityProcessService.deleteProcessInstanceId(processInstanceId);
|
|
|
+ workActivityProcessService.deleteProcessIdAuditUsers(processInstanceId);
|
|
|
+ }
|
|
|
+ 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.setIsApproval("0");
|
|
|
+ workActivityProcess.setProcessInstanceId(processInstance.getId());
|
|
|
+ workActivityProcessService.save(workActivityProcess);
|
|
|
+ workActivityProcessService.insertAuditsByType(bmzrs,processInstance.getId(),1,1);
|
|
|
+ }
|
|
|
+ oaNotify.setProcessInstanceId(processInstance.getId());
|
|
|
+ oaNotify.setStatus(String.valueOf(ProjectStatusEnum.IN_APRL.getValue()));
|
|
|
+ dao.updateProcessIdAndStatus(oaNotify);
|
|
|
+ //通知添加流程实例ID
|
|
|
+ workProjectNotify.setProcessInstanceId(processInstance.getId());
|
|
|
+ workProjectNotifyService.save(workProjectNotify);
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
*
|
|
|
* @param oaNotify
|
|
|
* @param isOffice 0:用户 1:部门
|
|
@@ -977,6 +1116,312 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 普通部门审批
|
|
|
+ * @param oaNotify
|
|
|
+ * @param auditUsers
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public String auditDepartmentSave(OaNotify oaNotify,List<User> auditUsers) {
|
|
|
+ try {
|
|
|
+ String str = "公告编号:"+oaNotify.getNumber()+",公告类型:"+ DictUtils.getMainDictLabel(oaNotify.getType(),"oa_notify_type","")+",公告日期:"+ DateUtils.formatDate(oaNotify.getCreateDate());
|
|
|
+ String title = "公告标题:"+ oaNotify.getTitle();
|
|
|
+ // 对不同环节的业务逻辑进行操作
|
|
|
+ String taskDefKey = oaNotify.getAct().getTaskDefKey();
|
|
|
+ if (!"modifyApply".equals(taskDefKey) && !taskDefKey.contains("audit")) {
|
|
|
+ actTaskService.claim(oaNotify.getAct().getTaskId(), UserUtils.getUser().getId());
|
|
|
+ }else {
|
|
|
+ oaNotify.getAct().setFlag("yes");
|
|
|
+ this.save(oaNotify);
|
|
|
+ }
|
|
|
+ String comment = "";
|
|
|
+ if (String.valueOf(ProjectStatusEnum.REJECTED.getValue()).equals(oaNotify.getStatus()) ){
|
|
|
+ comment = ("yes".equals(oaNotify.getAct().getFlag())?"[重新申请] ":"[已撤销] ");
|
|
|
+ }else {
|
|
|
+ comment = ("yes".equals(oaNotify.getAct().getFlag())?"[同意] ":"[驳回] ")+ oaNotify.getAct().getComment();
|
|
|
+ }
|
|
|
+ //yes 的时候状态为审核通过 否则为未通过
|
|
|
+ //1 审核中 2 未通过
|
|
|
+ oaNotify.setStatus(String.valueOf(("yes".equals(oaNotify.getAct().getFlag()) ? ProjectStatusEnum.IN_APRL.getValue() : ProjectStatusEnum.REJECTED.getValue())));
|
|
|
+ Map<String, Object> vars = Maps.newHashMap();
|
|
|
+ //业务逻辑对应的条件表达式
|
|
|
+ String exp = "";
|
|
|
+ String taskCount = "";
|
|
|
+ String notifyRole = "";
|
|
|
+ int key = 0;
|
|
|
+ String enname = "";
|
|
|
+ List<Activity> activitieList = activityService.getByProcessInstanceId(oaNotify.getProcessInstanceId());
|
|
|
+ WorkActivityMenu workActivityMenu = new WorkActivityMenu();
|
|
|
+ if (activitieList != null && activitieList.size() != 0) {
|
|
|
+ workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
|
|
|
+ workActivityMenu.setActivities(activitieList);
|
|
|
+ }
|
|
|
+
|
|
|
+ WorkActivityProcess workActivityProcess = new WorkActivityProcess();
|
|
|
+ WorkActivityProcess selectProcess = new WorkActivityProcess();
|
|
|
+ selectProcess.setProcessInstanceId(oaNotify.getProcessInstanceId());
|
|
|
+ List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
|
|
|
+ List<Activity> activities = workActivityMenu.getActivities();
|
|
|
+ if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("oaNotifyDepartment")) {
|
|
|
+ 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(oaNotify.getAct().getFlag())) {
|
|
|
+ notifyRole = "调整公告";
|
|
|
+ oaNotify.setStatus(String.valueOf(ProjectStatusEnum.REJECTED.getValue()));
|
|
|
+ workActivityProcess.setIsApproval("2");
|
|
|
+ String returnBack = "-1";
|
|
|
+ for (Activity activity : activities) {
|
|
|
+ if (activity.getCount() == activityProcess.getCount()) {
|
|
|
+ notifyRole = activity.getName();
|
|
|
+ returnBack = activity.getReturnBack();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (returnBack.equals("0")) {
|
|
|
+ workActivityProcess.setId("");
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ workActivityProcess.setIsApproval("1");
|
|
|
+ }
|
|
|
+ }else if(taskDefKey.equals("modifyApply")){
|
|
|
+ taskCount = "0";
|
|
|
+ exp = "pass";
|
|
|
+ workActivityProcess.setId("");
|
|
|
+ workActivityProcess.setCount(0);
|
|
|
+ if (!"yes".equals(oaNotify.getAct().getFlag())) {
|
|
|
+ oaNotify.setStatus(String.valueOf(ProjectStatusEnum.RECALL.getValue()));
|
|
|
+ workActivityProcess.setIsApproval("2");
|
|
|
+ } else {
|
|
|
+ workActivityProcess.setIsApproval("1");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ workActivityMenu.setProcessType("oaNotifyDepartment");
|
|
|
+ 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(oaNotify.getAct().getFlag())) {
|
|
|
+ notifyRole = "审批通过";
|
|
|
+ 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 = "bmzr";
|
|
|
+ if (!"yes".equals(oaNotify.getAct().getFlag())) {
|
|
|
+ oaNotify.setStatus(String.valueOf(ProjectStatusEnum.RECALL.getValue()));
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ } else if ("apply_end".equals(taskDefKey)) {
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 设置意见
|
|
|
+ oaNotify.getAct().setComment(("yes".equals(oaNotify.getAct().getFlag()) ? "[同意] " : "[驳回] ") + oaNotify.getAct().getComment());
|
|
|
+ oaNotify.preUpdate();
|
|
|
+ // 提交流程任务
|
|
|
+ vars.put(exp, "yes".equals(oaNotify.getAct().getFlag()) ? true : false);
|
|
|
+ vars.put("passs",true);
|
|
|
+ workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount, oaNotify.getProcessInstanceId(),taskDefKey,"modifyApply", oaNotify.getAct().getFlag(),comment, activities);
|
|
|
+ // 提交流程任务
|
|
|
+ actTaskService.complete(oaNotify.getAct().getTaskId(), oaNotify.getAct().getProcInsId(), oaNotify.getAct().getComment(), vars);
|
|
|
+ boolean state = actTaskService.isProcessEnd(oaNotify.getAct().getProcInsId());
|
|
|
+ List<User> users = new ArrayList<>();
|
|
|
+ List<User> userList = new ArrayList<>();
|
|
|
+ if (!state) {
|
|
|
+ users.add(oaNotify.getCreateBy());
|
|
|
+ if ("yes".equals(oaNotify.getAct().getFlag())) {
|
|
|
+ oaNotify.setStatus(String.valueOf(ProjectStatusEnum.SIGNED.getValue()));
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
+ notify.setNotifyId(oaNotify.getId());
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
+ workProjectNotifyService
|
|
|
+ .save(UtilNotify
|
|
|
+ .saveNotify(oaNotify.getId(),
|
|
|
+ oaNotify.getCreateBy(),
|
|
|
+ oaNotify.getCompany().getId(),
|
|
|
+ title,
|
|
|
+ str,
|
|
|
+ "89",
|
|
|
+ "0",
|
|
|
+ "待通知",
|
|
|
+ notifyRole));
|
|
|
+
|
|
|
+ } else {
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
+ notify.setNotifyId(oaNotify.getId());
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
+ if (!String.valueOf(ProjectStatusEnum.RECALL.getValue()).equals(oaNotify.getStatus())){
|
|
|
+ oaNotify.setStatus(String.valueOf(ProjectStatusEnum.REJECTED.getValue()));
|
|
|
+ workProjectNotifyService
|
|
|
+ .save(UtilNotify
|
|
|
+ .saveNotify(oaNotify.getId(),
|
|
|
+ oaNotify.getCreateBy(),
|
|
|
+ oaNotify.getCompany().getId(),
|
|
|
+ title,
|
|
|
+ str,
|
|
|
+ "89",
|
|
|
+ "0",
|
|
|
+ "待通知",
|
|
|
+ notifyRole));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ workActivityProcessService.deleteProcessIdAuditUsers(oaNotify.getProcessInstanceId());
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("oaNotifyDepartment")) {
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
+ notify.setNotifyId(oaNotify.getId());
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
+ //users.addAll(userList);
|
|
|
+ WorkProjectNotify workProjectNotify = UtilNotify
|
|
|
+ .saveNotify(oaNotify.getId(),
|
|
|
+ new User(),
|
|
|
+ oaNotify.getCompany().getId(),
|
|
|
+ title,
|
|
|
+ str,
|
|
|
+ "89",
|
|
|
+ "0",
|
|
|
+ "待审批",
|
|
|
+ notifyRole);
|
|
|
+ List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
|
|
|
+ activities,
|
|
|
+ workProjectNotify,
|
|
|
+ taskDefKey,
|
|
|
+ oaNotify.getAct().getFlag(),
|
|
|
+ taskCount,
|
|
|
+ oaNotify.getCreateBy(),
|
|
|
+ oaNotify.getOffice().getId(),
|
|
|
+ "89");
|
|
|
+ for (WorkProjectNotify workProjectNotify1:workProjectNotifys){
|
|
|
+ users.add(workProjectNotify1.getUser());
|
|
|
+ workProjectNotify1.setId("");
|
|
|
+ workProjectNotify1.setIsNewRecord(false);
|
|
|
+ workProjectNotifyService
|
|
|
+ .save(workProjectNotify1);
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ if (!"yes".equals(oaNotify.getAct().getFlag())) {
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
+ notify.setNotifyId(oaNotify.getId());
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
+ //users.addAll(userList);
|
|
|
+ workProjectNotifyService
|
|
|
+ .save(UtilNotify
|
|
|
+ .saveNotify(oaNotify.getId(),
|
|
|
+ oaNotify.getCreateBy(),
|
|
|
+ oaNotify.getCompany().getId(),
|
|
|
+ title,
|
|
|
+ str,
|
|
|
+ "89",
|
|
|
+ "0",
|
|
|
+ "重新申请",
|
|
|
+ notifyRole));
|
|
|
+ users.add( oaNotify.getCreateBy());
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(enname)) {
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
+ notify.setNotifyId(oaNotify.getId());
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
+ //users.addAll(userList1);
|
|
|
+ WorkProjectNotify workProjectNotify = UtilNotify
|
|
|
+ .saveNotify(oaNotify.getId(),
|
|
|
+ new User(),
|
|
|
+ oaNotify.getCompany().getId(),
|
|
|
+ title,
|
|
|
+ str,
|
|
|
+ "89",
|
|
|
+ "0",
|
|
|
+ "待审批",
|
|
|
+ notifyRole);
|
|
|
+ users.addAll(auditUsers);
|
|
|
+ for (User user1:auditUsers){
|
|
|
+ workProjectNotify.setUser(user1);
|
|
|
+ workProjectNotify.setId("");
|
|
|
+ workProjectNotify.setIsNewRecord(false);
|
|
|
+ workProjectNotifyService.save(workProjectNotify);
|
|
|
+ Map<String,Object> extras = new HashMap<>();
|
|
|
+ extras.put("type","7002");
|
|
|
+ extras.put("procDefKey","89");
|
|
|
+ extras.put("id",workProjectNotify.getId());
|
|
|
+ UserUtils.pushInfoToApp(title, str,extras,user1.getId());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
+ notify.setNotifyId(oaNotify.getId());
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
+ users.add(oaNotify.getCreateBy());
|
|
|
+ workProjectNotifyService
|
|
|
+ .save(UtilNotify
|
|
|
+ .saveNotify(oaNotify.getId(),
|
|
|
+ oaNotify.getCreateBy(),
|
|
|
+ oaNotify.getCompany().getId(),
|
|
|
+ title,
|
|
|
+ str,
|
|
|
+ "89",
|
|
|
+ "0",
|
|
|
+ "重新申请",
|
|
|
+ notifyRole));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(title) && users!=null && users.size()!=0) {
|
|
|
+ for (User u : users) {
|
|
|
+ UserUtils.pushIm(u.getId(),title);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(title) && userList!=null && userList.size()!=0) {
|
|
|
+ for (User u : userList) {
|
|
|
+ UserUtils.pushMeIm(u.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dao.update(oaNotify);
|
|
|
+ if(String.valueOf(ProjectStatusEnum.SIGNED.getValue()).equals(oaNotify.getStatus())){
|
|
|
+ if (oaNotify!=null && oaNotify.getContents()!=null){
|
|
|
+ oaNotify.setContents(StringEscapeUtils.unescapeHtml4(oaNotify.getContents()));
|
|
|
+ this.pushNotify(oaNotify,"1");
|
|
|
+ }else {
|
|
|
+ this.pushNotify(oaNotify,"2");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "保存审核意见成功!";
|
|
|
+ }catch (ActivitiObjectNotFoundException e){
|
|
|
+ logger.error("ActivitiObjectNotFoundException e:",e);
|
|
|
+ return "流程已审批,不能重新审批!";
|
|
|
+ }catch (Exception e){
|
|
|
+ logger.error("Exception e:",e);
|
|
|
+ return "保存审核意见失败!!";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public void queryDetails(OaNotify oaNotify) {
|
|
|
if(oaNotify==null)return;
|
|
|
oaNotify.setOfficeList(this.queryOfficeList(oaNotify));
|