Compare commits

..

No commits in common. "4fb481c1446a590a30459e87740fd70bbc4341c8" and "8b456819e745d5e368d390de1f6dba95ca5bd47e" have entirely different histories.

15 changed files with 12 additions and 1087 deletions

View File

@ -1,8 +1,6 @@
package com.zcloud.controller.bus;
import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.List;
@ -70,8 +68,6 @@ public class HotWorkApplicationController extends BaseController {
@Autowired
private DictionariesService dictionariesService;
@Autowired
private NoticeCorpService noticeCorpService;
/**
* @param
@ -80,397 +76,17 @@ 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
@ -1103,493 +719,6 @@ 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
@ -2288,11 +1417,7 @@ 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)){ // 动火许可签发单位
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("4".equals(type)){ // 现场管辖单位负责人
}else if("3".equals(type)){ // 现场管辖单位负责人
hot.put("UNIT_LEADER_DEPARTMENT_ID",userPageData.getString("DEPARTMENT_ID"));
hot.put("UNIT_LEADER_DEPARTMENT_NAME",userPageData.getString("deptName"));

View File

@ -322,53 +322,4 @@ public class RelevantUnitController extends BaseController {
map.put("result", errInfo);
return map;
}
/**
* @throws Exception
*/
@RequestMapping(value="/listAllForHotWork")
@ResponseBody
@Transactional
public Object listAllForHotWork() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
List<PageData> unitAllList = relevantunitService.listNameAll(pd); //列出RelevantUnit列表
PageData corp = new PageData();
corp.put("RELEVANTUNIT_ID",Jurisdiction.getCORPINFO_ID());
corp.put("id",Jurisdiction.getCORPINFO_ID());
corp.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID());
PageData corpName = corpinfoService.findById(corp);
corp.put("RELEVANT_NAME", corpName.getString("CORP_NAME"));
corp.put("label", corpName.getString("CORP_NAME"));
corp.put("nodeLevel", "0");
unitAllList.add(corp);
String endday = DateUtil.getDay();
PageData getPD = new PageData();
getPD.put("endday",endday);
getPD.put("KEYWORDS",pd.getString("KEYWORDS"));
getPD.put("DEPT_IDS",pd.getString("DEPT_IDS"));
List<PageData> userAllList = specialuserService.listAll(getPD);
if(!Tools.isEmpty(pd.get("CORPINFO_ID"))){
PageData corpinfo = new PageData();
corpinfo.put("CORPINFO_ID", pd.getString("CORPINFO_ID"));
corpinfo =corpinfoService.findById(corpinfo);
PageData addPd = new PageData();
if (!corpinfo.getString("CORP_NAME").equals("唐山曹妃甸煤炭港务有限公司")) {
addPd.put("RELEVANT_NAME",corpinfo.getString("CORP_NAME"));
addPd.put("label",corpinfo.getString("CORP_NAME"));
addPd.put("nodeLevel","0");
addPd.put("RELEVANTUNIT_ID",corpinfo.getString("CORPINFO_ID"));
addPd.put("id",corpinfo.getString("CORPINFO_ID"));
unitAllList.add(addPd);
}
}
map.put("varList", userAllList);
map.put("deptList", unitAllList);
map.put("result", errInfo);
return map;
}
}

View File

