Commit 1f754ad7 authored by tianbo's avatar tianbo

隐患bug修改

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