forked from xxhjsb/wit-park-backend
前台json无法解析问题修改
parent
07387c620e
commit
7a24cc710b
|
@ -4,6 +4,7 @@ import java.util.*;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.hbt.safety.supervision.mapper.HiddenDangerMapper;
|
||||
import com.hbt.safety.supervision.pojo.HiddenDanger;
|
||||
import com.hbt.safety.supervision.pojo.vo.DateVo;
|
||||
|
@ -128,9 +129,9 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService
|
|||
if (list == null) {
|
||||
return "";
|
||||
}
|
||||
Map<Object, List<HiddenDanger>> hiddenDangerMap = list.stream()
|
||||
.collect(Collectors.groupingBy(HiddenDanger::getReformStatus));
|
||||
return JSONObject.toJSONString(hiddenDangerMap);
|
||||
Map<String, List<HiddenDanger>> hiddenDangerMap = list.stream()
|
||||
.collect(Collectors.groupingBy( s -> s.getReformStatus() + ""));
|
||||
return JSON.toJSONString(hiddenDangerMap);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,8 @@ package com.hbt.safety.supervision.service.impl;
|
|||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.hbt.safety.supervision.mapper.RiskMapper;
|
||||
import com.hbt.safety.supervision.pojo.Risk;
|
||||
import com.hbt.safety.supervision.pojo.vo.DateVo;
|
||||
|
@ -107,8 +108,8 @@ public class RiskServiceImpl implements IRiskService
|
|||
if (list == null) {
|
||||
return "";
|
||||
}
|
||||
Map<Object, List<Risk>> map = list.stream().collect(Collectors.groupingBy(Risk::getLevel));
|
||||
return JSONObject.toJSONString(map);
|
||||
Map<String, List<Risk>> map = list.stream().collect(Collectors.groupingBy(s -> s.getLevel() + ""));
|
||||
return JSON.toJSONString(map);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -118,7 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<select id="selectHiddenDangers" resultType="com.hbt.safety.supervision.pojo.HiddenDanger">
|
||||
select name, reform_status reformStatus from hidden_danger where exceed_time_limit_status = 0
|
||||
select id, name, reform_status reformStatus from hidden_danger where exceed_time_limit_status = 0
|
||||
</select>
|
||||
|
||||
<select id="selectHiddenDangerSubmitDat" resultType="String">
|
||||
|
|
|
@ -108,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectRisks" resultType="com.hbt.safety.supervision.pojo.Risk">
|
||||
select name, level from risk
|
||||
select id, name, level from risk
|
||||
</select>
|
||||
|
||||
<select id="selectRiskSubmitDats" resultType="String">
|
||||
|
|
Loading…
Reference in New Issue