查询部门全称
parent
d359f63aa3
commit
4220091b0f
|
|
@ -4,6 +4,7 @@ import com.jjb.saas.base.starter.bootstart.JJBSpringbootApplication;
|
||||||
import com.jjb.saas.facade.starter.annotation.EnableFacadeRpcClient;
|
import com.jjb.saas.facade.starter.annotation.EnableFacadeRpcClient;
|
||||||
import com.jjb.saas.framework.event.consumer.EnableConsumer;
|
import com.jjb.saas.framework.event.consumer.EnableConsumer;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.cache.annotation.EnableCaching;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Spring Boot Starter
|
* Spring Boot Starter
|
||||||
|
|
@ -15,6 +16,7 @@ import org.springframework.boot.SpringApplication;
|
||||||
)
|
)
|
||||||
//@EnableFacadeRpcClient
|
//@EnableFacadeRpcClient
|
||||||
//@EnableConsumer
|
//@EnableConsumer
|
||||||
|
@EnableCaching
|
||||||
public class Application {
|
public class Application {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
|
||||||
|
|
@ -10,18 +10,19 @@ import com.zcloud.basic.info.dto.DepartmentPageQry;
|
||||||
import com.zcloud.basic.info.dto.DepartmentUpdateCmd;
|
import com.zcloud.basic.info.dto.DepartmentUpdateCmd;
|
||||||
import com.zcloud.basic.info.dto.clientobject.DepartmentCO;
|
import com.zcloud.basic.info.dto.clientobject.DepartmentCO;
|
||||||
import com.zcloud.basic.info.dto.clientobject.DepartmentInfoCO;
|
import com.zcloud.basic.info.dto.clientobject.DepartmentInfoCO;
|
||||||
import com.zcloud.basic.info.dto.clientobject.PostCO;
|
import com.zcloud.gbscommon.utils.Tools;
|
||||||
import com.zcloud.gbscommon.zclouddepartment.face.ZcloudDepartmentFacade;
|
import com.zcloud.gbscommon.zclouddepartment.face.ZcloudDepartmentFacade;
|
||||||
import com.zcloud.gbscommon.zclouddepartment.request.ZcloudDepartmentAddCmd;
|
import com.zcloud.gbscommon.zclouddepartment.request.ZcloudDepartmentAddCmd;
|
||||||
import com.zcloud.gbscommon.zclouddepartment.request.ZcloudDepartmentPageQry;
|
import com.zcloud.gbscommon.zclouddepartment.request.ZcloudDepartmentPageQry;
|
||||||
import com.zcloud.gbscommon.zclouddepartment.request.ZcloudDepartmentUpdateCmd;
|
import com.zcloud.gbscommon.zclouddepartment.request.ZcloudDepartmentUpdateCmd;
|
||||||
import com.zcloud.gbscommon.zclouddepartment.response.ZcloudDepartmentInfoCo;
|
import com.zcloud.gbscommon.zclouddepartment.response.ZcloudDepartmentInfoCo;
|
||||||
import com.zcloud.gbscommon.zcloudpost.response.ZcloudPostCO;
|
|
||||||
import org.apache.dubbo.config.annotation.DubboService;
|
import org.apache.dubbo.config.annotation.DubboService;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
@ -83,12 +84,19 @@ public class ZcloudDepartmentFacadeImpl implements ZcloudDepartmentFacade {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFullName(Long aLong) {
|
@Cacheable(value = "deptAllNameCache", key="'deptId:'+#deptId")
|
||||||
return null;
|
public String getFullName(Long deptId) {
|
||||||
|
List<DepartmentCO> list = departmentService.getDeptList();
|
||||||
|
String name = Tools.getTreeFullName(list,"id", "parentId", "name", deptId);
|
||||||
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<Long, String> listFullName(List<Long> list) {
|
public Map<Long, String> listFullName(List<Long> list) {
|
||||||
return null;
|
Map<Long, String> map = new HashMap<>();
|
||||||
|
for (Long id : list){
|
||||||
|
map.put(id, getFullName(id));
|
||||||
|
}
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue