|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package com.zcloud.controller.bus;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.text.DateFormat;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -68,6 +70,8 @@ public class HotWorkApplicationController extends BaseController {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private DictionariesService dictionariesService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private NoticeCorpService noticeCorpService;
|
|
|
|
|
|
|
|
|
|
/**新增
|
|
|
|
|
* @param
|
|
|
|
@ -76,17 +80,397 @@ public class HotWorkApplicationController extends BaseController {
|
|
|
|
|
@RequestMapping(value="/add")
|
|
|
|
|
@RequiresPermissions("hotwork:add")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
@DockAnnotation(isAdd = true)
|
|
|
|
|
public Object add() throws Exception{
|
|
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
pd = this.getPageData();
|
|
|
|
|
PageData dockData = new PageData(); // 主要对接数据
|
|
|
|
|
|
|
|
|
|
pd.put("loginUserId",Jurisdiction.getUSER_ID());
|
|
|
|
|
pd.put("HOTWORKAPPLICATION_ID", this.get32UUID()); //主键
|
|
|
|
|
pd.put("CREATOR", Jurisdiction.getUSER_ID());
|
|
|
|
|
pd.put("CREATTIME", DateUtil.date2Str(new Date()));
|
|
|
|
|
pd.put("OPERATOR",Jurisdiction.getUSER_ID());
|
|
|
|
|
pd.put("OPERATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
pd.put("ISDELETE","0");
|
|
|
|
|
pd.put("STATE","1"); // 1 。申请成功 ,项目进入到动火单位负责人确认
|
|
|
|
|
|
|
|
|
|
if("0".equals(pd.getString("HOT_WORK_LEVEL_INDEX"))){ // 特技动火 0 . 1 2 3
|
|
|
|
|
pd.put("STATE","30"); //如果是特级动火
|
|
|
|
|
}
|
|
|
|
|
// 新增新的其他措施
|
|
|
|
|
if (pd.get("OTHERMEASURE") != null && !pd.get("OTHERMEASURE").equals("")) {
|
|
|
|
|
String[] othermeasure = pd.get("OTHERMEASURE").toString().split(",");
|
|
|
|
|
Map<String, String> safetymethodrecordPdMap = new HashMap<String, String>();
|
|
|
|
|
int safetymethodrecordPdCount = 1;
|
|
|
|
|
for (String content : othermeasure) {
|
|
|
|
|
if(Tools.notEmpty(content)) {
|
|
|
|
|
PageData safetymethodrecordPd = new PageData();
|
|
|
|
|
safetymethodrecordPd.put("HOTWORKSAFETYMETHODRECORD_ID", this.get32UUID()); //主键
|
|
|
|
|
safetymethodrecordPd.put("HOTWORKAPPLICATION_ID", pd.getString("HOTWORKAPPLICATION_ID")); //主表主键
|
|
|
|
|
safetymethodrecordPd.put("CONTENT", content);//其它安全措施
|
|
|
|
|
safetymethodrecordPd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
|
|
|
|
safetymethodrecordPd.put("CREATE_USER_ID", Jurisdiction.getUSER_ID()); //添加用户ID
|
|
|
|
|
safetymethodrecordPd.put("CREATE_DEPARTMENT_ID", pd.getString("loginDeptId")); //添加用户部门ID
|
|
|
|
|
safetymethodrecordPd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人
|
|
|
|
|
safetymethodrecordPd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
|
|
|
|
safetymethodrecordPd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
|
|
|
|
|
safetymethodrecordPd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
|
|
|
|
safetymethodrecordPd.put("ISDELETE", "0"); //是否删除 1-是 0-否
|
|
|
|
|
safetymethodrecordPdMap.put("other" + safetymethodrecordPdCount, JSON.toJSONString(safetymethodrecordPd));
|
|
|
|
|
hotWorkSafetyMethodRecordService.save(safetymethodrecordPd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dockData.put("safetymethodrecordPd", JSON.toJSONString(safetymethodrecordPdMap));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PageData confinedPageData = new PageData(); // pd对接数据
|
|
|
|
|
confinedPageData.putAll(pd);
|
|
|
|
|
dockData.put("dockData", JSON.toJSONString(confinedPageData));
|
|
|
|
|
Map<String, String> hotuserMap = new HashMap<>();
|
|
|
|
|
hotWorkApplicationUserService.saveUserByHot(pd.getString("HOTWORKAPPLICATION_ID"),pd,hotuserMap);
|
|
|
|
|
dockData.put("hotuserMap", JSON.toJSONString(hotuserMap));
|
|
|
|
|
hotworkapplicationService.save(pd);
|
|
|
|
|
this.sendNotice(pd); //发送通知公告
|
|
|
|
|
map.put("dockData", JSON.toJSONString(dockData));
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 发送通知公告
|
|
|
|
|
* @param pageData
|
|
|
|
|
*/
|
|
|
|
|
public void sendNotice(PageData pageData) {
|
|
|
|
|
try{
|
|
|
|
|
PageData hot = hotworkapplicationService.findById(pageData);
|
|
|
|
|
String hotState = hot.getString("STATE");
|
|
|
|
|
PageData getHotUser = new PageData();
|
|
|
|
|
getHotUser.put("FOREIGN_KEY",hot.getString("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
getHotUser.put("STATE",hotState);
|
|
|
|
|
List<PageData> hotUserList = hotWorkApplicationUserService.listAll(getHotUser); // 找到这一笔的审批人
|
|
|
|
|
if(hotUserList.size()>0){
|
|
|
|
|
if(hot.getString("STATE").equals("1")){ //待确认通知
|
|
|
|
|
PageData hotUser = hotUserList.get(0);
|
|
|
|
|
String userID = hotUser.getString("USER_ID");
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条动火作业待确认"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", userID); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "动火单位负责人确认");
|
|
|
|
|
content.put("params3", "确认");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
if(hot.getString("IS_GAS_TESTING").equals("1")){ //气体分析发站内信
|
|
|
|
|
getHotUser.put("STATE","24");
|
|
|
|
|
hotUserList = hotWorkApplicationUserService.listAll(getHotUser); // 找到这一笔的审批人
|
|
|
|
|
if(hotUserList.size()>0){
|
|
|
|
|
hotUser = hotUserList.get(0);
|
|
|
|
|
userID = hotUser.getString("USER_ID");
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条动火作业待进行气体分析"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", userID); // 接收人员ID
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "气体分析");
|
|
|
|
|
content.put("params3", "进行气体分析");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if(hot.getString("STATE").equals("3")){ //待签发通知
|
|
|
|
|
if(hot.getString("JOB_TYPE_INDEX").equals("1")){
|
|
|
|
|
PageData hotUser = hotUserList.get(0);
|
|
|
|
|
String userID = hotUser.getString("USER_ID");
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条动火作业待签发"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", userID); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "项目发包单位签发");
|
|
|
|
|
content.put("params3", "签发");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
} else {
|
|
|
|
|
PageData hotUser = hotUserList.get(0);
|
|
|
|
|
String userID = hotUser.getString("USER_ID");
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条动火作业待审核"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", userID); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "现场管辖单位负责人审核");
|
|
|
|
|
content.put("params3", "审核");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
}
|
|
|
|
|
} else if(hot.getString("STATE").equals("4")){
|
|
|
|
|
PageData hotUser = hotUserList.get(0);
|
|
|
|
|
String userID = hotUser.getString("USER_ID");
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条动火作业待签发"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", userID); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "动火许可签发单位");
|
|
|
|
|
content.put("params3", "签发");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
} else if(hot.getString("STATE").equals("5")){
|
|
|
|
|
PageData hotUser = hotUserList.get(0);
|
|
|
|
|
String userID = hotUser.getString("USER_ID");
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条动火作业待审批"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", userID); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "安全总监审批");
|
|
|
|
|
content.put("params3", "审批");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
} else if(hot.getString("STATE").equals("6")){
|
|
|
|
|
PageData hotUser = hotUserList.get(0);
|
|
|
|
|
String userID = hotUser.getString("USER_ID");
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条动火作业待接收"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", userID); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "现场负责人接收");
|
|
|
|
|
content.put("params3", "接收");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
} else if(hot.getString("STATE").equals("7")){
|
|
|
|
|
PageData hotUser = hotUserList.get(0);
|
|
|
|
|
String userID = hotUser.getString("USER_ID");
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条动火作业待确认"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", userID); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "动火前现场管辖单位确认");
|
|
|
|
|
content.put("params3", "确认");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
} else if(hot.getString("STATE").equals("8")){
|
|
|
|
|
PageData hotUser = hotUserList.get(0);
|
|
|
|
|
String userID = hotUser.getString("USER_ID");
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条动火作业待确认"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", userID); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "现场负责人确认");
|
|
|
|
|
content.put("params3", "确认");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
} else if(hot.getString("STATE").equals("9")){
|
|
|
|
|
PageData hotUser = hotUserList.get(0);
|
|
|
|
|
String userID = hotUser.getString("USER_ID");
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条动火作业待确认"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", userID); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "动火后现场管辖单位确认");
|
|
|
|
|
content.put("params3", "确认");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
} else if(hot.getString("STATE").equals("10")){
|
|
|
|
|
PageData hotUser = hotUserList.get(0);
|
|
|
|
|
String userID = hotUser.getString("USER_ID");
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条动火作业待您进行监火"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", userID); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "延时监火");
|
|
|
|
|
content.put("params3", "处理");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
} else if(hot.getString("STATE").equals("30")){
|
|
|
|
|
PageData hotUser = hotUserList.get(0);
|
|
|
|
|
String userID = hotUser.getString("USER_ID");
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条特级动火作业待您确认"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", userID); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "动火确认人确认");
|
|
|
|
|
content.put("params3", "确认");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
} else if(hot.getString("STATE").equals("31")){
|
|
|
|
|
PageData hotUser = hotUserList.get(0);
|
|
|
|
|
String userID = hotUser.getString("USER_ID");
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条特级动火作业待您初审"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", userID); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "项目主管人员初审");
|
|
|
|
|
content.put("params3", "初审");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
} else if(hot.getString("STATE").equals("32")){
|
|
|
|
|
PageData hotUser = hotUserList.get(0);
|
|
|
|
|
String userID = hotUser.getString("USER_ID");
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条特级动火作业待您审核"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", userID); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "项目主管部门负责人审核");
|
|
|
|
|
content.put("params3", "审核");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
} else if(hot.getString("STATE").equals("33")){
|
|
|
|
|
PageData hotUser = hotUserList.get(0);
|
|
|
|
|
String userID = hotUser.getString("USER_ID");
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条特级动火作业待您审批"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", userID); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "分公司安全总监审批");
|
|
|
|
|
content.put("params3", "审批");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
} else if(hot.getString("STATE").equals("34")){
|
|
|
|
|
PageData hotUser = hotUserList.get(0);
|
|
|
|
|
String userID = hotUser.getString("USER_ID");
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条特级动火作业待您签批"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", userID); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "分公司主要负责人签批");
|
|
|
|
|
content.put("params3", "签批");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(hot.getString("STATE").equals("-1")){ //普通打回发站内信
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条动火作业打回待处理"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", hot.getString("CREATOR")); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "动火申请管理");
|
|
|
|
|
content.put("params3", "处理");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
} else if(hot.getString("STATE").equals("-2")){
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("BIANMA","PROCESS_WORK_001");
|
|
|
|
|
mes.put("SENDER_ID", "系统管理员"); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", "1"); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条动火作业打回待处理"); // 站内信标题
|
|
|
|
|
mes.put("CORPINFO_ID", hot.get("CORPINFO_ID"));// 企业id
|
|
|
|
|
mes.put("RECEIVER_ID", hot.getString("CREATOR")); // 接收人员ID
|
|
|
|
|
PageData content = new PageData();
|
|
|
|
|
content.put("number", hot.getString("JOB_NUMBER"));// 作业编号
|
|
|
|
|
content.put("params1", "动火申请作业"); // 作业名称
|
|
|
|
|
content.put("params2", "动火申请管理");
|
|
|
|
|
content.put("params3", "处理");// 作业操作
|
|
|
|
|
mes.put("CONTENT", content);// 站内信内容
|
|
|
|
|
noticeCorpService.sendNotice(mes);
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
// FHLOG.save("动火审批", "发送站内信失败!");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**删除
|
|
|
|
|
* @param out
|
|
|
|
|
* @throws Exception
|
|
|
|
@ -719,6 +1103,493 @@ public class HotWorkApplicationController extends BaseController {
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 审批
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value="/editOpinion")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
@Transactional
|
|
|
|
|
@DockAnnotation(hasAnnex = true)
|
|
|
|
|
public Object editOpinion() throws Exception{
|
|
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
pd = this.getPageData();
|
|
|
|
|
PageData dockData = new PageData(); // 主要对接数据
|
|
|
|
|
PageData confinedPageData = new PageData(); // pd对接数据
|
|
|
|
|
confinedPageData.putAll(pd);
|
|
|
|
|
dockData.put("dockData", JSON.toJSONString(confinedPageData));
|
|
|
|
|
String type = pd.getString("TYPE"); //1 通过 2.未通过
|
|
|
|
|
PageData hotUserPd = new PageData();
|
|
|
|
|
hotUserPd.put("FOREIGN_KEY",pd.getString("HOTWORKAPPLICATION_ID")); // 动火标识
|
|
|
|
|
hotUserPd.put("STATE",pd.get("STATE").toString()); // 哪一步
|
|
|
|
|
hotUserPd.put("USER_ID",pd.getString("loginUserId"));// 登录人
|
|
|
|
|
if ("10".equals(pd.get("STATE").toString())) {
|
|
|
|
|
PageData hotWorkApplication = hotworkapplicationService.findById(pd);
|
|
|
|
|
if(!Tools.isEmpty(hotWorkApplication) && hotWorkApplication.getString("STATE").equals("11")){ // 判断此作业是否已归档
|
|
|
|
|
map.put("result", "error");
|
|
|
|
|
map.put("msg", "此作业已归档,请勿重复操作!");
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<PageData> hotUserList = new ArrayList<>();
|
|
|
|
|
if (!pd.getString("STATE").equals("10")) {
|
|
|
|
|
hotUserList = hotWorkApplicationUserService.listAll(hotUserPd); // 找到这一笔的审批人
|
|
|
|
|
if (hotUserList.size() != 1) {
|
|
|
|
|
map.put("result", "error");
|
|
|
|
|
map.put("msg", "获取审批人意见失败!请联系管理员");
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//先判断延时监火是否为选择部门
|
|
|
|
|
hotUserList = hotWorkApplicationUserService.listByDepartment(hotUserPd); // 找到这一笔的审批人们(选择部门)
|
|
|
|
|
if (hotUserList.size() < 1) {
|
|
|
|
|
//如果查询部门查不到就根据人查询
|
|
|
|
|
hotUserList = hotWorkApplicationUserService.listAll(hotUserPd); // 找到这一笔的审批人(选择人)
|
|
|
|
|
if (hotUserList.size() != 1) {
|
|
|
|
|
map.put("result", "error");
|
|
|
|
|
map.put("msg", "获取审批人意见失败!请联系管理员");
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PageData hotUser = hotUserList.get(0);
|
|
|
|
|
PageData hot = hotworkapplicationService.findById(pd);
|
|
|
|
|
hot.put("loginUserId",pd.getString("loginUserId"));
|
|
|
|
|
String judgeState = this.judgeHotTime(hot);//判断是否超时
|
|
|
|
|
if(!"true".equals(judgeState)){
|
|
|
|
|
map.put("result", "error");
|
|
|
|
|
map.put("msg", "动火超期!请重新申请动火许可!");
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
if("1".equals(type)){
|
|
|
|
|
hotUser.put("OPINION",pd.getString("OPINION"));
|
|
|
|
|
hotUser.put("TYPE","1");
|
|
|
|
|
String state = "-1";
|
|
|
|
|
// 特级动火打回
|
|
|
|
|
if(hot.get("STATE") != null && Tools.notEmpty(hot.get("STATE").toString())){
|
|
|
|
|
Integer hotSta = Integer.parseInt(hot.get("STATE").toString());
|
|
|
|
|
if(hotSta >= 30 && hotSta <= 37){
|
|
|
|
|
state = "-2";// 其他审核。返回 -2
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 删除原有其他隐患措施
|
|
|
|
|
PageData delPd = new PageData();
|
|
|
|
|
delPd.put("HOTWORKAPPLICATION_ID", pd.get("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
delPd.put("OPERATOR", pd.get("loginUserName"));
|
|
|
|
|
delPd.put("OPERATTIME", DateUtil.date2Str(new Date()));
|
|
|
|
|
|
|
|
|
|
PageData confinedPageDatadelPd = new PageData(); // pd对接数据
|
|
|
|
|
confinedPageDatadelPd.putAll(delPd);
|
|
|
|
|
dockData.put("dockDatadelPd", JSON.toJSONString(confinedPageDatadelPd));
|
|
|
|
|
|
|
|
|
|
hotWorkSafetyMethodRecordService.deleteByCheck(delPd);
|
|
|
|
|
PageData stateData = new PageData();
|
|
|
|
|
stateData.put("HOTWORKAPPLICATION_ID", hot.getString("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
stateData.put("loginUserId", pd.get("loginUserId"));
|
|
|
|
|
stateData.put("STATE", state);
|
|
|
|
|
stateData.put("WORK_LONGITUDE", pd.get("WORK_LONGITUDE"));
|
|
|
|
|
stateData.put("WORK_LATITUDE", pd.get("WORK_LATITUDE"));
|
|
|
|
|
|
|
|
|
|
PageData confinedstateData = new PageData(); // pd对接数据
|
|
|
|
|
confinedstateData.putAll(stateData);
|
|
|
|
|
dockData.put("dockDatastateData", JSON.toJSONString(confinedstateData));
|
|
|
|
|
hotworkapplicationService.editByState(stateData); // 把动火状态修改成未通过
|
|
|
|
|
|
|
|
|
|
}else if ("2".equals(type)){
|
|
|
|
|
if(!Tools.isEmpty(pd.get("USER_SIGN_IMG"))){
|
|
|
|
|
ArrayList<String> pictureList = new ArrayList<>();
|
|
|
|
|
MultipartFile file = BASE64DecodedMultipartFile.base64ToMultipart(pd.getString("USER_SIGN_IMG"));
|
|
|
|
|
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
|
|
|
|
|
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
|
|
|
|
|
errInfo = "fail";
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
map.put("msg", "文件格式不正确!");
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
String ffile = DateUtil.getDays();
|
|
|
|
|
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
|
|
|
|
Smb.sshSftp(file, fileName, Const.FILEPATHYHTP + pd.get("CORPINFO_ID").toString() + "/" + ffile);
|
|
|
|
|
|
|
|
|
|
pictureList.add(Const.FILEPATHYHTP + pd.get("CORPINFO_ID").toString() + "/" + ffile + "/" + fileName + "@@" + fileName);
|
|
|
|
|
map.put("sendPicturesList", JSON.toJSONString(pictureList));
|
|
|
|
|
hotUser.put("AUTOGRAPH",Const.FILEPATHYHTP + pd.get("CORPINFO_ID").toString() + "/" + ffile + "/" + fileName);
|
|
|
|
|
}
|
|
|
|
|
hotUser.put("TYPE","2");
|
|
|
|
|
// 审批进入下一阶段 1.特技动火。2发包单位
|
|
|
|
|
if ("0".equals(hot.getString("JOB_TYPE_INDEX")) && "1".equals(hot.get("STATE").toString())){
|
|
|
|
|
hot.put("STATE","2"); // 如何是内容作业,跳过项目单发作业
|
|
|
|
|
}
|
|
|
|
|
if ("0".equals(hot.getString("IS_SAFETY_DIRECTOR")) && "4".equals(hot.get("STATE").toString())){
|
|
|
|
|
hot.put("STATE","5");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PageData stateData = new PageData();
|
|
|
|
|
stateData.put("HOTWORKAPPLICATION_ID", hot.getString("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
stateData.put("loginUserId", pd.get("loginUserId"));
|
|
|
|
|
stateData.put("STATE", hot.get("STATE").toString());
|
|
|
|
|
|
|
|
|
|
PageData confinedstateData = new PageData(); // pd对接数据
|
|
|
|
|
confinedstateData.putAll(stateData);
|
|
|
|
|
dockData.put("dockDatastateData", JSON.toJSONString(confinedstateData));
|
|
|
|
|
|
|
|
|
|
hotworkapplicationService.editByState(stateData);
|
|
|
|
|
PageData Position = new PageData();
|
|
|
|
|
Position.put("WORK_LONGITUDE", pd.get("WORK_LONGITUDE"));
|
|
|
|
|
Position.put("WORK_LATITUDE", pd.get("WORK_LATITUDE"));
|
|
|
|
|
Position.put("HOTWORKAPPLICATION_ID", hot.getString("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
|
|
|
|
|
PageData confinedPosition = new PageData(); // pd对接数据
|
|
|
|
|
confinedPosition.putAll(Position);
|
|
|
|
|
dockData.put("dockDataPosition", JSON.toJSONString(confinedPosition));
|
|
|
|
|
hotworkapplicationService.editPosition(Position); //添加定位
|
|
|
|
|
// hotworkapplicationService.editByState(hot.getString("HOTWORKAPPLICATION_ID"),hot.get("STATE").toString());
|
|
|
|
|
// 单位负责人确认时。保存主要安全措施
|
|
|
|
|
if("1".equals(pd.get("STATE").toString()) && pd.get("measureList") != null && Tools.notEmpty(pd.get("measureList").toString())){
|
|
|
|
|
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("measureList").toString());
|
|
|
|
|
Map<String, String> measuresMap = new HashMap<>();
|
|
|
|
|
int measuresCount = 1;
|
|
|
|
|
for (JSONObject json : list) {
|
|
|
|
|
// 因必须选择符合,所以只存需要填的项
|
|
|
|
|
if(json.get("ANSWER1") != null || json.get("ANSWER2") != null || json.get("ANSWER3") != null || json.get("ANSWER4") != null){
|
|
|
|
|
PageData measures = new PageData();
|
|
|
|
|
measures.put("HOTWORKTOMEASURES_ID", this.get32UUID()); // 主键
|
|
|
|
|
measures.put("HOTWORKAPPLICATION_ID", pd.getString("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
measures.put("BUS_HOTWORK_MEASURES_ID", json.get("BUS_HOTWORK_MEASURES_ID"));
|
|
|
|
|
measures.put("ANSWER1", json.get("ANSWER1"));
|
|
|
|
|
measures.put("ANSWER2", json.get("ANSWER2"));
|
|
|
|
|
measures.put("ANSWER3", json.get("ANSWER3"));
|
|
|
|
|
measures.put("ANSWER4", json.get("ANSWER4"));
|
|
|
|
|
measures.put("STATUS", json.get("radio"));
|
|
|
|
|
measuresMap.put("other" + measuresCount, JSON.toJSONString(measures));
|
|
|
|
|
measuresCount++;
|
|
|
|
|
hotworkToMeasuresService.save(measures);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
dockData.put("dockDatameasuresMap", JSON.toJSONString(measuresMap));
|
|
|
|
|
}
|
|
|
|
|
// 新增新的其他措施
|
|
|
|
|
if (pd.get("OTHERMEASURE") != null && !pd.get("OTHERMEASURE").equals("")) {
|
|
|
|
|
String[] othermeasure = pd.get("OTHERMEASURE").toString().split(",");
|
|
|
|
|
Map<String, String> safemethodrecordPdMap = new HashMap<>();
|
|
|
|
|
int count = 1;
|
|
|
|
|
for (String content : othermeasure) {
|
|
|
|
|
if(Tools.notEmpty(content)) {
|
|
|
|
|
PageData safetymethodrecordPd = new PageData();
|
|
|
|
|
safetymethodrecordPd.put("HOTWORKSAFETYMETHODRECORD_ID", this.get32UUID()); //主键
|
|
|
|
|
safetymethodrecordPd.put("HOTWORKAPPLICATION_ID", pd.getString("HOTWORKAPPLICATION_ID")); //主表主键
|
|
|
|
|
safetymethodrecordPd.put("CONTENT", content);//其它安全措施
|
|
|
|
|
safetymethodrecordPd.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); //企业
|
|
|
|
|
safetymethodrecordPd.put("CREATE_USER_ID", pd.getString("loginUserId")); //添加用户ID
|
|
|
|
|
safetymethodrecordPd.put("CREATE_DEPARTMENT_ID", pd.getString("loginDeptId")); //添加用户部门ID
|
|
|
|
|
safetymethodrecordPd.put("CREATOR", pd.getString("loginUserName")); //添加人
|
|
|
|
|
safetymethodrecordPd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
|
|
|
|
safetymethodrecordPd.put("OPERATOR", pd.getString("loginUserName")); //修改人
|
|
|
|
|
safetymethodrecordPd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
|
|
|
|
safetymethodrecordPd.put("ISDELETE", "0"); //是否删除 1-是 0-否
|
|
|
|
|
safemethodrecordPdMap.put("other" + count, JSON.toJSONString(safetymethodrecordPd));
|
|
|
|
|
count++;
|
|
|
|
|
hotWorkSafetyMethodRecordService.save(safetymethodrecordPd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dockData.put("dockDatasafemethodrecordPdMap", JSON.toJSONString(safemethodrecordPdMap));
|
|
|
|
|
}
|
|
|
|
|
if("6".equals(pd.getString("STATE"))){ // 添加动火前
|
|
|
|
|
PageData leaderUser = new PageData();
|
|
|
|
|
leaderUser.put("HOTWORKAPPLICATIONUSER_ID", UuidUtil.get32UUID());
|
|
|
|
|
leaderUser.put("USER_ID",pd.get("HOT_WORK_BEFORE_UNIT_LEADER_ID"));
|
|
|
|
|
leaderUser.put("STATE","7");
|
|
|
|
|
leaderUser.put("TYPE","-1");
|
|
|
|
|
leaderUser.put("ISDELETE","0");
|
|
|
|
|
leaderUser.put("FOREIGN_KEY",pd.get("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
leaderUser.put("CREATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("CREATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
leaderUser.put("OPERATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("OPERATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
|
|
|
|
|
PageData confinedleaderUser = new PageData(); // pd对接数据
|
|
|
|
|
confinedleaderUser.putAll(leaderUser);
|
|
|
|
|
dockData.put("dockDataleaderUser", JSON.toJSONString(confinedleaderUser));
|
|
|
|
|
|
|
|
|
|
hotWorkApplicationUserService.save(leaderUser); //
|
|
|
|
|
}else if("8".equals(pd.getString("STATE"))){ // 添加动火后现场负责人
|
|
|
|
|
PageData leaderUser = new PageData();
|
|
|
|
|
leaderUser.put("HOTWORKAPPLICATIONUSER_ID", UuidUtil.get32UUID());
|
|
|
|
|
leaderUser.put("USER_ID",pd.get("HOT_WORK_AFTER_UNIT_LEADER_ID"));
|
|
|
|
|
leaderUser.put("STATE","9");
|
|
|
|
|
leaderUser.put("TYPE","-1");
|
|
|
|
|
leaderUser.put("ISDELETE","0");
|
|
|
|
|
leaderUser.put("FOREIGN_KEY",pd.get("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
leaderUser.put("CREATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("CREATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
leaderUser.put("OPERATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("OPERATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
|
|
|
|
|
PageData confinedleaderUser = new PageData(); // pd对接数据
|
|
|
|
|
confinedleaderUser.putAll(leaderUser);
|
|
|
|
|
dockData.put("dockDataleaderUser", JSON.toJSONString(confinedleaderUser));
|
|
|
|
|
|
|
|
|
|
hotWorkApplicationUserService.save(leaderUser); // 添加 动火后负责人
|
|
|
|
|
}else if("9".equals(pd.getString("STATE"))){ // 添加 临时监火
|
|
|
|
|
PageData leaderUser = new PageData();
|
|
|
|
|
leaderUser.put("HOTWORKAPPLICATIONUSER_ID", UuidUtil.get32UUID());
|
|
|
|
|
// leaderUser.put("USER_ID",pd.get("TIME_LAPSE_FIREMAN_ID"));
|
|
|
|
|
leaderUser.put("USER_ID",pd.get("TIME_LAPSE_FIREMAN_DEPARTMENT_ID"));
|
|
|
|
|
leaderUser.put("STATE","10");
|
|
|
|
|
leaderUser.put("TYPE","-1");
|
|
|
|
|
leaderUser.put("ISDELETE","0");
|
|
|
|
|
leaderUser.put("FOREIGN_KEY",pd.get("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
leaderUser.put("CREATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("CREATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
leaderUser.put("OPERATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("OPERATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
|
|
|
|
|
PageData confinedleaderUser = new PageData(); // pd对接数据
|
|
|
|
|
confinedleaderUser.putAll(leaderUser);
|
|
|
|
|
dockData.put("dockDataleaderUser", JSON.toJSONString(confinedleaderUser));
|
|
|
|
|
|
|
|
|
|
hotWorkApplicationUserService.save(leaderUser); // 添加 动火后负责人
|
|
|
|
|
} else if("10".equals(pd.getString("STATE"))){ // 延时监火完成后,进行归档
|
|
|
|
|
PageData leaderUser = new PageData();
|
|
|
|
|
leaderUser.put("HOTWORKAPPLICATIONUSER_ID", UuidUtil.get32UUID());
|
|
|
|
|
leaderUser.put("USER_ID",pd.get("loginUserId"));
|
|
|
|
|
leaderUser.put("STATE","11");
|
|
|
|
|
leaderUser.put("TYPE","2");
|
|
|
|
|
leaderUser.put("ISDELETE","0");
|
|
|
|
|
leaderUser.put("FOREIGN_KEY",pd.get("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
leaderUser.put("CREATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("CREATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
leaderUser.put("OPERATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("OPERATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
|
|
|
|
|
PageData confinedleaderUser = new PageData(); // pd对接数据
|
|
|
|
|
confinedleaderUser.putAll(leaderUser);
|
|
|
|
|
dockData.put("dockDataleaderUser", JSON.toJSONString(confinedleaderUser));
|
|
|
|
|
|
|
|
|
|
hotWorkApplicationUserService.save(leaderUser); // 添加 动火后负责人
|
|
|
|
|
} else if("30".equals(pd.getString("STATE"))){ // 特级动火 -- 选择项目主管人员
|
|
|
|
|
PageData leaderUser = new PageData();
|
|
|
|
|
leaderUser.put("HOTWORKAPPLICATIONUSER_ID", UuidUtil.get32UUID());
|
|
|
|
|
leaderUser.put("USER_ID",pd.get("projectSupervisor_USER_ID"));
|
|
|
|
|
leaderUser.put("STATE","31");
|
|
|
|
|
leaderUser.put("TYPE","-1");
|
|
|
|
|
leaderUser.put("ISDELETE","0");
|
|
|
|
|
leaderUser.put("FOREIGN_KEY",pd.get("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
leaderUser.put("CREATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("CREATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
leaderUser.put("OPERATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("OPERATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
|
|
|
|
|
PageData confinedleaderUser = new PageData(); // pd对接数据
|
|
|
|
|
confinedleaderUser.putAll(leaderUser);
|
|
|
|
|
dockData.put("dockDataleaderUser", JSON.toJSONString(confinedleaderUser));
|
|
|
|
|
|
|
|
|
|
hotWorkApplicationUserService.save(leaderUser);
|
|
|
|
|
}else if("31".equals(pd.getString("STATE"))){ // 特级动火 -- 项目主管部门负责人
|
|
|
|
|
//防止打回后有多个意见
|
|
|
|
|
PageData leaderUser = new PageData();
|
|
|
|
|
leaderUser.put("HOTWORKAPPLICATIONUSER_ID", UuidUtil.get32UUID());
|
|
|
|
|
leaderUser.put("USER_ID",pd.get("projectPreliminarily_USER_ID"));
|
|
|
|
|
leaderUser.put("STATE","32");
|
|
|
|
|
leaderUser.put("TYPE","-1");
|
|
|
|
|
leaderUser.put("ISDELETE","0");
|
|
|
|
|
leaderUser.put("FOREIGN_KEY",pd.get("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
leaderUser.put("CREATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("CREATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
leaderUser.put("OPERATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("OPERATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
|
|
|
|
|
PageData confinedleaderUser = new PageData(); // pd对接数据
|
|
|
|
|
confinedleaderUser.putAll(leaderUser);
|
|
|
|
|
dockData.put("dockDataleaderUser", JSON.toJSONString(confinedleaderUser));
|
|
|
|
|
|
|
|
|
|
hotWorkApplicationUserService.save(leaderUser);
|
|
|
|
|
}else if("32".equals(pd.getString("STATE"))){ // 特级动火
|
|
|
|
|
PageData back = new PageData();
|
|
|
|
|
back.put("STATE","33");
|
|
|
|
|
back.put("FOREIGN_KEY",pd.get("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
|
|
|
|
|
PageData confinedback = new PageData(); // pd对接数据
|
|
|
|
|
confinedback.putAll(back);
|
|
|
|
|
dockData.put("dockDataback", JSON.toJSONString(confinedback));
|
|
|
|
|
|
|
|
|
|
hotWorkApplicationUserService.deleteForBack(back);
|
|
|
|
|
PageData leaderUser = new PageData();
|
|
|
|
|
leaderUser.put("HOTWORKAPPLICATIONUSER_ID", UuidUtil.get32UUID());
|
|
|
|
|
leaderUser.put("USER_ID",pd.get("inspectorGeneral_USER_ID"));
|
|
|
|
|
leaderUser.put("STATE","33");
|
|
|
|
|
leaderUser.put("TYPE","-1");
|
|
|
|
|
leaderUser.put("ISDELETE","0");
|
|
|
|
|
leaderUser.put("FOREIGN_KEY",pd.get("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
leaderUser.put("CREATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("CREATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
leaderUser.put("OPERATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("OPERATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
|
|
|
|
|
PageData confinedleaderUser = new PageData(); // pd对接数据
|
|
|
|
|
confinedleaderUser.putAll(leaderUser);
|
|
|
|
|
dockData.put("dockDataleaderUser", JSON.toJSONString(confinedleaderUser));
|
|
|
|
|
|
|
|
|
|
hotWorkApplicationUserService.save(leaderUser);
|
|
|
|
|
}else if("33".equals(pd.getString("STATE"))){ // 特级动火
|
|
|
|
|
PageData back = new PageData();
|
|
|
|
|
back.put("STATE","34");
|
|
|
|
|
back.put("FOREIGN_KEY",pd.get("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
|
|
|
|
|
PageData confinedback = new PageData(); // pd对接数据
|
|
|
|
|
confinedback.putAll(back);
|
|
|
|
|
dockData.put("dockDataback", JSON.toJSONString(confinedback));
|
|
|
|
|
|
|
|
|
|
hotWorkApplicationUserService.deleteForBack(back);
|
|
|
|
|
PageData leaderUser = new PageData();
|
|
|
|
|
leaderUser.put("HOTWORKAPPLICATIONUSER_ID", UuidUtil.get32UUID());
|
|
|
|
|
leaderUser.put("USER_ID",pd.get("officeResponsible_USER_ID"));
|
|
|
|
|
leaderUser.put("STATE","34");
|
|
|
|
|
leaderUser.put("TYPE","-1");
|
|
|
|
|
leaderUser.put("ISDELETE","0");
|
|
|
|
|
leaderUser.put("FOREIGN_KEY",pd.get("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
leaderUser.put("CREATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("CREATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
leaderUser.put("OPERATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("OPERATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
|
|
|
|
|
PageData confinedleaderUser = new PageData(); // pd对接数据
|
|
|
|
|
confinedleaderUser.putAll(leaderUser);
|
|
|
|
|
dockData.put("dockDataleaderUser", JSON.toJSONString(confinedleaderUser));
|
|
|
|
|
|
|
|
|
|
hotWorkApplicationUserService.save(leaderUser);
|
|
|
|
|
}else if("34".equals(pd.getString("STATE"))){ // 特级动火
|
|
|
|
|
PageData back = new PageData();
|
|
|
|
|
back.put("STATE","35");
|
|
|
|
|
back.put("FOREIGN_KEY",pd.get("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
|
|
|
|
|
PageData confinedback = new PageData(); // pd对接数据
|
|
|
|
|
confinedback.putAll(back);
|
|
|
|
|
dockData.put("dockDataback", JSON.toJSONString(confinedback));
|
|
|
|
|
|
|
|
|
|
hotWorkApplicationUserService.deleteForBack(back);
|
|
|
|
|
PageData leaderUser = new PageData();
|
|
|
|
|
leaderUser.put("HOTWORKAPPLICATIONUSER_ID", UuidUtil.get32UUID());
|
|
|
|
|
leaderUser.put("USER_ID",pd.get("supervision_USER_ID"));
|
|
|
|
|
leaderUser.put("STATE","35");
|
|
|
|
|
leaderUser.put("TYPE","-1");
|
|
|
|
|
leaderUser.put("ISDELETE","0");
|
|
|
|
|
leaderUser.put("FOREIGN_KEY",pd.get("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
leaderUser.put("CREATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("CREATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
leaderUser.put("OPERATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("OPERATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
|
|
|
|
|
PageData confinedleaderUser = new PageData(); // pd对接数据
|
|
|
|
|
confinedleaderUser.putAll(leaderUser);
|
|
|
|
|
dockData.put("dockDataleaderUser", JSON.toJSONString(confinedleaderUser));
|
|
|
|
|
|
|
|
|
|
hotWorkApplicationUserService.save(leaderUser);
|
|
|
|
|
if(Tools.notEmpty(pd.getString("supervision_USER_ID"))){
|
|
|
|
|
PageData mes = new PageData();
|
|
|
|
|
mes.put("SENDER_ID", pd.getString("loginUserId")); // 发送人员ID
|
|
|
|
|
mes.put("SENDER_NAME", pd.getString("loginUserId")); // 发送人员姓名
|
|
|
|
|
mes.put("SYNOPSIS", "友情提示:有一条特级动火数据需要初审"); // 站内信标题
|
|
|
|
|
mes.put("RECEIVER_ID", pd.getString("supervision_USER_ID")); // 接收人员ID
|
|
|
|
|
mes.put("CONTENT", "有一条特级动火数据在“安全监督部初审”,等您审核");// 站内信内容
|
|
|
|
|
|
|
|
|
|
PageData confinedmes = new PageData(); // pd对接数据
|
|
|
|
|
confinedmes.putAll(mes);
|
|
|
|
|
dockData.put("dockDatames", JSON.toJSONString(confinedmes));
|
|
|
|
|
|
|
|
|
|
noticeRegulatoryService.sendMessage(mes);
|
|
|
|
|
}
|
|
|
|
|
}else if("35".equals(pd.getString("STATE"))){ // 特级动火
|
|
|
|
|
PageData leaderUser = new PageData();
|
|
|
|
|
leaderUser.put("HOTWORKAPPLICATIONUSER_ID", UuidUtil.get32UUID());
|
|
|
|
|
leaderUser.put("USER_ID",pd.get("committee_USER_ID"));
|
|
|
|
|
leaderUser.put("STATE","36");
|
|
|
|
|
leaderUser.put("TYPE","-1");
|
|
|
|
|
leaderUser.put("ISDELETE","0");
|
|
|
|
|
leaderUser.put("FOREIGN_KEY",pd.get("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
leaderUser.put("CREATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("CREATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
leaderUser.put("OPERATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("OPERATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
|
|
|
|
|
PageData confinedleaderUser = new PageData(); // pd对接数据
|
|
|
|
|
confinedleaderUser.putAll(leaderUser);
|
|
|
|
|
dockData.put("dockDataleaderUser", JSON.toJSONString(confinedleaderUser));
|
|
|
|
|
|
|
|
|
|
hotWorkApplicationUserService.save(leaderUser);
|
|
|
|
|
}else if("36".equals(pd.getString("STATE"))){ // 特级动火
|
|
|
|
|
PageData leaderUser = new PageData();
|
|
|
|
|
leaderUser.put("HOTWORKAPPLICATIONUSER_ID", UuidUtil.get32UUID());
|
|
|
|
|
leaderUser.put("USER_ID",pd.get("safetyDirector_USER_ID"));
|
|
|
|
|
leaderUser.put("STATE","37");
|
|
|
|
|
leaderUser.put("TYPE","-1");
|
|
|
|
|
leaderUser.put("ISDELETE","0");
|
|
|
|
|
leaderUser.put("FOREIGN_KEY",pd.get("HOTWORKAPPLICATION_ID"));
|
|
|
|
|
leaderUser.put("CREATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("CREATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
leaderUser.put("OPERATOR",pd.getString("loginUserId"));
|
|
|
|
|
leaderUser.put("OPERATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
|
|
|
|
|
PageData confinedleaderUser = new PageData(); // pd对接数据
|
|
|
|
|
confinedleaderUser.putAll(leaderUser);
|
|
|
|
|
dockData.put("dockDataleaderUser", JSON.toJSONString(confinedleaderUser));
|
|
|
|
|
|
|
|
|
|
hotWorkApplicationUserService.save(leaderUser);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
map.put("result", "error");
|
|
|
|
|
map.put("msg", "未知审批状态!请联系管理员");
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
hotUser.put("OPERATOR",pd.getString("loginUserId"));
|
|
|
|
|
hotUser.put("OPERATTIME",DateUtil.date2Str(new Date()));
|
|
|
|
|
|
|
|
|
|
PageData confinedhotUser = new PageData(); // pd对接数据
|
|
|
|
|
confinedhotUser.putAll(hotUser);
|
|
|
|
|
dockData.put("dockDatahotUser", JSON.toJSONString(confinedhotUser));
|
|
|
|
|
|
|
|
|
|
hotWorkApplicationUserService.edit(hotUser);
|
|
|
|
|
this.sendNotice(pd);
|
|
|
|
|
map.put("dockData", JSON.toJSONString(dockData));
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 判断动火是否超时
|
|
|
|
|
public String judgeHotTime (PageData hot){
|
|
|
|
|
try {
|
|
|
|
|
if(hot.getString("STATE").equals("10")||
|
|
|
|
|
hot.getString("STATE").equals("11")){
|
|
|
|
|
return "true";
|
|
|
|
|
}
|
|
|
|
|
DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
|
|
if(!Tools.isEmpty(hot.getString("HOT_WORK_TIME_END"))){
|
|
|
|
|
String hotWorkTimeEnd = hot.getString("HOT_WORK_TIME_END"); //动火结束时间
|
|
|
|
|
long hotTimeEnd = fmt.parse(hotWorkTimeEnd).getTime();
|
|
|
|
|
long nowTime = new Date().getTime();
|
|
|
|
|
if(nowTime <= hotTimeEnd){
|
|
|
|
|
return "true";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
hot.put("STATE","-6");
|
|
|
|
|
hotworkapplicationService.editByState(hot);
|
|
|
|
|
messageService.sendMessageByParameter("HOT_MAIL_001", "友情提示:有一条动火申请过期",
|
|
|
|
|
hot.getString("CORPINFO_ID"),hot.getString("CREATOR"),hot.getString("HOTWORKAPPLICATION_ID"),
|
|
|
|
|
hot.getString("JOB_NUMBER"),fmt.format(new Date()),"","","");
|
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 特级动火审批
|
|
|
|
|
* @param files203
|
|
|
|
@ -1417,7 +2288,11 @@ public class HotWorkApplicationController extends BaseController {
|
|
|
|
|
}else if("2".equals(type)){ // 项目发包单位负责人
|
|
|
|
|
hot.put("PROJECT_UNIT_LEADER_NAME",userPageData.getString("userName"));
|
|
|
|
|
hot.put("PROJECT_UNIT_LEADER_ID",userPageData.getString("USER_ID"));
|
|
|
|
|
// }else if("4".equals(type)){ // 现场管辖单位负责人
|
|
|
|
|
}else if("4".equals(type)){ // 动火许可签发单位
|
|
|
|
|
hot.put("ISSUING_DEPARTMENT_ID",userPageData.getString("DEPARTMENT_ID"));
|
|
|
|
|
hot.put("ISSUING_DEPARTMENT_NAME",userPageData.getString("deptName"));
|
|
|
|
|
hot.put("ISSUING_USER_NAME",userPageData.getString("userName"));
|
|
|
|
|
hot.put("ISSUING_USER_ID",userPageData.getString("USER_ID"));
|
|
|
|
|
}else if("3".equals(type)){ // 现场管辖单位负责人
|
|
|
|
|
hot.put("UNIT_LEADER_DEPARTMENT_ID",userPageData.getString("DEPARTMENT_ID"));
|
|
|
|
|
hot.put("UNIT_LEADER_DEPARTMENT_NAME",userPageData.getString("deptName"));
|
|
|
|
|