|
|
|
@ -96,6 +96,8 @@ public class DeliveryOrderController {
|
|
|
|
|
private BusinessCargoService businessCargoService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ReturnCargoOrderService returnCargoOrderService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private InventoryService inventoryService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 列表
|
|
|
|
@ -162,6 +164,20 @@ public class DeliveryOrderController {
|
|
|
|
|
if (StringUtil.isNotEmpty(b)){
|
|
|
|
|
return ActionResult.fail(b );
|
|
|
|
|
}
|
|
|
|
|
for (DeliveryProductRelationModel model : deliveryOrderForm.getDeliveryProductRelationList()){
|
|
|
|
|
QueryWrapper<InventoryEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
queryWrapper.lambda().eq(InventoryEntity::getProductId,model.getProductId());
|
|
|
|
|
queryWrapper.lambda().eq(InventoryEntity::getBatchNumber,model.getBatchNo());
|
|
|
|
|
queryWrapper.lambda().isNull(InventoryEntity::getDeleteMark);
|
|
|
|
|
InventoryEntity inventoryEntity = inventoryService.getOne(queryWrapper);
|
|
|
|
|
if (ObjectUtil.isNotEmpty(inventoryEntity)) {
|
|
|
|
|
if (inventoryEntity.getInventoryNumber().compareTo(model.getDeliveryNum()) == -1){
|
|
|
|
|
return ActionResult.fail("库存数量不足");
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
return ActionResult.fail("库区不存在");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
try{
|
|
|
|
|
deliveryOrderService.saveOrUpdate(deliveryOrderForm, id ,true);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|