Merge branch 'lmy20231207-登录返回图片和后端地址' into lmy20231215-动火bug修改
commit
83c43d21f2
|
@ -71,6 +71,9 @@ public class LoginController extends BaseController {
|
|||
@Autowired
|
||||
private PhotoService photoService;
|
||||
|
||||
@Autowired
|
||||
private CorpPathService corpPathService;
|
||||
|
||||
/**
|
||||
* 请求登录验证用户接口
|
||||
*
|
||||
|
@ -253,6 +256,17 @@ public class LoginController extends BaseController {
|
|||
session.setAttribute(Const.ISSUPERVISE, dpd.getString("ISSUPERVISE")); //把当前用户放入session
|
||||
|
||||
FHLOG.save(USERNAME, "成功登录系统", ip); //记录日志
|
||||
|
||||
//查询该用户或企业的图片和后端地址
|
||||
if (!Tools.isEmpty(pd.getString("CORPINFO_ID")) && !pd.getString("CORPINFO_ID").equals("1")) {
|
||||
PageData pathData = corpPathService.getCorpPathByCorpId(pd);
|
||||
map.put("picPath",pathData.getString("PIC_PATH"));
|
||||
map.put("backEndPath", pathData.getString("BACK_END_PATH"));
|
||||
} else {
|
||||
PageData pathData = corpPathService.getCorpPathByPersonInfo(pd);
|
||||
map.put("picPath", pathData.getString("PIC_PATH"));
|
||||
map.put("backEndPath", pathData.getString("BACK_END_PATH"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
token.clear();
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package com.zcloud.mapper.datasource.system;
|
||||
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
/**
|
||||
* 企业图片地址、后端地址访问表
|
||||
*/
|
||||
public interface CorpPathMapper {
|
||||
|
||||
PageData getCorpPathByCorpId(PageData pd);
|
||||
|
||||
PageData getCorpPathByPersonInfo(PageData pd);
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.zcloud.service.system;
|
||||
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
/**
|
||||
* 企业图片地址、后端地址访问表
|
||||
*/
|
||||
public interface CorpPathService {
|
||||
|
||||
/**
|
||||
* 根据企业id获取企业图片、后端路径访问地址
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData getCorpPathByCorpId(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 根据人员信息获取对应企业图片、后端路径访问地址
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData getCorpPathByPersonInfo(PageData pd) throws Exception;
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package com.zcloud.service.system.impl;
|
||||
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.system.CorpPathMapper;
|
||||
import com.zcloud.service.system.CorpPathService;
|
||||
import com.zcloud.util.Tools;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 企业图片地址、后端地址访问表
|
||||
*/
|
||||
@Service
|
||||
public class CorpPathServiceImpl implements CorpPathService {
|
||||
@Autowired
|
||||
private CorpPathMapper corpPathMapper;
|
||||
|
||||
@Value("${corp.default.pic-path}")
|
||||
private String defaultPicPath;
|
||||
|
||||
@Value("${corp.default.back-end-path}")
|
||||
private String defaultBackEndPath;
|
||||
|
||||
/**
|
||||
* 根据企业id获取企业图片、后端路径访问地址
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public PageData getCorpPathByCorpId(PageData pd) throws Exception {
|
||||
PageData data = corpPathMapper.getCorpPathByCorpId(pd);
|
||||
if (Tools.isEmpty(data)) {
|
||||
PageData result = new PageData();
|
||||
result.put("PIC_PATH",defaultPicPath);
|
||||
result.put("BACK_END_PATH", defaultBackEndPath);
|
||||
return result;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据人员信息获取企业图片、后端路径访问地址
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public PageData getCorpPathByPersonInfo(PageData pd) throws Exception {
|
||||
PageData data = corpPathMapper.getCorpPathByPersonInfo(pd);
|
||||
if ("1".equals(pd.getString("USER_ID")) || Tools.isEmpty(data)) {
|
||||
PageData result = new PageData();
|
||||
result.put("PIC_PATH",defaultPicPath);
|
||||
result.put("BACK_END_PATH", defaultBackEndPath);
|
||||
return result;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
|
@ -61,6 +61,9 @@ spring.main.banner-mode=off
|
|||
#
|
||||
#qa-regulatory-gwj.api.url=http://192.168.0.79:8008
|
||||
|
||||
corp.default.pic-path=https://qgqy.qhdsafety.com/file/
|
||||
corp.default.back-end-path=http://192.168.151.57:8092/
|
||||
|
||||
preventionxgf.api.url=http://192.168.0.31:8992/qa-prevention-xgf/
|
||||
qa-regulatory-gwj.api.url=http://192.168.0.31:8992/qa-regulatory-gwj/
|
||||
#?????
|
||||
|
|
|
@ -64,6 +64,9 @@ spring.main.banner-mode=off
|
|||
preventionxgf.api.url=http://192.168.0.79:8088/
|
||||
qa-regulatory-gwj.api.url=http://192.168.0.79:8092/
|
||||
|
||||
corp.default.pic-path=https://qgqy.qhdsafety.com/file/
|
||||
corp.default.back-end-path=http://192.168.151.57:8092/
|
||||
|
||||
#?????
|
||||
smb.host=39.103.224.166
|
||||
smb.port=22
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zcloud.mapper.datasource.system.CorpPathMapper">
|
||||
|
||||
<!--表名 -->
|
||||
<sql id="tableName">
|
||||
SYS_CORP_PATH
|
||||
</sql>
|
||||
|
||||
<!-- 字段 -->
|
||||
<sql id="Field">
|
||||
CORP_PATH_ID,
|
||||
CORPINFO_ID,
|
||||
PIC_PATH,
|
||||
BACK_END_PATH
|
||||
</sql>
|
||||
|
||||
<!-- 字段 -->
|
||||
<sql id="Field2">
|
||||
f.CORP_PATH_ID,
|
||||
f.CORPINFO_ID,
|
||||
f.PIC_PATH,
|
||||
f.BACK_END_PATH
|
||||
</sql>
|
||||
|
||||
<!-- 字段值 -->
|
||||
<sql id="FieldValue">
|
||||
#{CORP_PATH_ID},
|
||||
#{CORPINFO_ID},
|
||||
#{PIC_PATH},
|
||||
#{BACK_END_PATH}
|
||||
</sql>
|
||||
|
||||
<select id="getCorpPathByCorpId" resultType="pd">
|
||||
select
|
||||
<include refid="Field"/>
|
||||
from
|
||||
<include refid="tableName"/>
|
||||
where
|
||||
CORPINFO_ID = #{corpId}
|
||||
</select>
|
||||
|
||||
<select id="getCorpPathByPersonInfo" resultType="pd">
|
||||
select
|
||||
<include refid="Field2"/>
|
||||
from
|
||||
<include refid="tableName"/> f
|
||||
left join `qa-gwj-prevention`.vi_user_all vua on vua.USER_ID = #{USER_ID}
|
||||
where f.CORPINFO_ID = vua.CORPINFO_ID
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue