修改问题

This commit is contained in:
wanggeng888 2021-06-17 11:16:43 +08:00
parent ac74f210d7
commit bdb1bb71c5
9 changed files with 200 additions and 174 deletions

View File

@ -60,26 +60,23 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun
@Override @Override
public SuccessResult saveCommunityBoss(Map<String, Object> params) throws SaveException, SearchException { public SuccessResult saveCommunityBoss(Map<String, Object> params) throws SaveException, SearchException {
Map<String, Object> communityBossParams = new HashMap<>(); String communityBossId = UUIDUtil.getUUID();
params.put("communityBossId", UUIDUtil.getUUID()); params.put("communityBossId", communityBossId);
setSaveInfo(params); setSaveInfo(params);
communityBossDao.saveCommunityBoss(params); communityBossDao.saveCommunityBoss(params);
LOG.debug("绑定片长和社区关系"); LOG.debug("绑定片长和社区关系");
if (params.get("communityId") != null && !StringUtils.isBlank(params.get("communityId").toString())) { if (params.get("communityId") != null && !StringUtils.isBlank(params.get("communityId").toString())) {
String[] communityIds = params.get("communityId").toString().split(","); String[] communityIds = params.get("communityId").toString().split(",");
String communityBossId = params.get("communityBossId").toString();
saveCommunityBossCommunity(communityBossId, communityIds); saveCommunityBossCommunity(communityBossId, communityIds);
} }
LOG.debug("绑定片长和小区关系"); LOG.debug("绑定片长和小区关系");
if (params.get("districtId") != null && !StringUtils.isBlank(params.get("districtId").toString())) { if (params.get("districtId") != null && !StringUtils.isBlank(params.get("districtId").toString())) {
String[] districtIds = params.get("districtId").toString().split(","); String[] districtIds = params.get("districtId").toString().split(",");
String communityBossId = params.get("communityBossId").toString();
saveCommunityBossDistrict(communityBossId, districtIds); saveCommunityBossDistrict(communityBossId, districtIds);
} }
LOG.debug("绑定片长和楼宇关系"); LOG.debug("绑定片长和楼宇关系");
if (params.get("buildingId") != null && !StringUtils.isBlank(params.get("buildingId").toString())) { if (params.get("buildingId") != null && !StringUtils.isBlank(params.get("buildingId").toString())) {
String[] buildingIds = params.get("buildingId").toString().split(","); String[] buildingIds = params.get("buildingId").toString().split(",");
String communityBossId = params.get("communityBossId").toString();
saveCommunityBossBuilding(communityBossId, buildingIds); saveCommunityBossBuilding(communityBossId, buildingIds);
} }
return new SuccessResult(); return new SuccessResult();
@ -262,7 +259,7 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun
} }
Set<String> communityBossIds = new HashSet<>(); Set<String> communityBossIds = new HashSet<>();
for (CommunityBossDTO communityBossDTO : communityBossDTOs) { for (CommunityBossDTO communityBossDTO : communityBossDTOs) {
communityBossIds.add(communityBossDTO.getCommunityBossUserId()); communityBossIds.add(communityBossDTO.getCommunityBossId());
} }
Map<String, Object> params = getHashMap(2); Map<String, Object> params = getHashMap(2);
params.put("communityBossIds", new ArrayList<>(communityBossIds)); params.put("communityBossIds", new ArrayList<>(communityBossIds));
@ -271,7 +268,7 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun
for (CommunityDTO communityDTO : communityDTOs) { for (CommunityDTO communityDTO : communityDTOs) {
if (StringUtils.equals(communityBossDTO.getCommunityBossId(), communityDTO.getCommunityBossId())) { if (StringUtils.equals(communityBossDTO.getCommunityBossId(), communityDTO.getCommunityBossId())) {
List<CommunityDTO> communities = communityBossDTO.getCommunities(); List<CommunityDTO> communities = communityBossDTO.getCommunities();
communityDTOs.add(communityDTO); communities.add(communityDTO);
communityBossDTO.setCommunities(communities); communityBossDTO.setCommunities(communities);
} }
} }
@ -414,7 +411,7 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun
} }
Set<String> communityBossIds = new HashSet<>(); Set<String> communityBossIds = new HashSet<>();
for (CommunityBossDTO communityBossDTO : communityBossDTOs) { for (CommunityBossDTO communityBossDTO : communityBossDTOs) {
communityBossIds.add(communityBossDTO.getCommunityBossUserId()); communityBossIds.add(communityBossDTO.getCommunityBossId());
} }
Map<String, Object> params = getHashMap(2); Map<String, Object> params = getHashMap(2);
params.put("communityBossIds", new ArrayList<>(communityBossIds)); params.put("communityBossIds", new ArrayList<>(communityBossIds));
@ -494,7 +491,7 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun
} }
Set<String> communityBossIds = new HashSet<>(); Set<String> communityBossIds = new HashSet<>();
for (CommunityBossDTO communityBossDTO : communityBossDTOs) { for (CommunityBossDTO communityBossDTO : communityBossDTOs) {
communityBossIds.add(communityBossDTO.getCommunityBossUserId()); communityBossIds.add(communityBossDTO.getCommunityBossId());
} }
Map<String, Object> params = getHashMap(2); Map<String, Object> params = getHashMap(2);
params.put("communityBossIds", new ArrayList<>(communityBossIds)); params.put("communityBossIds", new ArrayList<>(communityBossIds));

