字典数据管理去掉停用启用校验下级的限制,并支持级联更新

This commit is contained in:
thinkgem
2024-04-08 10:00:30 +08:00
parent 0e82478fad
commit ac17706fc7
2 changed files with 9 additions and 8 deletions

View File

@@ -185,13 +185,13 @@ public class DictDataController extends BaseController {
if (old != null && Global.YES.equals(old.getIsSys()) && !dictData.currentUser().isSuperAdmin()){ if (old != null && Global.YES.equals(old.getIsSys()) && !dictData.currentUser().isSuperAdmin()){
return renderResult(Global.FALSE, text("越权操作,只有超级管理员才能修改系统数据!")); return renderResult(Global.FALSE, text("越权操作,只有超级管理员才能修改系统数据!"));
} }
DictData where = new DictData(); // DictData where = new DictData();
where.setStatus(DictData.STATUS_NORMAL); // where.setStatus(DictData.STATUS_NORMAL);
where.setParentCodes("," + dictData.getId() + ","); // where.setParentCodes("," + dictData.getId() + ",");
long count = dictDataService.findCount(where); // long count = dictDataService.findCount(where);
if (count > 0) { // if (count > 0) {
return renderResult(Global.FALSE, text("该字典包含未停用的子字典!")); // return renderResult(Global.FALSE, text("该字典包含未停用的子字典!"));
} // }
dictData.setStatus(DictData.STATUS_DISABLE); dictData.setStatus(DictData.STATUS_DISABLE);
dictDataService.updateStatus(dictData); dictDataService.updateStatus(dictData);
return renderResult(Global.TRUE, text("停用字典成功")); return renderResult(Global.TRUE, text("停用字典成功"));

View File

@@ -142,7 +142,8 @@ $('#inputForm').validate({
js.showMessage(data.message); js.showMessage(data.message);
if(data.result == Global.TRUE){ if(data.result == Global.TRUE){
js.closeCurrentTabPage(function(contentWindow){ js.closeCurrentTabPage(function(contentWindow){
contentWindow.page(); (contentWindow.win||contentWindow).$('#dataGrid').dataGrid('refreshTreeChildren',
$('#parentCode').val(), '${dictData.id}');
}); });
} }
}, "json"); }, "json");