medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppRegulatoryRecordController.java
@@ -64,7 +64,7 @@ @ApiOperation("新增检查记录") @PostMapping("/add") public R<?> add(@Valid @RequestBody MwRegulatoryRecordDTO dto) { mwRegulatoryRecordService.add(dto); mwRegulatoryRecordService.add1(dto); return R.ok(); } medicalWaste-system/src/main/java/com/sinata/system/service/MwRegulatoryRecordService.java
@@ -39,6 +39,7 @@ * @return */ void add(MwRegulatoryRecordDTO dto); void add1(MwRegulatoryRecordDTO dto); /** * 编辑检查记录 medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwRegulatoryRecordServiceImpl.java
@@ -6,6 +6,7 @@ import com.sinata.common.exception.ServiceException; import com.sinata.common.utils.BeanUtils; import com.sinata.common.utils.CollUtils; import com.sinata.common.utils.SecurityUtils; import com.sinata.system.domain.MwAttachment; import com.sinata.system.domain.MwRegulatoryRecord; import com.sinata.system.domain.SysDepartment; @@ -96,6 +97,23 @@ } } @Override @Transactional(rollbackFor = Exception.class) public void add1(MwRegulatoryRecordDTO dto) { dto.setCheckBy(SecurityUtils.getLoginUser().getUser().getNickName()); MwRegulatoryRecord mwRegulatoryRecord = BeanUtils.copyBean(dto, MwRegulatoryRecord.class); save(mwRegulatoryRecord); //保存附件 if (CollUtils.isNotEmpty(dto.getAttachmentList())) { List<MwAttachment> mwAttachments = BeanUtils.copyToList(dto.getAttachmentList(), MwAttachment.class); mwAttachments.forEach(attachment -> { attachment.setTargetId(mwRegulatoryRecord.getId()); attachment.setType(AttachmentTypeEnum.REGULATORY.getCode()); }); mwAttachmentService.saveBatch(mwAttachments); } } /** * 编辑检查记录 * medicalWaste-system/src/main/java/com/sinata/system/service/impl/SysDepartmentServiceImpl.java
@@ -228,7 +228,7 @@ sysDepartmentVO1.setChildren(root1); sysDepartmentVO = sysDepartmentVO1; } if (sysDepartmentVO.getTreeCode().length()==14){ if (sysDepartmentVO.getTreeCode().length()>=14){ SysDepartment sysDepartment = this.baseMapper.selectById(sysDepartmentVO.getParentId()); SysDepartmentVO sysDepartmentVO1 = new SysDepartmentVO(); BeanUtils.copyProperties(sysDepartment,sysDepartmentVO1);