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