优化PAD登录获取服务器地址,获取用户所拥有的机构服务器地址

This commit is contained in:
曹磊 2025-10-10 09:27:00 +08:00
parent 1174c64341
commit 83bd705489
3 changed files with 11 additions and 11 deletions

View File

@ -5,14 +5,14 @@
<select id="getEmployeesOrgListByEmpId" resultType="com.nu.modules.employees.entity.EmployeesOrg">
SELECT
a.org_code as orgCode,
concat(REGEXP_REPLACE(b.url, '/([^/]*)$', '\\'),b.context_path) AS serverUrl
concat(CASE WHEN RIGHT(b.url, 1) = '/' THEN LEFT(b.url, LENGTH(b.url) - 1) ELSE b.url END, b.context_path ) AS serverUrl
FROM nu_biz_employees_org a
LEFT JOIN sys_depart b
ON a.org_code = b.org_code
WHERE a.employees_id = #{employeesId}
AND a.status = '2'
AND a.iz_history = '1'
AND a.iz_freeze = '0'
AND a.iz_freeze = '0'
AND a.iz_history = '1'
AND (a.status = '2' or a.apply_type = '2')
</select>
</mapper>

View File

@ -56,7 +56,7 @@
<select id="getEmployeeInfoByTel" resultType="com.nu.modules.employees.entity.NuEmployeesAdvisoryInfo">
SELECT
adinfo.*,
concat(REGEXP_REPLACE(sd.url, '/([^/]*)$', '\\'),sd.context_path) AS serverUrl
concat(CASE WHEN RIGHT(sd.url, 1) = '/' THEN LEFT(sd.url, LENGTH(sd.url) - 1) ELSE sd.url END, sd.context_path ) AS serverUrl
FROM nu_employees_advisory_info adinfo
LEFT JOIN sys_depart sd
ON adinfo.last_login_org = sd.org_code

View File

@ -99,9 +99,9 @@ public class EmployeesMQListener {
}else{
UpdateWrapper<EmployeesOrg> uwOrg = new UpdateWrapper<>();
uwOrg.eq("employees_id", dto.getEmployeeId());
uwOrg.eq("status", "2");//审批通过
uwOrg.eq("iz_history", "1");//非历史
uwOrg.eq("iz_freeze", "0");//未冻结
uwOrg.eq("iz_history", "1");//非历史
uwOrg.and(c -> c.eq("apply_type","2").or().eq("status","2"));//审批通过
uwOrg.eq("org_code", employeesAd.getLastLoginOrg());//机构
EmployeesOrg empOrg = employeesOrgService.getOne(uwOrg);
if(empOrg!=null){
@ -151,9 +151,9 @@ public class EmployeesMQListener {
public void handleSysuserPwd(SysUserMQDto dto) {
UpdateWrapper<EmployeesOrg> uw = new UpdateWrapper<>();
uw.eq("employees_id", dto.getEmployeeId());
uw.eq("status", "2");//审批通过
uw.eq("iz_history", "1");//非历史
uw.eq("iz_freeze", "0");//未冻结
uw.eq("iz_history", "1");//非历史
uw.and(c -> c.eq("apply_type","2").or().eq("status","2"));//审批通过
List<EmployeesOrg> list = employeesOrgService.list(uw);
if(list.size()>0){
for(int i=0;i<list.size();i++){
@ -209,9 +209,9 @@ public class EmployeesMQListener {
}else{
UpdateWrapper<EmployeesOrg> uwOrg = new UpdateWrapper<>();
uwOrg.eq("employees_id", dto.getEmployeeId());
uwOrg.eq("status", "2");//审批通过
uwOrg.eq("iz_history", "1");//非历史
uwOrg.eq("iz_freeze", "0");//未冻结
uwOrg.eq("iz_history", "1");//非历史
uwOrg.and(c -> c.eq("apply_type","2").or().eq("status","2"));//审批通过
uwOrg.eq("org_code", employeesAd.getLastLoginOrg());//机构
EmployeesOrg empOrg = employeesOrgService.getOne(uwOrg);
if(empOrg!=null){