|
|
|
@ -5,9 +5,11 @@ import com.hxgk.lowcode.mapper.UserMapper; |
|
|
|
import com.hxgk.lowcode.model.entity.ManCont; |
|
|
|
import com.hxgk.lowcode.model.entity.Tree; |
|
|
|
import com.hxgk.lowcode.model.entity.UserDetail; |
|
|
|
import com.hxgk.lowcode.service.HrService; |
|
|
|
import com.hxgk.lowcode.service.UserService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
import org.springframework.data.redis.core.HashOperations; |
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -23,6 +25,9 @@ public class UserServiceImpl implements UserService { |
|
|
|
private StringRedisTemplate redisTemplate; |
|
|
|
@Autowired |
|
|
|
private UserMapper userMapper; |
|
|
|
@Lazy |
|
|
|
@Autowired |
|
|
|
private HrService hrService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 从redis中根据userkey和usertoken获取userDetail |
|
|
|
@ -132,16 +137,41 @@ public class UserServiceImpl implements UserService { |
|
|
|
@DS("hrnew") |
|
|
|
@Override |
|
|
|
public ManCont getManContByDeviceNo(String paramType,String paramValue) { |
|
|
|
//先从科远库查出该paramValue对应的工号
|
|
|
|
String number = getNumberByDeviceNo(paramValue); |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
try{ |
|
|
|
//先从科远库查出该paramValue对应的工号
|
|
|
|
ManCont manContByDeviceNo = userMapper.getManContByDeviceNo(paramValue); |
|
|
|
return manContByDeviceNo; |
|
|
|
}catch(Exception e){ |
|
|
|
e.printStackTrace(); |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
@DS("hrnew") |
|
|
|
@Override |
|
|
|
public List<String> getAllParentOrgForEmp(ManCont manCont) { |
|
|
|
try{ |
|
|
|
String adminOrgObj = manCont.getAdminOrg().toString(); |
|
|
|
//调用方法判断
|
|
|
|
|
|
|
|
/* 1.获取ownerValue的adminOrgObj(所属行政组织), |
|
|
|
* 2.从1获取到的主部门id向上查询到所有祖先部门数组, |
|
|
|
* 3.查看targetOrgOrPerson是否在2查询到的数组中 |
|
|
|
*/ |
|
|
|
Tree orgAndManTree = hrService.getOrgAndManTree(); |
|
|
|
//所有祖先部门
|
|
|
|
List<String> ancestorIds = orgAndManTree.getAncestorIds(adminOrgObj); |
|
|
|
return ancestorIds; |
|
|
|
}catch(Exception e){ |
|
|
|
e.printStackTrace(); |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String getNumberByDeviceNo(String paramValue) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|