修改问题

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
public SuccessResult saveCommunityBoss(Map<String, Object> params) throws SaveException, SearchException {
Map<String, Object> 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<String> communityBossIds = new HashSet<>();
for (CommunityBossDTO communityBossDTO : communityBossDTOs) {
communityBossIds.add(communityBossDTO.getCommunityBossUserId());
communityBossIds.add(communityBossDTO.getCommunityBossId());
}
Map<String, Object> 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<CommunityDTO> communities = communityBossDTO.getCommunities();
communityDTOs.add(communityDTO);
communities.add(communityDTO);
communityBossDTO.setCommunities(communities);
}
}
@ -414,7 +411,7 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun
}
Set<String> communityBossIds = new HashSet<>();
for (CommunityBossDTO communityBossDTO : communityBossDTOs) {
communityBossIds.add(communityBossDTO.getCommunityBossUserId());
communityBossIds.add(communityBossDTO.getCommunityBossId());
}
Map<String, Object> params = getHashMap(2);
params.put("communityBossIds", new ArrayList<>(communityBossIds));
@ -494,7 +491,7 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun
}
Set<String> communityBossIds = new HashSet<>();
for (CommunityBossDTO communityBossDTO : communityBossDTOs) {
communityBossIds.add(communityBossDTO.getCommunityBossUserId());
communityBossIds.add(communityBossDTO.getCommunityBossId());
}
Map<String, Object> params = getHashMap(2);
params.put("communityBossIds", new ArrayList<>(communityBossIds));

View File

@ -33,6 +33,7 @@
<div class="layui-input-block">
<input type="text" name="communityBossParentName" id="communityBossParentName" placeholder="请选择上级片长" class="layui-input">
<input type="hidden" name="communityBossParentUserId" id="communityBossParentUserId">
<input type="hidden" name="communityBossParentId" id="communityBossParentId">
</div>
</div>
<div class="layui-form-item" id="communityNameDiv">
@ -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: {},

View File

@ -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;
})

View File

@ -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);
});
})

View File

@ -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);
});
})

View File

@ -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);
});
})

View File

@ -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);
});
})

View File

@ -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);
});
})

View File

@ -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);
});
})