Authored by qinchao

fix : 鉴定通过、不通过、直接寄回,如果前台传入的手机号码为空,则后台查询一下

... ... @@ -270,12 +270,12 @@ public class BuyerOrderReq extends PageRequestBO{
"expressType=" + expressType + '\'' +
"receiveName=" + receiveName + '\'' +
"receiveMobile=" + receiveMobile + '\'' +
"mobile="+mobile+ '\'' +
"receiveAddressDetail=" + receiveAddressDetail + '\'' +
"receiveZipCode=" + receiveZipCode + '\'' +
"receiveAreaCode=" + receiveAreaCode + '\'' +
"expressCompanyId=" + expressCompanyId + '\'' +
"waybillCode=" + waybillCode + '\'' +
"mobile="+mobile+ '\'' +
'}';
}
}
... ...
... ... @@ -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){
... ... @@ -292,41 +326,6 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
}
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()) {
return null;
... ...