Commit c90f673f authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents c5068618 2b350f3b
......@@ -281,7 +281,8 @@
IFNULL(a.post_name, '') as postName,
IFNULL(b.project_name, '') as stationName,
'' as unitName,
IFNULL(a.qrcode_color, 'green') as qrCodeColor
IFNULL(a.qrcode_color, 'green') as qrCodeColor,
IFNULL(a.rec_date, '') AS date
FROM
person_basic a
LEFT JOIN person_account b ON a.sequence_nbr = b.person_id
......
......@@ -317,15 +317,15 @@ public class PersonQrCodeController extends BaseController {
@GetMapping(value = "/getDetailInfoByObjectId")
@ApiOperation(httpMethod = "GET", value = "评估大屏 - 三级弹窗左侧信息API", notes = "评估大屏 - 三级弹窗左侧信息API")
public ResponseModel<Map<String, Object>> getDetailInfoByObjectId(@RequestParam(value = "objectId") String objectId,
@RequestParam(value = "column") String column) {
@RequestParam(value = "column") String column,
@RequestParam(required = false, value = "jobId") String jobId) {
Map<String, Object> resultMap = new HashMap<>();
if ("V1".equals(column)) {
resultMap = personBasicServiceImpl.getPersonDetailInfoByObjectId(objectId);
} else if ("S1".equals(column)) {
resultMap = sjglZsjZsbtzMapper.getEquipDetailInfoByObjectId(objectId);
} else if ("P1".equals(column)) {
// TODO: 2023/9/1 任务sql未处理
resultMap = sjglZsjZsbtzMapper.getJobDetailInfoByObjectId(objectId);
resultMap = sjglZsjZsbtzMapper.getJobDetailInfoByObjectId(jobId);
}
return ResponseHelper.buildResponse(resultMap);
}
......
......@@ -153,10 +153,12 @@
ifnull(a.qrcode_color, '') AS qrCodeColor,
ifnull(b.COMPANY_NAME, '') AS stationName,
ifnull(a.CREATE_TIME, '') as recDate,
GLDJBH AS objectId
a.DBID AS jobId,
c.SBBM as objectId
FROM
fdgl_job_main a
LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE
left join sjgl_zsj_zsbtz c on a.EQUIP_DBID = c.DBID
<where>
<if test="parentCode != null and parentCode != ''">
AND b.ORG_CODE like concat(#{parentCode},'%')
......@@ -199,12 +201,13 @@
<select id="getEquipDetailInfoByObjectId" resultType="java.util.Map">
SELECT
IFNULL(`SBBM`, '') as `name`,
IFNULL(SBMC, '') as `code`,
IFNULL(`SBBM`, '') as `code`,
IFNULL(SBMC, '') as `name`,
IFNULL(GGXH, '') as typeCode,
IFNULL(SCCJ, '') as source,
'' as stationName,
IFNULL(QRCODE_COLOR, 'green') as qrCodeColor
IFNULL(QRCODE_COLOR, 'green') as qrCodeColor,
IFNULL(UPDATE_TIME, '') AS recDate
FROM
sjgl_zsj_zsbtz
where SBBM = #{objectId}
......@@ -212,6 +215,18 @@
</select>
<select id="getJobDetailInfoByObjectId" resultType="java.util.Map">
SELECT
IFNULL(`JOB_DESCRIPTION`, '') as `name`,
case
when QRCODE_COLOR = 'red' then '重大'
when QRCODE_COLOR = 'yellow' then '超时'
else '正常' end as `status`,
IFNULL(QRCODE_COLOR, 'green') as qrCodeColor,
IFNULL(ZFZR, '') as person,
'' as phone,
IFNULL(CREATE_TIME, '') as `recDate`
FROM
fdgl_job_main
where DBID = #{objectId}
</select>
</mapper>
......@@ -45,14 +45,13 @@ public class CommonConstans {
public static final HashMap<String, String> fanStatus = new HashMap<String, String>() {
{
put("发电状态", "正常运行");
put("报警状态", "警运行");
put("停机状态", "正常停机");
put("故障状态", "故障停机");
put("报警状态", "警运行");
put("停机状态", "停机状态");
put("故障状态", "故障状态");
put("待机状态", "待机状态");
put("维护状态", "维护状态");
put("限功率", "实时故障22");
put("限功率", "限功率");
put("通讯中断", "通讯中断");
}
};
// 正常运行 运行=1
......
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -29,6 +31,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.service.IMonitorFanIndicator;
import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
import com.yeejoin.amos.component.robot.BadRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -42,6 +45,8 @@ import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.text.Collator;
import java.text.ParseException;
import java.util.*;
......@@ -100,6 +105,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
@Value("classpath:/json/topic.json")
private Resource topic;
@Value("classpath:/json/fanlocation.json")
private Resource fanlocation;
private List<Map> list;
@Override
......@@ -313,7 +321,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List<IndexDto> equipNumList = influxDButils.getListData(sqlEquipNumList, IndexDto.class);
Map<String, String> collect = influxDBList.stream().collect(Collectors.toMap(IndexDto::getEquipmentNumber, IndexDto::getState, (item1, item2) -> item1));
equipNumList.forEach(item -> {
String status = ObjectUtils.isEmpty(CommonConstans.fanStatus.get(item.getState())) ? "通讯中断" : CommonConstans.fanStatus.get(item.getState());
String status = ObjectUtils.isEmpty(CommonConstans.fanStatus.get(collect.get(item.getEquipmentNumber()))) ? "通讯中断" : CommonConstans.fanStatus.get(collect.get(item.getEquipmentNumber()));
item.setState(status);
});
return equipNumList;
......@@ -421,7 +429,17 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
public IndexDto getFanBasicInfoByEquipNum(String equipNum, String stationId) {
String json = null;
try {
json = IOUtils.toString(fanlocation.getInputStream(), java.lang.String.valueOf(StandardCharsets.UTF_8));
} catch (IOException e) {
e.printStackTrace();
}
JSONArray jsonArray = JSONObject.parseArray(json);
JSONObject jsonObject = (JSONObject) jsonArray.get(Integer.valueOf(equipNum)-1);
IndexDto indexDto = new IndexDto();
indexDto.setLongitude(String.valueOf(jsonObject.get("longitude")));
indexDto.setLatitude(String.valueOf(jsonObject.get("latitude")));
StationBasic stationBasic = getOneByStationNumber(stationId);
String sql = String.format("SELECT equipmentNumber, equipmentSpecificName, equipmentIndexName FROM \"indicators_%s\" WHERE equipmentNumber = '%s' and equipmentIndexName =~/^报警状态|停机状态|故障状态|待机状态|维护状态|正常发电状态$/ and value = 'true' order by time desc limit 1", stationBasic.getFanGatewayId(), equipNum);
List<IndexDto> influxDBList = influxDButils.getListData(sql, IndexDto.class);
......@@ -1170,7 +1188,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List<IndicatorsDto> xyxSqlData = influxDButils.getListData(xyxSql, IndicatorsDto.class);
xyxSqlData.forEach(item -> resultMap.put("xyx" + item.getDisplayName(), keepTwoDecimalPlaces(item.getValue())));
String dlbjSql = String.format("SELECT value, displayName FROM \"indicators_%s\" WHERE systemType = '模拟量' and frontModule = '电量表计'", gatewayId);
String dlbjSql = String.format("SELECT value, displayName FROM \"indicators_%s\" WHERE systemType = '模拟量' and frontModule = '模拟量'", gatewayId);
List<IndicatorsDto> dlbjSqlData = influxDButils.getListData(dlbjSql, IndicatorsDto.class);
// 正向总有功正向总无功需要计算
dlbjSqlData.forEach(item -> {
......
[
{
"euqipmentNumber": "01",
"latitude": "26°19'20.3968",
"longitude": "114°43'01.3487"
},
{
"euqipmentNumber": "02",
"latitude": "26°18'17.3192",
"longitude": "114°43'55.0756"
},
{
"euqipmentNumber": "03",
"latitude": "26°18'34.3219",
"longitude": "114°44'01.4686"
},
{
"euqipmentNumber": "04",
"latitude": "26°18'42.2673",
"longitude": "114°44'10.7522"
},
{
"euqipmentNumber": "05",
"latitude": "26°18'38.0098",
"longitude": "114°44'21.7018"
},
{
"euqipmentNumber": "06",
"latitude": "26°18'34.6466",
"longitude": "114°44'29.9556"
},
{
"euqipmentNumber": "07",
"latitude": "26°18'36.8995",
"longitude": "114°44'39.7470"
},
{
"euqipmentNumber": "08",
"latitude": "26°18'33.5051",
"longitude": "114°44'50.8102"
},
{
"euqipmentNumber": "09",
"longitude": "114°42'38.4597",
"latitude": "26°16'45.3175"
},
{
"euqipmentNumber": "10",
"longitude": "114°42'46.7892",
"latitude": "26°16'34.2193"
},
{
"euqipmentNumber": "11",
"longitude": "114°42'57.3524",
"latitude": "26°16'18.2295"
},
{
"euqipmentNumber": "12",
"longitude": "114°43'44.6453",
"latitude": "26°16'22.9530"
},
{
"euqipmentNumber": "13",
"latitude": "26°16'25.2473",
"longitude": "114°43'55.4240"
},
{
"euqipmentNumber": "14",
"latitude": "26°15'23.8288",
"longitude": "114°42'46.1713"
},
{
"euqipmentNumber": "15",
"latitude": "26°15'18.3501",
"longitude": "114°42'36.4494"
},
{
"euqipmentNumber": "16",
"latitude": "26°15'15.1157",
"longitude": "114°42'24.2207"
},
{
"euqipmentNumber": "17",
"latitude": "26°15'12.3541",
"longitude": "114°42'16.2315"
},
{
"euqipmentNumber": "18",
"latitude": "26°15'07.7590",
"longitude": "114°42'09.1002"
},
{
"euqipmentNumber": "19",
"latitude": "26°15'06.4482",
"longitude": "114°41'59.3730"
},
{
"euqipmentNumber": "20",
"latitude": "26°15'05.7242",
"longitude": "114°41'51.2436"
},
{
"euqipmentNumber": "21",
"latitude": "26°14'54.2353",
"longitude": "114°41'45.1572"
},
{
"euqipmentNumber": "22",
"latitude": "26°14'53.7742",
"longitude": "114°41'35.6931"
},
{
"euqipmentNumber": "23",
"latitude": "26°14'49.6670",
"longitude": "114°41'28.9852"
},
{
"euqipmentNumber": "24",
"latitude": "26°14'52.6637",
"longitude": "114°41'19.3269"
},
{
"euqipmentNumber": "25",
"latitude": "26°14'43.4608",
"longitude": "114°41'12.0974"
},
{
"euqipmentNumber": "26",
"latitude": "26°14'40.3649",
"longitude": "114°41'03.8101"
},
{
"euqipmentNumber": "27",
"latitude": "26°15'33.5730",
"longitude": "114°40'33.7931"
},
{
"euqipmentNumber": "28",
"latitude": "26°15'24.1330",
"longitude": "114°40'51.2196"
},
{
"euqipmentNumber": "29",
"latitude": "26°15'29.4603",
"longitude": "114°40'45.3326"
}
]
\ 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