From 110163f9daf1c239e8a6142ce320ef32845b1462 Mon Sep 17 00:00:00 2001 From: liujun Date: Sat, 3 Feb 2024 22:02:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E4=BA=A4=E5=BA=95=E4=BA=BA?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E6=8E=A5=E5=8F=A3=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../highriskwork/AppHotworkCfdController.java | 268 +++++++++--------- .../BusHotworkCfdExamineMapper.java | 2 + .../highriskwork/HotworkCfdService.java | 12 + .../impl/HotworkCfdServiceImpl.java | 123 ++++++-- src/main/java/com/zcloud/util/Warden.java | 9 + .../BusHotworkCfdExamineMapper.xml | 214 ++++++++++++-- .../highriskwork/HotworkCfdMapper.xml | 2 - 7 files changed, 450 insertions(+), 180 deletions(-) diff --git a/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java b/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java index 903eab07..6bcbadef 100644 --- a/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java +++ b/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java @@ -113,6 +113,8 @@ public class AppHotworkCfdController extends BaseController { pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 pd.put("ISDELETE", "0"); //是否删除 1-是 0-否 hotworkCfdService.save(pd); + // created by liu jun 2024/02/01 保存动火交底人、项目负责人、安全员 + hotworkCfdService.saveConfess(pd); if (pd.get("APPLY_STATUS").equals("1")) { PageData log = new PageData(); @@ -249,6 +251,8 @@ public class AppHotworkCfdController extends BaseController { PageData pd = new PageData(); pd = this.getPageData(); hotworkCfdService.edit(pd); + // created by liu jun 2024/02/01 保存动火交底人、项目负责人、安全员 + hotworkCfdService.editConfess(pd); if (pd.get("APPLY_STATUS").equals("1")) { PageData log = new PageData(); log.put("HOTWORKLOG_ID", this.get32UUID()); @@ -621,36 +625,29 @@ public class AppHotworkCfdController extends BaseController { } switch (status) { - // created by liu jun 2024-01-30 description: 作业负责人之前添加项目主管部门负责人签字,为什么状态码时1.5,因为前端代码有判断,小于1则不能提交所以这里写1.5 - case "1.5": { + // created by liu jun 2024-01-30 description: 安全项检查人签字 + case "0.9": { if (files != null && files.length > 0) { MultipartFile file = files[0]; - 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("BELONGING_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); - pd2.put("BELONGING_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); - pd2.put("BELONGING_CONTENT", pd.get("CONTENT")); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); - hotworkCfdService.edit(pd2); - } - break; - } - case "2"://确认 - if (files != null && files.length > 0) { - MultipartFile file = files[0]; - - 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("CONFIRM_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); - pd2.put("CONFIRM_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); - pd2.put("CONFIRM_CONTENT", pd.get("CONTENT")); - pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + // 如果审批通过则进入下一阶段 + if (pd.get("APPROVAL_STATUS").equals("1")) { + pd2.put("APPLY_STATUS", "1"); + } else { + pd2.put("APPLY_STATUS", "-0.9"); + } hotworkCfdService.edit(pd2); + PageData condition = new PageData(); + condition.put("HOTWORK_ID", pd2.get("HOTWORK_ID")); + condition.put("TYPE","2"); + condition.put("APPROVAL_SIGNATURE",Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + condition.put("APPROVAL_OPINIONS",pd.get("CONTENT")); + condition.put("APPROVAL_SIGNATURE_TIME",pd.get("SIGNER_TIME")); + condition.put("APPROVAL_STATUS",pd.getString("APPROVAL_STATUS")); + hotworkCfdService.approval(condition); + // 保存安全项信息 hotworkToMeasuresCfdService.delete(pd2); List list = (List) JSON.parse(pd.get("measuresList").toString()); for (JSONObject json : list) { @@ -667,87 +664,54 @@ public class AppHotworkCfdController extends BaseController { measures.put("CONFIRM_NAME", pd.get("ACTION_USER")); hotworkToMeasuresCfdService.save(measures); } - log.put("ACTION", "作业单位通过"); - - - // 发短信 - PageData mes = new PageData(); - mes.put("RECEIVER_ID", pd2.get("LEADER_USER_ID"));// 收信人userid - mes.put("templateCode", "DH_Y02");// 短信模板编码 - mes.put("SMSCode", "SMS_227245922");// 短信模板编码 - mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id - // 参数集合 - List paramsList = new ArrayList(); - // 第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", "params1");// 存入短信模板中的参数名称 - params2.put("value", "动火作业");// 存入上面参数名称所传递的值 - paramsList.add(params2); - // 第3个参数 - PageData params3 = new PageData(); - params3.put("name", "params2");// 存入短信模板中的参数名称 - params3.put("value", "动火点所在单位审核");// 存入上面参数名称所传递的值 - paramsList.add(params3); - // 第4个参数 - PageData params4 = new PageData(); - params4.put("name", "params3");// 存入短信模板中的参数名称 - params4.put("value", "审核");// 存入上面参数名称所传递的值 - paramsList.add(params4); - //sendMessageUtil.sendMessages(mes, paramsList); } break; + } + // 作业负责人审批 + case "2": {//确认 + if (files != null && files.length > 0) { + MultipartFile file = files[0]; -// case "3"://监护人确认 -// if (files != null && files.length > 0) { -// MultipartFile file = files[0]; -// -// 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("GUARDIAN_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); -// pd2.put("GUARDIAN_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); -// pd2.put("GUARDIAN_CONTENT", pd.get("CONTENT")); -// pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); -// hotworkService.edit(pd2); -// log.put("ACTION", "监护人确认通过"); -// -// // 发短信 -// PageData mes = new PageData(); -// mes.put("RECEIVER_ID", pd2.get("LEADER_USER_ID"));// 收信人userid -// mes.put("templateCode", "SMS_227245922");// 短信模板编码 -// mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id -// // 参数集合 -// List paramsList = new ArrayList(); -// // 第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", "params1");// 存入短信模板中的参数名称 -// params2.put("value", "动火作业");// 存入上面参数名称所传递的值 -// paramsList.add(params2); -// // 第3个参数 -// PageData params3 = new PageData(); -// params3.put("name", "params2");// 存入短信模板中的参数名称 -// params3.put("value", "动火点所在单位审核");// 存入上面参数名称所传递的值 -// paramsList.add(params3); -// // 第4个参数 -// PageData params4 = new PageData(); -// params4.put("name", "params3");// 存入短信模板中的参数名称 -// params4.put("value", "审核");// 存入上面参数名称所传递的值 -// paramsList.add(params4); -// //sendMessageUtil.sendMessages(mes, paramsList); -// } -// break; + 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("CONFIRM_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + pd2.put("CONFIRM_USER_SIGNER_TIME", pd.get("SIGNER_TIME")); + pd2.put("CONFIRM_CONTENT", pd.get("CONTENT")); + pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); + hotworkCfdService.edit(pd2); + log.put("ACTION", "作业单位通过"); + } + break; + } + // created by liu jun 2024-01-30 description: 作业负责人之前添加项目主管部门负责人签字 + // 项目主管部门审批 + case "2.5": { + if (files != null && files.length > 0) { + MultipartFile file = files[0]; + 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); + // 如果审批通过则进入下一阶段 + if (pd.get("APPROVAL_STATUS").equals("1")) { + pd2.put("APPLY_STATUS", "3"); + } else { + pd2.put("APPLY_STATUS", "-2.5"); + } + hotworkCfdService.edit(pd2); + // 保存审批信息 + PageData condition = new PageData(); + condition.put("HOTWORK_ID", pd2.get("HOTWORK_ID")); + condition.put("TYPE","1"); + condition.put("APPROVAL_OPINIONS",pd.get("CONTENT")); + condition.put("APPROVAL_SIGNATURE",Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + condition.put("APPROVAL_SIGNATURE_TIME",pd.get("SIGNER_TIME")); + condition.put("APPROVAL_STATUS",pd.getString("APPROVAL_STATUS")); + hotworkCfdService.approval(condition); + } + break; + } case "4"://单位负责人人确认 if (files != null && files.length > 0) { MultipartFile file = files[0]; @@ -1015,7 +979,7 @@ public class AppHotworkCfdController extends BaseController { //sendMessageUtil.sendMessages(mes, paramsList); } break; - case "-2"://确认打回 + case "-2": {//确认打回 log.put("ACTION", "作业单位打回"); pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); pd2.put("CONFIRM_CONTENT", pd.get("CONTENT")); @@ -1046,35 +1010,7 @@ public class AppHotworkCfdController extends BaseController { paramsList.add(params3); //sendMessageUtil.sendMessages(mes, paramsList); break; -// case "-3"://监护人确认打回 -// log.put("ACTION", "监护人打回"); -// pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); -// pd2.put("GUARDIAN_CONTENT", pd.get("CONTENT")); -// hotworkService.edit(pd2); -// // 发短信 -// PageData mes1 = new PageData(); -// mes1.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid -// mes1.put("templateCode", "SMS_223580715");// 短信模板编码 -// mes1.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id -// // 参数集合 -// List paramsList1 = new ArrayList(); -// // 第1个参数 -// PageData params4 = new PageData(); -// params4.put("name", "params1");// 存入短信模板中的参数名称 -// params4.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值 -// paramsList1.add(params4); -// // 第2个参数 -// PageData params5 = new PageData(); -// params5.put("name", "params2");// 存入短信模板中的参数名称 -// params5.put("value", "动火作业");// 存入上面参数名称所传递的值 -// paramsList1.add(params5); -// // 第3个参数 -// PageData params6 = new PageData(); -// params6.put("name", "params3");// 存入短信模板中的参数名称 -// params6.put("value", "监护人确认");// 存入上面参数名称所传递的值 -// paramsList1.add(params6); -// //sendMessageUtil.sendMessages(mes1, paramsList1); -// break; + } case "-4"://单位负责人打回 log.put("ACTION", "单位负责人打回"); pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS")); @@ -1578,4 +1514,74 @@ public class AppHotworkCfdController extends BaseController { } } + /** + * 检查信息是否可以审批 + * created by liu jun + * @date 2024-02-03 + */ + @RequestMapping(value="/check") + @ResponseBody + public Object check() throws Exception { + PageData response = new PageData(); + try { + PageData request = this.getPageData(); + PageData info = hotworkCfdService.check(request); + response.putAll(info); + response.put("result", "success"); + return response; + } catch (Exception e) { + e.printStackTrace(); + response.put("result", "error"); + response.put("message", e.getMessage()); + return response; + } + } + + /** + * 安全交底人审批查询接口 + * created by liu jun + * @date 2024-02-03 + */ + @RequestMapping(value="/safetyList") + @ResponseBody + @LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "列表") + public Object safetyList(Page page) throws Exception{ + PageData response = new PageData(); + try { + PageData request = this.getPageData(); + page.setPd(request); + List varList = hotworkCfdService.safetyList(page); + response.put("varList", varList); + response.put("page", page); + response.put("result", "success"); + return response; + } catch (Exception e) { + e.printStackTrace(); + response.put("result", "error"); + response.put("message", e.getMessage()); + return response; + } + } + /** + * 安全交底人审批 + * created by liu jun + * @date 2024-02-03 + */ + @RequestMapping(value = "/confessApproval") + @ResponseBody + public Object confessApproval(@RequestParam(value = "FFILE", required = false) MultipartFile[] files) throws Exception { + PageData response = new PageData(); + try { + PageData request = this.getPageData(); + hotworkCfdService.confessApproval(request, files); + response.put("result", "success"); + return response; + } catch (Exception e) { + e.printStackTrace(); + response.put("result", "error"); + response.put("message", e.getMessage()); + return response; + } + } + } diff --git a/src/main/java/com/zcloud/mapper/datasource/highriskwork/BusHotworkCfdExamineMapper.java b/src/main/java/com/zcloud/mapper/datasource/highriskwork/BusHotworkCfdExamineMapper.java index d8180544..523de699 100644 --- a/src/main/java/com/zcloud/mapper/datasource/highriskwork/BusHotworkCfdExamineMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/highriskwork/BusHotworkCfdExamineMapper.java @@ -24,5 +24,7 @@ public interface BusHotworkCfdExamineMapper { List listAll(PageData condition); List findByCondition(PageData condition); + + List safetylistPage(Page page); } diff --git a/src/main/java/com/zcloud/service/highriskwork/HotworkCfdService.java b/src/main/java/com/zcloud/service/highriskwork/HotworkCfdService.java index b269758f..a5509e72 100644 --- a/src/main/java/com/zcloud/service/highriskwork/HotworkCfdService.java +++ b/src/main/java/com/zcloud/service/highriskwork/HotworkCfdService.java @@ -2,6 +2,7 @@ package com.zcloud.service.highriskwork; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -86,5 +87,16 @@ public interface HotworkCfdService { PageData getCode(PageData pd)throws Exception; void addInfo(PageData pd) throws Exception; + + void saveConfess(PageData info) throws Exception; + void editConfess(PageData info) throws Exception; + + void approval(PageData condition) throws Exception; + + PageData check(PageData condition) throws Exception; + + List safetyList(Page page) throws Exception; + + void confessApproval(PageData request, MultipartFile[] files) throws Exception; } diff --git a/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java b/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java index 9218428c..a5801768 100644 --- a/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java +++ b/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java @@ -9,9 +9,11 @@ import com.zcloud.service.bus.CorpInfoService; import com.zcloud.service.highriskwork.HotworkCfdService; import com.zcloud.util.DateUtil; import com.zcloud.util.Warden; +import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.util.List; @@ -46,12 +48,10 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { @Transactional public void save(PageData pd)throws Exception { hotworkCfdMapper.save(pd); - // created by liu jun 2024/02/01 保存动火交底人 - this.saveConfess(pd.getString("confessList"), pd); } - private void saveConfess(String json, PageData info) throws Exception{ - List list = Warden.getList(json); + public void saveConfess(PageData info) throws Exception{ + List list = Warden.getList(info.getString("confessList")); String flowsId = Warden.get32UUID(); String time = DateUtil.getTime(); PageData condition = new PageData(); @@ -68,7 +68,7 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { this.getCorpInfo(entity); entity.put("TYPE", "0"); entity.put("TYPE_NAME", "动火交底人"); - entity.put("APPROVAL_OPINIONS",""); + entity.put("APPROVAL_OPINIONS",info.getString("CONFESS_DEPARTMENT_OPINIONS")); entity.put("STATUS", "0"); entity.put("CREATE_TIME", time); entity.put("VALID_FLAG", "1"); @@ -88,7 +88,7 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { belonging.put("TYPE", "1"); belonging.put("TYPE_NAME", "项目主管部门负责人"); belonging.put("APPROVAL_OPINIONS",""); - belonging.put("STATUS", "0"); + belonging.put("APPROVAL_STATUS", "0"); belonging.put("CREATE_TIME", time); belonging.put("VALID_FLAG", "1"); belonging.put("IS_DELETE", "0"); @@ -107,13 +107,104 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { safety.put("TYPE", "2"); safety.put("TYPE_NAME", "安全项检查人"); safety.put("APPROVAL_OPINIONS",""); - safety.put("STATUS", "0"); + safety.put("APPROVAL_STATUS", "0"); safety.put("CREATE_TIME", time); safety.put("VALID_FLAG", "1"); safety.put("IS_DELETE", "0"); busHotworkCfdExamineMapper.save(safety); } + @Override + public void editConfess(PageData info) throws Exception { + // 删除原有的动火交底人 + PageData condition = new PageData(); + condition.put("HOTWORK_ID", info.getString("HOTWORK_ID")); + List oldEntity = busHotworkCfdExamineMapper.listAll(condition); + for (PageData entity : oldEntity) { + entity.put("IS_DELETE", "1"); + busHotworkCfdExamineMapper.edit(entity); + } + // created by liu jun 2024/02/01 保存动火交底人 + this.saveConfess(info); + } + + @Override + public void approval(PageData info) throws Exception { + PageData condition = new PageData(); + condition.put("HOTWORK_ID", info.getString("HOTWORK_ID")); + condition.put("IS_DELETE", "0"); + condition.put("VALID_FLAG", "1"); + condition.put("TYPE", info.getString("TYPE")); + List list = busHotworkCfdExamineMapper.findByCondition(condition); + if (list == null || list.size() == 0) throw new RuntimeException("数据异常请联系管理员"); + PageData entity = list.get(0); + entity.put("APPROVAL_OPINIONS", info.getString("APPROVAL_OPINIONS")); + entity.put("APPROVAL_SIGNATURE", info.getString("APPROVAL_SIGNATURE")); + entity.put("APPROVAL_SIGNATURE_TIME", info.getString("APPROVAL_SIGNATURE_TIME")); + entity.put("APPROVAL_STATUS", info.getString("APPROVAL_STATUS")); + busHotworkCfdExamineMapper.edit(entity); + } + + @Override + public PageData check(PageData request) throws Exception { + PageData condition = new PageData(); + condition.put("HOTWORK_ID", request.get("HOTWORK_ID")); + PageData entity = hotworkCfdMapper.findById(condition); + if (entity == null) { + throw new RuntimeException("未找到动火作业信息"); + } + String passFlag = "1"; + String message = ""; + if (entity.get("ACCEPT_CONFESS_USER_SIGNER_PATH") == null || StringUtils.isEmpty(entity.getString("ACCEPT_CONFESS_USER_SIGNER_PATH"))) { + message = "交底人未签字,"; + passFlag = "0"; + } + if (entity.get("GUARDIAN_USER_SIGNER_PATH") == null || StringUtils.isEmpty(entity.getString(entity.get("GUARDIAN_USER_SIGNER_PATH")))) { + message = message + "监护人未签字,"; + passFlag = "0"; + } + condition.clear(); + condition.put("HOTWORK_ID", request.get("HOTWORK_ID")); + condition.put("IS_DELETE", "0"); + condition.put("VALID_FLAG", "1"); + condition.put("TYPE", "0"); + List approvalInfos = busHotworkCfdExamineMapper.findByCondition(condition); + if (approvalInfos == null || approvalInfos.size() == 0) throw new RuntimeException("未找到审批信息"); + int unApprovalNum = (int) approvalInfos.stream().filter(x -> "0".equals(x.getString("APPROVAL_STATUS"))).count(); + if (unApprovalNum > 0) { + message = message + "动火交底人未签字"; + passFlag = "0"; + } + PageData result = new PageData(); + result.put("passFlag", passFlag); + result.put("message", message); + return result; + } + + @Override + public List safetyList(Page page) throws Exception { + return busHotworkCfdExamineMapper.safetylistPage(page); + } + + @Override + public void confessApproval(PageData request, MultipartFile[] files) throws Exception { + PageData conditon = new PageData(); + conditon.put("HOTWORK_ID", request.get("HOTWORK_ID")); + conditon.put("IS_DELETE", "0"); + conditon.put("VALID_FLAG", "1"); + conditon.put("TYPE", "0"); + conditon.put("USER_ID", request.get("USER_ID")); + List approvalInfos = busHotworkCfdExamineMapper.findByCondition(conditon); + if(approvalInfos.size() == 0) throw new RuntimeException("未找到审批信息,请联系管理员"); + if (approvalInfos.size() > 1) throw new RuntimeException("审批信息异常,请联系管理员"); + PageData entity = approvalInfos.get(0); + entity.put("APPROVAL_STATUS", "1"); + entity.put("APPROVAL_SIGNATURE", Warden.saveFile(files,request.getString("CORPINFO_ID"))); + entity.put("APPROVAL_SIGNATURE_TIME", DateUtil.getTime()); + busHotworkCfdExamineMapper.edit(entity); + + } + private void getCorpInfo(PageData entity) throws Exception { PageData condition = new PageData(); condition.put("DEPARTMENT_ID", entity.getString("DEPARTMENT_ID")); @@ -152,16 +243,6 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { @Transactional public void edit(PageData pd)throws Exception{ hotworkCfdMapper.edit(pd); - // 删除原有的动火交底人 - PageData condition = new PageData(); - condition.put("HOTWORK_ID", pd.getString("HOTWORK_ID")); - List oldEntity = busHotworkCfdExamineMapper.listAll(condition); - for (PageData entity : oldEntity) { - entity.put("IS_DELETE", "1"); - busHotworkCfdExamineMapper.edit(entity); - } - // created by liu jun 2024/02/01 保存动火交底人 - this.saveConfess(pd.getString("confessList"), pd); } /**列表 @@ -169,7 +250,12 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { * @throws Exception */ public List list(Page page)throws Exception{ - return hotworkCfdMapper.datalistPage(page); + List list = hotworkCfdMapper.datalistPage(page); + // created by liu jun 2024/02/03 description: 拼接动火交底人、项目主管部门、安全项检查人 + for(PageData dto: list){ + this.addInfo(dto); + } + return list; } public List jhlist(Page page)throws Exception{ return hotworkCfdMapper.jhdatalistPage(page); @@ -280,6 +366,7 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { x.put("CONFESS_DEPARTMENT_ID", x.get("DEPARTMENT_ID")); x.put("CONFESS_DEPARTMENT_NAME", x.get("DEPARTMENT_NAME")); } + pd.put("confessUserNames", confess.stream().map(x -> x.getString("USER_NAME")).collect(Collectors.joining(","))); pd.put("confessList", confess); // 项目责任负责人 PageData belong = approvalInfos.stream().filter(x -> "1".equals(x.getString("TYPE"))).findFirst().orElse(null); diff --git a/src/main/java/com/zcloud/util/Warden.java b/src/main/java/com/zcloud/util/Warden.java index 8f2b9c81..af96cf99 100644 --- a/src/main/java/com/zcloud/util/Warden.java +++ b/src/main/java/com/zcloud/util/Warden.java @@ -11,6 +11,7 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.util.EntityUtils; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import java.io.*; @@ -294,5 +295,13 @@ public class Warden { } } + public static Object saveFile(MultipartFile[] files,String CORPINFO_ID) throws Exception{ + if (files.length == 0) throw new RuntimeException("文件为空"); + MultipartFile file = files[0]; + String ffile = DateUtil.getDays(); + String fileName = get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + Smb.sshSftp(file, fileName, Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile); + return Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile + "/" + fileName; + } } diff --git a/src/main/resources/mybatis/datasource/highriskwork/BusHotworkCfdExamineMapper.xml b/src/main/resources/mybatis/datasource/highriskwork/BusHotworkCfdExamineMapper.xml index d9447c71..6bd33592 100644 --- a/src/main/resources/mybatis/datasource/highriskwork/BusHotworkCfdExamineMapper.xml +++ b/src/main/resources/mybatis/datasource/highriskwork/BusHotworkCfdExamineMapper.xml @@ -22,7 +22,7 @@ f.APPROVAL_SIGNATURE_TIME, f.FLOW_ID, f.VALID_FLAG, - f.STATUS, + f.APPROVAL_STATUS, f.IS_DELETE, f.CREATE_TIME, f.REMARK @@ -44,7 +44,7 @@ APPROVAL_SIGNATURE_TIME, FLOW_ID, VALID_FLAG, - STATUS, + APPROVAL_STATUS, IS_DELETE, CREATE_TIME, REMARK @@ -66,7 +66,7 @@ #{APPROVAL_SIGNATURE_TIME}, #{FLOW_ID}, #{VALID_FLAG}, - #{STATUS}, + #{APPROVAL_STATUS}, #{IS_DELETE}, #{CREATE_TIME}, #{REMARK} @@ -100,7 +100,7 @@ APPROVAL_SIGNATURE_TIME = #{APPROVAL_SIGNATURE_TIME}, FLOW_ID = #{FLOW_ID}, VALID_FLAG = #{VALID_FLAG}, - STATUS = #{STATUS}, + APPROVAL_STATUS = #{APPROVAL_STATUS}, IS_DELETE = #{IS_DELETE}, CREATE_TIME = #{CREATE_TIME}, REMARK = #{REMARK} @@ -109,7 +109,17 @@ + diff --git a/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml b/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml index 9bcb826a..45433b99 100644 --- a/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml +++ b/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml @@ -955,8 +955,6 @@ f.ACCEPT_CONFESS_DEPARTMENT_ID, f.ACCEPT_CONFESS_USER_ID, f.ANALYZE_TIME, - - (SELECT a.ACCEPT_CONFESS_USER_SIGNER_TIME from BUS_HOTWORK_ACCEPTUSER_CFD a where a.ISDELETE = '0' AND a.HOTWORK_ID = f.HOTWORK_ID ORDER BY