|
|
|
@ -192,13 +192,30 @@ public class TaskReportServiceImpl implements TaskReportService {
|
|
|
|
|
throw exception(TASK_REPORT_ASSEMBLE_GENERATE_REPEAT, JSON.toJSONString(existsReportList.stream().map(TaskReportDO::getAssembleCode).collect(Collectors.joining(","))));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
|
for (TaskReportAssembleVO vo : taskReportAssembleVOList) {
|
|
|
|
|
// 入库
|
|
|
|
|
TaskReportDO reportDO = BeanUtils.toBean(vo, TaskReportDO.class);
|
|
|
|
|
reportDO.setReportTime(now)
|
|
|
|
|
.setHasReport(YesOrNoEnum.Y.getCode());
|
|
|
|
|
taskReportMapper.insert(reportDO);
|
|
|
|
|
|
|
|
|
|
List<SaleOrderPackingClauseDetailDO> saleOrderPackingClauseDOS =
|
|
|
|
|
saleOrderPackingClauseDetailMapper.selectListByClauseId(Long.valueOf(vo.getAssembleCode().split("-")[1]));
|
|
|
|
|
|
|
|
|
|
if(CollUtil.isNotEmpty(saleOrderPackingClauseDOS)){
|
|
|
|
|
|
|
|
|
|
saleOrderPackingClauseDOS.forEach(co->{
|
|
|
|
|
TaskReportDO reportDO = BeanUtils.toBean(vo, TaskReportDO.class);
|
|
|
|
|
reportDO.setReportTime(now).setHasReport(YesOrNoEnum.Y.getCode());
|
|
|
|
|
reportDO.setMaterialId(co.getMaterialId()).setAmount(co.getAmount());
|
|
|
|
|
|
|
|
|
|
taskReportMapper.insert(reportDO);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// // 入库
|
|
|
|
|
// TaskReportDO reportDO = BeanUtils.toBean(vo, TaskReportDO.class);
|
|
|
|
|
// reportDO.setReportTime(now)
|
|
|
|
|
// .setHasReport(YesOrNoEnum.Y.getCode());
|
|
|
|
|
// taskReportMapper.insert(reportDO);
|
|
|
|
|
|
|
|
|
|
// TaskDispatchDO taskDispatchDO = taskDispatchMapper.selectById(reportDO.getDispatchId());
|
|
|
|
|
// ProjectOrderDO ProjectOrderDO = projectOrderMapper.selectById(taskDispatchDO.getProjectId());
|
|
|
|
|