Browse Source

组织人员树-集团

lwx_v1
liwenxuan 2 years ago
parent
commit
a8d161f9d4
  1. 5
      pom.xml
  2. 23
      src/main/java/com/hxgk/lowcode/service/impl/HrServiceImpl.java
  3. 6
      src/main/resources/application-dev.yml

5
pom.xml

@ -5,7 +5,7 @@
<groupId>com.hxgk</groupId>
<artifactId>lowcode</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<packaging>jar</packaging>
<name>lowcode</name>
<description>Demo project for Spring Boot</description>
<properties>
@ -13,6 +13,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-boot.version>2.7.6</spring-boot.version>
</properties>
<dependencies>
<dependency>
@ -156,7 +157,7 @@
<version>${spring-boot.version}</version>
<configuration>
<mainClass>com.hxgk.lowcode.LowcodeApplication</mainClass>
<skip>true</skip>
<!--<skip>true</skip>-->
</configuration>
<executions>
<execution>

23
src/main/java/com/hxgk/lowcode/service/impl/HrServiceImpl.java

@ -100,15 +100,15 @@ public class HrServiceImpl implements HrService {
public Tree getOrgAndManTree() {
//先从redis里查一下看看有没有有则直接返回
if(redisTemplate.hasKey("orgTree_309_102")){
String orgTreeStr = redisTemplate.opsForValue().get("orgTree_309_102").toString();
if(redisTemplate.hasKey("orgTree_0_313")){
String orgTreeStr = redisTemplate.opsForValue().get("orgTree_0_313").toString();
Tree o = JSON.parseObject(orgTreeStr, Tree.class);
return o;
}else{
ArrayList<OrgContType> allWsList = new ArrayList();
ArrayList<Tree> treeList = new ArrayList();
Long adminorg = 309L;//高科企管部
Long adminorg = 0L;//恒信集团
//Long adminorg = 309L;//高科企管部
//Long adminorg = 312L;//高科
OrgContType orgContType = queryOrgContTypeByAdminorg(adminorg);
@ -139,12 +139,12 @@ public class HrServiceImpl implements HrService {
recursionListToTree(treeList,pid);
}
for (Tree dept : treeList) {
if(dept.getId().equals("102")){//309高科 102企管
if(dept.getId().equals("313")){//309高科 102企管 313集团
tree = dept;
}
}
String orgAndManTree_Json= JSON.toJSONString(tree);
redisTemplate.opsForValue().set("orgTree_309_102", orgAndManTree_Json, 1, TimeUnit.DAYS);
redisTemplate.opsForValue().set("orgTree_0_313", orgAndManTree_Json, 1, TimeUnit.DAYS);
return tree;
}
@ -197,6 +197,17 @@ public class HrServiceImpl implements HrService {
*/
public OrgContType queryOrgContTypeByAdminorg(Long adminorg) {
if(adminorg==0){
OrgContType orgContType = new OrgContType();
orgContType.setId(0L);
orgContType.setLevel(0);
orgContType.setName("root");
orgContType.setNumbe("rootnumbe");
orgContType.setState((byte) 1);
orgContType.setTypename("根");
orgContType.setSuperior(9999999l);
return orgContType;
}
OrgContType orgContType = orgContTypeMapper.queryLever(adminorg);
return orgContType;
}

6
src/main/resources/application-dev.yml

@ -16,12 +16,6 @@ spring:
datasource:
dynamic:
datasource:
hengxingaoketes:
driver-class-name: com.mysql.cj.jdbc.Driver
password: rjwi58B6zYCHMbGZ
#url: jdbc:mysql://127.0.0.1:3306/hengxingaoke_tes?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
url: jdbc:mysql://172.20.2.87:3306/hengxingaoke_tes?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false
username: hengxingaoke_tes
hrnew:
driver-class-name: com.mysql.cj.jdbc.Driver
password: 9z_Bu28r1*DZ3K6@+a

Loading…
Cancel
Save