...
|
...
|
@@ -248,6 +248,40 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
return result;
|
|
|
}
|
|
|
|
|
|
public JSONObject updateOrderStatus(BuyerOrderReq req) {
|
|
|
if(null == req.getId() || null == req.getStatus()) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectById(req.getId());
|
|
|
if(null == buyerOrder) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
//调用前台接口
|
|
|
String args = "";
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_TO_BE_RECEIVED.getByteVal()) {//鉴定通过
|
|
|
args = "orderAppraise.appraiseSuccess";
|
|
|
//重新设置mobile
|
|
|
restMobileFromBuyer(req,buyerOrder.getOrderCode());
|
|
|
jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
|
|
}else if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGE_NOT_PASS.getByteVal()) {//鉴定不通过
|
|
|
args = "orderAppraise.appraiseFail";
|
|
|
//重新设置mobile
|
|
|
resetMobileFromSeller(req,buyerOrder.getOrderCode());
|
|
|
jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
|
|
}else if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGING.getByteVal()) {//确认收货
|
|
|
args = "ufo-gateway.confirmReceive";
|
|
|
jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
|
|
|
}
|
|
|
|
|
|
if(jsonObject.getIntValue("code") == 200) {
|
|
|
buyerOrderMapper.updateStatusById(req.getId(), req.getStatus());
|
|
|
}
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
//如果前台传的手机号码为空,则重设
|
|
|
private void restMobileFromBuyer(BuyerOrderReq req,String orderCode){
|
...
|
...
|
@@ -291,41 +325,6 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
LOGGER.info("appraiseFail mobile is ok ,{}",req.getMobile());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public JSONObject updateOrderStatus(BuyerOrderReq req) {
|
|
|
if(null == req.getId() || null == req.getStatus()) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectById(req.getId());
|
|
|
if(null == buyerOrder) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
//调用前台接口
|
|
|
String args = "";
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_TO_BE_RECEIVED.getByteVal()) {//鉴定通过
|
|
|
args = "orderAppraise.appraiseSuccess";
|
|
|
//重新设置mobile
|
|
|
restMobileFromBuyer(req,buyerOrder.getOrderCode());
|
|
|
jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
|
|
}else if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGE_NOT_PASS.getByteVal()) {//鉴定不通过
|
|
|
args = "orderAppraise.appraiseFail";
|
|
|
//重新设置mobile
|
|
|
resetMobileFromSeller(req,buyerOrder.getOrderCode());
|
|
|
jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
|
|
|
}else if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGING.getByteVal()) {//确认收货
|
|
|
args = "ufo-gateway.confirmReceive";
|
|
|
jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
|
|
|
}
|
|
|
|
|
|
if(jsonObject.getIntValue("code") == 200) {
|
|
|
buyerOrderMapper.updateStatusById(req.getId(), req.getStatus());
|
|
|
}
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
public JSONObject returnBackOrder(BuyerOrderReq req){
|
|
|
if(null == req.getId() || null == req.getStatus()) {
|
...
|
...
|
|