部门删除同步gbs,调整部门树
parent
ec219b6222
commit
cd23dcec04
|
|
@ -38,9 +38,9 @@ public class DepartmentAddExe {
|
||||||
public boolean execute(DepartmentAddCmd cmd) {
|
public boolean execute(DepartmentAddCmd cmd) {
|
||||||
DepartmentE examTypeE = new DepartmentE();
|
DepartmentE examTypeE = new DepartmentE();
|
||||||
//TODO 父id的值待定
|
//TODO 父id的值待定
|
||||||
// if(examTypeE.getParentId()==null){
|
if(cmd.getParentId()==null){
|
||||||
// examTypeE.setParentId(AuthContext.getTenantId());
|
cmd.setParentId(AuthContext.getTenantId());
|
||||||
// }
|
}
|
||||||
if(cmd.getCorpinfoId() == null){
|
if(cmd.getCorpinfoId() == null){
|
||||||
cmd.setCorpinfoId(AuthContext.getTenantId());
|
cmd.setCorpinfoId(AuthContext.getTenantId());
|
||||||
}
|
}
|
||||||
|
|
@ -63,9 +63,8 @@ public class DepartmentAddExe {
|
||||||
deptCmd.setParentId(examTypeE.getParentId());
|
deptCmd.setParentId(examTypeE.getParentId());
|
||||||
deptCmd.setDeptTypeEnum(DeptTypeEnum.DEPARTMENT.getValue());
|
deptCmd.setDeptTypeEnum(DeptTypeEnum.DEPARTMENT.getValue());
|
||||||
//TODO gbs部门表 sys_dept tenant_id,parent_ids,add_type_enum,存储错误,导致gbs页面看不到,参数还没有,待定
|
//TODO gbs部门表 sys_dept tenant_id,parent_ids,add_type_enum,存储错误,导致gbs页面看不到,参数还没有,待定
|
||||||
// Response response = deptFacade.addDept(deptCmd);
|
Response response = deptFacade.addDept(deptCmd);
|
||||||
// log.info("DepartmentAddExe,新增部门调用GBS返回:"+response.toString());
|
log.info("DepartmentAddExe,新增部门调用GBS返回:"+response.toString());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@ public class DepartmentRemoveExe {
|
||||||
if (!res) {
|
if (!res) {
|
||||||
throw new BizException("删除失败");
|
throw new BizException("删除失败");
|
||||||
}
|
}
|
||||||
|
deptFacade.deleteById( id);
|
||||||
//删除redis数据
|
//删除redis数据
|
||||||
zcloudRedisUtil.del(Const.REDIS_DEPT_PREFIX+id);
|
zcloudRedisUtil.del(Const.REDIS_DEPT_PREFIX+id);
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -86,6 +87,7 @@ public class DepartmentRemoveExe {
|
||||||
}
|
}
|
||||||
// 批量删除 Redis 缓存 - 循环处理每个ID
|
// 批量删除 Redis 缓存 - 循环处理每个ID
|
||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
|
deptFacade.deleteById( id);
|
||||||
zcloudRedisUtil.del(Const.REDIS_DEPT_PREFIX + id);
|
zcloudRedisUtil.del(Const.REDIS_DEPT_PREFIX + id);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ public class DepartmentQueryExe {
|
||||||
}
|
}
|
||||||
List<DepartmentTreeInfoCO> examCenterCOS = departmentCoConvertor.converDOsToInfoCOs(pageResponse);
|
List<DepartmentTreeInfoCO> examCenterCOS = departmentCoConvertor.converDOsToInfoCOs(pageResponse);
|
||||||
//GBS部门根节点父部门是1
|
//GBS部门根节点父部门是1
|
||||||
return Tools.buildEntityTree(examCenterCOS, "id", "parentId", "childrenList");
|
return Tools.buildEntityTree(examCenterCOS, "id", "parentId", "childrenList",AuthContext.getTenantId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,12 @@ import com.zcloud.basic.info.command.query.CorpInfoQueryExe;
|
||||||
import com.zcloud.basic.info.dto.*;
|
import com.zcloud.basic.info.dto.*;
|
||||||
import com.zcloud.basic.info.dto.clientobject.CorpDepartmentCO;
|
import com.zcloud.basic.info.dto.clientobject.CorpDepartmentCO;
|
||||||
import com.zcloud.basic.info.dto.clientobject.CorpInfoCO;
|
import com.zcloud.basic.info.dto.clientobject.CorpInfoCO;
|
||||||
import com.zcloud.basic.info.domain.enums.UserTypeEnum;
|
|
||||||
import com.zcloud.basic.info.dto.clientobject.CorpUserMiddleCO;
|
import com.zcloud.basic.info.dto.clientobject.CorpUserMiddleCO;
|
||||||
import com.zcloud.gbscommon.utils.Tools;
|
import com.zcloud.gbscommon.utils.Tools;
|
||||||
import org.apache.shiro.crypto.hash.SimpleHash;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ public class DepartmentAddCmd extends Command {
|
||||||
@NotEmpty(message = "名称不能为空")
|
@NotEmpty(message = "名称不能为空")
|
||||||
private String name;
|
private String name;
|
||||||
@ApiModelProperty(value = "父部门id", name = "parentId", required = true)
|
@ApiModelProperty(value = "父部门id", name = "parentId", required = true)
|
||||||
@NotNull(message = "父部门id不能为空")
|
// @NotNull(message = "父部门id不能为空")
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "所属企业", name = "corpinfoId")
|
@ApiModelProperty(value = "所属企业", name = "corpinfoId")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue