Authored by chenchao

add seller cancel confirm

... ... @@ -3,10 +3,7 @@ package com.yohoufo.order.controller;
import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo;
import com.yohobuy.ufo.model.order.common.TabType;
import com.yohobuy.ufo.model.order.req.*;
import com.yohobuy.ufo.model.order.resp.BatchChangePriceResp;
import com.yohobuy.ufo.model.order.resp.OrderListInfo;
import com.yohobuy.ufo.model.order.resp.PageResp;
import com.yohobuy.ufo.model.order.resp.SellerOrderListResp;
import com.yohobuy.ufo.model.order.resp.*;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.common.annotation.IgnoreSession;
import com.yohoufo.common.annotation.IgnoreSignature;
... ... @@ -472,27 +469,24 @@ public class SellerOrderController {
}
/**
* 取消计算罚款 出售中或售出都会取消
* 取消确认时,计算罚款 出售中或售出都会取消
* @param uid
* @param orderCode
* @return
* @throws GatewayException
*/
@RequestMapping(params = "method=ufo.sellerOrder.cancelCompute")
@RequestMapping(params = "method=ufo.sellerOrder.cancelConfirm")
@ResponseBody
public ApiResponse cancelCompute(@RequestParam(name = "uid", required = true)int uid,
public ApiResponse cancelConfirm(@RequestParam(name = "uid", required = true)int uid,
@RequestParam(name = "orderCode", required = true)long orderCode
) {
SellerOrderCancelReq req = SellerOrderCancelReq.builder()
.uid(uid)
.orderCode(orderCode)
.build();
logger.info("in ufo.sellerOrder.cancelCompute, req {}", req);
boolean result = false;//
logger.info("in ufo.sellerOrder.cancelConfirm, req {}", req);
OrderCancelComputeResult result = sellerOrderService.cancelConfirm(req);//
String msg = "实时计算成功";
if(!result){
msg = "实时计算失败";
}
return new ApiResponse.ApiResponseBuilder().data(result).code(200).message(msg).build();
}
... ...
... ... @@ -6,6 +6,7 @@ import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.bo.*;
import com.yohobuy.ufo.model.order.common.*;
import com.yohobuy.ufo.model.order.constants.ConfirmDesc;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.order.req.*;
import com.yohobuy.ufo.model.order.resp.*;
... ... @@ -855,7 +856,39 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
}
return null;
}
private final static String FLAG_PRE = "#*", FLAG_SUFFIX = "*#";
/**
* 您确定取消出售吗?取消后将根据《卖家须知》扣除对应保证金作为赔偿打入卖家账户
* “扣除对应保证金” 加粗标红
* @version 6.8.6
* @return
*/
public OrderCancelComputeResult cancelConfirm(SellerOrderCancelReq req){
log.info("seller self cancel order Confirm ,req {}", req);
int uid = req.getUid();
long orderCode = req.getOrderCode();
if (uid <= 0 || orderCode <= 0L){
throw new ServiceException(ServiceError.ORDER_REQUEST_PARM_IS_EMPTY);
}
CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
if (Objects.isNull(codeMeta)){
log.warn("seller cancel Confirm orderCode illegal, req {}", req);
throw new ServiceException(ServiceError.ORDER_REQUEST_PARM_IS_EMPTY);
}
OrderCodeType codeType = OrderCodeType.getOrderCodeType(codeMeta.getType());
log.info("in seller cancel Confirm uid {},orderCode {}, actor {}", uid, orderCode, codeType);
OrderCancelComputeResult occr = new OrderCancelComputeResult();
if (OrderCodeType.SELLER_TYPE.equals(codeType)){
occr.setConfirmDesc(ConfirmDesc.SELF_BEFORE_PAY);
}
if (OrderCodeType.BUYER_TYPE.equals(codeType)){
String confirmDesc = "您确定取消出售吗?取消后将根据《卖家须知》"+ FLAG_PRE +"扣除对应保证金"+ FLAG_SUFFIX + "作为赔偿打入卖家账户";
occr.setConfirmDesc(confirmDesc);
}
return occr;
}
}
... ...