|
|
|
@ -5,10 +5,7 @@ import cn.hutool.http.HttpResponse;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataTripartiteWarehouseEntity; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataTripartiteWarehouseClient; |
|
|
|
|
import com.logpm.factory.comfac.service.IAsyncDataService; |
|
|
|
|
import com.logpm.factory.oupai.entity.*; |
|
|
|
|
import com.logpm.factory.oupai.mapper.ReceivingOrderMapper; |
|
|
|
@ -106,7 +103,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
queryWrapper.eq("oid", orderPackageCode); |
|
|
|
|
FactoryPackageEntity packageEntity = factoryPackageService.getOne(queryWrapper); |
|
|
|
|
if (Objects.isNull(packageEntity)) { |
|
|
|
|
log.error("############oid 查询数据失败: {}", orderPackageCode); |
|
|
|
|
log.warn("############oid 查询数据失败: {}", orderPackageCode); |
|
|
|
|
return orderPackageCode; |
|
|
|
|
} |
|
|
|
|
packageEntity.setPackageStatus(5); |
|
|
|
@ -148,9 +145,10 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
String packageDetailNames = null; |
|
|
|
|
String firstPackName,secondPackName,thirdPackName = null; |
|
|
|
|
if (Objects.isNull(packageEntity)) { |
|
|
|
|
log.error("############oid 查询数据失败: {}", key); |
|
|
|
|
log.warn("############oid 查询数据失败: {}", key); |
|
|
|
|
// 查询欧派系统的的数据
|
|
|
|
|
String url = ouPaiProperties.getUri() + "tims_odata_api/api/odata/Package(" + key + ")?select=Code,PackageStatus,FirstClassCode,FirstClassName,SecondClassCode,SecondClassName,ThirdClassCode,ThirdClassName,BuyIn,CosourcingCode,CosourcingUnit,Length,Width,Height,Weight,IsInventory,SendTime,ReceivingTime,CreateTime,ShipTime,CarNumber,DeliveryMethod&$expand=ReceivingOrders($select=Code,Type,Status,Plate,PackagesCount,ReceivePackageCount,PlateNum,CarNumber,CarrierCode,SendTime,ArrivalTime,ReceiveTime,CreateTime,ReturnNumber;$expand=EndWarehouse($select=Name,Code))&$expand=Order($select=SelfCode,Code)"; OpOrderStatusLogEntity opOrderStatusLogEntity = sendRequestData(url, event); |
|
|
|
|
String url = ouPaiProperties.getUri() + "tims_odata_api/api/odata/Package(" + key + ")?select=Code,PackageStatus,FirstClassCode,FirstClassName,SecondClassCode,SecondClassName,ThirdClassCode,ThirdClassName,BuyIn,CosourcingCode,CosourcingUnit,Length,Width,Height,Weight,IsInventory,SendTime,ReceivingTime,CreateTime,ShipTime,CarNumber,DeliveryMethod&$expand=ReceivingOrders($select=Code,Type,Status,Plate,PackagesCount,ReceivePackageCount,PlateNum,CarNumber,CarrierCode,SendTime,ArrivalTime,ReceiveTime,CreateTime,ReturnNumber;$expand=EndWarehouse($select=Name,Code))&$expand=Order($select=SelfCode,Code)"; |
|
|
|
|
OpOrderStatusLogEntity opOrderStatusLogEntity = sendRequestData(url, event); |
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(opOrderStatusLogEntity.getResponseBody()); |
|
|
|
|
|
|
|
|
@ -163,7 +161,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
thirdPackName = jsonObject.getString("ThirdPackName"); |
|
|
|
|
|
|
|
|
|
if(isInventory){ |
|
|
|
|
log.error("############库存品数据 不进行推送: {}", code); |
|
|
|
|
log.warn("############库存品数据 不进行推送: {}", code); |
|
|
|
|
return key; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -178,14 +176,16 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
if(t!=null){ |
|
|
|
|
opShipNo = t.getString("Code"); |
|
|
|
|
JSONObject endWarehouse = t.getJSONObject("EndWarehouse"); |
|
|
|
|
log.info("############仓库对象: endWarehouse={}",endWarehouse); |
|
|
|
|
endWarehouseName = endWarehouse.getString("Name"); |
|
|
|
|
|
|
|
|
|
JSONObject fromWarehouse = t.getJSONObject("FromWarehouse"); |
|
|
|
|
log.info("############基地对象: fromWarehouse={}",fromWarehouse); |
|
|
|
|
siteName = fromWarehouse.getString("Name"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
log.error("############没有收货单oid:{}", key); |
|
|
|
|
log.warn("############没有收货单oid:{}", key); |
|
|
|
|
return key; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|