Commit 2259e2ec authored by chenzhao's avatar chenzhao

开关图片地址接口

parent 6d74c814
...@@ -423,4 +423,16 @@ public class MonitorFanIdxController extends BaseController { ...@@ -423,4 +423,16 @@ public class MonitorFanIdxController extends BaseController {
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "开关图片API")
@GetMapping("/switchUrl")
public ResponseModel<Map<String,Object>> getElectricQuantityList(
@RequestParam(value = "stationId") String stationId,
@RequestParam(value = "equipName") String equipName
) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getBoosterGatewayId();
return ResponseHelper.buildResponse(monitorFanIndicatorImpl.getSwitchUrl(gatewayId,equipName));
}
} }
package com.yeejoin.amos.boot.module.jxiop.biz.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
@Data
@Accessors(chain = true)
@TableName("switch_picture_url")
public class SwitchPicture {
@TableField(value = "sequence_nbr")
public long sequenceNumber;
@TableField(value = "station_id")
public String stationId;
@TableField(value = "switch_num")
public String switchNum;
@TableField(value = "on_url")
public String onUrl;
@TableField(value = "off_url")
public String offUrl;
}
package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.SwitchPicture;
public interface SwitchPictureMapper extends BaseMapper<SwitchPicture> {
SwitchPicture getSwitchUrl(String stationId,String switchNum);
}
...@@ -19,11 +19,9 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper; ...@@ -19,11 +19,9 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.RegionMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.RegionMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.*; import com.yeejoin.amos.boot.module.jxiop.biz.dto.*;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.AlarmEvent; import com.yeejoin.amos.boot.module.jxiop.biz.entity.*;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.SjglZsjZsbtz;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.TemporaryData;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.TpriDmpDatabook;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.AlarmEventMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.AlarmEventMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SwitchPictureMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SystemEnumMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SystemEnumMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.TemporaryDataMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.TemporaryDataMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils; import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils;
...@@ -68,6 +66,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -68,6 +66,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
@Autowired @Autowired
SystemEnumMapper systemEnumMapper; SystemEnumMapper systemEnumMapper;
@Autowired
SwitchPictureMapper switchPictureMapper;
@Autowired @Autowired
SjglZsjZsbtzServiceImpl sjglZsjZsbtzServiceImpl; SjglZsjZsbtzServiceImpl sjglZsjZsbtzServiceImpl;
...@@ -973,5 +973,23 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -973,5 +973,23 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
} }
} }
public Map<String,Object> getSwitchUrl(String gatewayId,String equipName){
String sql = "SELECT * FROM indicators_"+gatewayId+" WHERE systemType = '开关' and frontModule =~ /"+equipName+"/ and displayName =~/合位$/";
List<IndicatorsDto> listData = influxDButils.getListData(sql, IndicatorsDto.class);
Map<String, Object> photoUrls = new HashMap<>();
for (IndicatorsDto listDatum : listData) {
String url = "";
SwitchPicture switchUrl = switchPictureMapper.getSwitchUrl(gatewayId, listDatum.getDisplayName().split("_")[0]);
if (listDatum.getValue().equals("true")){
url = switchUrl.getOnUrl();
}else {
url = switchUrl.getOffUrl();
}
photoUrls.put(listDatum.getDisplayName().split("_")[0]+"url",url);
}
return photoUrls ;
}
} }
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SwitchPictureMapper">
<select id="getSwitchUrl" resultType="com.yeejoin.amos.boot.module.jxiop.biz.entity.SwitchPicture">
select
*
from
switch_picture_url
where
station_id = #{stationId} and switch_num = #{switchNum}
</select>
</mapper>
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