From 3b1afc834433af08a72cbcb9bea5535aa1e551b2 Mon Sep 17 00:00:00 2001 From: songwenxuan <1924103812@qq.com> Date: Tue, 19 Dec 2023 17:28:02 +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/app/AppHiddenController.java | 2 ++ .../controller/bus/CheckRecordController.java | 20 ++++++++++------ .../controller/bus/HiddenController.java | 13 +++++++++-- .../hiddenApi/HiddenApiController.java | 23 ++++++++++++------- .../zcloud/service/bus/HiddenUserService.java | 6 ++++- .../bus/impl/HiddenUserServiceImpl.java | 20 ++++++++++++---- .../service/hiddenApi/HiddenApiService.java | 13 ++++++----- .../hiddenApi/HiddenCheckApiService.java | 21 +++++++++-------- .../hiddenApi/HiddenExamineApiService.java | 4 ++-- .../hiddenApi/impl/HiddenApiServiceImpl.java | 4 ++-- .../impl/HiddenCheckApiServiceImpl.java | 20 +++++++++++----- .../impl/HiddenExamineApiServiceImpl.java | 7 ++++-- 12 files changed, 103 insertions(+), 50 deletions(-) diff --git a/src/main/java/com/zcloud/controller/app/AppHiddenController.java b/src/main/java/com/zcloud/controller/app/AppHiddenController.java index 2e4fe821..e79a4918 100644 --- a/src/main/java/com/zcloud/controller/app/AppHiddenController.java +++ b/src/main/java/com/zcloud/controller/app/AppHiddenController.java @@ -10,6 +10,7 @@ import java.util.Map; import java.util.Random; import java.io.File; +import com.zcloud.aspect.DockAnnotation; import com.zcloud.controller.bus.HiddenController; import com.zcloud.service.bus.*; import com.zcloud.service.hiddenApi.HiddenApiService; @@ -642,6 +643,7 @@ public class AppHiddenController extends BaseController { */ @RequestMapping(value = "/delete") @ResponseBody + @DockAnnotation public Object delete() throws Exception { // 获取IP HttpServletRequest request = this.getRequest(); diff --git a/src/main/java/com/zcloud/controller/bus/CheckRecordController.java b/src/main/java/com/zcloud/controller/bus/CheckRecordController.java index 609f242d..a913c985 100644 --- a/src/main/java/com/zcloud/controller/bus/CheckRecordController.java +++ b/src/main/java/com/zcloud/controller/bus/CheckRecordController.java @@ -142,9 +142,6 @@ public class CheckRecordController extends BaseController { pd.put("PERIODSTART", list.get("START_DATE")); pd.put("PERIODEND", list.get("END_DATE")); } - - - checkrecordService.save(pd); checkuserService.delete(pd); PageData checkUser = new PageData(); @@ -152,9 +149,12 @@ public class CheckRecordController extends BaseController { checkUser.put("CHECKRECORD_ID", pd.get("CHECKRECORD_ID")); checkUser.put("DEPARTMENT_ID", pd.get("CHECKDEPT")); checkUser.put("USER_ID", pd.get("CHECKOR")); + pd.put("checkUser", JSON.toJSONString(checkUser)); checkuserService.save(checkUser); if (pd.get("OTHER") != null && !pd.get("OTHER").equals("")) { List userList = (List) JSON.parse(pd.get("OTHER").toString()); + HashMap otherMap = new HashMap<>(); + int count = 1; for (JSONObject json : userList) { if (json.get("DEPARTMENT_ID") != null && json.get("DEPARTMENT_ID") != "" && json.get("USER_ID") != null && json.get("USER_ID") != "") { @@ -163,12 +163,17 @@ public class CheckRecordController extends BaseController { other.put("CHECKRECORD_ID", pd.get("CHECKRECORD_ID")); other.put("DEPARTMENT_ID", json.get("DEPARTMENT_ID")); other.put("USER_ID", json.get("USER_ID")); + otherMap.put("other"+count,JSON.toJSONString(other)); + count+=1; checkuserService.save(other); } } + pd.put("otherMap",JSON.toJSONString(otherMap)); } if (pd.get("ITEMS") != null && !pd.get("ITEMS").equals("")) { List itemsList = (List) JSON.parse(pd.get("ITEMS").toString()); + Map itemMap = new HashMap<>(); + int count = 1; for (JSONObject json : itemsList) { PageData item = new PageData(); item.put("RECORDITEM_ID", json.get("RECORDITEM_ID")); // 主键 @@ -190,9 +195,11 @@ public class CheckRecordController extends BaseController { item.put("RISKPOINT_ID", chei.get("RISKPOINT_ID")); item.put("LONGITUDE", pd.get("LONGITUDE")); item.put("LATITUDE", pd.get("LATITUDE")); + itemMap.put("item"+count, JSON.toJSONString(item)); + count+=1; recordItemService.save(item); - } + pd.put("itemMap",JSON.toJSONString(itemMap)); } if (pd.get("IDS") != null && !pd.get("IDS").equals("")) { String ids = pd.get("IDS").toString(); @@ -220,9 +227,7 @@ public class CheckRecordController extends BaseController { hiddenpd.getString("HIDDENDESCR"),"隐患确认","确认","",""); } } - - - + map.put("dockData", JSON.toJSONString(pd)); map.put("result", errInfo); return map; } @@ -236,6 +241,7 @@ public class CheckRecordController extends BaseController { @RequestMapping(value = "/delete") @RequiresPermissions("checkrecord:del") @ResponseBody + @DockAnnotation public Object delete() throws Exception { Map map = new HashMap(); String errInfo = "success"; diff --git a/src/main/java/com/zcloud/controller/bus/HiddenController.java b/src/main/java/com/zcloud/controller/bus/HiddenController.java index 6d997e29..4cc2881e 100644 --- a/src/main/java/com/zcloud/controller/bus/HiddenController.java +++ b/src/main/java/com/zcloud/controller/bus/HiddenController.java @@ -140,7 +140,8 @@ public class HiddenController extends BaseController { PageData hiddenRegion = hiddenRegionService.saveHidden(pd.getString("HIDDENPART")); pd.put("HIDDENPART", hiddenRegion.getString("HIDDENREGION_ID")); } - hiddenUserService.saveRectificationo(pd.getString("findCreator"), pd.getString("HIDDEN_ID"), "1"); + Map saveMap = hiddenUserService.saveRectificationo(pd.getString("findCreator"), pd.getString("HIDDEN_ID"), "1"); + pd.put("saveMap",JSON.toJSONString(saveMap)); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业id if (pd.get("RECTIFICATIONTYPE") != null && Tools.notEmpty(pd.get("RECTIFICATIONTYPE").toString())) { @@ -162,6 +163,7 @@ public class HiddenController extends BaseController { PageData loginDeptPd = new PageData(); loginDeptPd.put("DEPARTMENT_ID", Jurisdiction.getDEPARTMENT_ID()); PageData longinfoUserDept = departmentService.findById(loginDeptPd);//获取登录人部门信息 + pd.put("longinfoUserDept",JSON.toJSONString(longinfoUserDept)); if (Tools.isEmpty(longinfoUserDept) || Tools.isEmpty(longinfoUserDept.getString("HEADMAN"))) {// 查看部门是否有负责人 return ResultCodeConstant.resMap(000201); //所在部门未维护部门负责人 } else {//如何维护了,隐患确认人就要成为部门负责人 @@ -274,6 +276,7 @@ public class HiddenController extends BaseController { */ @RequestMapping(value = "/listAdd") @ResponseBody + @DockAnnotation(isAdd = true) public Object listAdd() throws Exception { Map map = new HashMap(); String errInfo = "success"; @@ -306,11 +309,13 @@ public class HiddenController extends BaseController { } } pd.put("ISCONFIRM", "0"); - hiddenUserService.saveRectificationo(pd.getString("findCreator"), pd.getString("HIDDEN_ID"), "1"); + Map saveMap = hiddenUserService.saveRectificationo(pd.getString("findCreator"), pd.getString("HIDDEN_ID"), "1"); + pd.put("saveMap", JSON.toJSONString(saveMap)); if (pd.getString("HIDDENLEVEL").equals("jdyh001") || pd.getString("HIDDENLEVEL").equals("hiddenLevel2002")) {//判断是否是重大隐患 PageData userpd = new PageData(); userpd.put("USER_ID", Jurisdiction.getUSER_ID()); userpd.put("DEPARTMENT_ID", usersService.findById(userpd).getString("DEPARTMENT_ID"));//获取登录人的部门ID + pd.put("userpd",JSON.toJSONString(userpd)); if (departmentService.findById(userpd).getString("LEVEL").equals("departmentLevel0003")) {//判断部门级别是不是班组 userpd.put("DEPARTMENT_ID", departmentService.findById(userpd).getString("DEPARTMENT_ID")); if (Tools.isEmpty(departmentService.findById(userpd).getString("HEADMAN"))) {//判断部门是否有负责人 @@ -343,10 +348,12 @@ public class HiddenController extends BaseController { before.put("spare4", pd.getString("RECTIFICATIONDEPT")); before.put("CREATOR", pd.getString("loginUserId")); before.put("OPERATOR", pd.getString("loginUserId")); + pd.put("before", JSON.toJSONString(before)); hiddenExamineService.saveApp(before); hiddenService.save(pd); map.put("result", errInfo); map.put("pd", pd); + map.put("dockData",JSON.toJSONString(pd)); return map; } @@ -371,6 +378,7 @@ public class HiddenController extends BaseController { */ @RequestMapping(value = "/delete") @ResponseBody + @DockAnnotation public Object delete() throws Exception { // 获取IP HttpServletRequest request = this.getRequest(); @@ -2030,6 +2038,7 @@ public class HiddenController extends BaseController { @RequestMapping(value = "/confirmHidden") @RequiresPermissions("hidden:edit") @ResponseBody + @DockAnnotation public Object confirmHidden() 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 ff394201..f4fc76ec 100644 --- a/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java +++ b/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java @@ -1,5 +1,7 @@ package com.zcloud.controller.hiddenApi; +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; @@ -369,13 +371,12 @@ public class HiddenApiController extends BaseController { @RequestMapping(value = "/confirmHidden") @RequiresPermissions("hidden:edit") @ResponseBody + @DockAnnotation(isAdd = true) public Object confirmHidden() throws Exception { Map map = new HashMap(); Integer code = 000000; PageData pd = new PageData(); pd = this.getPageData(); - - String HIDDENLEVEL = pd.getString("HIDDENLEVEL"); // 隐患级别 String RECTIFICATIONOR = pd.getString("RECTIFICATIONOR");//整改负责人 String RECTIFICATIONDEADLINE = pd.getString("RECTIFICATIONDEADLINE"); //整改完成期限 @@ -430,9 +431,10 @@ public class HiddenApiController extends BaseController { hidden.put("RECTIFICATIONOR",RECTIFICATIONOR); hidden.put("RECTIFICATIONDEADLINE",RECTIFICATIONDEADLINE); hidden.put("RECTIFICATIONDEPT",RECTIFICATIONDEPT); - hiddenExamineApiService.saveConfirm(hidden, "4"); //添加隐患处理流程 - hiddenApiService.confirmHidden(pd); //确认 - + PageData pageData = hiddenExamineApiService.saveConfirm(hidden, "4"); //添加隐患处理流程 + pd.put("pageData", JSON.toJSONString(pageData)); + PageData confirm = hiddenApiService.confirmHidden(pd); //确认 + pd.put("confirm", JSON.toJSONString(confirm)); if (Tools.notEmpty(pd.getString("RECTIFICATIONOR")) && !hidden.getString("RECTIFICATIONTYPE").equals("1")) { messageService.sendMessageByParameter("HIDDEN_MAIL_002", "友情提示:有一条隐患需要整改", hidden.getString("CORPINFO_ID"), pd.getString("USER_ID"), hidden.getString("HIDDEN_ID"), @@ -442,6 +444,7 @@ public class HiddenApiController extends BaseController { hidden.getString("CORPINFO_ID"), pd.getString("USER_ID"), hidden.getString("HIDDEN_ID"), hidden.getString("HIDDENDESCR"), "通过", "整改", "", ""); } + map.put("dockData",JSON.toJSONString(pd)); return ResultCodeConstant.resMap(code, map); } @@ -500,6 +503,7 @@ public class HiddenApiController extends BaseController { @RequestMapping(value = "/rectify") @RequiresPermissions("hidden:list") @ResponseBody + @DockAnnotation(isAdd = true) public Object rectify() throws Exception { /** * 修改隐患信息 @@ -548,16 +552,19 @@ public class HiddenApiController extends BaseController { map.put("hiddenSchemeState", hiddenSchemeState); } /** 隐患验收信息 **/ - int hiddenCheckState = hiddenCheckApiService.saveHiddenCheck(pd.getString("CHECKOR"), pd.getString("CHECKDEPT"), pd.getString("OTHER"), pd.getString("HIDDEN_ID"), hidden.getString("HIDDENDESCR")); + PageData hiddenCheck = hiddenCheckApiService.saveHiddenCheck(pd.getString("CHECKOR"), pd.getString("CHECKDEPT"), pd.getString("OTHER"), pd.getString("HIDDEN_ID"), hidden.getString("HIDDENDESCR")); + pd.put("hiddenCheck",JSON.toJSONString(hiddenCheck)); /** 隐患延时申请的要通过 **/ - hiddenExamineApiService.saveRectify(pd.getString("HIDDEN_ID")); //添加隐患整改记录 + PageData exam = hiddenExamineApiService.saveRectify(pd.getString("HIDDEN_ID")); //添加隐患整改记录 + pd.put("exam", JSON.toJSONString(exam)); List hiddenUserList = hiddenUserApiService.getListByHiddenId(pd.getString("HIDDEN_ID")); for (PageData pageData : hiddenUserList) { if ("2".equals(pageData.getString("TYPE")) && "-1".equals(pageData.getString("STATE"))) { //延期审核 没有审批的 hiddenExamineApiService.adoptExamine(pageData.getString("HIDDENEXAMINE_ID"), "整改完成"); } } - map.put("hiddenCheckState", hiddenCheckState); + map.put("hiddenCheckState", hiddenCheck.get("retint")); + map.put("dockData",JSON.toJSONString(pd)); return ResultCodeConstant.resMap(code, map); } diff --git a/src/main/java/com/zcloud/service/bus/HiddenUserService.java b/src/main/java/com/zcloud/service/bus/HiddenUserService.java index 959576d6..12473651 100644 --- a/src/main/java/com/zcloud/service/bus/HiddenUserService.java +++ b/src/main/java/com/zcloud/service/bus/HiddenUserService.java @@ -1,6 +1,8 @@ package com.zcloud.service.bus; import java.util.List; +import java.util.Map; + import com.zcloud.entity.Page; import com.zcloud.entity.PageData; @@ -56,9 +58,11 @@ public interface HiddenUserService{ /** * 添加隐患整改人 + * + * @return * @throws Exception */ - public void saveRectificationo (String userIds ,String hiddenId ,String type)throws Exception; + public Map saveRectificationo (String userIds , String hiddenId , String type)throws Exception; /** * 根据隐患ids获取隐患相关人员 diff --git a/src/main/java/com/zcloud/service/bus/impl/HiddenUserServiceImpl.java b/src/main/java/com/zcloud/service/bus/impl/HiddenUserServiceImpl.java index aefd2ea3..debab1fc 100644 --- a/src/main/java/com/zcloud/service/bus/impl/HiddenUserServiceImpl.java +++ b/src/main/java/com/zcloud/service/bus/impl/HiddenUserServiceImpl.java @@ -2,6 +2,7 @@ package com.zcloud.service.bus.impl; import java.util.*; +import com.alibaba.fastjson.JSON; import com.zcloud.util.Jurisdiction; import com.zcloud.util.Tools; import com.zcloud.util.UuidUtil; @@ -84,12 +85,15 @@ public class HiddenUserServiceImpl implements HiddenUserService{ /** * 添加隐患相关人员信息 -- 有主要处理人 - * @param userIds 用户ids - * @param hiddenId 隐患id - * @param type 类别 + * + * @param userIds 用户ids + * @param hiddenId 隐患id + * @param type 类别 + * @return * @throws Exception */ - public void saveRectificationo(String userIds ,String hiddenId,String type)throws Exception{ + public Map saveRectificationo(String userIds , String hiddenId, String type)throws Exception{ + Map saveMap = new HashMap<>(); if(!Tools.isEmpty(hiddenId)){ PageData del = new PageData(); del.put("TYPE",type); @@ -97,7 +101,10 @@ public class HiddenUserServiceImpl implements HiddenUserService{ hiddenuserMapper.deleteByHidden(del); // 先删除后添加 } if(!Tools.isEmpty(userIds)){ + saveMap.put("USER_ID",Jurisdiction.getUSER_ID()); String removeLoginUser = userIds.replaceAll(Jurisdiction.getUSER_ID(),""); //去除当前登录人的用户id + HashMap hiddenUserMap = new HashMap<>(); + int count = 1; String userID [] = removeLoginUser.split(","); for (int i =0;i notRepr = new HashMap<>(); notRepr.put("hiddendescr",hiddenDescr);// @@ -131,6 +133,8 @@ public class HiddenCheckApiServiceImpl implements HiddenCheckApiService { if (checkOhther != null && !checkOhther.equals("") && !checkOhther.equals("[]")) { List list = (List) JSON.parse(checkOhther); + Map otherMap = new HashMap<>(); + int count = 1; for (JSONObject json : list) { PageData other = new PageData(); other.put("HIDDENCHECK_ID", UuidUtil.get32UUID()); // 主键 @@ -138,13 +142,17 @@ public class HiddenCheckApiServiceImpl implements HiddenCheckApiService { other.put("DEPARTMENT_ID", json.get("DEPARTMENT_ID")); other.put("USER_ID", json.get("USER_ID")); other.put("STATUS", "0"); + pageData.put("other"+count,JSON.toJSONString(other)); + count+=1; retint += hiddenCheckApiMapper.save(other); messageService.sendMessageByParameter("HIDDEN_MAIL_004","友情提示:有一条隐患需要验收", Jurisdiction.getCORPINFO_ID(),json.get("USER_ID").toString(),hiddenId, hiddenDescr,"隐患验收","验收","",""); } + pageData.put("otherMap",JSON.toJSONString(otherMap)); } - return retint; + pageData.put("retint",retint); + return pageData; } /**通过id获取数据 验收信息 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 ce21a889..f7c864cd 100644 --- a/src/main/java/com/zcloud/service/hiddenApi/impl/HiddenExamineApiServiceImpl.java +++ b/src/main/java/com/zcloud/service/hiddenApi/impl/HiddenExamineApiServiceImpl.java @@ -1,5 +1,6 @@ package com.zcloud.service.hiddenApi.impl; +import com.alibaba.fastjson.JSON; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.mapper.datasource.hiddenApi.HiddenExamineApiMapper; @@ -189,6 +190,7 @@ public class HiddenExamineApiServiceImpl implements HiddenExamineApiService { pageData.put("HIDDEN_ID",pd.get("HIDDEN_ID")); hiddenExamineApiMapper.deleteByHiddenIdAndType(pageData); hiddenExamineApiMapper.save(before); + pd.put("before", JSON.toJSONString(before)); return pd; } /** @@ -211,7 +213,7 @@ public class HiddenExamineApiServiceImpl implements HiddenExamineApiService { return hiddenExamineApiMapper.save(exam); } - public int saveRectify(String hiddenId )throws Exception{ + public PageData saveRectify(String hiddenId )throws Exception{ PageData exam = new PageData();// 添加隐患初始信息 exam.put("HIDDENEXAMINE_ID",UuidUtil.get32UUID()); exam.put("CREATOR",Jurisdiction.getUSER_ID()); @@ -220,7 +222,8 @@ public class HiddenExamineApiServiceImpl implements HiddenExamineApiService { exam.put("OPERATTIME",DateUtil.date2Str(new Date())); exam.put("TYPE",7);//隐患整改 exam.put("STATE",-1);//验收打回变成初始状态-1 - return hiddenExamineApiMapper.save(exam); + hiddenExamineApiMapper.save(exam); + return exam; } /** * 通过 审批