|
|
|
|
@ -11,10 +11,12 @@ import cn.iocoder.yudao.module.mes.dal.dataobject.producereport.ProduceReportDO;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.dataobject.producereport.ProduceReportDetailDO;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.mysql.producereport.ProduceReportDetailMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.mysql.producereport.ProduceReportMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.redis.no.MesNoRedisDAO;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.service.changerecord.ProduceReportChangeRecordService;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.service.organization.OrganizationService;
|
|
|
|
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
|
|
|
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
@ -49,6 +51,8 @@ public class ProduceReportServiceImpl implements ProduceReportService {
|
|
|
|
|
private ProduceReportChangeRecordService produceReportChangeRecordService;
|
|
|
|
|
@Resource
|
|
|
|
|
private ProduceReportDetailService produceReportDetailService;
|
|
|
|
|
@Resource
|
|
|
|
|
private MesNoRedisDAO noRedisDAO;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
@ -56,6 +60,11 @@ public class ProduceReportServiceImpl implements ProduceReportService {
|
|
|
|
|
createReqVO.setReportStatus(ReportStatusEnum.草稿.getValue());
|
|
|
|
|
// 插入
|
|
|
|
|
ProduceReportDO produceReport = BeanUtils.toBean(createReqVO, ProduceReportDO.class);
|
|
|
|
|
if (StringUtils.isEmpty(createReqVO.getReportCode())) {
|
|
|
|
|
// 1.4 生成订单号,并校验唯一性
|
|
|
|
|
String no = noRedisDAO.generate3(MesNoRedisDAO.REPORT_NO_PREFIX);
|
|
|
|
|
produceReport.setReportCode(no);
|
|
|
|
|
}
|
|
|
|
|
produceReportMapper.insert(produceReport);
|
|
|
|
|
|
|
|
|
|
// 插入子表
|
|
|
|
|
|