mitao
2025-03-27 b22f118eabab8f2f27dbd73e7c6cb1090cd82c82
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);
        }
    }
    /**
     * 编辑检查记录
     *