Commit 175f422b authored by tangwei's avatar tangwei

Merge branch 'develop_dl_plan6_temp' of…

Merge branch 'develop_dl_plan6_temp' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6_temp # Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
parents d012287e 0efbaf08
......@@ -24,6 +24,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.DateTimeUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
......@@ -35,6 +36,8 @@ import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import static org.typroject.tyboot.core.foundation.utils.DateTimeUtil.ISO8601_DATE_HOUR_MIN_SEC;
@RestController
@Api(tags = "监盘总览组态需求 -- API")
@RequestMapping(value = "/supervisionConfigure", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
......@@ -456,7 +459,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
public ResponseModel selectPipePressureDetail(@RequestParam(value = "equipmentSpecificId") String equipmentSpecificId,
@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime
) {
) throws ParseException {
if (!StringUtil.isNotEmpty(equipmentSpecificId)) {
return CommonResponseUtil.success();
}
......@@ -493,14 +496,16 @@ public class SupervisionConfigureController extends AbstractBaseController {
String json1 = JSON.toJSONString(mounthEntity.getResult());
List<Map<String, String>> list = (List<Map<String, String>>) JSONArray.parse(json1);
Collections.reverse(list);
if (!CollectionUtils.isEmpty(list) && list.size() > 30) {
for (int i = 0; i <= 29; i++) {
result.add(list.get(i));
}
} else {
// if (!CollectionUtils.isEmpty(list) && list.size() > 30) {
// for (int i = 0; i <= 29; i++) {
// result.add(list.get(i));
// }
// } else {
// result.addAll(list);
// }
if (!CollectionUtils.isEmpty(list)) {
result.addAll(list);
}
}
List<Map<String, String>> res = new ArrayList<>();
for (Map<String, String> m : result) {
......@@ -531,19 +536,32 @@ public class SupervisionConfigureController extends AbstractBaseController {
return CommonResponseUtil.success(resMap);
}
private String change(String time) {
private String change(String time) throws ParseException {
//进行转化时区
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US);
Date myDate = null;
Date date1 = null;
// if(time.contains("Z")) {
// try {
// myDate = dateFormat.parse(time.replace("Z", "+0000"));
// } catch (ParseException e) {
// e.printStackTrace();
// }
// }
try {
myDate = dateFormat.parse(time.replace("Z", "+0000"));
String strDate = time.substring(0, 19);
SimpleDateFormat sdf = new SimpleDateFormat(ISO8601_DATE_HOUR_MIN_SEC);
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
date1 = sdf.parse(strDate);
} catch (ParseException e) {
e.printStackTrace();
}
return DateTimeUtil.format(date1, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC);
// return times;
//转换为年月日时分秒
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String format = df.format(myDate);
return format;
// DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// return df.format(time);
// return format;
}
}
......@@ -506,7 +506,7 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
// 处理监控和多个电力设备关系(1个摄像头对多个电力装备)
videoImportantEquipments.addAll(this.buildVideoImportantEquipment(fireMap, video.getId(), x.getImportantEquipmentCodes(), rowNum));
}catch (Exception e) {
throw new RuntimeException("系统异常!");
throw new RuntimeException(e.getMessage());
}
}
if (!videoSources.isEmpty()) {
......
......@@ -109,7 +109,7 @@
wel.warehouse_structure_id ,wel.equipment_code
</select>
<select id="selectFireMonitor" resultType="java.util.Map">
SELECT temp.name, temp.alarm ,temp.id,
SELECT temp.name, temp.alarm ,temp.id, temp.code,
IFNULL((SELECT wesi.value FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = temp.id AND wesi.equipment_index_key = 'CAFS_CAFSFireGun_FireGunPressure'
ORDER BY wesi.update_date desc LIMIT 1),0) AS value,
IFNULL((SELECT CASE WHEN wesi.value_label IS NULL OR trim( wesi.value_label ) = '' THEN (CASE
......@@ -127,7 +127,7 @@
ORDER BY wesi.update_date desc LIMIT 1),'--') AS status,
'0' AS flow
FROM(
SELECT wes.id,wes.name,
SELECT wes.id,wes.name,wes.code,
CASE
WHEN ( SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1
AND wes.realtime_iot_index_value = 'true' THEN
......@@ -145,6 +145,7 @@
SELECT
temp.id,
temp.name,
temp.code,
temp.nowLevel,
temp.volume,
temp.unit,
......@@ -179,6 +180,7 @@
SELECT
wes.id,
wes.name,
wes.code,
IFNULL( ( SELECT value FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' ), '--' ) AS nowLevel,
IFNULL( ( SELECT unit FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' ), '--' ) AS unit,
IFNULL(( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxLevel' ) , 0 )AS maxLevel,
......@@ -198,7 +200,7 @@
'1' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
wes.equipment_code as code ,
wes.code as code ,
wes.name,
IFNULL(wes.realtime_iot_index_name,
'暂无信号'
......@@ -222,7 +224,7 @@
'2' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
wes.equipment_code as code ,
wes.code as code ,
wes.name,
IFNULL(wes.realtime_iot_index_name,
'暂无信号'
......@@ -247,7 +249,7 @@
'3' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
wes.equipment_code as code ,
wes.code as code ,
wes.name,
IFNULL(wes.realtime_iot_index_name,
'暂无信号'
......@@ -272,7 +274,7 @@
'4' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
wes.equipment_code as code ,
wes.code as code ,
wes.name,
IFNULL(wes.realtime_iot_index_name,
'暂无信号'
......@@ -1170,6 +1172,7 @@
'未消除'
) cleanStatus,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_code AS code,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
CASE wlesal.equipment_specific_index_value
......
......@@ -2825,6 +2825,7 @@
concat_ws( '-', ws.full_name, ed.area ) area,
es.iot_code,
es.id,
es.code,
IFNULL( sum( `status` ), 0 ) AS isAlarm
FROM
wl_equipment_specific es
......@@ -4681,13 +4682,15 @@
IFNULL( rp.volume, 0 ) AS volume,
ec.image,
r.resource_type,
r.sequence_nbr
r.sequence_nbr,
wes.code
FROM
cb_water_resource r
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_specific_index ei ON ei.equipment_specific_id = rp.level_device_id
LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id
LEFT JOIN f_fire_fighting_system fs ON fs.id = r.belong_fighting_system_id
LEFT JOIN wl_equipment_specific wes ON wes.id = rp.level_device_id
WHERE
r.resource_type = 'industryPool'
AND r.is_delete = 1
......@@ -4707,7 +4710,8 @@
a.volume,
a.image,
a.resource_type,
a.sequence_nbr
a.sequence_nbr,
a.code
FROM
(
SELECT
......@@ -4733,12 +4737,14 @@
ec.image,
r.resource_type,
r.sequence_nbr,
rp.level_device_id
rp.level_device_id,
wes.code
FROM
cb_water_resource r
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id
LEFT JOIN f_fire_fighting_system fs ON fs.id = r.belong_fighting_system_id
LEFT JOIN wl_equipment_specific wes ON wes.id = rp.level_device_id
WHERE
r.resource_type = 'pool'
AND r.is_delete = 1
......
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