Commit 1f754ad7 authored by tianbo's avatar tianbo

隐患bug修改

parent 2e7d6192
...@@ -63,7 +63,7 @@ public class PermissionInterceptor implements Interceptor { ...@@ -63,7 +63,7 @@ public class PermissionInterceptor implements Interceptor {
MetaObject metaObject = SystemMetaObject.forObject(statementHandler); MetaObject metaObject = SystemMetaObject.forObject(statementHandler);
MappedStatement mappedStatement = (MappedStatement) metaObject.getValue("delegate.mappedStatement"); MappedStatement mappedStatement = (MappedStatement) metaObject.getValue("delegate.mappedStatement");
// TODO 处理mybatis plus // 处理mybatis plus
String dataAuthRule = PermissionInterceptorContext.getDataAuthRule(); String dataAuthRule = PermissionInterceptorContext.getDataAuthRule();
// 被拦截方法 // 被拦截方法
......
...@@ -575,7 +575,10 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -575,7 +575,10 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
Date endDate = new Date(); Date endDate = new Date();
logger.info("-------------------------工作流列表时间" + (endDate.getTime() - startDate.getTime())); logger.info("-------------------------工作流列表时间" + (endDate.getTime() - startDate.getTime()));
JSONArray taskJsonList = respBody.getJSONArray("data"); JSONArray taskJsonList = respBody.getJSONArray("data");
List<JSONObject> taskList = JSONObject.parseArray(taskJsonList.toJSONString(), JSONObject.class); List<JSONObject> taskList = Lists.newArrayList();
if (!ValidationUtil.isEmpty(taskJsonList)) {
taskList = JSONObject.parseArray(taskJsonList.toJSONString(), JSONObject.class);
}
List<String> bussinessKeys = new ArrayList<>(); List<String> bussinessKeys = new ArrayList<>();
for (JSONObject json : taskList) { for (JSONObject json : taskList) {
bussinessKeys.add(json.getString("businessKey")); bussinessKeys.add(json.getString("businessKey"));
...@@ -610,7 +613,12 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -610,7 +613,12 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
List<AgencyUserModel> users = remoteSecurityService.listUserByUserIds(toke, product, appKey, userIdsStr); List<AgencyUserModel> users = remoteSecurityService.listUserByUserIds(toke, product, appKey, userIdsStr);
Map<String, AgencyUserModel> userMap = Maps.uniqueIndex(users, AgencyUserModel::getUserId); Map<String, AgencyUserModel> userMap = Maps.uniqueIndex(users, AgencyUserModel::getUserId);
for (LatentDangerBo bo : dangerList) { for (LatentDangerBo bo : dangerList) {
JSONObject task = taskList.stream().filter(t -> t.getString("businessKey").equals(bo.getBusinessKey())).collect(Collectors.toList()).get(0); List<JSONObject> filterTaskList =
taskList.stream().filter(t -> t.getString("businessKey").equals(bo.getBusinessKey())).collect(Collectors.toList());
if (ValidationUtil.isEmpty(filterTaskList)) {
continue;
}
JSONObject task = filterTaskList.get(0);
LatentDangerListVo vo = new LatentDangerListVo(); LatentDangerListVo vo = new LatentDangerListVo();
vo.setTaskId(task.getString("id")); vo.setTaskId(task.getString("id"));
vo.setDangerId(bo.getId()); vo.setDangerId(bo.getId());
......
...@@ -871,11 +871,13 @@ ...@@ -871,11 +871,13 @@
* *
FROM FROM
p_latent_danger pld p_latent_danger pld
WHERE WHERE 1=1
pld.business_key IN <if test="businessKeys != null and businessKeys.size > 0">
<foreach collection = "businessKeys" item = "businessKey" index="index" open = "(" close = ")" separator = "," > and pld.business_key IN
#{businessKey} <foreach collection = "businessKeys" item = "businessKey" index="index" open = "(" close = ")" separator = "," >
</foreach> #{businessKey}
</foreach>
</if>
<if test="latentDangerListParam.dangerLevel != null and latentDangerListParam.dangerLevel != -1"> <if test="latentDangerListParam.dangerLevel != null and latentDangerListParam.dangerLevel != -1">
and pld.danger_level=#{latentDangerListParam.dangerLevel} and pld.danger_level=#{latentDangerListParam.dangerLevel}
</if> </if>
...@@ -902,11 +904,13 @@ ...@@ -902,11 +904,13 @@
count(*) count(*)
FROM FROM
p_latent_danger pld p_latent_danger pld
WHERE WHERE 1=1
pld.business_key IN <if test="businessKeys != null and businessKeys.size > 0">
<foreach collection = "businessKeys" item = "businessKey" index="index" open = "(" close = ")" separator = "," > and pld.business_key IN
#{businessKey} <foreach collection = "businessKeys" item = "businessKey" index="index" open = "(" close = ")" separator = "," >
</foreach> #{businessKey}
</foreach>
</if>
<if test="latentDangerListParam.dangerLevel != null and latentDangerListParam.dangerLevel != -1"> <if test="latentDangerListParam.dangerLevel != null and latentDangerListParam.dangerLevel != -1">
and pld.danger_level=#{latentDangerListParam.dangerLevel} and pld.danger_level=#{latentDangerListParam.dangerLevel}
</if> </if>
......
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