短路功能迁移

pull/3/head
liujun 2023-12-13 13:02:20 +08:00
parent 515476f56a
commit 8e983a58a8
10 changed files with 1368 additions and 63 deletions

View File

@ -3,21 +3,26 @@ package com.zcloud.controller.gf;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.controller.base.BaseController;
import com.zcloud.dto.mq.Response;
import com.zcloud.dto.mq.TenCorpDto;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mq.service.SendMessageService;
import com.zcloud.mq.util.TenCorpConst;
import com.zcloud.service.gf.*;
import com.zcloud.util.*;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartRequest;
import javax.annotation.Resource;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -32,7 +37,9 @@ public class AppGFHotworkController extends BaseController {
@Resource
private GFHotworkService GFhotworkService;
@Resource
@Autowired
private GFHotworkAcceptUserService hotworkacceptuserService;
@Autowired
private GFHotworkLogService GFhotworkLogService;
@Resource
private GFHotworkToMeasuresService GFhotworkToMeasuresService;
@ -40,7 +47,14 @@ public class AppGFHotworkController extends BaseController {
private GFHotworkGasService GFhotworkGasService;
@Autowired
private SendMessageUtil sendMessageUtil;
/**
@Autowired
private Smb smb;
@Resource
private SendMessageService mqClient;
/**
*
*
* @param
* @throws Exception
*/
@ -76,10 +90,22 @@ public class AppGFHotworkController extends BaseController {
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("HOTWORK_ID", this.get32UUID()); //主键
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
PageData pd2 = new PageData();
Calendar calendar = Calendar.getInstance();
DecimalFormat dft=new DecimalFormat("00");
int year = calendar.get(Calendar.YEAR);
String month = dft.format(calendar.get(Calendar.MONTH) + 1);
String day = dft.format(calendar.get(Calendar.DAY_OF_MONTH));
pd2.put("CREATDATE",year + "-" + month + "-" + day);
pd2.put("CORPINFO_ID",pd.get("CORPINFO_ID"));
pd2 = GFhotworkService.getCode(pd2); //根据ID读取
String code = "DH" + year + month + day + dft.format((Integer.parseInt(pd2.get("code").toString()) + 1));
pd = this.getPageData();
pd.put("CHECK_NO", code);
pd.put("HOTWORK_ID", this.get32UUID()); //主键
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
GFhotworkService.save(pd);
if(pd.get("APPLY_STATUS").equals("1")) {
@ -120,14 +146,41 @@ public class AppGFHotworkController extends BaseController {
params4.put("value", "确认");// 存入上面参数名称所传递的值
paramsList.add(params4);
sendMessageUtil.sendMessages(mes, paramsList);
// 发短信
PageData mes1 = new PageData();
mes1.put("RECEIVER_ID", pd.get("ANALYZE_USER_ID"));// 收信人userid
mes1.put("templateCode", "DH_QT");// 短信模板编码
mes1.put("SMSCode", "SMS_223540753");// 短信模板编码
mes1.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList1 = new ArrayList<PageData>();
// 第1个参数
PageData params5 = new PageData();
params5.put("name", "params1");// 存入短信模板中的参数名称
params5.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList1.add(params5);
// 第2个参数
PageData params6 = new PageData();
params6.put("name", "params2");// 存入短信模板中的参数名称
params6.put("value", "动火作业");// 存入上面参数名称所传递的值
paramsList1.add(params6);
sendMessageUtil.sendMessages(mes1, paramsList1);
}
TenCorpDto tenCorpDto = new TenCorpDto();
tenCorpDto.setMark(pd.getString("HOTWORK_ID"));
tenCorpDto.setMark_name("HOTWORK_ID");
tenCorpDto.setTime_stamp(pd.getString("WORK_START_DATE") + ":00:000");
tenCorpDto.setTopic("eightWork");
tenCorpDto.setData(pd);
tenCorpDto.setMessage(TenCorpConst.hotWork);
mqClient.SendDelayQueue(tenCorpDto);
map.put("result", errInfo);
return map;
}
/**
* @param out
* @throws Exception
*/
@RequestMapping(value="/delete")
@ResponseBody
@ -194,6 +247,15 @@ public class AppGFHotworkController extends BaseController {
paramsList.add(params4);
sendMessageUtil.sendMessages(mes, paramsList);
}
TenCorpDto tenCorpDto = new TenCorpDto();
tenCorpDto.setMark(pd.getString("HOTWORK_ID"));
tenCorpDto.setMark_name("HOTWORK_ID");
tenCorpDto.setTime_stamp(pd.getString("WORK_START_DATE") + ":00:000");
tenCorpDto.setTopic("eightWork");
tenCorpDto.setData(pd);
tenCorpDto.setMessage(TenCorpConst.hotWork);
mqClient.SendDelayQueue(tenCorpDto);
map.put("result", errInfo);
return map;
}
@ -273,9 +335,7 @@ public class AppGFHotworkController extends BaseController {
@RequestMapping(value="/editAcceptconfess")
@ResponseBody
@Transactional
public Object editAcceptconfess(
@RequestParam(value="FFILE",required=false) MultipartFile[] files
) throws Exception {
public Object editAcceptconfess(MultipartRequest request) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
@ -284,23 +344,190 @@ public class AppGFHotworkController extends BaseController {
pd2 = GFhotworkService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
if (files != null && files.length > 0) {
MultipartFile file = files[0];
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME[] = pd.getString("SIGNTIME").split(",");
String ffile = DateUtil.getDays();
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
pd2.put("ACCEPT_CONFESS_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd2.put("ACCEPT_CONFESS_USER_SIGNER_TIME", pd.get("SIGNER_TIME"));
// pd2.put("GUARDIAN_CONTENT", pd.get("CONTENT"));
// pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
GFhotworkService.edit(pd2);
for (int i = 0; i < SIGNTIME.length; i++) {
signertime = SIGNTIME[i];
fileList.add(request.getFile("file" + i));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveImg(fileList.toArray(fileArr), signertime, pd.getString("HOTWORK_ID"), pd.getString("CORPINFO_ID"), pd.getString("ACCEPT_CONFESS_USER_ID"), pd.getString("ACCEPT_CONFESS_DEPARTMENT_ID"));
fileList.clear();
}
map.put("result", errInfo);
return map;
}
/**
private void saveImg(MultipartFile[] files, String signertime, String HOTWORK_ID, String CORPINFO_ID, String ACCEPT_CONFESS_USER_ID, String ACCEPT_CONFESS_DEPARTMENT_ID) throws Exception {
if (files != null && files.length > 0) {
for (int i = 0; i < files.length; i++) {
PageData pd = new PageData();
pd = this.getPageData();
MultipartFile file = files[i];
String ffile = DateUtil.getDays();
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
smb.sshSftp(file, fileName, Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile);
pd.put("ACCEPT_CONFESS_USER_SIGNER_TIME", signertime);
pd.put("ACCEPT_CONFESS_ID", this.get32UUID());
pd.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("ACCEPT_CONFESS_USER_SIGNER_PATH", Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile + "/" + fileName);
pd.put("ISDELETE", '0');
pd.put("CORPINFO_ID", CORPINFO_ID);
pd.put("HOTWORK_ID", HOTWORK_ID);
pd.put("ACCEPT_CONFESS_USER_ID", ACCEPT_CONFESS_USER_ID);
pd.put("ACCEPT_CONFESS_DEPARTMENT_ID", ACCEPT_CONFESS_DEPARTMENT_ID);
pd.put("ACCEPT_USER_ID","");
pd.put("ACCEPT_DEPARTMENT_ID", "");
hotworkacceptuserService.save(pd);
}
}
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/editAcceptStatus")
@ResponseBody
@Transactional
public Object editAcceptStatus(MultipartRequest request) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData pd2 = new PageData();
pd2 = GFhotworkService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
PageData log = new PageData();
log.put("HOTWORKLOG_ID", this.get32UUID());
// log.put("ACTION", "审核打回");
log.put("HOTWORK_ID", pd.get("HOTWORK_ID"));
log.put("CREATOR", pd.get("ACTION_USER"));
log.put("CREATTIME", DateUtil.date2Str(new Date()));
String status = pd.get("STATUS").toString();
if ("2".equals(status) || "3".equals(status) || "4".equals(status) || "5".equals(status) || "6".equals(status) || "7".equals(status)) {
pd2.put("OTHER_PROTECTIVE_MEASURES", (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") +
(StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;"));
} else if ("-2".equals(status) || "-3".equals(status) || "-4".equals(status) || "-5".equals(status) || "-6".equals(status) || "-7".equals(status) || "-8".equals(status)) {
//打回清空数据
pd2.put("OTHER_PROTECTIVE_MEASURES", "");
}
switch (status) {
case "8"://验收人
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME[] = pd.getString("SIGNTIME").split(",");
for (int i = 0; i < SIGNTIME.length; i++) {
signertime = SIGNTIME[i];
fileList.add(request.getFile("file" + i));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveAcceptImg(fileList.toArray(fileArr), signertime, pd.getString("HOTWORK_ID"), pd.getString("CORPINFO_ID"), pd.getString("ACCEPT_USER_ID"), pd.getString("ACCEPT_DEPARTMENT_ID"));
fileList.clear();
}
pd2.put("ACCEPT_CONTENT", pd.get("CONTENT"));
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
GFhotworkService.edit(pd2);
log.put("ACTION", "验收通过");
// 发短信
PageData mes = new PageData();
mes.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid
mes.put("templateCode", "DH_Y08");// 短信模板编码
mes.put("SMSCode", "SMS_227250920");// 短信模板编码
mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList = new ArrayList<PageData>();
// 第1个参数
PageData params1 = new PageData();
params1.put("name", "number");// 存入短信模板中的参数名称
params1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList.add(params1);
// 第2个参数
PageData params2 = new PageData();
params2.put("name", "type");// 存入短信模板中的参数名称
params2.put("value", "动火作业");// 存入上面参数名称所传递的值
paramsList.add(params2);
sendMessageUtil.sendMessages(mes, paramsList);
break;
case "-8"://审批打回
log.put("ACTION", "验收人打回");
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
pd2.put("ACCEPT_CONTENT", pd.get("CONTENT"));
GFhotworkService.edit(pd2);
// 发短信
PageData mes6 = new PageData();
mes6.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid
mes6.put("templateCode", "DH_N08");// 短信模板编码
mes6.put("SMSCode", "SMS_223580715");// 短信模板编码
mes6.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList6 = new ArrayList<PageData>();
// 第1个参数
PageData params19 = new PageData();
params19.put("name", "params1");// 存入短信模板中的参数名称
params19.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList6.add(params19);
// 第2个参数
PageData params20 = new PageData();
params20.put("name", "params2");// 存入短信模板中的参数名称
params20.put("value", "动火作业");// 存入上面参数名称所传递的值
paramsList6.add(params20);
// 第3个参数
PageData params21 = new PageData();
params21.put("name", "params3");// 存入短信模板中的参数名称
params21.put("value", "验收归档");// 存入上面参数名称所传递的值
paramsList6.add(params21);
sendMessageUtil.sendMessages(mes6, paramsList6);
break;
default:
break;
}
GFhotworkLogService.save(log);
map.put("result", errInfo);
return map;
}
private void saveAcceptImg(MultipartFile[] files,String signertime, String HOTWORK_ID, String CORPINFO_ID, String ACCEPT_USER_ID, String ACCEPT_DEPARTMENT_ID) throws Exception{
if (files != null && files.length > 0) {
for (int i = 0; i < files.length; i++) {
PageData cpd = new PageData();
cpd = this.getPageData();
MultipartFile file = files[i];
String ffile = DateUtil.getDays();
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
smb.sshSftp(file, fileName,Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile);
cpd.put("ACCEPT_USER_SIGNER_TIME", signertime);
cpd.put("ACCEPT_CONFESS_ID", this.get32UUID());
cpd.put("OPERATOR", cpd.get("OPERATOR")); //修改人
cpd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
cpd.put("ACCEPT_USER_SIGNER_PATH", Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile + "/" + fileName);
cpd.put("ISDELETE", '0');
cpd.put("CORPINFO_ID", CORPINFO_ID);
cpd.put("HOTWORK_ID", HOTWORK_ID);
cpd.put("ACCEPT_USER_ID", ACCEPT_USER_ID);
cpd.put("ACCEPT_CONFESS_DEPARTMENT_ID", "");
cpd.put("ACCEPT_CONFESS_USER_ID", "");
cpd.put("ACCEPT_DEPARTMENT_ID", ACCEPT_DEPARTMENT_ID);
hotworkacceptuserService.save(cpd);
}
}
}
/**
*
*
* @param
* @throws Exception
*/
@ -653,25 +880,25 @@ public class AppGFHotworkController extends BaseController {
paramsList.add(params4);
sendMessageUtil.sendMessages(mes, paramsList);
// 发短信
PageData mes1 = new PageData();
mes1.put("RECEIVER_ID", pd2.get("ANALYZE_USER_ID"));// 收信人userid
mes1.put("templateCode", "DH_QT");// 短信模板编码
mes1.put("SMSCode", "SMS_223540753");// 短信模板编码
mes1.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList1 = new ArrayList<PageData>();
// 第1个参数
PageData params5 = new PageData();
params5.put("name", "params1");// 存入短信模板中的参数名称
params5.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList1.add(params5);
// 第2个参数
PageData params6 = new PageData();
params6.put("name", "params2");// 存入短信模板中的参数名称
params6.put("value", "动火作业");// 存入上面参数名称所传递的值
paramsList1.add(params6);
sendMessageUtil.sendMessages(mes1, paramsList1);
// // 发短信
// PageData mes1 = new PageData();
// mes1.put("RECEIVER_ID", pd2.get("ANALYZE_USER_ID"));// 收信人userid
// mes1.put("templateCode", "DH_QT");// 短信模板编码
// mes1.put("SMSCode", "SMS_223540753");// 短信模板编码
// mes1.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id
// // 参数集合
// List<PageData> paramsList1 = new ArrayList<PageData>();
// // 第1个参数
// PageData params5 = new PageData();
// params5.put("name", "params1");// 存入短信模板中的参数名称
// params5.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值
// paramsList1.add(params5);
// // 第2个参数
// PageData params6 = new PageData();
// params6.put("name", "params2");// 存入短信模板中的参数名称
// params6.put("value", "动火作业");// 存入上面参数名称所传递的值
// paramsList1.add(params6);
// sendMessageUtil.sendMessages(mes1, paramsList1);
}
break;
@ -932,8 +1159,136 @@ public class AppGFHotworkController extends BaseController {
return map;
}
public static void main(String[] args) {
System.out.println(UuidUtil.get32UUID());
/**
*
*
*/
@PostMapping(value = "/cancel")
@ResponseBody
public void cancel(@RequestBody PageData pd) throws Exception {
Map<String, String> map = new HashMap<String, String>();
String errInfo = "success";
System.out.println(JSONObject.toJSONString(pd));
PageData cpd = new PageData();
cpd = GFhotworkService.findById(pd);
if (cpd != null && cpd.size() > 0 && cpd.getString("ANALYZE_TIME") != null && cpd.getString("MONITOR_USER_SIGNER_TIME") != null) {
// String WORK_START_DATE = pd.getString("WORK_START_DATE");
// String ANALYZE_TIME = cpd.getString("ANALYZE_TIME");
// String MONITOR_USER_SIGNER_TIME = cpd.getString("MONITOR_USER_SIGNER_TIME");
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
// System.out.println(WORK_START_DATE);
// System.out.println(ANALYZE_TIME);
// System.out.println(MONITOR_USER_SIGNER_TIME);
// System.out.println("-------------123----------");
// try {
// Date date1 = format.parse(WORK_START_DATE);
// Date date2 = format.parse(ANALYZE_TIME);
// Date date3 = format.parse(MONITOR_USER_SIGNER_TIME);
// long workTime = date1.getTime();
// long analyzeTime = date2.getTime();
// long monitorTime = date3.getTime();
// System.out.println(workTime - analyzeTime);
// System.out.println(analyzeTime - workTime);
// System.out.println(workTime - monitorTime);
// if (workTime - analyzeTime >= 0 && workTime - monitorTime >= 0) {
return;
// } else {
// hotworkService.cancel(pd);
// // 发短信
// PageData mes = new PageData();
// mes.put("RECEIVER_ID", pd.get("CONFIRM_USER_ID"));// 收信人userid
// mes.put("templateCode", "DH_ZF");// 短信模板编码
// mes.put("SMSCode", "SMS_462060039");// 短信模板编码
// mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id
// // 参数集合
// List<PageData> paramsList = new ArrayList<PageData>();
// // 第1个参数
// PageData params1 = new PageData();
// params1.put("name", "number");// 存入短信模板中的参数名称
// params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值
// paramsList.add(params1);
// // 第2个参数
// PageData params2 = new PageData();
// params2.put("name", "params1");// 存入短信模板中的参数名称
// params2.put("value", "动火作业");// 存入上面参数名称所传递的值
// paramsList.add(params2);
// sendMessageUtil.sendMessages(mes, paramsList);
// }
// } catch (ParseException e) {
// e.printStackTrace();
// }
}else if (cpd!=null && cpd.size()>0 && cpd.getString("ANALYZE_TIME") == null){
pd.put("APPLY_STATUS",-98);
GFhotworkService.cancel(pd);
PageData pd2 = new PageData();
pd2 = GFhotworkService.checkno(pd);
PageData pd3 = new PageData();
pd3.put("CHECK_NO",pd2.getString("CHECK_NO"));
pd3.put("CORPINFO_ID",pd.getString("CORPINFO_ID"));
GFhotworkService.editSpecialwork(pd3);
GFhotworkService.editSpecialwork1(pd3);
GFhotworkService.editSpecialwork2(pd3);
GFhotworkService.editSpecialwork3(pd3);
GFhotworkService.editSpecialwork4(pd3);
GFhotworkService.editSpecialwork5(pd3);
GFhotworkService.editSpecialwork6(pd3);
GFhotworkService.editSpecialwork7(pd3);
PageData mes = new PageData();
mes.put("RECEIVER_ID", pd.get("CONFIRM_USER_ID"));// 收信人userid
mes.put("templateCode", "DH_ZF1");// 短信模板编码
mes.put("SMSCode", "SMS_462060039");// 短信模板编码
mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList = new ArrayList<PageData>();
// 第1个参数
PageData params1 = new PageData();
params1.put("name", "number");// 存入短信模板中的参数名称
params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList.add(params1);
// 第2个参数
PageData params2 = new PageData();
params2.put("name", "params1");// 存入短信模板中的参数名称
params2.put("value", "动火作业");// 存入上面参数名称所传递的值
paramsList.add(params2);
sendMessageUtil.sendMessages(mes, paramsList);
}else if (cpd!=null && cpd.size()>0 && cpd.getString("ANALYZE_TIME") != null && cpd.getString("MONITOR_USER_SIGNER_TIME") == null){
pd.put("APPLY_STATUS",-99);
GFhotworkService.cancel(pd);
PageData pd2 = new PageData();
pd2 = GFhotworkService.checkno(pd);
PageData pd3 = new PageData();
pd3.put("CHECK_NO",pd2.getString("CHECK_NO"));
pd3.put("CORPINFO_ID",pd.getString("CORPINFO_ID"));
GFhotworkService.editSpecialwork(pd3);
GFhotworkService.editSpecialwork1(pd3);
GFhotworkService.editSpecialwork2(pd3);
GFhotworkService.editSpecialwork3(pd3);
GFhotworkService.editSpecialwork4(pd3);
GFhotworkService.editSpecialwork5(pd3);
GFhotworkService.editSpecialwork6(pd3);
GFhotworkService.editSpecialwork7(pd3);
PageData mes = new PageData();
mes.put("RECEIVER_ID", pd.get("CONFIRM_USER_ID"));// 收信人userid
mes.put("templateCode", "DH_ZF2");// 短信模板编码
mes.put("SMSCode", "SMS_462060039");// 短信模板编码
mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList = new ArrayList<PageData>();
// 第1个参数
PageData params1 = new PageData();
params1.put("name", "number");// 存入短信模板中的参数名称
params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList.add(params1);
// 第2个参数
PageData params2 = new PageData();
params2.put("name", "params1");// 存入短信模板中的参数名称
params2.put("value", "动火作业");// 存入上面参数名称所传递的值
paramsList.add(params2);
sendMessageUtil.sendMessages(mes, paramsList);
}
map.put("result", errInfo); //返回结果
return ;
}
/**
@ -1032,6 +1387,8 @@ public class AppGFHotworkController extends BaseController {
pd = GFhotworkService.findById(pd); //根据ID读取
map.put("measuresList", GFhotworkService.listAllMeasures(pd));
map.put("gasList", GFhotworkGasService.listAll(pd));
map.put("imgList",hotworkacceptuserService.findByIds(pd));
map.put("imgList1",hotworkacceptuserService.findById(pd));
map.put("pd", pd);
map.put("result", errInfo);
return map;
@ -1084,6 +1441,7 @@ public class AppGFHotworkController extends BaseController {
pd.put("HOTWORKGAS_ID", this.get32UUID()); //主键
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
GFhotworkGasService.save(pd);
GFhotworkService.edittime(pd);
map.put("result", errInfo); //返回结果
return map;
}

View File

@ -34,6 +34,8 @@ public class GFHotworkController extends BaseController {
private GFHotworkService GFhotworkService;
@Autowired
private GFHotworkGasService GFhotworkGasService;
@Autowired
private GFHotworkAcceptUserService hotworkacceptuserService;
/**
* @param
* @throws Exception
@ -53,7 +55,6 @@ public class GFHotworkController extends BaseController {
}
/**
* @param out
* @throws Exception
*/
@RequestMapping(value="/delete")
@ -132,6 +133,8 @@ public class GFHotworkController extends BaseController {
map.put("pd", pd);
map.put("measuresList", GFhotworkService.listAllMeasures(pd));
map.put("gasList", GFhotworkGasService.listAll(pd));
map.put("imgList",hotworkacceptuserService.findByIds(pd));
map.put("imgList1",hotworkacceptuserService.findById(pd));
map.put("result", errInfo);
return map;
}

View File

@ -0,0 +1,67 @@
package com.zcloud.mapper.datasource.gf;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2020-12-24
* www.zcloudchina.com
*/
public interface GFHotworkAcceptUserMapper {
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
* @param pd
* @throws Exception
*/
void delete(PageData pd);
/**
* @param pd
* @throws Exception
*/
void deleteList(PageData pd);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**
* @param page
* @throws Exception
*/
List<PageData> datalistPage(Page page);
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**id
* @param pd
* @throws Exception
*/
List<PageData> findById(PageData pd);
List<PageData> findByIds(PageData pd);
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
void deleteAll(String[] ArrayDATA_IDS);
List<PageData> listAllByIds(PageData pd);
}

View File

@ -52,6 +52,22 @@ public interface GFHotworkMapper{
*/
PageData findById(PageData pd);
void cancel(PageData pd);
PageData checkno(PageData pd);
void editSpecialwork(PageData pd);
void editSpecialwork1(PageData pd);
void editSpecialwork2(PageData pd);
void editSpecialwork3(PageData pd);
void editSpecialwork4(PageData pd);
void editSpecialwork5(PageData pd);
void editSpecialwork6(PageData pd);
void editSpecialwork7(PageData pd);
void edittime(PageData pd);
/**
* @param ArrayDATA_IDS
* @throws Exception

View File

@ -0,0 +1,67 @@
package com.zcloud.service.gf;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2020-12-24
* www.zcloudchina.com
*/
public interface GFHotworkAcceptUserService {
/**
* @param pd
* @throws Exception
*/
public void save(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void deleteList(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception;
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception;
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception;
/**id
* @param pd
* @throws Exception
*/
public List<PageData> findById(PageData pd)throws Exception;
public List<PageData> findByIds(PageData pd)throws Exception;
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
public List<PageData> listAllByIds(PageData pd)throws Exception;
}

View File

@ -51,6 +51,21 @@ public interface GFHotworkService{
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception;
public void cancel(PageData pd)throws Exception;
public PageData checkno(PageData pd)throws Exception;
public void editSpecialwork(PageData pd)throws Exception;
public void editSpecialwork1(PageData pd)throws Exception;
public void editSpecialwork2(PageData pd)throws Exception;
public void editSpecialwork3(PageData pd)throws Exception;
public void editSpecialwork4(PageData pd)throws Exception;
public void editSpecialwork5(PageData pd)throws Exception;
public void editSpecialwork6(PageData pd)throws Exception;
public void editSpecialwork7(PageData pd)throws Exception;
public void edittime(PageData pd)throws Exception;
/**
* @param ArrayDATA_IDS

View File

@ -0,0 +1,102 @@
package com.zcloud.service.gf.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.gf.GFHotworkAcceptUserMapper;
import com.zcloud.service.gf.GFHotworkAcceptUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* luoxiaobao
* 2020-12-24
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class GFHotworkAcceptUserServiceImpl implements GFHotworkAcceptUserService {
@Autowired
private GFHotworkAcceptUserMapper hotworkacceptuserMapper;
/**
* @param pd
* @throws Exception
*/
public void save(PageData pd)throws Exception{
hotworkacceptuserMapper.save(pd);
}
/**
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception{
hotworkacceptuserMapper.delete(pd);
}
/**
* @param pd
* @throws Exception
*/
public void deleteList(PageData pd)throws Exception{
hotworkacceptuserMapper.deleteList(pd);
}
/**
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception{
hotworkacceptuserMapper.edit(pd);
}
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception{
return hotworkacceptuserMapper.datalistPage(page);
}
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception{
return hotworkacceptuserMapper.listAll(pd);
}
/**id
* @param pd
* @throws Exception
*/
public List<PageData> findById(PageData pd)throws Exception{
return hotworkacceptuserMapper.findById(pd);
}
public List<PageData> findByIds(PageData pd)throws Exception{
return hotworkacceptuserMapper.findByIds(pd);
}
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
hotworkacceptuserMapper.deleteAll(ArrayDATA_IDS);
}
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAllByIds(PageData pd)throws Exception{
return hotworkacceptuserMapper.listAllByIds(pd);
}
}

View File

@ -80,6 +80,42 @@ public class GFHotworkServiceImpl implements GFHotworkService {
return GFhotworkMapper.findById(pd);
}
public void cancel(PageData pd)throws Exception{
GFhotworkMapper.cancel(pd);
}
public PageData checkno(PageData pd)throws Exception{
return GFhotworkMapper.checkno(pd);
}
public void editSpecialwork(PageData pd)throws Exception{
GFhotworkMapper.editSpecialwork(pd);
}
public void editSpecialwork1(PageData pd)throws Exception{
GFhotworkMapper.editSpecialwork1(pd);
}
public void editSpecialwork2(PageData pd)throws Exception{
GFhotworkMapper.editSpecialwork2(pd);
}
public void editSpecialwork3(PageData pd)throws Exception{
GFhotworkMapper.editSpecialwork3(pd);
}
public void editSpecialwork4(PageData pd)throws Exception{
GFhotworkMapper.editSpecialwork4(pd);
}
public void editSpecialwork5(PageData pd)throws Exception{
GFhotworkMapper.editSpecialwork5(pd);
}
public void editSpecialwork6(PageData pd)throws Exception{
GFhotworkMapper.editSpecialwork6(pd);
}
public void editSpecialwork7(PageData pd)throws Exception{
GFhotworkMapper.editSpecialwork7(pd);
}
public void edittime(PageData pd)throws Exception{
GFhotworkMapper.edittime(pd);
}
/**
* @param ArrayDATA_IDS
* @throws Exception

View File

@ -0,0 +1,217 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zcloud.mapper.datasource.gf.GFHotworkAcceptUserMapper">
<!--表名 -->
<sql id="tableName">
GF_HOTWORK_ACCEPTUSER
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<sql id="Field">
f.ACCEPT_CONFESS_ID,
f.HOTWORK_ID,
f.CORPINFO_ID,
f.ISDELETE,
f.OPERATTIME,
f.OPERATOR,
f.ACCEPT_CONFESS_DEPARTMENT_ID,
f.ACCEPT_CONFESS_USER_ID,
f.ACCEPT_CONFESS_USER_SIGNER_PATH,
f.ACCEPT_CONFESS_USER_SIGNER_TIME,
f.ISSELF,
f.ACCEPT_USER_ID,
f.ACCEPT_USER_SIGNER_PATH,
f.ACCEPT_USER_SIGNER_TIME,
f.ACCEPT_DEPARTMENT_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
ACCEPT_CONFESS_ID,
HOTWORK_ID,
CORPINFO_ID,
ISDELETE,
OPERATTIME,
OPERATOR,
ACCEPT_CONFESS_DEPARTMENT_ID,
ACCEPT_CONFESS_USER_ID,
ACCEPT_CONFESS_USER_SIGNER_PATH,
ACCEPT_CONFESS_USER_SIGNER_TIME,
ISSELF,
ACCEPT_USER_ID,
ACCEPT_USER_SIGNER_PATH,
ACCEPT_USER_SIGNER_TIME,
ACCEPT_DEPARTMENT_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{ACCEPT_CONFESS_ID},
#{HOTWORK_ID},
#{CORPINFO_ID},
#{ISDELETE},
#{OPERATTIME},
#{OPERATOR},
#{ACCEPT_CONFESS_DEPARTMENT_ID},
#{ACCEPT_CONFESS_USER_ID},
#{ACCEPT_CONFESS_USER_SIGNER_PATH},
#{ACCEPT_CONFESS_USER_SIGNER_TIME},
#{ISSELF},
#{ACCEPT_USER_ID},
#{ACCEPT_USER_SIGNER_PATH},
#{ACCEPT_USER_SIGNER_TIME},
#{ACCEPT_DEPARTMENT_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
delete from
<include refid="tableName"></include>
where
ACCEPT_CONFESS_ID = #{ACCEPT_CONFESS_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
ACCEPT_CONFESS_ID = #{ACCEPT_CONFESS_ID},
HOTWORK_ID = #{HOTWORK_ID},
CORPINFO_ID = #{CORPINFO_ID},
OPERATTIME = #{OPERATTIME},
OPERATOR = #{OPERATOR},
ACCEPT_CONFESS_DEPARTMENT_ID = #{ACCEPT_CONFESS_DEPARTMENT_ID},
ACCEPT_CONFESS_USER_ID = #{ACCEPT_CONFESS_USER_ID},
ACCEPT_CONFESS_USER_SIGNER_PATH = #{ACCEPT_CONFESS_USER_SIGNER_PATH},
ACCEPT_CONFESS_USER_SIGNER_TIME = #{ACCEPT_CONFESS_USER_SIGNER_TIME},
ISSELF = #{ISSELF}
where
ACCEPT_CONFESS_ID = #{ACCEPT_CONFESS_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
f.ACCEPT_CONFESS_ID,
f.HOTWORK_ID,
f.CORPINFO_ID,
f.ISDELETE,
f.OPERATTIME,
f.OPERATOR,
f.ACCEPT_USER_ID,
f.ACCEPT_USER_SIGNER_PATH,
f.ACCEPT_USER_SIGNER_TIME,
f.ACCEPT_DEPARTMENT_ID
from
<include refid="tableName"></include> f
where
f.HOTWORK_ID = #{HOTWORK_ID} and f.CORPINFO_ID = #{CORPINFO_ID} and f.ACCEPT_USER_ID = #{ACCEPT_USER_ID}
order by f.ACCEPT_USER_SIGNER_TIME asc
</select>
<select id="findByIds" parameterType="pd" resultType="pd">
select
f.ACCEPT_CONFESS_ID,
f.HOTWORK_ID,
f.CORPINFO_ID,
f.ISDELETE,
f.OPERATTIME,
f.OPERATOR,
f.ACCEPT_CONFESS_DEPARTMENT_ID,
f.ACCEPT_CONFESS_USER_ID,
f.ACCEPT_CONFESS_USER_SIGNER_PATH,
f.ACCEPT_CONFESS_USER_SIGNER_TIME
from
<include refid="tableName"></include> f
where
f.HOTWORK_ID = #{HOTWORK_ID} and f.CORPINFO_ID = #{CORPINFO_ID} and f.ACCEPT_CONFESS_USER_ID = #{ACCEPT_CONFESS_USER_ID}
order by f.ACCEPT_CONFESS_USER_SIGNER_TIME asc
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0'
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- 根据需求自己加检索条件
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where 1=1
<if test="ISSELF != null and ISSELF != ''"><!-- 关键词检索 -->
and
f.ISSELF=#{ISSELF}
</if>
<if test="HOTWORK_ID != null and HOTWORK_ID != ''"><!-- 关键词检索 -->
and
f.HOTWORK_ID=#{HOTWORK_ID}
</if>
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="String">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
ACCEPT_CONFESS_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 列表 -->
<select id="listAllByIds" parameterType="String" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where 1=1
<if test="ArrayDATA_IDS != null and ArrayDATA_IDS != ''"><!-- 关键词检索 -->
and f.ACCEPT_CONFESS_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>

View File

@ -85,7 +85,8 @@
f.ACCEPT_CONFESS_DEPARTMENT_ID,
f.ACCEPT_CONFESS_USER_ID,
f.ACCEPT_CONFESS_USER_SIGNER_PATH,
f.ACCEPT_CONFESS_USER_SIGNER_TIME
f.ACCEPT_CONFESS_USER_SIGNER_TIME,
f.ANALYZE_TIME
</sql>
<!-- 字段用于新增 -->
@ -161,7 +162,8 @@
ACCEPT_CONFESS_DEPARTMENT_ID,
ACCEPT_CONFESS_USER_ID,
ACCEPT_CONFESS_USER_SIGNER_PATH,
ACCEPT_CONFESS_USER_SIGNER_TIME
ACCEPT_CONFESS_USER_SIGNER_TIME,
ANALYZE_TIME
</sql>
<!-- 字段值 -->
@ -237,7 +239,8 @@
#{ACCEPT_CONFESS_DEPARTMENT_ID},
#{ACCEPT_CONFESS_USER_ID},
#{ACCEPT_CONFESS_USER_SIGNER_PATH},
#{ACCEPT_CONFESS_USER_SIGNER_TIME}
#{ACCEPT_CONFESS_USER_SIGNER_TIME},
#{ANALYZE_TIME}
</sql>
<!-- 新增-->
@ -260,7 +263,14 @@
where
HOTWORK_ID = #{HOTWORK_ID}
</delete>
<update id="edittime" parameterType="pd">
update
<include refid="tableName"></include>
set
ANALYZE_TIME = #{ANALYZE_TIME}
where
HOTWORK_ID = #{HOTWORK_ID}
</update>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
@ -342,6 +352,105 @@
HOTWORK_ID = #{HOTWORK_ID}
</update>
<update id="cancel" parameterType="pd">
update
<include refid="tableName"></include>
set
APPLY_STATUS = #{APPLY_STATUS}
where
HOTWORK_ID = #{HOTWORK_ID}
</update>
<select id="checkno" parameterType="pd" resultType="pd">
SELECT
CONCAT_WS( " ", "动火作业", f.CHECK_NO ) AS CHECK_NO
FROM
<include refid="tableName"></include> f
WHERE
f.HOTWORK_ID = #{HOTWORK_ID}
AND f.ISDELETE = '0'
</select>
<update id="editSpecialwork" parameterType = "pd">
update
bus_confinedspace f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork1" parameterType = "pd">
update
bus_blindboard f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork2" parameterType = "pd">
update
bus_electricity f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork3" parameterType = "pd">
update
bus_hoisting f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork4" parameterType = "pd">
update
bus_breakground f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork5" parameterType = "pd">
update
bus_cutroad f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork6" parameterType = "pd">
update
bus_highwork f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork7" parameterType = "pd">
update
bus_hotwork f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
@ -353,8 +462,8 @@
f.OPERATOR,
f.CHECK_NO,
f.WORK_CONTENT,
f.WORK_START_DATE,
f.WORK_END_DATE,
replace(f.WORK_START_DATE,'-','/') as WORK_START_DATE,
replace(f.WORK_END_DATE,'-','/') as WORK_END_DATE,
f.CONFIRM_DEPARTMENT_ID,
f.CONFIRM_USER_ID,
f.CONFIRM_USER_SIGNER_PATH,
@ -368,6 +477,10 @@
f.APPROVE_USER_SIGNER_PATH,
f.APPROVE_USER_SIGNER_TIME,
f.APPLY_STATUS,
(SELECT replace(a.ANALYZE_TIME,'-','/') from bus_hotworkgas a where a.ISDELETE = '0'
AND a.HOTWORK_ID = #{HOTWORK_ID}
ORDER BY
a.ANALYZE_TIME DESC LIMIT 1) as ANALYZE_TIME,
IFNULL(f.CONFIRM_CONTENT,'无') as CONFIRM_CONTENT,
IFNULL(f.AUDIT_CONTENT,'无') as AUDIT_CONTENT,
IFNULL(f.APPROVE_CONTENT,'无') as APPROVE_CONTENT,
@ -382,7 +495,7 @@
f.WORK_PLACE,
f.WORK_LEVEL,
f.WORK_USER,
f.SPECIAL_WORK,
IFNULL(f.SPECIAL_WORK,'无') as SPECIAL_WORK,
f.RISK_IDENTIFICATION,
f.WORK_MANAGER,
f.ANALYZE_DEPARTMENT_ID,
@ -490,7 +603,87 @@
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>,
f.CORPINFO_ID,
f.ISDELETE,
f.CREATTIME,
f.CREATOR,
f.OPERATTIME,
f.OPERATOR,
f.CHECK_NO,
f.WORK_CONTENT,
f.WORK_START_DATE,
f.WORK_END_DATE,
f.CONFIRM_DEPARTMENT_ID,
f.CONFIRM_USER_ID,
f.CONFIRM_USER_SIGNER_PATH,
f.CONFIRM_USER_SIGNER_TIME,
f.AUDIT_DEPARTMENT_ID,
f.AUDIT_USER_ID,
f.AUDIT_USER_SIGNER_PATH,
f.AUDIT_USER_SIGNER_TIME,
f.APPROVE_DEPARTMENT_ID,
f.APPROVE_USER_ID,
f.APPROVE_USER_SIGNER_PATH,
f.APPROVE_USER_SIGNER_TIME,
f.APPLY_STATUS,
f.CONFIRM_CONTENT,
f.AUDIT_CONTENT,
f.APPROVE_CONTENT,
f.OTHER_PROTECTIVE_MEASURES,
f.ACCEPT_DEPARTMENT_ID,
f.ACCEPT_USER_ID,
f.ACCEPT_USER_SIGNER_PATH,
f.ACCEPT_USER_SIGNER_TIME,
f.ACCEPT_CONTENT,
f.APPLY_DEPARTMENT_ID,
f.APPLY_USER_ID,
f.WORK_PLACE,
f.WORK_LEVEL,
f.WORK_USER,
f.SPECIAL_WORK,
f.RISK_IDENTIFICATION,
f.WORK_MANAGER,
f.ANALYZE_DEPARTMENT_ID,
f.ANALYZE_USER_ID,
f.GUARDIAN_DEPARTMENT_ID,
f.GUARDIAN_USER_ID,
f.GUARDIAN_USER_SIGNER_PATH,
f.GUARDIAN_USER_SIGNER_TIME,
f.GUARDIAN_CONTENT,
f.LEADER_DEPARTMENT_ID,
f.LEADER_USER_ID,
f.LEADER_USER_SIGNER_PATH,
f.LEADER_USER_SIGNER_TIME,
f.LEADER_CONTENT,
f.MONITOR_DEPARTMENT_ID,
f.MONITOR_USER_ID,
f.MONITOR_USER_SIGNER_PATH,
f.MONITOR_USER_SIGNER_TIME,
f.MONITOR_CONTENT,
f.CONFESS_USER,
f.EDUCATE_USER,
f.ACCEPT_EDUCATE_USER,
f.TRIAL_USER,
f.WORK_FUNCTION,
f.GUARDIAN_USER,
f.HOTWORK_ID,
f.CONFESS_DEPARTMENT_ID,
f.CONFESS_USER_ID,
f.CONFESS_USER_SIGNER_PATH,
f.CONFESS_USER_SIGNER_TIME,
f.ACCEPT_CONFESS_DEPARTMENT_ID,
f.ACCEPT_CONFESS_USER_ID,
IFNULL((SELECT replace(a.ANALYZE_TIME,'-','/') from bus_hotworkgas a where a.ISDELETE = '0'
AND a.HOTWORK_ID = f.HOTWORK_ID
ORDER BY
a.ANALYZE_TIME DESC LIMIT 1),'无') as ANALYZE_TIME,
(SELECT a.ACCEPT_CONFESS_USER_SIGNER_TIME from BUS_HOTWORK_ACCEPTUSER a where a.ISDELETE = '0'
AND a.HOTWORK_ID = f.HOTWORK_ID
ORDER BY
a.ACCEPT_CONFESS_USER_SIGNER_TIME DESC LIMIT 1) as ACCEPT_CONFESS_USER_SIGNER_TIME,
ad.NAME as APPLY_DEPARTMENT_NAME,
getFullName(ad.DEPARTMENT_ID) APPLY_DEPARTMENT_ALL,
au.NAME as APPLY_USER_NAME,
@ -562,7 +755,9 @@
<if test="pd.APPLY_STATUS != null and pd.APPLY_STATUS != ''">
and f.APPLY_STATUS = #{pd.APPLY_STATUS}
</if>
<if test="pd.IS_GAS != null and pd.IS_GAS != ''">
and f.APPLY_STATUS in ('1','2','4','5','6')
</if>
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''">
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</if>
@ -667,7 +862,82 @@
</select>
<select id="aqdatalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>,
f.CORPINFO_ID,
f.ISDELETE,
f.CREATTIME,
f.CREATOR,
f.OPERATTIME,
f.OPERATOR,
f.CHECK_NO,
f.WORK_CONTENT,
f.WORK_START_DATE,
f.WORK_END_DATE,
f.CONFIRM_DEPARTMENT_ID,
f.CONFIRM_USER_ID,
f.CONFIRM_USER_SIGNER_PATH,
f.CONFIRM_USER_SIGNER_TIME,
f.AUDIT_DEPARTMENT_ID,
f.AUDIT_USER_ID,
f.AUDIT_USER_SIGNER_PATH,
f.AUDIT_USER_SIGNER_TIME,
f.APPROVE_DEPARTMENT_ID,
f.APPROVE_USER_ID,
f.APPROVE_USER_SIGNER_PATH,
f.APPROVE_USER_SIGNER_TIME,
f.APPLY_STATUS,
f.CONFIRM_CONTENT,
f.AUDIT_CONTENT,
f.APPROVE_CONTENT,
f.OTHER_PROTECTIVE_MEASURES,
f.ACCEPT_DEPARTMENT_ID,
f.ACCEPT_USER_ID,
f.ACCEPT_USER_SIGNER_PATH,
f.ACCEPT_USER_SIGNER_TIME,
f.ACCEPT_CONTENT,
f.APPLY_DEPARTMENT_ID,
f.APPLY_USER_ID,
f.WORK_PLACE,
f.WORK_LEVEL,
f.WORK_USER,
f.SPECIAL_WORK,
f.RISK_IDENTIFICATION,
f.WORK_MANAGER,
f.ANALYZE_DEPARTMENT_ID,
f.ANALYZE_USER_ID,
f.GUARDIAN_DEPARTMENT_ID,
f.GUARDIAN_USER_ID,
f.GUARDIAN_USER_SIGNER_PATH,
f.GUARDIAN_USER_SIGNER_TIME,
f.GUARDIAN_CONTENT,
f.LEADER_DEPARTMENT_ID,
f.LEADER_USER_ID,
f.LEADER_USER_SIGNER_PATH,
f.LEADER_USER_SIGNER_TIME,
f.LEADER_CONTENT,
f.MONITOR_DEPARTMENT_ID,
f.MONITOR_USER_ID,
f.MONITOR_USER_SIGNER_PATH,
f.MONITOR_USER_SIGNER_TIME,
f.MONITOR_CONTENT,
f.CONFESS_USER,
f.EDUCATE_USER,
f.ACCEPT_EDUCATE_USER,
f.TRIAL_USER,
f.WORK_FUNCTION,
f.GUARDIAN_USER,
f.HOTWORK_ID,
f.CONFESS_DEPARTMENT_ID,
f.CONFESS_USER_ID,
f.CONFESS_USER_SIGNER_PATH,
f.CONFESS_USER_SIGNER_TIME,
f.ACCEPT_CONFESS_DEPARTMENT_ID,
f.ACCEPT_CONFESS_USER_ID,
f.ANALYZE_TIME,
(SELECT a.ACCEPT_CONFESS_USER_SIGNER_TIME from BUS_HOTWORK_ACCEPTUSER a where a.ISDELETE = '0'
AND a.HOTWORK_ID = f.HOTWORK_ID
ORDER BY
a.ACCEPT_CONFESS_USER_SIGNER_TIME DESC LIMIT 1) as ACCEPT_CONFESS_USER_SIGNER_TIME,
ad.NAME as APPLY_DEPARTMENT_NAME,
getFullName(ad.DEPARTMENT_ID) APPLY_DEPARTMENT_ALL,
au.NAME as APPLY_USER_NAME,
@ -842,7 +1112,82 @@
</select>
<select id="jhdatalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>,
f.CORPINFO_ID,
f.ISDELETE,
f.CREATTIME,
f.CREATOR,
f.OPERATTIME,
f.OPERATOR,
f.CHECK_NO,
f.WORK_CONTENT,
f.WORK_START_DATE,
f.WORK_END_DATE,
f.CONFIRM_DEPARTMENT_ID,
f.CONFIRM_USER_ID,
f.CONFIRM_USER_SIGNER_PATH,
f.CONFIRM_USER_SIGNER_TIME,
f.AUDIT_DEPARTMENT_ID,
f.AUDIT_USER_ID,
f.AUDIT_USER_SIGNER_PATH,
f.AUDIT_USER_SIGNER_TIME,
f.APPROVE_DEPARTMENT_ID,
f.APPROVE_USER_ID,
f.APPROVE_USER_SIGNER_PATH,
f.APPROVE_USER_SIGNER_TIME,
f.APPLY_STATUS,
f.CONFIRM_CONTENT,
f.AUDIT_CONTENT,
f.APPROVE_CONTENT,
f.OTHER_PROTECTIVE_MEASURES,
f.ACCEPT_DEPARTMENT_ID,
f.ACCEPT_USER_ID,
f.ACCEPT_USER_SIGNER_PATH,
f.ACCEPT_USER_SIGNER_TIME,
f.ACCEPT_CONTENT,
f.APPLY_DEPARTMENT_ID,
f.APPLY_USER_ID,
f.WORK_PLACE,
f.WORK_LEVEL,
f.WORK_USER,
f.SPECIAL_WORK,
f.RISK_IDENTIFICATION,
f.WORK_MANAGER,
f.ANALYZE_DEPARTMENT_ID,
f.ANALYZE_USER_ID,
f.GUARDIAN_DEPARTMENT_ID,
f.GUARDIAN_USER_ID,
f.GUARDIAN_USER_SIGNER_PATH,
f.GUARDIAN_USER_SIGNER_TIME,
f.GUARDIAN_CONTENT,
f.LEADER_DEPARTMENT_ID,
f.LEADER_USER_ID,
f.LEADER_USER_SIGNER_PATH,
f.LEADER_USER_SIGNER_TIME,
f.LEADER_CONTENT,
f.MONITOR_DEPARTMENT_ID,
f.MONITOR_USER_ID,
f.MONITOR_USER_SIGNER_PATH,
f.MONITOR_USER_SIGNER_TIME,
f.MONITOR_CONTENT,
f.CONFESS_USER,
f.EDUCATE_USER,
f.ACCEPT_EDUCATE_USER,
f.TRIAL_USER,
f.WORK_FUNCTION,
f.GUARDIAN_USER,
f.HOTWORK_ID,
f.CONFESS_DEPARTMENT_ID,
f.CONFESS_USER_ID,
f.CONFESS_USER_SIGNER_PATH,
f.CONFESS_USER_SIGNER_TIME,
f.ACCEPT_CONFESS_DEPARTMENT_ID,
f.ACCEPT_CONFESS_USER_ID,
f.ANALYZE_TIME,
(SELECT a.ACCEPT_CONFESS_USER_SIGNER_TIME from BUS_HOTWORK_ACCEPTUSER a where a.ISDELETE = '0'
AND a.HOTWORK_ID = f.HOTWORK_ID
ORDER BY
a.ACCEPT_CONFESS_USER_SIGNER_TIME DESC LIMIT 1) as ACCEPT_CONFESS_USER_SIGNER_TIME,
ad.NAME as APPLY_DEPARTMENT_NAME,
getFullName(ad.DEPARTMENT_ID) APPLY_DEPARTMENT_ALL,
au.NAME as APPLY_USER_NAME,
@ -1016,7 +1361,82 @@
</select>
<select id="jsdatalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>,
f.CORPINFO_ID,
f.ISDELETE,
f.CREATTIME,
f.CREATOR,
f.OPERATTIME,
f.OPERATOR,
f.CHECK_NO,
f.WORK_CONTENT,
f.WORK_START_DATE,
f.WORK_END_DATE,
f.CONFIRM_DEPARTMENT_ID,
f.CONFIRM_USER_ID,
f.CONFIRM_USER_SIGNER_PATH,
f.CONFIRM_USER_SIGNER_TIME,
f.AUDIT_DEPARTMENT_ID,
f.AUDIT_USER_ID,
f.AUDIT_USER_SIGNER_PATH,
f.AUDIT_USER_SIGNER_TIME,
f.APPROVE_DEPARTMENT_ID,
f.APPROVE_USER_ID,
f.APPROVE_USER_SIGNER_PATH,
f.APPROVE_USER_SIGNER_TIME,
f.APPLY_STATUS,
f.CONFIRM_CONTENT,
f.AUDIT_CONTENT,
f.APPROVE_CONTENT,
f.OTHER_PROTECTIVE_MEASURES,
f.ACCEPT_DEPARTMENT_ID,
f.ACCEPT_USER_ID,
f.ACCEPT_USER_SIGNER_PATH,
f.ACCEPT_USER_SIGNER_TIME,
f.ACCEPT_CONTENT,
f.APPLY_DEPARTMENT_ID,
f.APPLY_USER_ID,
f.WORK_PLACE,
f.WORK_LEVEL,
f.WORK_USER,
f.SPECIAL_WORK,
f.RISK_IDENTIFICATION,
f.WORK_MANAGER,
f.ANALYZE_DEPARTMENT_ID,
f.ANALYZE_USER_ID,
f.GUARDIAN_DEPARTMENT_ID,
f.GUARDIAN_USER_ID,
f.GUARDIAN_USER_SIGNER_PATH,
f.GUARDIAN_USER_SIGNER_TIME,
f.GUARDIAN_CONTENT,
f.LEADER_DEPARTMENT_ID,
f.LEADER_USER_ID,
f.LEADER_USER_SIGNER_PATH,
f.LEADER_USER_SIGNER_TIME,
f.LEADER_CONTENT,
f.MONITOR_DEPARTMENT_ID,
f.MONITOR_USER_ID,
f.MONITOR_USER_SIGNER_PATH,
f.MONITOR_USER_SIGNER_TIME,
f.MONITOR_CONTENT,
f.CONFESS_USER,
f.EDUCATE_USER,
f.ACCEPT_EDUCATE_USER,
f.TRIAL_USER,
f.WORK_FUNCTION,
f.GUARDIAN_USER,
f.HOTWORK_ID,
f.CONFESS_DEPARTMENT_ID,
f.CONFESS_USER_ID,
f.CONFESS_USER_SIGNER_PATH,
f.CONFESS_USER_SIGNER_TIME,
f.ACCEPT_CONFESS_DEPARTMENT_ID,
f.ACCEPT_CONFESS_USER_ID,
f.ANALYZE_TIME,
(SELECT a.ACCEPT_CONFESS_USER_SIGNER_TIME from BUS_HOTWORK_ACCEPTUSER a where a.ISDELETE = '0'
AND a.HOTWORK_ID = f.HOTWORK_ID
ORDER BY
a.ACCEPT_CONFESS_USER_SIGNER_TIME DESC LIMIT 1) as ACCEPT_CONFESS_USER_SIGNER_TIME,
ad.NAME as APPLY_DEPARTMENT_NAME,
getFullName(ad.DEPARTMENT_ID) APPLY_DEPARTMENT_ALL,
au.NAME as APPLY_USER_NAME,
@ -1085,7 +1505,10 @@
left join OA_DEPARTMENT anad on anad.DEPARTMENT_ID = f.ANALYZE_DEPARTMENT_ID
left join SYS_USER anau on anau.USER_ID = f.ANALYZE_USER_ID
where f.ISDELETE = '0'
and f.APPLY_STATUS &lt; 8 and f.ACCEPT_CONFESS_USER_SIGNER_TIME is null and f.APPLY_STATUS &gt; 0
and f.APPLY_STATUS &lt; 8 and
not exists(select 1 from BUS_HOTWORK_ACCEPTUSER m where m.HOTWORK_ID = f.HOTWORK_ID and m.CORPINFO_ID = f.CORPINFO_ID and f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID)
and f.APPLY_STATUS &gt; 0
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''">
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
@ -1240,10 +1663,11 @@
COUNT(CASE WHEN f.APPLY_STATUS = '5' AND f.APPROVE_USER_ID = #{USER_ID} THEN f.HOTWORK_ID END) COUNTAPPROVE,
COUNT(CASE WHEN f.APPLY_STATUS = '6' AND f.MONITOR_USER_ID = #{USER_ID} THEN f.HOTWORK_ID END) COUNTMONITOR,
COUNT(CASE WHEN f.APPLY_STATUS = '7' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.HOTWORK_ID END) COUNTACCEPT,
COUNT(CASE WHEN f.APPLY_STATUS = '7' AND f.ANALYZE_USER_ID = #{USER_ID} THEN f.HOTWORK_ID END) COUNTANALYZE,
COUNT(CASE WHEN f.APPLY_STATUS &lt; '7' AND f.APPLY_STATUS &gt; 0 AND f.ANALYZE_USER_ID = #{USER_ID} THEN f.HOTWORK_ID END) COUNTANALYZE,
COUNT(CASE WHEN f.APPLY_STATUS &lt; '8' AND f.APPLY_STATUS &gt; 0 AND f.GUARDIAN_USER_ID = #{USER_ID} and f.GUARDIAN_USER_SIGNER_TIME is null THEN f.HOTWORK_ID END) COUNTGUARDIAN,
COUNT(CASE WHEN f.APPLY_STATUS &lt; '8' AND f.APPLY_STATUS &gt; 0 AND f.CONFESS_USER_ID = #{USER_ID} and f.CONFESS_USER_SIGNER_TIME is null THEN f.HOTWORK_ID END) COUNTCONFESS,
COUNT(CASE WHEN f.APPLY_STATUS &lt; '8' AND f.APPLY_STATUS &gt; 0 AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID} and f.ACCEPT_CONFESS_USER_SIGNER_TIME is null THEN f.HOTWORK_ID END) COUNTACCEPTCONFESS
COUNT(CASE WHEN f.APPLY_STATUS &lt; '8' AND f.APPLY_STATUS &gt; 0 AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID} and not exists(select 1 from BUS_HOTWORK_ACCEPTUSER m where m.HOTWORK_ID = f.HOTWORK_ID and m.CORPINFO_ID = f.CORPINFO_ID and f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID)
THEN f.HOTWORK_ID END) COUNTACCEPTCONFESS
FROM <include refid="tableName"></include> f
WHERE f.ISDELETE = '0' AND f.CORPINFO_ID = #{CORPINFO_ID}
</select>