Commit febeb799 authored by 赵啸非's avatar 赵啸非

修改根据业务查询部门逻辑

parent be4fc0cd
......@@ -116,6 +116,7 @@ public class DemoWebApiController {
DeptEntity deptEntity = deptService.selectOne(new DeptQuery().name(deptName));
if (!ObjectUtils.isEmpty(deptEntity)) {
if (deptEntity.getId() != windowEntity.getDeptId()) {
log.info("部门:{},更新部门id:orgin deptId:{} ,updateDeptId:{}", deptName, windowEntity.getDeptId(), deptEntity.getId());
windowEntity.setDeptId(deptEntity.getId());
windowService.update(windowEntity);
}
......@@ -124,25 +125,24 @@ public class DemoWebApiController {
//更新窗口事项中的部门id
List<WindowMatterEntity> windowMatterEntities = windowMatterService.find(new WindowMatterQuery());
for (WindowMatterEntity windowMatterEntity : windowMatterEntities) {
if(!ObjectUtils.isEmpty(windowMatterEntity.getDeptCode())){
DeptEntity extCache = deptService.getExtCache(windowMatterEntity.getDeptCode());
if (!ObjectUtils.isEmpty(extCache)) {
if (extCache.getId() != windowMatterEntity.getDeptId()) {
windowMatterEntity.setDeptId(extCache.getId());
windowMatterService.update(windowMatterEntity);
}
DeptEntity deptEntity = deptService.selectOne(new DeptQuery().name(windowMatterEntity.getDeptName()));
if (!ObjectUtils.isEmpty(deptEntity)) {
if (deptEntity.getId() != windowMatterEntity.getDeptId()) {
windowMatterEntity.setDeptId(deptEntity.getId());
windowMatterEntity.setDeptCode(deptEntity.getDeptNumber());
windowMatterService.update(windowMatterEntity);
}
}
}
List<SiteMatterEntity> siteMatterEntities = siteMatterService.find(new SiteMatterQuery());
for (SiteMatterEntity siteMatterEntity : siteMatterEntities) {
if(ObjectUtils.isEmpty(siteMatterEntity.getDeptCode())) continue;
DeptEntity extCache = deptService.getExtCache(siteMatterEntity.getDeptCode());
if (!ObjectUtils.isEmpty(extCache)) {
if (extCache.getId() != siteMatterEntity.getDeptId()) {
siteMatterEntity.setDeptId(extCache.getId());
if (ObjectUtils.isEmpty(siteMatterEntity.getDeptCode())) continue;
DeptEntity deptEntity = deptService.selectOne(new DeptQuery().name(siteMatterEntity.getDeptName()));
if (!ObjectUtils.isEmpty(deptEntity)) {
if (deptEntity.getId() != siteMatterEntity.getDeptId()) {
siteMatterEntity.setDeptId(deptEntity.getId());
siteMatterEntity.setDeptCode(deptEntity.getDeptNumber());
siteMatterService.update(siteMatterEntity);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment