Commit 2856d284 authored by 张森's avatar 张森

30546 运行趋势页签接口开发

parent fb999bba
package com.yeejoin.equipmanage.common.entity.vo;
import lombok.Data;
@Data
public class EquipTrendInfoVo {
private String id;
private String iotCode;
private String name;
private String maxNum;
private String minNum;
private String unit;
}
package com.yeejoin.equipmanage.common.entity.vo;
import lombok.Data;
import java.util.List;
@Data
public class EquipTrendResultVo {
private List<String> legends;
private String yAxisName;
private List<String> xAxisData;
private List<List<String>> yAxisData;
private List<List<String>> threshold;
}
...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -8,6 +8,7 @@ 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;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.FormInstanceEquip; import com.yeejoin.equipmanage.common.entity.FormInstanceEquip;
import com.yeejoin.equipmanage.common.entity.vo.EquipTrendResultVo;
import com.yeejoin.equipmanage.common.enums.IndexStatusEnum; import com.yeejoin.equipmanage.common.enums.IndexStatusEnum;
import com.yeejoin.equipmanage.common.utils.*; import com.yeejoin.equipmanage.common.utils.*;
import com.yeejoin.equipmanage.config.PersonIdentify; import com.yeejoin.equipmanage.config.PersonIdentify;
...@@ -72,6 +73,9 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -72,6 +73,9 @@ public class SupervisionConfigureController extends AbstractBaseController {
@Autowired @Autowired
private FormInstanceEquipMapper formInstanceEquipMapper; private FormInstanceEquipMapper formInstanceEquipMapper;
@Autowired
private IEquipmentSpecificSerivce equipmentSpecificService;
@PersonIdentify @PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -823,4 +827,50 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -823,4 +827,50 @@ public class SupervisionConfigureController extends AbstractBaseController {
Map<String, Object> list = supervisionVideoService.getPressurePumpPage(bizOrgCode, id, startTime, endTime, pageNum, pageSize, timeSort, stateSort); Map<String, Object> list = supervisionVideoService.getPressurePumpPage(bizOrgCode, id, startTime, endTime, pageNum, pageSize, timeSort, stateSort);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
} }
@PersonIdentify
@RequestMapping(value = "/operatingTrendIot", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "设备平台运行趋势 设备相关API", produces = "application/json;charset=UTF-8", notes = "设备平台运行趋势 设备相关API")
public ResponseModel operatingTrendIot(@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "equipCode", required = false) String equipCode,
@RequestParam(value = "indexKey", required = false) String indexKey) {
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
}
EquipTrendResultVo equipTrendResultVo = equipmentSpecificService.operatingTrendIot(startTime, endTime, bizOrgCode, equipCode, indexKey);
return CommonResponseUtil.success(equipTrendResultVo);
}
@PersonIdentify
@RequestMapping(value = "/operatingTrendWater", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "设备平台运行趋势 稳压泵启动频次趋势API", produces = "application/json;charset=UTF-8", notes = "设备平台运行趋势 稳压泵启动频次趋势API")
public ResponseModel operatingTrendPressurePump(@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "equipCode", required = false) String equipCode,
@RequestParam(value = "indexKey", required = false) String indexKey) {
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
}
EquipTrendResultVo equipTrendResultVo = equipmentSpecificService.operatingTrendPressurePump(startTime, endTime, bizOrgCode, equipCode, indexKey);
return CommonResponseUtil.success(equipTrendResultVo);
}
} }
...@@ -15,7 +15,7 @@ import java.util.Map; ...@@ -15,7 +15,7 @@ import java.util.Map;
* @author DELL * @author DELL
*/ */
//@FeignClient(name = "${iot.vehicle.track}", path = "iot", configuration = {FeignConfiguration.class}) //@FeignClient(name = "${iot.vehicle.track}", path = "iot", configuration = {FeignConfiguration.class})
@FeignClient(name = "AMOS-API-IOT", path = "iot", configuration = { FeignConfiguration.class }) @FeignClient(name = "AMOS-API-IOT-ZS", path = "iot", configuration = { FeignConfiguration.class })
public interface IotFeign { public interface IotFeign {
@RequestMapping(value = "/v1/livedata/list", method = RequestMethod.GET, consumes = "application/json") @RequestMapping(value = "/v1/livedata/list", method = RequestMethod.GET, consumes = "application/json")
......
...@@ -346,4 +346,5 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -346,4 +346,5 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
Integer selectEquipmentCountBySystemId(@Param("systemId") Long systemId); Integer selectEquipmentCountBySystemId(@Param("systemId") Long systemId);
List<EquipTrendInfoVo> getEquipListByCode(@Param("code") String code, @Param("indexKey") String indexKey, @Param("bizOrgCode") String bizOrgCode);
} }
...@@ -329,4 +329,8 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> { ...@@ -329,4 +329,8 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
Page<Map<String, Object>> getFireEquipListByDefineCode(String code, String equipStatus, String bizOrgCode, Page<Map<String, Object>> pageBean); Page<Map<String, Object>> getFireEquipListByDefineCode(String code, String equipStatus, String bizOrgCode, Page<Map<String, Object>> pageBean);
void updateCarStatus(String status, String carId); void updateCarStatus(String status, String carId);
EquipTrendResultVo operatingTrendIot(String startTime, String endTime, String bizOrgCode, String equipCode, String indexKey);
EquipTrendResultVo operatingTrendPressurePump(String startTime, String endTime, String bizOrgCode, String equipCode, String indexKey);
} }
...@@ -2997,4 +2997,40 @@ ...@@ -2997,4 +2997,40 @@
</if> </if>
</select> </select>
<select id="getEquipListByCode" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipTrendInfoVo">
SELECT
a.id,
a.iot_code AS iotCode,
a.`name` AS `name`,
<if test="equipCode == '92011000'">
max( CASE WHEN b.field_name = 'maxPressure' THEN b.field_value END ) AS maxNum,
max( CASE WHEN b.field_name = 'minPressure' THEN b.field_value END ) AS minNum,
concat('压力(', ifnull(c.unit, 'Mpa'), ')') as unit
</if>
<if test="(equipCode == '92032000' and indexKey == 'CAFS_WaterTank_WaterTankLevel') or (equipCode == '92031900')">
max( CASE WHEN b.field_name = 'maxLevel' THEN b.field_value END ) AS maxNum,
max( CASE WHEN b.field_name = 'minLevel' THEN b.field_value END ) AS minNum,
concat('液位(', ifnull(c.unit, 'M'), ')') as unit
</if>
<if test="equipCode == '92032000' and indexKey == 'CAFS_WaterTank_EffluentFlow'">
max( CASE WHEN b.field_name = 'maxLevel' THEN b.field_value END ) AS maxNum,
max( CASE WHEN b.field_name = 'minLevel' THEN b.field_value END ) AS minNum,
concat('出口流量(', ifnull(c.unit, 'L/S'), ')') as unit
</if>
<if test="equipCode == '92010800'">
'频次(次/小时)' as unit
</if>
FROM
`wl_equipment_specific` AS a
LEFT JOIN wl_form_instance_equip b ON a.id = b.instance_id
LEFT JOIN ( SELECT * FROM wl_equipment_specific_index WHERE equipment_index_key = #{indexKey} ) c ON a.id = c.equipment_specific_id
<where>
a.`equipment_code` LIKE concat(#{code}, '%')
<if test="bizOrgCode != null and bizOrgCode != ''">
AND a.biz_org_code LIKE concat(#{bizOrgCode}, '%')
</if>
</where>
GROUP BY
a.id
</select>
</mapper> </mapper>
\ 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