...
|
...
|
@@ -12,6 +12,7 @@ import java.util.stream.Collectors; |
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.yoho.order.model.*;
|
|
|
import com.yoho.ufo.order.constant.OperateTypeEnum;
|
|
|
import com.yohobuy.ufo.model.order.common.EnumExpressType;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
...
|
...
|
@@ -138,10 +139,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
private static final Integer EXPRESS_TYPE_JUDGE_TO_SELLER = EnumExpressType.EXPRESS_TYPE_3.getCode();
|
|
|
|
|
|
private static final Integer EXPRESS_TYPE_RETURN_BACK_TO_SELLER = EnumExpressType.EXPRESS_TYPE_REBACK.getCode();
|
|
|
|
|
|
private static final Integer OPERATE_TYPE_UPDATE_SELLERWAYBILLCODE = 1;//修改卖家物流单号
|
|
|
|
|
|
private static final Integer OPERATE_TYPE_UPDATE_RECEIVE_INFO = 2;//修改收货人信息
|
|
|
|
|
|
|
|
|
@Value("${ip.port.uic.server}")
|
|
|
private String uicServerIpAndPort;
|
...
|
...
|
@@ -363,6 +361,12 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
String args = "ufo-gateway.confirmReceive";
|
|
|
JSONObject jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
|
|
|
|
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_CONFIRM_RECEIVE.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(),userHelper, operateType, "");
|
|
|
LOGGER.info("confirmReceive saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -382,6 +386,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
|
|
|
String args = "ufo-gateway.judgeBegin";
|
|
|
JSONObject jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
|
|
|
|
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_JUDGE_BEGIN.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
|
|
LOGGER.info("judgeBegin saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -403,6 +414,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
String args = "orderAppraise.appraiseSuccess";
|
|
|
LOGGER.info("judgePass begin call enter interface is {}, orderCode is {}", buyerOrder.getOrderCode(), args);
|
|
|
JSONObject jsonObject = asyncCallJudgeResultUpdate(args, buyerOrder.getOrderCode());
|
|
|
|
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_JUDGE_PASS.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
|
|
LOGGER.info("judgePass saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -424,6 +442,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
String args = "orderAppraise.appraiseFail";
|
|
|
LOGGER.info("judgeReject begin call enter interface is {}, orderCode is {}", buyerOrder.getOrderCode(), args);
|
|
|
JSONObject jsonObject = asyncCallJudgeResultUpdate(args, buyerOrder.getOrderCode());
|
|
|
|
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_JUDGE_REJECT.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
|
|
LOGGER.info("judgeReject saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -542,6 +567,12 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
restMobileFromBuyer(req,buyerOrder.getOrderCode());
|
|
|
JSONObject jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
|
|
|
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_DELIVERY_GOODS.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
|
|
LOGGER.info("deliverGoods saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -572,6 +603,12 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
resetMobileFromSeller(req,buyerOrder.getOrderCode());
|
|
|
JSONObject jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
|
|
|
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_RETURN_CAUSE_OF_JUDGE_FAILURE.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
|
|
LOGGER.info("returnBackOrderCauseOfJudgeFailure saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -602,6 +639,12 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
resetMobileFromSeller(req,buyerOrder.getOrderCode());
|
|
|
JSONObject jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
|
|
|
|
|
//记录操作日志
|
|
|
int operateType =OperateTypeEnum.OPERATE_TYPE_RETURN_CAUSE_OF_BUYER_CANCEL_AFTER_SELLER_SELL_OUT.getCode();
|
|
|
UserHelper userHelper = new UserHelper();
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
|
|
LOGGER.info("returnBackOrder cause of buyer cancel after seller sell out saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -916,6 +959,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
for(OrderOperateRecord item : list) {
|
|
|
OrderOperateRecordResp rsp = new OrderOperateRecordResp();
|
|
|
rsp.setType(item.getType());
|
|
|
rsp.setTypeStr(OperateTypeEnum.getDescByCode(item.getType()));
|
|
|
rsp.setUserName(item.getUserName());
|
|
|
rsp.setUpdateTimeStr(DateUtil.long2DateStr(item.getUpdateTime().longValue()*1000, "yyyy-MM-dd HH:mm:ss"));
|
|
|
rspList.add(rsp);
|
...
|
...
|
@@ -958,7 +1002,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
int operateType = OPERATE_TYPE_UPDATE_SELLERWAYBILLCODE;
|
|
|
int operateType = OperateTypeEnum.OPERATE_TYPE_UPDATE_SELLER_WAY_BILL_CODE.getCode();
|
|
|
String oldInfo = "";
|
|
|
|
|
|
//卖家已发货,更新卖家物流单号,卖家信息
|
...
|
...
|
@@ -980,7 +1024,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
//调用前台接口更新物流信息
|
|
|
noticeFrontUpdateExpressInfo(req);
|
|
|
}else {//修改买家信息
|
|
|
operateType = OPERATE_TYPE_UPDATE_RECEIVE_INFO;
|
|
|
operateType = OperateTypeEnum.OPERATE_TYPE_UPDATE_RECEIVE_INFO.getCode();
|
|
|
BuyerOrderMeta buyerMeta = buyerOrderMetaMapper.selectByOrderCodeAndKey(req.getOrderCode(), BUYER_ORDER_META_KEY_DELIVERY_ADDRESS);
|
|
|
if(null == buyerMeta) {
|
|
|
return 0;
|
...
|
...
|
@@ -995,7 +1039,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
}
|
|
|
}else if(buyerOrder.getStatus().byteValue() != Constant.BUYER_ORDER_STATUS_ALLOCATING.getByteVal()
|
|
|
&&buyerOrder.getStatus().byteValue() < 4) {//平台鉴定前,更新收货人信息
|
|
|
operateType = OPERATE_TYPE_UPDATE_RECEIVE_INFO;
|
|
|
LOGGER.info("updateReceiveInfo change address before judge ,buyerOrder = {}",buyerOrder);
|
|
|
operateType = OperateTypeEnum.OPERATE_TYPE_UPDATE_RECEIVE_INFO.getCode();
|
|
|
BuyerOrderMeta buyerMeta = buyerOrderMetaMapper.selectByOrderCodeAndKey(req.getOrderCode(), BUYER_ORDER_META_KEY_DELIVERY_ADDRESS);
|
|
|
if(null == buyerMeta) {
|
|
|
return 0;
|
...
|
...
|
|