|
|
|
@ -4184,17 +4184,36 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
|
|
|
|
|
private void saveOrderInfo(String orderCode, Integer oldWarehouseId, Long newWarehouseId) { |
|
|
|
|
|
|
|
|
|
//通过订单号查询暂存单
|
|
|
|
|
AdvanceEntity advanceEntity = advanceClient.getQueryDataOne(orderCode); |
|
|
|
|
Integer total = 0; |
|
|
|
|
AdvanceEntity advanceEntity = null; |
|
|
|
|
WayBillEntity wayBillEntity = null; |
|
|
|
|
List<AdvanceEntity> advanceList = advanceClient.getAdvanceList(orderCode); |
|
|
|
|
for (AdvanceEntity entity : advanceList) { |
|
|
|
|
total = total + entity.getTotal(); |
|
|
|
|
String waybillNo = entity.getWaybillNo(); |
|
|
|
|
if(StringUtil.isNotBlank(waybillNo)){ |
|
|
|
|
WayBillEntity wb = wayBillClient.getByWaybillNo(waybillNo); |
|
|
|
|
if(!Objects.isNull(wb)){ |
|
|
|
|
Integer oWid = wb.getWarehouseId(); |
|
|
|
|
if(oldWarehouseId.equals(oWid)){ |
|
|
|
|
advanceEntity = entity; |
|
|
|
|
wayBillEntity = wb; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(Objects.isNull(advanceEntity)){ |
|
|
|
|
log.warn("#################saveOrderInfo: 未查询单订单信息 orderCode={}",orderCode); |
|
|
|
|
throw new CustomerException(403,"未查询单订单信息"); |
|
|
|
|
log.warn("#################saveOrderInfo: 暂存单信息不存在 orderCode={}",orderCode); |
|
|
|
|
throw new CustomerException(403,"暂存单信息不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Integer advanceId = advanceEntity.getId(); |
|
|
|
|
Integer waybillStatus = advanceEntity.getWaybillStatus(); |
|
|
|
|
String waybillNo = advanceEntity.getWaybillNo(); |
|
|
|
|
if(waybillStatus.equals(1)){ |
|
|
|
|
log.warn("#################saveOrderInfo: 订单还未开单 orderCode={}",orderCode); |
|
|
|
|
throw new CustomerException(403,"订单还未开单"); |
|
|
|
|
|
|
|
|
|
if(Objects.isNull(wayBillEntity)){ |
|
|
|
|
log.warn("#################saveOrderInfo: 暂存单暂未有运单信息 orderCode={}",orderCode); |
|
|
|
|
throw new CustomerException(403,"暂存单暂未有运单信息"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -4207,14 +4226,6 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
|
|
|
|
|
throw new CustomerException(403,"未查询单订单信息"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Integer total = 0; |
|
|
|
|
List<AdvanceEntity> advanceList = advanceClient.getAdvanceList(orderCode); |
|
|
|
|
for (AdvanceEntity entity : advanceList) { |
|
|
|
|
total = total + entity.getTotal(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
WayBillEntity wayBillEntity = wayBillClient.getByWayBillByAdvanceId(advanceId); |
|
|
|
|
|
|
|
|
|
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(newWarehouseId); |
|
|
|
|
if(Objects.isNull(basicdataWarehouseEntity)){ |
|
|
|
|
log.warn("#################saveOrderInfo: 未查询到仓库信息 newWarehouseId={}",newWarehouseId); |
|
|
|
|