| | |
| | | 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; |
| | |
| | | } |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 编辑检查记录 |
| | | * |