|
@@ -6,6 +6,8 @@ package com.jeeplus.modules.act.web;
|
|
|
import java.io.InputStream;
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.net.URLDecoder;
|
|
|
+import java.util.Date;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -29,7 +31,9 @@ import com.jeeplus.modules.sg.managementcenter.activiti.service.ProcessPersonnel
|
|
|
import com.jeeplus.modules.sg.managementcenter.activiti.service.UploadImagesService;
|
|
|
import com.jeeplus.modules.sg.managementcenter.activiti.utils.MyActiviUtils;
|
|
|
import com.jeeplus.modules.sg.managementcenter.project.entity.Project;
|
|
|
+import com.jeeplus.modules.sg.managementcenter.project.service.PickingRequisitionService;
|
|
|
import com.jeeplus.modules.sg.managementcenter.project.service.ProjectService;
|
|
|
+import com.jeeplus.modules.sg.materialmodule.activiti.service.MaterialModuleService;
|
|
|
import com.jeeplus.modules.sg.picking.activiti.entity.PickList;
|
|
|
import com.jeeplus.modules.sg.picking.activiti.entity.ShowList;
|
|
|
import com.jeeplus.modules.sg.picking.activiti.service.PickIngService;
|
|
@@ -67,6 +71,7 @@ import com.jeeplus.modules.act.entity.Act;
|
|
|
import com.jeeplus.modules.act.service.ActTaskService;
|
|
|
import com.jeeplus.modules.act.utils.ActUtils;
|
|
|
import com.jeeplus.modules.sys.utils.UserUtils;
|
|
|
+import sun.util.calendar.BaseCalendar;
|
|
|
|
|
|
/**
|
|
|
* 流程个人任务相关Controller
|
|
@@ -118,6 +123,10 @@ public class ActTaskController extends BaseController {
|
|
|
@Autowired
|
|
|
private SystemService systemService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private MaterialModuleService materialModuleService;
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 获取待办列表
|
|
|
* @return
|
|
@@ -1549,16 +1558,55 @@ public class ActTaskController extends BaseController {
|
|
|
public AjaxJson PowerStartTask(Act act,String pic, UploadImages uploadImages) {
|
|
|
AjaxJson j = new AjaxJson();
|
|
|
try {
|
|
|
- if (pic!=null&&pic!="") {
|
|
|
- uploadImages.setPath(pic);
|
|
|
- uploadImages.setProcInsId(act.getProcInsId());
|
|
|
- uploadImages.setImgName("上传涉电开工流程");
|
|
|
- uploadImages.setuId(UserUtils.getUser().getLoginName());
|
|
|
- uploadImagesService.save(uploadImages);
|
|
|
+ //获取当前的流程实例id
|
|
|
+ String procInsId = act.getProcInsId();
|
|
|
+ //根据项目信息查询计划开工日期
|
|
|
+ String projectName = materialModuleService.findProjectName(procInsId);
|
|
|
+ Date specificTime = materialModuleService.findSpecificTime(projectName);
|
|
|
+ String[] needUser = {"施工项目经理A"};
|
|
|
+ List<String> listUserId = MyActiviUtils.getListUserId(needUser);
|
|
|
+ List<String> userId = materialModuleService.findUserId(listUserId);
|
|
|
+ String stringJoiningTogether = MyActiviUtils.getStringJoiningTogether(userId);
|
|
|
+ OaNotify oaNotify = new OaNotify();
|
|
|
+ oaNotify.setType("4");
|
|
|
+ oaNotify.setTitle("施工验收流程项目计划信息");
|
|
|
+ oaNotify.setStatus("1");
|
|
|
+ oaNotify.setOaNotifyRecordIds(stringJoiningTogether);
|
|
|
+ if (specificTime == null) {
|
|
|
+ //根据流程实例id查询对应的项目信息(如果没有,发送通知,没有该项目计划信息)
|
|
|
+ oaNotify.setContent(projectName + ":项目没有对应的计划信息");
|
|
|
+ oaNotifyService.save(oaNotify);
|
|
|
+ List<OaNotifyRecord> list = oaNotify.getOaNotifyRecordList();
|
|
|
+ for (OaNotifyRecord o : list) {
|
|
|
+ //发送通知到客户端
|
|
|
+ ServletContext context = SpringContextHolder.getBean(ServletContext.class);
|
|
|
+ new SystemInfoSocketHandler().sendMessageToUser(UserUtils.get(o.getUser().getId()).getLoginName(), "收到一条新通知,请到我的通知查看!");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //将计划赶工日期与当前时间比对(则将不符情况以通知形式发送)
|
|
|
+ SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMdd");
|
|
|
+ boolean timeFlag = fmt.format(specificTime).equals(fmt.format(new Date()));
|
|
|
+ if (timeFlag == false) {
|
|
|
+ oaNotify.setContent(projectName + ":计划时间与实际时间不符");
|
|
|
+ oaNotifyService.save(oaNotify);
|
|
|
+ List<OaNotifyRecord> list = oaNotify.getOaNotifyRecordList();
|
|
|
+ for (OaNotifyRecord o : list) {
|
|
|
+ //发送通知到客户端
|
|
|
+ ServletContext context = SpringContextHolder.getBean(ServletContext.class);
|
|
|
+ new SystemInfoSocketHandler().sendMessageToUser(UserUtils.get(o.getUser().getId()).getLoginName(), "收到一条新通知,请到我的通知查看!");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- String comment = URLDecoder.decode(act.getComment(), "UTF-8");
|
|
|
- act.setComment(comment);
|
|
|
- actTaskService.PowerStartTask(act);
|
|
|
+ if (pic != null && pic != "") {
|
|
|
+ uploadImages.setPath(pic);
|
|
|
+ uploadImages.setProcInsId(act.getProcInsId());
|
|
|
+ uploadImages.setImgName("上传涉电开工流程");
|
|
|
+ uploadImages.setuId(UserUtils.getUser().getLoginName());
|
|
|
+ uploadImagesService.save(uploadImages);
|
|
|
+ }
|
|
|
+ String comment = URLDecoder.decode(act.getComment(), "UTF-8");
|
|
|
+ act.setComment(comment);
|
|
|
+ actTaskService.PowerStartTask(act);
|
|
|
} catch (UnsupportedEncodingException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|