|
|
|
@ -59,7 +59,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
// 对返回i的数据进行处理 按照 发车单-->订单-->包件 完成保存
|
|
|
|
|
handleData(code); |
|
|
|
|
|
|
|
|
|
if(ObjectUtils.isNotNull(code)){ |
|
|
|
|
if (ObjectUtils.isNotNull(code)) { |
|
|
|
|
asyncDataService.handlerOuPaiDataToHt(code); |
|
|
|
|
} |
|
|
|
|
return code; |
|
|
|
@ -67,9 +67,9 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String saveOuPaiPackageStatusByCode(String orderCode,Integer event) { |
|
|
|
|
public String saveOuPaiPackageStatusByCode(String orderCode, Integer event) { |
|
|
|
|
//
|
|
|
|
|
String url = ouPaiProperties.getUri() + "tims_odata_api/api/odata/ReceivingOrder?$filter=Code eq '"+orderCode+"'&select=Code,Type,Status,Plate,PackagesCount,ReceivePackageCount,PlateNum,CarNumber,CarrierCode,SendTime,ArrivalTime,ReceiveTime,CreateTime,ReturnNumber\n" + |
|
|
|
|
String url = ouPaiProperties.getUri() + "tims_odata_api/api/odata/ReceivingOrder?$filter=Code eq '" + orderCode + "'&select=Code,Type,Status,Plate,PackagesCount,ReceivePackageCount,PlateNum,CarNumber,CarrierCode,SendTime,ArrivalTime,ReceiveTime,CreateTime,ReturnNumber\n" + |
|
|
|
|
"&$expand=" + |
|
|
|
|
"Packages($select=Code,PdaNumber,FirstClassCode,FirstClassName,SecondClassCode,SecondClassName,ThirdClassCode,ThirdClassName,BuyIn,CosourcingCode,CosourcingUnit,SortingCenter,DistributionCenter,Length,Width,Height,Weight,OrderDetail,Order,PathIndex,PathDetail,DeliveryOrders,ReceivingOrders,LPN,LpnSerialNum,IsEntruck,ReservationOrder,OutGoingOrderDetail,SignBill,IsInventory,Inventories,InventoryInDetails,Freeze,OutGoingOrderDetailInventoryDetail,From,Creator,CreateTime,ShipTime,CarNumber,DeliveryMethod,DeliveryReceiver,DeliveryReceiverPhone,ReturnNumber,GroupType,CarrierCode,CarrierName,PackageDetailNames,ReceivingTime,SendTime,ExceptionSignRemark,Descript,SignTime,OutOrder,IsReceiveByHand,PackageStatus,PackageDetailNames;" + |
|
|
|
|
"$expand=Order($select=" + |
|
|
|
@ -80,7 +80,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
"&$expand=SendWarehouse($select=Name,Code)" + |
|
|
|
|
")&$expand=FromWarehouse($select=Name,Code)&$expand=CurrentWarehouse($select=Name,Code)&$expand=EndWarehouse($select=Name,Code)"; |
|
|
|
|
|
|
|
|
|
handlePackageData(url,event); |
|
|
|
|
handlePackageData(url, event); |
|
|
|
|
return orderCode; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -108,23 +108,23 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
"$expand=ReservationOrderInventoryDetail($select=Qty;$expand=Inventory($select=SerialNumber,BatchCode," + |
|
|
|
|
"Code,Name,Unit,Qty,HoldQty,SelectedQty,Location))))"; |
|
|
|
|
|
|
|
|
|
handleOutGoingOrderData(url,event); |
|
|
|
|
handleOutGoingOrderData(url, event); |
|
|
|
|
return orderCode; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String savaOuPaiSignBillByCode(String orderCode, Integer event) { |
|
|
|
|
//
|
|
|
|
|
String url = ouPaiProperties.getUri() + "tims_odata_api/api/odata/SignBill?$filter=Code eq '"+orderCode+"'" + |
|
|
|
|
String url = ouPaiProperties.getUri() + "tims_odata_api/api/odata/SignBill?$filter=Code eq '" + orderCode + "'" + |
|
|
|
|
"&$select=Code,Status,SignPerson,SignPhone,SignAddress,SignTime,Remark," + |
|
|
|
|
"&$expand=OutGoingOrder($select=Code,Status&$expand=OutGoingOrderDetails($select=))&$expand=Packages($select=Code,FirstClassName,PackageStatus)&$expand=SignPictures($select=)"; |
|
|
|
|
|
|
|
|
|
handleSignBillData(url,event); |
|
|
|
|
handleSignBillData(url, event); |
|
|
|
|
return orderCode; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void handleSignBillData(String url, Integer event) { |
|
|
|
|
OpOrderStatusLogEntity opOrderStatusLogEntity = sendRequestData(url,event); |
|
|
|
|
OpOrderStatusLogEntity opOrderStatusLogEntity = sendRequestData(url, event); |
|
|
|
|
|
|
|
|
|
// 保存需要解析的数据
|
|
|
|
|
// 获取返回内容
|
|
|
|
@ -137,7 +137,6 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
|
|
|
|
|
opOrderStatusLogEntity.setDataStatus(1); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("############handlePackageData: {}", e.getMessage()); |
|
|
|
|
opOrderStatusLogEntity.setDataStatus(2); |
|
|
|
|
} |
|
|
|
@ -145,7 +144,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void handleOutGoingOrderData(String url, Integer event) { |
|
|
|
|
OpOrderStatusLogEntity opOrderStatusLogEntity = sendRequestData(url,event); |
|
|
|
|
OpOrderStatusLogEntity opOrderStatusLogEntity = sendRequestData(url, event); |
|
|
|
|
|
|
|
|
|
// 保存需要解析的数据
|
|
|
|
|
// 获取返回内容
|
|
|
|
@ -156,10 +155,8 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
//TODO 这里需要添加处理配送发运单的逻辑
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
opOrderStatusLogEntity.setDataStatus(1); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("############handlePackageData: {}", e.getMessage()); |
|
|
|
|
opOrderStatusLogEntity.setDataStatus(2); |
|
|
|
|
} |
|
|
|
@ -167,9 +164,9 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void handlePackageData(String url,Integer event) { |
|
|
|
|
private void handlePackageData(String url, Integer event) { |
|
|
|
|
|
|
|
|
|
OpOrderStatusLogEntity opOrderStatusLogEntity = sendRequestData(url,event); |
|
|
|
|
OpOrderStatusLogEntity opOrderStatusLogEntity = sendRequestData(url, event); |
|
|
|
|
|
|
|
|
|
// 保存需要解析的数据
|
|
|
|
|
// 获取返回内容
|
|
|
|
@ -179,7 +176,14 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
map.put("type", "Push"); |
|
|
|
|
map.put("messageData", opOrderStatusLogEntity); |
|
|
|
|
map.put("createTime", new Date().getTime()); |
|
|
|
|
rabbitTemplate.convertAndSend(RabbitConstant.OUPAI_RECEIVING_EXCHANGE, RabbitConstant.OUPAI_RECEIVING_ROUTING, map); |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
rabbitTemplate.convertAndSend(RabbitConstant.RECEIVE_INFO_EXCHANGE, RabbitConstant.RECEIVE_INFO_ROUTING, map); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("############handlePackageData: {}", e.getMessage()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
log.info("############handlePackageData: 数据处理结束"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -359,7 +363,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
JSONObject store = orderEntity.getJSONObject("Store"); |
|
|
|
|
if(!Objects.isNull(store)){ |
|
|
|
|
if (!Objects.isNull(store)) { |
|
|
|
|
factoryOrderEntity.setStoreCode(store.getString("Code")); |
|
|
|
|
factoryOrderEntity.setStoreName(store.getString("Name")); |
|
|
|
|
} |
|
|
|
@ -489,11 +493,11 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
factoryPackageEntity.setPushStatus(0); |
|
|
|
|
factoryPackageEntity.setTurnStatus(0); |
|
|
|
|
boolean save = factoryPackageService.save(factoryPackageEntity); |
|
|
|
|
if(save){ |
|
|
|
|
if (save) { |
|
|
|
|
Long packageId = factoryPackageEntity.getId(); |
|
|
|
|
//保存物料信息
|
|
|
|
|
JSONArray packageDetails = packageEntity.getJSONArray("PackageDetails"); |
|
|
|
|
if(!Objects.isNull(packageDetails)){ |
|
|
|
|
if (!Objects.isNull(packageDetails)) { |
|
|
|
|
for (int k = 0; k < packageDetails.size(); k++) { |
|
|
|
|
JSONObject packageDetailsJSONObject = packageDetails.getJSONObject(k); |
|
|
|
|
FactoryPackageDetailEntity factoryPackageDetailEntity = new FactoryPackageDetailEntity(); |
|
|
|
@ -534,7 +538,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
*/ |
|
|
|
|
private OpOrderStatusLogEntity findOurPaiDataByCarNumber(String code) { |
|
|
|
|
|
|
|
|
|
String url = ouPaiProperties.getUri() + "tims_odata_api/api/odata/ReceivingOrder?$filter=Code eq '"+code+"'&select=Code,Type,Status,Plate,PackagesCount,ReceivePackageCount,PlateNum,CarNumber,CarrierCode,SendTime,ArrivalTime,ReceiveTime,CreateTime,ReturnNumber\n" + |
|
|
|
|
String url = ouPaiProperties.getUri() + "tims_odata_api/api/odata/ReceivingOrder?$filter=Code eq '" + code + "'&select=Code,Type,Status,Plate,PackagesCount,ReceivePackageCount,PlateNum,CarNumber,CarrierCode,SendTime,ArrivalTime,ReceiveTime,CreateTime,ReturnNumber\n" + |
|
|
|
|
"&$expand=" + |
|
|
|
|
"Packages($select=Code,PdaNumber,FirstClassCode,FirstClassName,SecondClassCode,SecondClassName,ThirdClassCode,ThirdClassName,BuyIn,CosourcingCode,CosourcingUnit,SortingCenter,DistributionCenter,Length,Width,Height,Weight,OrderDetail,Order,PathIndex,PathDetail,DeliveryOrders,ReceivingOrders,LPN,LpnSerialNum,IsEntruck,ReservationOrder,OutGoingOrderDetail,SignBill,IsInventory,Inventories,InventoryInDetails,Freeze,OutGoingOrderDetailInventoryDetail,From,Creator,CreateTime,ShipTime,CarNumber,DeliveryMethod,DeliveryReceiver,DeliveryReceiverPhone,ReturnNumber,GroupType,CarrierCode,CarrierName,PackageDetailNames,ReceivingTime,SendTime,ExceptionSignRemark,Descript,SignTime,OutOrder,IsReceiveByHand,PackageStatus,PackageDetailNames;" + |
|
|
|
|
"$expand=Order($select=" + |
|
|
|
|