View File

@ -33,6 +33,7 @@
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="communityBossParentName" id="communityBossParentName" placeholder="请选择上级片长" class="layui-input"> <input type="text" name="communityBossParentName" id="communityBossParentName" placeholder="请选择上级片长" class="layui-input">
<input type="hidden" name="communityBossParentUserId" id="communityBossParentUserId"> <input type="hidden" name="communityBossParentUserId" id="communityBossParentUserId">
<input type="hidden" name="communityBossParentId" id="communityBossParentId">
</div> </div>
</div> </div>
<div class="layui-form-item" id="communityNameDiv"> <div class="layui-form-item" id="communityNameDiv">
@ -226,6 +227,8 @@
form.on('submit(submitForm)', function(formData) { form.on('submit(submitForm)', function(formData) {
var loadLayerIndex; var loadLayerIndex;
top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index);
formData.field['communityBossLevel'] = formObject.communityBossLevel; formData.field['communityBossLevel'] = formObject.communityBossLevel;
top.restAjax.post(top.restAjax.path('api/communityboss/savecommunityboss', []), formData.field, null, function (code, data) { top.restAjax.post(top.restAjax.path('api/communityboss/savecommunityboss', []), formData.field, null, function (code, data) {
// success // success
@ -251,6 +254,7 @@
// complete // complete
top.dialog.close(loadLayerIndex); top.dialog.close(loadLayerIndex);
}); });
});
return false; return false;
}) })
@ -344,6 +348,7 @@
for(var i = 0, item = childNodes[i]; item = childNodes[i++];) { for(var i = 0, item = childNodes[i]; item = childNodes[i++];) {
item.name = item.communityBossName; item.name = item.communityBossName;
item.id = item.communityBossUserId; item.id = item.communityBossUserId;
item.title = item.communityBossId;
} }
return childNodes; return childNodes;
}, },
@ -351,7 +356,7 @@
{ {
id: formObject.communityBossParentUserId, id: formObject.communityBossParentUserId,
name: formObject.communityBossParentName, name: formObject.communityBossParentName,
title: formObject.communityBossParentName title: formObject.communityBossId
} }
], ],
onClose: function() { onClose: function() {
@ -359,17 +364,21 @@
if(typeof(selectNodes) != 'undefined' && selectNodes != null) { if(typeof(selectNodes) != 'undefined' && selectNodes != null) {
if(selectNodes.length > 0) { if(selectNodes.length > 0) {
var selectedNode = selectNodes[0]; var selectedNode = selectNodes[0];
formObject.communityBossParentId = selectedNode.title;
formObject.communityBossParentUserId = selectedNode.id; formObject.communityBossParentUserId = selectedNode.id;
formObject.communityBossParentName = selectedNode.name; formObject.communityBossParentName = selectedNode.name;
communityBossParentUserIdChange(); communityBossParentUserIdChange();
$('#communityBossParentId').val(selectedNode.title);
$('#communityBossParentUserId').val(selectedNode.id); $('#communityBossParentUserId').val(selectedNode.id);
$('#communityBossParentName').val(selectedNode.name); $('#communityBossParentName').val(selectedNode.name);
} else { } else {
formObject.communityBossParentId = null;
formObject.communityBossParentUserId = null; formObject.communityBossParentUserId = null;
formObject.communityBossParentName = null; formObject.communityBossParentName = null;
communityBossParentUserIdChange(); communityBossParentUserIdChange();
$('#communityBossParentUserId').val(); $('#communityBossParentId').val('');
$('#communityBossParentName').val(); $('#communityBossParentUserId').val('');
$('#communityBossParentName').val('');
} }
} }
} }
@ -391,13 +400,13 @@
areaId: formObject.areaId areaId: formObject.areaId
} }
} else if(formObject.communityBossLevel == '3') { } 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 = {} otherParams = {}
} else if(formObject.communityBossLevel == '4') { } 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 = {} otherParams = {}
} else if(formObject.communityBossLevel == '5') { } 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 = {} otherParams = {}
} else { } else {
return; return;
@ -489,8 +498,7 @@
} }
top.dialog.tree({ top.dialog.tree({
title: '选择楼宇', title: '选择楼宇',
apiUri: top.restAjax.path('api/citybuilding/listCityBuildingByDistrictIds/{districtId' + apiUri: top.restAjax.path('api/citybuilding/listCityBuildingByDistrictIds/{districtId}', [formObject.districtId]),
'}', [formObject.districtId]),
width: '200px', width: '200px',
height: '400px', height: '400px',
otherParams: {}, otherParams: {},

View File

@ -344,6 +344,8 @@
form.on('submit(submitForm)', function(formData) { form.on('submit(submitForm)', function(formData) {
var loadLayerIndex; var loadLayerIndex;
top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index);
formData.field['communityBossLevel'] = formObject.communityBossLevel; formData.field['communityBossLevel'] = formObject.communityBossLevel;
top.restAjax.put(top.restAjax.path('api/communityboss/updatecommunityboss/{communityBossId}', [communityBossId]), formData.field, null, function (code, data) { top.restAjax.put(top.restAjax.path('api/communityboss/updatecommunityboss/{communityBossId}', [communityBossId]), formData.field, null, function (code, data) {
// success // success
@ -369,6 +371,7 @@
// complete // complete
top.dialog.close(loadLayerIndex); top.dialog.close(loadLayerIndex);
}); });
});
return false; return false;
}) })

View File

@ -112,6 +112,8 @@
form.on('submit(submitForm)', function(formData) { form.on('submit(submitForm)', function(formData) {
var loadLayerIndex; var loadLayerIndex;
top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index);
formData.field['newsType'] = newsType; formData.field['newsType'] = newsType;
top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function (code, data) { top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function (code, data) {
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
@ -133,6 +135,7 @@
}, function () { }, function () {
top.dialog.close(loadLayerIndex); top.dialog.close(loadLayerIndex);
}); });
});
}) })
function closeBox() { function closeBox() {

View File

@ -153,6 +153,8 @@
form.on('submit(submitForm)', function(formData) { form.on('submit(submitForm)', function(formData) {
var loadLayerIndex; var loadLayerIndex;
top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index);
formData.field['newsType'] = newsType; formData.field['newsType'] = newsType;
top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function (code, data) { top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function (code, data) {
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
@ -174,6 +176,7 @@
}, function () { }, function () {
top.dialog.close(loadLayerIndex); top.dialog.close(loadLayerIndex);
}); });
});
}) })
function closeBox() { function closeBox() {

View File

@ -111,6 +111,8 @@
form.on('submit(submitForm)', function(formData) { form.on('submit(submitForm)', function(formData) {
var loadLayerIndex; var loadLayerIndex;
top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index);
formData.field['newsType'] = newsType; formData.field['newsType'] = newsType;
top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function (code, data) { top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function (code, data) {
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
@ -132,6 +134,7 @@
}, function () { }, function () {
top.dialog.close(loadLayerIndex); top.dialog.close(loadLayerIndex);
}); });
});
}) })
function closeBox() { function closeBox() {

View File

@ -132,6 +132,8 @@
form.on('submit(submitForm)', function(formData) { form.on('submit(submitForm)', function(formData) {
formData.field['newsType'] = newsType; formData.field['newsType'] = newsType;
var loadLayerIndex; var loadLayerIndex;
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) { 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, { var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
time: 0, time: 0,
@ -152,6 +154,7 @@
}, function () { }, function () {
top.dialog.close(loadLayerIndex); top.dialog.close(loadLayerIndex);
}); });
});
}) })
function closeBox() { function closeBox() {

View File

@ -176,6 +176,8 @@
form.on('submit(submitForm)', function(formData) { form.on('submit(submitForm)', function(formData) {
formData.field['newsType'] = newsType; formData.field['newsType'] = newsType;
var loadLayerIndex; var loadLayerIndex;
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) { 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, { var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
time: 0, time: 0,
@ -196,6 +198,7 @@
}, function () { }, function () {
top.dialog.close(loadLayerIndex); top.dialog.close(loadLayerIndex);
}); });
});
}) })
function closeBox() { function closeBox() {

View File

@ -132,6 +132,8 @@
form.on('submit(submitForm)', function(formData) { form.on('submit(submitForm)', function(formData) {
formData.field['newsType'] = newsType; formData.field['newsType'] = newsType;
var loadLayerIndex; var loadLayerIndex;
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) { 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, { var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
time: 0, time: 0,
@ -152,6 +154,7 @@
}, function () { }, function () {
top.dialog.close(loadLayerIndex); top.dialog.close(loadLayerIndex);
}); });
});
}) })
function closeBox() { function closeBox() {