Commit d1e74e53 authored by 张森's avatar 张森

30573 消防资源--> 消防器材配置接口开发, BUG修改

parent 17a1b3e1
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.biz.common.controller; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.biz.common.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...@@ -460,4 +461,30 @@ public class DataDictionaryController extends BaseController { ...@@ -460,4 +461,30 @@ public class DataDictionaryController extends BaseController {
List<Map<String,Object>> listMap = iDataDictionaryService.listUserJobStatistic(bizOrgCode); List<Map<String,Object>> listMap = iDataDictionaryService.listUserJobStatistic(bizOrgCode);
return ResponseHelper.buildResponse(listMap); return ResponseHelper.buildResponse(listMap);
} }
/**
* 新增数据字典 - 存储默认展示视频
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/saveFireEquipConfig", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "存储默认展示视频", notes = "存储默认展示视频")
public boolean saveFireEquipConfig(@RequestParam String ids) {
String type = "ZYGL_XFQC";
LambdaUpdateWrapper<DataDictionary> lambda = new LambdaUpdateWrapper<>();
lambda.eq(DataDictionary::getType, type);
iDataDictionaryService.remove(lambda);
List<DataDictionary> insertList = new ArrayList<>();
String[] split = ids.split(",");
for (int i = 0; i < split.length; i++) {
DataDictionary dataDictionary = new DataDictionary();
dataDictionary.setName(split[i]);
dataDictionary.setCode(split[i]);
dataDictionary.setType(type);
insertList.add(dataDictionary);
}
iDataDictionaryService.saveBatch(insertList);
return Boolean.TRUE;
}
} }
...@@ -859,7 +859,7 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -859,7 +859,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
@RequestParam(value = "endTime", required = false) String endTime, @RequestParam(value = "endTime", required = false) String endTime,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode, @RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "equipCode", required = false) String equipCode, @RequestParam(value = "equipCode", required = false) String equipCode,
@RequestParam(value = "indexKey", required = false) String indexKey) { @RequestParam(value = "indexKey", required = false) String indexKey) throws ParseException {
if (ObjectUtils.isEmpty(bizOrgCode)) { if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity(); ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
......
...@@ -20,6 +20,7 @@ import com.yeejoin.equipmanage.common.vo.*; ...@@ -20,6 +20,7 @@ import com.yeejoin.equipmanage.common.vo.*;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.ParseException;
import java.util.Date; import java.util.Date;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
...@@ -332,5 +333,5 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> { ...@@ -332,5 +333,5 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
EquipTrendResultVo operatingTrendIot(String startTime, String endTime, String bizOrgCode, String equipCode, String indexKey); EquipTrendResultVo operatingTrendIot(String startTime, String endTime, String bizOrgCode, String equipCode, String indexKey);
EquipTrendResultVo operatingTrendPressurePump(String startTime, String endTime, String bizOrgCode, String equipCode, String indexKey); EquipTrendResultVo operatingTrendPressurePump(String startTime, String endTime, String bizOrgCode, String equipCode, String indexKey) throws ParseException;
} }
...@@ -2344,10 +2344,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -2344,10 +2344,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
} }
@Override @Override
public EquipTrendResultVo operatingTrendPressurePump(String startTime, String endTime, String bizOrgCode, String equipCode, String indexKey) { public EquipTrendResultVo operatingTrendPressurePump(String startTime, String endTime, String bizOrgCode, String equipCode, String indexKey) throws ParseException {
// 定义一个DateTimeFormatter来匹配时间字符串的格式 // 定义一个DateTimeFormatter来匹配时间字符串的格式
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
// 使用parse方法将字符串解析为LocalDateTime对象 // 使用parse方法将字符串解析为LocalDateTime对象
LocalDateTime startTimeLocal = LocalDateTime.parse(startTime, formatter); LocalDateTime startTimeLocal = LocalDateTime.parse(startTime, formatter);
LocalDateTime endTimeLocal = LocalDateTime.parse(endTime, formatter); LocalDateTime endTimeLocal = LocalDateTime.parse(endTime, formatter);
...@@ -2386,20 +2385,27 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -2386,20 +2385,27 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("调用AMOS-API-IOT服务失败,请检查服务是否正常!"); throw new RuntimeException("调用AMOS-API-IOT服务失败,请检查服务是否正常!");
} }
HashMap<String, Integer> stringIntegerHashMap = new HashMap<>();
if (200 == entity.getStatus() && !ObjectUtils.isEmpty(entity.getResult())) { if (200 == entity.getStatus() && !ObjectUtils.isEmpty(entity.getResult())) {
String json = JSON.toJSONString(entity.getResult()); String json = JSON.toJSONString(entity.getResult());
List<Map<String, String>> listObject = (List<Map<String, String>>) JSONArray.parse(json); List<Map<String, String>> listObject = (List<Map<String, String>>) JSONArray.parse(json);
List<String> values = new ArrayList<>(); List<String> values = new ArrayList<>();
for (Map<String, String> mapList : listObject) { for (Map<String, String> mapList : listObject) {
if (mapList.containsKey(indexKey)) { String time = change(mapList.get("time")).substring(0, 13);
long countNum = allTimeList.stream().filter(item -> mapList.get("time").contains(item)).count(); if (stringIntegerHashMap.containsKey(time)) {
values.add(String.valueOf(countNum)); stringIntegerHashMap.put(time, stringIntegerHashMap.get(time) + 1);
} else { } else {
values.add("0"); stringIntegerHashMap.put(time, 1);
} }
} }
yaxisList.add(values);
} }
List<String> values = new ArrayList<>();
for (int i = 0; i < allTimeList.size(); i++) {
values.add(stringIntegerHashMap.getOrDefault(allTimeList.get(i), 0).toString());
}
yaxisList.add(values);
} }
equipTrendResultVo.setxAxisData(allTimeList); equipTrendResultVo.setxAxisData(allTimeList);
equipTrendResultVo.setLegends(legends); equipTrendResultVo.setLegends(legends);
......
...@@ -3026,6 +3026,7 @@ ...@@ -3026,6 +3026,7 @@
LEFT JOIN ( SELECT * FROM wl_equipment_specific_index WHERE equipment_index_key = #{indexKey} ) c ON a.id = c.equipment_specific_id LEFT JOIN ( SELECT * FROM wl_equipment_specific_index WHERE equipment_index_key = #{indexKey} ) c ON a.id = c.equipment_specific_id
<where> <where>
a.`equipment_code` LIKE concat(#{code}, '%') a.`equipment_code` LIKE concat(#{code}, '%')
AND a.iot_code is not null AND a.iot_code != ''
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND a.biz_org_code LIKE concat(#{bizOrgCode}, '%') AND a.biz_org_code LIKE concat(#{bizOrgCode}, '%')
</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