|
|
@@ -123,8 +123,11 @@ public class DeptController extends BaseController {
|
|
123
|
123
|
}
|
|
124
|
124
|
input.setCreateBy(CurrentUser().getUserName());
|
|
125
|
125
|
input.setCreateTime(new Date());
|
|
|
126
|
+ Dept parentdept= deptService.getEntity(input.getParentId());
|
|
126
|
127
|
boolean result = deptService.insert(input);
|
|
127
|
128
|
if (result) {
|
|
|
129
|
+ input.setAncestors(parentdept.getAncestors()+","+input.getDeptId());
|
|
|
130
|
+ deptService.update(input);
|
|
128
|
131
|
if (redisHelper.getCache("deptTree")!=null){
|
|
129
|
132
|
redisHelper.deleteCache("deptTree");
|
|
130
|
133
|
}
|
|
|
@@ -191,6 +194,8 @@ public class DeptController extends BaseController {
|
|
191
|
194
|
if (redisHelper.getCache("deptTree")!=null){
|
|
192
|
195
|
redisHelper.deleteCache("deptTree");
|
|
193
|
196
|
}
|
|
|
197
|
+ Dept parentdept= deptService.getEntity(input.getParentId());
|
|
|
198
|
+ input.setAncestors(parentdept.getAncestors()+","+input.getDeptId());
|
|
194
|
199
|
boolean result = deptService.update(input);
|
|
195
|
200
|
if (result) {
|
|
196
|
201
|
if (redisHelper.getCache("deptTree")!=null){
|