|
@@ -603,6 +603,87 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
@@ -603,6 +603,87 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
603
|
return jsonObject;
|
603
|
return jsonObject;
|
604
|
}
|
604
|
}
|
605
|
|
605
|
|
|
|
606
|
+ //发货
|
|
|
607
|
+ public JSONObject deliveryGoodsToBuyer(BuyerOrderReq req){
|
|
|
608
|
+ LOGGER.info("deliveryGoodsToBuyer enter, req is {}", req);
|
|
|
609
|
+ BuyerOrder buyerOrder = checkForPlatformExpress(req);
|
|
|
610
|
+ String args = "orderAppraise.deliveryGoodsToBuyer";
|
|
|
611
|
+ if( Constant.BUYER_ORDER_STATUS_JUDGE_PASS.getByteVal()!=buyerOrder.getStatus().byteValue()){
|
|
|
612
|
+ throw new ServiceException(400,"错误:订单状态变化,不允许发货,请重新刷新列表");
|
|
|
613
|
+ }
|
|
|
614
|
+ //重新设置mobile
|
|
|
615
|
+ restMobileFromBuyer(req,buyerOrder.getOrderCode());
|
|
|
616
|
+
|
|
|
617
|
+ //记录操作日志
|
|
|
618
|
+ int operateType =OperateTypeEnum.OPERATE_TYPE_DELIVERY_GOODS.getCode();
|
|
|
619
|
+ UserHelper userHelper = new UserHelper();
|
|
|
620
|
+ saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
|
|
621
|
+
|
|
|
622
|
+ JSONObject jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
|
|
623
|
+ LOGGER.info("deliveryGoodsToBuyer saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
624
|
+ return jsonObject;
|
|
|
625
|
+ }
|
|
|
626
|
+
|
|
|
627
|
+ private BuyerOrder checkForPlatformExpress(BuyerOrderReq req){
|
|
|
628
|
+ if(StringUtils.isBlank(req.getOrderCode())) {
|
|
|
629
|
+ throw new ServiceException(400,"错误:参数错误,订单号为空");
|
|
|
630
|
+ }
|
|
|
631
|
+ //物流公司id,默认值为 23
|
|
|
632
|
+ if(req.getExpressCompanyId()==null){
|
|
|
633
|
+ throw new ServiceException(400,"错误:参数错误,物流公司为空");
|
|
|
634
|
+ }
|
|
|
635
|
+ if(StringUtils.isBlank(req.getWaybillCode())){
|
|
|
636
|
+ throw new ServiceException(400,"错误:参数错误,物流单号为空");
|
|
|
637
|
+ }
|
|
|
638
|
+ if(req.getDepotNo()==null){
|
|
|
639
|
+ throw new ServiceException(400,"错误:参数错误,仓库号为空");
|
|
|
640
|
+ }
|
|
|
641
|
+ if(StringUtils.isBlank(req.getMobile())){
|
|
|
642
|
+ throw new ServiceException(400,"错误:参数错误,手机号为空");
|
|
|
643
|
+ }
|
|
|
644
|
+
|
|
|
645
|
+ BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(req.getOrderCode());
|
|
|
646
|
+ if(null == buyerOrder) {
|
|
|
647
|
+ throw new ServiceException(400,"错误:订单为空");
|
|
|
648
|
+ }
|
|
|
649
|
+
|
|
|
650
|
+ //查看是否存在寄回的物流信息,如果存在,则不允许再次寄回
|
|
|
651
|
+ List<ExpressRecord> sellerExpressRecordList = expressRecordMapper.selectByOrderCodeListAndType(Lists.newArrayList(buyerOrder.getOrderCode()), Lists.newArrayList(EXPRESS_TYPE_JUDGE_TO_BUYER, EXPRESS_TYPE_JUDGE_TO_SELLER,EXPRESS_TYPE_RETURN_BACK_TO_SELLER));
|
|
|
652
|
+ if(CollectionUtils.isNotEmpty(sellerExpressRecordList)) {
|
|
|
653
|
+ throw new ServiceException(400,"错误:订单已存在物流信息["+sellerExpressRecordList.get(0).getWaybillCode()+"]");
|
|
|
654
|
+ }
|
|
|
655
|
+ return buyerOrder;
|
|
|
656
|
+ }
|
|
|
657
|
+
|
|
|
658
|
+ public JSONObject sendBackGoodsToSeller(BuyerOrderReq req){
|
|
|
659
|
+ LOGGER.info("sendBackGoodsToSeller enter, req is {}", req);
|
|
|
660
|
+ BuyerOrder buyerOrder = checkForPlatformExpress(req);
|
|
|
661
|
+ //重新设置mobile
|
|
|
662
|
+ resetMobileFromSeller(req,buyerOrder.getOrderCode());
|
|
|
663
|
+
|
|
|
664
|
+ //调用前台接口
|
|
|
665
|
+ String args ;
|
|
|
666
|
+ if(buyerOrder.getStatus().byteValue()==Constant.BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_SELLER_DELIVERY.getByteVal()) {
|
|
|
667
|
+ args = "orderAppraise.returnBack";
|
|
|
668
|
+ }else if(buyerOrder.getStatus().byteValue()==Constant.BUYER_ORDER_STATUS_JUDGE_NOT_PASS.getByteVal()
|
|
|
669
|
+ ||buyerOrder.getStatus().byteValue()==Constant.CANCEL_QUALITY_CHECK_FAKE.getByteVal()
|
|
|
670
|
+ ||buyerOrder.getStatus().byteValue()==Constant.CANCEL_MINI_FAULT_REJECT.getByteVal()
|
|
|
671
|
+ ||buyerOrder.getStatus().byteValue()==Constant.CANCEL_MINI_FAULT_OUT_TIME_REJECT.getByteVal()){
|
|
|
672
|
+ args = "orderAppraise.returnBackOrderCauseOfJudgeFailure";
|
|
|
673
|
+ }else{
|
|
|
674
|
+ throw new ServiceException(400,"错误:订单状态不合法,不允许平台发货或寄回");
|
|
|
675
|
+ }
|
|
|
676
|
+
|
|
|
677
|
+ //记录操作日志
|
|
|
678
|
+ int operateType =OperateTypeEnum.OPERATE_TYPE_DELIVERY_GOODS.getCode();
|
|
|
679
|
+ UserHelper userHelper = new UserHelper();
|
|
|
680
|
+ saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
|
|
681
|
+
|
|
|
682
|
+ JSONObject jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
|
|
683
|
+ LOGGER.info("sendBackGoodsToSeller saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
684
|
+ return jsonObject;
|
|
|
685
|
+ }
|
|
|
686
|
+
|
606
|
//鉴定通过 :更新订单状态为judge_pass ,期望状态有两种情况:平台鉴定中或者瑕疵接受了
|
687
|
//鉴定通过 :更新订单状态为judge_pass ,期望状态有两种情况:平台鉴定中或者瑕疵接受了
|
607
|
public JSONObject judgeCenterNotPass(String orderCode){
|
688
|
public JSONObject judgeCenterNotPass(String orderCode){
|
608
|
if(StringUtils.isBlank(orderCode)){
|
689
|
if(StringUtils.isBlank(orderCode)){
|
|
@@ -754,6 +835,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
@@ -754,6 +835,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
754
|
}
|
835
|
}
|
755
|
|
836
|
|
756
|
|
837
|
|
|
|
838
|
+
|
757
|
public JSONObject returnBackOrderCauseOfJudgeFailure(BuyerOrderReq req){
|
839
|
public JSONObject returnBackOrderCauseOfJudgeFailure(BuyerOrderReq req){
|
758
|
if(null == req.getId() || null == req.getStatus()) {
|
840
|
if(null == req.getId() || null == req.getStatus()) {
|
759
|
return null;
|
841
|
return null;
|