Authored by chenchao

add seller cancel confirm

@@ -3,10 +3,7 @@ package com.yohoufo.order.controller; @@ -3,10 +3,7 @@ package com.yohoufo.order.controller;
3 import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo; 3 import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo;
4 import com.yohobuy.ufo.model.order.common.TabType; 4 import com.yohobuy.ufo.model.order.common.TabType;
5 import com.yohobuy.ufo.model.order.req.*; 5 import com.yohobuy.ufo.model.order.req.*;
6 -import com.yohobuy.ufo.model.order.resp.BatchChangePriceResp;  
7 -import com.yohobuy.ufo.model.order.resp.OrderListInfo;  
8 -import com.yohobuy.ufo.model.order.resp.PageResp;  
9 -import com.yohobuy.ufo.model.order.resp.SellerOrderListResp; 6 +import com.yohobuy.ufo.model.order.resp.*;
10 import com.yohoufo.common.ApiResponse; 7 import com.yohoufo.common.ApiResponse;
11 import com.yohoufo.common.annotation.IgnoreSession; 8 import com.yohoufo.common.annotation.IgnoreSession;
12 import com.yohoufo.common.annotation.IgnoreSignature; 9 import com.yohoufo.common.annotation.IgnoreSignature;
@@ -472,27 +469,24 @@ public class SellerOrderController { @@ -472,27 +469,24 @@ public class SellerOrderController {
472 } 469 }
473 470
474 /** 471 /**
475 - * 取消计算罚款 出售中或售出都会取消 472 + * 取消确认时,计算罚款 出售中或售出都会取消
476 * @param uid 473 * @param uid
477 * @param orderCode 474 * @param orderCode
478 * @return 475 * @return
479 * @throws GatewayException 476 * @throws GatewayException
480 */ 477 */
481 - @RequestMapping(params = "method=ufo.sellerOrder.cancelCompute") 478 + @RequestMapping(params = "method=ufo.sellerOrder.cancelConfirm")
482 @ResponseBody 479 @ResponseBody
483 - public ApiResponse cancelCompute(@RequestParam(name = "uid", required = true)int uid, 480 + public ApiResponse cancelConfirm(@RequestParam(name = "uid", required = true)int uid,
484 @RequestParam(name = "orderCode", required = true)long orderCode 481 @RequestParam(name = "orderCode", required = true)long orderCode
485 ) { 482 ) {
486 SellerOrderCancelReq req = SellerOrderCancelReq.builder() 483 SellerOrderCancelReq req = SellerOrderCancelReq.builder()
487 .uid(uid) 484 .uid(uid)
488 .orderCode(orderCode) 485 .orderCode(orderCode)
489 .build(); 486 .build();
490 - logger.info("in ufo.sellerOrder.cancelCompute, req {}", req);  
491 - boolean result = false;// 487 + logger.info("in ufo.sellerOrder.cancelConfirm, req {}", req);
  488 + OrderCancelComputeResult result = sellerOrderService.cancelConfirm(req);//
492 String msg = "实时计算成功"; 489 String msg = "实时计算成功";
493 - if(!result){  
494 - msg = "实时计算失败";  
495 - }  
496 return new ApiResponse.ApiResponseBuilder().data(result).code(200).message(msg).build(); 490 return new ApiResponse.ApiResponseBuilder().data(result).code(200).message(msg).build();
497 } 491 }
498 492
@@ -6,6 +6,7 @@ import com.yoho.error.ServiceError; @@ -6,6 +6,7 @@ import com.yoho.error.ServiceError;
6 import com.yoho.error.exception.ServiceException; 6 import com.yoho.error.exception.ServiceException;
7 import com.yohobuy.ufo.model.order.bo.*; 7 import com.yohobuy.ufo.model.order.bo.*;
8 import com.yohobuy.ufo.model.order.common.*; 8 import com.yohobuy.ufo.model.order.common.*;
  9 +import com.yohobuy.ufo.model.order.constants.ConfirmDesc;
9 import com.yohobuy.ufo.model.order.constants.SkupType; 10 import com.yohobuy.ufo.model.order.constants.SkupType;
10 import com.yohobuy.ufo.model.order.req.*; 11 import com.yohobuy.ufo.model.order.req.*;
11 import com.yohobuy.ufo.model.order.resp.*; 12 import com.yohobuy.ufo.model.order.resp.*;
@@ -855,7 +856,39 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi @@ -855,7 +856,39 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
855 } 856 }
856 return null; 857 return null;
857 } 858 }
  859 + private final static String FLAG_PRE = "#*", FLAG_SUFFIX = "*#";
  860 + /**
  861 + * 您确定取消出售吗?取消后将根据《卖家须知》扣除对应保证金作为赔偿打入卖家账户
  862 + * “扣除对应保证金” 加粗标红
  863 + * @version 6.8.6
  864 + * @return
  865 + */
  866 + public OrderCancelComputeResult cancelConfirm(SellerOrderCancelReq req){
  867 + log.info("seller self cancel order Confirm ,req {}", req);
  868 + int uid = req.getUid();
  869 + long orderCode = req.getOrderCode();
  870 +
  871 + if (uid <= 0 || orderCode <= 0L){
  872 + throw new ServiceException(ServiceError.ORDER_REQUEST_PARM_IS_EMPTY);
  873 + }
  874 + CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
  875 + if (Objects.isNull(codeMeta)){
  876 + log.warn("seller cancel Confirm orderCode illegal, req {}", req);
  877 + throw new ServiceException(ServiceError.ORDER_REQUEST_PARM_IS_EMPTY);
  878 + }
  879 + OrderCodeType codeType = OrderCodeType.getOrderCodeType(codeMeta.getType());
  880 + log.info("in seller cancel Confirm uid {},orderCode {}, actor {}", uid, orderCode, codeType);
  881 + OrderCancelComputeResult occr = new OrderCancelComputeResult();
  882 + if (OrderCodeType.SELLER_TYPE.equals(codeType)){
  883 + occr.setConfirmDesc(ConfirmDesc.SELF_BEFORE_PAY);
  884 + }
858 885
  886 + if (OrderCodeType.BUYER_TYPE.equals(codeType)){
  887 + String confirmDesc = "您确定取消出售吗?取消后将根据《卖家须知》"+ FLAG_PRE +"扣除对应保证金"+ FLAG_SUFFIX + "作为赔偿打入卖家账户";
  888 + occr.setConfirmDesc(confirmDesc);
  889 + }
  890 + return occr;
  891 + }
859 892
860 893
861 } 894 }