部门接口调整
parent
08b910630e
commit
a46b8a0e4e
|
|
@ -5,6 +5,7 @@ import com.jjb.saas.system.client.dept.facade.DeptFacade;
|
|||
import com.jjb.saas.system.client.dept.request.FacadeUpdateDeptCmd;
|
||||
import com.zcloud.basic.info.domain.gateway.DepartmentGateway;
|
||||
import com.zcloud.basic.info.domain.model.DepartmentE;
|
||||
import com.zcloud.basic.info.domain.model.FacadeDepartmentE;
|
||||
import com.zcloud.basic.info.dto.DepartmentUpdateCmd;
|
||||
import com.zcloud.basic.info.persistence.dataobject.DepartmentDO;
|
||||
import com.zcloud.basic.info.persistence.repository.DepartmentRepository;
|
||||
|
|
@ -46,12 +47,11 @@ public class DepartmentUpdateExe {
|
|||
throw new BizException("修改失败");
|
||||
}
|
||||
|
||||
FacadeUpdateDeptCmd deptCmd = new FacadeUpdateDeptCmd();
|
||||
deptCmd.setLinkId(departmentE.getId());
|
||||
deptCmd.setLinkName(departmentE.getName());
|
||||
deptCmd.setParentId(departmentE.getParentId());
|
||||
deptFacade.updateDept(deptCmd);
|
||||
FacadeDepartmentE deptE =FacadeDepartmentE.initUpdate(departmentE);
|
||||
|
||||
FacadeUpdateDeptCmd deptCmd = new FacadeUpdateDeptCmd();
|
||||
BeanUtils.copyProperties(deptE, deptCmd);
|
||||
deptFacade.updateDept(deptCmd);
|
||||
if(!departmentDO.getName().equals(departmentE.getName())){
|
||||
//TODO 名字不一样,发送mq
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.zcloud.basic.info.command.query;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.basic.info.command.convertor.DepartmentCoConvertor;
|
||||
import com.zcloud.basic.info.domain.model.DepartmentE;
|
||||
import com.zcloud.basic.info.dto.CorpDepartmentQry;
|
||||
|
|
@ -15,6 +16,7 @@ import com.zcloud.basic.info.persistence.dataobject.DepartmentDO;
|
|||
import com.zcloud.basic.info.persistence.repository.DepartmentRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
|
@ -48,6 +50,10 @@ public class DepartmentQueryExe {
|
|||
}
|
||||
|
||||
public List<DepartmentTreeInfoCO> listTree(DepartmentTreeQry departmentQry) {
|
||||
if(Objects.isNull(departmentQry.getEqCorpinfoId())){
|
||||
departmentQry.setEqCorpinfoId(AuthContext.getTenantId());
|
||||
|
||||
}
|
||||
Map<String, Object> parmas = PageQueryHelper.toHashMap(departmentQry);
|
||||
List<DepartmentDO> pageResponse = departmentRepository.listTree(parmas);
|
||||
if(CollUtil.isEmpty(pageResponse)) {
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@ public class DepartmentTreeQry {
|
|||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "企业id", name = "eqCorpInfoId")
|
||||
private String eqCorpInfoId;
|
||||
@ApiModelProperty(value = "企业id", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
@ApiModelProperty(value = "父id", name = "eqParentId")
|
||||
private String eqParentId;
|
||||
private Long eqParentId;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
package com.zcloud.basic.info.domain.model;
|
||||
|
||||
import com.alibaba.cola.domain.Entity;
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-10-30 10:10:48
|
||||
*/
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class FacadeDepartmentE extends BaseE {
|
||||
|
||||
//外部对象ID
|
||||
private Long linkId;
|
||||
//父级ID
|
||||
private Long parentId;
|
||||
|
||||
//外部对象名称
|
||||
private String linkName;
|
||||
|
||||
//区域父子级编码(逗号隔开)
|
||||
private String regionCode;
|
||||
|
||||
//区域名称
|
||||
private String regionCodeName;
|
||||
|
||||
|
||||
public static FacadeDepartmentE initUpdate(DepartmentE departmentE) {
|
||||
FacadeDepartmentE deptE = new FacadeDepartmentE();
|
||||
deptE.setLinkId(departmentE.getId());
|
||||
deptE.setLinkName(departmentE.getName());
|
||||
deptE.setParentId(departmentE.getParentId());
|
||||
return deptE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -45,8 +45,8 @@ public class DepartmentRepositoryImpl extends BaseRepositoryImpl<DepartmentMappe
|
|||
public List<DepartmentDO> listTree(Map<String, Object> parmas) {
|
||||
QueryWrapper<DepartmentDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, parmas);
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
queryWrapper.eq("tenant_id",ssoUser.getTenantId());
|
||||
// SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
// queryWrapper.eq("tenant_id",ssoUser.getTenantId());
|
||||
queryWrapper.orderByDesc("dep_order");
|
||||
List<DepartmentDO> departmentDOList = departmentMapper.selectList(queryWrapper);
|
||||
if (CollUtil.isEmpty(departmentDOList)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue