fix:订单版本号变更bug修复
parent
e9c73d1925
commit
60a9bdab2e
|
|
@ -171,7 +171,7 @@ public class InventoryDeliveryController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult remove(Long id)
|
||||
{
|
||||
return toAjax(inventoryDeliveryService.deleteInventoryOuterById(id, true));
|
||||
return toAjax(inventoryDeliveryService.deleteInventoryOuterById(id, true, null));
|
||||
}
|
||||
@Log(title = "发货记录", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/recall")
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public interface IInventoryDeliveryService
|
|||
|
||||
void statusUpdate(InventoryDelivery inventoryDelivery);
|
||||
|
||||
int deleteInventoryOuterById(Long id, boolean realDeleted);
|
||||
int deleteInventoryOuterById(Long id, boolean realDeleted, String orderCode);
|
||||
|
||||
List<DeliveryInfoVo> getNumberInfo(ApiDataQueryDto dto);
|
||||
|
||||
|
|
|
|||
|
|
@ -287,7 +287,6 @@ public class ExecutionTrackServiceImpl implements IExecutionTrackService {
|
|||
//累计发货
|
||||
List<InventoryDelivery> inventoryDeliveries = deliveryMapper.selectQuantityByOrderCodeStatus(projectOrderInfo.getOrderCode(), InventoryDelivery.DeliveryStatusEnum.CONFIRM_DELIVERY.getCode());
|
||||
if (CollUtil.isNotEmpty(inventoryDeliveries)) {
|
||||
// deliveryMapper.deleteInventoryDeliveryByIds(inventoryOuters.stream().map(item -> item.getId().toString()).toArray(String[]::new));
|
||||
for (InventoryDelivery inventoryDeliverie : inventoryDeliveries) {
|
||||
InventoryDelivery updateDelivery = new InventoryDelivery();
|
||||
updateDelivery.setId(inventoryDeliverie.getId());
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int deleteInventoryOuterById(Long id, boolean realDelete) {
|
||||
public int deleteInventoryOuterById(Long id, boolean realDelete, String orderCode) {
|
||||
InventoryDelivery inventoryDelivery = inventoryDeliveryMapper.selectInventoryDeliveryById(id);
|
||||
//还原库存信息
|
||||
InventoryInfo inventoryInfo = new InventoryInfo();
|
||||
|
|
@ -336,11 +336,18 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
return inventoryDeliveryMapper.deleteInventoryDeliveryById(id);
|
||||
} else {
|
||||
// 2026-03-19:新逻辑,仅修改发货单状态为撤回,不删除库存表
|
||||
inventoryDelivery = new InventoryDelivery();
|
||||
inventoryDelivery.setId(id);
|
||||
inventoryDelivery.setDeliveryStatus(InventoryDelivery.DeliveryStatusEnum.RECALL_DELIVERY.getCode());
|
||||
inventoryDelivery.setUpdateTime(DateUtils.getNowDate());
|
||||
return inventoryDeliveryMapper.updateInventoryDelivery(inventoryDelivery);
|
||||
int rows = 0;
|
||||
List<InventoryDelivery> inventoryDeliveries = inventoryDeliveryMapper.selectQuantityByOrderCodeStatus(orderCode, InventoryDelivery.DeliveryStatusEnum.CONFIRM_DELIVERY.getCode());
|
||||
if (CollUtil.isNotEmpty(inventoryDeliveries)) {
|
||||
for (InventoryDelivery inventoryDeliverie : inventoryDeliveries) {
|
||||
InventoryDelivery updateDelivery = new InventoryDelivery();
|
||||
updateDelivery.setId(inventoryDeliverie.getId());
|
||||
updateDelivery.setDeliveryStatus(InventoryDelivery.DeliveryStatusEnum.RECALL_DELIVERY.getCode());
|
||||
updateDelivery.setUpdateTime(DateUtils.getNowDate());
|
||||
rows += inventoryDeliveryMapper.updateInventoryDelivery(updateDelivery);
|
||||
}
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -381,7 +388,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
|
||||
InventoryDelivery inventoryDelivery = inventoryDeliveryMapper.selectInventoryDeliveryById(id);
|
||||
ProjectOrderInfo projectOrderInfo = projectOrderInfoService.selectProjectOrderInfoByOrderCode(inventoryDelivery.getOrderCode());
|
||||
deleteInventoryOuterById(id, false);
|
||||
deleteInventoryOuterById(id, false, projectOrderInfo.getOrderCode());
|
||||
List<ProjectProductInfo> projectProductInfos = projectProductInfoService.listDeliveryProductByOrderCode(Collections.singletonList(inventoryDelivery.getOrderCode()));
|
||||
//软硬件之和
|
||||
long sum = projectProductInfos.stream().mapToLong(ProjectProductInfo::getQuantity).sum();
|
||||
|
|
|
|||
Loading…
Reference in New Issue