Browse Source

'地图数据BUG修复'

master
daixiantong 4 years ago
parent
commit
f15c6de76b
2 changed files with 39 additions and 19 deletions
  1. +37
    -19
      src/main/java/com/taauav/admin/service/impl/LsAdminServiceImpl.java
  2. +2
    -0
      src/main/java/com/taauav/front/vo/LSVillageVo.java

+ 37
- 19
src/main/java/com/taauav/admin/service/impl/LsAdminServiceImpl.java View File

@@ -476,7 +476,6 @@ public class LsAdminServiceImpl extends BaseServiceImpl<LsAdminMapper, LsAdmin>
if (limitLevel > 0) {
wrapper.lt("level", limitLevel);
}

List<SysCity> cityList = cityService.list(wrapper);
return cityList;
}
@@ -564,6 +563,7 @@ public class LsAdminServiceImpl extends BaseServiceImpl<LsAdminMapper, LsAdmin>
String key = "userId_" + userId + "_townId_" + townId + "_village_driver";
Boolean exist = redisUtils.hasKey(key);
List<TauvDriverDTO> driverDTOList = new ArrayList<>();
Boolean permission = false;
if (exist) {
Object object = redisUtils.get(key);
driverDTOList = FunctionUtils.castList(object, TauvDriverDTO.class);
@@ -576,11 +576,10 @@ public class LsAdminServiceImpl extends BaseServiceImpl<LsAdminMapper, LsAdmin>
switch (auth.getAuthData()) {
case 1:
city = cityService.getInfoById(adminInfo.getDriverArea());
if (city.getLevel() == 5 && !cityList.contains(city)) {
if (city.getLevel() == 5 && !cityList.contains(city) && city.getPid().equals(townId)) {
cityList.add(city);
if (city.getPid().equals(townId)) {
cityVoList.add(countQuestionNum(city, map));
}
permission = true;
cityVoList.add(countQuestionNum(city, map));
if (!exist) {
driverDTOList = dealDriverList(city.getId(), driverDTOList);
}
@@ -588,28 +587,47 @@ public class LsAdminServiceImpl extends BaseServiceImpl<LsAdminMapper, LsAdmin>
break;
case 2:
city = cityService.getInfoById(adminInfo.getDriverArea());
if (city.getLevel() == 5 && !cityList.contains(city)) {
if (city.getLevel() == 5 && !cityList.contains(city) && city.getPid().equals(townId)) {
cityList.add(city);
if (city.getPid().equals(townId)) {
cityVoList.add(countQuestionNum(city, map));
}
permission = true;
cityVoList.add(countQuestionNum(city, map));
if (!exist) {
driverDTOList = dealDriverList(city.getId(), driverDTOList);
}
} else if (city.getLevel() < 5) {
} else if (city.getLevel() == 4 && townId.equals(adminInfo.getDriverArea())) {
permission = true;
//获取子级
List<SysCity> childCityList = getChildCityList(adminInfo.getDriverArea(), 0);
List<SysCity> childCityList = getChildCityList(townId, 0);
for (SysCity item : childCityList) {
if (!cityList.contains(item) && item.getLevel().equals(5)) {
if (!cityList.contains(item)) {
cityList.add(item);
if (item.getPid().equals(townId)) {
cityVoList.add(countQuestionNum(item, map));
}
cityVoList.add(countQuestionNum(item, map));
if (!exist) {
driverDTOList = dealDriverList(city.getId(), driverDTOList);
}
}
}
} else if (city.getLevel() == 3) {
List<SysCity> townList = getChildCityList(city.getId(), 0);
List<BigInteger> townIds = new ArrayList<>();
if (townList != null && townList.size() > 0) {
for (SysCity item : townList) {
townIds.add(item.getId());
}
}
if (townIds.contains(townId)) {
permission = true;
List<SysCity> childCityList = getChildCityList(townId, 0);
for (SysCity item : childCityList) {
if (!cityList.contains(item)) {
cityList.add(item);
cityVoList.add(countQuestionNum(item, map));
if (!exist) {
driverDTOList = dealDriverList(city.getId(), driverDTOList);
}
}
}
}
}
break;
case 3:
@@ -619,11 +637,10 @@ public class LsAdminServiceImpl extends BaseServiceImpl<LsAdminMapper, LsAdmin>
for (String area : driverAreaList) {
BigInteger areaId = new BigInteger(area);
city = cityService.getInfoById(areaId);
if (city.getLevel().equals(5) && !cityList.contains(city)) {
if (city.getLevel().equals(5) && !cityList.contains(city) && city.getPid().equals(townId)) {
cityList.add(city);
if (city.getPid().equals(townId)) {
cityVoList.add(countQuestionNum(city, map));
}
permission = true;
cityVoList.add(countQuestionNum(city, map));
if (!exist) {
driverDTOList = dealDriverList(city.getId(), driverDTOList);
}
@@ -642,6 +659,7 @@ public class LsAdminServiceImpl extends BaseServiceImpl<LsAdminMapper, LsAdmin>
LSVillageVo villageVo = new LSVillageVo();
villageVo.setCityVoList(cityVoList);
villageVo.setDriverDTOList(driverDTOList);
villageVo.setPermission(permission);
return villageVo;
}


+ 2
- 0
src/main/java/com/taauav/front/vo/LSVillageVo.java View File

@@ -11,4 +11,6 @@ public class LSVillageVo {
private List<SysCityVo> cityVoList;

private List<TauvDriverDTO> driverDTOList;

private Boolean permission;
}

Loading…
Cancel
Save