|
|
|
@ -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; |
|
|
|
} |
|
|
|
|