Authored by qinchao

质检接口

... ... @@ -2,6 +2,7 @@ package com.yohoufo.order.controller;
import com.yoho.core.rest.annotation.ServiceDesc;
import com.yohobuy.ufo.model.order.bo.AppraiseExpressInfoBo;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.common.annotation.IgnoreSession;
import com.yohoufo.common.annotation.IgnoreSignature;
... ... @@ -62,9 +63,28 @@ public class AppraiseController {
@IgnoreSignature
public ApiResponse appraiseFail(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
logger.info("in appraise Fail, req {}", appraiseExpressInfoBo);
return appraiseService.appraiseFail(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum(),appraiseExpressInfoBo.getMobile());
OrderStatus expectStatus = OrderStatus.PLATFORM_CHECKING;
return appraiseService.appraiseFail(appraiseExpressInfoBo,expectStatus,true);
}
/**
*
* 质检不通过 -- > 商品鉴定不通过,
* 但是不发物流
* 提供给运营平台使用
* @return
*/
@RequestMapping(value="/appraiseFailWithoutExpress")
@IgnoreSession
@IgnoreSignature
public ApiResponse appraiseFailWithoutExpress(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
logger.info("in appraiseFailWithoutExpress , req {}", appraiseExpressInfoBo);
OrderStatus expectStatus = OrderStatus.PLATFORM_RECEIVE;
return appraiseService.appraiseFail( appraiseExpressInfoBo,expectStatus,false);
}
/**
* 鉴定中心鉴定不通过后,寄回
... ...
... ... @@ -434,12 +434,16 @@ public class AppraiseService {
* 更新发到卖家的物流信息
* 将卖家的保证金分账给平台和买家
* 更新买家订单状态
* @param expressCompanyId
* @param orderCode
* @param wayBillCode
* @return
*/
public ApiResponse appraiseFail(Integer expressCompanyId, Long orderCode, String wayBillCode, Integer depotNum,String mobile){
public ApiResponse appraiseFail(AppraiseExpressInfoBo appraiseExpressInfoBo,OrderStatus expectStatus,boolean sendExpressFlag){
LOGGER.info("appraiseFail enter , appraiseExpressInfoBo {} ,sendExpressFlag {}", appraiseExpressInfoBo ,sendExpressFlag);
Integer expressCompanyId = appraiseExpressInfoBo.getExpressCompanyId();
Long orderCode = appraiseExpressInfoBo.getOrderCode();
String wayBillCode = appraiseExpressInfoBo.getWayBillCode();
Integer depotNum = appraiseExpressInfoBo.getDepotNum();
String mobile = appraiseExpressInfoBo.getMobile();
ApiResponse apiResponse=new ApiResponse();
BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
... ... @@ -447,7 +451,7 @@ public class AppraiseService {
LOGGER.warn("appraiseFail getOrderInfo order not exist, orderCode {}", orderCode);
throw new ServiceException(ServiceError.ORDER_NULL);
}
OrderStatus expectStatus = OrderStatus.PLATFORM_CHECKING;
if (buyerOrder.getStatus() != expectStatus.getCode()){
LOGGER.warn("appraiseFail expectStatus {}, actual status {}, orderCode {}", expectStatus,
buyerOrder.getStatus(), orderCode);
... ... @@ -564,7 +568,10 @@ public class AppraiseService {
}finally {
//更新物流信息,写到最后
//鉴定不通过,发物流
expressInfoService.returnBackOrderCauseOfJudgeFailure(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile);
if(sendExpressFlag){
expressInfoService.returnBackOrderCauseOfJudgeFailure(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile);
}
//记录调拨信息(只保存卖家一条)
EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
... ...