Showing
1 changed file
with
12 additions
and
0 deletions
@@ -95,8 +95,20 @@ public class ProductLimitUserHelpServiceImpl implements IProductLimitUserHelpSer | @@ -95,8 +95,20 @@ public class ProductLimitUserHelpServiceImpl implements IProductLimitUserHelpSer | ||
95 | 95 | ||
96 | @Override | 96 | @Override |
97 | public void addHelpUserInfo(LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) { | 97 | public void addHelpUserInfo(LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) { |
98 | + //判断传入的信息表中是否已经存在 | ||
99 | + List<LimitProductHelpUser> list = productLimitUserHelpMapper.selectHelpInfo(limitProductHelpUserRequestBO.getUserId(), limitProductHelpUserRequestBO.getLimitProductCode()); | ||
100 | + Boolean flag = true; | ||
101 | + if (CollectionUtils.isNotEmpty(list)){ | ||
102 | + for (LimitProductHelpUser limitProductHelpUser : list){ | ||
103 | + if (null != limitProductHelpUser.getIsShare() && "Y".equals(limitProductHelpUser.getIsShare())){ | ||
104 | + flag = false; | ||
105 | + } | ||
106 | + } | ||
107 | + } | ||
108 | + if (flag){ | ||
98 | LimitProductHelpUser limitProductHelpUser = converToModel(limitProductHelpUserRequestBO); | 109 | LimitProductHelpUser limitProductHelpUser = converToModel(limitProductHelpUserRequestBO); |
99 | productLimitUserHelpMapper.addHelpUserInfo(limitProductHelpUser); | 110 | productLimitUserHelpMapper.addHelpUserInfo(limitProductHelpUser); |
111 | + } | ||
100 | //清除缓存 | 112 | //清除缓存 |
101 | String redisKeySuffix = limitProductHelpUserRequestBO.getUserId() + ":" + limitProductHelpUserRequestBO.getLimitProductCode(); | 113 | String redisKeySuffix = limitProductHelpUserRequestBO.getUserId() + ":" + limitProductHelpUserRequestBO.getLimitProductCode(); |
102 | redisValueCache.delete(CacheKeyEnum.LIMIT_USER_HELP_INFO, redisKeySuffix); | 114 | redisValueCache.delete(CacheKeyEnum.LIMIT_USER_HELP_INFO, redisKeySuffix); |
-
Please register or login to post a comment