diff --git a/bonus-modules/bonus-project/src/main/java/com/bonus/project/controller/SecurityCheckController.java b/bonus-modules/bonus-project/src/main/java/com/bonus/project/controller/SecurityCheckController.java index d36c68a..7e74d90 100644 --- a/bonus-modules/bonus-project/src/main/java/com/bonus/project/controller/SecurityCheckController.java +++ b/bonus-modules/bonus-project/src/main/java/com/bonus/project/controller/SecurityCheckController.java @@ -563,7 +563,7 @@ public class SecurityCheckController extends BaseController { @SysLog(title = "隐患整改审批", businessType = OperaType.EXPORT, logType = 0, module = "隐患整改审批->导出隐患整改审批列表数据") public void exportHiddenDangerRectificationApprovalList(HttpServletResponse response, @RequestBody SecurityCheckDto dto) { try { - List list = service.getHiddenDangerRectificationApprovalList(dto); + List list = service.getHiddenDangerRectificationApprovalListByPage(dto); ExcelUtil util = new ExcelUtil<>(HiddenDangerRectificationVo.class); util.exportExcel(response, list, "隐患整改审批列表导出"); } catch (Exception e) { diff --git a/bonus-modules/bonus-project/src/main/java/com/bonus/project/service/SecurityCheckService.java b/bonus-modules/bonus-project/src/main/java/com/bonus/project/service/SecurityCheckService.java index 9f03fcd..b4bfbc1 100644 --- a/bonus-modules/bonus-project/src/main/java/com/bonus/project/service/SecurityCheckService.java +++ b/bonus-modules/bonus-project/src/main/java/com/bonus/project/service/SecurityCheckService.java @@ -134,6 +134,7 @@ public interface SecurityCheckService { * @return 隐患整改审批列表 */ List getHiddenDangerRectificationApprovalList(SecurityCheckDto dto); + List getHiddenDangerRectificationApprovalListByPage(SecurityCheckDto dto); /** * 整改方隐患问题整改回传状态修改 diff --git a/bonus-modules/bonus-project/src/main/java/com/bonus/project/service/impl/SecurityCheckServiceImpl.java b/bonus-modules/bonus-project/src/main/java/com/bonus/project/service/impl/SecurityCheckServiceImpl.java index bb13c26..ae3f44c 100644 --- a/bonus-modules/bonus-project/src/main/java/com/bonus/project/service/impl/SecurityCheckServiceImpl.java +++ b/bonus-modules/bonus-project/src/main/java/com/bonus/project/service/impl/SecurityCheckServiceImpl.java @@ -56,7 +56,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { * @return 隐患问题类别配置列表 */ @Override - public List getHiddenDangerTypeList(SecurityCheckDto dto) { + public List getHiddenDangerTypeList(SecurityCheckDto dto) { return mapper.getHiddenDangerTypeList(dto); } @@ -114,11 +114,11 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { public AjaxResult deleteHiddenDangerTypeForm(String id) { try { int result = mapper.getIsThereARecord(id); - if (result > 0){ + if (result > 0) { return AjaxResult.error("该类型已使用,不可删除!"); } - mapper.deleteHiddenDangerTypeForm(id); - } catch (Exception e){ + mapper.deleteHiddenDangerTypeForm(id); + } catch (Exception e) { log.error(e.toString(), e); return AjaxResult.error("系统异常,请联系管理员"); } @@ -127,7 +127,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { /**************************************************安全检查记录********************************************/ - + /** * 获取安全检查记录列表 * @@ -165,7 +165,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { String params = allRequestParams.get("params"); SecurityCheckDto dto = JSONObject.parseObject(params, SecurityCheckDto.class); result = mapper.whetherThereIsACheckRecord(dto); - if (result > 0){ + if (result > 0) { return AjaxResult.error("该检查记录已存在,请勿重复添加"); } //查询最新一条的检查记录编号 @@ -213,17 +213,16 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { @Transactional(rollbackFor = Exception.class) public AjaxResult updateSecurityCheckRecordForm(MultipartFile[] photoList, MultipartFile[] attachmentList, Map allRequestParams) { int result = 0; - try{ + try { String params = allRequestParams.get("params"); SecurityCheckDto dto = JSONObject.parseObject(params, SecurityCheckDto.class); result = mapper.whetherThereIsACheckRecord(dto); - if (result > 0){ + if (result > 0) { return AjaxResult.error("该检查记录标题已存在,请勿重复添加"); } mapper.updateSecurityCheckRecordForm(dto); Long[] fileIds = dto.getFileId(); - if (fileIds != null && fileIds.length > 0) - { + if (fileIds != null && fileIds.length > 0) { //删除附件 mapper.deleteFiles(dto.getFileId()); } @@ -233,10 +232,10 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { if (attachmentList != null && attachmentList.length > 0) { processFiles(attachmentList, dto.getId(), "1", "2"); } - }catch (Exception e) { + } catch (Exception e) { log.error(e.toString(), e); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); - return AjaxResult.error(); + return AjaxResult.error("图片或文件格式错误,请重新上传"); } return AjaxResult.success(); @@ -247,7 +246,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { /** * 新增隐患 * - * @param checkPhotoList 现场照片 + * @param checkPhotoList 现场照片 * @param allRequestParams 保存数据 * @return 保存结果 */ @@ -356,6 +355,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { /** * 延期申请撤回 + * * @param id 隐患整改id * @return 撤回结果 */ @@ -393,7 +393,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { /**************************************************隐患问题整改********************************************/ - /** + /** * 获取隐患问题整改列表 * * @param dto 查询条件 @@ -403,28 +403,28 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { public List getHiddenDangerRectificationList(SecurityCheckDto dto) { RequestEntity entity = new RequestEntity(); //数据查询 - Map checkMaps= Maps.newHashMap(); - if("1".equals(dto.getStatus())){ + Map checkMaps = Maps.newHashMap(); + if ("1".equals(dto.getStatus())) { entity.setUserId(String.valueOf(SecurityUtils.getLoginUser().getUserid())); AjaxResult ajaxResult = flowTaskService.getStayFlow(entity); if (ajaxResult.isSuccess()) { List> data = (List>) ajaxResult.get("data"); - List proInsId=new ArrayList<>(); - data.forEach(map->{ - proInsId.add((String)map.get("proInsId")); - checkMaps.put((String)map.get("proInsId"),(String) map.get("finalCheck")); + List proInsId = new ArrayList<>(); + data.forEach(map -> { + proInsId.add((String) map.get("proInsId")); + checkMaps.put((String) map.get("proInsId"), (String) map.get("finalCheck")); }); - if(com.bonus.common.core.utils.StringUtils.isNotEmpty(data)){ + if (com.bonus.common.core.utils.StringUtils.isNotEmpty(data)) { dto.setDataType(1); dto.setProInsId(proInsId); } } } PageUtils.startPage(); - List list = mapper.getHiddenDangerRectificationList(dto); - list.forEach(data->{ + List list = mapper.getHiddenDangerRectificationList(dto); + list.forEach(data -> { - if("1".equals(data.getStatus()) && dto.getDataType()==1){ + if ("1".equals(data.getStatus()) && dto.getDataType() == 1) { if ("2".equals(data.getIntoStatus())) { data.setIntoStatus("1"); } @@ -469,8 +469,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { dto.setIsCheck("1"); result = mapper.updateHiddenDangerRectification(dto); Long[] fileIds = dto.getFileId(); - if (fileIds != null && fileIds.length > 0) - { + if (fileIds != null && fileIds.length > 0) { //删除附件 result = mapper.deleteFiles(dto.getFileId()); } @@ -516,28 +515,61 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { public List getHiddenDangerRectificationApprovalList(SecurityCheckDto dto) { RequestEntity entity = new RequestEntity(); //数据查询 - Map checkMaps= Maps.newHashMap(); - if("1".equals(dto.getStatus())){ + Map checkMaps = Maps.newHashMap(); + if ("1".equals(dto.getStatus())) { entity.setUserId(String.valueOf(SecurityUtils.getLoginUser().getUserid())); AjaxResult ajaxResult = flowTaskService.getStayFlow(entity); if (ajaxResult.isSuccess()) { List> data = (List>) ajaxResult.get("data"); - List proInsId=new ArrayList<>(); - data.forEach(map->{ - proInsId.add((String)map.get("proInsId")); - checkMaps.put((String)map.get("proInsId"),(String) map.get("finalCheck")); + List proInsId = new ArrayList<>(); + data.forEach(map -> { + proInsId.add((String) map.get("proInsId")); + checkMaps.put((String) map.get("proInsId"), (String) map.get("finalCheck")); }); - if(com.bonus.common.core.utils.StringUtils.isNotEmpty(data)){ + if (com.bonus.common.core.utils.StringUtils.isNotEmpty(data)) { dto.setDataType(1); dto.setProInsId(proInsId); } } } PageUtils.startPage(); - List list = mapper.getHiddenDangerRectificationApprovalList(dto); - list.forEach(data->{ + List list = mapper.getHiddenDangerRectificationApprovalList(dto); + list.forEach(data -> { - if("1".equals(data.getStatus()) && dto.getDataType()==1){ + if ("1".equals(data.getStatus()) && dto.getDataType() == 1) { + if ("2".equals(data.getIntoStatus())) { + data.setIntoStatus("1"); + } + data.setFinalCheck(checkMaps.get(data.getProcInsId())); + } + }); + return list; + } + @Override + public List getHiddenDangerRectificationApprovalListByPage(SecurityCheckDto dto) { + RequestEntity entity = new RequestEntity(); + //数据查询 + Map checkMaps = Maps.newHashMap(); + if ("1".equals(dto.getStatus())) { + entity.setUserId(String.valueOf(SecurityUtils.getLoginUser().getUserid())); + AjaxResult ajaxResult = flowTaskService.getStayFlow(entity); + if (ajaxResult.isSuccess()) { + List> data = (List>) ajaxResult.get("data"); + List proInsId = new ArrayList<>(); + data.forEach(map -> { + proInsId.add((String) map.get("proInsId")); + checkMaps.put((String) map.get("proInsId"), (String) map.get("finalCheck")); + }); + if (com.bonus.common.core.utils.StringUtils.isNotEmpty(data)) { + dto.setDataType(1); + dto.setProInsId(proInsId); + } + } + } + + List list = mapper.getHiddenDangerRectificationApprovalList(dto); + list.forEach(data -> { + if ("1".equals(data.getStatus()) && dto.getDataType() == 1) { if ("2".equals(data.getIntoStatus())) { data.setIntoStatus("1"); } @@ -561,6 +593,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { // } // return list; // } + /** * 整改方隐患问题整改回传状态修改 * @@ -633,7 +666,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { dto.setCheckStatus(checkStatus); mapper.updateHiddenDangerStatus(dto); } - }catch (Exception e){ + } catch (Exception e) { TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); log.error(e.toString(), e); } @@ -642,10 +675,11 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { /** * 根据当前日期、整改时间和延期时间计算检查状态 - * @param date 当前日期 - * @param correctionTime 整改时间 - * @param delayTime 延期时间 - * @param isCheck 是否整改 + * + * @param date 当前日期 + * @param correctionTime 整改时间 + * @param delayTime 延期时间 + * @param isCheck 是否整改 * @param delayCheckState 延期检查状态 * @return 返回一个计算出来的checkStatus字符串 */ @@ -692,7 +726,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { return AjaxResult.error("延期时间不能早于期限整改时间"); } result = mapper.updateApplicationForExtension(dto); - if (result > 0){ + if (result > 0) { mapper.updateReasonForDelay(dto); } @@ -716,28 +750,28 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { public List getReviewOfDeferredApprovalList(SecurityCheckDto dto) { RequestEntity entity = new RequestEntity(); //数据查询 - Map checkMaps= Maps.newHashMap(); - if("1".equals(dto.getStatus()) ){ + Map checkMaps = Maps.newHashMap(); + if ("1".equals(dto.getStatus())) { entity.setUserId(String.valueOf(SecurityUtils.getLoginUser().getUserid())); AjaxResult ajaxResult = flowTaskService.getStayFlow(entity); if (ajaxResult.isSuccess()) { List> data = (List>) ajaxResult.get("data"); - List proInsId=new ArrayList<>(); - data.forEach(map->{ - proInsId.add((String)map.get("proInsId")); - checkMaps.put((String)map.get("proInsId"),(String) map.get("finalCheck")); + List proInsId = new ArrayList<>(); + data.forEach(map -> { + proInsId.add((String) map.get("proInsId")); + checkMaps.put((String) map.get("proInsId"), (String) map.get("finalCheck")); }); - if(com.bonus.common.core.utils.StringUtils.isNotEmpty(data)){ + if (com.bonus.common.core.utils.StringUtils.isNotEmpty(data)) { dto.setDataType(1); dto.setProInsId(proInsId); } } } PageUtils.startPage(); - List list = mapper.getReviewOfDeferredApprovalList(dto); - list.forEach(data->{ + List list = mapper.getReviewOfDeferredApprovalList(dto); + list.forEach(data -> { - if("1".equals(data.getStatus()) && dto.getDataType()==1){ + if ("1".equals(data.getStatus()) && dto.getDataType() == 1) { if ("2".equals(data.getIntoStatus())) { data.setIntoStatus("1"); } @@ -766,20 +800,20 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { /** * 定时修改隐患状态。一天跑两次中午12点一次晚上11点50一次 - * 整改状态: - * 1、未到期 - * 2、按期完成整改; - * 3、延期未到期 - * 4、延期完成整改 - * 5、已超期 - * 6、超期完成整改 - * 7、延期已超期 + * 整改状态: + * 1、未到期 + * 2、按期完成整改; + * 3、延期未到期 + * 4、延期完成整改 + * 5、已超期 + * 6、超期完成整改 + * 7、延期已超期 * 8、延期超期完成整改 */ @Override public void updateHiddenDangerStatus() { List list = mapper.getHiddenDangersFormList(); - if (list != null){ + if (list != null) { for (NewHiddenDangerDto item : list) { //获取当前日期 Date currentDate = new Date(); @@ -789,9 +823,9 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { String correctionTime = item.getCorrectionTime(); //获取延期时间 String delayTime = item.getDelayTime(); - if ("1".equals(item.getIsProcess())){ - if (delayTime != null && !delayTime.isEmpty() && "3".equals(item.getDelayCheckState())){ - if (date.compareTo(delayTime) <= 0 && "3".equals(item.getCheckState())){ + if ("1".equals(item.getIsProcess())) { + if (delayTime != null && !delayTime.isEmpty() && "3".equals(item.getDelayCheckState())) { + if (date.compareTo(delayTime) <= 0 && "3".equals(item.getCheckState())) { item.setCheckStatus("4"); } else if (date.compareTo(delayTime) > 0 && "3".equals(item.getCheckState())) { item.setCheckStatus("8"); @@ -803,7 +837,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { } else { if (date.compareTo(correctionTime) <= 0 && "3".equals(item.getCheckState())) { item.setCheckStatus("2"); - } else if (date.compareTo(correctionTime) > 0 &&"3".equals(item.getCheckState())) { + } else if (date.compareTo(correctionTime) > 0 && "3".equals(item.getCheckState())) { item.setCheckStatus("6"); } else if (date.compareTo(correctionTime) <= 0 && !"3".equals(item.getCheckState())) { item.setCheckStatus("5"); @@ -811,7 +845,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { item.setCheckStatus("1"); } } - }else { + } else { if (delayTime != null && !delayTime.isEmpty() && "3".equals(item.getDelayCheckState())) { //判断延期时间是否大于当前时间 if (date.compareTo(delayTime) < 0 && "2".equals(item.getIsCheck())) { @@ -837,7 +871,7 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { } } - if (item.getCheckStatus() != null && !item.getCheckStatus().isEmpty()){ + if (item.getCheckStatus() != null && !item.getCheckStatus().isEmpty()) { mapper.updateHiddenDangerStatus(item); } } @@ -850,9 +884,10 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { /** * 上传文件到文件服务器 - * @param files 文件 - * @param id id - * @param bigType 大类 3 违章 + * + * @param files 文件 + * @param id id + * @param bigType 大类 3 违章 * @param fileType 文件类型 8、违章照片 9、违章改进照片 10、罚款凭证 * @return 是否成功 */ @@ -878,13 +913,14 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { /** * 保存文件信息 + * * @param filePath 文件路径 - * @param id id + * @param id id * @param fileSize 文件大小 - * @param bigType 大类 + * @param bigType 大类 * @param fileType 文件类型 * @param fileName 文件名称 - * @param suffix 文件后缀 + * @param suffix 文件后缀 * @return 是否成功 */ private int fileSaving(@NotNull String filePath, String id, long fileSize, String bigType, String fileType, String fileName, String suffix) { @@ -907,7 +943,4 @@ public class SecurityCheckServiceImpl implements SecurityCheckService { } - - - } diff --git a/bonus-modules/bonus-project/src/main/resources/mapper/system/ConsApprovalMapper.xml b/bonus-modules/bonus-project/src/main/resources/mapper/system/ConsApprovalMapper.xml index 3445a96..ecc78be 100644 --- a/bonus-modules/bonus-project/src/main/resources/mapper/system/ConsApprovalMapper.xml +++ b/bonus-modules/bonus-project/src/main/resources/mapper/system/ConsApprovalMapper.xml @@ -68,7 +68,7 @@ pci.cont_name like concat('%',#{keyWord},'%') ) - + and lpc.into_status = #{status}