Authored by qinchao

瑕疵信息insert,放到前台gateway

... ... @@ -7,6 +7,7 @@ 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;
import com.yohoufo.order.model.request.SaveQualityCheckInfoRequest;
import com.yohoufo.order.service.impl.AppraiseService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
... ... @@ -91,9 +92,9 @@ public class AppraiseController {
@RequestMapping(value="/appraiseFailWithoutExpress")
@IgnoreSession
@IgnoreSignature
public ApiResponse appraiseFailWithoutExpress(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
logger.info("in appraiseFailWithoutExpress , req {}", appraiseExpressInfoBo);
return appraiseService.qualityCheckReject(appraiseExpressInfoBo);
public ApiResponse appraiseFailWithoutExpress(@RequestBody SaveQualityCheckInfoRequest request) {
logger.info("in appraiseFailWithoutExpress , req {}", request);
return appraiseService.qualityCheckReject(request);
}
... ...
... ... @@ -8,6 +8,7 @@ import com.yohoufo.common.ApiResponse;
import com.yohoufo.common.annotation.IgnoreSession;
import com.yohoufo.common.annotation.IgnoreSignature;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.request.SaveQualityCheckInfoRequest;
import com.yohoufo.order.service.IBuyerOrderService;
import com.yohoufo.order.service.IPaymentService;
import com.yohoufo.order.utils.LoggerUtils;
... ... @@ -78,9 +79,9 @@ public class ErpGWOrderController {
@IgnoreSession
@IgnoreSignature
@RequestMapping(value = "/miniFaultCreate")
public ApiResponse miniFaultCreate(@RequestBody OrderRequest request) {
public ApiResponse miniFaultCreate(@RequestBody SaveQualityCheckInfoRequest request) {
LOG.info("method ufo.depot.miniFaultCreate in, req is {}", request);
buyerOrderService.miniFaultCreate(request.getOrderCode());
buyerOrderService.miniFaultCreate(request);
LOG.info("method ufo.depot.miniFaultCreate out, req is {}", request);
return new ApiResponse.ApiResponseBuilder().code(200).message("瑕疵创建成功").build();
}
... ...
package com.yohoufo.order.model.request;
import com.yohoufo.dal.order.model.QualityCheck;
import lombok.Data;
import lombok.ToString;
@Data
@ToString
public class SaveQualityCheckInfoRequest {
private Long orderCode;
private QualityCheck qualityCheck;
}
... ...
... ... @@ -6,6 +6,7 @@ import com.yohobuy.ufo.model.order.resp.OrderCancelComputeResult;
import com.yohobuy.ufo.model.order.resp.OrderCntResp;
import com.yohobuy.ufo.model.order.vo.AddressInfo;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.request.SaveQualityCheckInfoRequest;
import com.yohoufo.order.model.response.OrderSummaryResp;
public interface IBuyerOrderService extends IOrderListService, IOrderDetailService{
... ... @@ -57,7 +58,7 @@ public interface IBuyerOrderService extends IOrderListService, IOrderDetailServi
void qualityCheckPass(long orderCode);
void miniFaultCreate(long orderCode);
void miniFaultCreate(SaveQualityCheckInfoRequest request);
void miniFaultAccept(OrderRequest orderRequest);
... ...
... ... @@ -20,6 +20,7 @@ import com.yohoufo.order.event.BuyerConfirmEvent;
import com.yohoufo.order.event.BuyerRefundCouponEvent;
import com.yohoufo.order.event.ErpBuyerOrderEvent;
import com.yohoufo.order.model.request.PaymentRequest;
import com.yohoufo.order.model.request.SaveQualityCheckInfoRequest;
import com.yohoufo.order.model.request.TranseferCellNode;
import com.yohoufo.order.model.request.TransferMoneyRequest;
import com.yohoufo.order.model.response.AppraiseAddressResp;
... ... @@ -843,11 +844,12 @@ public class AppraiseService {
* 质检不通过 31->20
* 不发物流
*/
public ApiResponse qualityCheckReject(AppraiseExpressInfoBo appraiseExpressInfoBo){
LOGGER.info("qualityCheckReject enter , appraiseExpressInfoBo {} ", appraiseExpressInfoBo );
public ApiResponse qualityCheckReject(SaveQualityCheckInfoRequest request){
LOGGER.info("qualityCheckReject enter , appraiseExpressInfoBo {} ", request );
OrderStatus expectStatus = OrderStatus.PLATFORM_RECEIVE;
OrderStatus targetStatus = OrderStatus.QUALITY_CHECK_FAKE;
Long orderCode = appraiseExpressInfoBo.getOrderCode();
Long orderCode = request.getOrderCode();
QualityCheck qualityCheck = request.getQualityCheck();
ApiResponse apiResponse=new ApiResponse();
BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
... ... @@ -865,6 +867,14 @@ public class AppraiseService {
// 更新买家订单状态
int buyerUid = buyerOrder.getUid();
int sellerUid = buyerOrder.getSellerUid();
//保存质检有问题的图片信息
if(qualityCheck==null){
LOGGER.warn("in qualityCheckReject qualityCheck is null, orderCode {},uid {} ,sellerUid {}", orderCode,buyerUid,sellerUid);
throw new ServiceException(400,"质检不合格信息为空");
}
qualityCheckMapper.insert(qualityCheck);
LOGGER.info("qualityCheckReject update buyer order {} ", buyerOrder);
int rows = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerUid, expectStatus.getCode(), targetStatus.getCode(),
DateUtil.getCurrentTimeSecond());
... ...
... ... @@ -20,10 +20,7 @@ import com.yohoufo.dal.order.BuyerOrderGoodsMapper;
import com.yohoufo.dal.order.BuyerOrderMapper;
import com.yohoufo.dal.order.QualityCheckMapper;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
import com.yohoufo.dal.order.model.BuyOrderNums;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.BuyerOrderGoods;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.dal.order.model.*;
import com.yohoufo.order.common.ActionStatusHold;
import com.yohoufo.order.common.DelStatus;
import com.yohoufo.order.common.Payment;
... ... @@ -32,6 +29,7 @@ import com.yohoufo.order.model.PayQueryBo;
import com.yohoufo.order.model.dto.BuyerPenaltyCalResult;
import com.yohoufo.order.model.request.OrderListRequest;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.request.SaveQualityCheckInfoRequest;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohoufo.order.model.response.OrderSummaryResp;
import com.yohoufo.order.service.IBuyerOrderMetaService;
... ... @@ -778,8 +776,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
// 瑕疵创建
@Override
public void miniFaultCreate(long orderCode){
logger.info("in miniFaultCreate, orderCode {}", orderCode);
public void miniFaultCreate(SaveQualityCheckInfoRequest request){
logger.info("in miniFaultCreate, orderCode {}", request);
long orderCode = request.getOrderCode();
QualityCheck qualityCheck = request.getQualityCheck();
OrderStatus expectStatus = OrderStatus.PLATFORM_RECEIVE;
OrderStatus targetStatus = OrderStatus.MINI_FAULT_WAITING;
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
... ... @@ -793,6 +793,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
int uid = buyerOrder.getUid();
int sellerUid = buyerOrder.getSellerUid();
//保存质检有问题的图片信息
if(qualityCheck==null){
logger.warn("in miniFaultCreate qualityCheck is null, orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
throw new ServiceException(400,"瑕疵信息为空");
}
qualityCheckMapper.insert(qualityCheck);
if (1 == buyerOrderMapper.updateStatusByOrderCode(orderCode, uid,
expectStatus.getCode(),
targetStatus.getCode(),
... ...