From eef6d2bcdb29348efe4ef17bc45a4c6886b487b1 Mon Sep 17 00:00:00 2001
From: lidongdong <1459917685@qq.com>
Date: 星期四, 11 七月 2024 18:16:26 +0800
Subject: [PATCH] 花城 【小程序】统计排行添加是否是问题清单标识5
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BcRegionServiceImpl.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 50 insertions(+), 4 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BcRegionServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BcRegionServiceImpl.java
index 866d8af..acb7674 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BcRegionServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BcRegionServiceImpl.java
@@ -35,18 +35,64 @@
}
@Override
- public R levelList() {
+ public R selectCommunityCodeByName( String city, String country,String town,String villagetr) {
+ return R.ok(this.baseMapper.selectCommunityCodeByName(city,country,town,villagetr));
+ }
+
+ @Override
+ public R levelList(Integer level,String code) {
+ if(level==1){
+ List<ProvinceCityReturnVO> firstLevel=this.baseMapper.selectFirst();
+ return R.ok(firstLevel);
+ }
+ if(level==2){
+ List<ProvinceCityReturnVO> secondLevel=this.baseMapper.selectSecond(code);
+ return R.ok(secondLevel);
+ }
+ if(level==3){
+ List<ProvinceCityReturnVO> thirdLevel=this.baseMapper.selectThird(code);
+ return R.ok(thirdLevel);
+ }
+ if(level==4){
+ List<ProvinceCityReturnVO> fourthLevel=this.baseMapper.selectFourth(code);
+ return R.ok(fourthLevel);
+ }
+ return R.fail("参数错误");
+// if(stringRedisTemplate.hasKey("levelList")){
+// return R.ok(stringRedisTemplate.opsForValue().get("levelList"));
+// }
+// else {
+// List<ProvinceCityReturnVO> firstLevel=this.baseMapper.selectFirst();
+// firstLevel.forEach(provinceCityReturnVO -> {
+// List<ProvinceCityReturnVO> secondLevel=this.baseMapper.selectSecond(provinceCityReturnVO.getCode());
+// secondLevel.forEach(provinceCityReturnVO1 -> {
+// List<ProvinceCityReturnVO> thirdLevel=this.baseMapper.selectThird(provinceCityReturnVO1.getCode());
+// thirdLevel.forEach(provinceCityReturnVO2 -> {
+// List<ProvinceCityReturnVO> fourthLevel=this.baseMapper.selectFourth(provinceCityReturnVO2.getCode());
+// provinceCityReturnVO2.setProvinceCityReturnVOList(fourthLevel);
+// });
+// provinceCityReturnVO1.setProvinceCityReturnVOList(thirdLevel);
+// });
+// provinceCityReturnVO.setProvinceCityReturnVOList(secondLevel);
+// });
+// stringRedisTemplate.opsForValue().set("levelList", JSON.toJSONString(firstLevel));
+// return R.ok(firstLevel);
+// }
+ }
+
+ @Override
+ public R levelListBackstage() {
if(stringRedisTemplate.hasKey("levelList")){
return R.ok(stringRedisTemplate.opsForValue().get("levelList"));
}
else {
List<ProvinceCityReturnVO> firstLevel=this.baseMapper.selectFirst();
firstLevel.forEach(provinceCityReturnVO -> {
- List<ProvinceCityReturnVO> secondLevel=this.baseMapper.selectSecond(provinceCityReturnVO.getName());
+ List<ProvinceCityReturnVO> secondLevel=this.baseMapper.selectSecond(provinceCityReturnVO.getCode());
secondLevel.forEach(provinceCityReturnVO1 -> {
- List<ProvinceCityReturnVO> thirdLevel=this.baseMapper.selectThird(provinceCityReturnVO1.getName());
+ List<ProvinceCityReturnVO> thirdLevel=this.baseMapper.selectThird(provinceCityReturnVO1.getCode());
thirdLevel.forEach(provinceCityReturnVO2 -> {
- List<ProvinceCityReturnVO> fourthLevel=this.baseMapper.selectFourth(provinceCityReturnVO2.getName());
+ List<ProvinceCityReturnVO> fourthLevel=this.baseMapper.selectFourth(provinceCityReturnVO2.getCode());
provinceCityReturnVO2.setProvinceCityReturnVOList(fourthLevel);
});
provinceCityReturnVO1.setProvinceCityReturnVOList(thirdLevel);
--
Gitblit v1.7.1