|
@@ -0,0 +1,849 @@
|
|
|
+package com.jeeplus.modules.signatureManagement.businessSignature.service;
|
|
|
+
|
|
|
+import com.google.common.collect.Lists;
|
|
|
+import com.google.common.collect.Maps;
|
|
|
+import com.jeeplus.common.persistence.Page;
|
|
|
+import com.jeeplus.common.service.CrudService;
|
|
|
+import com.jeeplus.common.utils.IdGen;
|
|
|
+import com.jeeplus.common.utils.MenuStatusEnum;
|
|
|
+import com.jeeplus.modules.act.service.ActTaskService;
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
|
|
|
+import com.jeeplus.modules.serialnum.service.SerialNumTplService;
|
|
|
+import com.jeeplus.modules.signatureManagement.businessSignature.dao.BusinessSignatureDao;
|
|
|
+import com.jeeplus.modules.signatureManagement.businessSignature.entity.BusinessSignatureInfo;
|
|
|
+import com.jeeplus.modules.sys.entity.Office;
|
|
|
+import com.jeeplus.modules.sys.entity.User;
|
|
|
+import com.jeeplus.modules.sys.service.OfficeService;
|
|
|
+import com.jeeplus.modules.sys.service.WorkattachmentService;
|
|
|
+import com.jeeplus.modules.sys.utils.DictUtils;
|
|
|
+import com.jeeplus.modules.sys.utils.UserUtils;
|
|
|
+import com.jeeplus.modules.workactivity.dao.WorkActivityProcessDao;
|
|
|
+import com.jeeplus.modules.workactivity.entity.Activity;
|
|
|
+import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
|
|
|
+import com.jeeplus.modules.workactivity.service.ActivityService;
|
|
|
+import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
|
|
|
+import com.jeeplus.modules.workactivitymenu.entity.WorkActivityMenu;
|
|
|
+import com.jeeplus.modules.workactivitymenu.service.WorkActivityMenuService;
|
|
|
+import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
|
|
|
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
|
|
|
+import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
|
|
|
+import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
|
|
|
+import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
|
|
|
+import org.activiti.engine.ActivitiObjectNotFoundException;
|
|
|
+import org.activiti.engine.IdentityService;
|
|
|
+import org.activiti.engine.RuntimeService;
|
|
|
+import org.activiti.engine.runtime.ProcessInstance;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author: 徐滕
|
|
|
+ * @version: 2024-05-30 16:41
|
|
|
+ */
|
|
|
+@Service
|
|
|
+@Transactional(readOnly = true)
|
|
|
+public class BusinessSignatureService extends CrudService<BusinessSignatureDao, BusinessSignatureInfo> {
|
|
|
+
|
|
|
+ private static final byte[] SYN_BYTE = new byte[0];
|
|
|
+ @Autowired
|
|
|
+ private OfficeService officeService;
|
|
|
+ @Autowired
|
|
|
+ private SerialNumTplService serialNumTplService;
|
|
|
+ @Autowired
|
|
|
+ private WorkClientAttachmentDao workClientAttachmentDao;
|
|
|
+ @Autowired
|
|
|
+ private WorkActivityMenuService workActivityMenuService;
|
|
|
+ @Autowired
|
|
|
+ private RuntimeService runtimeService;
|
|
|
+ @Autowired
|
|
|
+ private WorkActivityProcessService workActivityProcessService;
|
|
|
+ @Autowired
|
|
|
+ private WorkProjectNotifyService workProjectNotifyService;
|
|
|
+ @Autowired
|
|
|
+ private IdentityService identityService;
|
|
|
+ @Autowired
|
|
|
+ private WorkattachmentService workattachmentService;
|
|
|
+ @Autowired
|
|
|
+ private WorkActivityProcessDao workActivityProcessDao;
|
|
|
+ @Autowired
|
|
|
+ private ActTaskService actTaskService;
|
|
|
+ @Autowired
|
|
|
+ private ActivityService activityService;
|
|
|
+
|
|
|
+
|
|
|
+ public BusinessSignatureInfo get(String id) {
|
|
|
+ if(StringUtils.isBlank(id)){
|
|
|
+ return new BusinessSignatureInfo();
|
|
|
+ }
|
|
|
+ BusinessSignatureInfo dailyOfficeWork = super.get(id);
|
|
|
+ if(dailyOfficeWork != null){
|
|
|
+ //获取附件信息
|
|
|
+ WorkClientAttachment workClientAttachment = new WorkClientAttachment();
|
|
|
+ workClientAttachment.setAttachmentId(id);
|
|
|
+ workClientAttachment.setAttachmentFlag("193");
|
|
|
+ dailyOfficeWork.setWorkAttachments(workattachmentService.getAttachmentList(workClientAttachment));
|
|
|
+
|
|
|
+ //添加当前文件服务器类型
|
|
|
+ dailyOfficeWork.setUploadMode(uploadMode);
|
|
|
+ //数据处理(如果为阿里云文件服务器,则对查看的路径进行处理)
|
|
|
+ WorkattachmentService.clientAttachmentManageOnUrl(dailyOfficeWork.getWorkAttachments());
|
|
|
+ }
|
|
|
+ return dailyOfficeWork;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public Page<BusinessSignatureInfo> findPage(Page<BusinessSignatureInfo> page, BusinessSignatureInfo businessSignatureInfo) {
|
|
|
+ //设置数据权限
|
|
|
+ if(!UserUtils.getUser().isAdmin()) {
|
|
|
+ String dataScopeSql = null;
|
|
|
+ dataScopeSql = dataScopeFilter(businessSignatureInfo.getCurrentUser(), "o", "u", "s", MenuStatusEnum.EBUSINESS_SIGNATURE.getValue());
|
|
|
+ businessSignatureInfo.getSqlMap().put("dsf", dataScopeSql);
|
|
|
+ businessSignatureInfo.getSqlMap().put("delFlag", "AND a.del_flag = 0");
|
|
|
+ }
|
|
|
+ if(null!= businessSignatureInfo.getOffice() && StringUtils.isNotBlank(businessSignatureInfo.getOffice().getId())){
|
|
|
+ //查询该选择节点下所有的部门Id
|
|
|
+ List<String> officeIdList = officeService.getChildrenOffice(businessSignatureInfo.getOffice().getId());
|
|
|
+ officeIdList.add(businessSignatureInfo.getOffice().getId());
|
|
|
+ businessSignatureInfo.setOfficeIdList(officeIdList);
|
|
|
+ }
|
|
|
+ int count = dao.queryCount(businessSignatureInfo);
|
|
|
+ page.setCount(count);
|
|
|
+ page.setCountFlag(false);
|
|
|
+ businessSignatureInfo.setPage(page);
|
|
|
+ List<BusinessSignatureInfo> recordsList = findList(businessSignatureInfo);
|
|
|
+ page.setList(recordsList);
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增方法
|
|
|
+ * @param businessSignatureInfo
|
|
|
+ */
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void saveInfo(BusinessSignatureInfo businessSignatureInfo) {
|
|
|
+
|
|
|
+ businessSignatureInfo.setStatus(1);
|
|
|
+ User createBy = businessSignatureInfo.getCreateBy();
|
|
|
+ if(createBy != null){
|
|
|
+ createBy = UserUtils.get(createBy.getId());
|
|
|
+ }else {
|
|
|
+ createBy = UserUtils.getUser();
|
|
|
+ }
|
|
|
+
|
|
|
+ //添加申请编号
|
|
|
+ /*synchronized (SYN_BYTE) {
|
|
|
+ if (StringUtils.isBlank(businessSignatureInfo.getNumber())) {
|
|
|
+ //工程造价鉴定 需要纸质归档
|
|
|
+ assert createBy != null;
|
|
|
+ businessSignatureInfo.setNumber(serialNumTplService.genSerialNum(createBy.getCompany(), DailyOfficeWork.DAILY_OFFICE_WORK_KEY));
|
|
|
+
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ if(StringUtils.isBlank(businessSignatureInfo.getId())){
|
|
|
+ businessSignatureInfo.setCompany(UserUtils.getUser().getCompany());
|
|
|
+ businessSignatureInfo.setOffice(UserUtils.getUser().getOffice());
|
|
|
+ businessSignatureInfo.preInsert();
|
|
|
+ dao.insert(businessSignatureInfo);
|
|
|
+ }else {
|
|
|
+ businessSignatureInfo.preUpdate();
|
|
|
+ dao.update(businessSignatureInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ //保存签章附件信息
|
|
|
+ this.saveAttachments(businessSignatureInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void save(BusinessSignatureInfo businessSignatureInfo, ProjectStatusEnum status) throws Exception {
|
|
|
+ businessSignatureInfo.setCompany(UserUtils.getUser().getCompany());
|
|
|
+ businessSignatureInfo.setOffice(UserUtils.getUser().getOffice());
|
|
|
+
|
|
|
+ businessSignatureInfo.setStatus(status.getValue());
|
|
|
+ User createBy = businessSignatureInfo.getCreateBy();
|
|
|
+ if(createBy != null){
|
|
|
+ createBy = UserUtils.get(createBy.getId());
|
|
|
+ }else {
|
|
|
+ createBy = UserUtils.getUser();
|
|
|
+ }
|
|
|
+
|
|
|
+ //添加申请编号
|
|
|
+ /*synchronized (SYN_BYTE) {
|
|
|
+ if (StringUtils.isBlank(businessSignatureInfo.getNumber())) {
|
|
|
+ //工程造价鉴定 需要纸质归档
|
|
|
+ assert createBy != null;
|
|
|
+ businessSignatureInfo.setNumber(serialNumTplService.genSerialNum(createBy.getCompany(), DailyOfficeWork.DAILY_OFFICE_WORK_KEY));
|
|
|
+
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+ if(businessSignatureInfo.getStatus()== ProjectStatusEnum.INVALID.getValue()){
|
|
|
+ businessSignatureInfo.setId(IdGen.uuid());
|
|
|
+ dao.insert(businessSignatureInfo);
|
|
|
+ }else {
|
|
|
+ super.save(businessSignatureInfo);
|
|
|
+ }
|
|
|
+ //保存签章附件信息
|
|
|
+ this.saveAttachments(businessSignatureInfo);
|
|
|
+ //启动审批流程
|
|
|
+ this.startAudit(businessSignatureInfo,businessSignatureInfo.getProcessInstanceId());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存附件
|
|
|
+ * @param businessSignatureInfo
|
|
|
+ */
|
|
|
+ private void saveAttachments(BusinessSignatureInfo businessSignatureInfo) {
|
|
|
+ if (businessSignatureInfo.getWorkAttachments()!=null && !businessSignatureInfo.getWorkAttachments().isEmpty()) {
|
|
|
+ //保存附件信息
|
|
|
+ for (WorkClientAttachment workClientAttachment : businessSignatureInfo.getWorkAttachments()) {
|
|
|
+ if (StringUtils.isBlank(workClientAttachment.getId())&&StringUtils.isNotBlank(workClientAttachment.getAttachmentId())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(workClientAttachment.getId())&&StringUtils.isBlank(workClientAttachment.getUrl())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (WorkClientAttachment.DEL_FLAG_NORMAL.equals(workClientAttachment.getDelFlag())) {
|
|
|
+ workClientAttachment.setAttachmentId(businessSignatureInfo.getId());
|
|
|
+ workClientAttachment.setAttachmentFlag("193");
|
|
|
+ workClientAttachment.setAttachmentUser(UserUtils.getUser().getId());
|
|
|
+ if (StringUtils.isBlank(workClientAttachment.getId()) || "null".equals(workClientAttachment.getId())) {
|
|
|
+ workClientAttachment.preInsert();
|
|
|
+ workClientAttachmentDao.insert(workClientAttachment);
|
|
|
+ } else {
|
|
|
+ workClientAttachment.preUpdate();
|
|
|
+ workClientAttachmentDao.update(workClientAttachment);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ workClientAttachmentDao.delete(workClientAttachment);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 启动审批流程
|
|
|
+ *
|
|
|
+ * @param businessSignatureInfo
|
|
|
+ */
|
|
|
+ private void startAudit(BusinessSignatureInfo businessSignatureInfo, String processInstanceId) throws Exception {
|
|
|
+ try{
|
|
|
+ Map<String, Object> variables = new HashMap<String, Object>();
|
|
|
+ identityService.setAuthenticatedUserId(businessSignatureInfo.getCurrentUser().getId());
|
|
|
+ Office office = businessSignatureInfo.getOffice();
|
|
|
+ office = officeService.get(office.getId());
|
|
|
+ businessSignatureInfo.setOffice(office);
|
|
|
+ String useTypeStr = DictUtils.getMainDictLabel(businessSignatureInfo.getUseType(), "businessSignature", "");
|
|
|
+ String contentStr = "业务用章申请描述:"+ businessSignatureInfo.getName()+"。待审批,申请使用场景:"+useTypeStr;
|
|
|
+ String titleStr = "业务用章申请描述:"+ businessSignatureInfo.getName()+"。待审批,申请使用场景:"+useTypeStr;
|
|
|
+
|
|
|
+ String businessKey = businessSignatureInfo.getId();
|
|
|
+
|
|
|
+ WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("7854872f45b84acd893010e66a3db2c8", office);
|
|
|
+ // 启动流程
|
|
|
+ String processType = workActivityMenu.getProcessType();
|
|
|
+ StringBuffer buffer = new StringBuffer();
|
|
|
+ Activity activity = new Activity();
|
|
|
+ WorkProjectNotify workProjectNotify = UtilNotify
|
|
|
+ .saveNotify(businessSignatureInfo.getId(),
|
|
|
+ null,
|
|
|
+ businessSignatureInfo.getCompany().getId(),
|
|
|
+ titleStr,
|
|
|
+ contentStr,
|
|
|
+ "193",
|
|
|
+ "0",
|
|
|
+ "待审批",
|
|
|
+ ""
|
|
|
+ );
|
|
|
+
|
|
|
+ List<User> users = new ArrayList<>();
|
|
|
+
|
|
|
+ List<User> bmzrs = Lists.newArrayList();
|
|
|
+
|
|
|
+ String officeName = "";
|
|
|
+
|
|
|
+ Office loginUserOffice = UserUtils.getUser().getOffice();
|
|
|
+ if(StringUtils.isNotBlank(loginUserOffice.getParentIds())){
|
|
|
+ // 使用 split 方法将字符串分割成数组
|
|
|
+ String[] parentIdArray = loginUserOffice.getParentIds().split(",");
|
|
|
+ // 将数组转换为 List
|
|
|
+ List<String> parentIdList = new ArrayList<>(Arrays.asList(parentIdArray));
|
|
|
+ parentIdList.add(loginUserOffice.getId());
|
|
|
+ List<Office> parentOffice = officeService.getByIdList(parentIdList);
|
|
|
+ List<String> officeNameList = Lists.newArrayList();
|
|
|
+ for (Office loginParentOffice : parentOffice) {
|
|
|
+ officeNameList.add(loginParentOffice.getName());
|
|
|
+ }
|
|
|
+ officeName = String.join(", ", officeNameList);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotBlank(officeName)) {
|
|
|
+ if(officeName.contains("工程五部") ||
|
|
|
+ officeName.contains("盐城分公司") ||
|
|
|
+ officeName.contains("河北团队") ||
|
|
|
+ officeName.contains("河北团队2") ||
|
|
|
+ officeName.contains("四川团队") ||
|
|
|
+ officeName.contains("苏州分公司")){
|
|
|
+ //查找办公室审批人员
|
|
|
+ bmzrs = UserUtils.getByRoleActivityEnname("bgsquhe",3,office.getId(),"11",businessSignatureInfo.getCreateBy());
|
|
|
+ } else {
|
|
|
+ //查找部门主任审批人员
|
|
|
+ bmzrs = UserUtils.getByRoleActivityEnname("bmzr",2,office.getId(),"6",businessSignatureInfo.getCreateBy());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<User> gsyzshyList = UserUtils.getByRoleActivityEnname("gsyzshy",3,office.getId(),"11",businessSignatureInfo.getCreateBy());
|
|
|
+
|
|
|
+ //查找办公室审批人员
|
|
|
+ List<User> bgsList = UserUtils.getByRoleActivityEnname("bgsquhe",3,office.getId(),"11",businessSignatureInfo.getCreateBy());
|
|
|
+
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(workActivityMenu.getId())) {
|
|
|
+ processType = workActivityMenu.getProcessType();
|
|
|
+ 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(),"8",businessSignatureInfo.getCreateBy());
|
|
|
+ if (enusers.size()==0){
|
|
|
+ throw new Exception("流程审批人不能为空,角色"+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 (StringUtils.isNotBlank(activity.getId())) {
|
|
|
+ //角色审批
|
|
|
+ if (StringUtils.isNotBlank(activity.getRole().getEnname())) {
|
|
|
+ users = UserUtils.getByRoleActivityEnnames(activity.getRole().getEnname(),office.getId(),"11",businessSignatureInfo.getCreateBy());
|
|
|
+ }
|
|
|
+ //人员审批
|
|
|
+ if (StringUtils.isNotBlank(activity.getUser().getId())) {
|
|
|
+ users.add(activity.getUser());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ workProjectNotify.setId("");
|
|
|
+ } else {
|
|
|
+ if (bmzrs.size() == 0){
|
|
|
+ throw new Exception("流程审批人不能为空,角色部门负责人下无用户,请联系管理员!");
|
|
|
+ }
|
|
|
+ processType = "businessSignature";
|
|
|
+ variables.put("applyUserId", businessSignatureInfo.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","7003");
|
|
|
+ extras.put("procDefKey","193");
|
|
|
+ extras.put("id",workProjectNotify.getId());
|
|
|
+ UserUtils.pushInfoToApp(titleStr,contentStr,extras,u.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ long t1 = System.currentTimeMillis();
|
|
|
+ UserUtils.pushIm(userIds,contentStr);
|
|
|
+ logger.info("推送消息耗时:{}ms",System.currentTimeMillis()-t1);
|
|
|
+ variables.put("busId", businessKey);
|
|
|
+ variables.put("type", processType);
|
|
|
+ variables.put("title", "业务用章申请描述:" + businessSignatureInfo.getName());//设置标题;
|
|
|
+
|
|
|
+ ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
|
|
|
+ if (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.setProcessInstanceId(processInstance.getId());
|
|
|
+ workActivityProcess.setIsApproval("0");
|
|
|
+ workActivityProcessService.save(workActivityProcess);
|
|
|
+ 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(gsyzshyList,processInstance.getId(),2,0);
|
|
|
+ workActivityProcessService.insertAuditsByType(bgsList,processInstance.getId(),3,0);
|
|
|
+ }
|
|
|
+ businessSignatureInfo.setProcessInstanceId(processInstance.getId());
|
|
|
+ businessSignatureInfo.setStatus(ProjectStatusEnum.IN_APRL.getValue());
|
|
|
+ dao.updateProcessIdAndStatus(businessSignatureInfo);
|
|
|
+ //通知添加流程实例ID
|
|
|
+ workProjectNotify.setProcessInstanceId(processInstance.getId());
|
|
|
+ workProjectNotifyService.save(workProjectNotify);
|
|
|
+ }catch (Exception e){
|
|
|
+ logger.error("启动审批流程异常:",e);
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 报告:强制撤销
|
|
|
+ * @param businessSignatureInfo
|
|
|
+ */
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void cancelInvalidate(BusinessSignatureInfo businessSignatureInfo) {
|
|
|
+ try {
|
|
|
+ String invalidateProcessInstanceId = businessSignatureInfo.getProcessInstanceId();
|
|
|
+ //将流程图中尚未走到的task的流程追踪信息逻辑删除,添加一条"撤销"流程追踪信息
|
|
|
+ WorkActivityProcess process = new WorkActivityProcess();
|
|
|
+ process.setProcessInstanceId(businessSignatureInfo.getProcessInstanceId());
|
|
|
+ process.setIsApproval("0");
|
|
|
+ WorkActivityProcess workActivityProcess = new WorkActivityProcess();
|
|
|
+ workActivityProcess.setProcessInstanceId(businessSignatureInfo.getProcessInstanceId());
|
|
|
+ List<WorkActivityProcess> processList = workActivityProcessService.findList(workActivityProcess);
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
+ notify.setNotifyId(businessSignatureInfo.getId());
|
|
|
+ List<User> userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
+ if (userList!=null && userList.size()!=0) {
|
|
|
+ for (User u : userList) {
|
|
|
+ User user = UserUtils.get(u.getId());
|
|
|
+ UserUtils.pushMeIm(user.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(processList!=null && processList.size()>0){
|
|
|
+ for (int i =0;i<processList.size();i++) {
|
|
|
+ WorkActivityProcess p = processList.get(i);
|
|
|
+ if(com.jeeplus.common.utils.StringUtils.isNotBlank(p.getIsApproval()) && "0".equals(p.getIsApproval())){
|
|
|
+ p.setDelFlag("1");
|
|
|
+ p.setIsApproval("-1");
|
|
|
+ workActivityProcessDao.updateDelFlagAndIsApproval(p);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ WorkActivityProcess pro = new WorkActivityProcess();
|
|
|
+ pro.setId("");
|
|
|
+ pro.preInsert();
|
|
|
+ pro.setDelFlag("0");
|
|
|
+ pro.setRemarks("[强制撤销]");
|
|
|
+ pro.setProcessKey(processList.get(0).getProcessKey());
|
|
|
+ pro.setIsApproval("1");
|
|
|
+ pro.setProcessInstanceId(processList.get(0).getProcessInstanceId());
|
|
|
+ pro.setCount(0);
|
|
|
+ workActivityProcessDao.insert(pro);
|
|
|
+ }
|
|
|
+
|
|
|
+ //结束该流程,设为"撤销"状态
|
|
|
+ actTaskService.endProcessInstance(invalidateProcessInstanceId,"业务用章申请-强制撤销");
|
|
|
+ businessSignatureInfo.setStatus(3);
|
|
|
+ businessSignatureInfo.preUpdate();
|
|
|
+ dao.update(businessSignatureInfo);
|
|
|
+
|
|
|
+ }catch (ActivitiObjectNotFoundException e){
|
|
|
+ System.err.println("业务用章申请撤销异常,因为这个流程已不存在!");
|
|
|
+ e.printStackTrace();
|
|
|
+ logger.error("Exception e:"+e);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ logger.error("Exception e:"+e);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 签章流程审核方法
|
|
|
+ * @param businessSignatureInfo
|
|
|
+ * @param auditUsers
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public String signatuereSaveAudit(BusinessSignatureInfo businessSignatureInfo, List<User> auditUsers) {
|
|
|
+ int status = businessSignatureInfo.getStatus();
|
|
|
+ String taskDefKey = businessSignatureInfo.getAct().getTaskDefKey();
|
|
|
+ if (!"modifyApply".equals(taskDefKey) && !taskDefKey.contains("audit") ) {
|
|
|
+ actTaskService.claim(businessSignatureInfo.getAct().getTaskId(), UserUtils.getUser().getId());
|
|
|
+ }else {
|
|
|
+ //驳回修改进入该方法
|
|
|
+ businessSignatureInfo.getAct().setFlag("yes");
|
|
|
+ saveInfo(businessSignatureInfo);
|
|
|
+ businessSignatureInfo.setStatus(ProjectStatusEnum.IN_APRL.getValue());
|
|
|
+ }
|
|
|
+
|
|
|
+ String comment = "";
|
|
|
+ if ( status == ProjectStatusEnum.REJECTED.getValue()) {
|
|
|
+ comment = ("yes".equals(businessSignatureInfo.getAct().getFlag())?"[重新申请] ":"[已撤销] ");
|
|
|
+ }else {
|
|
|
+ comment = ("yes".equals(businessSignatureInfo.getAct().getFlag())?"[同意] ":"[驳回] ")+businessSignatureInfo.getAct().getComment();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!"yes".equals(businessSignatureInfo.getAct().getFlag())) {
|
|
|
+ businessSignatureInfo.setStatus(ProjectStatusEnum.REJECTED.getValue());
|
|
|
+ }
|
|
|
+
|
|
|
+ User createUser = UserUtils.get(businessSignatureInfo.getCreateBy().getId());
|
|
|
+
|
|
|
+ Map<String, Object> vars = Maps.newHashMap();
|
|
|
+ String notifyRole = "";
|
|
|
+ //业务逻辑对应的条件表达式
|
|
|
+ User user = null;
|
|
|
+ List<Activity> activitieList = activityService.getByProcessInstanceId(businessSignatureInfo.getProcessInstanceId());
|
|
|
+ WorkActivityMenu workActivityMenu = new WorkActivityMenu();
|
|
|
+ if (activitieList != null && activitieList.size() != 0) {
|
|
|
+ Iterator<Activity> iterator = activitieList.iterator();
|
|
|
+ while (iterator.hasNext()){
|
|
|
+ Activity activityInfo = iterator.next();
|
|
|
+ if (!"businessSignature".equals(activityInfo.getProcessKey())){
|
|
|
+ iterator.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
|
|
|
+ workActivityMenu.setActivities(activitieList);
|
|
|
+ }
|
|
|
+
|
|
|
+ WorkActivityProcess workActivityProcess = new WorkActivityProcess();
|
|
|
+ WorkActivityProcess selectProcess = new WorkActivityProcess();
|
|
|
+ selectProcess.setProcessInstanceId(businessSignatureInfo.getProcessInstanceId());
|
|
|
+ List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
|
|
|
+ List<Activity> activities = workActivityMenu.getActivities();
|
|
|
+ String taskCount = "1";
|
|
|
+ String enname = "";
|
|
|
+ Office office = businessSignatureInfo.getOffice();
|
|
|
+ office = officeService.get(office.getId());
|
|
|
+ businessSignatureInfo.setOffice(office);
|
|
|
+ String useTypeStr = DictUtils.getMainDictLabel(businessSignatureInfo.getUseType(), "businessSignature", "");
|
|
|
+ String notifyStr = "业务用章申请描述:"+ businessSignatureInfo.getName()+"。待审批,申请使用场景:"+useTypeStr;
|
|
|
+ String str = notifyStr+",创建人:"+businessSignatureInfo.getCreateBy().getName()+",所属部门:"+businessSignatureInfo.getOffice().getName();
|
|
|
+ String titleStr = "业务用章申请描述:"+ businessSignatureInfo.getName()+"。待审批";
|
|
|
+ int key = 0;
|
|
|
+ //业务逻辑对应的条件表达式
|
|
|
+ String exp = "";
|
|
|
+ if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("businessSignature")) {
|
|
|
+ key = 1;
|
|
|
+ for (int i = 0; i < workActivityProcesses.size(); i++) {
|
|
|
+ WorkActivityProcess activityProcess = workActivityProcesses.get(i);
|
|
|
+ if (taskDefKey.equals("modifyApply")) {
|
|
|
+ taskCount = "0";
|
|
|
+ workActivityProcess.setId("");
|
|
|
+ workActivityProcess.setCount(0);
|
|
|
+ if (!"yes".equals(businessSignatureInfo.getAct().getFlag())) {
|
|
|
+ businessSignatureInfo.setStatus(ProjectStatusEnum.RECALL.getValue());
|
|
|
+ workActivityProcess.setIsApproval("2");
|
|
|
+ vars.put("pass", false);
|
|
|
+ } else {
|
|
|
+ vars.put("pass", true);
|
|
|
+ workActivityProcess.setIsApproval("1");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ taskCount = activityProcess.getCount()+"";
|
|
|
+ workActivityProcess = activityProcess;
|
|
|
+ if (!workActivityProcess.getIsApproval().equals("0")) {
|
|
|
+ workActivityProcess.setId("");
|
|
|
+ }
|
|
|
+ for (Activity activity : activities) {
|
|
|
+ if (activity.getCount() == activityProcess.getCount()) {
|
|
|
+ notifyRole = activity.getName();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!"yes".equals(businessSignatureInfo.getAct().getFlag())) {
|
|
|
+ notifyRole = "调整签章申请";
|
|
|
+ businessSignatureInfo.setStatus(ProjectStatusEnum.REJECTED.getValue());
|
|
|
+ workActivityProcess.setIsApproval("2");
|
|
|
+ String returnBack = "-1";
|
|
|
+ for (Activity activity : activities) {
|
|
|
+ if (activity.getCount() == activityProcess.getCount()) {
|
|
|
+ returnBack = activity.getReturnBack();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (returnBack.equals("0")) {
|
|
|
+ workActivityProcess.setId("");
|
|
|
+ }
|
|
|
+ vars.put("pass", false);
|
|
|
+ } else {
|
|
|
+ workActivityProcess.setIsApproval("1");
|
|
|
+ vars.put("pass", true);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ workActivityMenu.setProcessType("businessSignature");
|
|
|
+ for (int i = 0; i < workActivityProcesses.size(); i++) {
|
|
|
+ WorkActivityProcess activityProcess = workActivityProcesses.get(i);
|
|
|
+ String count = String.valueOf(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(businessSignatureInfo.getAct().getFlag())) {
|
|
|
+ workActivityProcessService.insertAuditsByType(auditUsers,businessSignatureInfo.getProcessInstanceId(),2,1);
|
|
|
+ notifyRole = "公司领导审核";
|
|
|
+ workActivityProcess.setIsApproval("1");
|
|
|
+ enname = "gsyzshy";
|
|
|
+ vars.put("gsyzshyList", auditUsers);
|
|
|
+ vars.put("gsyzshyCount",auditUsers.size());
|
|
|
+ } else {
|
|
|
+ notifyRole = "调整业务用章申请";
|
|
|
+ workActivityProcess.setIsApproval("2");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }else if ("gsyzshy".equals(taskDefKey) && count.contains("2")) {
|
|
|
+ taskCount = "2";
|
|
|
+ exp = "pass";
|
|
|
+ if ("yes".equals(businessSignatureInfo.getAct().getFlag())) {
|
|
|
+ workActivityProcessService.insertAuditsByType(auditUsers,businessSignatureInfo.getProcessInstanceId(),2,1);
|
|
|
+ notifyRole = "办公室审核";
|
|
|
+ workActivityProcess.setIsApproval("1");
|
|
|
+ enname = "bgsquhe";
|
|
|
+ vars.put("bgsquheList", auditUsers);
|
|
|
+ vars.put("bgsquheCount",auditUsers.size());
|
|
|
+ } else {
|
|
|
+ notifyRole = "调整业务用章申请";
|
|
|
+ workActivityProcess.setIsApproval("2");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }else if ("bgsquhe".equals(taskDefKey) && count.contains("3")) {
|
|
|
+ taskCount = "3";
|
|
|
+ exp = "pass";
|
|
|
+ if ("yes".equals(businessSignatureInfo.getAct().getFlag())) {
|
|
|
+ notifyRole = "审批通过";
|
|
|
+ workActivityProcess.setIsApproval("1");
|
|
|
+ businessSignatureInfo.setApplicationDate(new Date());
|
|
|
+ } else {
|
|
|
+ notifyRole = "调整业务用章申请";
|
|
|
+ workActivityProcess.setIsApproval("2");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ } else if ("modifyApply".equals(taskDefKey) && "0".equals(count)) {
|
|
|
+ notifyRole = "部门负责人审批";
|
|
|
+ taskCount = "0";
|
|
|
+ enname = "bmzr";
|
|
|
+ workActivityProcess.setCount(0);
|
|
|
+ if("yes".equals(businessSignatureInfo.getAct().getFlag())){
|
|
|
+ workActivityProcess.setIsApproval("1");
|
|
|
+ vars.put("pass",true);
|
|
|
+ vars.put("passs",true);
|
|
|
+ }else{
|
|
|
+ workActivityProcess.setIsApproval("2");
|
|
|
+ businessSignatureInfo.setStatus(ProjectStatusEnum.RECALL.getValue());
|
|
|
+ vars.put("pass",false);
|
|
|
+ vars.put("passs",false);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 设置意见
|
|
|
+ businessSignatureInfo.getAct().setComment(("yes".equals(businessSignatureInfo.getAct().getFlag()) ? "[同意] " : "[驳回] ") + businessSignatureInfo.getAct().getComment());
|
|
|
+ businessSignatureInfo.preUpdate();
|
|
|
+ // 提交流程任务
|
|
|
+ vars.put(exp, "yes".equals(businessSignatureInfo.getAct().getFlag()) ? true : false);
|
|
|
+ vars.put("passs", true);
|
|
|
+ workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,businessSignatureInfo.getProcessInstanceId(),taskDefKey,"modifyApply",businessSignatureInfo.getAct().getFlag(),comment, activities);
|
|
|
+ // 提交流程任务
|
|
|
+ actTaskService.complete(businessSignatureInfo.getAct().getTaskId(), businessSignatureInfo.getAct().getProcInsId(), businessSignatureInfo.getAct().getComment(), vars);
|
|
|
+
|
|
|
+ boolean state = actTaskService.isProcessEnd(businessSignatureInfo.getAct().getProcInsId());
|
|
|
+ List<User> users = new ArrayList<>();
|
|
|
+ List<User> userList = new ArrayList<>();
|
|
|
+
|
|
|
+
|
|
|
+ if(!state) {
|
|
|
+ users.add(businessSignatureInfo.getCreateBy());
|
|
|
+ //审核完成提示框
|
|
|
+
|
|
|
+ String title = "业务用章申请描述:"+ businessSignatureInfo.getName()+"。签章申请审批完成,申请使用场景:"+useTypeStr+"。";
|
|
|
+ String content = "业务用章申请描述:"+ businessSignatureInfo.getName()+"。签章申请审批完成,申请使用场景:"+useTypeStr;
|
|
|
+
|
|
|
+ if ("yes".equals(businessSignatureInfo.getAct().getFlag())) {
|
|
|
+ businessSignatureInfo.setStatus(ProjectStatusEnum.SIGNED.getValue());
|
|
|
+ WorkProjectNotify customNotify = new WorkProjectNotify();
|
|
|
+ customNotify.setNotifyId(businessSignatureInfo.getId());
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(customNotify);
|
|
|
+ users.add(businessSignatureInfo.getCreateBy());
|
|
|
+ workProjectNotifyService
|
|
|
+ .save(UtilNotify
|
|
|
+ .saveNotify(businessSignatureInfo.getId(),
|
|
|
+ businessSignatureInfo.getCreateBy(),
|
|
|
+ businessSignatureInfo.getCompany().getId(),
|
|
|
+ title,
|
|
|
+ content,
|
|
|
+ "193",
|
|
|
+ "0",
|
|
|
+ "待通知",
|
|
|
+ notifyRole));
|
|
|
+ } else {
|
|
|
+ WorkProjectNotify customNotify = new WorkProjectNotify();
|
|
|
+ customNotify.setNotifyId(businessSignatureInfo.getId());
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(customNotify);
|
|
|
+ users.add(businessSignatureInfo.getCreateBy());
|
|
|
+ if (businessSignatureInfo.getStatus()!= ProjectStatusEnum.RECALL.getValue()){
|
|
|
+ businessSignatureInfo.setStatus(ProjectStatusEnum.REJECTED.getValue());
|
|
|
+ workProjectNotifyService
|
|
|
+ .save(UtilNotify
|
|
|
+ .saveNotify(businessSignatureInfo.getId(),
|
|
|
+ businessSignatureInfo.getCreateBy(),
|
|
|
+ businessSignatureInfo.getCompany().getId(),
|
|
|
+ titleStr,
|
|
|
+ notifyStr,
|
|
|
+ "193",
|
|
|
+ "0",
|
|
|
+ "待通知",
|
|
|
+ notifyRole));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ workActivityProcessService.deleteProcessIdAuditUsers(businessSignatureInfo.getProcessInstanceId());
|
|
|
+
|
|
|
+ }else{
|
|
|
+ if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("businessSignature")) {
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
+ notify.setNotifyId(businessSignatureInfo.getId());
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
+ WorkProjectNotify workProjectNotify = UtilNotify
|
|
|
+ .saveNotify(businessSignatureInfo.getId(),
|
|
|
+ new User(),
|
|
|
+ businessSignatureInfo.getCompany().getId(),
|
|
|
+ titleStr,
|
|
|
+ str,
|
|
|
+ "193",
|
|
|
+ "0",
|
|
|
+ "待审批",
|
|
|
+ notifyRole);
|
|
|
+ String count = taskDefKey.replace("audit","").replace("task","");
|
|
|
+ List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
|
|
|
+ activities,
|
|
|
+ workProjectNotify,
|
|
|
+ taskDefKey,
|
|
|
+ businessSignatureInfo.getAct().getFlag(),
|
|
|
+ count,
|
|
|
+ businessSignatureInfo.getCreateBy(),
|
|
|
+ businessSignatureInfo.getOffice().getId(),
|
|
|
+ "4");
|
|
|
+ for (WorkProjectNotify workProjectNotify1:workProjectNotifys){
|
|
|
+ users.add(workProjectNotify1.getUser());
|
|
|
+ workProjectNotify1.setId("");
|
|
|
+ workProjectNotify1.setIsNewRecord(false);
|
|
|
+ workProjectNotifyService.save(workProjectNotify1);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if (!"yes".equals(businessSignatureInfo.getAct().getFlag())) {//驳回待办提醒
|
|
|
+
|
|
|
+ str = "业务用章申请描述:"+ businessSignatureInfo.getName()+"。被驳回,请选择重新申请或作废,申请使用场景:"+useTypeStr+"。";
|
|
|
+ titleStr = "业务用章申请描述:"+ businessSignatureInfo.getName()+"。被驳回,请选择重新申请或作废,申请使用场景:"+useTypeStr+"。";
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
+ notify.setNotifyId(businessSignatureInfo.getId());
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
+ //users.add(user);
|
|
|
+ WorkProjectNotify workProjectNotify = UtilNotify
|
|
|
+ .saveNotify(businessSignatureInfo.getId(),
|
|
|
+ businessSignatureInfo.getCreateBy(),
|
|
|
+ businessSignatureInfo.getCompany().getId(),
|
|
|
+ titleStr,
|
|
|
+ str,
|
|
|
+ "193",
|
|
|
+ "0",
|
|
|
+ "重新申请",
|
|
|
+ notifyRole);
|
|
|
+ workProjectNotifyService.save(workProjectNotify);
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(enname)) {//驳回重新申请待办信息
|
|
|
+ str = "业务用章申请描述:"+ businessSignatureInfo.getName()+"。待审批,申请使用场景:"+useTypeStr+"。";
|
|
|
+ titleStr = "业务用章申请描述:"+ businessSignatureInfo.getName()+"。待审批,申请使用场景:"+useTypeStr+"。";
|
|
|
+
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
+ notify.setNotifyId(businessSignatureInfo.getId());
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
+ WorkProjectNotify workProjectNotify = UtilNotify
|
|
|
+ .saveNotify(businessSignatureInfo.getId(),
|
|
|
+ new User(),
|
|
|
+ businessSignatureInfo.getCompany().getId(),
|
|
|
+ titleStr,
|
|
|
+ str,
|
|
|
+ "193",
|
|
|
+ "0",
|
|
|
+ "待审批",
|
|
|
+ notifyRole);
|
|
|
+ for (User user1:auditUsers){
|
|
|
+ users.add(user1);
|
|
|
+ workProjectNotify.setUser(user1);
|
|
|
+ workProjectNotify.setId("");
|
|
|
+ workProjectNotify.setIsNewRecord(false);
|
|
|
+ workProjectNotifyService.save(workProjectNotify);
|
|
|
+ Map<String,Object> extras = new HashMap<>();
|
|
|
+ extras.put("type","7003");
|
|
|
+ extras.put("procDefKey","193");
|
|
|
+ extras.put("id",workProjectNotify.getId());
|
|
|
+ UserUtils.pushInfoToApp(titleStr,str,extras,user1.getId());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ WorkProjectNotify notify = new WorkProjectNotify();
|
|
|
+ notify.setNotifyId(businessSignatureInfo.getId());
|
|
|
+ userList = workProjectNotifyService.readByNotifyId(notify);
|
|
|
+ users.add(businessSignatureInfo.getCreateBy());
|
|
|
+ workProjectNotifyService
|
|
|
+ .save(UtilNotify
|
|
|
+ .saveNotify(businessSignatureInfo.getId(),
|
|
|
+ businessSignatureInfo.getCreateBy(),
|
|
|
+ businessSignatureInfo.getCompany().getId(),
|
|
|
+ titleStr,
|
|
|
+ str,
|
|
|
+ "193",
|
|
|
+ "0",
|
|
|
+ "重新申请",
|
|
|
+ notifyRole));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (users!=null && users.size()!=0) {
|
|
|
+ List<String> userIds = new ArrayList<>(users.size());
|
|
|
+ for (User u : users) {
|
|
|
+ userIds.add(u.getId());
|
|
|
+ }
|
|
|
+ UserUtils.pushIm(userIds,titleStr);
|
|
|
+ }
|
|
|
+ if (userList!=null && userList.size()!=0) {
|
|
|
+ for (User u : userList) {
|
|
|
+ UserUtils.pushMeIm(u.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dao.update(businessSignatureInfo);
|
|
|
+ return "保存审核意见成功!";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|