| | |
| | | List<SafetySelfInspectionItem> itemList= safetySelfInspectionItemMapper.getDetailBySafetySelfInspectionId(id,unqualified); |
| | | //获取要素树 |
| | | List<ElementTree> elementTreeList = elementManagementService.getMenuType1Tree(); |
| | | //获取附件 |
| | | List<AttachmentInfo> byBusinessId = attachmentInfoService.findByBusinessId(id); |
| | | safetySelfInspectionRespDTO.setAttachmentList(byBusinessId); |
| | | |
| | | List<SafetySelfInspectionElementRespDTO> arespDTOList = new ArrayList<>(); |
| | | if (CollectionUtils.isNotEmpty(elementTreeList)) { |
| | |
| | | safetySelfInspectionItemDeductionMapper.delBySafetySelfInspectionItemId(param.getId(),username,date); |
| | | //删除隐患 |
| | | dangerService.delByInspectionItemId(param.getSafetyInspectionItemId(),user); |
| | | //删除附件 |
| | | attachmentInfoService.deleteByBusinessId(param.getId()); |
| | | }else{ |
| | | //扣分 |
| | | List<SafetySelfInspectionItemDeduction> list = safetySelfInspectionItemDeductionMapper.getBySafetySelfInspectionItemId(param.getId()); |
| | |
| | | inspectionHiddenDanger.setCreateTime(new Date()); |
| | | inspectionHiddenDanger.setUpdateBy(user.getRealname()); |
| | | inspectionHiddenDanger.setUpdateTime(new Date()); |
| | | inspectionHiddenDanger.setStatus((byte)0); |
| | | inspectionHiddenDanger.setStatus((byte)-1); |
| | | inspectionHiddenDanger.setValidFlag(true); |
| | | inspectionHiddenDanger.setSelfInspectionId(param.getSafetySelfInspectionId()); |
| | | inspectionHiddenDanger.setSelfInspectionItemId(param.getId()); |
| | |
| | | safetySelfInspectionItemMapper.updateBatch(itemList); |
| | | } |
| | | |
| | | @Override |
| | | public void addCheckAttachment(List<AttachmentInfo> attachmentList, UserInfo user) { |
| | | requiredAttachmentVerification(attachmentList); |
| | | for (AttachmentInfo attachmentInfo : attachmentList) { |
| | | attachmentInfo.setUpdateTime(new Date()); |
| | | attachmentInfo.setUpdateUid(user.getId()); |
| | | attachmentInfo.setUpdateUname(user.getRealname()); |
| | | } |
| | | attachmentInfoService.updateBusinessIdBatch(attachmentList); |
| | | } |
| | | |
| | | private void requiredAttachmentVerification(List<AttachmentInfo> attachmentList) { |
| | | if(CollectionUtils.isEmpty(attachmentList)){ |
| | | throw new BusinessException("附件信息为空"); |
| | | } |
| | | for (AttachmentInfo attachmentInfo : attachmentList) { |
| | | if(attachmentInfo.getId() == null){ |
| | | throw new BusinessException("附件主键信息不能为空"); |
| | | } |
| | | if(attachmentInfo.getBusinessId() == null){ |
| | | throw new BusinessException("附件信息关联业务id不能为空"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 查询验证 |
| | | * 验证对象存在 |