From bdb1bb71c56156b522605a53823fe1f3c0ea8977 Mon Sep 17 00:00:00 2001 From: wanggeng888 <450292408@qq.com> Date: Thu, 17 Jun 2021 11:16:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CommunityBossServiceImpl.java | 15 ++-- .../static/route/communityboss/save.html | 70 +++++++++++-------- .../static/route/communityboss/update.html | 49 +++++++------ .../static/route/news/save_daily.html | 41 ++++++----- .../static/route/news/save_notice.html | 41 ++++++----- .../static/route/news/save_propaganda.html | 41 ++++++----- .../static/route/news/update_daily.html | 39 ++++++----- .../static/route/news/update_notice.html | 39 ++++++----- .../static/route/news/update_propaganda.html | 39 ++++++----- 9 files changed, 200 insertions(+), 174 deletions(-) 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 935bb29..fa34045 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,26 +60,23 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun @Override public SuccessResult saveCommunityBoss(Map params) throws SaveException, SearchException { - Map communityBossParams = new HashMap<>(); - params.put("communityBossId", UUIDUtil.getUUID()); + String communityBossId = UUIDUtil.getUUID(); + params.put("communityBossId", communityBossId); setSaveInfo(params); communityBossDao.saveCommunityBoss(params); LOG.debug("绑定片长和社区关系"); if (params.get("communityId") != null && !StringUtils.isBlank(params.get("communityId").toString())) { String[] communityIds = params.get("communityId").toString().split(","); - String communityBossId = params.get("communityBossId").toString(); saveCommunityBossCommunity(communityBossId, communityIds); } LOG.debug("绑定片长和小区关系"); if (params.get("districtId") != null && !StringUtils.isBlank(params.get("districtId").toString())) { String[] districtIds = params.get("districtId").toString().split(","); - String communityBossId = params.get("communityBossId").toString(); saveCommunityBossDistrict(communityBossId, districtIds); } LOG.debug("绑定片长和楼宇关系"); if (params.get("buildingId") != null && !StringUtils.isBlank(params.get("buildingId").toString())) { String[] buildingIds = params.get("buildingId").toString().split(","); - String communityBossId = params.get("communityBossId").toString(); saveCommunityBossBuilding(communityBossId, buildingIds); } return new SuccessResult(); @@ -262,7 +259,7 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun } Set communityBossIds = new HashSet<>(); for (CommunityBossDTO communityBossDTO : communityBossDTOs) { - communityBossIds.add(communityBossDTO.getCommunityBossUserId()); + communityBossIds.add(communityBossDTO.getCommunityBossId()); } Map params = getHashMap(2); params.put("communityBossIds", new ArrayList<>(communityBossIds)); @@ -271,7 +268,7 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun for (CommunityDTO communityDTO : communityDTOs) { if (StringUtils.equals(communityBossDTO.getCommunityBossId(), communityDTO.getCommunityBossId())) { List communities = communityBossDTO.getCommunities(); - communityDTOs.add(communityDTO); + communities.add(communityDTO); communityBossDTO.setCommunities(communities); } } @@ -414,7 +411,7 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun } Set communityBossIds = new HashSet<>(); for (CommunityBossDTO communityBossDTO : communityBossDTOs) { - communityBossIds.add(communityBossDTO.getCommunityBossUserId()); + communityBossIds.add(communityBossDTO.getCommunityBossId()); } Map params = getHashMap(2); params.put("communityBossIds", new ArrayList<>(communityBossIds)); @@ -494,7 +491,7 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun } Set communityBossIds = new HashSet<>(); for (CommunityBossDTO communityBossDTO : communityBossDTOs) { - communityBossIds.add(communityBossDTO.getCommunityBossUserId()); + communityBossIds.add(communityBossDTO.getCommunityBossId()); } Map params = getHashMap(2); params.put("communityBossIds", new ArrayList<>(communityBossIds)); diff --git a/src/main/resources/static/route/communityboss/save.html b/src/main/resources/static/route/communityboss/save.html index 6e4e4d7..ccb9985 100755 --- a/src/main/resources/static/route/communityboss/save.html +++ b/src/main/resources/static/route/communityboss/save.html @@ -33,6 +33,7 @@
+
@@ -226,30 +227,33 @@ form.on('submit(submitForm)', function(formData) { var loadLayerIndex; - formData.field['communityBossLevel'] = formObject.communityBossLevel; - top.restAjax.post(top.restAjax.path('api/communityboss/savecommunityboss', []), formData.field, null, function(code, data) { - // success - var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { - time: 0, - btn: [top.dataMessage.button.yes, top.dataMessage.button.no], - shade: 0.3, - yes: function() { - top.dialog.close(layerIndex); - window.location.reload(); - }, - btn2: function() { - closeBox(); - } + top.dialog.confirm(top.dataMessage.commit, function(index) { + top.dialog.close(index); + formData.field['communityBossLevel'] = formObject.communityBossLevel; + top.restAjax.post(top.restAjax.path('api/communityboss/savecommunityboss', []), formData.field, null, function (code, data) { + // success + var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { + time: 0, + btn: [top.dataMessage.button.yes, top.dataMessage.button.no], + shade: 0.3, + yes: function () { + top.dialog.close(layerIndex); + window.location.reload(); + }, + btn2: function () { + closeBox(); + } + }); + }, function (code, data) { + // error + top.dialog.msg(data.msg); + }, function () { + // before + loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); + }, function () { + // complete + top.dialog.close(loadLayerIndex); }); - }, function(code, data) { - // error - top.dialog.msg(data.msg); - }, function() { - // before - loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); - }, function() { - // complete - top.dialog.close(loadLayerIndex); }); return false; }) @@ -344,6 +348,7 @@ for(var i = 0, item = childNodes[i]; item = childNodes[i++];) { item.name = item.communityBossName; item.id = item.communityBossUserId; + item.title = item.communityBossId; } return childNodes; }, @@ -351,7 +356,7 @@ { id: formObject.communityBossParentUserId, name: formObject.communityBossParentName, - title: formObject.communityBossParentName + title: formObject.communityBossId } ], onClose: function() { @@ -359,17 +364,21 @@ if(typeof(selectNodes) != 'undefined' && selectNodes != null) { if(selectNodes.length > 0) { var selectedNode = selectNodes[0]; + formObject.communityBossParentId = selectedNode.title; formObject.communityBossParentUserId = selectedNode.id; formObject.communityBossParentName = selectedNode.name; communityBossParentUserIdChange(); + $('#communityBossParentId').val(selectedNode.title); $('#communityBossParentUserId').val(selectedNode.id); $('#communityBossParentName').val(selectedNode.name); } else { + formObject.communityBossParentId = null; formObject.communityBossParentUserId = null; formObject.communityBossParentName = null; communityBossParentUserIdChange(); - $('#communityBossParentUserId').val(); - $('#communityBossParentName').val(); + $('#communityBossParentId').val(''); + $('#communityBossParentUserId').val(''); + $('#communityBossParentName').val(''); } } } @@ -391,13 +400,13 @@ areaId: formObject.areaId } } else if(formObject.communityBossLevel == '3') { - apiUri = top.restAjax.path('api/communityboss/listcommunitybosscommunity/{communityBossUserId}', [formObject.communityBossParentUserId]); + apiUri = top.restAjax.path('api/communityboss/listcommunitybosscommunity/{communityBossId}', [formObject.communityBossParentId]); otherParams = {} } else if(formObject.communityBossLevel == '4') { - apiUri = top.restAjax.path('api/communityboss/listcommunitybosscommunity/{communityBossUserId}', [formObject.communityBossParentUserId]); + apiUri = top.restAjax.path('api/communityboss/listcommunitybosscommunity/{communityBossId}', [formObject.communityBossParentId]); otherParams = {} } else if(formObject.communityBossLevel == '5') { - apiUri = top.restAjax.path('api/communityboss/listcommunitybosscommunity/{communityBossUserId}', [formObject.communityBossParentUserId]); + apiUri = top.restAjax.path('api/communityboss/listcommunitybosscommunity/{communityBossId}', [formObject.communityBossParentId]); otherParams = {} } else { return; @@ -489,8 +498,7 @@ } top.dialog.tree({ title: '选择楼宇', - apiUri: top.restAjax.path('api/citybuilding/listCityBuildingByDistrictIds/{districtId' + - '}', [formObject.districtId]), + apiUri: top.restAjax.path('api/citybuilding/listCityBuildingByDistrictIds/{districtId}', [formObject.districtId]), width: '200px', height: '400px', otherParams: {}, diff --git a/src/main/resources/static/route/communityboss/update.html b/src/main/resources/static/route/communityboss/update.html index 2d737f1..6ed5933 100755 --- a/src/main/resources/static/route/communityboss/update.html +++ b/src/main/resources/static/route/communityboss/update.html @@ -344,30 +344,33 @@ form.on('submit(submitForm)', function(formData) { var loadLayerIndex; - formData.field['communityBossLevel'] = formObject.communityBossLevel; - top.restAjax.put(top.restAjax.path('api/communityboss/updatecommunityboss/{communityBossId}', [communityBossId]), formData.field, null, function(code, data) { - // success - var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { - time: 0, - btn: [top.dataMessage.button.yes, top.dataMessage.button.no], - shade: 0.3, - yes: function() { - top.dialog.close(layerIndex); - window.location.reload(); - }, - btn2: function() { - closeBox(); - } + top.dialog.confirm(top.dataMessage.commit, function(index) { + top.dialog.close(index); + formData.field['communityBossLevel'] = formObject.communityBossLevel; + top.restAjax.put(top.restAjax.path('api/communityboss/updatecommunityboss/{communityBossId}', [communityBossId]), formData.field, null, function (code, data) { + // success + var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { + time: 0, + btn: [top.dataMessage.button.yes, top.dataMessage.button.no], + shade: 0.3, + yes: function () { + top.dialog.close(layerIndex); + window.location.reload(); + }, + btn2: function () { + closeBox(); + } + }); + }, function (code, data) { + // error + top.dialog.msg(data.msg); + }, function () { + // before + loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); + }, function () { + // complete + top.dialog.close(loadLayerIndex); }); - }, function(code, data) { - // error - top.dialog.msg(data.msg); - }, function() { - // before - loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); - }, function() { - // complete - top.dialog.close(loadLayerIndex); }); return false; }) diff --git a/src/main/resources/static/route/news/save_daily.html b/src/main/resources/static/route/news/save_daily.html index 77cdbb6..1618660 100755 --- a/src/main/resources/static/route/news/save_daily.html +++ b/src/main/resources/static/route/news/save_daily.html @@ -112,26 +112,29 @@ form.on('submit(submitForm)', function(formData) { var loadLayerIndex; - formData.field['newsType'] = newsType; - top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function(code, data) { - var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { - time: 0, - btn: [top.dataMessage.button.yes, top.dataMessage.button.no], - shade: 0.3, - yes: function() { - top.dialog.close(layerIndex); - window.location.reload(); - }, - btn2: function() { - closeBox(); - } + top.dialog.confirm(top.dataMessage.commit, function(index) { + top.dialog.close(index); + formData.field['newsType'] = newsType; + top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function (code, data) { + var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { + time: 0, + btn: [top.dataMessage.button.yes, top.dataMessage.button.no], + shade: 0.3, + yes: function () { + top.dialog.close(layerIndex); + window.location.reload(); + }, + btn2: function () { + closeBox(); + } + }); + }, function (code, data) { + top.dialog.msg(data.msg); + }, function () { + loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); + }, function () { + top.dialog.close(loadLayerIndex); }); - }, function(code, data) { - top.dialog.msg(data.msg); - }, function() { - loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); - }, function() { - top.dialog.close(loadLayerIndex); }); }) diff --git a/src/main/resources/static/route/news/save_notice.html b/src/main/resources/static/route/news/save_notice.html index 336fec6..21203b4 100755 --- a/src/main/resources/static/route/news/save_notice.html +++ b/src/main/resources/static/route/news/save_notice.html @@ -153,26 +153,29 @@ form.on('submit(submitForm)', function(formData) { var loadLayerIndex; - formData.field['newsType'] = newsType; - top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function(code, data) { - var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { - time: 0, - btn: [top.dataMessage.button.yes, top.dataMessage.button.no], - shade: 0.3, - yes: function() { - top.dialog.close(layerIndex); - window.location.reload(); - }, - btn2: function() { - closeBox(); - } + top.dialog.confirm(top.dataMessage.commit, function(index) { + top.dialog.close(index); + formData.field['newsType'] = newsType; + top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function (code, data) { + var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { + time: 0, + btn: [top.dataMessage.button.yes, top.dataMessage.button.no], + shade: 0.3, + yes: function () { + top.dialog.close(layerIndex); + window.location.reload(); + }, + btn2: function () { + closeBox(); + } + }); + }, function (code, data) { + top.dialog.msg(data.msg); + }, function () { + loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); + }, function () { + top.dialog.close(loadLayerIndex); }); - }, function(code, data) { - top.dialog.msg(data.msg); - }, function() { - loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); - }, function() { - top.dialog.close(loadLayerIndex); }); }) diff --git a/src/main/resources/static/route/news/save_propaganda.html b/src/main/resources/static/route/news/save_propaganda.html index 8688b00..8ac0bf7 100755 --- a/src/main/resources/static/route/news/save_propaganda.html +++ b/src/main/resources/static/route/news/save_propaganda.html @@ -111,26 +111,29 @@ form.on('submit(submitForm)', function(formData) { var loadLayerIndex; - formData.field['newsType'] = newsType; - top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function(code, data) { - var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { - time: 0, - btn: [top.dataMessage.button.yes, top.dataMessage.button.no], - shade: 0.3, - yes: function() { - top.dialog.close(layerIndex); - window.location.reload(); - }, - btn2: function() { - closeBox(); - } + top.dialog.confirm(top.dataMessage.commit, function(index) { + top.dialog.close(index); + formData.field['newsType'] = newsType; + top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function (code, data) { + var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { + time: 0, + btn: [top.dataMessage.button.yes, top.dataMessage.button.no], + shade: 0.3, + yes: function () { + top.dialog.close(layerIndex); + window.location.reload(); + }, + btn2: function () { + closeBox(); + } + }); + }, function (code, data) { + top.dialog.msg(data.msg); + }, function () { + loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); + }, function () { + top.dialog.close(loadLayerIndex); }); - }, function(code, data) { - top.dialog.msg(data.msg); - }, function() { - loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); - }, function() { - top.dialog.close(loadLayerIndex); }); }) diff --git a/src/main/resources/static/route/news/update_daily.html b/src/main/resources/static/route/news/update_daily.html index 6aa18ad..10cfe43 100755 --- a/src/main/resources/static/route/news/update_daily.html +++ b/src/main/resources/static/route/news/update_daily.html @@ -132,25 +132,28 @@ form.on('submit(submitForm)', function(formData) { formData.field['newsType'] = newsType; var loadLayerIndex; - top.restAjax.put(top.restAjax.path('api/news/updatenews/{newsId}', [newsId]), formData.field, null, function(code, data) { - var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { - time: 0, - btn: [top.dataMessage.button.yes, top.dataMessage.button.no], - shade: 0.3, - yes: function() { - top.dialog.close(layerIndex); - window.location.reload(); - }, - btn2: function() { - closeBox(); - } + top.dialog.confirm(top.dataMessage.commit, function(index) { + top.dialog.close(index); + top.restAjax.put(top.restAjax.path('api/news/updatenews/{newsId}', [newsId]), formData.field, null, function (code, data) { + var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { + time: 0, + btn: [top.dataMessage.button.yes, top.dataMessage.button.no], + shade: 0.3, + yes: function () { + top.dialog.close(layerIndex); + window.location.reload(); + }, + btn2: function () { + closeBox(); + } + }); + }, function (code, data) { + top.dialog.msg(data.msg); + }, function () { + loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); + }, function () { + top.dialog.close(loadLayerIndex); }); - }, function(code, data) { - top.dialog.msg(data.msg); - }, function() { - loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); - }, function() { - top.dialog.close(loadLayerIndex); }); }) diff --git a/src/main/resources/static/route/news/update_notice.html b/src/main/resources/static/route/news/update_notice.html index cd0a5a6..510ec4e 100755 --- a/src/main/resources/static/route/news/update_notice.html +++ b/src/main/resources/static/route/news/update_notice.html @@ -176,25 +176,28 @@ form.on('submit(submitForm)', function(formData) { formData.field['newsType'] = newsType; var loadLayerIndex; - top.restAjax.put(top.restAjax.path('api/news/updatenews/{newsId}', [newsId]), formData.field, null, function(code, data) { - var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { - time: 0, - btn: [top.dataMessage.button.yes, top.dataMessage.button.no], - shade: 0.3, - yes: function() { - top.dialog.close(layerIndex); - window.location.reload(); - }, - btn2: function() { - closeBox(); - } + top.dialog.confirm(top.dataMessage.commit, function(index) { + top.dialog.close(index); + top.restAjax.put(top.restAjax.path('api/news/updatenews/{newsId}', [newsId]), formData.field, null, function (code, data) { + var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { + time: 0, + btn: [top.dataMessage.button.yes, top.dataMessage.button.no], + shade: 0.3, + yes: function () { + top.dialog.close(layerIndex); + window.location.reload(); + }, + btn2: function () { + closeBox(); + } + }); + }, function (code, data) { + top.dialog.msg(data.msg); + }, function () { + loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); + }, function () { + top.dialog.close(loadLayerIndex); }); - }, function(code, data) { - top.dialog.msg(data.msg); - }, function() { - loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); - }, function() { - top.dialog.close(loadLayerIndex); }); }) diff --git a/src/main/resources/static/route/news/update_propaganda.html b/src/main/resources/static/route/news/update_propaganda.html index 6aa18ad..10cfe43 100755 --- a/src/main/resources/static/route/news/update_propaganda.html +++ b/src/main/resources/static/route/news/update_propaganda.html @@ -132,25 +132,28 @@ form.on('submit(submitForm)', function(formData) { formData.field['newsType'] = newsType; var loadLayerIndex; - top.restAjax.put(top.restAjax.path('api/news/updatenews/{newsId}', [newsId]), formData.field, null, function(code, data) { - var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { - time: 0, - btn: [top.dataMessage.button.yes, top.dataMessage.button.no], - shade: 0.3, - yes: function() { - top.dialog.close(layerIndex); - window.location.reload(); - }, - btn2: function() { - closeBox(); - } + top.dialog.confirm(top.dataMessage.commit, function(index) { + top.dialog.close(index); + top.restAjax.put(top.restAjax.path('api/news/updatenews/{newsId}', [newsId]), formData.field, null, function (code, data) { + var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { + time: 0, + btn: [top.dataMessage.button.yes, top.dataMessage.button.no], + shade: 0.3, + yes: function () { + top.dialog.close(layerIndex); + window.location.reload(); + }, + btn2: function () { + closeBox(); + } + }); + }, function (code, data) { + top.dialog.msg(data.msg); + }, function () { + loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); + }, function () { + top.dialog.close(loadLayerIndex); }); - }, function(code, data) { - top.dialog.msg(data.msg); - }, function() { - loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); - }, function() { - top.dialog.close(loadLayerIndex); }); })