|
|
|
@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
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.factory.comfac.constant.FactoryConstant; |
|
|
|
|
import com.logpm.factory.comfac.dto.OrderStatusDTO; |
|
|
|
|
import com.logpm.factory.comfac.service.IAsyncDataService; |
|
|
|
|
import com.logpm.factory.oupai.entity.*; |
|
|
|
@ -111,6 +110,52 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String saveOuPaiFactoryOrderDTOByCarCarNumberAgain(String code) { |
|
|
|
|
log.info("数据重新获取 start {}", code); |
|
|
|
|
OpOrderStatusLogEntity opOrderStatusLogEntity = findOurPaiDataByCarNumberByLoal(code); |
|
|
|
|
|
|
|
|
|
// 保存需要解析的数据
|
|
|
|
|
// 获取返回内容
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
// 需要下载 数据中的内容
|
|
|
|
|
String responseUrl = opOrderStatusLogEntity.getResponseUrl(); |
|
|
|
|
|
|
|
|
|
// 下载这个数据
|
|
|
|
|
opOrderStatusLogEntity.setResponseBody(FileLogsUtil.loadFileContent(responseUrl)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(opOrderStatusLogEntity.getResponseBody()); |
|
|
|
|
JSONArray resultArray = jsonObject.getJSONArray("value"); |
|
|
|
|
log.info("############handleData: 数据处理开始"); |
|
|
|
|
analyzeData(resultArray); |
|
|
|
|
opOrderStatusLogEntity.setDataStatus(1); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error(">>>> 欧派数据解析报错", e); |
|
|
|
|
opOrderStatusLogEntity.setDataStatus(2); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
opOrderStatusLogService.saveOrUpdate(opOrderStatusLogEntity); |
|
|
|
|
log.info("数据重新获取 end {}", code); |
|
|
|
|
return code; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private OpOrderStatusLogEntity findOurPaiDataByCarNumberByLoal(String code) { |
|
|
|
|
|
|
|
|
|
// 查询自己数据 判断这个收货单号是否存在
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<OpOrderStatusLogEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
lambdaQueryWrapper.eq(OpOrderStatusLogEntity::getType, 3); |
|
|
|
|
lambdaQueryWrapper.like(OpOrderStatusLogEntity::getArgs, code); |
|
|
|
|
lambdaQueryWrapper.orderByAsc(OpOrderStatusLogEntity::getCreateTime); |
|
|
|
|
lambdaQueryWrapper.last("limit 1"); |
|
|
|
|
return opOrderStatusLogService.getOne(lambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String saveOuPaiPackageStatusByCode(String orderPackageCode, Integer event) { |
|
|
|
|
//
|
|
|
|
@ -372,20 +417,20 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
String currentWarehouseId = orderStatusDTO.getCurrentWarehouse();//当前仓Id
|
|
|
|
|
//查询destinationWarehouse logiBillNo plantId数据
|
|
|
|
|
log.info("oupai-handleStatusData >>> unitNo={}", unitNo); |
|
|
|
|
Map<String, String> supplyData = advanceDetailClient.getSupplyData(unitNo); |
|
|
|
|
if (ObjectUtils.isEmpty(supplyData)) { |
|
|
|
|
return Resp.fail(400, "未查询到该单据信息"); |
|
|
|
|
} |
|
|
|
|
String destinationWarehouseId = supplyData.get("destinationWarehouseId");//目的仓id
|
|
|
|
|
if (StringUtil.isBlank(currentWarehouseId) || StringUtil.isBlank(destinationWarehouseId)) { |
|
|
|
|
log.warn("##############oupai-handleStatusData: 仓库数据有问题currentWarehouseId={} destinationWarehouseId={}", currentWarehouseId, destinationWarehouseId); |
|
|
|
|
return Resp.fail(400, "仓库数据有误"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!currentWarehouseId.equals(destinationWarehouseId)) { |
|
|
|
|
log.info("##############oupai-handleStatusData: 不用处理的状态 currentWarehouseId={} destinationWarehouseId={}", currentWarehouseId, destinationWarehouseId); |
|
|
|
|
return Resp.fail(400, "不是目的仓"); |
|
|
|
|
} |
|
|
|
|
// Map<String, String> supplyData = advanceDetailClient.getSupplyData(unitNo);
|
|
|
|
|
// if (ObjectUtils.isEmpty(supplyData)) {
|
|
|
|
|
// return Resp.fail(400, "未查询到该单据信息");
|
|
|
|
|
// }
|
|
|
|
|
// String destinationWarehouseId = supplyData.get("destinationWarehouseId");//目的仓id
|
|
|
|
|
// if (StringUtil.isBlank(currentWarehouseId) || StringUtil.isBlank(destinationWarehouseId)) {
|
|
|
|
|
// log.warn("##############oupai-handleStatusData: 仓库数据有问题currentWarehouseId={} destinationWarehouseId={}", currentWarehouseId, destinationWarehouseId);
|
|
|
|
|
// return Resp.fail(400, "仓库数据有误");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (!currentWarehouseId.equals(destinationWarehouseId)) {
|
|
|
|
|
// log.info("##############oupai-handleStatusData: 不用处理的状态 currentWarehouseId={} destinationWarehouseId={}", currentWarehouseId, destinationWarehouseId);
|
|
|
|
|
// return Resp.fail(400, "不是目的仓");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// 查询这个包件对应到新系统的订单
|
|
|
|
|
FactoryOrderEntity factoryOrder = factoryOrderService.selectEntityByOrderPackageCode(unitNo); |
|
|
|
@ -451,21 +496,51 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
if (opPackagePushLogEntity == null) { |
|
|
|
|
log.info(" >>>>>>>>>>>>>>>>>>>>>>> 包件 {} 已推送欧派 状态 {}", unitNo, detailObject.get("Operate")); |
|
|
|
|
} else { |
|
|
|
|
// 需要盘点这个对象的
|
|
|
|
|
String resp = opPackagePushLogEntity.getResp(); |
|
|
|
|
// 转换为json
|
|
|
|
|
// JSONObject respJson = JSONObject.parseObject(resp);
|
|
|
|
|
log.info(" >>>>>>>>>>>>>>>>>>>>>>> 推送欧派返回数据 {}", resp); |
|
|
|
|
// TODO: 2023/10/25 不知道返回成功的状态是多少
|
|
|
|
|
// 需要修改包件对应的状态
|
|
|
|
|
factoryPackageEntity.setPushStatus(1); |
|
|
|
|
factoryPackageService.updateById(factoryPackageEntity); |
|
|
|
|
checkOpFactoryPackagePushStatus(factoryPackageEntity); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return Resp.success("物流状态传递成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据推送类型修改包件上的状态 |
|
|
|
|
* |
|
|
|
|
* @param factoryPackageEntity |
|
|
|
|
*/ |
|
|
|
|
void checkOpFactoryPackagePushStatus(FactoryPackageEntity factoryPackageEntity) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询推送记录 师傅包含 已收货 已出库
|
|
|
|
|
LambdaQueryWrapper<OpPackagePushLogEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
lambdaQueryWrapper.eq(OpPackagePushLogEntity::getRefId, factoryPackageEntity.getId()); |
|
|
|
|
lambdaQueryWrapper.eq(OpPackagePushLogEntity::getPushType, 1);// 查询包件
|
|
|
|
|
|
|
|
|
|
List<OpPackagePushLogEntity> list = opPackagePushLogService.list(lambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
if (list != null && !list.isEmpty()) { |
|
|
|
|
for (OpPackagePushLogEntity opPackagePushLogEntity : list) { |
|
|
|
|
if ("收货".equals(opPackagePushLogEntity.getPushOupaiNode())) { |
|
|
|
|
factoryPackageEntity.setPushStatus(3); |
|
|
|
|
} |
|
|
|
|
if ("发货".equals(opPackagePushLogEntity.getPushOupaiNode())) { |
|
|
|
|
factoryPackageEntity.setPushStatus(4); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
factoryPackageService.updateById(factoryPackageEntity); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
log.info("包件推送记录未null 包条码{}", factoryPackageEntity.getCode()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据汇通业务提供是否操作欧派系统的商场 来决定是否会推数据 |
|
|
|
|
* 如果需要使用欧派系统 这里就需要不进行回传 |
|
|
|
@ -594,6 +669,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
LambdaQueryWrapper<OpPackagePushLogEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
lambdaQueryWrapper.eq(OpPackagePushLogEntity::getRefId, refId); |
|
|
|
|
lambdaQueryWrapper.eq(OpPackagePushLogEntity::getPushOupaiNode, data.getString("Operate")); |
|
|
|
|
lambdaQueryWrapper.eq(OpPackagePushLogEntity::getPushType, pushType);// 查询包件
|
|
|
|
|
List<OpPackagePushLogEntity> list = opPackagePushLogService.list(lambdaQueryWrapper); |
|
|
|
|
if (ObjectUtils.isNull(list) || list.isEmpty()) { |
|
|
|
|
OpPackagePushLogEntity opPackagePushLogEntity = new OpPackagePushLogEntity(); |
|
|
|
@ -669,7 +745,8 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
lambdaQueryWrapper.eq(ReceivingOrderEntity::getCode, code); |
|
|
|
|
List<ReceivingOrderEntity> receivingOrderEntities = receivingOrderMapper.selectList(lambdaQueryWrapper); |
|
|
|
|
if (ObjectUtils.isNotNull(receivingOrderEntities)) { |
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>> 收货单已存在 {} ", code); |
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>> 收货单已存在 收货单下面的订单是否存在 包件是否存在{} ", code); |
|
|
|
|
extractedOuPaiOrderPackageInfor(valueObject, receivingOrderEntities.get(0).getId(), code); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -729,246 +806,270 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
if (row == 1) { |
|
|
|
|
log.info("############handleData: 保存发货单数据 成功成功成功成功 code={}", code); |
|
|
|
|
Long receivingId = receivingOrderEntity.getId();//发货单id
|
|
|
|
|
JSONArray packages = valueObject.getJSONArray("Packages"); |
|
|
|
|
for (int j = 0; j < packages.size(); j++) { |
|
|
|
|
JSONObject packageEntity = packages.getJSONObject(j);//包件信息
|
|
|
|
|
JSONObject orderEntity = packageEntity.getJSONObject("Order");//订单信息
|
|
|
|
|
if (orderEntity == null) { |
|
|
|
|
log.info("包件数据没有订单信息 packageCode {}", packageEntity.getString("Code")); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
String selfCode = orderEntity.getString("SelfCode");//订单自编码
|
|
|
|
|
//先查询是否存在订单自编码
|
|
|
|
|
//
|
|
|
|
|
FactoryOrderEntity factoryOrderEntity = factoryOrderService.selectEntityBySelfCode(selfCode, receivingId); |
|
|
|
|
if(Objects.isNull(factoryOrderEntity)){ |
|
|
|
|
factoryOrderEntity = new FactoryOrderEntity(); |
|
|
|
|
factoryOrderEntity.setCode(orderEntity.getString("Code")); |
|
|
|
|
factoryOrderEntity.setSelfCode(selfCode); |
|
|
|
|
factoryOrderEntity.setContractNumber(orderEntity.getString("ContractNumber")); |
|
|
|
|
factoryOrderEntity.setServiceNumber(orderEntity.getString("ServiceNumber")); |
|
|
|
|
factoryOrderEntity.setOrderClass(orderEntity.getString("OrderClass")); |
|
|
|
|
factoryOrderEntity.setOrderType(orderEntity.getString("OrderType")); |
|
|
|
|
String factoryStatus = orderEntity.getString("Status"); |
|
|
|
|
if ("待送货".equals(factoryStatus)) { |
|
|
|
|
factoryOrderEntity.setFactoryStatus(0); |
|
|
|
|
} else if ("已签收".equals(factoryStatus)) { |
|
|
|
|
factoryOrderEntity.setFactoryStatus(2); |
|
|
|
|
} else if ("已取消".equals(factoryStatus)) { |
|
|
|
|
factoryOrderEntity.setFactoryStatus(3); |
|
|
|
|
} else if ("部分签收".equals(factoryStatus)) { |
|
|
|
|
factoryOrderEntity.setFactoryStatus(6); |
|
|
|
|
} |
|
|
|
|
extractedOuPaiOrderPackageInfor(valueObject, receivingId, code); |
|
|
|
|
} else { |
|
|
|
|
log.error("############handleData: 保存发货单数据失败 code={}", code); |
|
|
|
|
throw new CustomerException(403, "保存发货单数据失败"); |
|
|
|
|
} |
|
|
|
|
Date end = new Date(); |
|
|
|
|
long startLong = start.getTime(); |
|
|
|
|
long endLong = end.getTime(); |
|
|
|
|
long l = endLong - startLong; |
|
|
|
|
log.info("############handleData: 数据处理完成 耗时 {} 毫秒", l); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String factoryShipStatus = orderEntity.getString("FactoryShipStatus"); |
|
|
|
|
if ("工厂未发货".equals(factoryShipStatus)) { |
|
|
|
|
factoryOrderEntity.setFactoryShipStatus(0); |
|
|
|
|
} else if ("工厂部分发货".equals(factoryShipStatus)) { |
|
|
|
|
factoryOrderEntity.setFactoryShipStatus(1); |
|
|
|
|
} else if ("工厂齐套发货".equals(factoryShipStatus)) { |
|
|
|
|
factoryOrderEntity.setFactoryShipStatus(2); |
|
|
|
|
} |
|
|
|
|
factoryOrderEntity.setFactorySendQty(orderEntity.getInteger("FactorySendQty")); |
|
|
|
|
|
|
|
|
|
String warehouseReceiveStatus = orderEntity.getString("WarehouseReceiveStatus"); |
|
|
|
|
if ("仓库未收货".equals(warehouseReceiveStatus)) { |
|
|
|
|
factoryOrderEntity.setWarehouseReceiveStatus(0); |
|
|
|
|
} else if ("仓库部分收货".equals(warehouseReceiveStatus)) { |
|
|
|
|
factoryOrderEntity.setWarehouseReceiveStatus(1); |
|
|
|
|
} else if ("仓库全部收货".equals(warehouseReceiveStatus)) { |
|
|
|
|
factoryOrderEntity.setWarehouseReceiveStatus(2); |
|
|
|
|
} |
|
|
|
|
factoryOrderEntity.setWarehouseReceiveQty(orderEntity.getInteger("WarehouseReceiveQty")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String reservationStatus = orderEntity.getString("ReservationStatus"); |
|
|
|
|
if ("不可预约".equals(reservationStatus)) { |
|
|
|
|
factoryOrderEntity.setReservationStatus(0); |
|
|
|
|
} else if ("可预约".equals(reservationStatus)) { |
|
|
|
|
factoryOrderEntity.setReservationStatus(1); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 欧派入库方法 |
|
|
|
|
* |
|
|
|
|
* @param valueObject |
|
|
|
|
* @param receivingId |
|
|
|
|
* @param code |
|
|
|
|
*/ |
|
|
|
|
private void extractedOuPaiOrderPackageInfor(JSONObject valueObject, Long receivingId, String code) { |
|
|
|
|
JSONArray packages = valueObject.getJSONArray("Packages"); |
|
|
|
|
|
|
|
|
|
log.info(">>> 获取的包件长度 {}", packages.size()); |
|
|
|
|
for (int j = 0; j < packages.size(); j++) { |
|
|
|
|
JSONObject packageEntity = packages.getJSONObject(j);//包件信息
|
|
|
|
|
log.info(">>>>> 解析出欧派的包件信息 {}", packageEntity.getString("Code")); |
|
|
|
|
JSONObject orderEntity = packageEntity.getJSONObject("Order");//订单信息
|
|
|
|
|
if (orderEntity == null) { |
|
|
|
|
log.info("包件数据没有订单信息 packageCode {}", packageEntity.getString("Code")); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
String selfCode = orderEntity.getString("SelfCode");//订单自编码
|
|
|
|
|
//先查询是否存在订单自编码
|
|
|
|
|
//
|
|
|
|
|
FactoryOrderEntity factoryOrderEntity = factoryOrderService.selectEntityBySelfCode(selfCode, receivingId); |
|
|
|
|
if (Objects.isNull(factoryOrderEntity)) { |
|
|
|
|
log.info(" oupai 收货单ID{} 收货单下面的订单不存在 进行新增订单 {}", receivingId, selfCode); |
|
|
|
|
factoryOrderEntity = new FactoryOrderEntity(); |
|
|
|
|
factoryOrderEntity.setCode(orderEntity.getString("Code")); |
|
|
|
|
factoryOrderEntity.setSelfCode(selfCode); |
|
|
|
|
factoryOrderEntity.setContractNumber(orderEntity.getString("ContractNumber")); |
|
|
|
|
factoryOrderEntity.setServiceNumber(orderEntity.getString("ServiceNumber")); |
|
|
|
|
factoryOrderEntity.setOrderClass(orderEntity.getString("OrderClass")); |
|
|
|
|
factoryOrderEntity.setOrderType(orderEntity.getString("OrderType")); |
|
|
|
|
String factoryStatus = orderEntity.getString("Status"); |
|
|
|
|
if ("待送货".equals(factoryStatus)) { |
|
|
|
|
factoryOrderEntity.setFactoryStatus(0); |
|
|
|
|
} else if ("已签收".equals(factoryStatus)) { |
|
|
|
|
factoryOrderEntity.setFactoryStatus(2); |
|
|
|
|
} else if ("已取消".equals(factoryStatus)) { |
|
|
|
|
factoryOrderEntity.setFactoryStatus(3); |
|
|
|
|
} else if ("部分签收".equals(factoryStatus)) { |
|
|
|
|
factoryOrderEntity.setFactoryStatus(6); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
JSONObject store = orderEntity.getJSONObject("Store"); |
|
|
|
|
if (!Objects.isNull(store)) { |
|
|
|
|
factoryOrderEntity.setStoreCode(store.getString("Code")); |
|
|
|
|
factoryOrderEntity.setStoreName(store.getString("Name")); |
|
|
|
|
JSONObject shop = store.getJSONObject("Shop"); |
|
|
|
|
if (!Objects.isNull(shop)) { |
|
|
|
|
factoryOrderEntity.setShopCode(shop.getString("Code")); |
|
|
|
|
factoryOrderEntity.setShopName(shop.getString("Name")); |
|
|
|
|
factoryOrderEntity.setBusinessModel(shop.getString("BusinessModel")); |
|
|
|
|
} |
|
|
|
|
String factoryShipStatus = orderEntity.getString("FactoryShipStatus"); |
|
|
|
|
if ("工厂未发货".equals(factoryShipStatus)) { |
|
|
|
|
factoryOrderEntity.setFactoryShipStatus(0); |
|
|
|
|
} else if ("工厂部分发货".equals(factoryShipStatus)) { |
|
|
|
|
factoryOrderEntity.setFactoryShipStatus(1); |
|
|
|
|
} else if ("工厂齐套发货".equals(factoryShipStatus)) { |
|
|
|
|
factoryOrderEntity.setFactoryShipStatus(2); |
|
|
|
|
} |
|
|
|
|
factoryOrderEntity.setFactorySendQty(orderEntity.getInteger("FactorySendQty")); |
|
|
|
|
|
|
|
|
|
String warehouseReceiveStatus = orderEntity.getString("WarehouseReceiveStatus"); |
|
|
|
|
if ("仓库未收货".equals(warehouseReceiveStatus)) { |
|
|
|
|
factoryOrderEntity.setWarehouseReceiveStatus(0); |
|
|
|
|
} else if ("仓库部分收货".equals(warehouseReceiveStatus)) { |
|
|
|
|
factoryOrderEntity.setWarehouseReceiveStatus(1); |
|
|
|
|
} else if ("仓库全部收货".equals(warehouseReceiveStatus)) { |
|
|
|
|
factoryOrderEntity.setWarehouseReceiveStatus(2); |
|
|
|
|
} |
|
|
|
|
factoryOrderEntity.setWarehouseReceiveQty(orderEntity.getInteger("WarehouseReceiveQty")); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
String reservationStatus = orderEntity.getString("ReservationStatus"); |
|
|
|
|
if ("不可预约".equals(reservationStatus)) { |
|
|
|
|
factoryOrderEntity.setReservationStatus(0); |
|
|
|
|
} else if ("可预约".equals(reservationStatus)) { |
|
|
|
|
factoryOrderEntity.setReservationStatus(1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
factoryOrderEntity.setMatingCode(orderEntity.getString("MatingCode")); |
|
|
|
|
Boolean isMating = orderEntity.getBoolean("IsMating"); |
|
|
|
|
if (isMating) { |
|
|
|
|
factoryOrderEntity.setIsMating(1); |
|
|
|
|
} else { |
|
|
|
|
factoryOrderEntity.setIsMating(0); |
|
|
|
|
} |
|
|
|
|
factoryOrderEntity.setFirstClassCode(orderEntity.getString("FirstClassCode")); |
|
|
|
|
Boolean leave = orderEntity.getBoolean("Leave"); |
|
|
|
|
if (leave) { |
|
|
|
|
factoryOrderEntity.setLeaveStatus(1); |
|
|
|
|
} else { |
|
|
|
|
factoryOrderEntity.setLeaveStatus(0); |
|
|
|
|
} |
|
|
|
|
factoryOrderEntity.setCustomer(orderEntity.getString("Customer")); |
|
|
|
|
factoryOrderEntity.setProvince(orderEntity.getString("Province")); |
|
|
|
|
factoryOrderEntity.setCity(orderEntity.getString("City")); |
|
|
|
|
factoryOrderEntity.setCustomerAddress(orderEntity.getString("CustomerAddress")); |
|
|
|
|
factoryOrderEntity.setCustomerPhone(orderEntity.getString("CustomerPhone")); |
|
|
|
|
factoryOrderEntity.setShopReceiver(orderEntity.getString("ShopReceiver")); |
|
|
|
|
factoryOrderEntity.setBrandCode(orderEntity.getString("BrandCode")); |
|
|
|
|
factoryOrderEntity.setBrandName(orderEntity.getString("BrandName")); |
|
|
|
|
factoryOrderEntity.setFirstShipTime(CommonUtil.StringToDateByT(orderEntity.getString("FirstShipTime"))); |
|
|
|
|
factoryOrderEntity.setMatingShipTime(CommonUtil.StringToDateByT(orderEntity.getString("MatingShipTime"))); |
|
|
|
|
factoryOrderEntity.setFirstReceiveTime(CommonUtil.StringToDateByT(orderEntity.getString("FirstReceiveTime"))); |
|
|
|
|
factoryOrderEntity.setMatingReceiveTime(CommonUtil.StringToDateByT(orderEntity.getString("MatingReceiveTime"))); |
|
|
|
|
Boolean freeze = orderEntity.getBoolean("Freeze"); |
|
|
|
|
if (freeze) { |
|
|
|
|
factoryOrderEntity.setFreeze(1); |
|
|
|
|
} else { |
|
|
|
|
factoryOrderEntity.setFreeze(0); |
|
|
|
|
} |
|
|
|
|
factoryOrderEntity.setOutGoingTime(CommonUtil.StringToDateByT(orderEntity.getString("OutGoingTime"))); |
|
|
|
|
factoryOrderEntity.setStatus(0); |
|
|
|
|
factoryOrderEntity.setReceivingId(receivingId); |
|
|
|
|
factoryOrderEntity.setReceiptStatus(0); |
|
|
|
|
factoryOrderEntity.setPushStatus(0); |
|
|
|
|
factoryOrderEntity.setTurnStatus(0); |
|
|
|
|
//
|
|
|
|
|
boolean save = factoryOrderService.save(factoryOrderEntity); |
|
|
|
|
if (!save) { |
|
|
|
|
log.error("############handleData: 保存订单失败 selfCode={}", selfCode); |
|
|
|
|
throw new CustomerException(403, "保存订单失败"); |
|
|
|
|
} |
|
|
|
|
JSONObject store = orderEntity.getJSONObject("Store"); |
|
|
|
|
if (!Objects.isNull(store)) { |
|
|
|
|
factoryOrderEntity.setStoreCode(store.getString("Code")); |
|
|
|
|
factoryOrderEntity.setStoreName(store.getString("Name")); |
|
|
|
|
JSONObject shop = store.getJSONObject("Shop"); |
|
|
|
|
if (!Objects.isNull(shop)) { |
|
|
|
|
factoryOrderEntity.setShopCode(shop.getString("Code")); |
|
|
|
|
factoryOrderEntity.setShopName(shop.getString("Name")); |
|
|
|
|
factoryOrderEntity.setBusinessModel(shop.getString("BusinessModel")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//保存订单成功,继续保存包件
|
|
|
|
|
Long orderId = factoryOrderEntity.getId(); |
|
|
|
|
String packageCode = packageEntity.getString("Code"); |
|
|
|
|
LambdaQueryWrapper<FactoryPackageEntity> packageEntityQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
packageEntityQueryWrapper.eq(FactoryPackageEntity::getCode, packageCode); |
|
|
|
|
|
|
|
|
|
FactoryPackageEntity factoryPackageEntity = factoryPackageService.getOne(packageEntityQueryWrapper); |
|
|
|
|
|
|
|
|
|
if (Objects.isNull(factoryPackageEntity)) { |
|
|
|
|
factoryPackageEntity = new FactoryPackageEntity(); |
|
|
|
|
factoryPackageEntity.setOrderId(orderId); |
|
|
|
|
factoryPackageEntity.setCode(packageCode); |
|
|
|
|
factoryPackageEntity.setOid(packageEntity.getString("Oid")); |
|
|
|
|
factoryPackageEntity.setFirstClassCode(packageEntity.getString("FirstClassCode")); |
|
|
|
|
factoryPackageEntity.setFirstClassName(packageEntity.getString("FirstClassName")); |
|
|
|
|
factoryPackageEntity.setSecondClassCode(packageEntity.getString("SecondClassCode")); |
|
|
|
|
factoryPackageEntity.setSecondClassName(packageEntity.getString("SecondClassName")); |
|
|
|
|
factoryPackageEntity.setThirdClassCode(packageEntity.getString("ThirdClassCode")); |
|
|
|
|
factoryPackageEntity.setThirdClassName(packageEntity.getString("ThirdClassName")); |
|
|
|
|
factoryPackageEntity.setPackageDetailNames(packageEntity.getString("PackageDetailNames")); |
|
|
|
|
factoryPackageEntity.setCarNumber(packageEntity.getString("CarNumber")); |
|
|
|
|
factoryPackageEntity.setReserve1(factoryOrderEntity.getCode()); |
|
|
|
|
Boolean buyIn = packageEntity.getBoolean("BuyIn"); |
|
|
|
|
if (buyIn) { |
|
|
|
|
factoryPackageEntity.setBuyin(1); |
|
|
|
|
} else { |
|
|
|
|
factoryPackageEntity.setBuyin(0); |
|
|
|
|
} |
|
|
|
|
factoryPackageEntity.setCosourcingCode(packageEntity.getString("CosourcingCode")); |
|
|
|
|
factoryPackageEntity.setCosourcingUnit(packageEntity.getString("CosourcingUnit")); |
|
|
|
|
String packageStatus = packageEntity.getString("PackageStatus"); |
|
|
|
|
//未知:0 已调度:1 已装车:2 待收货:3 已收货:4 已在库:5 待理货:6 待上架:7 已上架:8 已下架:9 已发运:10 已签收:11 待返货:12 已提件:13 已拒收:14 异常:-1
|
|
|
|
|
if ("已调度".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(1); |
|
|
|
|
} else if ("已装车".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(2); |
|
|
|
|
} else if ("待收货".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(3); |
|
|
|
|
} else if ("已收货".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(4); |
|
|
|
|
} else if ("已在库".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(5); |
|
|
|
|
} else if ("待理货".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(6); |
|
|
|
|
} else if ("待上架".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(7); |
|
|
|
|
} else if ("已上架".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(8); |
|
|
|
|
} else if ("已下架".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(9); |
|
|
|
|
} else if ("已发运".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(10); |
|
|
|
|
} else if ("已签收".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(11); |
|
|
|
|
} else if ("待返货".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(12); |
|
|
|
|
} else if ("已提件".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(13); |
|
|
|
|
} else if ("已拒收".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(14); |
|
|
|
|
} else if ("异常".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(-1); |
|
|
|
|
} else { |
|
|
|
|
factoryPackageEntity.setPackageStatus(0); |
|
|
|
|
} |
|
|
|
|
factoryPackageEntity.setLength(packageEntity.getBigDecimal("Length")); |
|
|
|
|
factoryPackageEntity.setWidth(packageEntity.getBigDecimal("Width")); |
|
|
|
|
factoryPackageEntity.setHeight(packageEntity.getBigDecimal("Height")); |
|
|
|
|
factoryPackageEntity.setWeight(packageEntity.getBigDecimal("Weight")); |
|
|
|
|
Boolean isInventory = packageEntity.getBoolean("IsInventory"); |
|
|
|
|
if (isInventory) { |
|
|
|
|
factoryPackageEntity.setIsInventory(1); |
|
|
|
|
} else { |
|
|
|
|
factoryPackageEntity.setIsInventory(0); |
|
|
|
|
} |
|
|
|
|
Boolean packageFreeze = packageEntity.getBoolean("Freeze"); |
|
|
|
|
if (packageFreeze) { |
|
|
|
|
factoryPackageEntity.setFreeze(1); |
|
|
|
|
} else { |
|
|
|
|
factoryPackageEntity.setFreeze(0); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//保存包件信息
|
|
|
|
|
factoryPackageEntity.setReceiptStatus(0); |
|
|
|
|
factoryPackageEntity.setPushStatus(0); |
|
|
|
|
factoryPackageEntity.setTurnStatus(0); |
|
|
|
|
boolean packageSave = factoryPackageService.save(factoryPackageEntity); |
|
|
|
|
if (packageSave) { |
|
|
|
|
Long packageId = factoryPackageEntity.getId(); |
|
|
|
|
//保存物料信息
|
|
|
|
|
JSONArray packageDetails = packageEntity.getJSONArray("PackageDetails"); |
|
|
|
|
if (!Objects.isNull(packageDetails)) { |
|
|
|
|
for (int k = 0; k < packageDetails.size(); k++) { |
|
|
|
|
JSONObject packageDetailsJSONObject = packageDetails.getJSONObject(k); |
|
|
|
|
FactoryPackageDetailEntity factoryPackageDetailEntity = new FactoryPackageDetailEntity(); |
|
|
|
|
factoryPackageDetailEntity.setPackageId(packageId); |
|
|
|
|
factoryPackageDetailEntity.setCode(packageDetailsJSONObject.getString("Code")); |
|
|
|
|
factoryPackageDetailEntity.setName(packageDetailsJSONObject.getString("Name")); |
|
|
|
|
factoryPackageDetailEntity.setType(packageDetailsJSONObject.getString("Type")); |
|
|
|
|
factoryPackageDetailEntity.setUnit(packageDetailsJSONObject.getString("Unit")); |
|
|
|
|
factoryPackageDetailEntity.setOrgCode(packageDetailsJSONObject.getString("OrgCode")); |
|
|
|
|
factoryPackageDetailService.save(factoryPackageDetailEntity); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
factoryOrderEntity.setMatingCode(orderEntity.getString("MatingCode")); |
|
|
|
|
Boolean isMating = orderEntity.getBoolean("IsMating"); |
|
|
|
|
if (isMating) { |
|
|
|
|
factoryOrderEntity.setIsMating(1); |
|
|
|
|
} else { |
|
|
|
|
factoryOrderEntity.setIsMating(0); |
|
|
|
|
} |
|
|
|
|
factoryOrderEntity.setFirstClassCode(orderEntity.getString("FirstClassCode")); |
|
|
|
|
Boolean leave = orderEntity.getBoolean("Leave"); |
|
|
|
|
if (leave) { |
|
|
|
|
factoryOrderEntity.setLeaveStatus(1); |
|
|
|
|
} else { |
|
|
|
|
factoryOrderEntity.setLeaveStatus(0); |
|
|
|
|
} |
|
|
|
|
factoryOrderEntity.setCustomer(orderEntity.getString("Customer")); |
|
|
|
|
factoryOrderEntity.setProvince(orderEntity.getString("Province")); |
|
|
|
|
factoryOrderEntity.setCity(orderEntity.getString("City")); |
|
|
|
|
factoryOrderEntity.setCustomerAddress(orderEntity.getString("CustomerAddress")); |
|
|
|
|
factoryOrderEntity.setCustomerPhone(orderEntity.getString("CustomerPhone")); |
|
|
|
|
factoryOrderEntity.setShopReceiver(orderEntity.getString("ShopReceiver")); |
|
|
|
|
factoryOrderEntity.setBrandCode(orderEntity.getString("BrandCode")); |
|
|
|
|
factoryOrderEntity.setBrandName(orderEntity.getString("BrandName")); |
|
|
|
|
factoryOrderEntity.setFirstShipTime(CommonUtil.StringToDateByT(orderEntity.getString("FirstShipTime"))); |
|
|
|
|
factoryOrderEntity.setMatingShipTime(CommonUtil.StringToDateByT(orderEntity.getString("MatingShipTime"))); |
|
|
|
|
factoryOrderEntity.setFirstReceiveTime(CommonUtil.StringToDateByT(orderEntity.getString("FirstReceiveTime"))); |
|
|
|
|
factoryOrderEntity.setMatingReceiveTime(CommonUtil.StringToDateByT(orderEntity.getString("MatingReceiveTime"))); |
|
|
|
|
Boolean freeze = orderEntity.getBoolean("Freeze"); |
|
|
|
|
if (freeze) { |
|
|
|
|
factoryOrderEntity.setFreeze(1); |
|
|
|
|
} else { |
|
|
|
|
factoryOrderEntity.setFreeze(0); |
|
|
|
|
} |
|
|
|
|
factoryOrderEntity.setOutGoingTime(CommonUtil.StringToDateByT(orderEntity.getString("OutGoingTime"))); |
|
|
|
|
factoryOrderEntity.setStatus(0); |
|
|
|
|
factoryOrderEntity.setReceivingId(receivingId); |
|
|
|
|
factoryOrderEntity.setReceiptStatus(0); |
|
|
|
|
factoryOrderEntity.setPushStatus(0); |
|
|
|
|
factoryOrderEntity.setTurnStatus(0); |
|
|
|
|
//
|
|
|
|
|
boolean save = factoryOrderService.save(factoryOrderEntity); |
|
|
|
|
if (!save) { |
|
|
|
|
log.error("############handleData: 保存订单失败 selfCode={}", selfCode); |
|
|
|
|
throw new CustomerException(403, "保存订单失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
log.error("############handleData: 包件码已存在 packageCode={} 收货单号 {}", packageCode,code); |
|
|
|
|
//保存订单成功,继续保存包件
|
|
|
|
|
Long orderId = factoryOrderEntity.getId(); |
|
|
|
|
String packageCode = packageEntity.getString("Code"); |
|
|
|
|
LambdaQueryWrapper<FactoryPackageEntity> packageEntityQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
packageEntityQueryWrapper.eq(FactoryPackageEntity::getCode, packageCode); |
|
|
|
|
|
|
|
|
|
FactoryPackageEntity factoryPackageEntity = factoryPackageService.getOne(packageEntityQueryWrapper); |
|
|
|
|
|
|
|
|
|
if (Objects.isNull(factoryPackageEntity)) { |
|
|
|
|
log.info(" oupai 收货单ID{} 收货单下面的包件不存在 进行新增订单 {} 关联包件 {}", receivingId, selfCode, packageCode); |
|
|
|
|
|
|
|
|
|
factoryPackageEntity = new FactoryPackageEntity(); |
|
|
|
|
factoryPackageEntity.setOrderId(orderId); |
|
|
|
|
factoryPackageEntity.setCode(packageCode); |
|
|
|
|
factoryPackageEntity.setOid(packageEntity.getString("Oid")); |
|
|
|
|
factoryPackageEntity.setFirstClassCode(packageEntity.getString("FirstClassCode")); |
|
|
|
|
factoryPackageEntity.setFirstClassName(packageEntity.getString("FirstClassName")); |
|
|
|
|
factoryPackageEntity.setSecondClassCode(packageEntity.getString("SecondClassCode")); |
|
|
|
|
factoryPackageEntity.setSecondClassName(packageEntity.getString("SecondClassName")); |
|
|
|
|
factoryPackageEntity.setThirdClassCode(packageEntity.getString("ThirdClassCode")); |
|
|
|
|
factoryPackageEntity.setThirdClassName(packageEntity.getString("ThirdClassName")); |
|
|
|
|
factoryPackageEntity.setPackageDetailNames(packageEntity.getString("PackageDetailNames")); |
|
|
|
|
factoryPackageEntity.setCarNumber(packageEntity.getString("CarNumber")); |
|
|
|
|
factoryPackageEntity.setReserve1(factoryOrderEntity.getCode()); |
|
|
|
|
Boolean buyIn = packageEntity.getBoolean("BuyIn"); |
|
|
|
|
if (buyIn) { |
|
|
|
|
factoryPackageEntity.setBuyin(1); |
|
|
|
|
} else { |
|
|
|
|
factoryPackageEntity.setBuyin(0); |
|
|
|
|
} |
|
|
|
|
factoryPackageEntity.setCosourcingCode(packageEntity.getString("CosourcingCode")); |
|
|
|
|
factoryPackageEntity.setCosourcingUnit(packageEntity.getString("CosourcingUnit")); |
|
|
|
|
String packageStatus = packageEntity.getString("PackageStatus"); |
|
|
|
|
//未知:0 已调度:1 已装车:2 待收货:3 已收货:4 已在库:5 待理货:6 待上架:7 已上架:8 已下架:9 已发运:10 已签收:11 待返货:12 已提件:13 已拒收:14 异常:-1
|
|
|
|
|
if ("已调度".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(1); |
|
|
|
|
} else if ("已装车".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(2); |
|
|
|
|
} else if ("待收货".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(3); |
|
|
|
|
} else if ("已收货".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(4); |
|
|
|
|
} else if ("已在库".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(5); |
|
|
|
|
} else if ("待理货".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(6); |
|
|
|
|
} else if ("待上架".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(7); |
|
|
|
|
} else if ("已上架".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(8); |
|
|
|
|
} else if ("已下架".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(9); |
|
|
|
|
} else if ("已发运".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(10); |
|
|
|
|
} else if ("已签收".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(11); |
|
|
|
|
} else if ("待返货".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(12); |
|
|
|
|
} else if ("已提件".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(13); |
|
|
|
|
} else if ("已拒收".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(14); |
|
|
|
|
} else if ("异常".equals(packageStatus)) { |
|
|
|
|
factoryPackageEntity.setPackageStatus(-1); |
|
|
|
|
} else { |
|
|
|
|
factoryPackageEntity.setPackageStatus(0); |
|
|
|
|
} |
|
|
|
|
factoryPackageEntity.setLength(packageEntity.getBigDecimal("Length")); |
|
|
|
|
factoryPackageEntity.setWidth(packageEntity.getBigDecimal("Width")); |
|
|
|
|
factoryPackageEntity.setHeight(packageEntity.getBigDecimal("Height")); |
|
|
|
|
factoryPackageEntity.setWeight(packageEntity.getBigDecimal("Weight")); |
|
|
|
|
Boolean isInventory = packageEntity.getBoolean("IsInventory"); |
|
|
|
|
if (isInventory) { |
|
|
|
|
factoryPackageEntity.setIsInventory(1); |
|
|
|
|
} else { |
|
|
|
|
factoryPackageEntity.setIsInventory(0); |
|
|
|
|
} |
|
|
|
|
Boolean packageFreeze = packageEntity.getBoolean("Freeze"); |
|
|
|
|
if (packageFreeze) { |
|
|
|
|
factoryPackageEntity.setFreeze(1); |
|
|
|
|
} else { |
|
|
|
|
factoryPackageEntity.setFreeze(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//throw new CustomerException(403, "包件码已存在");
|
|
|
|
|
//保存包件信息
|
|
|
|
|
factoryPackageEntity.setReceiptStatus(0); |
|
|
|
|
factoryPackageEntity.setPushStatus(0); |
|
|
|
|
factoryPackageEntity.setTurnStatus(0); |
|
|
|
|
boolean packageSave = factoryPackageService.save(factoryPackageEntity); |
|
|
|
|
if (packageSave) { |
|
|
|
|
Long packageId = factoryPackageEntity.getId(); |
|
|
|
|
//保存物料信息
|
|
|
|
|
JSONArray packageDetails = packageEntity.getJSONArray("PackageDetails"); |
|
|
|
|
if (!Objects.isNull(packageDetails)) { |
|
|
|
|
for (int k = 0; k < packageDetails.size(); k++) { |
|
|
|
|
JSONObject packageDetailsJSONObject = packageDetails.getJSONObject(k); |
|
|
|
|
FactoryPackageDetailEntity factoryPackageDetailEntity = new FactoryPackageDetailEntity(); |
|
|
|
|
factoryPackageDetailEntity.setPackageId(packageId); |
|
|
|
|
factoryPackageDetailEntity.setCode(packageDetailsJSONObject.getString("Code")); |
|
|
|
|
factoryPackageDetailEntity.setName(packageDetailsJSONObject.getString("Name")); |
|
|
|
|
factoryPackageDetailEntity.setType(packageDetailsJSONObject.getString("Type")); |
|
|
|
|
factoryPackageDetailEntity.setUnit(packageDetailsJSONObject.getString("Unit")); |
|
|
|
|
factoryPackageDetailEntity.setOrgCode(packageDetailsJSONObject.getString("OrgCode")); |
|
|
|
|
factoryPackageDetailService.save(factoryPackageDetailEntity); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
log.error("############handleData: 保存发货单数据失败 code={}", code); |
|
|
|
|
throw new CustomerException(403, "保存发货单数据失败"); |
|
|
|
|
|
|
|
|
|
String receiveCode = receivingOrderMapper.selectReceivingOrderByOrderId(factoryPackageEntity.getOrderId()); |
|
|
|
|
|
|
|
|
|
if(receiveCode.equals(code)){ |
|
|
|
|
log.error("############handleData: 包件码已存在 packageCode={} ,订单 id {} 收货单号 {}", packageCode, factoryPackageEntity.getOrderId(), code); |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
log.error("############handleData: 该包件存在于其它收货单 packageCode={} 订单ID {} 收货单号 {}", packageCode,factoryPackageEntity.getOrderId(), receiveCode); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//throw new CustomerException(403, "包件码已存在");
|
|
|
|
|
} |
|
|
|
|
Date end = new Date(); |
|
|
|
|
long startLong = start.getTime(); |
|
|
|
|
long endLong = end.getTime(); |
|
|
|
|
long l = endLong - startLong; |
|
|
|
|
log.info("############handleData: 数据处理完成 耗时 {} 毫秒", l); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -980,6 +1081,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" + |
|
|
|
|
"&$expand=" + |
|
|
|
|
"Packages($select=Oid,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;" + |
|
|
|
|