From 9eb150d89028c1f66a49cdf1a1afc20453b419aa Mon Sep 17 00:00:00 2001 From: wanggeng888 <450292408@qq.com> Date: Thu, 17 Jun 2021 11:53:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BD=91=E6=A0=BC=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../communityboss/CommunityBossController.java | 4 ++-- .../dtos/communityboss/CommunityBossDTO.java | 11 +++++++++++ .../impl/CommunityBossServiceImpl.java | 12 ++++++++++++ .../communityboss/communityboss-mapper.xml | 13 ++++++++++++- .../static/route/communityboss/list.html | 11 ++++++++++- .../static/route/communityboss/list_level2.html | 11 ++++++++++- .../static/route/communityboss/list_level3.html | 12 ++++++++++-- .../static/route/communityboss/list_level4.html | 11 ++++++++++- .../static/route/communityboss/list_level5.html | 11 ++++++++++- .../static/route/communityboss/save.html | 12 +++++++++--- .../static/route/communityboss/update.html | 16 +++++++++++----- 11 files changed, 107 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/cm/systemcity/controller/apis/communityboss/CommunityBossController.java b/src/main/java/com/cm/systemcity/controller/apis/communityboss/CommunityBossController.java index 570bd18..afb201f 100755 --- a/src/main/java/com/cm/systemcity/controller/apis/communityboss/CommunityBossController.java +++ b/src/main/java/com/cm/systemcity/controller/apis/communityboss/CommunityBossController.java @@ -122,8 +122,8 @@ public class CommunityBossController extends AbstractController { } params.put("communityBossParentId", StringUtils.isBlank(communityBossVO.getCommunityBossParentId()) ? "0" : communityBossVO.getCommunityBossParentId()); - params.put("communityBossParentUserId", StringUtils.isBlank(communityBossVO.getCommunityBossParentUserId()) ? "0" : communityBossVO.getCommunityBossParentUserId()); - + params.put("communityBossParentUserId", StringUtils.isBlank(communityBossVO.getCommunityBossParentUserId()) ? "0" : communityBossVO.getCommunityBossParentUserId()); + params.put("gridSummary", communityBossVO.getGridSummary()); params.put("districtId", communityBossVO.getDistrictId() == null ? "" : communityBossVO.getDistrictId()); params.put("districtName", communityBossVO.getDistrictName() == null ? "" : communityBossVO.getDistrictName()); diff --git a/src/main/java/com/cm/systemcity/pojo/dtos/communityboss/CommunityBossDTO.java b/src/main/java/com/cm/systemcity/pojo/dtos/communityboss/CommunityBossDTO.java index 481e3c9..2f23acf 100755 --- a/src/main/java/com/cm/systemcity/pojo/dtos/communityboss/CommunityBossDTO.java +++ b/src/main/java/com/cm/systemcity/pojo/dtos/communityboss/CommunityBossDTO.java @@ -54,6 +54,9 @@ public class CommunityBossDTO implements Serializable { @ApiModelProperty(name = "buildings", value = "楼宇列表") private List buildings; + @ApiModelProperty(name = "gridSummary", value = "网格描述") + private String gridSummary; + public String getCommunityBossId() { return communityBossId == null ? "" : communityBossId.trim(); } @@ -190,4 +193,12 @@ public class CommunityBossDTO implements Serializable { public void setBuildings(List buildings) { this.buildings = buildings; } + + public String getGridSummary() { + return gridSummary == null ? "" : gridSummary; + } + + public void setGridSummary(String gridSummary) { + this.gridSummary = gridSummary; + } } \ No newline at end of file diff --git a/src/main/java/com/cm/systemcity/service/communityboss/impl/CommunityBossServiceImpl.java b/src/main/java/com/cm/systemcity/service/communityboss/impl/CommunityBossServiceImpl.java index fa34045..1129dae 100755 --- a/src/main/java/com/cm/systemcity/service/communityboss/impl/CommunityBossServiceImpl.java +++ b/src/main/java/com/cm/systemcity/service/communityboss/impl/CommunityBossServiceImpl.java @@ -60,6 +60,10 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun @Override public SuccessResult saveCommunityBoss(Map params) throws SaveException, SearchException { + CommunityBossDTO communityBossDTO = getByUserIdAndLevel(params.get("communityBossUserId").toString(), params.get("communityBossLevel").toString()); + if (communityBossDTO != null) { + throw new SearchException("已经是该级别片长,无需重复添加"); + } String communityBossId = UUIDUtil.getUUID(); params.put("communityBossId", communityBossId); setSaveInfo(params); @@ -82,6 +86,13 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun return new SuccessResult(); } + private CommunityBossDTO getByUserIdAndLevel(String communityBossUserId, String communityBossLevel) { + Map params = getHashMap(4); + params.put("communityBossUserId", communityBossUserId); + params.put("communityBossLevel", communityBossLevel); + return getCommunityBossDTO(params); + } + @Override public SuccessResult removeCommunityBoss(Map params) throws RemoveException { params.put("communityBossIds", Arrays.asList(params.get("communityBossIds").toString().split("_"))); @@ -187,6 +198,7 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun /** * 设置用户 + * * @param communityBossDTO */ private void setUserInfo(CommunityBossDTO communityBossDTO) { diff --git a/src/main/resources/mybatis/mapper/communityboss/communityboss-mapper.xml b/src/main/resources/mybatis/mapper/communityboss/communityboss-mapper.xml index 7a56356..ed61a34 100755 --- a/src/main/resources/mybatis/mapper/communityboss/communityboss-mapper.xml +++ b/src/main/resources/mybatis/mapper/communityboss/communityboss-mapper.xml @@ -17,6 +17,7 @@ + @@ -215,6 +216,14 @@ AND t1.community_boss_id = #{communityBossId} + + AND + t1.community_boss_user_id = #{communityBossUserId} + + + AND + t1.community_boss_level = #{communityBossLevel} + @@ -329,6 +338,7 @@ t1.community_boss_level, t1.area_id, t1.area_name, + t1.grid_summary, GROUP_CONCAT(t3.community_id) community_ids, GROUP_CONCAT(t3.community_name) community_names FROM @@ -344,7 +354,8 @@ t1.community_boss_parent_user_id, t1.community_boss_level, t1.area_id, - t1.area_name + t1.area_name, + t1.grid_summary ) mt1 WHERE 1 = 1 diff --git a/src/main/resources/static/route/communityboss/list.html b/src/main/resources/static/route/communityboss/list.html index c379499..460d6e8 100755 --- a/src/main/resources/static/route/communityboss/list.html +++ b/src/main/resources/static/route/communityboss/list.html @@ -129,7 +129,7 @@ closeBtn: 0, area: ['100%', '100%'], shadeClose: true, - anim: 1, + anim: 2, content: top.restAjax.path('route/communityboss/update.html?communityBossId={id}', [id]), end: function() { reloadTable(); @@ -230,6 +230,15 @@ return rowData; } }, + {field: 'gridSummary', width: 200, title: '网格描述', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + return '-'; + } + return rowData; + } + }, ]], page: true, parseData: function(data) { diff --git a/src/main/resources/static/route/communityboss/list_level2.html b/src/main/resources/static/route/communityboss/list_level2.html index ba686a4..03f1827 100755 --- a/src/main/resources/static/route/communityboss/list_level2.html +++ b/src/main/resources/static/route/communityboss/list_level2.html @@ -244,7 +244,16 @@ rowData = communitiesFormatter(rowData); return rowData; } - } + }, + {field: 'gridSummary', width: 200, title: '网格描述', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + return '-'; + } + return rowData; + } + }, ]], page: true, parseData: function(data) { diff --git a/src/main/resources/static/route/communityboss/list_level3.html b/src/main/resources/static/route/communityboss/list_level3.html index 3ce6032..5766a69 100755 --- a/src/main/resources/static/route/communityboss/list_level3.html +++ b/src/main/resources/static/route/communityboss/list_level3.html @@ -257,8 +257,16 @@ rowData = districtFormatter(rowData); return rowData; } - } - + }, + {field: 'gridSummary', width: 200, title: '网格描述', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + return '-'; + } + return rowData; + } + }, ]], page: true, diff --git a/src/main/resources/static/route/communityboss/list_level4.html b/src/main/resources/static/route/communityboss/list_level4.html index 42e6afa..2f2f4fd 100644 --- a/src/main/resources/static/route/communityboss/list_level4.html +++ b/src/main/resources/static/route/communityboss/list_level4.html @@ -290,7 +290,16 @@ rowData = buildingFormatter(rowData); return rowData; } - } + }, + {field: 'gridSummary', width: 200, title: '网格描述', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + return '-'; + } + return rowData; + } + }, ]], page: true, parseData: function(data) { diff --git a/src/main/resources/static/route/communityboss/list_level5.html b/src/main/resources/static/route/communityboss/list_level5.html index 642868a..e257bdf 100644 --- a/src/main/resources/static/route/communityboss/list_level5.html +++ b/src/main/resources/static/route/communityboss/list_level5.html @@ -292,7 +292,16 @@ rowData = buildingFormatter(rowData); return rowData; } - } + }, + {field: 'gridSummary', width: 200, title: '网格描述', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + return '-'; + } + return rowData; + } + }, ]], page: true, parseData: function(data) { diff --git a/src/main/resources/static/route/communityboss/save.html b/src/main/resources/static/route/communityboss/save.html index ccb9985..aa12858 100755 --- a/src/main/resources/static/route/communityboss/save.html +++ b/src/main/resources/static/route/communityboss/save.html @@ -11,7 +11,7 @@ -
+
@@ -70,7 +70,12 @@
- +
+ +
+ +
+