|
|
|
@ -9,9 +9,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
|
import com.logpm.basic.entity.BasicMaterialEntity; |
|
|
|
|
import com.logpm.basic.feign.IBasicMaterialClient; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataBrandEntity; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataClientEntity; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataWarehouseEntity; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataBrandClient; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataClientClient; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataStoreBusinessClient; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataWarehouseClient; |
|
|
|
@ -37,7 +39,6 @@ import com.logpm.factory.snm.entity.PanPackageInfo;
|
|
|
|
|
import com.logpm.factory.snm.entity.PanPackageList; |
|
|
|
|
import com.logpm.oldproject.entity.*; |
|
|
|
|
import com.logpm.oldproject.feign.*; |
|
|
|
|
import com.logpm.oldproject.vo.DistributionParcelListEntityVO; |
|
|
|
|
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; |
|
|
|
|
import com.logpm.trunkline.entity.TrunklineAdvanceEntity; |
|
|
|
|
import com.logpm.trunkline.entity.TrunklineDetailProductEntity; |
|
|
|
@ -111,6 +112,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
|
|
|
|
|
private final IDetailProductClient detailProductClient; |
|
|
|
|
private final ITrunklineDetailProductClient trunklineDetailProductClient; |
|
|
|
|
private final ITrunklineAdvanceDetailClient trunklineAdvanceDetailClient; |
|
|
|
|
private final IBasicdataBrandClient basicdataBrandClient; |
|
|
|
|
|
|
|
|
|
private final IOrderCountClient orderCountClient; |
|
|
|
|
private final BladeRedis redis; |
|
|
|
@ -356,10 +358,19 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
@Override |
|
|
|
|
public void handleDataToPlatform(String unitNo, String operationTime) { |
|
|
|
|
logger.info("############handleDataToPlatform: 处理数据到platform unitNo={}", unitNo); |
|
|
|
|
public void handleDataToPlatform(String unitNo, String operationTime,Long newWarehouseId) { |
|
|
|
|
logger.info("############handleDataToPlatform: 处理数据到platform unitNo={} currentWarehouseId={}", unitNo,newWarehouseId); |
|
|
|
|
|
|
|
|
|
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(newWarehouseId); |
|
|
|
|
if(Objects.isNull(warehouseEntity)){ |
|
|
|
|
log.warn("##############handleDataToPlatform: 当前仓库信息不存在"); |
|
|
|
|
throw new CustomerException(405,"当前仓库信息不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int oldWarehouseId = warehouseEntity.getOldId(); |
|
|
|
|
|
|
|
|
|
//先查询包件是否已存入到新系统数据库
|
|
|
|
|
DistributionParcelListEntity distributionParcelListEntity = distributionParcelListClient.findByPacketBarCode(unitNo); |
|
|
|
|
DistributionParcelListEntity distributionParcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(unitNo,newWarehouseId); |
|
|
|
|
if (Objects.isNull(distributionParcelListEntity)) { |
|
|
|
|
//未找到包件信息那就去新增
|
|
|
|
|
//1.根据包条码去老系统数据库找到对应的包条信息
|
|
|
|
@ -385,57 +396,53 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, String> supplyData = advanceDetailClient.getSupplyData(unitNo); |
|
|
|
|
String destinationWarehouse= ""; |
|
|
|
|
String takeCompany= ""; |
|
|
|
|
if(ObjectUtil.isNotEmpty(supplyData)){ |
|
|
|
|
destinationWarehouse = supplyData.get("destinationWarehouse");//目的仓名称
|
|
|
|
|
takeCompany = supplyData.get("takeCompany"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// OrderDetailEntity orderDetailEntity = orderDetailClient.findByUnitNo(unitNo);
|
|
|
|
|
// if(Objects.isNull(orderDetailEntity)){
|
|
|
|
|
// logger.warn("############handleDataToPlatform: 包条信息不存在 unitNo={}",unitNo);
|
|
|
|
|
// throw new CustomerException(405, "包条信息不存在");
|
|
|
|
|
// Map<String, String> supplyData = advanceDetailClient.getSupplyData(unitNo);
|
|
|
|
|
// String destinationWarehouse= "";
|
|
|
|
|
// String takeCompany= "";
|
|
|
|
|
// if(ObjectUtil.isNotEmpty(supplyData)){
|
|
|
|
|
// destinationWarehouse = supplyData.get("destinationWarehouse");//目的仓名称
|
|
|
|
|
// takeCompany = supplyData.get("takeCompany");
|
|
|
|
|
// }
|
|
|
|
|
// Integer oldId = orderDetailEntity.getNowWarehouseId();
|
|
|
|
|
|
|
|
|
|
// 查询数据对应的仓库名称
|
|
|
|
|
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.findByName(destinationWarehouse); |
|
|
|
|
if(Objects.isNull(basicdataWarehouseEntity)){ |
|
|
|
|
logger.warn("############handleDataToPlatform: 仓库信息不存在 destinationWarehouse={}",destinationWarehouse); |
|
|
|
|
throw new CustomerException(405, "仓库信息不存在"); |
|
|
|
|
OrderDetailEntity orderDetailEntity = orderDetailClient.findByUnitNo(unitNo); |
|
|
|
|
if(Objects.isNull(orderDetailEntity)){ |
|
|
|
|
logger.warn("############handleDataToPlatform: 包条信息不存在 unitNo={}",unitNo); |
|
|
|
|
throw new CustomerException(405, "包条信息不存在"); |
|
|
|
|
} |
|
|
|
|
Long warehouseId = basicdataWarehouseEntity.getId(); |
|
|
|
|
|
|
|
|
|
// OrderCountEntity orderCountEntity = orderCountClient.getEntityByOrderCode(orderSelfNum,oldId);
|
|
|
|
|
// if(Objects.isNull(orderCountEntity)){
|
|
|
|
|
// log.warn("#################handleDataToPlatform: 未查询单订单信息 orderCode={}",orderSelfNum);
|
|
|
|
|
// throw new CustomerException(403,"未查询单订单信息");
|
|
|
|
|
// 查询数据对应的仓库名称
|
|
|
|
|
// BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.findByName(destinationWarehouse);
|
|
|
|
|
// if(Objects.isNull(basicdataWarehouseEntity)){
|
|
|
|
|
// logger.warn("############handleDataToPlatform: 仓库信息不存在 destinationWarehouse={}",destinationWarehouse);
|
|
|
|
|
// throw new CustomerException(405, "仓库信息不存在");
|
|
|
|
|
// }
|
|
|
|
|
// Long warehouseId = basicdataWarehouseEntity.getId();
|
|
|
|
|
|
|
|
|
|
OrderCountEntity orderCountEntity = orderCountClient.getEntityByOrderCode(orderSelfNum,oldWarehouseId); |
|
|
|
|
if(Objects.isNull(orderCountEntity)){ |
|
|
|
|
log.warn("#################handleDataToPlatform: 未查询单订单信息 orderCode={}",orderSelfNum); |
|
|
|
|
throw new CustomerException(403,"未查询单订单信息"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//判断新系统是否有这条订单数据
|
|
|
|
|
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderSelfNum,warehouseId); |
|
|
|
|
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderSelfNum,newWarehouseId); |
|
|
|
|
|
|
|
|
|
Long id; |
|
|
|
|
String waybillNoNum = advanceEntity.getWaybillNo(); |
|
|
|
|
String waybillNo = advanceEntity.getWaybillNo(); |
|
|
|
|
|
|
|
|
|
if (Objects.isNull(distributionStockArticleEntity)) { |
|
|
|
|
Date date = new Date(); |
|
|
|
|
if(StringUtil.isNoneBlank(operationTime)){ |
|
|
|
|
if(StringUtil.isNotBlank(operationTime)){ |
|
|
|
|
date = CommonUtil.StringToDate(operationTime); |
|
|
|
|
} |
|
|
|
|
logger.info("#################handleDataToPlatform.waybillNoNum: {}", waybillNoNum); |
|
|
|
|
logger.info("#################handleDataToPlatform.waybillNo: {}", waybillNo); |
|
|
|
|
|
|
|
|
|
distributionStockArticleEntity = new DistributionStockArticleEntity(); |
|
|
|
|
distributionStockArticleEntity.setOrderCode(orderSelfNum); |
|
|
|
|
distributionStockArticleEntity.setWaybillNumber(waybillNoNum); |
|
|
|
|
|
|
|
|
|
distributionStockArticleEntity.setWarehouse(basicdataWarehouseEntity.getName()); |
|
|
|
|
distributionStockArticleEntity.setWarehouseId(warehouseId); |
|
|
|
|
// 其实是客户
|
|
|
|
|
distributionStockArticleEntity.setMallName(takeCompany); |
|
|
|
|
distributionStockArticleEntity.setWaybillNumber(waybillNo); |
|
|
|
|
|
|
|
|
|
distributionStockArticleEntity.setWarehouse(warehouseEntity.getName()); |
|
|
|
|
distributionStockArticleEntity.setWarehouseId(newWarehouseId); |
|
|
|
|
|
|
|
|
|
distributionStockArticleEntity.setWarehouseEntryTime(date); |
|
|
|
|
distributionStockArticleEntity.setWarehouseEntryTimeEnd(date); |
|
|
|
@ -445,31 +452,29 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
|
|
|
|
|
// distributionStockArticleEntity.setWaybillNumber();// 运单号
|
|
|
|
|
distributionStockArticleEntity.setMallName(advanceEntity.getDealerName()); |
|
|
|
|
distributionStockArticleEntity.setMallCode(advanceEntity.getDealerCode()); |
|
|
|
|
distributionStockArticleEntity.setCompleteSet(1); |
|
|
|
|
|
|
|
|
|
//判断是否齐套 查询该订单自编号下面的包件是都全部都交由汇通了
|
|
|
|
|
Integer allNum = advanceDetailClient.getAllNumByOrderNo(orderSelfNum); |
|
|
|
|
if (total.equals(allNum)) { |
|
|
|
|
//如果数据库中的数据和订单上的数量相等就是齐套
|
|
|
|
|
distributionStockArticleEntity.setCompleteSet(1); |
|
|
|
|
} else { |
|
|
|
|
distributionStockArticleEntity.setCompleteSet(0); |
|
|
|
|
} |
|
|
|
|
logger.info("############basicdataWarehouseEntity {}", basicdataWarehouseEntity); |
|
|
|
|
if (!Objects.isNull(basicdataWarehouseEntity)) { |
|
|
|
|
distributionStockArticleEntity.setCreateDept(basicdataWarehouseEntity.getDepartment()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
WayBillEntity wayBillEntity = wayBillClient.getByWayBillByOrderCode(orderSelfNum); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(Objects.isNull(wayBillEntity)){ |
|
|
|
|
logger.error("包条同步失败 ----> 数据异常 包条对应的运单不存在 包件 {} 运单对象 {},",unitNo,wayBillEntity); |
|
|
|
|
return ; |
|
|
|
|
|
|
|
|
|
// Integer allNum = advanceDetailClient.getAllNumByOrderNo(orderSelfNum);
|
|
|
|
|
// if (total.equals(allNum)) {
|
|
|
|
|
// //如果数据库中的数据和订单上的数量相等就是齐套
|
|
|
|
|
// distributionStockArticleEntity.setCompleteSet(1);
|
|
|
|
|
// } else {
|
|
|
|
|
// distributionStockArticleEntity.setCompleteSet(0);
|
|
|
|
|
// }
|
|
|
|
|
// logger.info("############basicdataWarehouseEntity {}", basicdataWarehouseEntity);
|
|
|
|
|
// if (!Objects.isNull(basicdataWarehouseEntity)) {
|
|
|
|
|
// distributionStockArticleEntity.setCreateDept(basicdataWarehouseEntity.getDepartment());
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (ObjectUtils.isNotNull(wayBillEntity)) { |
|
|
|
|
WayBillEntity wayBillEntity = wayBillClient.getByWaybillNo(waybillNo); |
|
|
|
|
// if(Objects.isNull(wayBillEntity)){
|
|
|
|
|
// logger.error("包条同步失败 ----> 数据异常 包条对应的运单不存在 包件 {} 运单对象 {},",unitNo,wayBillEntity);
|
|
|
|
|
// return ;
|
|
|
|
|
// }
|
|
|
|
|
distributionStockArticleEntity.setTypeService("1");//默认商配
|
|
|
|
|
if (!Objects.isNull(wayBillEntity)) { |
|
|
|
|
|
|
|
|
|
distributionStockArticleEntity.setConsigneeUnit(wayBillEntity.getTakeCompany());//收货单位(经销商)
|
|
|
|
|
distributionStockArticleEntity.setConsigneePerson(wayBillEntity.getTakePerson());//收货人
|
|
|
|
@ -493,37 +498,34 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
|
|
|
|
|
distributionStockArticleEntity.setAcceptWarehouseName(t.getName()); |
|
|
|
|
distributionStockArticleEntity.setAcceptWarehouseId(t.getId()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String customerName = wayBillEntity.getTakeCompany();//客户名称
|
|
|
|
|
|
|
|
|
|
//通过客户名称去查询客户的服务类型、
|
|
|
|
|
distributionStockArticleEntity.setTypeService("1");//默认商配
|
|
|
|
|
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findByName(customerName); |
|
|
|
|
logger.info("订单同步出现的客户编号{} 匹配的客户", basicdataClientEntity); |
|
|
|
|
if (!Objects.isNull(basicdataClientEntity)) { |
|
|
|
|
//商城
|
|
|
|
|
distributionStockArticleEntity.setMallId(basicdataClientEntity.getId()); |
|
|
|
|
distributionStockArticleEntity.setMallName(basicdataClientEntity.getClientName()); |
|
|
|
|
distributionStockArticleEntity.setMallCode(basicdataClientEntity.getClientCode()); |
|
|
|
|
|
|
|
|
|
// todo 这里需要去查询门店 和新系统的门店ID 进行绑定
|
|
|
|
|
String peisongType = getPeisongTypeByClientId(basicdataClientEntity.getId()); |
|
|
|
|
logger.info("订单同步peisongType {} ", peisongType); |
|
|
|
|
|
|
|
|
|
if (StringUtil.isNoneBlank(peisongType)) { |
|
|
|
|
distributionStockArticleEntity.setTypeService(peisongType); |
|
|
|
|
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findByName(wayBillEntity.getTakeCompany()); |
|
|
|
|
logger.info("订单同步出现的客户编号{} 匹配的客户", basicdataClientEntity); |
|
|
|
|
if (!Objects.isNull(basicdataClientEntity)) { |
|
|
|
|
//商城
|
|
|
|
|
distributionStockArticleEntity.setMallId(basicdataClientEntity.getId()); |
|
|
|
|
distributionStockArticleEntity.setMallName(basicdataClientEntity.getClientName()); |
|
|
|
|
distributionStockArticleEntity.setMallCode(basicdataClientEntity.getClientCode()); |
|
|
|
|
|
|
|
|
|
// todo 这里需要去查询门店 和新系统的门店ID 进行绑定
|
|
|
|
|
String peisongType = getPeisongTypeByClientId(basicdataClientEntity.getId()); |
|
|
|
|
logger.info("订单同步peisongType {} ", peisongType); |
|
|
|
|
|
|
|
|
|
if (StringUtil.isNotBlank(peisongType)) { |
|
|
|
|
distributionStockArticleEntity.setTypeService(peisongType); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
distributionStockArticleEntity.setGenre(1); |
|
|
|
|
distributionStockArticleEntity.setAdvanceId(advanceId); |
|
|
|
|
//--------------2023-07-06 新增字段处理
|
|
|
|
|
|
|
|
|
|
//查询包条码对应的运单信息
|
|
|
|
|
waybillNoNum = supplyData.get("logiBillNo"); |
|
|
|
|
//存入运单信息
|
|
|
|
|
saveWaybillEntity(waybillNoNum ); |
|
|
|
|
saveWaybillEntity(waybillNo); |
|
|
|
|
|
|
|
|
|
// 增加订单 经销商信息 和门店信息
|
|
|
|
|
buildDealerAndStore(distributionStockArticleEntity, advanceEntity); |
|
|
|
@ -559,7 +561,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//保存包件信息
|
|
|
|
|
saveOrderPackage(unitNo, distributionStockArticleEntity, basicdataWarehouseEntity, waybillNoNum,operationTime,basicdataWarehouseEntity.getOldId()); |
|
|
|
|
saveOrderPackage(unitNo, distributionStockArticleEntity, warehouseEntity, waybillNo,operationTime,oldWarehouseId); |
|
|
|
|
|
|
|
|
|
logger.info("#################handleDataToPlatform: 数据处理完成"); |
|
|
|
|
} else { |
|
|
|
@ -567,8 +569,8 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
|
|
|
|
|
logger.info("#################handleDataToPlatform: 包件信息已存在,不用处理 unitNo={}", unitNo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//存入包条缓存
|
|
|
|
|
bladeRedis.setEx("arrive-"+unitNo,unitNo,30L); |
|
|
|
|
// //存入包条缓存
|
|
|
|
|
// bladeRedis.setEx("arrive-"+unitNo,unitNo,30L);
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -665,33 +667,37 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
|
|
|
|
|
*/ |
|
|
|
|
private void saveOrderPackage(String unitNo, DistributionStockArticleEntity distributionStockArticleEntity, BasicdataWarehouseEntity basicdataWarehouseEntity, String waybillNo,String operationTime,Integer oldWarehouseId) { |
|
|
|
|
|
|
|
|
|
DistributionParcelListEntityVO vo = advanceDetailClient.getByUnitNo(unitNo);; |
|
|
|
|
// 判断当前查询包件不是否为皮阿落
|
|
|
|
|
// // todo 这里不合理 需要优化
|
|
|
|
|
// if("皮阿诺".equals(distributionStockArticleEntity.getBrand())){
|
|
|
|
|
// vo = advanceDetailClient.getByUnitNoByPyl(unitNo);
|
|
|
|
|
// }else{
|
|
|
|
|
// vo = advanceDetailClient.getByUnitNo(unitNo);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// DistributionParcelListEntityVO vo = advanceDetailClient.getByUnitNo(unitNo);
|
|
|
|
|
//// WarehouseWaybillEntity warehouseWaybill = warehouseWaybillClient.findByWaybillNo(waybillNo);
|
|
|
|
|
|
|
|
|
|
if(Objects.isNull(vo)){ |
|
|
|
|
logger.warn("##############saveOrderPackage: 未在老系统查询到包件数据 unitNo={}",unitNo); |
|
|
|
|
throw new CustomerException(405,"未在老系统查询到包件数据"); |
|
|
|
|
Long newWarehouseId = basicdataWarehouseEntity.getId(); |
|
|
|
|
String newWarehosueName = basicdataWarehouseEntity.getName(); |
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(unitNo, newWarehouseId); |
|
|
|
|
if(!Objects.isNull(parcelListEntity)){ |
|
|
|
|
logger.warn("##############saveOrderPackage: 新系统存在包件数据 unitNo={}",unitNo); |
|
|
|
|
throw new CustomerException(405,"新系统存在包件数据"); |
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity = trunklineAdvanceDetailClient.findEntityByOrderPackageCode(unitNo); |
|
|
|
|
if(Objects.isNull(trunklineAdvanceDetailEntity)){ |
|
|
|
|
logger.warn("##############saveOrderPackage: 暂存单包件信息不存在 unitNo={}",unitNo); |
|
|
|
|
throw new CustomerException(405,"暂存单包件信息不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
OrderDetailEntity orderDetailEntity = orderDetailClient.findEntityByUnitNoAndOldWarehosueId(unitNo,oldWarehouseId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DetailProductEntity> productEntityList = detailProductClient.findListByUnitNo(unitNo); |
|
|
|
|
DetailProductEntity detailProductEntity = productEntityList.get(0); |
|
|
|
|
|
|
|
|
|
DistributionParcelListEntity entity = new DistributionParcelListEntity(); |
|
|
|
|
BeanUtil.copyProperties(vo, entity); |
|
|
|
|
entity.setWarehouseId(newWarehouseId); |
|
|
|
|
entity.setWarehouse(newWarehosueName); |
|
|
|
|
entity.setWarehouseEntryTimeEnd(CommonUtil.StringToDate(operationTime)); |
|
|
|
|
entity.setFirsts(trunklineAdvanceDetailEntity.getFirstPackName()); |
|
|
|
|
entity.setSecond(trunklineAdvanceDetailEntity.getSecondPackName()); |
|
|
|
|
entity.setThirdProduct(trunklineAdvanceDetailEntity.getThirdPackName()); |
|
|
|
|
entity.setTrainNumber(trunklineAdvanceDetailEntity.getTrainNumber()); |
|
|
|
|
entity.setQuantity(1); |
|
|
|
|
entity.setOrderPackageCode(vo.getPacketBarCode()); |
|
|
|
|
entity.setOrderPackageCode(unitNo); |
|
|
|
|
entity.setConditions(1); |
|
|
|
|
entity.setWarehouse(distributionStockArticleEntity.getWarehouse()); |
|
|
|
|
entity.setWarehouseId(distributionStockArticleEntity.getWarehouseId()); |
|
|
|
|
entity.setStockArticleId(distributionStockArticleEntity.getId()); |
|
|
|
|
entity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue()); |
|
|
|
|
entity.setOrderPackageFreezeStatus(OrderPackageFreezeStatusConstant.weidongjie.getValue()); |
|
|
|
@ -702,6 +708,9 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
|
|
|
|
|
entity.setServiceNumber(distributionStockArticleEntity.getServiceNumber()); |
|
|
|
|
entity.setWaybillNumber(waybillNo); |
|
|
|
|
entity.setBrandName(distributionStockArticleEntity.getBrand()); |
|
|
|
|
entity.setAdvanceId(trunklineAdvanceDetailEntity.getAdvanceId()); |
|
|
|
|
entity.setWarehouseEntryTimeEnd(CommonUtil.StringToDate(operationTime)); |
|
|
|
|
|
|
|
|
|
// if(ObjectUtil.isNotEmpty(warehouseWaybill)){
|
|
|
|
|
// entity.setWarehouseId(warehouseWaybill.getId());
|
|
|
|
|
// }
|
|
|
|
@ -719,34 +728,22 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
|
|
|
|
|
entity.setDealerCode(distributionStockArticleEntity.getDealerCode()); |
|
|
|
|
entity.setDealerName(distributionStockArticleEntity.getDealerName()); |
|
|
|
|
|
|
|
|
|
if(!Objects.isNull(orderDetailEntity)){ |
|
|
|
|
entity.setWarehouseEntryTimeEnd(orderDetailEntity.getUpdateTime()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 绑定部门--仓库
|
|
|
|
|
if (!Objects.isNull(basicdataWarehouseEntity)) { |
|
|
|
|
entity.setCreateDept(basicdataWarehouseEntity.getDepartment()); |
|
|
|
|
} |
|
|
|
|
entity.setCreateUser(1714696768639311873L); |
|
|
|
|
entity.setUpdateUser(1714696768639311873L); |
|
|
|
|
entity.setCreateDept(1649331096241836033L); |
|
|
|
|
entity.setTenantId(TenantNum.HUITONGCODE); |
|
|
|
|
if (StringUtil.isNoneBlank(entity.getMaterialName()) && StringUtil.isNoneBlank(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()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
String materialCode = trunklineAdvanceDetailEntity.getMaterialCode(); |
|
|
|
|
String materialName = trunklineAdvanceDetailEntity.getMaterialName(); |
|
|
|
|
Long materialId = trunklineAdvanceDetailEntity.getMaterialId(); |
|
|
|
|
entity.setMaterialId(materialId); |
|
|
|
|
entity.setMaterialCode(materialCode); |
|
|
|
|
entity.setMaterialName(materialName); |
|
|
|
|
boolean b = distributionParcelListClient.add(entity); |
|
|
|
|
if (!b) { |
|
|
|
|
logger.warn("#################handleDataToPlatform: 保存包件信息失败 orderCode={}", entity.getOrderCode()); |
|
|
|
|
throw new CustomerException(405, "保存包件信息失败"); |
|
|
|
|
}else{ |
|
|
|
|
logger.info("################handleDataToPlatform: 保存包件成功 OrderPackageCode={}",vo.getPacketBarCode()); |
|
|
|
|
logger.info("################handleDataToPlatform: 保存包件成功 OrderPackageCode={}",unitNo); |
|
|
|
|
// Integer handQuantity = distributionStockArticleEntity.getHandQuantity();
|
|
|
|
|
// Integer totalNumber = distributionStockArticleEntity.getTotalNumber();
|
|
|
|
|
//
|
|
|
|
@ -799,6 +796,9 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
|
|
|
|
|
String agent = wayBillEntity.getAgent(); |
|
|
|
|
|
|
|
|
|
warehouseWaybill = new WarehouseWaybillEntity(); |
|
|
|
|
warehouseWaybill.setCreateUser(1714696768639311873L); |
|
|
|
|
warehouseWaybill.setUpdateUser(1714696768639311873L); |
|
|
|
|
warehouseWaybill.setCreateDept(1649331096241836033L); |
|
|
|
|
warehouseWaybill.setWaybillNo(waybillNo); |
|
|
|
|
warehouseWaybill.setDestinationWarehouseName(warehouseName); |
|
|
|
|
warehouseWaybill.setDestinationWarehouseId(Objects.isNull(endhouse) ? null : endhouse.getId()); |
|
|
|
@ -1006,6 +1006,8 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
|
|
|
|
|
List<TrunklineAdvanceDetailEntity> newPackageList = new ArrayList<>(); |
|
|
|
|
for (AdvanceDetailEntity advanceDetailEntity : detailList) { |
|
|
|
|
String unitNo = advanceDetailEntity.getUnitNo(); |
|
|
|
|
List<DetailProductEntity> detailProductList = detailProductClient.findListByUnitNo(unitNo); |
|
|
|
|
DetailProductEntity productEntity = detailProductList.get(0); |
|
|
|
|
TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity = new TrunklineAdvanceDetailEntity(); |
|
|
|
|
trunklineAdvanceDetailEntity.setTenantId(TenantNum.HUITONGCODE); |
|
|
|
|
trunklineAdvanceDetailEntity.setCreateUser(1714696768639311873L); |
|
|
|
@ -1035,10 +1037,34 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
|
|
|
|
|
trunklineAdvanceDetailEntity.setWaybillNo(waybillNo); |
|
|
|
|
trunklineAdvanceDetailEntity.setPackageStatus("1"); |
|
|
|
|
trunklineAdvanceDetailEntity.setChargeType(1); |
|
|
|
|
String productcode = productEntity.getProductcode(); |
|
|
|
|
String productname = productEntity.getProductname(); |
|
|
|
|
|
|
|
|
|
BasicMaterialEntity basicMaterialEntity = basicMaterialClient.findEntityByCodeAndName(productcode, productname); |
|
|
|
|
if(Objects.isNull(basicMaterialEntity)){ |
|
|
|
|
BasicdataBrandEntity basicdataBrandEntity = basicdataBrandClient.findEntityByName(brand); |
|
|
|
|
basicMaterialEntity = new BasicMaterialEntity(); |
|
|
|
|
basicMaterialEntity.setProductCode(productcode); |
|
|
|
|
basicMaterialEntity.setName(productname); |
|
|
|
|
if(!Objects.isNull(basicdataBrandEntity)){ |
|
|
|
|
basicMaterialEntity.setBrandId(basicdataBrandEntity.getId()+""); |
|
|
|
|
} |
|
|
|
|
basicMaterialEntity.setProperty("家配"); |
|
|
|
|
basicMaterialEntity.setSpecification("件"); |
|
|
|
|
basicMaterialEntity.setPackingSpecification(advanceDetailEntity.getMscsNum()+"件/箱"); |
|
|
|
|
basicMaterialEntity.setLogpmUnit("箱"); |
|
|
|
|
basicMaterialEntity.setSku(productcode); |
|
|
|
|
basicMaterialEntity.setPackageNum(advanceDetailEntity.getMscsNum()); |
|
|
|
|
basicMaterialEntity.setHide(1); |
|
|
|
|
Long aLong = basicMaterialClient.addMaterial(basicMaterialEntity); |
|
|
|
|
basicMaterialEntity.setId(aLong); |
|
|
|
|
} |
|
|
|
|
trunklineAdvanceDetailEntity.setMaterialId(basicMaterialEntity.getId()); |
|
|
|
|
trunklineAdvanceDetailEntity.setMaterialCode(basicMaterialEntity.getProductCode()); |
|
|
|
|
trunklineAdvanceDetailEntity.setMaterialName(basicMaterialEntity.getName()); |
|
|
|
|
newPackageList.add(trunklineAdvanceDetailEntity); |
|
|
|
|
|
|
|
|
|
//同步包内明细
|
|
|
|
|
List<DetailProductEntity> detailProductList = detailProductClient.findListByUnitNo(unitNo); |
|
|
|
|
List<TrunklineDetailProductEntity> trunklineDetailProductEntities = new ArrayList<>(); |
|
|
|
|
for (DetailProductEntity detailProductEntity : detailProductList) { |
|
|
|
|
TrunklineDetailProductEntity trunklineDetailProductEntity = new TrunklineDetailProductEntity(); |
|
|
|
|