Browse Source

clearCustomerTag

dev
yinzuomei 3 years ago
parent
commit
df61b90895
  1. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  2. 1
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java
  3. 10
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java
  4. 2
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -21,8 +21,8 @@ import java.util.Set;
* @author yinzuomei@elink-cn.com * @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:37 * @date 2020/6/4 13:37
*/ */
//@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class, url = "localhost:8092") @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class, url = "localhost:8092")
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class) // @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class)
public interface GovOrgOpenFeignClient { public interface GovOrgOpenFeignClient {
/** /**

1
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java

@ -32,6 +32,7 @@ public class TagController {
* @Description 已发布列表页的标签政府端 * @Description 已发布列表页的标签政府端
* @param tokenDto * @param tokenDto
* @author zxc * @author zxc
* 补充pc党建声音查询条件新增弹框中的标签下拉框也调用的此接口
*/ */
@PostMapping("taglist") @PostMapping("taglist")
// @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) // @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST)

10
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java

@ -39,6 +39,7 @@ import com.epmet.dto.result.UpdateTagUseCountsResultDTO;
import com.epmet.entity.TagCustomerEntity; import com.epmet.entity.TagCustomerEntity;
import com.epmet.entity.TagScopeEntity; import com.epmet.entity.TagScopeEntity;
import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.redis.TagRedis;
import com.epmet.service.TagCustomerService; import com.epmet.service.TagCustomerService;
import com.epmet.utils.TagColorUtils; import com.epmet.utils.TagColorUtils;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
@ -68,7 +69,8 @@ public class TagCustomerServiceImpl extends BaseServiceImpl<TagCustomerDao, TagC
private TagScopeDao tagScopeDao; private TagScopeDao tagScopeDao;
@Autowired @Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient; private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private TagRedis tagRedis;
/** /**
* pc标签管理-分页查询 * pc标签管理-分页查询
@ -118,6 +120,8 @@ public class TagCustomerServiceImpl extends BaseServiceImpl<TagCustomerDao, TagC
tagScopeDao.insert(tagScopeEntity); tagScopeDao.insert(tagScopeEntity);
}); });
} }
//删除redis缓存
tagRedis.clearCustomerTag(dto.getCustomerId());
} }
/** /**
@ -149,6 +153,7 @@ public class TagCustomerServiceImpl extends BaseServiceImpl<TagCustomerDao, TagC
tagScopeDao.insert(tagScopeEntity); tagScopeDao.insert(tagScopeEntity);
}); });
} }
tagRedis.clearCustomerTag(dto.getCustomerId());
} }
@Override @Override
@ -199,6 +204,7 @@ public class TagCustomerServiceImpl extends BaseServiceImpl<TagCustomerDao, TagC
.set(TagCustomerEntity::getUpdatedTime, new Date()) .set(TagCustomerEntity::getUpdatedTime, new Date())
.set(TagCustomerEntity::getShowFlag,showFlag); .set(TagCustomerEntity::getShowFlag,showFlag);
baseDao.update(null,tagCustomerUpdateWrapper); baseDao.update(null,tagCustomerUpdateWrapper);
tagRedis.clearCustomerTag(EpmetRequestHolder.getLoginUserCustomerId());
} }
/** /**
@ -224,7 +230,7 @@ public class TagCustomerServiceImpl extends BaseServiceImpl<TagCustomerDao, TagC
Result<List<AgencyResultDTO>> communityRes = govOrgOpenFeignClient.getAllCommunity(customerId); Result<List<AgencyResultDTO>> communityRes = govOrgOpenFeignClient.getAllCommunity(customerId);
if (communityRes.success() && CollectionUtils.isNotEmpty(communityRes.getData())) { if (communityRes.success() && CollectionUtils.isNotEmpty(communityRes.getData())) {
int communityTotal = communityRes.getData().size(); int communityTotal = communityRes.getData().size();
int num = 1; int num = 0;
for (TagCustomerEntity tag : tagList) { for (TagCustomerEntity tag : tagList) {
for (AgencyResultDTO agencyResultDTO : communityRes.getData()) { for (AgencyResultDTO agencyResultDTO : communityRes.getData()) {
TagScopeEntity tagScopeEntity = new TagScopeEntity(); TagScopeEntity tagScopeEntity = new TagScopeEntity();

2
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java

@ -57,6 +57,7 @@ public class TagServiceImpl implements TagService {
* @Description 已发布列表页的标签政府端 * @Description 已发布列表页的标签政府端
* @param tokenDto * @param tokenDto
* @author zxc * @author zxc
* 补充pc党建声音查询条件新增弹框中的标签下拉框也调用的此接口
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ -64,6 +65,7 @@ public class TagServiceImpl implements TagService {
String customerId = tokenDto.getCustomerId(); String customerId = tokenDto.getCustomerId();
List<TagInfoResultDTO> resultDtos = tagRedis.zRevRange(customerId); List<TagInfoResultDTO> resultDtos = tagRedis.zRevRange(customerId);
if (resultDtos.size() == NumConstant.ZERO){ if (resultDtos.size() == NumConstant.ZERO){
//初始化标签
resultDtos = this.initTags(customerId); resultDtos = this.initTags(customerId);
} }
return resultDtos; return resultDtos;

Loading…
Cancel
Save