|
@@ -7,6 +7,8 @@ import com.yohobuy.ufo.model.order.bo.DepositProductBo; |
|
@@ -7,6 +7,8 @@ import com.yohobuy.ufo.model.order.bo.DepositProductBo; |
7
|
import com.yohobuy.ufo.model.order.constants.DepositOrderStatusEnum;
|
7
|
import com.yohobuy.ufo.model.order.constants.DepositOrderStatusEnum;
|
8
|
import com.yohobuy.ufo.model.order.constants.StorageDepositStatusEnum;
|
8
|
import com.yohobuy.ufo.model.order.constants.StorageDepositStatusEnum;
|
9
|
import com.yohobuy.ufo.model.order.resp.PageResp;
|
9
|
import com.yohobuy.ufo.model.order.resp.PageResp;
|
|
|
10
|
+import com.yohoufo.common.ApiResponse;
|
|
|
11
|
+import com.yohoufo.common.cache.ControllerCacheAop;
|
10
|
import com.yohoufo.common.exception.UfoServiceException;
|
12
|
import com.yohoufo.common.exception.UfoServiceException;
|
11
|
import com.yohoufo.common.helper.ImageUrlAssist;
|
13
|
import com.yohoufo.common.helper.ImageUrlAssist;
|
12
|
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
|
14
|
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
|
|
@@ -14,6 +16,7 @@ import com.yohoufo.dal.order.StorageDepositMapper; |
|
@@ -14,6 +16,7 @@ import com.yohoufo.dal.order.StorageDepositMapper; |
14
|
import com.yohoufo.dal.order.model.SellerOrderGoods;
|
16
|
import com.yohoufo.dal.order.model.SellerOrderGoods;
|
15
|
import com.yohoufo.dal.order.model.StorageDeposit;
|
17
|
import com.yohoufo.dal.order.model.StorageDeposit;
|
16
|
import com.yohoufo.dal.order.model.StorageDepositCount;
|
18
|
import com.yohoufo.dal.order.model.StorageDepositCount;
|
|
|
19
|
+import com.yohoufo.order.controller.DepositController;
|
17
|
import com.yohoufo.order.service.DepositService;
|
20
|
import com.yohoufo.order.service.DepositService;
|
18
|
import com.yohoufo.order.service.proxy.ProductProxyService;
|
21
|
import com.yohoufo.order.service.proxy.ProductProxyService;
|
19
|
import org.slf4j.Logger;
|
22
|
import org.slf4j.Logger;
|
|
@@ -21,6 +24,7 @@ import org.slf4j.LoggerFactory; |
|
@@ -21,6 +24,7 @@ import org.slf4j.LoggerFactory; |
21
|
import org.springframework.beans.factory.annotation.Autowired;
|
24
|
import org.springframework.beans.factory.annotation.Autowired;
|
22
|
import org.springframework.stereotype.Service;
|
25
|
import org.springframework.stereotype.Service;
|
23
|
|
26
|
|
|
|
27
|
+import java.lang.reflect.Method;
|
24
|
import java.math.BigDecimal;
|
28
|
import java.math.BigDecimal;
|
25
|
import java.util.*;
|
29
|
import java.util.*;
|
26
|
import java.util.function.Function;
|
30
|
import java.util.function.Function;
|
|
@@ -33,6 +37,9 @@ public class DepositServiceImpl implements DepositService { |
|
@@ -33,6 +37,9 @@ public class DepositServiceImpl implements DepositService { |
33
|
private final Logger LOGGER = LoggerFactory.getLogger(DepositServiceImpl.class);
|
37
|
private final Logger LOGGER = LoggerFactory.getLogger(DepositServiceImpl.class);
|
34
|
|
38
|
|
35
|
@Autowired
|
39
|
@Autowired
|
|
|
40
|
+ private ControllerCacheAop cacheAop;
|
|
|
41
|
+
|
|
|
42
|
+ @Autowired
|
36
|
private ProductProxyService productProxyService;
|
43
|
private ProductProxyService productProxyService;
|
37
|
|
44
|
|
38
|
@Autowired
|
45
|
@Autowired
|
|
@@ -285,6 +292,34 @@ public class DepositServiceImpl implements DepositService { |
|
@@ -285,6 +292,34 @@ public class DepositServiceImpl implements DepositService { |
285
|
return storageDepositMapper.updateStorageStatus(depositCode, status, orderStatus);
|
292
|
return storageDepositMapper.updateStorageStatus(depositCode, status, orderStatus);
|
286
|
}
|
293
|
}
|
287
|
|
294
|
|
|
|
295
|
+ public void clearCache(Integer uid, Integer productId, Integer storageId) {
|
|
|
296
|
+ if (uid == null) {
|
|
|
297
|
+ return;
|
|
|
298
|
+ }
|
|
|
299
|
+ try {
|
|
|
300
|
+ Method queryUserDoposit = DepositController.class.getMethod("queryUserDoposit", new Class[]{Integer.class, Integer.class, Integer.class});
|
|
|
301
|
+ cacheAop.clearCache(queryUserDoposit, new Object[]{uid, 0, 0});
|
|
|
302
|
+
|
|
|
303
|
+ Method queryUserDopositBackDetail = DepositController.class.getMethod("queryUserDopositBackDetail", new Class[]{Integer.class, Integer.class, Integer.class});
|
|
|
304
|
+ cacheAop.clearCache(queryUserDopositBackDetail, new Object[]{uid, 0, 0});
|
|
|
305
|
+
|
|
|
306
|
+ if (productId != null) {
|
|
|
307
|
+ Method queryUserDopositing = DepositController.class.getMethod("queryUserDopositing", new Class[]{Integer.class, Integer.class, Integer.class, Integer.class});
|
|
|
308
|
+ cacheAop.clearCache(queryUserDopositBackDetail, new Object[]{uid, productId, 0, 0});
|
|
|
309
|
+ }
|
|
|
310
|
+
|
|
|
311
|
+ if (storageId != null) {
|
|
|
312
|
+ Method queryUserStorageOffCount = DepositController.class.getMethod("queryUserStorageOffCount", new Class[]{Integer.class, Integer.class});
|
|
|
313
|
+ cacheAop.clearCache(queryUserStorageOffCount, new Object[]{uid, storageId});
|
|
|
314
|
+ }
|
|
|
315
|
+
|
|
|
316
|
+ Method queryUserStorageCount = DepositController.class.getMethod("queryUserStorageCount", new Class[]{Integer.class});
|
|
|
317
|
+ cacheAop.clearCache(queryUserStorageCount, new Object[]{uid});
|
|
|
318
|
+ } catch (Exception e) {
|
|
|
319
|
+ LOGGER.error("删除用户寄存缓存失败!", e);
|
|
|
320
|
+ }
|
|
|
321
|
+ }
|
|
|
322
|
+
|
288
|
/**
|
323
|
/**
|
289
|
* Do 转 Vo
|
324
|
* Do 转 Vo
|
290
|
* @param storageDeposit
|
325
|
* @param storageDeposit
|