From 42bf496c29dcb4c997867b1b5b55f95517df293d Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Thu, 10 Feb 2022 15:07:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=96=B0=E5=A2=9E=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E6=9D=A1=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pojo/dtos/bigdta/SchoolKey.java | 9 -------- .../impl/EnterpriseServiceImpl.java | 13 ++++++++++++ .../homicide/impl/HomicideServiceImpl.java | 13 ++++++++++++ .../impl/ImportantEventServiceImpl.java | 13 ++++++++++++ .../KeyAreaCheckRenovationServiceImpl.java | 13 ++++++++++++ .../keyplace/impl/KeyPlaceServiceImpl.java | 13 ++++++++++++ .../linecase/impl/LineCaseServiceImpl.java | 13 ++++++++++++ .../impl/LogisticsSafeServiceImpl.java | 13 ++++++++++++ .../impl/PublicVideoServiceImpl.java | 13 ++++++++++++ .../tenlion/systembase/util/VerifyUtil.java | 21 +++++++++++++++++++ .../mapper/enterprise/enterprise-mapper.xml | 3 +++ .../mapper/homicide/homicide-mapper.xml | 3 +++ .../importantevent/important-event-mapper.xml | 3 +++ .../key-area-check-renovation-mapper.xml | 3 +++ .../mapper/keyplace/key-place-mapper.xml | 3 +++ .../mapper/linecase/line-case-mapper.xml | 3 +++ .../logisticssafe/logistics-safe-mapper.xml | 3 +++ .../publicvideo/public-video-mapper.xml | 3 +++ 18 files changed, 149 insertions(+), 9 deletions(-) diff --git a/src/main/java/cn/com/tenlion/systembase/pojo/dtos/bigdta/SchoolKey.java b/src/main/java/cn/com/tenlion/systembase/pojo/dtos/bigdta/SchoolKey.java index b05b32d..933732a 100644 --- a/src/main/java/cn/com/tenlion/systembase/pojo/dtos/bigdta/SchoolKey.java +++ b/src/main/java/cn/com/tenlion/systembase/pojo/dtos/bigdta/SchoolKey.java @@ -151,21 +151,12 @@ public class SchoolKey { if(school_name != null && school_name.length() > 255 ) { throw new ParamsException("学校名称超出长度"); } - if(StringUtils.isEmpty(full_name)) { - throw new ParamsException("姓名名不能为空"); - } if(full_name != null && full_name.length() > 20 ) { throw new ParamsException("姓名超出长度"); } - if(StringUtils.isEmpty(name_used_before)) { - throw new ParamsException("曾用名名不能为空"); - } if(name_used_before != null && name_used_before.length() > 20 ) { throw new ParamsException("曾用名超出长度"); } - if(StringUtils.isEmpty(gender)) { - throw new ParamsException("性别名不能为空"); - } if(gender != null && gender.length() > 10 ) { throw new ParamsException("性别超出长度"); } diff --git a/src/main/java/cn/com/tenlion/systembase/service/enterprise/impl/EnterpriseServiceImpl.java b/src/main/java/cn/com/tenlion/systembase/service/enterprise/impl/EnterpriseServiceImpl.java index 7cadb10..bd86da5 100644 --- a/src/main/java/cn/com/tenlion/systembase/service/enterprise/impl/EnterpriseServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systembase/service/enterprise/impl/EnterpriseServiceImpl.java @@ -10,6 +10,7 @@ import cn.com.tenlion.systembase.pojo.vos.enterprise.EnterpriseVO; import cn.com.tenlion.systembase.pojo.vos.keyareacheckrenovation.KeyAreaCheckRenovationVO; import cn.com.tenlion.systembase.service.enterprise.IEnterpriseService; import cn.com.tenlion.systembase.service.grid.IGridService; +import cn.com.tenlion.systembase.util.VerifyUtil; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -175,6 +176,18 @@ public class EnterpriseServiceImpl extends DefaultBaseService implements IEnterp @Override public List list(Map params) { + if(params.get("areaCodeLike") != null && !"".equals(params.get("areaCodeLike").toString())){ + String areaCoed = params.get("areaCodeLike").toString(); + String[] areaCodeSplit = VerifyUtil.splitStringByLength(areaCoed, 2); + String areaCodeLike = ""; + for(int i = 5 ; i >= 0; i--){ + if(!"00".equals(areaCodeSplit[i])){ + areaCodeLike = areaCoed.substring(0, (i + 1) * 2 ); + break; + } + } + params.put("areaCodeLike",areaCodeLike); + } return enterpriseDao.list(params); } diff --git a/src/main/java/cn/com/tenlion/systembase/service/homicide/impl/HomicideServiceImpl.java b/src/main/java/cn/com/tenlion/systembase/service/homicide/impl/HomicideServiceImpl.java index 4273daf..78b9daf 100644 --- a/src/main/java/cn/com/tenlion/systembase/service/homicide/impl/HomicideServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systembase/service/homicide/impl/HomicideServiceImpl.java @@ -8,6 +8,7 @@ import cn.com.tenlion.systembase.pojo.pos.homicide.HomicidePO; import cn.com.tenlion.systembase.pojo.vos.homicide.HomicideVO; import cn.com.tenlion.systembase.service.grid.IGridService; import cn.com.tenlion.systembase.service.homicide.IHomicideService; +import cn.com.tenlion.systembase.util.VerifyUtil; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.result.SuccessResultList; @@ -151,6 +152,18 @@ public class HomicideServiceImpl extends DefaultBaseService implements IHomicide @Override public List list(Map params) { + if(params.get("areaCodeLike") != null && !"".equals(params.get("areaCodeLike").toString())){ + String areaCoed = params.get("areaCodeLike").toString(); + String[] areaCodeSplit = VerifyUtil.splitStringByLength(areaCoed, 2); + String areaCodeLike = ""; + for(int i = 5 ; i >= 0; i--){ + if(!"00".equals(areaCodeSplit[i])){ + areaCodeLike = areaCoed.substring(0, (i + 1) * 2 ); + break; + } + } + params.put("areaCodeLike",areaCodeLike); + } return homicideDao.list(params); } diff --git a/src/main/java/cn/com/tenlion/systembase/service/importantevent/impl/ImportantEventServiceImpl.java b/src/main/java/cn/com/tenlion/systembase/service/importantevent/impl/ImportantEventServiceImpl.java index 1d8c5f5..d810445 100644 --- a/src/main/java/cn/com/tenlion/systembase/service/importantevent/impl/ImportantEventServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systembase/service/importantevent/impl/ImportantEventServiceImpl.java @@ -3,6 +3,7 @@ package cn.com.tenlion.systembase.service.importantevent.impl; import cn.com.tenlion.systembase.pojo.dtos.bigdta.CgImportantEvent; import cn.com.tenlion.systembase.pojo.dtos.grid.GridDTO; import cn.com.tenlion.systembase.service.grid.IGridService; +import cn.com.tenlion.systembase.util.VerifyUtil; import com.alibaba.fastjson.JSONObject; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.pojo.ListPage; @@ -162,6 +163,18 @@ public class ImportantEventServiceImpl extends DefaultBaseService implements IIm @Override public List list(Map params) { + if(params.get("areaCodeLike") != null && !"".equals(params.get("areaCodeLike").toString())){ + String areaCoed = params.get("areaCodeLike").toString(); + String[] areaCodeSplit = VerifyUtil.splitStringByLength(areaCoed, 2); + String areaCodeLike = ""; + for(int i = 5 ; i >= 0; i--){ + if(!"00".equals(areaCodeSplit[i])){ + areaCodeLike = areaCoed.substring(0, (i + 1) * 2 ); + break; + } + } + params.put("areaCodeLike",areaCodeLike); + } return importantEventDao.list(params); } diff --git a/src/main/java/cn/com/tenlion/systembase/service/keyareacheckrenovation/impl/KeyAreaCheckRenovationServiceImpl.java b/src/main/java/cn/com/tenlion/systembase/service/keyareacheckrenovation/impl/KeyAreaCheckRenovationServiceImpl.java index 65b0b3a..1c3de38 100644 --- a/src/main/java/cn/com/tenlion/systembase/service/keyareacheckrenovation/impl/KeyAreaCheckRenovationServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systembase/service/keyareacheckrenovation/impl/KeyAreaCheckRenovationServiceImpl.java @@ -11,6 +11,7 @@ import cn.com.tenlion.systembase.pojo.vos.comprehensivecenter.ComprehensiveCente import cn.com.tenlion.systembase.pojo.vos.keyareacheckrenovation.KeyAreaCheckRenovationVO; import cn.com.tenlion.systembase.service.grid.IGridService; import cn.com.tenlion.systembase.service.keyareacheckrenovation.IKeyAreaCheckRenovationService; +import cn.com.tenlion.systembase.util.VerifyUtil; import com.alibaba.fastjson.JSONObject; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.pojo.ListPage; @@ -164,6 +165,18 @@ public class KeyAreaCheckRenovationServiceImpl extends DefaultBaseService implem @Override public List list(Map params) { + if(params.get("areaCodeLike") != null && !"".equals(params.get("areaCodeLike").toString())){ + String areaCoed = params.get("areaCodeLike").toString(); + String[] areaCodeSplit = VerifyUtil.splitStringByLength(areaCoed, 2); + String areaCodeLike = ""; + for(int i = 5 ; i >= 0; i--){ + if(!"00".equals(areaCodeSplit[i])){ + areaCodeLike = areaCoed.substring(0, (i + 1) * 2); + break; + } + } + params.put("areaCodeLike",areaCodeLike); + } return keyAreaCheckRenovationDao.list(params); } diff --git a/src/main/java/cn/com/tenlion/systembase/service/keyplace/impl/KeyPlaceServiceImpl.java b/src/main/java/cn/com/tenlion/systembase/service/keyplace/impl/KeyPlaceServiceImpl.java index f56b047..66e5b98 100644 --- a/src/main/java/cn/com/tenlion/systembase/service/keyplace/impl/KeyPlaceServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systembase/service/keyplace/impl/KeyPlaceServiceImpl.java @@ -9,6 +9,7 @@ import cn.com.tenlion.systembase.pojo.pos.keyplace.KeyPlacePO; import cn.com.tenlion.systembase.pojo.vos.keyplace.KeyPlaceVO; import cn.com.tenlion.systembase.service.grid.IGridService; import cn.com.tenlion.systembase.service.keyplace.IKeyPlaceService; +import cn.com.tenlion.systembase.util.VerifyUtil; import com.alibaba.fastjson.JSONObject; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.pojo.ListPage; @@ -162,6 +163,18 @@ public class KeyPlaceServiceImpl extends DefaultBaseService implements IKeyPlace @Override public List list(Map params) { + if(params.get("areaCodeLike") != null && !"".equals(params.get("areaCodeLike").toString())){ + String areaCoed = params.get("areaCodeLike").toString(); + String[] areaCodeSplit = VerifyUtil.splitStringByLength(areaCoed, 2); + String areaCodeLike = ""; + for(int i = 5 ; i >= 0; i--){ + if(!"00".equals(areaCodeSplit[i])){ + areaCodeLike = areaCoed.substring(0, (i + 1) * 2 ); + break; + } + } + params.put("areaCodeLike",areaCodeLike); + } return keyPlaceDao.list(params); } diff --git a/src/main/java/cn/com/tenlion/systembase/service/linecase/impl/LineCaseServiceImpl.java b/src/main/java/cn/com/tenlion/systembase/service/linecase/impl/LineCaseServiceImpl.java index f2e26a8..1f51c22 100644 --- a/src/main/java/cn/com/tenlion/systembase/service/linecase/impl/LineCaseServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systembase/service/linecase/impl/LineCaseServiceImpl.java @@ -8,6 +8,7 @@ import cn.com.tenlion.systembase.pojo.pos.linecase.LineCasePO; import cn.com.tenlion.systembase.pojo.vos.linecase.LineCaseVO; import cn.com.tenlion.systembase.service.grid.IGridService; import cn.com.tenlion.systembase.service.linecase.ILineCaseService; +import cn.com.tenlion.systembase.util.VerifyUtil; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.result.SuccessResultList; @@ -151,6 +152,18 @@ public class LineCaseServiceImpl extends DefaultBaseService implements ILineCase @Override public List list(Map params) { + if(params.get("areaCodeLike") != null && !"".equals(params.get("areaCodeLike").toString())){ + String areaCoed = params.get("areaCodeLike").toString(); + String[] areaCodeSplit = VerifyUtil.splitStringByLength(areaCoed, 2); + String areaCodeLike = ""; + for(int i = 5 ; i >= 0; i--){ + if(!"00".equals(areaCodeSplit[i])){ + areaCodeLike = areaCoed.substring(0, (i + 1) * 2 ); + break; + } + } + params.put("areaCodeLike",areaCodeLike); + } return lineCaseDao.list(params); } diff --git a/src/main/java/cn/com/tenlion/systembase/service/logisticssafe/impl/LogisticsSafeServiceImpl.java b/src/main/java/cn/com/tenlion/systembase/service/logisticssafe/impl/LogisticsSafeServiceImpl.java index 5b45e60..9bd1dcc 100644 --- a/src/main/java/cn/com/tenlion/systembase/service/logisticssafe/impl/LogisticsSafeServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systembase/service/logisticssafe/impl/LogisticsSafeServiceImpl.java @@ -8,6 +8,7 @@ import cn.com.tenlion.systembase.pojo.pos.logisticssafe.LogisticsSafePO; import cn.com.tenlion.systembase.pojo.vos.logisticssafe.LogisticsSafeVO; import cn.com.tenlion.systembase.service.grid.IGridService; import cn.com.tenlion.systembase.service.logisticssafe.ILogisticsSafeService; +import cn.com.tenlion.systembase.util.VerifyUtil; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.result.SuccessResultList; @@ -169,6 +170,18 @@ public class LogisticsSafeServiceImpl extends DefaultBaseService implements ILog @Override public List list(Map params) { + if(params.get("areaCodeLike") != null && !"".equals(params.get("areaCodeLike").toString())){ + String areaCoed = params.get("areaCodeLike").toString(); + String[] areaCodeSplit = VerifyUtil.splitStringByLength(areaCoed, 2); + String areaCodeLike = ""; + for(int i = 5 ; i >= 0; i--){ + if(!"00".equals(areaCodeSplit[i])){ + areaCodeLike = areaCoed.substring(0, (i + 1) * 2 ); + break; + } + } + params.put("areaCodeLike",areaCodeLike); + } return logisticsSafeDao.list(params); } diff --git a/src/main/java/cn/com/tenlion/systembase/service/publicvideo/impl/PublicVideoServiceImpl.java b/src/main/java/cn/com/tenlion/systembase/service/publicvideo/impl/PublicVideoServiceImpl.java index 9ccfeed..02d2fed 100644 --- a/src/main/java/cn/com/tenlion/systembase/service/publicvideo/impl/PublicVideoServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systembase/service/publicvideo/impl/PublicVideoServiceImpl.java @@ -8,6 +8,7 @@ import cn.com.tenlion.systembase.pojo.pos.publicvideo.PublicVideoPO; import cn.com.tenlion.systembase.pojo.vos.publicvideo.PublicVideoVO; import cn.com.tenlion.systembase.service.grid.IGridService; import cn.com.tenlion.systembase.service.publicvideo.IPublicVideoService; +import cn.com.tenlion.systembase.util.VerifyUtil; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.result.SuccessResultList; @@ -151,6 +152,18 @@ public class PublicVideoServiceImpl extends DefaultBaseService implements IPubli @Override public List list(Map params) { + if(params.get("areaCodeLike") != null && !"".equals(params.get("areaCodeLike").toString())){ + String areaCoed = params.get("areaCodeLike").toString(); + String[] areaCodeSplit = VerifyUtil.splitStringByLength(areaCoed, 2); + String areaCodeLike = ""; + for(int i = 5 ; i >= 0; i--){ + if(!"00".equals(areaCodeSplit[i])){ + areaCodeLike = areaCoed.substring(0, (i + 1) * 2 ); + break; + } + } + params.put("areaCodeLike",areaCodeLike); + } return publicVideoDao.list(params); } diff --git a/src/main/java/cn/com/tenlion/systembase/util/VerifyUtil.java b/src/main/java/cn/com/tenlion/systembase/util/VerifyUtil.java index 00bce13..5f5b2bb 100644 --- a/src/main/java/cn/com/tenlion/systembase/util/VerifyUtil.java +++ b/src/main/java/cn/com/tenlion/systembase/util/VerifyUtil.java @@ -17,4 +17,25 @@ public class VerifyUtil { return false; } + + public static String[] splitStringByLength(String src, int length) { + //检查参数是否合法 + if (null == src || src.equals("")) { + return null; + } + if (length <= 0) { + return null; + } + //获取整个字符串可以被切割成字符子串的个数 + int n = (src.length() + length - 1) / length; + String[] split = new String[n]; + for (int i = 0; i < n; i++) { + if (i < (n -1)) { + split[i] = src.substring(i * length, (i + 1) * length); + } else { + split[i] = src.substring(i * length); + } + } + return split; + } } diff --git a/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml b/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml index b21fd2d..7366381 100644 --- a/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml +++ b/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml @@ -816,6 +816,9 @@ AND t1.area_code = #{areaCode} + + AND t1.area_code LIKE CONCAT(#{areaCodeLike}, '%') + AND t1.grid_code = #{gridCode} diff --git a/src/main/resources/mybatis/mapper/homicide/homicide-mapper.xml b/src/main/resources/mybatis/mapper/homicide/homicide-mapper.xml index dd85146..d4238df 100644 --- a/src/main/resources/mybatis/mapper/homicide/homicide-mapper.xml +++ b/src/main/resources/mybatis/mapper/homicide/homicide-mapper.xml @@ -256,6 +256,9 @@ AND t1.happen_location_code = #{areaCode} + + AND t1.happen_location_code LIKE CONCAT(#{areaCodeLike}, '%') + AND t1.grid = #{grid} diff --git a/src/main/resources/mybatis/mapper/importantevent/important-event-mapper.xml b/src/main/resources/mybatis/mapper/importantevent/important-event-mapper.xml index fa1636a..4b04492 100644 --- a/src/main/resources/mybatis/mapper/importantevent/important-event-mapper.xml +++ b/src/main/resources/mybatis/mapper/importantevent/important-event-mapper.xml @@ -295,6 +295,9 @@ AND t1.location_code = #{areaCode} + + AND t1.location_code LIKE CONCAT(#{areaCodeLike}, '%') + AND t1.grid = #{grid} diff --git a/src/main/resources/mybatis/mapper/keyareacheckrenovation/key-area-check-renovation-mapper.xml b/src/main/resources/mybatis/mapper/keyareacheckrenovation/key-area-check-renovation-mapper.xml index 7d40060..8b1d052 100644 --- a/src/main/resources/mybatis/mapper/keyareacheckrenovation/key-area-check-renovation-mapper.xml +++ b/src/main/resources/mybatis/mapper/keyareacheckrenovation/key-area-check-renovation-mapper.xml @@ -402,6 +402,9 @@ AND t1.location_code = #{areaCode} + + AND t1.location_code LIKE CONCAT(#{areaCodeLike}, '%') + AND t1.grid = #{grid} diff --git a/src/main/resources/mybatis/mapper/keyplace/key-place-mapper.xml b/src/main/resources/mybatis/mapper/keyplace/key-place-mapper.xml index 6dd7ea4..1318a44 100644 --- a/src/main/resources/mybatis/mapper/keyplace/key-place-mapper.xml +++ b/src/main/resources/mybatis/mapper/keyplace/key-place-mapper.xml @@ -348,6 +348,9 @@ AND t1.area_code = #{areaCode} + + AND t1.area_code LIKE CONCAT(#{areaCodeLike}, '%') + AND t1.grid = #{grid} diff --git a/src/main/resources/mybatis/mapper/linecase/line-case-mapper.xml b/src/main/resources/mybatis/mapper/linecase/line-case-mapper.xml index ca38562..e021dfe 100644 --- a/src/main/resources/mybatis/mapper/linecase/line-case-mapper.xml +++ b/src/main/resources/mybatis/mapper/linecase/line-case-mapper.xml @@ -383,6 +383,9 @@ AND t1.location_code = #{areaCode} + + AND t1.location_code LIKE CONCAT(#{areaCodeLike}, '%') + AND t1.grid = #{grid} diff --git a/src/main/resources/mybatis/mapper/logisticssafe/logistics-safe-mapper.xml b/src/main/resources/mybatis/mapper/logisticssafe/logistics-safe-mapper.xml index 73cf085..45d1763 100644 --- a/src/main/resources/mybatis/mapper/logisticssafe/logistics-safe-mapper.xml +++ b/src/main/resources/mybatis/mapper/logisticssafe/logistics-safe-mapper.xml @@ -501,6 +501,9 @@ AND t1.enterprise_location_code = #{areaCode} + + AND t1.enterprise_location_code LIKE CONCAT(#{areaCodeLike}, '%') + AND t1.grid = #{grid} diff --git a/src/main/resources/mybatis/mapper/publicvideo/public-video-mapper.xml b/src/main/resources/mybatis/mapper/publicvideo/public-video-mapper.xml index 836bf38..da16a6e 100644 --- a/src/main/resources/mybatis/mapper/publicvideo/public-video-mapper.xml +++ b/src/main/resources/mybatis/mapper/publicvideo/public-video-mapper.xml @@ -274,6 +274,9 @@ AND t1.location_code = #{areaCode} + + AND t1.location_code LIKE CONCAT(#{areaCodeLike}, '%') + AND t1.grid = #{grid}