Commit ebfd1321 authored by zhangsen's avatar zhangsen

修改系统状态接口返回格式

parent 37b7f0d5
......@@ -147,7 +147,7 @@
and s.confirm_date like concat(date ,'%')
</where>
) as alarmNums,
date
concat(date ,'时') as date
from
(SELECT
DATE_FORMAT( DATE_ADD( #{beginDateTime}, INTERVAL @s HOUR ),'%Y-%m-%d %H') AS date,
......
......@@ -122,7 +122,7 @@ public class FireStationInfoController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据换流站code统计消防系统状态", notes = "根据换流站code统计消防系统状态")
@GetMapping(value = "/getFireSystemByStationCode")
public ResponseModel<Map<String, Integer>> getFireSystemByStationCode(@ApiParam(value = "换流站编号", required = true) @RequestParam(required = true) String stationCode) {
public ResponseModel<List<Map<String, String>>> getFireSystemByStationCode(@ApiParam(value = "换流站编号", required = true) @RequestParam(required = true) String stationCode) {
if (StrUtil.isEmpty(stationCode)) {
throw new BadRequest("换流站编号不能为空");
}
......
......@@ -164,12 +164,15 @@ public class FireStationInfoServiceImpl extends BaseService<FireStationInfoDto,
return carInfoByStationCode;
}
public Map<String, Integer> getFireSystemByStationCode(String stationCode) {
HashMap<String, Integer> resultMap = new HashMap<>();
public List<Map<String, String>> getFireSystemByStationCode(String stationCode) {
List<Map<String, String>> resultList= new ArrayList<>();
List<FireFightingSystem> mridList = fireFightingSystemMapper.getMridByCode(stationCode);
mridList.forEach(item -> {
resultMap.put(item.getName(), fireEquipmentSignalLogMapper.getAlarmCountByMrid(item.getMrid()));
HashMap<String, String> resultMap = new HashMap<>();
resultMap.put("systemName", item.getName());
resultMap.put("alarmNum", String.valueOf(fireEquipmentSignalLogMapper.getAlarmCountByMrid(item.getMrid())));
resultList.add(resultMap);
});
return resultMap;
return resultList;
}
}
\ 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