修改问题

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,30 +227,33 @@
form.on('submit(submitForm)', function(formData) { form.on('submit(submitForm)', function(formData) {
var loadLayerIndex; var loadLayerIndex;
formData.field['communityBossLevel'] = formObject.communityBossLevel; top.dialog.confirm(top.dataMessage.commit, function(index) {
top.restAjax.post(top.restAjax.path('api/communityboss/savecommunityboss', []), formData.field, null, function(code, data) { top.dialog.close(index);
// success formData.field['communityBossLevel'] = formObject.communityBossLevel;
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { top.restAjax.post(top.restAjax.path('api/communityboss/savecommunityboss', []), formData.field, null, function (code, data) {
time: 0, // success
btn: [top.dataMessage.button.yes, top.dataMessage.button.no], var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
shade: 0.3, time: 0,
yes: function() { btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
top.dialog.close(layerIndex); shade: 0.3,
window.location.reload(); yes: function () {
}, top.dialog.close(layerIndex);
btn2: function() { window.location.reload();
closeBox(); },
} 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; 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,30 +344,33 @@
form.on('submit(submitForm)', function(formData) { form.on('submit(submitForm)', function(formData) {
var loadLayerIndex; var loadLayerIndex;
formData.field['communityBossLevel'] = formObject.communityBossLevel; top.dialog.confirm(top.dataMessage.commit, function(index) {
top.restAjax.put(top.restAjax.path('api/communityboss/updatecommunityboss/{communityBossId}', [communityBossId]), formData.field, null, function(code, data) { top.dialog.close(index);
// success formData.field['communityBossLevel'] = formObject.communityBossLevel;
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { top.restAjax.put(top.restAjax.path('api/communityboss/updatecommunityboss/{communityBossId}', [communityBossId]), formData.field, null, function (code, data) {
time: 0, // success
btn: [top.dataMessage.button.yes, top.dataMessage.button.no], var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
shade: 0.3, time: 0,
yes: function() { btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
top.dialog.close(layerIndex); shade: 0.3,
window.location.reload(); yes: function () {
}, top.dialog.close(layerIndex);
btn2: function() { window.location.reload();
closeBox(); },
} 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; return false;
}) })

View File

@ -112,26 +112,29 @@
form.on('submit(submitForm)', function(formData) { form.on('submit(submitForm)', function(formData) {
var loadLayerIndex; var loadLayerIndex;
formData.field['newsType'] = newsType; top.dialog.confirm(top.dataMessage.commit, function(index) {
top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function(code, data) { top.dialog.close(index);
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { formData.field['newsType'] = newsType;
time: 0, top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function (code, data) {
btn: [top.dataMessage.button.yes, top.dataMessage.button.no], var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
shade: 0.3, time: 0,
yes: function() { btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
top.dialog.close(layerIndex); shade: 0.3,
window.location.reload(); yes: function () {
}, top.dialog.close(layerIndex);
btn2: function() { window.location.reload();
closeBox(); },
} 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);
}); });
}) })

View File

@ -153,26 +153,29 @@
form.on('submit(submitForm)', function(formData) { form.on('submit(submitForm)', function(formData) {
var loadLayerIndex; var loadLayerIndex;
formData.field['newsType'] = newsType; top.dialog.confirm(top.dataMessage.commit, function(index) {
top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function(code, data) { top.dialog.close(index);
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { formData.field['newsType'] = newsType;
time: 0, top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function (code, data) {
btn: [top.dataMessage.button.yes, top.dataMessage.button.no], var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
shade: 0.3, time: 0,
yes: function() { btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
top.dialog.close(layerIndex); shade: 0.3,
window.location.reload(); yes: function () {
}, top.dialog.close(layerIndex);
btn2: function() { window.location.reload();
closeBox(); },
} 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);
}); });
}) })

View File

@ -111,26 +111,29 @@
form.on('submit(submitForm)', function(formData) { form.on('submit(submitForm)', function(formData) {
var loadLayerIndex; var loadLayerIndex;
formData.field['newsType'] = newsType; top.dialog.confirm(top.dataMessage.commit, function(index) {
top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function(code, data) { top.dialog.close(index);
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { formData.field['newsType'] = newsType;
time: 0, top.restAjax.post(top.restAjax.path('api/news/savenews', []), formData.field, null, function (code, data) {
btn: [top.dataMessage.button.yes, top.dataMessage.button.no], var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
shade: 0.3, time: 0,
yes: function() { btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
top.dialog.close(layerIndex); shade: 0.3,
window.location.reload(); yes: function () {
}, top.dialog.close(layerIndex);
btn2: function() { window.location.reload();
closeBox(); },
} 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);
}); });
}) })

View File

@ -132,25 +132,28 @@
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.restAjax.put(top.restAjax.path('api/news/updatenews/{newsId}', [newsId]), formData.field, null, function(code, data) { top.dialog.confirm(top.dataMessage.commit, function(index) {
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { top.dialog.close(index);
time: 0, top.restAjax.put(top.restAjax.path('api/news/updatenews/{newsId}', [newsId]), formData.field, null, function (code, data) {
btn: [top.dataMessage.button.yes, top.dataMessage.button.no], var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
shade: 0.3, time: 0,
yes: function() { btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
top.dialog.close(layerIndex); shade: 0.3,
window.location.reload(); yes: function () {
}, top.dialog.close(layerIndex);
btn2: function() { window.location.reload();
closeBox(); },
} 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);
}); });
}) })

View File

@ -176,25 +176,28 @@
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.restAjax.put(top.restAjax.path('api/news/updatenews/{newsId}', [newsId]), formData.field, null, function(code, data) { top.dialog.confirm(top.dataMessage.commit, function(index) {
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { top.dialog.close(index);
time: 0, top.restAjax.put(top.restAjax.path('api/news/updatenews/{newsId}', [newsId]), formData.field, null, function (code, data) {
btn: [top.dataMessage.button.yes, top.dataMessage.button.no], var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
shade: 0.3, time: 0,
yes: function() { btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
top.dialog.close(layerIndex); shade: 0.3,
window.location.reload(); yes: function () {
}, top.dialog.close(layerIndex);
btn2: function() { window.location.reload();
closeBox(); },
} 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);
}); });
}) })

View File

@ -132,25 +132,28 @@
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.restAjax.put(top.restAjax.path('api/news/updatenews/{newsId}', [newsId]), formData.field, null, function(code, data) { top.dialog.confirm(top.dataMessage.commit, function(index) {
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { top.dialog.close(index);
time: 0, top.restAjax.put(top.restAjax.path('api/news/updatenews/{newsId}', [newsId]), formData.field, null, function (code, data) {
btn: [top.dataMessage.button.yes, top.dataMessage.button.no], var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
shade: 0.3, time: 0,
yes: function() { btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
top.dialog.close(layerIndex); shade: 0.3,
window.location.reload(); yes: function () {
}, top.dialog.close(layerIndex);
btn2: function() { window.location.reload();
closeBox(); },
} 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);
}); });
}) })