|
|
@@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.goafanti.admin.bo.AdminDetail;
|
|
|
+import com.goafanti.admin.bo.AdminListBo;
|
|
|
import com.goafanti.admin.service.AdminService;
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.common.dao.AdminLocationMapper;
|
|
|
@@ -49,8 +50,8 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
- public Pagination<Admin> listAdmin(Integer province, Integer number, String mobile, String name, Integer pageNo,
|
|
|
- Integer pageSize) {
|
|
|
+ public Pagination<AdminListBo> listAdmin(Integer province, Integer number, String mobile, String name,
|
|
|
+ Integer pageNo, Integer pageSize) {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
|
|
|
if (StringUtils.isNotBlank(mobile)) {
|
|
|
@@ -72,8 +73,24 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
|
|
|
if (pageSize == null || pageSize < 0 || pageSize > 10) {
|
|
|
pageSize = 10;
|
|
|
}
|
|
|
-
|
|
|
- return (Pagination<Admin>) findPage("findAdminListByPage", "findAdminCount", params, pageNo, pageSize);
|
|
|
+ if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
|
|
|
+ return (Pagination<AdminListBo>) findPage("findAdminListByPage", "findAdminCount", params, pageNo,
|
|
|
+ pageSize);
|
|
|
+ } else if (TokenManager.hasRole(AFTConstants.AREAADMIN)) {
|
|
|
+ List<Integer> provinceList = adminLocationMapper
|
|
|
+ .selectProvinceWhereCityIsNullByAdminId(TokenManager.getAdminId());
|
|
|
+ List<Integer> cityList = adminLocationMapper.selectCityByAdminId(TokenManager.getAdminId());
|
|
|
+ provinceList.addAll(cityList);
|
|
|
+ if (null != provinceList && provinceList.size() > 0){
|
|
|
+ params.put("provinceList", provinceList);
|
|
|
+ }
|
|
|
+ if (null != cityList && cityList.size() > 0){
|
|
|
+ params.put("cityList", cityList);
|
|
|
+ }
|
|
|
+ return (Pagination<AdminListBo>) findPage("findAreaAdminListByPage", "findAreaAdminCount", params, pageNo,
|
|
|
+ pageSize);
|
|
|
+ }
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -218,12 +235,12 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public static void main(String[] args) {
|
|
|
List<Integer> list1 = new ArrayList<>();
|
|
|
List<Integer> list2 = new ArrayList<>();
|
|
|
list1.addAll(list2);
|
|
|
- for (Integer i : list1){
|
|
|
+ for (Integer i : list1) {
|
|
|
System.out.println(i);
|
|
|
}
|
|
|
System.out.println(list1.size());
|