Browse Source

1.增加欧派的数据解析和同步老系统1.2

training
pref_mail@163.com 1 year ago
parent
commit
0fbf3e629d
  1. 116
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java
  2. 4
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java

116
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java

@ -366,57 +366,65 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
for (FactoryOrderEntity factoryOrderEntity : factoryOrderEntities) { for (FactoryOrderEntity factoryOrderEntity : factoryOrderEntities) {
AdvanceEntity advanceEntity = new AdvanceEntity(); // 需要从老系统进行订单数据查询
advanceEntity.setOrderSelfNum(StringUtil.isBlank(factoryOrderEntity.getSelfCode()) ? "" : factoryOrderEntity.getSelfCode()); //订单自编号 AdvanceEntity advanceEntity = iAdvanceClient.getQueryDataOne(factoryOrderEntity.getSelfCode());
advanceEntity.setSiteName(""); // 基地 TODO 需要映射 if(ObjectUtils.isNull(advanceEntity)){
advanceEntity.setArea(""); // 区域 advanceEntity = new AdvanceEntity();
advanceEntity.setOrderTypeName(""); //订单类型名称 可以为空 advanceEntity.setOrderSelfNum(StringUtil.isBlank(factoryOrderEntity.getSelfCode()) ? "" : factoryOrderEntity.getSelfCode()); //订单自编号
advanceEntity.setOrderClassName("工厂"); //订单类型 可以为空 advanceEntity.setSiteName(""); // 基地 TODO 需要映射
advanceEntity.setType(FactoryConstant.OUPAI); advanceEntity.setArea(""); // 区域
advanceEntity.setTotal(factoryOrderEntity.getFactorySendQty()); //订单总数据 advanceEntity.setOrderTypeName(""); //订单类型名称 可以为空
advanceEntity.setMctsTruck(receivingOrderEntity.getCarNumber()); //车次 advanceEntity.setOrderClassName("工厂"); //订单类型 可以为空
advanceEntity.setMtdsNo("");// 生产单号 advanceEntity.setType(FactoryConstant.OUPAI);
advanceEntity.setMctsTruckNo(receivingOrderEntity.getPlate());// 车牌//字段没有了 advanceEntity.setTotal(factoryOrderEntity.getFactorySendQty()); //订单总数据
advanceEntity.setFirstPackName(""); //一级品类 advanceEntity.setMctsTruck(receivingOrderEntity.getCarNumber()); //车次
advanceEntity.setFirstPackCode(""); //一级品类 advanceEntity.setMtdsNo("");// 生产单号
advanceEntity.setDealerName(factoryOrderEntity.getShopReceiver()); //商场名称 advanceEntity.setMctsTruckNo(receivingOrderEntity.getPlate());// 车牌//字段没有了
advanceEntity.setDealerCode(""); //商场编码 advanceEntity.setFirstPackName(""); //一级品类
advanceEntity.setDueDate(""); // 交期 advanceEntity.setFirstPackCode(""); //一级品类
advanceEntity.setIsOpai(0); //是否干仓配 advanceEntity.setDealerName(factoryOrderEntity.getShopReceiver()); //商场名称
advanceEntity.setOrderNum("");//MSCS订单号 可以为空 advanceEntity.setDealerCode(""); //商场编码
advanceEntity.setCarrierName("汇通");//承运商 可以为空 advanceEntity.setDueDate(""); // 交期
advanceEntity.setCustomerName(StringUtil.isBlank(factoryOrderEntity.getCustomer()) ? "" : factoryOrderEntity.getCustomer()); //顾客名称 advanceEntity.setIsOpai(0); //是否干仓配
advanceEntity.setCustomerPhone(StringUtil.isBlank(factoryOrderEntity.getCustomerPhone()) ? "" : factoryOrderEntity.getCustomerPhone()); // 顾客电话 advanceEntity.setOrderNum("");//MSCS订单号 可以为空
advanceEntity.setCustomerRoad(StringUtil.isBlank(factoryOrderEntity.getCustomerAddress()) ? "" : factoryOrderEntity.getCustomerAddress());//顾客地址 advanceEntity.setCarrierName("汇通");//承运商 可以为空
advanceEntity.setSystemType("线上"); //订单类型 advanceEntity.setCustomerName(StringUtil.isBlank(factoryOrderEntity.getCustomer()) ? "" : factoryOrderEntity.getCustomer()); //顾客名称
advanceEntity.setStoreNo(StringUtil.isBlank(factoryOrderEntity.getStoreCode()) ? "" : factoryOrderEntity.getStoreCode()); //门店编码 advanceEntity.setCustomerPhone(StringUtil.isBlank(factoryOrderEntity.getCustomerPhone()) ? "" : factoryOrderEntity.getCustomerPhone()); // 顾客电话
advanceEntity.setStoreName(StringUtil.isBlank(factoryOrderEntity.getStoreName()) ? "" : factoryOrderEntity.getStoreCode()); //门店名称 advanceEntity.setCustomerRoad(StringUtil.isBlank(factoryOrderEntity.getCustomerAddress()) ? "" : factoryOrderEntity.getCustomerAddress());//顾客地址
advanceEntity.setSerialKey(""); //序列号 advanceEntity.setSystemType("线上"); //订单类型
advanceEntity.setServiceNum(StringUtil.isBlank(factoryOrderEntity.getServiceNumber()) ? "" : factoryOrderEntity.getServiceNumber()); //服务号 advanceEntity.setStoreNo(StringUtil.isBlank(factoryOrderEntity.getStoreCode()) ? "" : factoryOrderEntity.getStoreCode()); //门店编码
advanceEntity.setMatingCode("");//齐套模式 可以为空 advanceEntity.setStoreName(StringUtil.isBlank(factoryOrderEntity.getStoreName()) ? "" : factoryOrderEntity.getStoreCode()); //门店名称
advanceEntity.setContractNum("");//合同号 可以为空 advanceEntity.setSerialKey(""); //序列号
advanceEntity.setLeaveBehind("");//遗留:Y=是,N=否 advanceEntity.setServiceNum(StringUtil.isBlank(factoryOrderEntity.getServiceNumber()) ? "" : factoryOrderEntity.getServiceNumber()); //服务号
advanceEntity.setSenderMobile("");//发货人电话 可以为空 advanceEntity.setMatingCode("");//齐套模式 可以为空
advanceEntity.setSenderAddress(""); //发货地址 可以为空 advanceEntity.setContractNum("");//合同号 可以为空
advanceEntity.setSenderName(""); //发货工厂名称 可以为空 advanceEntity.setLeaveBehind("");//遗留:Y=是,N=否
advanceEntity.setAdministratorsId(1078);// 导入人 advanceEntity.setSenderMobile("");//发货人电话 可以为空
advanceEntity.setCreateTime(LocalDate.now()); //添加时间 advanceEntity.setSenderAddress(""); //发货地址 可以为空
advanceEntity.setCarsNum(""); advanceEntity.setSenderName(""); //发货工厂名称 可以为空
advanceEntity.setDeleteTime(0); // 删除时间 advanceEntity.setAdministratorsId(1078);// 导入人
advanceEntity.setWaybillNo("");//运单号 可以为空 advanceEntity.setCreateTime(LocalDate.now()); //添加时间
advanceEntity.setCarsNum(receivingOrderEntity.getCarNumber());
advanceEntity.setDeleteTime(0); // 删除时间
advanceEntity.setWaybillNo("");//运单号 可以为空
// Integer id = PanFactoryEnum.getId(panFactoryOrder.getPlantId()); // Integer id = PanFactoryEnum.getId(panFactoryOrder.getPlantId());
advanceEntity.setWarehouseId(141); //导入人仓库id TODO 需要提供映射 advanceEntity.setWarehouseId(141); //导入人仓库id TODO 需要提供映射
advanceEntity.setWaybillStatus(Byte.parseByte("1"));//开单状态:1=未开单,2=已开单 advanceEntity.setWaybillStatus(Byte.parseByte("1"));//开单状态:1=未开单,2=已开单
advanceEntity.setOldId(0);// advanceEntity.setOldId(0);//
advanceEntity.setFreeze(Byte.parseByte("1"));//冻结状态:1=正常,2=冻结 advanceEntity.setFreeze(Byte.parseByte("1"));//冻结状态:1=正常,2=冻结
advanceEntity.setDeleteReason("");//删除原因 advanceEntity.setDeleteReason("");//删除原因
advanceEntity.setDeleteAdministratorsId(0);//删除用户 advanceEntity.setDeleteAdministratorsId(0);//删除用户
Integer advanceId = iAdvanceClient.addAdvanceClient(advanceEntity); Integer advanceId = iAdvanceClient.addAdvanceClient(advanceEntity);
if (ObjectUtils.isNull(advanceId)) { if (ObjectUtils.isNull(advanceId)) {
continue; continue;
}
advanceEntity.setId(advanceId);
}else{
// 更新数据 对这个 advanceEntity 这个进行属性设置 调用对象的更新方法
} }
advanceEntity.setId(advanceId);
factoryOrderEntity.setTurnStatus(1); factoryOrderEntity.setTurnStatus(1);
// 处理订单下面的包件数据 // 处理订单下面的包件数据
@ -445,12 +453,16 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
AdvanceDetailEntity advanceDetailEntity = advanceDetailClient.getOneByUnitNo(factoryPackageEntity.getCode()); AdvanceDetailEntity advanceDetailEntity = advanceDetailClient.getOneByUnitNo(factoryPackageEntity.getCode());
if (ObjectUtil.isNotEmpty(advanceDetailEntity)) { if (ObjectUtil.isNotEmpty(advanceDetailEntity)) {
// 一 er san 级包件信息 // 一 er san 级包件信息
advanceDetailEntity.setFirstPackName(factoryPackageEntity.getFirstClassName());//一级品类
advanceDetailEntity.setFirstPackCode(factoryPackageEntity.getFirstClassCode());//二级品类
advanceDetailEntity.setFirstPackCode(factoryPackageEntity.getFirstClassCode());//二级品类
advanceDetailEntity.setSecondPackName(factoryPackageEntity.getSecondClassName());//二级品类名称
advanceDetailEntity.setSecondPackCode(factoryPackageEntity.getSecondClassCode());//二级品类
advanceDetailEntity.setThirdPackName(factoryPackageEntity.getThirdClassName());//三级品类名称
advanceDetailEntity.setThirdPackCode(factoryPackageEntity.getThirdClassCode());//三级品类
// 更新物料 // 更新物料
// 当这个包条存在老系统的时候 // 当这个包条存在老系统的时候
advanceDetailEntity.setMctsTruckNo(factoryPackageEntity.getCarNumber()); advanceDetailEntity.setMctsTruckNo(factoryPackageEntity.getCarNumber());
//更新包件 //更新包件
@ -487,7 +499,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceDetailEntity.setMtdsNum(0);//销售数量 advanceDetailEntity.setMtdsNum(0);//销售数量
advanceDetailEntity.setVolume("");//体积 advanceDetailEntity.setVolume("");//体积
advanceDetailEntity.setUnitNo(StringUtil.isBlank(factoryPackageEntity.getCode()) ? "" : factoryPackageEntity.getCode());//包条码 advanceDetailEntity.setUnitNo(StringUtil.isBlank(factoryPackageEntity.getCode()) ? "" : factoryPackageEntity.getCode());//包条码
advanceDetailEntity.setMctsTruck(factoryPackageEntity.getCarNumber());//车次号 advanceDetailEntity.setMctsTruck(advanceEntity.getMctsTruck());//车次号
advanceDetailEntity.setMctsTruckNo(advanceEntity.getMctsTruckNo());//车牌号 advanceDetailEntity.setMctsTruckNo(advanceEntity.getMctsTruckNo());//车牌号
advanceDetailEntity.setDate100(null);//基地发货日期 advanceDetailEntity.setDate100(null);//基地发货日期
advanceDetailEntity.setDate2("");//预约到厂时间 advanceDetailEntity.setDate2("");//预约到厂时间

4
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java

@ -261,9 +261,9 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
factoryPackageEntity.setOrderId(orderId); factoryPackageEntity.setOrderId(orderId);
factoryPackageEntity.setCode(packageCode); factoryPackageEntity.setCode(packageCode);
factoryPackageEntity.setFirstClassCode(packageEntity.getString("FirstClassCode")); factoryPackageEntity.setFirstClassCode(packageEntity.getString("FirstClassCode"));
factoryPackageEntity.setFirstClassCode(packageEntity.getString("FirstClassName")); factoryPackageEntity.setFirstClassName(packageEntity.getString("FirstClassName"));
factoryPackageEntity.setSecondClassCode(packageEntity.getString("SecondClassCode")); factoryPackageEntity.setSecondClassCode(packageEntity.getString("SecondClassCode"));
factoryPackageEntity.setSecondClassName(packageEntity.getString("secondClassName")); factoryPackageEntity.setSecondClassName(packageEntity.getString("SecondClassName"));
factoryPackageEntity.setThirdClassCode(packageEntity.getString("ThirdClassCode")); factoryPackageEntity.setThirdClassCode(packageEntity.getString("ThirdClassCode"));
factoryPackageEntity.setThirdClassName(packageEntity.getString("ThirdClassName")); factoryPackageEntity.setThirdClassName(packageEntity.getString("ThirdClassName"));
Boolean buyIn = packageEntity.getBoolean("BuyIn"); Boolean buyIn = packageEntity.getBoolean("BuyIn");

Loading…
Cancel
Save