From 271431816e81a7e1ac6ffb4e2bbd0a219700eb6d Mon Sep 17 00:00:00 2001 From: zhangqihang Date: Tue, 27 Feb 2024 08:47:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/hidden/HiddenController.java | 109 +++++++++++++++++- .../controller/system/UsersController.java | 20 ++-- .../datasource/hidden/HiddenMapper.xml | 2 +- .../mybatis/datasource/system/UsersMapper.xml | 2 +- 4 files changed, 117 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/zcloud/controller/hidden/HiddenController.java b/src/main/java/com/zcloud/controller/hidden/HiddenController.java index ff7f195..1b36495 100644 --- a/src/main/java/com/zcloud/controller/hidden/HiddenController.java +++ b/src/main/java/com/zcloud/controller/hidden/HiddenController.java @@ -8,6 +8,7 @@ import com.zcloud.entity.PageData; import com.zcloud.entity.system.Dictionaries; import com.zcloud.logs.LogAnno; import com.zcloud.service.bus.HiddenUserService; +import com.zcloud.service.bus.NoticeCorpUtil; import com.zcloud.service.check.ListManagerService; import com.zcloud.service.check.RecordItemService; import com.zcloud.service.corp.CorpInfoService; @@ -17,10 +18,7 @@ import com.zcloud.service.hidden.HiddenService; import com.zcloud.service.inspection.SafetyEnvironmentalService; import com.zcloud.service.sms.SMSLogService; import com.zcloud.service.sms.SMSManagementService; -import com.zcloud.service.system.DepartmentService; -import com.zcloud.service.system.DictionariesService; -import com.zcloud.service.system.ImgFilesService; -import com.zcloud.service.system.UsersService; +import com.zcloud.service.system.*; import com.zcloud.util.*; import com.zcloud.util.message.MessageService; import net.sf.json.JSONArray; @@ -35,6 +33,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.text.SimpleDateFormat; import java.util.*; @@ -46,6 +45,10 @@ import java.util.*; @RequestMapping("/hidden") public class HiddenController extends BaseController { + @Autowired + private FHlogService FHLOG;//日志记录 + @Autowired + private NoticeCorpUtil noticeUtil; @Autowired private HiddenService hiddenService; @Autowired @@ -2124,4 +2127,102 @@ public class HiddenController extends BaseController { map.put("result", errInfo); return map; } + + /** + * 安全环保检查验收 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/finalcheck") + @ResponseBody + public Object finalcheck() throws Exception { + // 获取IP + HttpServletRequest request = this.getRequest(); + String ip = ""; + if (request.getHeader("x-forwarded-for") == null) { + ip = request.getRemoteAddr(); + } else { + ip = request.getHeader("x-forwarded-for"); + } + + + + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("ACCEPTSTEP", 7); + pd.put("x",false); + boolean success = false; +// List list2 = hiddenService.listOtherNotAccept4pc(pd); +// success = (boolean) pd.get("x"); +// if (success) { +// return null; +// }else { +// return null; +// } + + + + pd.put("FINAL_CHECKOR", Jurisdiction.getUSER_ID()); + hiddenService.finalcheck(pd); + // 是 + if ("1".equals(pd.get("FINAL_CHECK").toString())) { + if (Tools.notEmpty(pd.getString("INSPECTION_ID"))) { //安全环保检查验收 + pd.put("ACCEPTSTEP", 7); + List list = hiddenService.listOtherNotAccept4pc(pd); + if (list.size() == 0) { + PageData inspection = new PageData(); + inspection.put("INSPECTION_ID", pd.getString("INSPECTION_ID")); + inspection.put("OPERATOR", Jurisdiction.getUSER_ID()); + inspection.put("OPERATTIME", DateUtil.date2Str(new Date())); + inspection.put("INSPECTION_STATUS", "8"); // 已验收 + + safetyenvironmentalService.editStatus(inspection); + } + } + } else { + // 否 + PageData pd2 = new PageData(); + pd2.put("FOREIGN_KEY", pd.get("HIDDEN_ID")); + pd2.put("TYPE", "4"); + List zgImgs = imgFilesService.listAll(pd2); + for (PageData pageData : zgImgs) { + imgFilesService.delete(pageData); + if (Tools.notEmpty(pageData.getString("FILEPATH"))) { + smb.deleteFile(pageData.getString("FILEPATH")); + } + } + PageData hidden = new PageData(); + hidden.put("HIDDEN_ID", pd.get("HIDDEN_ID")); + hidden.put("STATE", "101"); //修改隐患表状态为验收打回 + hiddenService.changeState(hidden); + PageData inspection = new PageData(); + inspection.put("INSPECTION_ID", pd.getString("INSPECTION_ID")); + inspection.put("OPERATOR", Jurisdiction.getUSER_ID()); + inspection.put("OPERATTIME", DateUtil.date2Str(new Date())); + inspection.put("INSPECTION_STATUS", "3"); // 安全环保检查打回到归档,隐患待指派 + safetyenvironmentalService.editStatus(inspection); + inspection.put("SENDER_ID", Jurisdiction.getUSER_ID()); + inspection.put("SENDER_NAME", Jurisdiction.getName()); + noticeUtil.SE_Repulse(inspection); + // hiddenExamineService.deleteByHiddenId(pd); 如果验收打回删除隐患相关信息 + FHLOG.save(Jurisdiction.getName(), "删除隐患ID:" + pd.getString("HIDDEN_ID") + ",关于hiddenexamine表数据", ip); +// hidden.put("HIDDENEXAMINE_ID",this.get32UUID()); +// hidden.put("EXAMINE",pd.get("CONTENT"));//打回意见 +// hidden.put("CREATOR",Jurisdiction.getUSER_ID()); +// hidden.put("CREATTIME",DateUtil.date2Str(new Date())); +// hidden.put("OPERATOR",Jurisdiction.getUSER_ID()); +// hidden.put("OPERATTIME",DateUtil.date2Str(new Date())); +// hidden.put("TYPE",3);//验收打回 +// hidden.put("STATE",-1);//验收打回变成初始状态-1 +// hiddenExamineService.save(hidden); + } + map.put("check", pd); + map.put("result", errInfo); + return map; + } + + } diff --git a/src/main/java/com/zcloud/controller/system/UsersController.java b/src/main/java/com/zcloud/controller/system/UsersController.java index 8e7a057..585f6c8 100644 --- a/src/main/java/com/zcloud/controller/system/UsersController.java +++ b/src/main/java/com/zcloud/controller/system/UsersController.java @@ -411,18 +411,18 @@ public class UsersController extends BaseController { PageData pd = this.getPageData(); - if (pd.get("USERAVATARURL") != null && !pd.getString("USERAVATARURL").equals("")) { +// if(pd.get("USERAVATARURL")!=null && !pd.getString("USERAVATARURL").equals("")){ // System.out.println("USERAVATARURL原长度:"+pd.getString("USERAVATARURL").length()); - String USERAVATARURL64 = ImageAnd64Binary.zipBase64(pd.getString("USERAVATARURL")); +// String USERAVATARURL64 = ImageAnd64Binary.zipBase64(pd.getString("USERAVATARURL")); // System.out.println("USERAVATARURL压缩长度:"+USERAVATARURL64.length()); - try { - FaceUtil.compareFace(pd.getString("USERAVATARURL"), pd.getString("USERAVATARURL")); - } catch (Exception e) { - map.put("result", "fail"); - map.put("msg", "人脸图像不符合要求 请重新上传!"); - return map; - } - } +//// try{ +//// FaceUtil.compareFace(pd.getString("USERAVATARURL"),pd.getString("USERAVATARURL")); +//// }catch (Exception e){ +//// map.put("result", "Error"); +//// map.put("msg", "人脸图像不符合要求 请重新上传!"); +//// return map; +//// } +// } if ("input".equals(pd.getString("LEARNERCATEGORYSTATUS"))) { pd.put("DICTTYPE", "APPLICABLE_PERSONNEL"); diff --git a/src/main/resources/mybatis/datasource/hidden/HiddenMapper.xml b/src/main/resources/mybatis/datasource/hidden/HiddenMapper.xml index 879cc3b..38e94e3 100644 --- a/src/main/resources/mybatis/datasource/hidden/HiddenMapper.xml +++ b/src/main/resources/mybatis/datasource/hidden/HiddenMapper.xml @@ -461,7 +461,7 @@ left join sys_user re on re.USER_ID = f.RECTIFICATIONOR left join sys_user ch on ch.USER_ID = f.CHECKOR left join sys_user conUser on conUser.USER_ID = f.CONFIRM_USER - left join oa_department crd on crd.DEPARTMENT_ID = f.HIDDENFINDDEPT + left join oa_department crd on crd.DEPARTMENT_ID = cr.DEPARTMENT_ID left join oa_department red on red.DEPARTMENT_ID = f.RECTIFICATIONDEPT left join oa_department chd on chd.DEPARTMENT_ID = f.CHECKDEPT left join bus_checkrecord bc on bc.CHECKRECORD_ID = f.CHECKRECORD_ID and bc.ISDELETE = 0 diff --git a/src/main/resources/mybatis/datasource/system/UsersMapper.xml b/src/main/resources/mybatis/datasource/system/UsersMapper.xml index 0bbaa32..0c0e37c 100644 --- a/src/main/resources/mybatis/datasource/system/UsersMapper.xml +++ b/src/main/resources/mybatis/datasource/system/UsersMapper.xml @@ -284,7 +284,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ,LEARNERCATEGORY = #{LEARNERCATEGORY} - + ,USERAVATARPREFIX = #{USERAVATARPREFIX} ,USERAVATARURL = #{USERAVATARURL}