diff --git a/src/main/java/com/cm/population/controller/api/populationinfo/PopulationInfoController.java b/src/main/java/com/cm/population/controller/api/populationinfo/PopulationInfoController.java index 5f14bbe..819c78e 100644 --- a/src/main/java/com/cm/population/controller/api/populationinfo/PopulationInfoController.java +++ b/src/main/java/com/cm/population/controller/api/populationinfo/PopulationInfoController.java @@ -482,7 +482,6 @@ public class PopulationInfoController extends AbstractController { Map params = requestParams(); return populationInfoService.list(params); } - @ApiOperation(value = "基础人口信息分页列表", notes = "基础人口信息分页列表接口") @ApiImplicitParams({ @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), diff --git a/src/main/java/com/cm/population/controller/route/populationinfo/PopulationInfoRouteController.java b/src/main/java/com/cm/population/controller/route/populationinfo/PopulationInfoRouteController.java index f6731f1..89f0855 100644 --- a/src/main/java/com/cm/population/controller/route/populationinfo/PopulationInfoRouteController.java +++ b/src/main/java/com/cm/population/controller/route/populationinfo/PopulationInfoRouteController.java @@ -57,6 +57,11 @@ public class PopulationInfoRouteController extends AbstractController { return new ModelAndView("populationinfo/query"); } + @GetMapping("query-multiple") + public ModelAndView queryMultiple() { + return new ModelAndView("populationinfo/query-multiple"); + } + @GetMapping("bind") public ModelAndView bind() { ModelAndView mv = new ModelAndView("populationinfo/bind"); diff --git a/src/main/java/com/cm/population/service/populationinfo/impl/PopulationInfoServiceImpl.java b/src/main/java/com/cm/population/service/populationinfo/impl/PopulationInfoServiceImpl.java index aa2bae8..6b68f70 100644 --- a/src/main/java/com/cm/population/service/populationinfo/impl/PopulationInfoServiceImpl.java +++ b/src/main/java/com/cm/population/service/populationinfo/impl/PopulationInfoServiceImpl.java @@ -2,6 +2,7 @@ package com.cm.population.service.populationinfo.impl; import com.cm.common.base.AbstractService; import com.cm.common.exception.SaveException; +import com.cm.common.exception.SearchException; import com.cm.common.plugin.oauth.service.user.IUserService; import com.cm.common.plugin.pojo.bos.UserResourceBO; import com.cm.common.plugin.pojo.dtos.dataarea.DataAreaDTO; @@ -437,12 +438,19 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul @Override public List list(Map params) { + if(params.get("populationInfoIds") != null) { + List list = Arrays.asList(params.get("populationInfoIds").toString().split("\\_")); + if (list.size() > 100) { + throw new SearchException("单次最多选择100个"); + } + params.put("populationInfoIds", list); + } List listList = populationInfoDao.list(params); ArrayList arr = new ArrayList(); for(PopulationInfoDTO dto : listList) { arr.add(dto.getCreator()); } - // 查询用户 + // 查询创建人用户集 List jsonArray = iUserService.listUserResourceByIds(arr); UserResourceBO bo1 = new UserResourceBO(); bo1.setUserId("1"); @@ -450,12 +458,14 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul jsonArray.add(bo1); List list = iDataDictionaryService.listDictionaryByParentId("5ea50f00-3d76-492c-8680-9c30d50cce21"); for(PopulationInfoDTO populationInfoDTO : listList) { + // 封装创建人姓名回显 for(UserResourceBO bo : jsonArray) { if (bo.getUserId().equals(populationInfoDTO.getCreator())) { populationInfoDTO.setCreatorName(bo.getUserName()); break; } } + // 封装标签回显 if (populationInfoDTO != null && !StringUtil.isEmpty(populationInfoDTO.getLabel()) && populationInfoDTO.getLabel().length() > 0) { List dataList = new ArrayList<>(); for(DataDictionaryDTO dto : list) { diff --git a/src/main/java/com/cm/population/service/populationlog/impl/PopulationLogServiceImpl.java b/src/main/java/com/cm/population/service/populationlog/impl/PopulationLogServiceImpl.java index 0ce3343..95004ba 100644 --- a/src/main/java/com/cm/population/service/populationlog/impl/PopulationLogServiceImpl.java +++ b/src/main/java/com/cm/population/service/populationlog/impl/PopulationLogServiceImpl.java @@ -371,10 +371,10 @@ public class PopulationLogServiceImpl extends AbstractService implements IPopula throw new SaveException("请先登录"); } List list = populationLogDao.list(params); - if (!creator.equals("1")) { + //if (!creator.equals("1")) { for(PopulationLogDTO dto : list) { dto.setPopulationInfoData(""); // 不给返回操作的数据 - String populationInfoContent = dto.getPopulationInfoContent().replace("超级管理员[1]", "超级管理员"); + String populationInfoContent = dto.getPopulationInfoContent().replace("超级管理员[1]", "超级管理员[***]"); Pattern pattern = Pattern.compile("[a-zA-Z0-9-]{36}"); Matcher matcher = pattern.matcher(populationInfoContent); while(matcher.find()) { @@ -402,7 +402,7 @@ public class PopulationLogServiceImpl extends AbstractService implements IPopula } dto.setPopulationInfoContent(populationInfoContent); } - } + // } return list; } diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index a3be1f0..e2f24f7 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -1,6 +1,6 @@ server: port: 7023 - url: http://192.168.0.9:7023/population + url: http://192.168.0.115:7023/population title: population servlet: context-path: /population @@ -74,8 +74,8 @@ security: oauth-server: http://192.168.0.15:7021/usercenter oauth-logout: ${security.oauth2.oauth-server}/logout?redirect_uri=${server.url} client: - client-id: 00b49298399641448405170d55a3614b - client-secret: Z0RQUmZTdENUckprWVRtdGQ3Sm5ldmlCZFJKT1NBNHJZWnNrM1RSSWU3NG1ac2wwZTJHWk5NbXh3L3h3U2c4Rg== + client-id: b7eadbbb122044ecb4761db0b98ade3a + client-secret: Z3A3a1AvTHRZeCtPWXVkOXJaeGFYWGp5Q2F1VlhPYVY0Q0hFMCtuQ0tkVW1ac2wwZTJHWk5NbXh3L3h3U2c4Rg== user-authorization-uri: ${security.oauth2.oauth-server}/oauth_client/authorize access-token-uri: ${security.oauth2.oauth-server}/oauth_client/token grant-type: authorization_code @@ -121,4 +121,7 @@ logging: com.cm: debug server-other: - area-url: http://192.168.0.15:7022/servicecity \ No newline at end of file + area-url: http://192.168.0.15:7022/servicecity + population-update-log: true + population-insert-log: true + population-delete-log: false \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/populationlog/population-log-mapper.xml b/src/main/resources/mybatis/mapper/populationlog/population-log-mapper.xml index 74f84ec..e502a89 100644 --- a/src/main/resources/mybatis/mapper/populationlog/population-log-mapper.xml +++ b/src/main/resources/mybatis/mapper/populationlog/population-log-mapper.xml @@ -63,6 +63,7 @@ t1.population_info_id = #{populationInfoId} ORDER BY t1.gmt_create DESC + LIMIT 50