Authored by qinchao

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

@@ -270,12 +270,12 @@ public class BuyerOrderReq extends PageRequestBO{ @@ -270,12 +270,12 @@ public class BuyerOrderReq extends PageRequestBO{
270 "expressType=" + expressType + '\'' + 270 "expressType=" + expressType + '\'' +
271 "receiveName=" + receiveName + '\'' + 271 "receiveName=" + receiveName + '\'' +
272 "receiveMobile=" + receiveMobile + '\'' + 272 "receiveMobile=" + receiveMobile + '\'' +
  273 + "mobile="+mobile+ '\'' +
273 "receiveAddressDetail=" + receiveAddressDetail + '\'' + 274 "receiveAddressDetail=" + receiveAddressDetail + '\'' +
274 "receiveZipCode=" + receiveZipCode + '\'' + 275 "receiveZipCode=" + receiveZipCode + '\'' +
275 "receiveAreaCode=" + receiveAreaCode + '\'' + 276 "receiveAreaCode=" + receiveAreaCode + '\'' +
276 "expressCompanyId=" + expressCompanyId + '\'' + 277 "expressCompanyId=" + expressCompanyId + '\'' +
277 "waybillCode=" + waybillCode + '\'' + 278 "waybillCode=" + waybillCode + '\'' +
278 - "mobile="+mobile+ '\'' +  
279 '}'; 279 '}';
280 } 280 }
281 } 281 }
@@ -248,6 +248,40 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -248,6 +248,40 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
248 return result; 248 return result;
249 } 249 }
250 250
  251 + public JSONObject updateOrderStatus(BuyerOrderReq req) {
  252 + if(null == req.getId() || null == req.getStatus()) {
  253 + return null;
  254 + }
  255 +
  256 + BuyerOrder buyerOrder = buyerOrderMapper.selectById(req.getId());
  257 + if(null == buyerOrder) {
  258 + return null;
  259 + }
  260 +
  261 + //调用前台接口
  262 + String args = "";
  263 + JSONObject jsonObject = new JSONObject();
  264 + if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_TO_BE_RECEIVED.getByteVal()) {//鉴定通过
  265 + args = "orderAppraise.appraiseSuccess";
  266 + //重新设置mobile
  267 + restMobileFromBuyer(req,buyerOrder.getOrderCode());
  268 + jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
  269 + }else if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGE_NOT_PASS.getByteVal()) {//鉴定不通过
  270 + args = "orderAppraise.appraiseFail";
  271 + //重新设置mobile
  272 + resetMobileFromSeller(req,buyerOrder.getOrderCode());
  273 + jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
  274 + }else if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGING.getByteVal()) {//确认收货
  275 + args = "ufo-gateway.confirmReceive";
  276 + jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
  277 + }
  278 +
  279 + if(jsonObject.getIntValue("code") == 200) {
  280 + buyerOrderMapper.updateStatusById(req.getId(), req.getStatus());
  281 + }
  282 +
  283 + return jsonObject;
  284 + }
251 285
252 //如果前台传的手机号码为空,则重设 286 //如果前台传的手机号码为空,则重设
253 private void restMobileFromBuyer(BuyerOrderReq req,String orderCode){ 287 private void restMobileFromBuyer(BuyerOrderReq req,String orderCode){
@@ -291,41 +325,6 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -291,41 +325,6 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
291 LOGGER.info("appraiseFail mobile is ok ,{}",req.getMobile()); 325 LOGGER.info("appraiseFail mobile is ok ,{}",req.getMobile());
292 } 326 }
293 } 327 }
294 -  
295 - public JSONObject updateOrderStatus(BuyerOrderReq req) {  
296 - if(null == req.getId() || null == req.getStatus()) {  
297 - return null;  
298 - }  
299 -  
300 - BuyerOrder buyerOrder = buyerOrderMapper.selectById(req.getId());  
301 - if(null == buyerOrder) {  
302 - return null;  
303 - }  
304 -  
305 - //调用前台接口  
306 - String args = "";  
307 - JSONObject jsonObject = new JSONObject();  
308 - if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_TO_BE_RECEIVED.getByteVal()) {//鉴定通过  
309 - args = "orderAppraise.appraiseSuccess";  
310 - //重新设置mobile  
311 - restMobileFromBuyer(req,buyerOrder.getOrderCode());  
312 - jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);  
313 - }else if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGE_NOT_PASS.getByteVal()) {//鉴定不通过  
314 - args = "orderAppraise.appraiseFail";  
315 - //重新设置mobile  
316 - resetMobileFromSeller(req,buyerOrder.getOrderCode());  
317 - jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);  
318 - }else if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGING.getByteVal()) {//确认收货  
319 - args = "ufo-gateway.confirmReceive";  
320 - jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());  
321 - }  
322 -  
323 - if(jsonObject.getIntValue("code") == 200) {  
324 - buyerOrderMapper.updateStatusById(req.getId(), req.getStatus());  
325 - }  
326 -  
327 - return jsonObject;  
328 - }  
329 328
330 public JSONObject returnBackOrder(BuyerOrderReq req){ 329 public JSONObject returnBackOrder(BuyerOrderReq req){
331 if(null == req.getId() || null == req.getStatus()) { 330 if(null == req.getId() || null == req.getStatus()) {