|
|
|
@ -15,7 +15,9 @@ import com.logpm.distribution.feign.IDistributionStockArticleClient;
|
|
|
|
|
import com.logpm.oldproject.entity.*; |
|
|
|
|
import com.logpm.oldproject.feign.*; |
|
|
|
|
import com.logpm.oldproject.vo.DistributionParcelListEntityVO; |
|
|
|
|
import com.logpm.patch.entity.WarehouseMappingDataEntity; |
|
|
|
|
import com.logpm.patch.service.ISyncOrderInfoService; |
|
|
|
|
import com.logpm.patch.service.IWarehouseMappingDataService; |
|
|
|
|
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; |
|
|
|
|
import com.logpm.trunkline.entity.TrunklineAdvanceEntity; |
|
|
|
|
import com.logpm.trunkline.entity.TrunklineDetailProductEntity; |
|
|
|
@ -84,6 +86,8 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
private final ITrunklineAdvanceDetailClient trunklineAdvanceDetailClient; |
|
|
|
|
private final BladeRedis redis; |
|
|
|
|
|
|
|
|
|
private final IWarehouseMappingDataService warehouseMappingDataService; |
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
@Override |
|
|
|
|
public void handleData(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId,String tableName) { |
|
|
|
@ -1430,6 +1434,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
WayBillEntity waybillEntity = saveWaybillEntity(waybillNo); |
|
|
|
|
|
|
|
|
|
DistributionParcelListEntityVO vo = advanceDetailClient.getByUnitNoAndWarehouseId(unitNo,oldWarehouseId); |
|
|
|
|
String packetBarCode = vo.getPacketBarCode(); |
|
|
|
|
|
|
|
|
|
DistributionParcelListEntity entity = new DistributionParcelListEntity(); |
|
|
|
|
BeanUtil.copyProperties(vo, entity); |
|
|
|
@ -1522,12 +1527,68 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
// }
|
|
|
|
|
// distributionStockArticleEntity.setHandQuantity(handQuantity + 1);
|
|
|
|
|
// distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<WarehouseMappingDataEntity> warehouseMapping = warehouseMappingDataService.getWarehouseMapping(); |
|
|
|
|
WarehouseMappingDataEntity dataEntity = warehouseMapping.get(0); |
|
|
|
|
Integer isTray = dataEntity.getIsTray(); |
|
|
|
|
if(1 == isTray){ |
|
|
|
|
saveTrayTypeWithPackage(oldWarehouseId,warehouseId,packetBarCode); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void saveTrayTypeWithPackage(Integer oldWarehouseId, Long warehouseId, String packetBarCode) { |
|
|
|
|
|
|
|
|
|
TrayScanDesEntity trayScanDesEntity = trayScanDesClient.findEntityByUnitNoAndWarehouseId(packetBarCode, oldWarehouseId); |
|
|
|
|
if(!Objects.isNull(trayScanDesEntity)){ |
|
|
|
|
|
|
|
|
|
Integer trayId = trayScanDesEntity.getTrayId(); |
|
|
|
|
Integer trayScanId = trayScanDesEntity.getTrayScanId(); |
|
|
|
|
|
|
|
|
|
TrayScanEntity trayScanEntity = trayScanClient.getEntityByTrayScanId(trayScanId); |
|
|
|
|
Integer type = trayScanEntity.getType(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//方式:1=仓,2=商场,3=客户,4=其他,5=服务号,6=合同号
|
|
|
|
|
//方式:60=仓,30=商场,50=客户,100=其他,10=服务号,20=合同号
|
|
|
|
|
String newTrayType = "100"; |
|
|
|
|
if(1==type){ |
|
|
|
|
newTrayType = "60"; |
|
|
|
|
}else if(2==type){ |
|
|
|
|
newTrayType = "30"; |
|
|
|
|
}else if(3==type){ |
|
|
|
|
newTrayType = "50"; |
|
|
|
|
}else if(4==type){ |
|
|
|
|
newTrayType = "100"; |
|
|
|
|
}else if(5==type){ |
|
|
|
|
newTrayType = "10"; |
|
|
|
|
}else if(6==type){ |
|
|
|
|
newTrayType = "20"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
map.put("trayType",newTrayType); |
|
|
|
|
map.put("trayCode","T"+trayId); |
|
|
|
|
map.put("warehouseId",warehouseId); |
|
|
|
|
map.put("orderPackageCode",packetBarCode); |
|
|
|
|
|
|
|
|
|
//新系统保存打托方式
|
|
|
|
|
boolean b = warehouseTrayTypeClient.orderScanOrderPackageCode(map); |
|
|
|
|
|
|
|
|
|
if(!b){ |
|
|
|
|
log.error("################saveTrayTypeInfo: 包件打托失败 packetBarCode={} trayCode={}",packetBarCode,"T"+trayId); |
|
|
|
|
// throw new CustomerException(403,"包件打托失败");
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void buildDealerAndStore(DistributionStockArticleEntity distributionStockArticleEntity, AdvanceEntity advanceEntity) { |
|
|
|
|