|
|
|
@ -23,6 +23,7 @@ import com.logpm.factory.oupai.service.IReceivingOrderService;
|
|
|
|
|
import com.logpm.factory.pan.service.IPanFactoryOrderService; |
|
|
|
|
import com.logpm.factory.pan.service.IPanPackageInfoService; |
|
|
|
|
import com.logpm.factory.pan.service.IPanPackageListService; |
|
|
|
|
import com.logpm.factory.props.OuPaiProperties; |
|
|
|
|
import com.logpm.factory.snm.constant.PanFactoryEnum; |
|
|
|
|
import com.logpm.factory.snm.entity.PanFactoryOrder; |
|
|
|
|
import com.logpm.factory.snm.entity.PanPackageInfo; |
|
|
|
@ -104,10 +105,11 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
|
|
|
|
|
|
|
|
|
|
private final ZbCategoryContrastMapper zbCategoryContrastMapper; |
|
|
|
|
|
|
|
|
|
private final OuPaiProperties ouPaiProperties; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 目前推送的基地 |
|
|
|
|
*/ |
|
|
|
|
private String[] jidiCanshu = {"双流基地", "无锡基地"}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 处理皮阿诺数据推送到汇通老库 |
|
|
|
@ -394,6 +396,11 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
|
|
|
|
|
// 查询需要处理的派车单 查询没有转发的shuju
|
|
|
|
|
List<ReceivingOrderEntity> list = receivingOrderService.lambdaQuery().eq(ReceivingOrderEntity::getCode, code).eq(ReceivingOrderEntity::getTurnStatus, 0).list(); |
|
|
|
|
for (ReceivingOrderEntity receivingOrderEntity : list) { |
|
|
|
|
|
|
|
|
|
if (!ArrayUtil.contains(ouPaiProperties.getJidiCanshu(), receivingOrderEntity.getFromWarehouseName())) { |
|
|
|
|
log.info(FactoryConstant.OUPAI,"推送老系统失败,当前仓库不是双流仓,推送失败 {}", receivingOrderEntity.getCurrentWarehouseName()); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
// 查询这个派车单下面的订单
|
|
|
|
|
List<FactoryOrderEntity> factoryOrderEntities = factoryOrderService.lambdaQuery().eq(FactoryOrderEntity::getReceivingId, receivingOrderEntity.getId()).eq(FactoryOrderEntity::getTurnStatus, 0).list(); |
|
|
|
|
addAdvanceEntityBtOuPai(receivingOrderEntity, factoryOrderEntities); |
|
|
|
@ -410,15 +417,19 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
|
|
|
|
|
private void addAdvanceEntityBtOuPai(ReceivingOrderEntity receivingOrderEntity, List<FactoryOrderEntity> factoryOrderEntities) { |
|
|
|
|
|
|
|
|
|
String carNumber = receivingOrderEntity.getCarNumber(); |
|
|
|
|
|
|
|
|
|
if(Objects.isNull(ouPaiProperties.getJidiWarehouseMapper())){ |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 通过发货基地得到仓库ID
|
|
|
|
|
String warehourseIdString = ouPaiProperties.getJidiWarehouseMapper().get(receivingOrderEntity.getFromWarehouseName()); |
|
|
|
|
Integer warehourseId = Integer.parseInt(warehourseIdString); |
|
|
|
|
|
|
|
|
|
for (FactoryOrderEntity factoryOrderEntity : factoryOrderEntities) { |
|
|
|
|
// 需要从老系统进行订单数据查询
|
|
|
|
|
AdvanceEntity advanceEntity = findAdvanceEntityUseCacheByOrderSelfNum(factoryOrderEntity.getSelfCode(), carNumber); |
|
|
|
|
if (ObjectUtils.isNull(advanceEntity)) { |
|
|
|
|
//todo 先阶段值推送老系统的双流和无锡
|
|
|
|
|
if (!ArrayUtil.contains(jidiCanshu, receivingOrderEntity.getCurrentWarehouseName())) { |
|
|
|
|
log.info("推送老系统失败,当前仓库不是双流和无锡,推送失败 {}", receivingOrderEntity.getCurrentWarehouseName()); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
advanceEntity = new AdvanceEntity(); |
|
|
|
|
advanceEntity.setOrderSelfNum(StringUtil.isBlank(factoryOrderEntity.getSelfCode()) ? "" : factoryOrderEntity.getSelfCode()); //订单自编号
|
|
|
|
@ -460,9 +471,9 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
|
|
|
|
|
advanceEntity.setWaybillNo("");//运单号 可以为空
|
|
|
|
|
// Integer id = PanFactoryEnum.getId(panFactoryOrder.getPlantId());
|
|
|
|
|
|
|
|
|
|
// 获取基地对应的ID
|
|
|
|
|
|
|
|
|
|
advanceEntity.setWarehouseId(141); //导入人仓库id TODO 需要提供映射
|
|
|
|
|
|
|
|
|
|
advanceEntity.setWarehouseId(warehourseId); //导入人仓库id TODO 需要提供映射
|
|
|
|
|
|
|
|
|
|
advanceEntity.setWaybillStatus(Byte.parseByte("1"));//开单状态:1=未开单,2=已开单
|
|
|
|
|
advanceEntity.setOldId(0);//
|
|
|
|
|