...
|
...
|
@@ -1316,6 +1316,11 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
|
|
if(CollectionUtils.isNotEmpty(sellerExpressRecordList)) {
|
|
|
throw new ServiceException(400,"错误:订单已存在物流信息["+sellerExpressRecordList.get(0).getWaybillCode()+"]");
|
|
|
}
|
|
|
|
|
|
Integer companyId = Optional.ofNullable(req.getOrderCode()).map(this::orderQueryExpressCompanyId).map(ExpressCompany::getId).orElse(17);
|
|
|
|
|
|
req.setExpressCompanyId(companyId);
|
|
|
|
|
|
return buyerOrder;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -3081,28 +3086,28 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
|
|
* 根据订单号查询具体的物流公司
|
|
|
* @return
|
|
|
*/
|
|
|
public ExpressCompany orderQueryExpressCompanyId(BuyerOrderReq req) {
|
|
|
public ExpressCompany orderQueryExpressCompanyId(String orderCode) {
|
|
|
ExpressCompany expressCompany = new ExpressCompany();
|
|
|
expressCompany.setId(23);
|
|
|
expressCompany.setCompanyName("顺丰");
|
|
|
if (StringUtils.isEmpty(req.getOrderCode())) {
|
|
|
if (StringUtils.isEmpty(orderCode)) {
|
|
|
return expressCompany;
|
|
|
}
|
|
|
List<BuyerOrderGoods> buyerOrderGoodses = buyerOrderGoodsMapper.selectByOrderCode(Lists.newArrayList(req.getOrderCode()));
|
|
|
List<BuyerOrderGoods> buyerOrderGoodses = buyerOrderGoodsMapper.selectByOrderCode(Lists.newArrayList(orderCode));
|
|
|
if (CollectionUtils.isEmpty(buyerOrderGoodses)) {
|
|
|
LOGGER.error("buyerOrderGoodsMapper.selectByOrderCode is empty req is {}", req);
|
|
|
LOGGER.error("buyerOrderGoodsMapper.selectByOrderCode is empty orderCode is {}", orderCode);
|
|
|
return expressCompany;
|
|
|
}
|
|
|
Integer skup = buyerOrderGoodses.get(0).getSkup();
|
|
|
List<SellerOrderGoods> sellerOrderGoodses = sellerOrderGoodsMapper.selectByIds(Lists.newArrayList(skup));
|
|
|
if (CollectionUtils.isEmpty(sellerOrderGoodses)) {
|
|
|
LOGGER.error("sellerOrderGoodsMapper.selectByIds is empty req is {}", req);
|
|
|
LOGGER.error("sellerOrderGoodsMapper.selectByIds is empty orderCode is {}", orderCode);
|
|
|
return expressCompany;
|
|
|
}
|
|
|
Integer depotNo = sellerOrderGoodses.get(0).getDepotNo();
|
|
|
if (Integer.valueOf(2).equals(depotNo)) { // 香港仓的订单默认发中通 其他仓订单默认发顺丰
|
|
|
expressCompany.setId(47);
|
|
|
expressCompany.setCompanyName("中通");
|
|
|
expressCompany.setId(76);
|
|
|
expressCompany.setCompanyName("中通国际");
|
|
|
}
|
|
|
return expressCompany;
|
|
|
}
|
...
|
...
|
|