|
|
|
@ -90,7 +90,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
@Override |
|
|
|
|
public void handleData(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId,String tableName) { |
|
|
|
|
public void handleData(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId,String tableName,Integer inventoryId) { |
|
|
|
|
log.info("#############handleData: 处理订单开始"); |
|
|
|
|
for (String orderCode:orderCodeList){ |
|
|
|
|
log.info("#############handleData: 当前处理orderCode={}的订单 ",orderCode); |
|
|
|
@ -104,7 +104,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
// if(!Objects.isNull(inventoryDetailEntity)){
|
|
|
|
|
try{ |
|
|
|
|
//定单
|
|
|
|
|
saveOrderInfo(orderCode,oldWarehouseId,newWarehouseId); |
|
|
|
|
saveOrderInfo(orderCode,oldWarehouseId,newWarehouseId,inventoryId); |
|
|
|
|
|
|
|
|
|
//存入打托信息
|
|
|
|
|
// saveTrayTypeInfoPackage(orderCode,oldWarehouseId,newWarehouseId);
|
|
|
|
@ -1249,7 +1249,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void saveOrderInfo(String orderCode, Integer oldWarehouseId, Long newWarehouseId) { |
|
|
|
|
private void saveOrderInfo(String orderCode, Integer oldWarehouseId, Long newWarehouseId,Integer inventoryId) { |
|
|
|
|
|
|
|
|
|
//通过订单号查询暂存单
|
|
|
|
|
AdvanceEntity advanceEntity = advanceClient.getQueryDataOne(orderCode); |
|
|
|
@ -1388,11 +1388,11 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//保存包件信息
|
|
|
|
|
saveOrderPackage(distributionStockArticleEntity,basicdataWarehouseEntity,wayBillNo,CommonUtil.dateToString(new Date()),oldWarehouseId); |
|
|
|
|
saveOrderPackage(distributionStockArticleEntity,basicdataWarehouseEntity,wayBillNo,CommonUtil.dateToString(new Date()),oldWarehouseId,inventoryId); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void saveOrderPackage(DistributionStockArticleEntity distributionStockArticleEntity, BasicdataWarehouseEntity basicdataWarehouseEntity, String waybillNo,String operationTime,Integer oldWarehouseId) { |
|
|
|
|
private void saveOrderPackage(DistributionStockArticleEntity distributionStockArticleEntity, BasicdataWarehouseEntity basicdataWarehouseEntity, String waybillNo,String operationTime,Integer oldWarehouseId,Integer inventoryId) { |
|
|
|
|
|
|
|
|
|
String orderCode = distributionStockArticleEntity.getOrderCode(); |
|
|
|
|
Long warehouseId = basicdataWarehouseEntity.getId(); |
|
|
|
@ -1405,12 +1405,13 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
log.info("###########saveOrderPackage: 包条已存在,不同步 unitNo={}",unitNo); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findUnitNoIsExist(unitNo,inventoryId);
|
|
|
|
|
// if(Objects.isNull(inventoryDetailEntity)){
|
|
|
|
|
// log.info("###########saveOrderPackage: 包条不在盘点任务中存在,不同步 unitNo={}",unitNo);
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
String productName = null; |
|
|
|
|
if(!Objects.isNull(inventoryId)){ |
|
|
|
|
InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findUnitNoIsExist(unitNo,inventoryId); |
|
|
|
|
if(!Objects.isNull(inventoryDetailEntity)){ |
|
|
|
|
productName = inventoryDetailEntity.getProductname(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Integer status = orderDetailEntity.getStatus(); |
|
|
|
|
Integer carsType = orderDetailEntity.getCarsType(); |
|
|
|
@ -1497,16 +1498,28 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
entity.setUpdateUser(1714696768639311873L); |
|
|
|
|
entity.setCreateDept(1649331096241836033L); |
|
|
|
|
entity.setTenantId(TenantNum.HUITONGCODE); |
|
|
|
|
if (StringUtil.isNotBlank(entity.getMaterialName()) && StringUtil.isNotBlank(entity.getMaterialCode())) { |
|
|
|
|
// 查询物料信息
|
|
|
|
|
String sku = ""; |
|
|
|
|
BasicMaterialEntity basicMaterialEntity = basicMaterialClient.getMaterialOwn(entity.getMaterialCode(), entity.getMaterialName(), sku); |
|
|
|
|
if (ObjectUtils.isNotNull(basicMaterialEntity)) { |
|
|
|
|
if(!StringUtil.isBlank(productName)){ |
|
|
|
|
BasicMaterialEntity basicMaterialEntity = basicMaterialClient.findEntityByName(productName); |
|
|
|
|
if(Objects.isNull(basicMaterialEntity)){ |
|
|
|
|
entity.setMaterialName(productName); |
|
|
|
|
}else{ |
|
|
|
|
entity.setMaterialId(basicMaterialEntity.getId()); |
|
|
|
|
entity.setMaterialCode(basicMaterialEntity.getProductCode()); |
|
|
|
|
entity.setMaterialUnit(basicMaterialEntity.getLogpmUnit()); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
if (StringUtil.isNotBlank(entity.getMaterialName()) && StringUtil.isNotBlank(entity.getMaterialCode())) { |
|
|
|
|
// 查询物料信息
|
|
|
|
|
String sku = ""; |
|
|
|
|
BasicMaterialEntity basicMaterialEntity = basicMaterialClient.getMaterialOwn(entity.getMaterialCode(), entity.getMaterialName(), sku); |
|
|
|
|
if (ObjectUtils.isNotNull(basicMaterialEntity)) { |
|
|
|
|
entity.setMaterialId(basicMaterialEntity.getId()); |
|
|
|
|
entity.setMaterialCode(basicMaterialEntity.getProductCode()); |
|
|
|
|
entity.setMaterialUnit(basicMaterialEntity.getLogpmUnit()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
boolean b = distributionParcelListClient.add(entity); |
|
|
|
|
if (!b) { |
|
|
|
|
log.warn("#################handleDataToPlatform: 保存包件信息失败 orderCode={}", entity.getOrderCode()); |
|
|
|
|