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