|
@@ -126,6 +126,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
@@ -126,6 +126,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
126
|
|
126
|
|
127
|
private static final Integer EXPRESS_TYPE_JUDGE_TO_SELLER = 3;
|
127
|
private static final Integer EXPRESS_TYPE_JUDGE_TO_SELLER = 3;
|
128
|
|
128
|
|
|
|
129
|
+ private static final Integer EXPRESS_TYPE_RETURN_BACK_TO_SELLER = 4;
|
|
|
130
|
+
|
129
|
private static final Integer OPERATE_TYPE_UPDATE_SELLERWAYBILLCODE = 1;//修改卖家物流单号
|
131
|
private static final Integer OPERATE_TYPE_UPDATE_SELLERWAYBILLCODE = 1;//修改卖家物流单号
|
130
|
|
132
|
|
131
|
private static final Integer OPERATE_TYPE_UPDATE_RECEIVE_INFO = 2;//修改收货人信息
|
133
|
private static final Integer OPERATE_TYPE_UPDATE_RECEIVE_INFO = 2;//修改收货人信息
|
|
@@ -207,7 +209,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
@@ -207,7 +209,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
207
|
List<Integer> sellerExpressCompanyIdList = expressRecordList.stream().map(ExpressRecord::getLogisticsType).collect(Collectors.toList());
|
209
|
List<Integer> sellerExpressCompanyIdList = expressRecordList.stream().map(ExpressRecord::getLogisticsType).collect(Collectors.toList());
|
208
|
|
210
|
|
209
|
//查询平台快递单号
|
211
|
//查询平台快递单号
|
210
|
- List<ExpressRecord> platformExpressList = expressRecordMapper.selectByOrderCodeListAndType(buyerOrderCodeList, Lists.newArrayList(EXPRESS_TYPE_JUDGE_TO_BUYER, EXPRESS_TYPE_JUDGE_TO_SELLER));
|
212
|
+ List<ExpressRecord> platformExpressList = expressRecordMapper.selectByOrderCodeListAndType(buyerOrderCodeList, Lists.newArrayList(EXPRESS_TYPE_JUDGE_TO_BUYER, EXPRESS_TYPE_JUDGE_TO_SELLER,EXPRESS_TYPE_RETURN_BACK_TO_SELLER));
|
211
|
Map<String, ExpressRecord> platformExpressRecordMap = platformExpressList.stream().collect(Collectors.toMap(ExpressRecord::getOrderCode, e->e));
|
213
|
Map<String, ExpressRecord> platformExpressRecordMap = platformExpressList.stream().collect(Collectors.toMap(ExpressRecord::getOrderCode, e->e));
|
212
|
List<Integer> platformExpressCompanyIdList = platformExpressList.stream().map(ExpressRecord::getLogisticsType).collect(Collectors.toList());
|
214
|
List<Integer> platformExpressCompanyIdList = platformExpressList.stream().map(ExpressRecord::getLogisticsType).collect(Collectors.toList());
|
213
|
|
215
|
|
|
@@ -278,6 +280,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
@@ -278,6 +280,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
278
|
throw new ServiceException(400,"错误:订单状态不合法,不允许寄回商品");
|
280
|
throw new ServiceException(400,"错误:订单状态不合法,不允许寄回商品");
|
279
|
}
|
281
|
}
|
280
|
|
282
|
|
|
|
283
|
+ //查看是否存在寄回的物流信息,如果存在,则不允许再次寄回
|
|
|
284
|
+ ExpressRecord sellerExpressRecord = expressRecordMapper.selectByOrderCodeAndType(buyerOrder.getOrderCode(),
|
|
|
285
|
+ buyerOrder.getSellerUid(), EXPRESS_TYPE_RETURN_BACK_TO_SELLER);
|
|
|
286
|
+ if(null != sellerExpressRecord) {
|
|
|
287
|
+ throw new ServiceException(400,"错误:订单已存在寄回物流单["+sellerExpressRecord.getWaybillCode()+"]不允许再次寄回");
|
|
|
288
|
+ }
|
|
|
289
|
+
|
281
|
//调用前台接口
|
290
|
//调用前台接口
|
282
|
String args = "orderAppraise.returnBack";
|
291
|
String args = "orderAppraise.returnBack";
|
283
|
JSONObject jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
292
|
JSONObject jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
|
@@ -343,7 +352,19 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
@@ -343,7 +352,19 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
343
|
if(StringUtils.isEmpty(req.getOrderCode())) {
|
352
|
if(StringUtils.isEmpty(req.getOrderCode())) {
|
344
|
return result;
|
353
|
return result;
|
345
|
}
|
354
|
}
|
346
|
- ExpressRecord record = expressRecordMapper.selectByOrderCodeAndType(req.getOrderCode(), null, EXPRESS_TYPE_JUDGE_TO_SELLER);
|
355
|
+
|
|
|
356
|
+ BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(req.getOrderCode());
|
|
|
357
|
+ if(buyerOrder==null){
|
|
|
358
|
+ return result;
|
|
|
359
|
+ }
|
|
|
360
|
+
|
|
|
361
|
+ Integer expressType=EXPRESS_TYPE_JUDGE_TO_SELLER;
|
|
|
362
|
+ //已取消的订单,状态不会再变了
|
|
|
363
|
+ if(buyerOrder.getStatus().byteValue()==Constant.BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_SELLER_DELIVERY.getByteVal()){
|
|
|
364
|
+ expressType =EXPRESS_TYPE_RETURN_BACK_TO_SELLER;
|
|
|
365
|
+ }
|
|
|
366
|
+
|
|
|
367
|
+ ExpressRecord record = expressRecordMapper.selectByOrderCodeAndType(req.getOrderCode(), null, expressType);
|
347
|
if(null == record) {
|
368
|
if(null == record) {
|
348
|
return result;
|
369
|
return result;
|
349
|
}
|
370
|
}
|