From 336916d4b91b2c0f74448aae54fb4d73c7fc5525 Mon Sep 17 00:00:00 2001 From: songwenxuan <1924103812@qq.com> Date: Thu, 21 Dec 2023 08:28:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E5=8D=95=E6=8E=92=E6=9F=A5=E3=80=81?= =?UTF-8?q?=E9=9A=90=E6=82=A3=E6=B5=81=E7=A8=8B=E5=AF=B9=E6=8E=A5=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/bus/CheckRecordController.java | 1 + .../controller/bus/HiddenController.java | 2 ++ .../bus/HiddenExamineController.java | 3 +++ .../hiddenApi/HiddenApiController.java | 22 +++++++++++----- .../SafetyEnvironmentalController.java | 11 ++++---- .../SafetyEnvironmentalExplainController.java | 7 +++++- ...afetyEnvironmentalInspectorController.java | 8 +++++- .../hiddenApi/HiddenCheckApiService.java | 25 ++++++++++--------- .../hiddenApi/HiddenExamineApiService.java | 13 +++++----- .../impl/HiddenCheckApiServiceImpl.java | 8 +++--- .../impl/HiddenExamineApiServiceImpl.java | 7 ++++-- .../SafetyEnvironmentalExplainService.java | 13 ++++++---- .../SafetyEnvironmentalInspectorService.java | 10 +++++--- ...SafetyEnvironmentalExplainServiceImpl.java | 15 ++++++----- ...fetyEnvironmentalInspectorServiceImpl.java | 6 ++++- .../impl/SafetyEnvironmentalServiceImpl.java | 20 +++++++++++++-- 16 files changed, 116 insertions(+), 55 deletions(-) diff --git a/src/main/java/com/zcloud/controller/bus/CheckRecordController.java b/src/main/java/com/zcloud/controller/bus/CheckRecordController.java index a913c985..cede6441 100644 --- a/src/main/java/com/zcloud/controller/bus/CheckRecordController.java +++ b/src/main/java/com/zcloud/controller/bus/CheckRecordController.java @@ -74,6 +74,7 @@ public class CheckRecordController extends BaseController { private HiddenMailService hiddenMailService; @Autowired private MessageService messageService; + /** * 新增 * diff --git a/src/main/java/com/zcloud/controller/bus/HiddenController.java b/src/main/java/com/zcloud/controller/bus/HiddenController.java index 4cc2881e..f3c333e8 100644 --- a/src/main/java/com/zcloud/controller/bus/HiddenController.java +++ b/src/main/java/com/zcloud/controller/bus/HiddenController.java @@ -2833,6 +2833,7 @@ public class HiddenController extends BaseController { @RequestMapping(value = "/assign") @RequiresPermissions("hidden:add") @ResponseBody + @DockAnnotation public Object assign() throws Exception { Map map = new HashMap(); String errInfo = "success"; @@ -2873,6 +2874,7 @@ public class HiddenController extends BaseController { */ @RequestMapping(value = "/finalcheck") @ResponseBody + @DockAnnotation public Object finalcheck() throws Exception { // 获取IP HttpServletRequest request = this.getRequest(); diff --git a/src/main/java/com/zcloud/controller/bus/HiddenExamineController.java b/src/main/java/com/zcloud/controller/bus/HiddenExamineController.java index 777cd4c5..2807341b 100644 --- a/src/main/java/com/zcloud/controller/bus/HiddenExamineController.java +++ b/src/main/java/com/zcloud/controller/bus/HiddenExamineController.java @@ -1,5 +1,6 @@ package com.zcloud.controller.bus; +import com.zcloud.aspect.DockAnnotation; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; @@ -288,6 +289,7 @@ public class HiddenExamineController extends BaseController { @RequestMapping(value = "/delayedExamine") @RequiresPermissions("hidden:edit") @ResponseBody + @DockAnnotation() public Object delayedExamine() throws Exception { Map map = new HashMap(); String errInfo = "success"; @@ -417,6 +419,7 @@ public class HiddenExamineController extends BaseController { @RequestMapping(value = "/specialExamine") @RequiresPermissions("hidden:edit") @ResponseBody + @DockAnnotation public Object specialExamine(@RequestParam(value = "FFILE", required = false) MultipartFile file) throws Exception { Map map = new HashMap(); String errInfo = "success"; diff --git a/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java b/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java index f4fc76ec..50c06e14 100644 --- a/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java +++ b/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java @@ -577,6 +577,7 @@ public class HiddenApiController extends BaseController { @RequestMapping(value = "/unableRectify") @RequiresPermissions("hidden:list") @ResponseBody + @DockAnnotation(isAdd = true) public Object unableRectify() throws Exception { Map map = new HashMap(); Integer code = 000000; @@ -609,7 +610,7 @@ public class HiddenApiController extends BaseController { examine.put("OPERATOR", Jurisdiction.getUSER_ID()); examine.put("OPERATTIME", DateUtil.date2Str(new Date())); examine = hiddenExamineApiService.save(examine); - + pd.put("examine",JSON.toJSONString(examine)); messageService.sendMessageByParameter("HIDDEN_MAIL_005", "友情提示:有一条隐患需要特殊审核", hidden.getString("CORPINFO_ID"), hidden.getString("CONFIRM_USER"), hidden.getString("HIDDEN_ID"), hidden.getString("HIDDENDESCR"), "特殊处置审核", "审核", "", ""); @@ -633,8 +634,7 @@ public class HiddenApiController extends BaseController { inspection.put("HIDDEN_vector", pd.getString("HIDDEN_ID")); noticeUtil.SE_ThreeStepUtil(inspection); } - - + map.put("dockData",JSON.toJSONString(pd)); return ResultCodeConstant.resMap(code, map); } @@ -647,6 +647,7 @@ public class HiddenApiController extends BaseController { @RequestMapping(value = "/delayed") @RequiresPermissions("hidden:list") @ResponseBody + @DockAnnotation(isAdd = true) public Object delayed() throws Exception { Map map = new HashMap(); String errInfo = "success"; @@ -685,11 +686,12 @@ public class HiddenApiController extends BaseController { examine.put("DISPOSAL_FILE", Const.FILEPATHYHTP + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); } examine = hiddenExamineApiService.save(examine); - + pd.put("examine",JSON.toJSONString(examine)); messageService.sendMessageByParameter("HIDDEN_MAIL_007", "友情提示:有一条隐患需要延期审核", hidden.getString("CORPINFO_ID"), pd.getString("USER_ID"), hidden.getString("HIDDEN_ID"), hidden.getString("HIDDENDESCR"), "延期审核", "审核", "", ""); map.put("msg", "隐患延期申成功。请通知隐患确认人进行延期确认操作!"); + map.put("dockData",JSON.toJSONString(pd)); return ResultCodeConstant.resMap(code, map); } @@ -702,6 +704,7 @@ public class HiddenApiController extends BaseController { */ @RequestMapping(value = "/check") @ResponseBody + @DockAnnotation(isAdd = true) public Object check() throws Exception { Map map = new HashMap(); Integer code = 000000; @@ -728,16 +731,21 @@ public class HiddenApiController extends BaseController { if (hiddenCheckList.size() == 0) { return ResultCodeConstant.resMap(000220, map); } + Map hiddenCheckMap = new HashMap<>(); + int count = 1; for (PageData pageData : hiddenCheckList) { if ("1".equals(pageData.getString("STATUS"))) { checkCount++; //以前验收的++ } if (Jurisdiction.getUSER_ID().equals(pageData.getString("USER_ID"))) { check = pageData; - hiddenCheckApiService.checkHidden(pd.getString("HIDDEN_ID"), pageData.getString("HIDDENCHECK_ID"), pd.getString("CHECKDESCR"), pd.getString("CHECK_TIME"), Jurisdiction.getDEPARTMENT_ID(), Jurisdiction.getUSER_ID()); + PageData exampd = hiddenCheckApiService.checkHidden(pd.getString("HIDDEN_ID"), pageData.getString("HIDDENCHECK_ID"), pd.getString("CHECKDESCR"), pd.getString("CHECK_TIME"), Jurisdiction.getDEPARTMENT_ID(), Jurisdiction.getUSER_ID()); + hiddenCheckMap.put("exampd"+count, JSON.toJSONString(exampd)); + count++; checkCount++; //本次的++ } } + pd.put("hiddenCheckMap", JSON.toJSONString(hiddenCheckMap)); if (hiddenCheckList.size() != 0) { if (checkCount != hiddenCheckList.size()) { //还有没有验收的人 return ResultCodeConstant.resMap(000203, map); @@ -783,13 +791,15 @@ public class HiddenApiController extends BaseController { /** 验收打回 **/ hiddenApiService.repulseCheck(pd.getString("HIDDEN_ID")); /** 记录打回 **/ - hiddenExamineApiService.saveRepulseCheck(pd.getString("HIDDEN_ID"), pd.getString("CONTENT")); + PageData exam = hiddenExamineApiService.saveRepulseCheck(pd.getString("HIDDEN_ID"), pd.getString("CONTENT")); + pd.put("exam",JSON.toJSONString(exam)); /** 给隐患整改人发送站内信**/ messageService.sendMessageByParameter("HIDDEN_MAIL_002", "友情提示:有一条隐患被打回", hidden.getString("CORPINFO_ID"), pd.getString("USER_ID"), hidden.getString("HIDDEN_ID"), hidden.getString("HIDDENDESCR"), "整改", "重新整改", "", ""); } map.put("check", check); + map.put("dockData",JSON.toJSONString(pd)); return ResultCodeConstant.resMap(code, map); } diff --git a/src/main/java/com/zcloud/controller/inspection/SafetyEnvironmentalController.java b/src/main/java/com/zcloud/controller/inspection/SafetyEnvironmentalController.java index 1669cef6..6a717af3 100644 --- a/src/main/java/com/zcloud/controller/inspection/SafetyEnvironmentalController.java +++ b/src/main/java/com/zcloud/controller/inspection/SafetyEnvironmentalController.java @@ -1,13 +1,12 @@ package com.zcloud.controller.inspection; +import com.alibaba.fastjson.JSON; +import com.zcloud.aspect.DockAnnotation; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; -import com.zcloud.entity.hotWorkApplication.Color; import com.zcloud.entity.hotWorkApplication.Node; import com.zcloud.entity.hotWorkApplication.Overseer; -import com.zcloud.entity.system.Department; -import com.zcloud.entity.system.User; import com.zcloud.service.bus.HiddenCheckService; import com.zcloud.service.bus.HiddenService; import com.zcloud.service.bus.NoticeCorpService; @@ -21,8 +20,6 @@ import com.zcloud.service.system.UsersService; import com.zcloud.util.*; import org.apache.commons.lang.StringUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.apache.shiro.session.Session; -import org.apache.xmlgraphics.xmp.schemas.pdf.PDFAAdapter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -33,7 +30,6 @@ import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.util.*; -import java.util.stream.Collectors; /** * 说明:安全环保检查 @@ -276,6 +272,7 @@ public class SafetyEnvironmentalController extends BaseController { @RequestMapping(value = "/add") @RequiresPermissions("safetyenvironmental:add") @ResponseBody + @DockAnnotation(isAdd = true) public Object add() throws Exception { Map map = new HashMap(); String errInfo = "success"; @@ -307,6 +304,7 @@ public class SafetyEnvironmentalController extends BaseController { List hiddenList = safetyenvironmentalService.save(pd); pd.put("hiddenList", hiddenList); map.put("pd", pd); + map.put("dockData", JSON.toJSONString(pd)); map.put("result", errInfo); return map; } @@ -460,6 +458,7 @@ public class SafetyEnvironmentalController extends BaseController { @RequestMapping(value = "/hide") @RequiresPermissions("safetyenvironmental:del") @ResponseBody + @DockAnnotation public Object hide() throws Exception { Map map = new HashMap(); String errInfo = "success"; diff --git a/src/main/java/com/zcloud/controller/inspection/SafetyEnvironmentalExplainController.java b/src/main/java/com/zcloud/controller/inspection/SafetyEnvironmentalExplainController.java index 3acc2464..b8fb4b26 100644 --- a/src/main/java/com/zcloud/controller/inspection/SafetyEnvironmentalExplainController.java +++ b/src/main/java/com/zcloud/controller/inspection/SafetyEnvironmentalExplainController.java @@ -1,5 +1,7 @@ package com.zcloud.controller.inspection; +import com.alibaba.fastjson.JSON; +import com.zcloud.aspect.DockAnnotation; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; @@ -98,6 +100,7 @@ public class SafetyEnvironmentalExplainController extends BaseController { @RequestMapping(value="/add") @RequiresPermissions("safetyenvironmentalexplain:add") @ResponseBody + @DockAnnotation(isAdd = true) public Object add(@RequestParam(value="file",required=false) MultipartFile file) throws Exception{ Map map = new HashMap(); String errInfo = "success"; @@ -143,11 +146,13 @@ public class SafetyEnvironmentalExplainController extends BaseController { pd.put("INSPECTED_EXPLAIN_FILENAME", file.getOriginalFilename()); pd.put("INSPECTED_EXPLAIN_FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); } - safetyenvironmentalexplainService.save(pd); + PageData logData = safetyenvironmentalexplainService.save(pd); + pd.put("logData",JSON.toJSONString(logData)); noticeCorpUtil.SE_PleadingStepUtil(pd); map.put("pd", pd); map.put("result", errInfo); + map.put("dockData", JSON.toJSONString(pd)); return map; } diff --git a/src/main/java/com/zcloud/controller/inspection/SafetyEnvironmentalInspectorController.java b/src/main/java/com/zcloud/controller/inspection/SafetyEnvironmentalInspectorController.java index c7bc8356..37b18941 100644 --- a/src/main/java/com/zcloud/controller/inspection/SafetyEnvironmentalInspectorController.java +++ b/src/main/java/com/zcloud/controller/inspection/SafetyEnvironmentalInspectorController.java @@ -1,5 +1,7 @@ package com.zcloud.controller.inspection; +import com.alibaba.fastjson.JSON; +import com.zcloud.aspect.DockAnnotation; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; @@ -82,6 +84,7 @@ public class SafetyEnvironmentalInspectorController extends BaseController { @RequestMapping(value="/verify") @RequiresPermissions("safetyenvironmentalinspector:add") @ResponseBody + @DockAnnotation(isAdd = true) public Object verify() throws Exception{ Map map = new HashMap(); String errInfo = "success"; @@ -110,9 +113,12 @@ public class SafetyEnvironmentalInspectorController extends BaseController { uBean.put("INSPECTION_USER_SIGN_IMG", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); } - safetyenvironmentalinspectorService.verify(uBean); + pd.put("uBean",JSON.toJSONString(uBean)); + PageData verify = safetyenvironmentalinspectorService.verify(uBean); + pd.put("verify",JSON.toJSONString(verify)); map.put("pd", pd); map.put("result", errInfo); + map.put("dockData", JSON.toJSONString(pd)); return map; } diff --git a/src/main/java/com/zcloud/service/hiddenApi/HiddenCheckApiService.java b/src/main/java/com/zcloud/service/hiddenApi/HiddenCheckApiService.java index 7da8ba96..65241d93 100644 --- a/src/main/java/com/zcloud/service/hiddenApi/HiddenCheckApiService.java +++ b/src/main/java/com/zcloud/service/hiddenApi/HiddenCheckApiService.java @@ -77,18 +77,19 @@ public interface HiddenCheckApiService { public List findByHidden(String hiddenId)throws Exception; /** - * 根据隐患id 和用户id验收隐患 - * @param HIDDEN_ID - * @param HIDDENCHECK_ID 验收id - * @param CHECKDESCR 验收描述 - * @param CHECK_TIME 验收时间 - * @param DEPARTMENT_ID 验收部门 - * @param USER_ID 验收人 - * @return - * @throws Exception - */ - public int checkHidden(String HIDDEN_ID,String HIDDENCHECK_ID,String CHECKDESCR, - String CHECK_TIME,String DEPARTMENT_ID, String USER_ID)throws Exception; + * 根据隐患id 和用户id验收隐患 + * + * @param HIDDEN_ID + * @param HIDDENCHECK_ID 验收id + * @param CHECKDESCR 验收描述 + * @param CHECK_TIME 验收时间 + * @param DEPARTMENT_ID 验收部门 + * @param USER_ID 验收人 + * @return + * @throws Exception + */ + public PageData checkHidden(String HIDDEN_ID, String HIDDENCHECK_ID, String CHECKDESCR, + String CHECK_TIME, String DEPARTMENT_ID, String USER_ID)throws Exception; /**根据隐患信息删除隐患验收人。 * @param hiddenId diff --git a/src/main/java/com/zcloud/service/hiddenApi/HiddenExamineApiService.java b/src/main/java/com/zcloud/service/hiddenApi/HiddenExamineApiService.java index ebc19551..cb66792f 100644 --- a/src/main/java/com/zcloud/service/hiddenApi/HiddenExamineApiService.java +++ b/src/main/java/com/zcloud/service/hiddenApi/HiddenExamineApiService.java @@ -118,12 +118,13 @@ public interface HiddenExamineApiService { public PageData saveConfirm(PageData pd,String hiddenExamineType)throws Exception; /** - * 隐患打回 - * @param hiddenId - * @param EXAMINE - * @throws Exception - */ - public int saveRepulseCheck(String hiddenId ,String EXAMINE)throws Exception; + * 隐患打回 + * + * @param hiddenId + * @param EXAMINE + * @throws Exception + */ + public PageData saveRepulseCheck(String hiddenId , String EXAMINE)throws Exception; /** * 当隐患整改的时候,隐患流程进行修改 diff --git a/src/main/java/com/zcloud/service/hiddenApi/impl/HiddenCheckApiServiceImpl.java b/src/main/java/com/zcloud/service/hiddenApi/impl/HiddenCheckApiServiceImpl.java index 906b87c2..11b65f48 100644 --- a/src/main/java/com/zcloud/service/hiddenApi/impl/HiddenCheckApiServiceImpl.java +++ b/src/main/java/com/zcloud/service/hiddenApi/impl/HiddenCheckApiServiceImpl.java @@ -169,8 +169,8 @@ public class HiddenCheckApiServiceImpl implements HiddenCheckApiService { * @param pd * @throws Exception */ - public int checkHidden(String HIDDEN_ID, String HIDDENCHECK_ID,String CHECKDESCR, String CHECK_TIME, - String DEPARTMENT_ID, String USER_ID) throws Exception { + public PageData checkHidden(String HIDDEN_ID, String HIDDENCHECK_ID, String CHECKDESCR, String CHECK_TIME, + String DEPARTMENT_ID, String USER_ID) throws Exception { PageData pd = new PageData(); pd.put("HIDDENCHECK_ID",HIDDENCHECK_ID); pd.put("HIDDEN_ID",HIDDEN_ID); //隐患ID @@ -192,7 +192,9 @@ public class HiddenCheckApiServiceImpl implements HiddenCheckApiService { examPd.put("spare2",CHECK_TIME); examPd.put("TYPE","8"); hiddenExamineApiMapper.save(examPd); - return hiddenCheckApiMapper.checkHidden(pd); + int result = hiddenCheckApiMapper.checkHidden(pd); + examPd.put("result",result); + return examPd; } /**根据隐患信息删除隐患验收人。 * @param hiddenId diff --git a/src/main/java/com/zcloud/service/hiddenApi/impl/HiddenExamineApiServiceImpl.java b/src/main/java/com/zcloud/service/hiddenApi/impl/HiddenExamineApiServiceImpl.java index f7c864cd..8462d4d4 100644 --- a/src/main/java/com/zcloud/service/hiddenApi/impl/HiddenExamineApiServiceImpl.java +++ b/src/main/java/com/zcloud/service/hiddenApi/impl/HiddenExamineApiServiceImpl.java @@ -195,11 +195,12 @@ public class HiddenExamineApiServiceImpl implements HiddenExamineApiService { } /** * 隐患打回 + * * @param hiddenId * @param EXAMINE * @throws Exception */ - public int saveRepulseCheck(String hiddenId ,String EXAMINE)throws Exception{ + public PageData saveRepulseCheck(String hiddenId , String EXAMINE)throws Exception{ PageData exam = new PageData();// 添加隐患初始信息 exam.put("HIDDENEXAMINE_ID",UuidUtil.get32UUID()); exam.put("CREATOR",Jurisdiction.getUSER_ID()); @@ -210,7 +211,9 @@ public class HiddenExamineApiServiceImpl implements HiddenExamineApiService { exam.put("STATE",-1);//验收打回变成初始状态-1 exam.put("EXAMINE",EXAMINE);//打回意见 exam.put("HIDDEN_ID",hiddenId);//隐患ID - return hiddenExamineApiMapper.save(exam); + int saveInt = hiddenExamineApiMapper.save(exam); + exam.put("saveInt",saveInt); + return exam; } public PageData saveRectify(String hiddenId )throws Exception{ diff --git a/src/main/java/com/zcloud/service/inspection/SafetyEnvironmentalExplainService.java b/src/main/java/com/zcloud/service/inspection/SafetyEnvironmentalExplainService.java index 85839445..b65ec086 100644 --- a/src/main/java/com/zcloud/service/inspection/SafetyEnvironmentalExplainService.java +++ b/src/main/java/com/zcloud/service/inspection/SafetyEnvironmentalExplainService.java @@ -13,11 +13,14 @@ import java.util.List; */ public interface SafetyEnvironmentalExplainService{ - /**新增 - * @param pd - * @throws Exception - */ - public void save(PageData pd)throws Exception; + /** + * 新增 + * + * @param pd + * @return + * @throws Exception + */ + public PageData save(PageData pd)throws Exception; /**删除 * @param pd diff --git a/src/main/java/com/zcloud/service/inspection/SafetyEnvironmentalInspectorService.java b/src/main/java/com/zcloud/service/inspection/SafetyEnvironmentalInspectorService.java index 50210d9d..f2810fef 100644 --- a/src/main/java/com/zcloud/service/inspection/SafetyEnvironmentalInspectorService.java +++ b/src/main/java/com/zcloud/service/inspection/SafetyEnvironmentalInspectorService.java @@ -68,10 +68,12 @@ public interface SafetyEnvironmentalInspectorService{ List findByIds(PageData pd)throws Exception; /** - * 检查人核实 - * @param pd - */ - void verify(PageData pd)throws Exception; + * 检查人核实 + * + * @param pd + * @return + */ + PageData verify(PageData pd)throws Exception; /**删除(根据检查ID) * @param pd diff --git a/src/main/java/com/zcloud/service/inspection/impl/SafetyEnvironmentalExplainServiceImpl.java b/src/main/java/com/zcloud/service/inspection/impl/SafetyEnvironmentalExplainServiceImpl.java index 70ac9f64..1c4a2906 100644 --- a/src/main/java/com/zcloud/service/inspection/impl/SafetyEnvironmentalExplainServiceImpl.java +++ b/src/main/java/com/zcloud/service/inspection/impl/SafetyEnvironmentalExplainServiceImpl.java @@ -7,7 +7,6 @@ import com.zcloud.service.bus.HiddenService; import com.zcloud.service.inspection.SafetyEnvironmentalExplainService; import com.zcloud.service.inspection.SafetyEnvironmentalLogService; import com.zcloud.service.inspection.SafetyEnvironmentalService; -import com.zcloud.util.Jurisdiction; import com.zcloud.util.Tools; import com.zcloud.util.UuidUtil; import org.springframework.beans.factory.annotation.Autowired; @@ -37,12 +36,15 @@ public class SafetyEnvironmentalExplainServiceImpl implements SafetyEnvironmenta @Autowired private SafetyEnvironmentalLogService safetyenvironmentallogService; - /**新增 - * @param pd - * @throws Exception - */ + /** + * 新增 + * + * @param pd + * @return + * @throws Exception + */ @Transactional - public void save(PageData pd)throws Exception{ + public PageData save(PageData pd)throws Exception{ PageData inspection = safetyEnvironmentalService.findById(pd); inspection.put("INSPECTED_EXPLAIN", pd.getString("INSPECTED_EXPLAIN")); if (Tools.notEmpty(pd.getString("INSPECTED_EXPLAIN_FILENAME"))) { @@ -81,6 +83,7 @@ public class SafetyEnvironmentalExplainServiceImpl implements SafetyEnvironmenta safetyenvironmentallogService.save(log); safetyenvironmentalexplainMapper.save(pd); + return log; } /**删除 diff --git a/src/main/java/com/zcloud/service/inspection/impl/SafetyEnvironmentalInspectorServiceImpl.java b/src/main/java/com/zcloud/service/inspection/impl/SafetyEnvironmentalInspectorServiceImpl.java index b989bbb6..e17cc3bd 100644 --- a/src/main/java/com/zcloud/service/inspection/impl/SafetyEnvironmentalInspectorServiceImpl.java +++ b/src/main/java/com/zcloud/service/inspection/impl/SafetyEnvironmentalInspectorServiceImpl.java @@ -1,5 +1,6 @@ package com.zcloud.service.inspection.impl; +import com.alibaba.fastjson.JSON; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.mapper.datasource.inspection.SafetyEnvironmentalInspectorMapper; @@ -35,7 +36,8 @@ public class SafetyEnvironmentalInspectorServiceImpl implements SafetyEnvironmen private NoticeCorpUtil util; @Override - public void verify(PageData pd) throws Exception { + public PageData verify(PageData pd) throws Exception { + PageData pageData = new PageData(); if ("1".equals(pd.getString("INSPECTION_STATUS"))) { //检查进度状态 1.部分检查人员已核实 List list = safetyenvironmentalinspectorMapper.listOtherNotVerify(pd); if (list.size() == 0) { @@ -56,8 +58,10 @@ public class SafetyEnvironmentalInspectorServiceImpl implements SafetyEnvironmen log.put("ACTION", "安全环保检查申请"); //操作内容 log.put("CREATTIME", pd.getString("OPERATTIME")); //添加时间 log.put("CREATOR", pd.getString("ACTION_USER")); //添加人姓名 + pageData.put("log", JSON.toJSONString(log)); safetyenvironmentallogService.save(log); safetyenvironmentalinspectorMapper.edit(pd); + return pageData; } /** diff --git a/src/main/java/com/zcloud/service/inspection/impl/SafetyEnvironmentalServiceImpl.java b/src/main/java/com/zcloud/service/inspection/impl/SafetyEnvironmentalServiceImpl.java index 45f4983f..17173da1 100644 --- a/src/main/java/com/zcloud/service/inspection/impl/SafetyEnvironmentalServiceImpl.java +++ b/src/main/java/com/zcloud/service/inspection/impl/SafetyEnvironmentalServiceImpl.java @@ -19,6 +19,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.ArrayList; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; @@ -70,6 +71,8 @@ public class SafetyEnvironmentalServiceImpl implements SafetyEnvironmentalServic if (Tools.notEmpty(pd.getString("SITUATIONJSON"))) { List list = (List) JSON.parse(pd.getString("SITUATIONJSON")); String time = currentTime; + HashMap situationMap = new HashMap<>(); + int count = 1; for (JSONObject json : list) { PageData situationPd = new PageData(); situationPd.put("INSPECTION_SITUATION_ID", UuidUtil.get32UUID()); //主键 @@ -81,13 +84,18 @@ public class SafetyEnvironmentalServiceImpl implements SafetyEnvironmentalServic situationPd.put("OPERATOR", pd.getString("OPERATOR")); //修改人 situationPd.put("OPERATTIME", time); //修改时间 situationPd.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); //企业ID + situationMap.put("situationPd"+count,JSON.toJSONString(situationPd)); + count++; safetyenvironmentalsituationService.save(situationPd); time = DateUtil.calculateDateSecond(time, 1); } + pd.put("situationMap",situationMap); } if (Tools.notEmpty(pd.getString("INSPECTORJSON"))) { List list = (List) JSON.parse(pd.getString("INSPECTORJSON")); String time = currentTime; + HashMap inspectorMap = new HashMap<>(); + int count = 1; for (int i = 0; i < list.size(); i++) { JSONObject json = list.get(i); if (i == 0) { @@ -103,6 +111,8 @@ public class SafetyEnvironmentalServiceImpl implements SafetyEnvironmentalServic inspector.put("OPERATOR", pd.getString("OPERATOR")); //修改人 inspector.put("OPERATTIME", time); //修改时间 inspector.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); //企业ID + inspectorMap.put("inspector"+count,JSON.toJSONString(inspector)); + count++; boolean note_flag = true; if(StringUtils.isNotBlank(pd.getString("OPERATOR"))){ if (pd.getString("OPERATOR").equals(json.get("INSPECTION_USER_ID"))){ @@ -122,10 +132,13 @@ public class SafetyEnvironmentalServiceImpl implements SafetyEnvironmentalServic if (note_flag) noticeCorpUtil.SE_OneStepUtil(inspector); time = DateUtil.calculateDateSecond(time, 1); } + pd.put("inspectorMap",JSON.toJSONString(inspectorMap)); } if (Tools.notEmpty(pd.getString("HIDDENJSON"))) { List list = (List) JSON.parse(pd.getString("HIDDENJSON")); String time = currentTime; + HashMap hiddenMap = new HashMap<>(); + int count = 1; for (JSONObject json : list) { PageData hidden = new PageData(); hidden.put("HIDDEN_ID", UuidUtil.get32UUID()); //主键 @@ -147,7 +160,7 @@ public class SafetyEnvironmentalServiceImpl implements SafetyEnvironmentalServic hidden.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); hidden.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) hidden.put("POSITIONDESC",json.getString("POSITIONDESC")); - + hiddenMap.put("hidden"+count,JSON.toJSONString(hidden)); PageData before = new PageData();// 添加隐患初始信息 before.put("TYPE","0"); before.put("STATE","2"); @@ -164,10 +177,13 @@ public class SafetyEnvironmentalServiceImpl implements SafetyEnvironmentalServic findUser.put("USER_ID",json.getString("CREATOR")); findUser.put("TYPE","1"); findUser.put("IS_MAIN","0"); + hiddenMap.put("findUser"+count,JSON.toJSONString(findUser)); + count++; hiddenUserService.save(findUser); hiddenList.add(hidden); time = DateUtil.calculateDateSecond(time, 1); } + pd.put("hiddenMap",JSON.toJSONString(hiddenMap)); } PageData log = new PageData(); @@ -176,8 +192,8 @@ public class SafetyEnvironmentalServiceImpl implements SafetyEnvironmentalServic log.put("ACTION", "安全环保检查申请"); //操作内容 log.put("CREATTIME", pd.getString("CREATTIME")); //添加时间 log.put("CREATOR", pd.getString("ACTION_USER")); //添加人姓名 + pd.put("log",JSON.toJSONString(log)); safetyenvironmentallogService.save(log); - safetyenvironmentalMapper.save(pd); return hiddenList; }