补正同步申请表数据到工单

This commit is contained in:
xiaofajia 2024-10-26 11:20:07 +08:00
parent 76226e7f67
commit f4dda63143

View File

@ -135,6 +135,10 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
}
// 新增主表
// 如果是采购单就把状态变为采购中
if (repairSoRespVO.getSoType() != null && repairSoRespVO.getSoType().equals("01")){
repairSoRespVO.setSoStatus("02");
}
baseMapper.insertOrUpdate(repairSoRespVO);
// 新增子表
if (CollectionUtil.isEmpty(repairSoRespVO.getGoodsList())) {
@ -147,7 +151,8 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
repairSoiService.saveBatch(repairSoRespVO.getGoodsList());
// 操作配件库存表
// 获取所有需要操作的数据
// 获取所有需要操作的数据----生成采购单的时候不直接操作库存放到下面的inWares方法去操作
if (repairSoRespVO.getSoType() != null && !repairSoRespVO.getSoType().equals("01")){
List<DlRepairSoi> goodsList = repairSoRespVO.getGoodsList();
List<String> ids = goodsList.stream().map(DlRepairSoi::getGoodsId).collect(Collectors.toList());
List<RepairWares> repairWares = waresService.listByIds(ids);
@ -168,6 +173,7 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
}).collect(Collectors.toList());
waresService.updateBatchById(newWares);
}
}
/**
* 采购单/领料单新增分页
@ -540,8 +546,6 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
item.setStock((item.getStock() == null ? new BigDecimal(0) : item.getStock()).add(new BigDecimal(filterSoi.getInCount())));
});
waresService.updateBatchById(waresList);
}
}