@ -488,7 +488,6 @@ public class OutSourcedController extends BaseController {
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("UserId", Jurisdiction.getUSER_ID());
if (!StringUtils.equals(Jurisdiction.getUSER_ID(), "c5187fb9565649a89267f9adf6b0fab6")) {
if (!StringUtils.equals(Jurisdiction.getCORPINFO_ID(), "1e6dbbe16004402f8d2c0e52afd9a676")
&& !StringUtils.equals(Jurisdiction.getCORPINFO_ID(), "3a854eefa7894e06aaa1a2611bca80f6")

View File

@ -58,7 +58,7 @@ public class UnitsController extends BaseController {
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("ISDELETE", "0"); //是否删除
Map result = HttpClientService.doPost(tongBuUrl + "/api/units/findByName", pd);
if (Tools.isEmpty(result) || result.get("pd")==null) {
if (result.get("pd")==null) {
if (null != file && !file.isEmpty()) {
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)) {

View File

@ -450,25 +450,6 @@ public class DepartmentController extends BaseController {
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/getById")
@ResponseBody
public Object getById() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd = departmentService.findById(pd); //根据ID读取
map.put("pd", pd); //放入视图容器
map.put("result", errInfo);
return map;
}
/**
*
*

View File

@ -1427,31 +1427,12 @@ public class UsersController extends BaseController {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
pd.put("DEPARTMENT_ID",pd.get("DEPARTMENT_ID[0]"));
List<PageData> userList = usersService.listAllUser(pd); //列出Post列表
map.put("userList", userList);
map.put("result", errInfo);
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/listAllForHotWork")
@ResponseBody
public Object listAllForHotWork() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
List<PageData> userList = usersService.listAllForHotWork(pd); //列出Post列表
map.put("userList", userList);
map.put("result", errInfo);
return map;
}
/**
* excel
*

View File

@ -89,8 +89,6 @@ public interface UsersMapper {
*/
List<PageData> listAllUser(PageData pd);
List<PageData> listAllForHotWork(PageData pd);
/**
* @param pd
* @return

View File

@ -160,8 +160,6 @@ public interface UsersService {
*/
public List<PageData> listAllUser(PageData pd)throws Exception;
public List<PageData> listAllForHotWork(PageData pd)throws Exception;
/**()
* @param page
* @return

View File

@ -237,10 +237,6 @@ public class UsersServiceImpl implements UsersService {
return usersMapper.listAllUser(pd);
}
public List<PageData> listAllForHotWork(PageData pd)throws Exception{
return usersMapper.listAllForHotWork(pd);
}
/**()
* @param page
* @return

View File

@ -199,10 +199,7 @@
<!-- 列表(全部) -->
<select id="listNameAll" parameterType="pd" resultType="pd">
select
RELEVANT_NAME,
RELEVANTUNIT_ID,
RELEVANT_NAME label,
RELEVANTUNIT_ID id
RELEVANT_NAME ,RELEVANTUNIT_ID
from
<include refid="tableName"></include> f
</select>

View File

@ -191,8 +191,7 @@
IF(f.USER_TYPE='1',corp.CORP_NAME,unit.RELEVANT_NAME) unitName,
cuser.USERNAME as cuserName ,
ccorp.CORP_NAME as corpName ,
poDic.NAME as operationName,
spType.NAME AS typeName
poDic.NAME as operationName
from
<include refid="tableName"></include> f
left join bus_relevantunit unit on unit.RELEVANTUNIT_ID = f.UNIT_ID<!-- 相关单位 -->
@ -200,7 +199,6 @@
left join sys_user cuser on cuser.USER_ID = f.CREATOR<!-- 添加人信息-->
left join bus_corp_info ccorp on ccorp.CORPINFO_ID = cuser.CORPINFO_ID <!-- 添加人信息 企业-->
left join sys_dictionaries poDic on poDic.DICTIONARIES_ID = f.OPERATION_TYPE <!-- 操作项目-->
LEFT JOIN sys_dictionaries spType ON spType.DICTIONARIES_ID = f.SPECIAL_TYPE
where f.ISDELETE = '0'
<if test="pd.keySpecialType != null and pd.keySpecialType != ''"><!-- 作业类别 -->
and f.SPECIAL_TYPE = #{pd.keySpecialType}
@ -274,8 +272,7 @@
cuser.USERNAME as cuserName ,
ccorp.CORP_NAME as corpName ,
poDic.NAME as operationName ,
count(1) OPERATE_COUNT,
spType.NAME as typeName
count(1) OPERATE_COUNT
from
<include refid="tableName"></include> f
left join bus_relevantunit unit on unit.RELEVANTUNIT_ID = f.UNIT_ID<!-- 相关单位 -->
@ -283,7 +280,6 @@
left join sys_user cuser on cuser.USER_ID = f.CREATOR<!-- 添加人信息-->
left join bus_corp_info ccorp on ccorp.CORPINFO_ID = cuser.CORPINFO_ID <!-- 添加人信息 企业-->
left join sys_dictionaries poDic on poDic.DICTIONARIES_ID = f.OPERATION_TYPE <!-- 操作项目-->
LEFT JOIN sys_dictionaries spType ON spType.DICTIONARIES_ID = f.SPECIAL_TYPE
where f.ISDELETE = '0'
<if test="pd.UNIT_ID != null and pd.UNIT_ID != ''"><!-- 作业类别 -->
and f.UNIT_ID = #{pd.UNIT_ID}
@ -298,25 +294,15 @@
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>,u.NAME as userName,dept.NAME as deptName,br.RELEVANT_NAME
<include refid="Field"></include>,u.NAME as userName,dept.NAME as deptName
from
<include refid="tableName"></include> f
left join SYS_USER u on u.USER_ID = f.USER_ID
left join oa_department dept on dept.DEPARTMENT_ID = u.DEPARTMENT_ID
left join bus_relevantunit br on br.RELEVANTUNIT_ID = f.UNIT_ID
where f.ISDELETE = '0'
<if test="KEYWORDS != null and KEYWORDS != ''"><!-- 关键词检索 -->
and
(
u.NAME LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
)
</if>
<if test="UNIT_ID != null and UNIT_ID != ''"><!-- 人员类型 -->
and f.UNIT_ID = #{UNIT_ID}
</if>
<if test="DEPT_IDS != null and DEPT_IDS != ''">
and FIND_IN_SET(f.UNIT_ID,#{DEPT_IDS})
</if>
<if test="endday != null and endday !=''">
and f.VALIDITY_TIME_END <![CDATA[ >= ]]> #{endday}
</if>

View File

@ -156,12 +156,12 @@
<include refid="Field"></include>,
u.NAME CREATORNAME,
d.NAME DEPARTMENTNAME,
group_concat(p.NAME) HOT_WORK_METHOD_NAME
p.name as HOT_WORK_METHOD_NAME
from
<include refid="tableName"></include> f
left join sys_user u on f.CREATOR = u.USER_ID
left join oa_department d on d.DEPARTMENT_ID = u.DEPARTMENT_ID
LEFT JOIN sys_dictionaries p ON FIND_IN_SET(p.DICTIONARIES_ID,f.HOT_WORK_METHOD_ID)
left join sys_dictionaries p on f.HOT_WORK_METHOD_ID = p.DICTIONARIES_ID
where
f.HOTWORKAPPLICATION_ID = #{HOTWORKAPPLICATION_ID}
</select>

View File

@ -339,11 +339,7 @@
)
</if>
GROUP BY f.INSPECTION_ID
ORDER BY
<if test="pd.checkType != null and pd.checkType = '0'">
field(f.INSPECTION_STATUS,'-1') DESC, field(f.INSPECTION_ORIGINATOR_ID,#{pd.loginUserId}) DESC,
</if>
f.CREATTIME DESC
ORDER BY f.CREATTIME DESC
</select>
<!-- 通过ID获取数据 -->
@ -714,7 +710,7 @@
)
</if>
GROUP BY f.INSPECTION_ID
ORDER BY field(f.INSPECTION_STATUS,'8') ASC, f.CREATTIME DESC
ORDER BY f.CREATTIME DESC
</select>
<select id="statisticsBranchGroupDept" parameterType="pd" resultType="pd">

View File

@ -755,87 +755,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by u.DEPARTMENT_ID asc, u.SORT asc,u.LAST_LOGIN desc
</select>
<!-- 用户列表(全部) -->
<select id="listAllForHotWork" parameterType="pd" resultType="pd" >
select u.USER_ID,
u.USERNAME,
u.PASSWORD,
u.LAST_LOGIN,
u.NAME,
u.IP,
u.EMAIL,
u.NUMBER,
u.PHONE,
r.ROLE_ID,
u.DEPARTMENT_ID,
o.NAME as PID_NAME,
o.PARENT_ID,
d.NAME as DEPARTMENT_NAME,
r.ROLE_NAME
from <include refid="tableName"></include> u
left join SYS_ROLE r on u.ROLE_ID = r.ROLE_ID
left join OA_DEPARTMENT d on d.DEPARTMENT_ID=u.DEPARTMENT_ID
left join OA_DEPARTMENT o ON o.DEPARTMENT_ID = d.PARENT_ID
where u.ROLE_ID = r.ROLE_ID
and u.USERNAME != 'admin' and u.USERNAME != '唐山曹妃甸煤炭港务有限公司' and u.ISDELETE = '0'
<!-- and r.PARENT_ID = '1' -->
<if test="KEYWORDS != null and KEYWORDS != ''"><!-- 关键词检索 -->
and
(
u.USERNAME LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
or
u.EMAIL LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
or
u.NUMBER LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
or
u.NAME LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
or
u.PHONE LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
)
</if>
<if test="ROLE_ID != null and ROLE_ID != ''"><!-- 角色检索 -->
and u.ROLE_ID=#{ROLE_ID}
</if>
<if test="STRARTTIME!=null and STRARTTIME!=''"><!-- 登录时间检索 -->
and u.LAST_LOGIN &gt;= #{STRARTTIME}
</if>
<if test="ENDTIME!=null and ENDTIME!=''"><!-- 登录时间检索 -->
and u.LAST_LOGIN &lt;= #{ENDTIME}
</if>
<if test="CORPINFO_ID != null and CORPINFO_ID != ''"><!-- 关键词检索 -->
AND
u.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="DEPARTMENT_ID != null and DEPARTMENT_ID != ''"><!-- 关键词检索 -->
AND
u.DEPARTMENT_ID = #{DEPARTMENT_ID}
</if>
<if test="POST_ID != null and POST_ID != ''"><!-- 关键词检索 -->
AND
u.POST_ID = #{POST_ID}
</if>
<if test="NOSELF != null and NOSELF != ''"><!-- 关键词检索 -->
AND
u.USER_ID != #{LOGINUSERID}
</if>
<if test="NOMAIN != null and NOMAIN != ''"><!-- 关键词检索 -->
AND
u.ISMAIN != '1'
</if>
<if test="ISMAIN != null and ISMAIN != ''"><!-- 关键词检索 -->
AND
u.ISMAIN =#{ISMAIN}
</if>
<if test="IS_HAZARDCONFIRMER != null and IS_HAZARDCONFIRMER != ''"><!-- 关键词检索 -->
AND
u.IS_HAZARDCONFIRMER =#{IS_HAZARDCONFIRMER}
</if>
<if test="IS_ONLINELEARNING != null and IS_ONLINELEARNING != ''"><!-- 隐患确认人 -->
AND u.IS_ONLINELEARNING =#{IS_ONLINELEARNING}
</if>
order by u.DEPARTMENT_ID asc, u.SORT asc,u.LAST_LOGIN desc
</select>
<!--获取全部用户信息列表-->
<select id="getAllUserList" resultType="com.zcloud.entity.PageData">
select

View File

@ -305,8 +305,7 @@
vua.NAME OUTSOURCED_CREATOR_NAME,
ifnull(vac.CORP_NAME,'秦港股份有限公司') CORP_NAME,
p.`NAME` as UNITS_PIC_NAME,
ifnull(h.HIDDEN_COUNT,0) HIDDEN_COUNT,
ifnull( h.CHECKED_COUNT, 0) CHECKED_COUNT
ifnull(h.HIDDEN_COUNT,0) HIDDEN_COUNT
from
<include refid="tableName"></include> f
left join bus_units b using (UNITS_ID)
@ -318,8 +317,7 @@
LEFT JOIN `qa-cmt-regulatory`.vi_all_corp vac on vua.CORPINFO_ID = vac.CORPINFO_ID
left join `qa-cmt-regulatory`.bus_personnelmanagement p on p.PERSONNELMANAGEMENT_ID = f.UNITS_PIC
LEFT JOIN ( select count(c.KEYPROJECTCHECK_ID) co, c.OUTSOURCED_ID from `qa-cmt-prevention`.BUS_KEYPROJECTCHECK c where c.ISDELETE = '0' group by c.OUTSOURCED_ID ) cc on cc.OUTSOURCED_ID = f.OUTSOURCED_ID
left join ( SELECT t.OUTSOURCED_ID, COUNT( t.HIDDEN_ID ) HIDDEN_COUNT,
COUNT( case when t.STATE = '2' and t.CREATOR = #{pd.UserId} then 1 end) CHECKED_COUNT
left join ( SELECT t.OUTSOURCED_ID, COUNT( t.HIDDEN_ID ) HIDDEN_COUNT
FROM
( SELECT IFNULL( k.OUTSOURCED_ID, h.FOREIGN_ID ) OUTSOURCED_ID, h.* FROM `qa-cmt-prevention`.bus_keyproject_hidden h LEFT JOIN `qa-cmt-prevention`.bus_keyprojectcheck k ON h.FOREIGN_ID = k.KEYPROJECTCHECK_ID ) t GROUP BY t.OUTSOURCED_ID ) h on h.OUTSOURCED_ID = f.OUTSOURCED_ID
where f.ISDELETE = '0'