...
|
...
|
@@ -125,6 +125,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
private static final Integer EXPRESS_TYPE_JUDGE_TO_BUYER = 2;
|
|
|
|
|
|
private static final Integer EXPRESS_TYPE_JUDGE_TO_SELLER = 3;
|
|
|
|
|
|
private static final Integer EXPRESS_TYPE_RETURN_BACK_TO_SELLER = 4;
|
|
|
|
|
|
private static final Integer OPERATE_TYPE_UPDATE_SELLERWAYBILLCODE = 1;//修改卖家物流单号
|
|
|
|
...
|
...
|
@@ -207,7 +209,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
List<Integer> sellerExpressCompanyIdList = expressRecordList.stream().map(ExpressRecord::getLogisticsType).collect(Collectors.toList());
|
|
|
|
|
|
//查询平台快递单号
|
|
|
List<ExpressRecord> platformExpressList = expressRecordMapper.selectByOrderCodeListAndType(buyerOrderCodeList, Lists.newArrayList(EXPRESS_TYPE_JUDGE_TO_BUYER, EXPRESS_TYPE_JUDGE_TO_SELLER));
|
|
|
List<ExpressRecord> platformExpressList = expressRecordMapper.selectByOrderCodeListAndType(buyerOrderCodeList, Lists.newArrayList(EXPRESS_TYPE_JUDGE_TO_BUYER, EXPRESS_TYPE_JUDGE_TO_SELLER,EXPRESS_TYPE_RETURN_BACK_TO_SELLER));
|
|
|
Map<String, ExpressRecord> platformExpressRecordMap = platformExpressList.stream().collect(Collectors.toMap(ExpressRecord::getOrderCode, e->e));
|
|
|
List<Integer> platformExpressCompanyIdList = platformExpressList.stream().map(ExpressRecord::getLogisticsType).collect(Collectors.toList());
|
|
|
|
...
|
...
|
@@ -278,6 +280,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
throw new ServiceException(400,"错误:订单状态不合法,不允许寄回商品");
|
|
|
}
|
|
|
|
|
|
//查看是否存在寄回的物流信息,如果存在,则不允许再次寄回
|
|
|
ExpressRecord sellerExpressRecord = expressRecordMapper.selectByOrderCodeAndType(buyerOrder.getOrderCode(),
|
|
|
buyerOrder.getSellerUid(), EXPRESS_TYPE_RETURN_BACK_TO_SELLER);
|
|
|
if(null != sellerExpressRecord) {
|
|
|
throw new ServiceException(400,"错误:订单已存在寄回物流单["+sellerExpressRecord.getWaybillCode()+"]不允许再次寄回");
|
|
|
}
|
|
|
|
|
|
//调用前台接口
|
|
|
String args = "orderAppraise.returnBack";
|
|
|
JSONObject jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
...
|
...
|
@@ -343,7 +352,19 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
if(StringUtils.isEmpty(req.getOrderCode())) {
|
|
|
return result;
|
|
|
}
|
|
|
ExpressRecord record = expressRecordMapper.selectByOrderCodeAndType(req.getOrderCode(), null, EXPRESS_TYPE_JUDGE_TO_SELLER);
|
|
|
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(req.getOrderCode());
|
|
|
if(buyerOrder==null){
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
Integer expressType=EXPRESS_TYPE_JUDGE_TO_SELLER;
|
|
|
//已取消的订单,状态不会再变了
|
|
|
if(buyerOrder.getStatus().byteValue()==Constant.BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_SELLER_DELIVERY.getByteVal()){
|
|
|
expressType =EXPRESS_TYPE_RETURN_BACK_TO_SELLER;
|
|
|
}
|
|
|
|
|
|
ExpressRecord record = expressRecordMapper.selectByOrderCodeAndType(req.getOrderCode(), null, expressType);
|
|
|
if(null == record) {
|
|
|
return result;
|
|
|
}
|
...
|
...
|
|