Browse Source

Merge remote-tracking branch 'origin/pre-production'

master
zhenghaoyu 9 months ago
parent
commit
5fb7401dff
  1. 157
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

157
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -739,8 +739,12 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
throw new CustomerException(2001,"托盘已在其他仓库打托"); throw new CustomerException(2001,"托盘已在其他仓库打托");
} }
//只留下包件状态为20的
parcelListEntityList = parcelListEntityList.stream().filter(parcelListEntity -> "20".equals(parcelListEntity.getOrderPackageStatus())).collect(Collectors.toList());
//把parcelListEntityList通过orderCode进行分组 //把parcelListEntityList通过orderCode进行分组
Map<String, List<DistributionParcelListEntity>> map = parcelListEntityList.stream().filter(parcelListEntity -> "20".equals(parcelListEntity.getOrderPackageStatus())).collect(Collectors.groupingBy(DistributionParcelListEntity::getOrderCode)); Map<String, List<DistributionParcelListEntity>> map = parcelListEntityList.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getOrderCode));
FindParamterDTO findParamterDTO = new FindParamterDTO(); FindParamterDTO findParamterDTO = new FindParamterDTO();
findParamterDTO.setOrderCodeSet(map.keySet()); findParamterDTO.setOrderCodeSet(map.keySet());
@ -757,91 +761,92 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
String orderCode = parcelListEntity.getOrderCode(); String orderCode = parcelListEntity.getOrderCode();
DistributionStockArticleEntity stockArticleEntity = stockArticleEntityMap.get(orderCode); DistributionStockArticleEntity stockArticleEntity = stockArticleEntityMap.get(orderCode);
boolean chuanFlag = false; if(!Objects.isNull(stockArticleEntity)){
String msg = ""; boolean chuanFlag = false;
if("10".equals(tt)){//服务号 String msg = "";
String serviceNumber = stockArticleEntity.getServiceNumber(); if("10".equals(tt)){//服务号
if(!finalFilterValue.equals(serviceNumber)){ String serviceNumber = stockArticleEntity.getServiceNumber();
chuanFlag = true; if(!finalFilterValue.equals(serviceNumber)){
msg = "服务号"+ finalFilterValue; chuanFlag = true;
} msg = "服务号"+ finalFilterValue;
}else if("20".equals(tt)){//订单自编号 }
String oc = stockArticleEntity.getOrderCode(); }else if("20".equals(tt)){//订单自编号
if(!finalFilterValue.equals(oc)){ String oc = stockArticleEntity.getOrderCode();
chuanFlag = true; if(!finalFilterValue.equals(oc)){
msg = "订单自编号"+ finalFilterValue; chuanFlag = true;
} msg = "订单自编号"+ finalFilterValue;
}else if("30".equals(tt)){//商场 }
Long mallId = stockArticleEntity.getMallId(); }else if("30".equals(tt)){//商场
String mallName = null; Long mallId = stockArticleEntity.getMallId();
if(!Objects.isNull(mallId)){ String mallName = null;
mallName = stockArticleEntity.getMallName(); if(!Objects.isNull(mallId)){
}else{ mallName = stockArticleEntity.getMallName();
String dealerName = stockArticleEntity.getDealerName();
String brand = stockArticleEntity.getBrand();
Long clientId = basicdataTripartiteMallClient.getClientIdByNameAndBrand(dealerName, brand);
if(!Objects.isNull(clientId)){
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(clientId);
if(Objects.isNull(basicdataClientEntity)){
log.error("#############saveTrayTypeByOrderPackageCode: 未找到三方商场对应的汇通商场 clientId={}",clientId);
throw new CustomerException(405,"未找到三方商场对应的汇通商场");
}
mallName = basicdataClientEntity.getClientName();
}else{ }else{
mallName = dealerName; String dealerName = stockArticleEntity.getDealerName();
String brand = stockArticleEntity.getBrand();
Long clientId = basicdataTripartiteMallClient.getClientIdByNameAndBrand(dealerName, brand);
if(!Objects.isNull(clientId)){
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(clientId);
if(Objects.isNull(basicdataClientEntity)){
log.error("#############saveTrayTypeByOrderPackageCode: 未找到三方商场对应的汇通商场 clientId={}",clientId);
throw new CustomerException(405,"未找到三方商场对应的汇通商场");
}
mallName = basicdataClientEntity.getClientName();
}else{
mallName = dealerName;
}
} }
} if(!finalFilterValue.equals(mallName)){
if(!finalFilterValue.equals(mallName)){ chuanFlag = true;
chuanFlag = true; msg = "商场"+ finalFilterValue;
msg = "商场"+ finalFilterValue; }
} }else if("40".equals(tt)){//门店
}else if("40".equals(tt)){//门店 Long storeId = stockArticleEntity.getStoreId();
Long storeId = stockArticleEntity.getStoreId(); String storeName = stockArticleEntity.getStoreName();
String storeName = stockArticleEntity.getStoreName(); if(!finalFilterValue.equals(storeName)){
if(!finalFilterValue.equals(storeName)){ chuanFlag = true;
chuanFlag = true; msg = "门店"+ finalFilterValue;
msg = "门店"+ finalFilterValue; }
} }else if("50".equals(tt)){//客户
}else if("50".equals(tt)){//客户 String customerName = stockArticleEntity.getCustomerName();
String customerName = stockArticleEntity.getCustomerName(); String customerTelephone = stockArticleEntity.getCustomerTelephone();
String customerTelephone = stockArticleEntity.getCustomerTelephone(); if(!finalFilterValue.equals(customerName+customerTelephone)){
if(!finalFilterValue.equals(customerName+customerTelephone)){ chuanFlag = true;
chuanFlag = true; msg = "客户"+ finalFilterValue;
msg = "客户"+ finalFilterValue; }
} }else if("60".equals(tt)){//仓库
}else if("60".equals(tt)){//仓库 String warehouse = null;
String warehouse = null; String waybillNumber = parcelListEntity.getWaybillNumber();
String waybillNumber = parcelListEntity.getWaybillNumber(); if(StringUtil.isBlank(waybillNumber)){
if(StringUtil.isBlank(waybillNumber)){ //如果运单为空则去找有没有对应的dealName是否有对应的维护的商场信息
//如果运单为空则去找有没有对应的dealName是否有对应的维护的商场信息 String brand = stockArticleEntity.getBrand();
String brand = stockArticleEntity.getBrand(); String dealerName = parcelListEntity.getDealerName();
String dealerName = parcelListEntity.getDealerName(); Long clientId = basicdataTripartiteMallClient.getClientIdByNameAndBrand(dealerName, brand);
Long clientId = basicdataTripartiteMallClient.getClientIdByNameAndBrand(dealerName, brand); if(!Objects.isNull(clientId)){
if(!Objects.isNull(clientId)){ BasicdataStorageServicesEntity storageServicesEntity = basicdataStorageServicesClient.findEntityBySendWarehouseIdAndClientId(warehouseId, clientId);
BasicdataStorageServicesEntity storageServicesEntity = basicdataStorageServicesClient.findEntityBySendWarehouseIdAndClientId(warehouseId, clientId); if(!Objects.isNull(storageServicesEntity)){
if(!Objects.isNull(storageServicesEntity)){ warehouse = storageServicesEntity.getServeWarehouseName();
warehouse = storageServicesEntity.getServeWarehouseName(); }else{
warehouse = "";
}
}else{ }else{
warehouse = ""; warehouse = "";
} }
}else{ }else{
warehouse = ""; WarehouseWaybillEntity waybillEntity = warehouseWaybillService.findByWaybillNo(waybillNumber);
if(!Objects.isNull(waybillEntity)){
warehouse = waybillEntity.getDestinationWarehouseName();
}else{
warehouse = "";
}
} }
}else{ if(!finalFilterValue.equals(warehouse)){
WarehouseWaybillEntity waybillEntity = warehouseWaybillService.findByWaybillNo(waybillNumber); chuanFlag = true;
if(!Objects.isNull(waybillEntity)){ msg = "仓库"+ finalFilterValue;
warehouse = waybillEntity.getDestinationWarehouseName();
}else{
warehouse = "";
} }
} }
if(!finalFilterValue.equals(warehouse)){ orderPackageChuanMap.put(orderPackageCode,chuanFlag?1:0);
chuanFlag = true;
msg = "仓库"+ finalFilterValue;
}
} }
orderPackageChuanMap.put(orderPackageCode,chuanFlag?1:0);
}); });
List<WarehouseTrayGoodsEntity> trayGoodsEntities = new ArrayList<>(); List<WarehouseTrayGoodsEntity> trayGoodsEntities = new ArrayList<>();

Loading…
Cancel
Save