查询部门全称
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.framework.event.consumer.EnableConsumer;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
|
||||
/**
|
||||
* Spring Boot Starter
|
||||
|
|
@ -15,6 +16,7 @@ import org.springframework.boot.SpringApplication;
|
|||
)
|
||||
//@EnableFacadeRpcClient
|
||||
//@EnableConsumer
|
||||
@EnableCaching
|
||||
public class Application {
|
||||
|
||||
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.clientobject.DepartmentCO;
|
||||
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.request.ZcloudDepartmentAddCmd;
|
||||
import com.zcloud.gbscommon.zclouddepartment.request.ZcloudDepartmentPageQry;
|
||||
import com.zcloud.gbscommon.zclouddepartment.request.ZcloudDepartmentUpdateCmd;
|
||||
import com.zcloud.gbscommon.zclouddepartment.response.ZcloudDepartmentInfoCo;
|
||||
import com.zcloud.gbscommon.zcloudpost.response.ZcloudPostCO;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -83,12 +84,19 @@ public class ZcloudDepartmentFacadeImpl implements ZcloudDepartmentFacade {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getFullName(Long aLong) {
|
||||
return null;
|
||||
@Cacheable(value = "deptAllNameCache", key="'deptId:'+#deptId")
|
||||
public String getFullName(Long deptId) {
|
||||
List<DepartmentCO> list = departmentService.getDeptList();
|
||||
String name = Tools.getTreeFullName(list,"id", "parentId", "name", deptId);
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
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