|
|
@@ -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; |
|
|
|
} |
|
|
|
|