|
|
package com.yohoufo.order.controller;
|
|
|
|
|
|
import com.yohobuy.ufo.model.order.bo.DepositDetailBo;
|
|
|
import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo;
|
|
|
import com.yohobuy.ufo.model.order.req.DepositOrderComputeReq;
|
|
|
import com.yohobuy.ufo.model.order.req.SellerOrderComputeReq;
|
|
|
import com.yohobuy.ufo.model.order.resp.DepositOrderComputeResp;
|
|
|
import com.yohoufo.common.ApiResponse;
|
|
|
import com.yohoufo.common.annotation.IgnoreSession;
|
|
|
import com.yohoufo.common.annotation.IgnoreSignature;
|
|
|
import com.yohoufo.common.cache.Cachable;
|
|
|
import com.yohoufo.common.cache.ControllerCacheAop;
|
|
|
import com.yohoufo.common.exception.GatewayException;
|
|
|
import com.yohoufo.order.model.response.OrderSubmitResponse;
|
|
|
import com.yohoufo.order.service.deposit.DepositOrderService;
|
...
|
...
|
@@ -13,10 +18,13 @@ import org.slf4j.Logger; |
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
|
|
/**
|
|
|
* Created by li.ma on 2019/7/9.
|
|
|
*/
|
...
|
...
|
@@ -27,6 +35,9 @@ public class DepositOrderController { |
|
|
@Autowired
|
|
|
private DepositOrderService depositOrderService;
|
|
|
|
|
|
@Autowired
|
|
|
private ControllerCacheAop cacheAop;
|
|
|
|
|
|
/**
|
|
|
* 根据库存货号,计算召回的费用
|
|
|
* @param uid
|
...
|
...
|
@@ -83,6 +94,7 @@ public class DepositOrderController { |
|
|
*/
|
|
|
@RequestMapping(params = "method=ufo.deposit.orderInfo")
|
|
|
@ResponseBody
|
|
|
@Cachable(expire = 60)
|
|
|
public ApiResponse depositOrderInfo(@RequestParam(name = "uid", required = true)int uid,
|
|
|
@RequestParam(name = "deposit_code", required = true)String depositCode) throws GatewayException {
|
|
|
DepositOrderComputeReq req = DepositOrderComputeReq.builder().uid(uid).depositCode(depositCode).build();
|
...
|
...
|
@@ -92,4 +104,20 @@ public class DepositOrderController { |
|
|
|
|
|
return new ApiResponse.ApiResponseBuilder().code(200).data(resp).message("查询成功").build();
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/depositOrder/clearDepositOrderCache")
|
|
|
@IgnoreSignature
|
|
|
@IgnoreSession
|
|
|
public ApiResponse clearDepositOrderCache(@RequestBody DepositOrderComputeReq bo) {
|
|
|
Integer uid = bo.getUid();
|
|
|
String depositCode = bo.getDepositCode();
|
|
|
LOG.info("in clearDepositOrderCache bo={}", bo);
|
|
|
try {
|
|
|
Method depositOrderInfo = DepositOrderController.class.getMethod("depositOrderInfo", new Class[]{Integer.class, String.class});
|
|
|
cacheAop.clearCache(depositOrderInfo, new Object[]{uid, depositCode});
|
|
|
} catch (Exception e) {
|
|
|
LOG.error("删除寄存订单缓存失败!", e);
|
|
|
}
|
|
|
return new ApiResponse(200, "缓存清除成功!", Boolean.TRUE);
|
|
|
}
|
|
|
} |
...
|
...
|
|