Commit ad4e80dc authored by 李成龙's avatar 李成龙

安全风险与巡检代码迁移

parent e5ff4e0e
package com.yeejoin.amos.fas.business.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -26,13 +25,16 @@ import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.fas.business.feign.PrivilegeFeign;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.privilege.util.DesUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -45,7 +47,7 @@ import io.swagger.annotations.ApiOperation;
@RestController
@RequestMapping(value = "/api/loginBytoken")
@Api(tags = "通过userName登录Api")
public class LoginController extends AbstractBaseController{
public class LoginController {
private static final Logger logger = LoggerFactory.getLogger(LoginController.class);
......@@ -81,18 +83,17 @@ public class LoginController extends AbstractBaseController{
reginParams = JSON.parseObject(redisTemplate.opsForValue().get(buildKey(userId, token)), ReginParams.class);
if(reginParams == null){
reginParams = new ReginParams();
Map<String, String> param = new HashMap<>();
param.put("loginId", userId);
param.put("password", password);
Object result = privilegeFeign.login(appKey, product, param).getResult();
if (ObjectUtils.isEmpty(result)){
IdPasswordAuthModel dPasswordAuthModel = new IdPasswordAuthModel();
dPasswordAuthModel.setLoginId(userId);
dPasswordAuthModel.setPassword(DesUtil.encode(password, "qaz"));
RequestContext.setProduct(product);
FeignClientResult feignClientResult = Privilege.authClient.idpassword(dPasswordAuthModel);
if (ObjectUtils.isEmpty(feignClientResult.getResult())){
throw new Exception("缺失登录信息");
}
Map<String ,String > re = (Map<String ,String >) result;
Map<String ,String > re = (Map<String, String>) feignClientResult.getResult();
String amosToken = re.get("token");
privilegeFeign.warrant(appKey, product, amosToken);
RequestContext.setToken(amosToken);
RequestContext.setProduct(product);
RequestContext.setAppKey(appKey);
......
......@@ -39,7 +39,7 @@
spe.iot_code,
spe.code as specific_code,
spe.system_id,
(select group_concat(manage.name) FROM `f_fire_fighting_system` as manage where spe.system_id = manage.id) as system_name
(select group_concat(manage.name) FROM `f_fire_fighting_system` as manage where find_in_set(manage.id, spe.system_id)) as system_name
from
(
SELECT amount,
......
......@@ -35,7 +35,7 @@
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.fmeaId},
#{item.pointInputitemId}
#{item.pointInputitemId},
#{item.state}
)
</foreach>
......
......@@ -35,6 +35,7 @@
FROM
`p_point` p
<where>
is_delete = 0
<if test="list != null and list.length > 0">
AND
<foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
......
......@@ -29,4 +29,59 @@
ADD COLUMN `area_name` varchar(255) DEFAULT NULL COMMENT '物理区域名称(数据来源于装备wl_area)';
</sql>
</changeSet>
<changeSet author="maoying" id="16272868380001-1">
<preConditions onFail="MARK_RAN">
<columnExists tableName="p_plan_task" columnName="user_dept"/>
</preConditions>
<comment>MODIFY user_dept </comment>
<sql>
ALTER TABLE `p_plan_task`
MODIFY COLUMN `user_dept` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '人员部门信息';
</sql>
</changeSet>
<changeSet author="maoying" id="16272868380001-2">
<preConditions onFail="MARK_RAN">
<columnExists tableName="p_plan_task" columnName="user_name"/>
</preConditions>
<comment>MODIFY user_name </comment>
<sql>
ALTER TABLE `p_plan_task`
MODIFY COLUMN `user_name` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户姓名' ;
</sql>
</changeSet>
<changeSet author="maoying" id="16272868380001-3">
<preConditions onFail="MARK_RAN">
<columnExists tableName="p_check" columnName="user_id"/>
</preConditions>
<comment>MODIFY user_id </comment>
<sql>
ALTER TABLE `p_check`
MODIFY COLUMN `user_id` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '巡检人id,有可能有多个以,隔开';
</sql>
</changeSet>
<changeSet author="maoying" id="16272868380001-4">
<preConditions onFail="MARK_RAN">
<columnExists tableName="p_check" columnName="dep_id"/>
</preConditions>
<comment>MODIFY dep_id </comment>
<sql>
ALTER TABLE `p_check`
MODIFY COLUMN `dep_id` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '执行部门ids' ;
</sql>
</changeSet>
<changeSet author="maoying" id="16272868380001-5">
<preConditions onFail="MARK_RAN">
<columnExists tableName="p_check" columnName="dep_name"/>
</preConditions>
<comment>MODIFY dep_name </comment>
<sql>
ALTER TABLE `p_check`
MODIFY COLUMN `dep_name` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '执行部门名称';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment