refactor(入库计划): 插入入库计划明细实例 优化

This commit is contained in:
LJW 2024-11-13 08:53:41 +08:00
parent 309cd94000
commit 37067b913d

View File

@ -128,12 +128,17 @@ public class WmsInPlanServiceImpl implements IWmsInPlanService {
wmsInPlanDetails.setPlanId(planId);
list.add(wmsInPlanDetails);
// 插入入库任务明细实例
wmsInPlanDetailEntityMapper.deleteWmsInPlanDetailEntityByPlanDetailsId(wmsInPlanDetails.getDetailsId());
insertWmsInPlanDetailEntity(wmsInPlanDetails);
}
if (!list.isEmpty()) {
wmsInPlanMapper.batchWmsInPlanDetails(list);
WmsInPlan wmsInPlan1 = wmsInPlanMapper.selectWmsInPlanByPlanId(planId.toString());
List<WmsInPlanDetails> wmsInPlanDetailsList1 = wmsInPlan1.getWmsInPlanDetailsList();
for (int i = 0; i < list.size(); i++) {
List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList = list.get(i).getWmsInPlanDetailEntityList();
wmsInPlanDetailsList1.get(i).setWmsInPlanDetailEntityList(wmsInPlanDetailEntityList);
wmsInPlanDetailEntityMapper.deleteWmsInPlanDetailEntityByPlanDetailsId(wmsInPlanDetailsList1.get(i).getDetailsId());
insertWmsInPlanDetailEntity(wmsInPlanDetailsList1.get(i));
}
}
}
}
@ -152,6 +157,7 @@ public class WmsInPlanServiceImpl implements IWmsInPlanService {
for (WmsInPlanDetailEntity wmsInPlanDetailEntity : wmsInPlanDetailEntityList) {
wmsInPlanDetailEntity.setPlanId(planId);
wmsInPlanDetailEntity.setPlanDetailsId(planDetailsId);
wmsInPlanDetailEntity.setCreateTime(DateUtils.getNowDate());
list.add(wmsInPlanDetailEntity);
}