From 12e10ecd2c2ccdf51a49df19c2a2688e2dc79409 Mon Sep 17 00:00:00 2001 From: "java_cuibaocheng@163.com" Date: Thu, 16 Nov 2023 14:51:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=8F=A3=E5=9F=BA=E6=9C=AC=E4=BF=A1?= =?UTF-8?q?=E6=81=AF-=E6=88=BF=E5=B1=8B=E4=B8=AD=E5=90=8C=E4=BD=8F?= =?UTF-8?q?=E4=BA=BA=E7=9A=84=E6=96=B0=E5=A2=9E=E4=B8=8E=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=20=E4=BA=BA=E5=8F=A3=E5=9F=BA=E6=9C=AC=E4=BF=A1=E6=81=AF-?= =?UTF-8?q?=E4=BA=BA=E5=8F=A3=E9=80=89=E6=8B=A9=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E5=8E=BB=E8=84=B1=E6=95=8FBug=E4=BF=AE=E6=94=B9=20=E4=BA=BA?= =?UTF-8?q?=E5=8F=A3=E5=9F=BA=E6=9C=AC=E4=BF=A1=E6=81=AF-=E4=BA=BA?= =?UTF-8?q?=E5=8F=A3=E9=80=89=E6=8B=A9=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=BA=E5=91=98=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PopulationInfoController.java | 1 - .../PopulationInfoRouteController.java | 5 + .../impl/PopulationInfoServiceImpl.java | 12 +- .../impl/PopulationLogServiceImpl.java | 6 +- src/main/resources/application-test.yml | 11 +- .../populationlog/population-log-mapper.xml | 1 + .../resources/templates/house/list-popu.html | 60 ++-- src/main/resources/templates/house/save.html | 124 +++++++- .../resources/templates/house/update.html | 126 ++++++++- .../templates/populationinfo/list.html | 2 +- .../populationinfo/query-multiple.html | 264 ++++++++++++++++++ .../templates/populationinfo/query.html | 38 ++- 12 files changed, 607 insertions(+), 43 deletions(-) create mode 100644 src/main/resources/templates/populationinfo/query-multiple.html 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