Commit 7ef60dc7 authored by 李秀明's avatar 李秀明

Merge branch 'refs/heads/develop_dl' into develop_bugfix@dl

# Conflicts: # amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/OrgUsrMapper.xml # amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/utils/UnitTransformUtil.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EmergencyController.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/KeyWordsInfoController.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/SupervisionConfigureController.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EmergencyMapper.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/FireFightingSystemMapper.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFireFightingSystemService.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EmergencyServiceImpl.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificSerivceImpl.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/PressurePumpServiceImpl.java # amos-boot-system-equip/src/main/resources/mapper/EmergencyMapper.xml # amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificIndexMapper.xml # amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
parents ce18026f b8c4d588
...@@ -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;
...@@ -462,4 +463,44 @@ public class DataDictionaryController extends BaseController { ...@@ -462,4 +463,44 @@ 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 ResponseModel saveFireEquipConfig(@RequestParam(value = "codes", required = false) String codes) {
String type = "ZYGL_XFQC";
LambdaUpdateWrapper<DataDictionary> lambda = new LambdaUpdateWrapper<>();
lambda.eq(DataDictionary::getType, type);
iDataDictionaryService.remove(lambda);
if (StringUtils.isNotEmpty(codes)) {
List<DataDictionary> insertList = new ArrayList<>();
String[] split = codes.split(",");
for (int i = 0; i < split.length; i++) {
DataDictionary dataDictionary = new DataDictionary();
dataDictionary.setName(split[i]);
dataDictionary.setCode(split[i]);
dataDictionary.setType(type);
dataDictionary.setSortNum(i + 1);
insertList.add(dataDictionary);
}
iDataDictionaryService.saveBatch(insertList);
}
return ResponseHelper.buildResponse(Boolean.TRUE);
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getDictListByType", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典", notes = "根据字典类型查询字典")
public ResponseModel<List<DataDictionary>> getDictListByType(@RequestParam String type) throws Exception {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
List<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
return ResponseHelper.buildResponse(list);
}
} }
...@@ -1217,11 +1217,31 @@ ...@@ -1217,11 +1217,31 @@
cfp.fire_management_post, cfp.fire_management_post,
cft.type_code, cft.type_code,
cf.certificate_number certificatesNumber, cf.certificate_number certificatesNumber,
( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'personNumber' AND dfi.instance_id ( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'personNumber' AND dfi.instance_id = u.sequence_nbr ) AS employee_number,
= u.sequence_nbr ) AS employee_number, ( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'telephone' AND dfi.instance_id = u.sequence_nbr ) AS telephone,
( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'telephone' AND dfi.instance_id = CASE
u.sequence_nbr ) AS telephone, WHEN ( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'peopleType' AND dfi.instance_id = u.sequence_nbr ) = 1602 THEN
( CASE WHEN cfp.post_qualification IS NULL or cfp.post_qualification = '' THEN 0 ELSE 1 END ) AS is_certificate, (
IF
((
SELECT
concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427,1428,1429,1430,1431', ',', ',|' ), ',' )) > 0,
1,
0
)
)
WHEN ( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'peopleType' AND dfi.instance_id = u.sequence_nbr ) = 1601 THEN
(
IF
(
(
concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1823,1824,1825,1826,1827', ',', ',|' ), ',' ) > 0
AND concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425', ',', ',|' ), ',' ) > 0
),
1,
0
)) ELSE 0
END AS is_certificate,
IF IF
( (
( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'peopleType' AND dfi.instance_id = ( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'peopleType' AND dfi.instance_id =
......
...@@ -47,6 +47,9 @@ public class Equipment extends BaseEntity { ...@@ -47,6 +47,9 @@ public class Equipment extends BaseEntity {
@ApiModelProperty(value = "报废期限") @ApiModelProperty(value = "报废期限")
private Short expiryDate; private Short expiryDate;
@ApiModelProperty(value = "四横八纵图片")
private String shbzImg;
private String remark; private String remark;
@ApiModelProperty(value = "管理方式 单件还是批量管理模式,单件S,批量:P") @ApiModelProperty(value = "管理方式 单件还是批量管理模式,单件S,批量:P")
......
...@@ -14,6 +14,8 @@ import lombok.Data; ...@@ -14,6 +14,8 @@ import lombok.Data;
public class EquipCountBySystemVO { public class EquipCountBySystemVO {
@ApiModelProperty(value = "设备定义id") @ApiModelProperty(value = "设备定义id")
private Long equipmentId; private Long equipmentId;
@ApiModelProperty(value = "设备定义Code")
private String equipmentCode;
@ApiModelProperty(value = "设备名称") @ApiModelProperty(value = "设备名称")
private String equipmentName; private String equipmentName;
@ApiModelProperty(value = "设备分类名称") @ApiModelProperty(value = "设备分类名称")
...@@ -24,4 +26,6 @@ public class EquipCountBySystemVO { ...@@ -24,4 +26,6 @@ public class EquipCountBySystemVO {
private String unitName; private String unitName;
@ApiModelProperty(value = "图标") @ApiModelProperty(value = "图标")
private String img; private String img;
@ApiModelProperty(value = "排序字段")
private int sortNum;
} }
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;
public class EquipTrendResultVo {
private List<String> legends;
private String yAxisName;
private List<String> xAxisData;
private List<List<Object>> yAxisData;
private List<List<String>> threshold;
public List<String> getLegends() {
return legends;
}
public void setLegends(List<String> legends) {
this.legends = legends;
}
public String getyAxisName() {
return yAxisName;
}
public void setyAxisName(String yAxisName) {
this.yAxisName = yAxisName;
}
public List<String> getxAxisData() {
return xAxisData;
}
public void setxAxisData(List<String> xAxisData) {
this.xAxisData = xAxisData;
}
public List<List<Object>> getyAxisData() {
return yAxisData;
}
public void setyAxisData(List<List<Object>> yAxisData) {
this.yAxisData = yAxisData;
}
public List<List<String>> getThreshold() {
return threshold;
}
public void setThreshold(List<List<String>> threshold) {
this.threshold = threshold;
}
}
...@@ -10,7 +10,7 @@ public enum PressurePumpEnum { ...@@ -10,7 +10,7 @@ public enum PressurePumpEnum {
ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC", "", LocalDateTime.now().getSecond() + " " + (LocalDateTime.now().getMinute()) + "/5 * * * ?", "5", ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC", "", LocalDateTime.now().getSecond() + " " + (LocalDateTime.now().getMinute()) + "/5 * * * ?", "5",
PressurePumpValueEnum.PUMP_START_TIME.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode(), "【5】分钟"), PressurePumpValueEnum.PUMP_START_TIME.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode(), "【5】分钟"),
ALONE_START_QT("FHS_PressurePump_Start_ALONE_START_QT", PressurePumpCheckEnum.LE.getCode(), "", "5", ALONE_START_QT("FHS_PressurePump_Start_ALONE_START_QT", PressurePumpCheckEnum.BE.getCode(), "0.5", "5",
PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"), PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"),
ALONE_START_QT_WJ("FHS_PressurePump_Start_ALONE_START_QT_WJ", PressurePumpCheckEnum.BE.getCode(), "5", "30", ALONE_START_QT_WJ("FHS_PressurePump_Start_ALONE_START_QT_WJ", PressurePumpCheckEnum.BE.getCode(), "5", "30",
...@@ -19,7 +19,7 @@ public enum PressurePumpEnum { ...@@ -19,7 +19,7 @@ public enum PressurePumpEnum {
ALONE_START_QT_YZ("FHS_PressurePump_Start_ALONE_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60", ALONE_START_QT_YZ("FHS_PressurePump_Start_ALONE_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60",
PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时"), PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时"),
ALL_START_QT_WJ("FHS_PressurePump_Start_ALL_START_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "5", ALL_START_QT_WJ("FHS_PressurePump_Start_ALL_START_QT_WJ", PressurePumpCheckEnum.BE.getCode(), "0.5", "5",
PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"), PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"),
START_QT_WJ_ALL("FHS_PressurePump_Start_ALL_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "5", "30", START_QT_WJ_ALL("FHS_PressurePump_Start_ALL_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "5", "30",
......
...@@ -18,7 +18,8 @@ public enum UnitEnum { ...@@ -18,7 +18,8 @@ public enum UnitEnum {
M("m", "米", ""), M("m", "米", ""),
DM("dm", "分米", ""), DM("dm", "分米", ""),
CM("cm", "厘米", ""), CM("cm", "厘米", ""),
MM("mm", "毫米", ""); MM("mm", "毫米", ""),
LFM("m³", "立方米", "");
private String key; private String key;
......
...@@ -154,6 +154,41 @@ public class UnitTransformUtil { ...@@ -154,6 +154,41 @@ public class UnitTransformUtil {
return map; return map;
} }
public static Map<String, Object> transformValuesLFM(String currentValue, String currentUnit, String minValue, String maxValue) {
Map<String, Object> map = new HashMap<>();
if (UnitEnum.LFM.getKey().equalsIgnoreCase(currentUnit) || UnitEnum.LFM.getName().equals(currentUnit)) {
BigDecimal nowVal = new BigDecimal(0);
if (StringUtil.isNotEmpty(currentValue) && !"--".equals(currentValue)) {
nowVal = new BigDecimal(currentValue);
map.put("nowValue", nowVal.setScale(2, BigDecimal.ROUND_HALF_UP));
} else {
map.put("nowValue", "--");
}
// status 中 0 表示过低;1 表示正常;2 表示过高
if (StringUtil.isNotEmpty(minValue) && !"--".equals(minValue) && StringUtil.isNotEmpty(maxValue)
&& !"--".equals(maxValue) && !"null".equalsIgnoreCase(minValue) && !"null".equalsIgnoreCase(maxValue)) {
if (nowVal.compareTo(new BigDecimal(minValue)) < 0) {
map.put("status", "0");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
} else if (nowVal.compareTo(new BigDecimal(maxValue)) > 0) { // 当前值大于最大值
map.put("status", "2");
map.put("abs", 100);
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 0) {
map.put("status", "1");
map.put("abs", 100);
} else {
map.put("status", "1");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
}
} else {
map.put("status", "--");
map.put("abs", "--");
}
}
map.put("unit", "m³");
return map;
}
private static BigDecimal getPercent(BigDecimal num1, BigDecimal num2) { private static BigDecimal getPercent(BigDecimal num1, BigDecimal num2) {
if (num2.compareTo(BigDecimal.ZERO) == 0) { if (num2.compareTo(BigDecimal.ZERO) == 0) {
return BigDecimal.ZERO; return BigDecimal.ZERO;
......
...@@ -1108,6 +1108,36 @@ public class OrgUsrController extends BaseController { ...@@ -1108,6 +1108,36 @@ public class OrgUsrController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询公司bizOrgCode", notes = "查询公司bizOrgCode") @ApiOperation(httpMethod = "GET", value = "查询公司bizOrgCode", notes = "查询公司bizOrgCode")
@GetMapping(value = "/getCompanyBiz")
public ResponseModel<Map<String, Object>> getCompanyBiz(@RequestParam("bizOrgCode") String bizOrgCode) {
LambdaQueryWrapper<OrgUsr> lambda = new QueryWrapper<OrgUsr>().lambda();
lambda.eq(OrgUsr::getBizOrgCode, bizOrgCode);
lambda.eq(OrgUsr::getIsDelete, false);
if(orgUsrMapper.selectList(lambda).size() > 0) {
Map map = new HashMap();
OrgUsr orgUsr = orgUsrMapper.selectList(lambda).get(0);
try {
OrgUsrFormDto orgUsrFormDto = iOrgUsrService.selectCompanyById(orgUsr.getSequenceNbr());
map.put("bizOrgCode", orgUsrFormDto.getBizOrgCode());
map.put("bizOrgName", orgUsrFormDto.getBizOrgName());
map.put("parentName", orgUsrFormDto.getParentName());
map.put("companyPhone", orgUsrFormDto.getDynamicFormAlert().stream().filter(e->e.getKey().equals("companyPhone")).findFirst().get().getValue());
map.put("code", orgUsrFormDto.getCode());
map.put("dwfz", orgUsrFormDto.getDwfz());
map.put("xfaq", orgUsrFormDto.getXfaq());
map.put("xfgl", orgUsrFormDto.getXfgl());
} catch (Exception e) {
e.printStackTrace();
}
return ResponseHelper.buildResponse(map);
} else {
return ResponseHelper.buildResponse(null);
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询公司bizOrgCode", notes = "查询公司bizOrgCode")
@GetMapping(value = "/getCompany") @GetMapping(value = "/getCompany")
public ResponseModel<String> getBizByAmos(@RequestParam("bizOrgCode") String bizOrgCode) { public ResponseModel<String> getBizByAmos(@RequestParam("bizOrgCode") String bizOrgCode) {
LambdaQueryWrapper<OrgUsr> lambda = new QueryWrapper<OrgUsr>().lambda(); LambdaQueryWrapper<OrgUsr> lambda = new QueryWrapper<OrgUsr>().lambda();
......
...@@ -137,6 +137,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -137,6 +137,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Autowired @Autowired
private StationInfoMapper stationInfoMapper; private StationInfoMapper stationInfoMapper;
@Value("${jcs.company.topic.delete:jcs/company/topic/delete}") @Value("${jcs.company.topic.delete:jcs/company/topic/delete}")
private String airportDeleteTopic; private String airportDeleteTopic;
...@@ -1465,14 +1466,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1465,14 +1466,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
Map<String, String> Dwfz = null; Map<String, String> Dwfz = null;
List<OrgUsr> orgUsrs = getIdByOrgCode(orgUsr.getBizOrgCode(), id); List<OrgUsr> orgUsrs = getIdByOrgCode(orgUsr.getBizOrgCode(), id);
if(orgUsrs!=null){ if(orgUsrs!=null){
List<Long> ids = orgUsrs.stream().map(x -> x.getSequenceNbr()).collect(Collectors.toList()); List<Long> ids = orgUsrs.stream().map(x -> x.getSequenceNbr()).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(ids)) { if (CollectionUtils.isNotEmpty(ids)) {
Xfaq = orgUsrMapper.getManagePerson("消防安全负责人", ids); Xfaq = orgUsrMapper.getManagePerson("消防安全负责人", ids);
Xfgl = orgUsrMapper.getManagePerson("消防安全管理人", ids); Xfgl = orgUsrMapper.getManagePerson("消防安全管理人", ids);
Dwfz = orgUsrMapper.getManagePerson("法定代表人", ids); Dwfz = orgUsrMapper.getManagePerson("法定代表人", ids);
} }
} }
orgUsrFormVo.setXfaq(Xfaq != null ? Xfaq.get("uname") : ""); orgUsrFormVo.setXfaq(Xfaq != null ? Xfaq.get("uname") : "");
orgUsrFormVo.setXfgl(Xfgl != null ? Xfgl.get("uname") : ""); orgUsrFormVo.setXfgl(Xfgl != null ? Xfgl.get("uname") : "");
orgUsrFormVo.setDwfz(Dwfz != null ? Dwfz.get("uname") : ""); orgUsrFormVo.setDwfz(Dwfz != null ? Dwfz.get("uname") : "");
......
...@@ -16,6 +16,7 @@ import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper; ...@@ -16,6 +16,7 @@ import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.service.IFireFightingSystemService; import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -205,4 +206,20 @@ public class BigScreenController extends AbstractBaseController { ...@@ -205,4 +206,20 @@ public class BigScreenController extends AbstractBaseController {
return CommonResponseUtil.success(iFireFightingSystemService.getEquipmentsBySystemInfo(page, systemCode, equipmentCode)); return CommonResponseUtil.success(iFireFightingSystemService.getEquipmentsBySystemInfo(page, systemCode, equipmentCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "设备平台卡片-运行数据接口")
@GetMapping("/system/iot/log")
public ResponseModel getEquipmentsBySystemInfo(CommonPageable commonPageable,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "systemCode",required = false)String systemCode,
@ApiParam(value = "设备名称", required = false) @RequestParam(required = false) String fireEquipmentName,
@ApiParam(value = "开始日期", required = false) @RequestParam(required = false) String startTime,
@ApiParam(value = "结束日期", required = false) @RequestParam(required = false) String endTime) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
return CommonResponseUtil.success(iFireFightingSystemService.getEquipmentRunLogBySysInfo(page, bizOrgCode, systemCode, fireEquipmentName, startTime, endTime));
}
} }
...@@ -155,6 +155,21 @@ public class EmergencyController extends AbstractBaseController { ...@@ -155,6 +155,21 @@ public class EmergencyController extends AbstractBaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("排油系统列表")
@GetMapping(value = "/selectOilDrainageNew")
public Page<Map<String, Object>> selectOilDrainageNew(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode ,
@RequestParam(value = "pageNumber") int pageNumber,
@RequestParam(value = "pageSize") int pageSize,
@RequestParam(value = "code") String code) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
if (ObjectUtils.isEmpty(bizOrgCode)){
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.selectOilDrainageNew(page, bizOrgCode, code);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("气体灭火系统") @ApiOperation("气体灭火系统")
@GetMapping(value = "/selectGasExtinguishing") @GetMapping(value = "/selectGasExtinguishing")
public Page<Map<String, Object>> selectGasExtinguishing(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode , public Page<Map<String, Object>> selectGasExtinguishing(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode ,
...@@ -725,10 +740,11 @@ public class EmergencyController extends AbstractBaseController { ...@@ -725,10 +740,11 @@ public class EmergencyController extends AbstractBaseController {
} }
String sortField = "", sortOrder = ""; String sortField = "", sortOrder = "";
if (org.springframework.util.StringUtils.hasText(sorter)) { if (org.springframework.util.StringUtils.hasText(sorter)) {
sortField = sorter.split("@")[0].equalsIgnoreCase("cleanStatus") ? "clean_time" : sorter.split("@")[0]; sortField = sorter.split("@")[0];
sortOrder = sorter.split("@")[1]; sortOrder = sorter.split("@")[1];
} }
return CommonResponseUtil.success(iEmergencyService.alarmList(page, bizOrgCode, systemCode, types, emergencyLevels, name, cleanStatus, handleStatus, createDate, startDate, endDate, sortField, sortOrder)); return CommonResponseUtil.success(iEmergencyService.alarmList(page, bizOrgCode, systemCode, types, emergencyLevels,
name, cleanStatus, handleStatus, createDate, startDate, endDate, sortField, sortOrder));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
......
package com.yeejoin.equipmanage.controller; package com.yeejoin.equipmanage.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.service.IEquipmentSpecificIndexSerivce; import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
...@@ -13,11 +17,13 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -13,11 +17,13 @@ import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.util.Map;
@Slf4j @Slf4j
@RestController @RestController
@Api(tags = "装备性能指标API") @Api(tags = "装备性能指标API")
@RequestMapping(value = "/equipSpecificIndex") @RequestMapping(value = "/equipSpecificIndex")
public class EquipmentSpecificIndexController { public class EquipmentSpecificIndexController extends AbstractBaseController {
@Autowired @Autowired
private IEquipmentSpecificIndexSerivce equipmentSpecificIndexService; private IEquipmentSpecificIndexSerivce equipmentSpecificIndexService;
...@@ -29,4 +35,24 @@ public class EquipmentSpecificIndexController { ...@@ -29,4 +35,24 @@ public class EquipmentSpecificIndexController {
return equipmentSpecificIndexService.getById(id); return equipmentSpecificIndexService.getById(id);
} }
@RequestMapping(value = "/page", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取性能指标", notes = "获取性能指标")
public IPage<Map<String, Object>> getPage(
@RequestParam(value = "pageNumber", required = false) Integer pageNumber,
@RequestParam(value = "pageSize", required = false) Integer pageSize,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "systemId", required = false) String systemId,
@RequestParam(value = "equipName", required = false) String equipName,
@RequestParam(value = "startDate", required = false) String startDate,
@RequestParam(value = "endDate", required = false) String endDate
) {
if (!StringUtils.hasText(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
}
Page<EquipmentSpecificIndex> page = new Page<>(pageNumber, pageSize);
return equipmentSpecificIndexService.getPage(page, bizOrgCode, systemId, equipName, startDate, endDate);
}
} }
...@@ -130,18 +130,42 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -130,18 +130,42 @@ public class FireFightingSystemController extends AbstractBaseController {
@RequestMapping(value = "/getEquipcountBySystemId", method = RequestMethod.GET) @RequestMapping(value = "/getEquipcountBySystemId", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("根据系统id查询分组设备数量") @ApiOperation("根据系统id查询分组设备数量")
public List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId) { public List<EquipCountBySystemVO> getEquipCountBySystemId(
return fireFightingSystemService.getEquipCountBySystemId(systemId); @RequestParam(value = "systemId", required = false) Long systemId,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode
) {
if (org.apache.commons.lang3.StringUtils.isBlank(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && org.apache.commons.lang3.StringUtils.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
}
return fireFightingSystemService.getEquipCountBySystemId(systemId, bizOrgCode);
} }
@RequestMapping(value = "/getEquipCountPageBySystemId", method = RequestMethod.GET) @RequestMapping(value = "/getEquipCountPageBySystemId", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("根据系统id查询分组设备数量") @ApiOperation("根据系统id查询分组设备数量")
public Page<EquipCountBySystemVO> getEquipCountPageBySystemId(@RequestParam("systemId") Long systemId, public Page<EquipCountBySystemVO> getEquipCountPageBySystemId(
@RequestParam(value = "pageNumber", required = false) Integer pageNumber, @RequestParam(value = "systemId", required = false) Long systemId,
@RequestParam(value = "pageSize", required = false) Integer pageSize @RequestParam(value = "pageNumber", required = false) Integer pageNumber,
@RequestParam(value = "pageSize", required = false) Integer pageSize,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode
) { ) {
return fireFightingSystemService.getEquipCountPageBySystemId(systemId, pageNumber, pageSize); if (org.apache.commons.lang3.StringUtils.isBlank(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && org.apache.commons.lang3.StringUtils.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
}
return fireFightingSystemService.getEquipCountPageBySystemId(systemId, pageNumber, pageSize, bizOrgCode);
}
@RequestMapping(value = "/getFireEquipConfigInfo", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("根据字典查询相关信息")
public List<EquipCountBySystemVO> getFireEquipConfigInfo(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
if (org.apache.commons.lang3.StringUtils.isBlank(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && org.apache.commons.lang3.StringUtils.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
}
return fireFightingSystemService.getFireEquipConfigInfo(bizOrgCode);
} }
@RequestMapping(value = "/getOneById", method = RequestMethod.GET) @RequestMapping(value = "/getOneById", method = RequestMethod.GET)
...@@ -934,8 +958,14 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -934,8 +958,14 @@ public class FireFightingSystemController extends AbstractBaseController {
@ApiOperation(value = "按照组态格式获取设备详情", notes = "按照组态格式获取设备详情") @ApiOperation(value = "按照组态格式获取设备详情", notes = "按照组态格式获取设备详情")
@GetMapping(value = "/getSystemById") @GetMapping(value = "/getSystemById")
public Map<String, Object> getSystemById(Long id) { public Map<String, Object> getSystemById(Long id) {
String bizOrgCode = "";
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
FireFightingSystemEntity fireFightingSystem = fireFightingSystemService.getById(id); FireFightingSystemEntity fireFightingSystem = fireFightingSystemService.getById(id);
List<AlarmDataVO> list1 = fireFightingSystemService.getSystemById(id); List<AlarmDataVO> list1 = fireFightingSystemService.getSystemById(id, bizOrgCode);
Map<String, Object> res = new LinkedHashMap<>(); Map<String, Object> res = new LinkedHashMap<>();
Boolean status = Boolean.TRUE; Boolean status = Boolean.TRUE;
List<Object> ite = new ArrayList<>(); List<Object> ite = new ArrayList<>();
......
...@@ -20,6 +20,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -20,6 +20,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
@Slf4j @Slf4j
...@@ -74,4 +75,16 @@ public class FireResourceSupervisionController extends BaseController { ...@@ -74,4 +75,16 @@ public class FireResourceSupervisionController extends BaseController {
}}; }};
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "设备平台消防资源-消防器材接口", notes = "设备平台消防资源-消防器材接口")
@RequestMapping(value = "/equip/statistic", method = RequestMethod.GET)
public ResponseModel<Object> equipStatistic(@RequestParam(value = "type", required = false) String type, @RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
if (StringUtils.isBlank(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtils.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
}
List<Map<String, Object>> fireEquipStats = iFireResourceSupervisionService.getFireEquipStatistic(type, bizOrgCode);
return ResponseHelper.buildResponse(fireEquipStats);
}
} }
...@@ -41,4 +41,12 @@ public class KeyWordsInfoController extends AbstractBaseController { ...@@ -41,4 +41,12 @@ public class KeyWordsInfoController extends AbstractBaseController {
return CommonResponseUtil.success(resultList); return CommonResponseUtil.success(resultList);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "查询已绑定排油阀的换流变信息 - 根据分类分组", notes = "查询已绑定排油阀的换流变信息 - 根据分类分组")
@RequestMapping(value = "/getFEquipInfoListCategory", method = RequestMethod.GET)
public ResponseModel getFEquipInfoListCategory(@RequestParam(required = false) String bizOrgCode) {
List<Map<String, Object>> resultList = iFireFightingSystemService.getFEquipInfoListCategory(bizOrgCode);
return CommonResponseUtil.success(resultList);
}
} }
...@@ -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)
...@@ -216,7 +220,7 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -216,7 +220,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
} }
float outputFlowRate = Float.parseFloat(String.valueOf(m.get("outputFlowRate"))); float outputFlowRate = Float.parseFloat(String.valueOf(m.get("outputFlowRate")));
if (levelAbsLiter.compareTo(new BigDecimal(0)) != 0 && outputFlowRate != 0) { if (levelAbsLiter.compareTo(new BigDecimal(0)) != 0 && outputFlowRate != 0) {
double availableSeconds = (levelAbsLiter.divide(new BigDecimal(Double.parseDouble(Float.toString(outputFlowRate))), 0, RoundingMode.HALF_UP).doubleValue()); double availableSeconds = (levelAbsLiter.divide(BigDecimal.valueOf(outputFlowRate), 0, RoundingMode.HALF_UP).doubleValue());
m.put("availableTime", String.format("%.1fh", availableSeconds / 3600.0)); m.put("availableTime", String.format("%.1fh", availableSeconds / 3600.0));
} else { } else {
m.put("availableTime", "--"); m.put("availableTime", "--");
...@@ -245,7 +249,7 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -245,7 +249,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
for (Map<String, Object> m : res) { for (Map<String, Object> m : res) {
Map<String, Object> transResult = UnitTransformUtil.transformValues(String.valueOf(m.get("nowLevel")), Map<String, Object> transResult = UnitTransformUtil.transformValues(String.valueOf(m.get("nowLevel")),
String.valueOf(m.get("unit")), String.valueOf(m.get("minLevel")), String.valueOf(m.get("maxLevel"))); String.valueOf(m.get("unit")), String.valueOf(m.get("minLevel")), String.valueOf(m.get("maxLevel")));
// m.put("nowLevel", transResult.get("nowValue")); m.put("nowLevel", transResult.get("nowValue"));
if (StringUtil.isNotEmpty(IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))))) { if (StringUtil.isNotEmpty(IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))))) {
m.put("levelStatus", IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))).getDescribe1()); m.put("levelStatus", IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))).getDescribe1());
} else { } else {
...@@ -823,4 +827,73 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -823,4 +827,73 @@ 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 = "/operatingTrendPressurePump", 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) throws ParseException {
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);
}
@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 operatingTrendWater(@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) throws ParseException {
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.operatingTrendWater(startTime, endTime, bizOrgCode, equipCode, indexKey);
return CommonResponseUtil.success(equipTrendResultVo);
}
} }
...@@ -14,8 +14,7 @@ import java.util.Map; ...@@ -14,8 +14,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 })
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")
......
...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.fegin; ...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.fegin;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto; import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.equipmanage.common.dto.*; import com.yeejoin.equipmanage.common.dto.*;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
...@@ -204,4 +205,10 @@ public interface JcsFeign { ...@@ -204,4 +205,10 @@ public interface JcsFeign {
@GetMapping(value = "/org-usr/getCompany") @GetMapping(value = "/org-usr/getCompany")
FeignClientResult getCompany( @RequestParam(value = "bizOrgCode") String bizOrgCode); FeignClientResult getCompany( @RequestParam(value = "bizOrgCode") String bizOrgCode);
@GetMapping(value = "/data-dictionary/dataDictionaryIdFillMenu")
FeignClientResult<List<DataDictionary>> dataDictionaryIdFillMenu(@RequestParam(value = "type") String type);
@GetMapping(value = "/data-dictionary/getDictListByType")
FeignClientResult<List<DataDictionary>> getDictListByType(@RequestParam(value = "type") String type);
} }
...@@ -53,6 +53,14 @@ public interface EmergencyMapper extends BaseMapper{ ...@@ -53,6 +53,14 @@ public interface EmergencyMapper extends BaseMapper{
*/ */
Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page , @Param("bizOrgCode") String bizOrgCode, @Param("code") String code); Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page , @Param("bizOrgCode") String bizOrgCode, @Param("code") String code);
/**
* 排油系统
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> selectOilDrainageNew(Page<Map<String, Object>> page , @Param("bizOrgCode") String bizOrgCode, @Param("code") String code);
/** /**
* 气体灭火系统 * 气体灭火系统
* @param bizOrgCode * @param bizOrgCode
...@@ -107,12 +115,7 @@ public interface EmergencyMapper extends BaseMapper{ ...@@ -107,12 +115,7 @@ public interface EmergencyMapper extends BaseMapper{
* @param name 设备名称 * @param name 设备名称
* @return * @return
*/ */
Page<Map<String, Object>> alarmList(@Param("page") Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode, Page<Map<String, Object>> alarmList(@Param("page") Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode, @Param("systemCode") String systemCode, @Param("types") List<String> types, @Param("emergencyLevels") List<String> emergencyLevels, @Param("name") String name, @Param("cleanStatus") Integer cleanStatus, @Param("handleStatus") Integer handleStatus , @Param("createDate") String createDate, @Param("startDate") String startDate , @Param("endDate") String endDate, @Param("sortField") String sortField , @Param("sortOrder") String sortOrder);
@Param("systemCode") String systemCode, @Param("types") List<String> types,
@Param("emergencyLevels") List<String> emergencyLevels, @Param("name") String name,
@Param("cleanStatus") Integer cleanStatus, @Param("handleStatus") Integer handleStatus,
@Param("createDate") String createDate , @Param("startDate") String startDate ,
@Param("endDate") String endDate, @Param("sortField") String sortField, @Param("sortOrder") String sortOrder);
List<Map<String, Object>> alarmListNoPage( @Param("bizOrgCode") String bizOrgCode, @Param("systemCode") String systemCode, @Param("types") List<String> types, @Param("emergencyLevels") List<String> emergencyLevels, @Param("name") String name, @Param("cleanStatus") Integer cleanStatus, @Param("handleStatus") Integer handleStatus , @Param("createDate") String createDate , @Param("startDate") String startDate , @Param("endDate") String endDate); List<Map<String, Object>> alarmListNoPage( @Param("bizOrgCode") String bizOrgCode, @Param("systemCode") String systemCode, @Param("types") List<String> types, @Param("emergencyLevels") List<String> emergencyLevels, @Param("name") String name, @Param("cleanStatus") Integer cleanStatus, @Param("handleStatus") Integer handleStatus , @Param("createDate") String createDate , @Param("startDate") String startDate , @Param("endDate") String endDate);
......
package com.yeejoin.equipmanage.mapper; package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.Video; import com.yeejoin.equipmanage.common.entity.Video;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO; import com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO;
...@@ -105,7 +107,7 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif ...@@ -105,7 +107,7 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
List<EquipmentIndexVO> getEquipIndexBySpecificIdIn(@Param("list") List<String> specificDetails); List<EquipmentIndexVO> getEquipIndexBySpecificIdIn(@Param("list") List<String> specificDetails);
List<EquipmentIndexVO> getEquipIndexByIdIn(@Param("list") List<Long> specificIndexIds); List<EquipmentIndexVO> getEquipIndexByIdIn(@Param("list") List<Long> specificIndexIds);
List<Map<String, Object>> getEquipSpecificIndexByUpdateDateDesc(); List<Map<String, Object>> getEquipSpecificIndexByUpdateDateDesc();
List<EquipmentSpecificIndex> getEquipmentSpeIndexByIotCodeTrend(String iotCode, Integer isTrend, String fieldKey); List<EquipmentSpecificIndex> getEquipmentSpeIndexByIotCodeTrend(String iotCode, Integer isTrend, String fieldKey);
...@@ -119,4 +121,13 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif ...@@ -119,4 +121,13 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
List<EquipmentSpecificIndex> getEquipIndexInIndex(@Param("list") List<String> listIndex); List<EquipmentSpecificIndex> getEquipIndexInIndex(@Param("list") List<String> listIndex);
EquipmentSpecificIndex getEquipmentSpeIndexByAddress(String indexAddress, String eventAddress, String gatewayId); EquipmentSpecificIndex getEquipmentSpeIndexByAddress(String indexAddress, String eventAddress, String gatewayId);
IPage<Map<String, Object>> selectEquipIndexPage(
@Param("page") Page<EquipmentSpecificIndex> page,
@Param("bizOrgCode") String bizOrgCode,
@Param("systemId") String systemId,
@Param("equipName") String equipName,
@Param("startDate") String startDate,
@Param("endDate") String endDate
);
} }
...@@ -51,9 +51,9 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -51,9 +51,9 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
* @param systemId * @param systemId
* @return * @return
*/ */
List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId); List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId, String bizOrgCode);
Page<EquipCountBySystemVO> getEquipCountPageBySystemId(@Param("page") Page<Object> page, @Param("systemId") Long systemId); Page<EquipCountBySystemVO> getEquipCountPageBySystemId(@Param("page") Page<Object> page, @Param("systemId") Long systemId, @Param("bizOrgCode") String bizOrgCode);
/** /**
* 保存 * 保存
...@@ -772,7 +772,18 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -772,7 +772,18 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> getSystemTypes(String bizOrgCode); List<Map<String, Object>> getSystemTypes(String bizOrgCode);
List<Map<String, Object>> getFEquipInfoList(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getEquipIndexList(@Param("collect") List<String> collect); List<Map<String, Object>> getEquipIndexList(@Param("collect") List<String> collect);
List<Map<String, Object>> getFEquipInfoList(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getFEquipInfoListCategory(@Param("bizOrgCode") String bizOrgCode);
Page<Map<String, Object>> getEquipmentRunLogBySysInfo(Page page, @Param("bizOrgCode") String bizOrgCode, @Param("systemCode") String systemCode,
@Param("fireEquipmentName") String fireEquipmentName, @Param("startTime") String startTime, @Param("endTime") String endTime);
List<Map<String, Object>> getFireEquipStatistic(@Param("collect") List<String> collect, @Param("bizOrgCode")String bizOrgCode);
List<EquipCountBySystemVO> getFireEquipConfigInfo(@Param("codes") List<String> codes, @Param("bizOrgCode")String bizOrgCode);
} }
...@@ -39,6 +39,8 @@ public interface IEmergencyService { ...@@ -39,6 +39,8 @@ public interface IEmergencyService {
Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page, String bizOrgCode, String code); Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page, String bizOrgCode, String code);
Page<Map<String, Object>> selectOilDrainageNew(Page<Map<String, Object>> page, String bizOrgCode, String code);
Page<Map<String, Object>> selectGasExtinguishing(Page<Map<String, Object>> page, String bizOrgCode, String code); Page<Map<String, Object>> selectGasExtinguishing(Page<Map<String, Object>> page, String bizOrgCode, String code);
Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page, String bizOrgCode); Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page, String bizOrgCode);
......
package com.yeejoin.equipmanage.service; package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.Video; import com.yeejoin.equipmanage.common.entity.Video;
...@@ -77,4 +79,6 @@ public interface IEquipmentSpecificIndexSerivce extends IService<EquipmentSpecif ...@@ -77,4 +79,6 @@ public interface IEquipmentSpecificIndexSerivce extends IService<EquipmentSpecif
List<EquipmentIndexVO> getEquipIndexBySpecificIdIn(List<String> specificDetails); List<EquipmentIndexVO> getEquipIndexBySpecificIdIn(List<String> specificDetails);
List<EquipmentIndexVO> getEquipIndexByIdIn(List<Long> specificIndexIds); List<EquipmentIndexVO> getEquipIndexByIdIn(List<Long> specificIndexIds);
IPage<Map<String, Object>> getPage(Page<EquipmentSpecificIndex> page, String bizOrgCode, String systemId, String equipName, String startDate, String endDate);
} }
...@@ -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;
...@@ -329,4 +330,10 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> { ...@@ -329,4 +330,10 @@ 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) throws ParseException;
EquipTrendResultVo operatingTrendWater(String startTime, String endTime, String bizOrgCode, String equipCode, String indexKey) throws ParseException;
} }
...@@ -58,7 +58,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -58,7 +58,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param systemId * @param systemId
* @return * @return
*/ */
List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId); List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId, String bizOrgCode);
/** /**
* 根据系统id查询分组设备数量 * 根据系统id查询分组设备数量
...@@ -66,7 +66,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -66,7 +66,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param systemId * @param systemId
* @return * @return
*/ */
Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize); Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize, String bizOrgCode);
/** /**
* 保存 * 保存
...@@ -129,7 +129,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -129,7 +129,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param id * @param id
* @return * @return
*/ */
List<AlarmDataVO> getSystemById(Long id); List<AlarmDataVO> getSystemById(Long id, String bizOrgCode);
IPage<EquipmentAlarmBySystemIdOrSourceIdVO> getEquipmentAlarmBySystemIdOrSourceIdVO(IPage<EquipmentAlarmBySystemIdOrSourceIdVO> page,Long sourceId,Long systemId,Integer confirmType,String createDate,String type, String equipmentId); IPage<EquipmentAlarmBySystemIdOrSourceIdVO> getEquipmentAlarmBySystemIdOrSourceIdVO(IPage<EquipmentAlarmBySystemIdOrSourceIdVO> page,Long sourceId,Long systemId,Integer confirmType,String createDate,String type, String equipmentId);
...@@ -312,6 +312,8 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -312,6 +312,8 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
Page<Map<String, Object>> getEquipmentsBySystemInfo(Page page, String companyCode, String systemCode); Page<Map<String, Object>> getEquipmentsBySystemInfo(Page page, String companyCode, String systemCode);
Page<Map<String, Object>> getEquipmentRunLogBySysInfo(Page page, String bizOrgCode, String systemCode, String fireEquipmentName, String startTime, String endTime);
List<Map<String, Object>> getEquipExpiryStatistics(String bizOrgCode, Integer expiryDayNum); List<Map<String, Object>> getEquipExpiryStatistics(String bizOrgCode, Integer expiryDayNum);
Page<Map<String, String>> getEquipExpiryListByPage(String bizOrgCode, Integer expiryDayNum, Page page); Page<Map<String, String>> getEquipExpiryListByPage(String bizOrgCode, Integer expiryDayNum, Page page);
...@@ -359,7 +361,12 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -359,7 +361,12 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
List<OrgMenuDto> getSystemEquipTree(String systemCode); List<OrgMenuDto> getSystemEquipTree(String systemCode);
List<Map<String, Object>> getSystemAlarmNum(String bizOrgCode, String startDate, String endDate);
List<Map<String, Object>> getFEquipInfoList(String bizOrgCode); List<Map<String, Object>> getFEquipInfoList(String bizOrgCode);
List<Map<String, Object>> getFEquipInfoListCategory(String bizOrgCode);
List<EquipCountBySystemVO> getFireEquipConfigInfo(String bizOrgCode);
List<Map<String, Object>> getSystemAlarmNum(String bizOrgCode, String startDate, String endDate);
} }
...@@ -2,6 +2,9 @@ package com.yeejoin.equipmanage.service; ...@@ -2,6 +2,9 @@ package com.yeejoin.equipmanage.service;
import com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO; import com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO;
import java.util.List;
import java.util.Map;
/** /**
* 消防资源监管 * 消防资源监管
*/ */
...@@ -25,4 +28,6 @@ public interface IFireResourceSupervisionService { ...@@ -25,4 +28,6 @@ public interface IFireResourceSupervisionService {
FireResourceStatsDTO getFireCarStats(String bizOrgCode); FireResourceStatsDTO getFireCarStats(String bizOrgCode);
FireResourceStatsDTO getFireEquipStats(String bizOrgCode); FireResourceStatsDTO getFireEquipStats(String bizOrgCode);
List<Map<String, Object>> getFireEquipStatistic(String type, String bizOrgCode);
} }
...@@ -7,10 +7,7 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils; ...@@ -7,10 +7,7 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog;
import com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO; import com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO;
import com.yeejoin.equipmanage.common.entity.vo.EquipTypeImgAmountVO; import com.yeejoin.equipmanage.common.entity.vo.EquipTypeImgAmountVO;
import com.yeejoin.equipmanage.common.enums.EmergencyEquipTypeEnum; import com.yeejoin.equipmanage.common.enums.*;
import com.yeejoin.equipmanage.common.enums.IndexStatusEnum;
import com.yeejoin.equipmanage.common.enums.PressurePumpAnalysisEnum;
import com.yeejoin.equipmanage.common.enums.PressurePumpRelateEnum;
import com.yeejoin.equipmanage.common.utils.StringUtil; import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.utils.UnitTransformUtil; import com.yeejoin.equipmanage.common.utils.UnitTransformUtil;
import com.yeejoin.equipmanage.common.vo.IotDataVO; import com.yeejoin.equipmanage.common.vo.IotDataVO;
...@@ -120,6 +117,10 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -120,6 +117,10 @@ public class EmergencyServiceImpl implements IEmergencyService {
for (Map<String, Object> m : list) { for (Map<String, Object> m : list) {
Map<String, Object> transResult = UnitTransformUtil.transformValues(String.valueOf(m.get("value")), Map<String, Object> transResult = UnitTransformUtil.transformValues(String.valueOf(m.get("value")),
String.valueOf(m.get("unit")), String.valueOf(m.get("minLevel")), String.valueOf(m.get("maxLevel"))); String.valueOf(m.get("unit")), String.valueOf(m.get("minLevel")), String.valueOf(m.get("maxLevel")));
if (UnitEnum.LFM.getKey().equalsIgnoreCase(String.valueOf(m.get("unit"))) || UnitEnum.LFM.getName().equals(String.valueOf(m.get("unit")))) {
transResult = UnitTransformUtil.transformValuesLFM(String.valueOf(m.get("value")),
String.valueOf(m.get("unit")), String.valueOf(m.get("minLevel")), String.valueOf(m.get("maxLevel")));
}
m.put("value", transResult.get("nowValue")); m.put("value", transResult.get("nowValue"));
if (StringUtil.isNotEmpty(IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))))) { if (StringUtil.isNotEmpty(IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))))) {
m.put("statusDesc", IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))).getDescribe1()); m.put("statusDesc", IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))).getDescribe1());
...@@ -133,6 +134,11 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -133,6 +134,11 @@ public class EmergencyServiceImpl implements IEmergencyService {
} else { } else {
m.put("sxyl", transResult.get("abs")); m.put("sxyl", transResult.get("abs"));
} }
if (UnitEnum.LFM.getKey().equalsIgnoreCase(String.valueOf(m.get("unit"))) || UnitEnum.LFM.getName().equals(String.valueOf(m.get("unit")))) {
m.put("abs", transResult.get("abs") + "%");
}
m.put("unit", transResult.get("unit").toString());
} }
} }
return Optional.ofNullable(list).orElse(Lists.newArrayList()); return Optional.ofNullable(list).orElse(Lists.newArrayList());
...@@ -162,6 +168,12 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -162,6 +168,12 @@ public class EmergencyServiceImpl implements IEmergencyService {
Map<String, Object> transResult = UnitTransformUtil.transformValues(String.valueOf(m.get("nowLevel")), Map<String, Object> transResult = UnitTransformUtil.transformValues(String.valueOf(m.get("nowLevel")),
String.valueOf(m.get("unit")), String.valueOf(m.get("minLevel")), String.valueOf(m.get("maxLevel"))); String.valueOf(m.get("unit")), String.valueOf(m.get("minLevel")), String.valueOf(m.get("maxLevel")));
// m.put("nowLevel", transResult.get("nowValue")); // m.put("nowLevel", transResult.get("nowValue"));
if (UnitEnum.LFM.getKey().equalsIgnoreCase(String.valueOf(m.get("unit"))) || UnitEnum.LFM.getName().equals(String.valueOf(m.get("unit")))) {
transResult = UnitTransformUtil.transformValuesLFM(String.valueOf(m.get("nowLevel")),
String.valueOf(m.get("unit")), String.valueOf(m.get("minLevel")), String.valueOf(m.get("maxLevel")));
}
if (StringUtil.isNotEmpty(IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))))) { if (StringUtil.isNotEmpty(IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))))) {
m.put("status", IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))).getDescribe1()); m.put("status", IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))).getDescribe1());
} else { } else {
...@@ -174,6 +186,12 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -174,6 +186,12 @@ public class EmergencyServiceImpl implements IEmergencyService {
} else { } else {
m.put("abs", transResult.get("abs")); m.put("abs", transResult.get("abs"));
} }
if (UnitEnum.LFM.getKey().equalsIgnoreCase(String.valueOf(m.get("unit"))) || UnitEnum.LFM.getName().equals(String.valueOf(m.get("unit")))) {
m.put("abs", transResult.get("abs") + "%");
}
m.put("unit", transResult.get("unit").toString());
m.put("nowLevel", transResult.get("nowValue").toString());
} }
} }
return page1; return page1;
...@@ -185,6 +203,11 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -185,6 +203,11 @@ public class EmergencyServiceImpl implements IEmergencyService {
} }
@Override @Override
public Page<Map<String, Object>> selectOilDrainageNew(Page<Map<String, Object>> page, String bizOrgCode, String code) {
return emergencyMapper.selectOilDrainageNew(page, bizOrgCode, code);
}
@Override
public Page<Map<String, Object>> selectGasExtinguishing(Page<Map<String, Object>> page, String bizOrgCode, String code) { public Page<Map<String, Object>> selectGasExtinguishing(Page<Map<String, Object>> page, String bizOrgCode, String code) {
return emergencyMapper.selectGasExtinguishing(page, bizOrgCode, code); return emergencyMapper.selectGasExtinguishing(page, bizOrgCode, code);
} }
...@@ -643,12 +666,8 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -643,12 +666,8 @@ public class EmergencyServiceImpl implements IEmergencyService {
@Override @Override
public Page<Map<String, Object>> alarmList(Page<Map<String, Object>> page, String bizOrgCode, String systemCode, public Page<Map<String, Object>> alarmList(Page<Map<String, Object>> page, String bizOrgCode, String systemCode, List<String> types, List<String> emergencyLevels, String name, Integer cleanStatus, Integer handleStatus,String createDate,String startDate,String endDate,String sortField,String sortOrder) {
List<String> types, List<String> emergencyLevels, String name, Integer cleanStatus, return emergencyMapper.alarmList(page, bizOrgCode, systemCode, types, emergencyLevels, name, cleanStatus, handleStatus, createDate, startDate, endDate, sortField, sortOrder);
Integer handleStatus,String createDate,String startDate,String endDate,
String sortField,String sortOrder) {
return emergencyMapper.alarmList(page, bizOrgCode, systemCode, types, emergencyLevels, name, cleanStatus,
handleStatus, createDate, startDate, endDate, sortField, sortOrder);
} }
//稳压泵定时向缓存中存昨日启动次数任务 //稳压泵定时向缓存中存昨日启动次数任务
......
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
...@@ -11,6 +13,8 @@ import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce; ...@@ -11,6 +13,8 @@ import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -97,4 +101,15 @@ public class EquipmentSpecificIndexSerivceImpl extends ServiceImpl<EquipmentSpec ...@@ -97,4 +101,15 @@ public class EquipmentSpecificIndexSerivceImpl extends ServiceImpl<EquipmentSpec
} }
} }
@Override
public IPage<Map<String, Object>> getPage(Page<EquipmentSpecificIndex> page, String bizOrgCode, String systemId, String equipName, String startDate, String endDate) {
IPage<Map<String, Object>> resultPage = this.baseMapper.selectEquipIndexPage(page, bizOrgCode, systemId, equipName, startDate, endDate);
resultPage.getRecords().forEach(record -> {
String updateDate = record.getOrDefault("updateDate", "").toString();
LocalDateTime dateTime = LocalDateTime.parse(updateDate);
String formattedDate = dateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
record.put("updateDate", formattedDate);
});
return resultPage;
}
} }
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.component.robot.BadRequest; import com.yeejoin.amos.component.robot.BadRequest;
import com.yeejoin.equipmanage.common.entity.Equipment;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity; import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemGroupEntity; import com.yeejoin.equipmanage.common.entity.FireFightingSystemGroupEntity;
import com.yeejoin.equipmanage.common.entity.SystemEquipmentRelationEntity; import com.yeejoin.equipmanage.common.entity.SystemEquipmentRelationEntity;
...@@ -16,14 +17,17 @@ import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper; ...@@ -16,14 +17,17 @@ import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.mapper.FireFightingSystemGroupMapper; import com.yeejoin.equipmanage.mapper.FireFightingSystemGroupMapper;
import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper; import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.service.FireFightingSystemGroupService; import com.yeejoin.equipmanage.service.FireFightingSystemGroupService;
import com.yeejoin.equipmanage.service.IEquipmentService;
import com.yeejoin.equipmanage.service.IFireFightingSystemService; import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import com.yeejoin.equipmanage.service.SystemEquipmentRelationService; import com.yeejoin.equipmanage.service.SystemEquipmentRelationService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Slf4j @Slf4j
...@@ -39,6 +43,8 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting ...@@ -39,6 +43,8 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
private EquipmentSpecificMapper equipmentSpecificMapper; private EquipmentSpecificMapper equipmentSpecificMapper;
@Autowired @Autowired
private IFireFightingSystemService fireFightingSystemService; private IFireFightingSystemService fireFightingSystemService;
@Autowired
private IEquipmentService equipmentService;
/** /**
* 获取消防系统列表 * 获取消防系统列表
...@@ -230,6 +236,16 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting ...@@ -230,6 +236,16 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
} }
} }
// 查询装备定义的图片 List to Map -> key: equipmentId, value: equipmentEntity
Set<Long> equipmentIds = systemEquipmentMap.values().stream().flatMap(list -> list.stream().map(SystemEquipmentRelationEntity::getEquipmentId)).collect(Collectors.toSet());
Map<Long, Equipment> equipmentImageMap = equipmentService.list(
Wrappers.<Equipment>lambdaQuery()
.select(Equipment::getId, Equipment::getShbzImg, Equipment::getImg)
.in(!equipmentIds.isEmpty(), Equipment::getId, equipmentIds)
).stream().map(equipmentEntity -> new HashMap<Long, Equipment>() {{
put(equipmentEntity.getId(), equipmentEntity);
}}).collect(Collectors.toMap(map -> map.keySet().iterator().next(), map -> map.values().iterator().next()));
// List to Map -> key: systemId@equipmentId, value: 装备定义数量Map // List to Map -> key: systemId@equipmentId, value: 装备定义数量Map
List<Map<String, Object>> equipmentCountList = equipmentSpecificMapper.getEquipmentCount(bizOrgCode); List<Map<String, Object>> equipmentCountList = equipmentSpecificMapper.getEquipmentCount(bizOrgCode);
Map<String, Map<String, Object>> equipmentCountMap = new HashMap<>(); Map<String, Map<String, Object>> equipmentCountMap = new HashMap<>();
...@@ -241,11 +257,13 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting ...@@ -241,11 +257,13 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
String uniqueKey = id + "@" + equipmentId; String uniqueKey = id + "@" + equipmentId;
if (equipmentCountMap.containsKey(uniqueKey)) { if (equipmentCountMap.containsKey(uniqueKey)) {
Map<String, Object> objectMap = equipmentCountMap.get(uniqueKey); Map<String, Object> objectMap = equipmentCountMap.get(uniqueKey);
objectMap.put("count", Long.parseLong(map.getOrDefault("count", "0").toString()) + Long.parseLong(objectMap.getOrDefault("count", 0).toString())); long count = Long.parseLong(map.getOrDefault("count", "0").toString()) + Long.parseLong(objectMap.getOrDefault("count", 0).toString());
objectMap.put("count", count);
} }
equipmentCountMap.put(uniqueKey, map); equipmentCountMap.put(uniqueKey, map);
} }
} }
List<Map<String, Long>> systemEquipCountMaps = equipmentSpecificMapper.getEquipmentCountBySystemId(bizOrgCode, systemIds);
// 构建分组对象 // 构建分组对象
JSONArray groups = new JSONArray(); JSONArray groups = new JSONArray();
...@@ -279,17 +297,28 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting ...@@ -279,17 +297,28 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
Long equipmentId = relationEntity.getEquipmentId(); Long equipmentId = relationEntity.getEquipmentId();
if (equipmentCountMap.containsKey(systemId + "@" + equipmentId)) { if (equipmentCountMap.containsKey(systemId + "@" + equipmentId)) {
Map<String, Object> equipmentMap = equipmentCountMap.get(systemId + "@" + equipmentId); Map<String, Object> equipmentMap = equipmentCountMap.get(systemId + "@" + equipmentId);
Equipment imageEquipment = equipmentImageMap.get(equipmentId);
Map<String, Object> equipment = new HashMap<>(); Map<String, Object> equipment = new HashMap<>();
equipment.put("id", equipmentMap.get("equipmentId")); equipment.put("id", equipmentMap.get("equipmentId"));
equipment.put("name", equipmentMap.get("equipmentName")); equipment.put("name", equipmentMap.get("equipmentName"));
equipment.put("num", Integer.valueOf(equipmentMap.getOrDefault("count", "0").toString())); equipment.put("num", Integer.valueOf(equipmentMap.getOrDefault("count", "0").toString()));
equipment.put("unit", equipmentMap.get("unit")); equipment.put("unit", equipmentMap.get("unit"));
if (Objects.nonNull(imageEquipment)) {
equipment.put("img", StringUtils.hasText(imageEquipment.getShbzImg()) ? imageEquipment.getShbzImg() : imageEquipment.getImg());
}
equipment.put("sort", relationEntity.getSort()); equipment.put("sort", relationEntity.getSort());
equipment.put("type", relationEntity.getType()); equipment.put("type", relationEntity.getType());
equipments.add(equipment); equipments.add(equipment);
} }
} }
system.put("equipments", equipments); system.put("equipments", equipments);
AtomicLong equipmentCount = new AtomicLong(0);
systemEquipCountMaps.forEach(map -> {
if (String.valueOf(map.get("systemId")).matches(".*" + systemId + ".*")) {
equipmentCount.addAndGet(Long.parseLong(map.getOrDefault("count", 0L).toString()));
}
});
system.put("equipmentCount", equipmentCount.get());
systems.add(system); systems.add(system);
} }
groups.add(group); groups.add(group);
......
...@@ -16,6 +16,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -16,6 +16,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto; import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext; import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
...@@ -206,13 +207,13 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -206,13 +207,13 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
private StockDetailMapper stockDetailMapper; private StockDetailMapper stockDetailMapper;
@Override @Override
public List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId) { public List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId, String bizOrgCode) {
return this.baseMapper.getEquipCountBySystemId(systemId); return this.baseMapper.getEquipCountBySystemId(systemId, bizOrgCode);
} }
@Override @Override
public Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize) { public Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize, String bizOrgCode) {
return this.baseMapper.getEquipCountPageBySystemId(new Page(pageNumber, pageSize), systemId); return this.baseMapper.getEquipCountPageBySystemId(new Page(pageNumber, pageSize), systemId, bizOrgCode);
} }
...@@ -1232,22 +1233,24 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1232,22 +1233,24 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
@Override @Override
public List<AlarmDataVO> getSystemById(Long id) { public List<AlarmDataVO> getSystemById(Long id, String bizOrgCode) {
List<AlarmDataVO> list = this.baseMapper.getSystemById(id); List<AlarmDataVO> list = this.baseMapper.getSystemById(id);
// 部件总数 // 部件总数
Integer equipmentCount = equipmentSpecificMapper.selectCount( Integer equipmentCount = equipmentSpecificMapper.selectCount(
Wrappers.<EquipmentSpecific>lambdaQuery() Wrappers.<EquipmentSpecific>lambdaQuery()
.eq(EquipmentSpecific::getSystemId, id) .like(EquipmentSpecific::getSystemId, id)
.eq(EquipmentSpecific::getSingle, true) .isNotNull(EquipmentSpecific::getEquipmentCode)
.likeRight(StringUtils.hasText(bizOrgCode), EquipmentSpecific::getBizOrgCode, bizOrgCode)
); );
// 未复归设备 // 未复归设备
List<EquipmentSpecificAlarmLog> equipSpecIds = equipmentSpecificAlarmLogMapper.selectList( List<EquipmentSpecificAlarm> equipSpecIds = equipmentSpecificAlarmMapper.selectList(
Wrappers.<EquipmentSpecificAlarmLog>lambdaQuery() Wrappers.<EquipmentSpecificAlarm>lambdaQuery()
.select(EquipmentSpecificAlarmLog::getEquipmentSpecificId) .select(EquipmentSpecificAlarm::getEquipmentSpecificId)
.like(EquipmentSpecificAlarmLog::getSystemIds, id) .like(EquipmentSpecificAlarm::getSystemIds, id)
.eq(EquipmentSpecificAlarmLog::getStatus, "1") .eq(EquipmentSpecificAlarm::getStatus, "1")
.likeRight(StringUtils.hasText(bizOrgCode), EquipmentSpecificAlarm::getBizOrgCode, bizOrgCode)
); );
int count = (int) equipSpecIds.stream().map(EquipmentSpecificAlarmLog::getEquipmentSpecificId).distinct().count(); int count = (int) equipSpecIds.stream().map(EquipmentSpecificAlarm::getEquipmentSpecificId).distinct().count();
list.add(new AlarmDataVO("部件总数", equipmentCount + " 个", false)); list.add(new AlarmDataVO("部件总数", equipmentCount + " 个", false));
list.add(new AlarmDataVO("未复归设备", count + " 个", false)); list.add(new AlarmDataVO("未复归设备", count + " 个", false));
return list; return list;
...@@ -2896,6 +2899,11 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2896,6 +2899,11 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return fireFightingSystemMapper.getEquipmentsBySystemInfo(page, null, systemCode, equipmentCode); return fireFightingSystemMapper.getEquipmentsBySystemInfo(page, null, systemCode, equipmentCode);
} }
@Override
public Page<Map<String, Object>> getEquipmentRunLogBySysInfo(Page page, String bizOrgCode, String systemCode, String fireEquipmentName, String startTime, String endTime) {
return fireFightingSystemMapper.getEquipmentRunLogBySysInfo(page, bizOrgCode, systemCode, fireEquipmentName, startTime, endTime);
}
public static List<OrgMenuDto> systemAndEquipmentTreeNew(List<Map<String,Object>> list) { public static List<OrgMenuDto> systemAndEquipmentTreeNew(List<Map<String,Object>> list) {
List<OrgMenuDto> menuList = list.stream() List<OrgMenuDto> menuList = list.stream()
.map(o -> new OrgMenuDto(Long.parseLong(o.get("id").toString()), o.get("name").toString(), .map(o -> new OrgMenuDto(Long.parseLong(o.get("id").toString()), o.get("name").toString(),
...@@ -2928,6 +2936,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2928,6 +2936,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return result; return result;
} }
@Override @Override
public List<Map<String, Object>> getFEquipInfoList(String bizOrgCode) { public List<Map<String, Object>> getFEquipInfoList(String bizOrgCode) {
List<Map<String, Object>> list = this.baseMapper.getFEquipInfoList(bizOrgCode); List<Map<String, Object>> list = this.baseMapper.getFEquipInfoList(bizOrgCode);
...@@ -2978,4 +2987,75 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2978,4 +2987,75 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
List<Map<String, Object>> closeList = Collections.singletonList(closeMap); List<Map<String, Object>> closeList = Collections.singletonList(closeMap);
return CollUtil.isNotEmpty(resultList) ? resultList : closeList; return CollUtil.isNotEmpty(resultList) ? resultList : closeList;
} }
@Override
public List<Map<String, Object>> getFEquipInfoListCategory(String bizOrgCode) {
List<DataDictionary> zdsbfl = jcsFeignClient.dataDictionaryIdFillMenu("ZDSBFL").getResult();
List<Map<String, Object>> list = this.baseMapper.getFEquipInfoListCategory(bizOrgCode);
ArrayList<String> strings = new ArrayList<>();
list.forEach(item -> {
String equipIds = item.get("equipIds").toString();
strings.addAll(Arrays.asList(equipIds.split(",")));
});
List<String> collect = strings.stream().distinct().collect(Collectors.toList());
List<Map<String, Object>> equipIndexList = this.baseMapper.getEquipIndexList(collect);
Map<String, Map<String, Object>> equipmentSpecificId = equipIndexList.stream().collect(Collectors.toMap(item -> item.get("equipmentSpecificId").toString(), item -> item));
List<Map<String, Object>> resultList = new ArrayList<>();
list.forEach(item -> {
int isOpen = 0;
Date updateDate = null;
String equipIds = item.get("equipIds").toString();
String[] equipIdList = equipIds.split(",");
for (String index : equipIdList) {
if (ObjectUtil.isNotEmpty(equipmentSpecificId)
&& equipmentSpecificId.containsKey(index)
&& equipmentSpecificId.get(index).containsKey("equipmentIndexKey")
&& equipmentSpecificId.get(index).get("equipmentIndexKey").toString().equals("ONL_DrainOilValve_Open")) {
Map<String, Object> map = equipmentSpecificId.get(index);
isOpen = 1;
if (updateDate == null) {
updateDate = DateUtil.parse(map.get("updateDate").toString(), DatePattern.NORM_DATETIME_PATTERN);
} else {
int comparisonResult = DateUtil.compare(updateDate, DateUtil.parse(map.get("updateDate").toString(), DatePattern.NORM_DATETIME_PATTERN));
updateDate = comparisonResult < 0 ? DateUtil.parse(map.get("updateDate").toString(), DatePattern.NORM_DATETIME_PATTERN) : updateDate;
}
}
}
HashMap<String, Object> resultMap = new HashMap<>();
resultMap.put("id", item.get("id"));
resultMap.put("name", item.get("name"));
resultMap.put("time", updateDate);
resultMap.put("drainDuration", item.get("drainDuration"));
resultMap.put("category", item.get("category"));
if (isOpen == 1) {
resultMap.put("status", "start");
} else {
resultMap.put("status", "stop");
}
resultList.add(resultMap);
});
List<Map<String, Object>> listNew = new ArrayList<>();
Map<String, List<Map<String, Object>>> categoryMap = resultList.stream().collect(Collectors.groupingBy(t -> t.get("category").toString()));
zdsbfl.forEach(item -> {
HashMap<String, Object> map = new HashMap<>();
map.put("code", item.getTreeCode());
map.put("name", item.getName());
map.put("items", categoryMap.get(item.getTreeCode()));
listNew.add(map);
});
return listNew;
}
@Override
public List<EquipCountBySystemVO> getFireEquipConfigInfo(String bizOrgCode) {
List<DataDictionary> fireConfigInfoList = jcsFeignClient.getDictListByType("ZYGL_XFQC").getResult();
if (CollUtil.isEmpty(fireConfigInfoList)) {
return new ArrayList<>();
}
Map<String, Integer> collect = fireConfigInfoList.stream().collect(Collectors.toMap(DataDictionary::getCode, DataDictionary::getSortNum));
List<String> codes = fireConfigInfoList.stream().map(DataDictionary::getCode).collect(Collectors.toList());
List<EquipCountBySystemVO> fireEquipConfigInfo = this.baseMapper.getFireEquipConfigInfo(codes, bizOrgCode);
fireEquipConfigInfo.forEach(item -> item.setSortNum(collect.getOrDefault(item.getEquipmentCode(), 1)));
return fireEquipConfigInfo.stream().sorted(Comparator.comparingInt(EquipCountBySystemVO::getSortNum)).collect(Collectors.toList());
}
} }
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO; import com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO;
import com.yeejoin.equipmanage.common.enums.EmergencyEquipTypeEnum; import com.yeejoin.equipmanage.common.enums.EmergencyEquipTypeEnum;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.fegin.JcsFeign;
import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper; import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.service.IFireResourceSupervisionService; import com.yeejoin.equipmanage.service.IFireResourceSupervisionService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -19,6 +26,9 @@ public class IFireResourceSupervisionServiceImpl implements IFireResourceSupervi ...@@ -19,6 +26,9 @@ public class IFireResourceSupervisionServiceImpl implements IFireResourceSupervi
@Autowired @Autowired
private FireFightingSystemMapper fireFightingSystemMapper; private FireFightingSystemMapper fireFightingSystemMapper;
@Autowired
JcsFeign jcsFeignClient;
/** /**
* 消防系统信息 * 消防系统信息
* *
...@@ -64,6 +74,19 @@ public class IFireResourceSupervisionServiceImpl implements IFireResourceSupervi ...@@ -64,6 +74,19 @@ public class IFireResourceSupervisionServiceImpl implements IFireResourceSupervi
return buildFireResourceStatsDTO(resultMap); return buildFireResourceStatsDTO(resultMap);
} }
@Override
public List<Map<String, Object>> getFireEquipStatistic(String type, String bizOrgCode) {
List<DataDictionary> dictionaryList = jcsFeignClient.dataDictionaryIdFillMenu(StringUtil.isNotEmpty(type) ? type : "ZYGL_XFQC").getResult();
List<String> list = new ArrayList<>();
if (!CollectionUtils.isEmpty(dictionaryList)) {
dictionaryList.forEach(x -> {
list.add(x.getTreeCode());
});
}
List<Map<String, Object>> resultMap = fireFightingSystemMapper.getFireEquipStatistic(list, bizOrgCode);
return resultMap;
}
private FireResourceStatsDTO buildFireResourceStatsDTO(Map<String, Object> resultMap) { private FireResourceStatsDTO buildFireResourceStatsDTO(Map<String, Object> resultMap) {
FireResourceStatsDTO fireResourceStats = new FireResourceStatsDTO(); FireResourceStatsDTO fireResourceStats = new FireResourceStatsDTO();
fireResourceStats.setTotalCounts(Long.parseLong(resultMap.get("totalCount").toString())); fireResourceStats.setTotalCounts(Long.parseLong(resultMap.get("totalCount").toString()));
......
...@@ -526,6 +526,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -526,6 +526,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
StringBuilder endIndex = new StringBuilder(iotCode).insert(8, '/'); StringBuilder endIndex = new StringBuilder(iotCode).insert(8, '/');
String iotTopic = "influxdb/" + endIndex; String iotTopic = "influxdb/" + endIndex;
JSONObject msg = new JSONObject(); JSONObject msg = new JSONObject();
msg.put("traceId", equipmentSpeIndex.getId() + "");
msg.put(equipmentSpeIndex.getEquipmentIndexKey(), value); msg.put(equipmentSpeIndex.getEquipmentIndexKey(), value);
mqttSendGateway.sendToMqtt(iotTopic, JSON.toJSONString(msg)); mqttSendGateway.sendToMqtt(iotTopic, JSON.toJSONString(msg));
...@@ -586,7 +587,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -586,7 +587,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
saveEquipmentAlarmReportDay(equipmentSpeIndex, alarmFlag); saveEquipmentAlarmReportDay(equipmentSpeIndex, alarmFlag);
// 指标告警处理 // 指标告警处理
if (equipmentSpeIndex.getIsAlarm() != null && 1 == equipmentSpeIndex.getIsAlarm()) { if (equipmentSpeIndex.getIsAlarm() != null && 1 == equipmentSpeIndex.getIsAlarm() && !equipmentSpeIndex.getEquipmentIndexKey().equals(pressurePumpStart)) {
equipmentSpecificAlarms.addAll(createIndexAlarmRecord(equipmentSpeIndex, messageBodyMap)); equipmentSpecificAlarms.addAll(createIndexAlarmRecord(equipmentSpeIndex, messageBodyMap));
} }
// 遥测遥信数据推送云端kafka // 遥测遥信数据推送云端kafka
...@@ -648,6 +649,16 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -648,6 +649,16 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override @Override
public void afterCommit() { public void afterCommit() {
iotDatalist.forEach(iotDataVO -> {
String indexKey = iotDataVO.getKey();
String indexValue = iotDataVO.getValue().toString();
// 稳压泵启停信号处理
if (indexKey.equals(pressurePumpStart)) {
pressurePump(indexKey, indexValue, iotDatalist, topicEntity);
}
});
equipmentSpecificAlarms.forEach(action -> { equipmentSpecificAlarms.forEach(action -> {
if (AlarmStatusEnum.BJ.getCode() == action.getStatus()) { if (AlarmStatusEnum.BJ.getCode() == action.getStatus()) {
alarmLogs.add(addEquipAlarmLogRecord(action)); alarmLogs.add(addEquipAlarmLogRecord(action));
...@@ -803,10 +814,12 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -803,10 +814,12 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
return; return;
} }
String iotCode = equipmentSpecific.getIotCode(); String iotCode = equipmentSpecific.getIotCode();
topicEntity.setIotCode(iotCode);
StringBuilder endIndex = new StringBuilder(iotCode).insert(8, '/'); StringBuilder endIndex = new StringBuilder(iotCode).insert(8, '/');
String iotTopic = "influxdb/" + endIndex; String iotTopic = "influxdb/" + endIndex;
JSONObject msg = new JSONObject(); JSONObject msg = new JSONObject();
msg.put(equipmentSpeIndex.getEquipmentIndexKey(), value); msg.put(equipmentSpeIndex.getEquipmentIndexKey(), value);
msg.put("traceId", equipmentSpeIndex.getId() + "");
mqttSendGateway.sendToMqtt(iotTopic, JSON.toJSONString(msg)); mqttSendGateway.sendToMqtt(iotTopic, JSON.toJSONString(msg));
List<EquipmentSpecificVo> eqIotCodeList = iEquipmentSpecificSerivce.getEquipAndCarIotcodeByIotcode(iotCode); List<EquipmentSpecificVo> eqIotCodeList = iEquipmentSpecificSerivce.getEquipAndCarIotcodeByIotcode(iotCode);
...@@ -865,7 +878,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -865,7 +878,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
saveEquipmentAlarmReportDay(equipmentSpeIndex, alarmFlag); saveEquipmentAlarmReportDay(equipmentSpeIndex, alarmFlag);
// 指标告警处理 // 指标告警处理
if (equipmentSpeIndex.getIsAlarm() != null && 1 == equipmentSpeIndex.getIsAlarm()) { if (equipmentSpeIndex.getIsAlarm() != null && 1 == equipmentSpeIndex.getIsAlarm() && !equipmentSpeIndex.getEquipmentIndexKey().equals(pressurePumpStart)) {
equipmentSpecificAlarms.addAll(createIndexAlarmRecord(equipmentSpeIndex, messageBodyMap)); equipmentSpecificAlarms.addAll(createIndexAlarmRecord(equipmentSpeIndex, messageBodyMap));
} }
// 遥测遥信数据推送云端kafka // 遥测遥信数据推送云端kafka
...@@ -926,6 +939,16 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -926,6 +939,16 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override @Override
public void afterCommit() { public void afterCommit() {
iotDatalist.forEach(iotDataVO -> {
String indexKey = iotDataVO.getKey();
String indexValue = iotDataVO.getValue().toString();
// 稳压泵启停信号处理
if (indexKey.equals(pressurePumpStart)) {
pressurePump(indexKey, indexValue, iotDatalist, topicEntity);
}
});
equipmentSpecificAlarms.forEach(action -> { equipmentSpecificAlarms.forEach(action -> {
if (AlarmStatusEnum.BJ.getCode() == action.getStatus()) { if (AlarmStatusEnum.BJ.getCode() == action.getStatus()) {
alarmLogs.add(addEquipAlarmLogRecord(action)); alarmLogs.add(addEquipAlarmLogRecord(action));
...@@ -2721,6 +2744,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2721,6 +2744,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
// } // }
private void pressurePump(String indexKey, String indexValue, List<IotDataVO> iotDatalist, TopicEntityVo topicEntity) { private void pressurePump(String indexKey, String indexValue, List<IotDataVO> iotDatalist, TopicEntityVo topicEntity) {
log.info("开始处理稳压泵逻辑:{}值:{}", indexKey, indexValue);
List<String> listIndex = new ArrayList<>(); List<String> listIndex = new ArrayList<>();
listIndex.add(pressurePumpStart); listIndex.add(pressurePumpStart);
// 获取全部启停泵信号 // 获取全部启停泵信号
...@@ -2748,6 +2772,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2748,6 +2772,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
PressurePumpValueEnum valueEnum = PressurePumpValueEnum.getByCode(pressurePumpEnum.getCompareValue()); PressurePumpValueEnum valueEnum = PressurePumpValueEnum.getByCode(pressurePumpEnum.getCompareValue());
assert valueEnum != null; assert valueEnum != null;
EquipmentSpecificIndex data = getPressurePumpDateByType(indexKey, valueEnum, topicEntity, equipmentSpeIndexList, pressurePumpEnum); EquipmentSpecificIndex data = getPressurePumpDateByType(indexKey, valueEnum, topicEntity, equipmentSpeIndexList, pressurePumpEnum);
log.info("稳压泵获取{}, 值为{}", valueEnum.getDescribe(), data);
Date newDate = new Date(); Date newDate = new Date();
// 2. 校验 // 2. 校验
if (!ObjectUtils.isEmpty(data.getUpdateDate())) { if (!ObjectUtils.isEmpty(data.getUpdateDate())) {
...@@ -2768,13 +2793,13 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2768,13 +2793,13 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
EquipmentSpecificIndex equipmentSpecificIndex = new EquipmentSpecificIndex(); EquipmentSpecificIndex equipmentSpecificIndex = new EquipmentSpecificIndex();
String prefix = null; String prefix = null;
String suffix = null; String suffix = null;
if (iotCode.length() > 8) { if (!StringUtils.isEmpty(iotCode) && iotCode.length() > 8) {
prefix = iotCode.substring(0, 8); prefix = iotCode.substring(0, 8);
suffix = iotCode.substring(8); suffix = iotCode.substring(8);
} else { } else {
log.error("错误的物联编码是:", topicEntity.getIotCode());
throw new BadRequest("装备物联编码错误,请确认!"); throw new BadRequest("装备物联编码错误,请确认!");
} }
switch (valueEnum) { switch (valueEnum) {
case LAST_STOP: case LAST_STOP:
List<EquipmentSpecificIndex> lastStop = equipmentSpeIndexList.stream().filter(e -> List<EquipmentSpecificIndex> lastStop = equipmentSpeIndexList.stream().filter(e ->
...@@ -2874,6 +2899,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2874,6 +2899,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
assert pumpCheckEnum != null; assert pumpCheckEnum != null;
String leftValue = pressurePumpEnum.getLeftValue(); String leftValue = pressurePumpEnum.getLeftValue();
String rightValue = pressurePumpEnum.getRightValue(); String rightValue = pressurePumpEnum.getRightValue();
log.info("检验方式:{},大于:{},小于:{}, 间隔:{}", pumpCheckEnum.getDescribe(), leftValue, rightValue, diff);
switch (pumpCheckEnum) { switch (pumpCheckEnum) {
case LE: case LE:
if (StringUtil.isNotEmpty(rightValue)) { if (StringUtil.isNotEmpty(rightValue)) {
......
...@@ -141,7 +141,7 @@ public class PressurePumpServiceImpl implements IPressurePumpService { ...@@ -141,7 +141,7 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
String time = split.length > 0 ? (split[split.length - 1]) : ""; String time = split.length > 0 ? (split[split.length - 1]) : "";
try { try {
Date date = DateUtils.convertStrToDate(time, DateUtils.DATE_PATTERN); Date date = DateUtils.convertStrToDate(time, DateUtils.DATE_PATTERN);
// 结束日期不包含今天,获取3天前数据 // 结束日期不包含今天,获取3天前数据 改为统计近三天 包含当天
if (DateUtils.dateCompare(date, startDate) >= 0 && DateUtils.dateCompare(endDate, date) >= 0) { if (DateUtils.dateCompare(date, startDate) >= 0 && DateUtils.dateCompare(endDate, date) >= 0) {
list.add(JSON.parseObject(redisUtils.get(x).toString(), PressurePumpCountVo.class)); list.add(JSON.parseObject(redisUtils.get(x).toString(), PressurePumpCountVo.class));
} }
......
...@@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.DateTimeUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -40,6 +41,7 @@ import java.util.concurrent.atomic.AtomicInteger; ...@@ -40,6 +41,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static org.typroject.tyboot.core.foundation.context.RequestContext.*; import static org.typroject.tyboot.core.foundation.context.RequestContext.*;
import static org.typroject.tyboot.core.foundation.utils.DateTimeUtil.ISO8601_DATE_HOUR_MIN_SEC;
@Slf4j @Slf4j
...@@ -49,7 +51,7 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap ...@@ -49,7 +51,7 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
@Autowired @Autowired
SupervisionVideoMapper supervisionVideoMapper; SupervisionVideoMapper supervisionVideoMapper;
@Autowired @Autowired
private IVideoService videoService; private IVideoService videoService;
@Autowired @Autowired
...@@ -129,7 +131,7 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap ...@@ -129,7 +131,7 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
// 近3天启动平均值,四合五入 // 近3天启动平均值,四合五入
AtomicInteger dayAvgFrequency = new AtomicInteger(); AtomicInteger dayAvgFrequency = new AtomicInteger();
try { try {
Date startDate = com.yeejoin.amos.boot.biz.common.utils.DateUtils.dateAddDays(dateNow, Integer.parseInt(PressurePumpRelateEnum.DAY_AVG.getValue())); Date startDate = com.yeejoin.amos.boot.biz.common.utils.DateUtils.dateAddDays(dateNow, Integer.parseInt(PressurePumpRelateEnum.DAY_AVG.getValue()) + 1);
String startTime = String.join(" ", com.yeejoin.amos.boot.biz.common.utils.DateUtils.dateFormat(startDate, com.yeejoin.amos.boot.biz.common.utils.DateUtils.DATE_PATTERN), "00:00:00"); String startTime = String.join(" ", com.yeejoin.amos.boot.biz.common.utils.DateUtils.dateFormat(startDate, com.yeejoin.amos.boot.biz.common.utils.DateUtils.DATE_PATTERN), "00:00:00");
String endTime = String.join(" ", com.yeejoin.amos.boot.biz.common.utils.DateUtils.dateFormat(dateNow, com.yeejoin.amos.boot.biz.common.utils.DateUtils.DATE_PATTERN), "23:59:59"); String endTime = String.join(" ", com.yeejoin.amos.boot.biz.common.utils.DateUtils.dateFormat(dateNow, com.yeejoin.amos.boot.biz.common.utils.DateUtils.DATE_PATTERN), "23:59:59");
Map<String, List<PressurePumpCountVo>> dayAvgDataMap = pressurePumpService.getDateRangeCountList(pumpInfoList, startTime,endTime, PressurePumpRelateEnum.PRESSURE_PUMP.getValue(), countRedisKey, equipmentCode, pressurePumpStart, countExpire, bizOrgCode); Map<String, List<PressurePumpCountVo>> dayAvgDataMap = pressurePumpService.getDateRangeCountList(pumpInfoList, startTime,endTime, PressurePumpRelateEnum.PRESSURE_PUMP.getValue(), countRedisKey, equipmentCode, pressurePumpStart, countExpire, bizOrgCode);
...@@ -344,7 +346,11 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap ...@@ -344,7 +346,11 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("id", UUID.randomUUID().toString()); map.put("id", UUID.randomUUID().toString());
map.put("name", String.valueOf(item.get("name"))); map.put("name", String.valueOf(item.get("name")));
map.put("time", String.valueOf(x.get("time")).substring(0, 19).replace("T", " ")); try {
map.put("time", change(String.valueOf(x.get("time"))));
} catch (ParseException e) {
throw new RuntimeException(e);
}
map.put("value", String.valueOf(x.get(pressurePumpStart))); map.put("value", String.valueOf(x.get(pressurePumpStart)));
finalResList.add(map); finalResList.add(map);
}); });
...@@ -386,4 +392,17 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap ...@@ -386,4 +392,17 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
public List<Map<String, Object>> selectAllPressureName(String bizOrgCode) { public List<Map<String, Object>> selectAllPressureName(String bizOrgCode) {
return fireFightingSystemMapper.selectAllPressureName(bizOrgCode); return fireFightingSystemMapper.selectAllPressureName(bizOrgCode);
} }
private String change(String time) throws ParseException {
Date date1 = null;
try {
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);
}
} }
...@@ -4,6 +4,8 @@ import org.springframework.beans.BeanUtils; ...@@ -4,6 +4,8 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeanWrapper; import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl; import org.springframework.beans.BeanWrapperImpl;
import liquibase.util.StringUtil;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
...@@ -33,6 +35,11 @@ public class BeanUtil { ...@@ -33,6 +35,11 @@ public class BeanUtil {
public static boolean judgePropertyContainsChar(String sourceStr, String specialStr) { public static boolean judgePropertyContainsChar(String sourceStr, String specialStr) {
boolean bool = Boolean.FALSE; boolean bool = Boolean.FALSE;
if(StringUtil.isEmpty(sourceStr) || StringUtil.isEmpty(specialStr)){
return bool;
}
specialStr = specialStr.trim();
sourceStr = sourceStr.trim();
String[] strings = specialStr.split(","); String[] strings = specialStr.split(",");
for (String code : strings) { for (String code : strings) {
if (sourceStr.contains(code)) { if (sourceStr.contains(code)) {
......
...@@ -178,13 +178,13 @@ public class InputItemController extends AbstractBaseController { ...@@ -178,13 +178,13 @@ public class InputItemController extends AbstractBaseController {
// } else if (!StringUtils.isNotEmpty(finalTypeName) && StringUtils.isNotEmpty(facilitiesTypeName)) { // } else if (!StringUtils.isNotEmpty(finalTypeName) && StringUtils.isNotEmpty(facilitiesTypeName)) {
// finalTypeName = facilitiesTypeName; // finalTypeName = facilitiesTypeName;
// } // }
if (inputItemVo.getCustomType().equals("1") && inputItemVo.getKeyPartsType().equals("1")) { if ("1".equals(inputItemVo.getCustomType()) && "1".equals(inputItemVo.getKeyPartsType())) {
finalTypeName = ""; finalTypeName = "";
} else if (inputItemVo.getCustomType().equals("0") && inputItemVo.getKeyPartsType().equals("1")) { } else if ("0".equals(inputItemVo.getCustomType()) && "1".equals(inputItemVo.getKeyPartsType())) {
finalTypeName = "自定义巡检点"; finalTypeName = "自定义巡检点";
} else if (inputItemVo.getCustomType().equals("1") && inputItemVo.getKeyPartsType().equals("0")) { } else if ("1".equals(inputItemVo.getCustomType()) && "0".equals(inputItemVo.getKeyPartsType())) {
finalTypeName = "重点部位类型"; finalTypeName = "重点部位类型";
} else if (inputItemVo.getCustomType().equals("0") && inputItemVo.getKeyPartsType().equals("0")) { } else if ("0".equals(inputItemVo.getCustomType()) && "0".equals(inputItemVo.getKeyPartsType())) {
finalTypeName = "自定义巡检点" + "," + "重点部位类型"; finalTypeName = "自定义巡检点" + "," + "重点部位类型";
} }
inputItemVo.setTypeName(finalTypeName); inputItemVo.setTypeName(finalTypeName);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</parent> </parent>
<artifactId>amos-boot-system-equip</artifactId> <artifactId>amos-boot-system-equip</artifactId>
<version>3.7.2.0</version> <version>3.7.2.3</version>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
......
...@@ -1141,7 +1141,9 @@ ...@@ -1141,7 +1141,9 @@
<changeSet author="keyong" id="168623599"> <changeSet author="keyong" id="168623599">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<tableExists tableName="wl_car" /> <not>
<columnExists tableName="wl_car" columnName="max_speed"/>
</not>
</preConditions> </preConditions>
<comment>新增属性数据</comment> <comment>新增属性数据</comment>
<sql> <sql>
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
( 0 <![CDATA[<>]]> find_in_set( `fs`.`id`, `wesa`.`system_ids` ) ( 0 <![CDATA[<>]]> find_in_set( `fs`.`id`, `wesa`.`system_ids` )
AND `wesa`.`status` = 1)) > 0 AND `wesa`.`status` = 1)) > 0
), ),
'异常', '告警',
'正常' '正常'
) AS `status` ) AS `status`
FROM FROM
...@@ -246,38 +246,31 @@ ...@@ -246,38 +246,31 @@
wel.warehouse_structure_id ,wel.equipment_code wel.warehouse_structure_id ,wel.equipment_code
</select> </select>
<select id="selectFireMonitor" resultType="java.util.Map"> <select id="selectFireMonitor" resultType="java.util.Map">
SELECT temp.name, temp.alarm ,temp.id, temp.code, SELECT
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' temp.name,
ORDER BY wesi.update_date desc LIMIT 1),0) AS value, temp.alarm,
IFNULL((SELECT CASE WHEN wesi.value_label IS NULL OR trim( wesi.value_label ) = '' THEN (CASE temp.id,
wesi.`value` temp.code,
WHEN 'true' THEN 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'
concat( wesi.equipment_index_name, '(是)' ) ORDER BY wesi.update_date desc LIMIT 1), 0) AS value,
WHEN 'false' THEN IFNULL((SELECT CASE WHEN wesi.`value` = 'true' THEN wesi.equipment_index_name ELSE '关到位' END FROM wl_equipment_specific_index wesi
concat( wesi.equipment_index_name, '(否)' ) WHERE wesi.equipment_specific_id = temp.id AND wesi.equipment_index_key = 'CAFS_GunValve_Open' ORDER BY wesi.update_date DESC LIMIT 1),'关到位') AS status,
ELSE IFNULL((SELECT wesi.`value` FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = temp.id AND wesi.equipment_index_key = 'CAFS_GunValve_Flow' ORDER BY wesi.update_date DESC LIMIT 1), 0) AS flow
wesi.equipment_index_name FROM
END) ELSE wesi.value_label END FROM wl_equipment_specific_index wesi (
LEFT JOIN wl_equipment_index wei on wesi.equipment_index_id = wei.id
WHERE wesi.equipment_specific_id = temp.id AND wei.is_trend = 0
AND wesi.value is NOT NULL AND wesi.value <![CDATA[<>]]> ''
ORDER BY wesi.update_date desc LIMIT 1),'--') AS status,
'0' AS flow
FROM(
SELECT wes.id,wes.name,wes.code, SELECT wes.id,wes.name,wes.code,
CASE 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
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
AND wes.realtime_iot_index_value = 'true' THEN 1 ELSE 0
1 ELSE 0 END AS alarm
END AS alarm
FROM wl_equipment_specific wes FROM wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE WHERE
wes.equipment_code LIKE concat( '920322', '%' ) wes.equipment_code LIKE concat( '920322', '%' )
<if test="code != null and code!='' "> <if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code}) AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if> </if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) temp ) temp
</select> </select>
<select id="selectFoamTank" resultType="java.util.Map"> <select id="selectFoamTank" resultType="java.util.Map">
...@@ -442,6 +435,102 @@ ...@@ -442,6 +435,102 @@
) )
</select> </select>
<select id="selectOilDrainageNew" resultType="java.util.Map">
SELECT
wes.id,
'3' AS type,
(
SELECT
IF
(
wesi.`value` = 'true'
AND wesi.equipment_index_key = 'ONL_DrainOilValve_Open',
( SELECT emergency_level FROM wl_equipment_index WHERE name_key = 'ONL_DrainOilValve_Open' ),
( SELECT emergency_level FROM wl_equipment_index WHERE name_key = 'ONL_DrainOilValve_Close' ))
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = wes.id
AND wesi.equipment_index_key IN ( 'ONL_DrainOilValve_Open', 'ONL_DrainOilValve_Close' )
AND wesi.`value` = 'true'
ORDER BY
wesi.update_date DESC
LIMIT 1
) AS level,
wes.CODE AS code,
wes.name,
(
SELECT
IF
( wesi.`value` = 'true' AND wesi.equipment_index_key = 'ONL_DrainOilValve_Open', '全开', '全关' )
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = wes.id
AND wesi.equipment_index_key IN ( 'ONL_DrainOilValve_Open', 'ONL_DrainOilValve_Close' )
AND wesi.`value` = 'true'
ORDER BY
wesi.update_date DESC
LIMIT 1
) AS status
FROM
wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE
wes.equipment_code LIKE concat( '921004', '%' )
<if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
<if test="code != null and code!='' ">
UNION ALL
(
SELECT
wes.id,
'3' AS type,
(
SELECT
IF
(
wesi.`value` = 'true'
AND wesi.equipment_index_key = 'ONL_DrainOilValve_Open',
( SELECT emergency_level FROM wl_equipment_index WHERE name_key = 'ONL_DrainOilValve_Open' ),
( SELECT emergency_level FROM wl_equipment_index WHERE name_key = 'ONL_DrainOilValve_Close' ))
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = wes.id
AND wesi.equipment_index_key IN ( 'ONL_DrainOilValve_Open', 'ONL_DrainOilValve_Close' )
AND wesi.`value` = 'true'
ORDER BY
wesi.update_date DESC
LIMIT 1
) AS level,
wes.CODE AS code,
wes.name,
(
SELECT
IF
( wesi.`value` = 'true' AND wesi.equipment_index_key = 'ONL_DrainOilValve_Open', '全开', '全关' )
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = wes.id
AND wesi.equipment_index_key IN ( 'ONL_DrainOilValve_Open', 'ONL_DrainOilValve_Close' )
AND wesi.`value` = 'true'
ORDER BY
wesi.update_date DESC
LIMIT 1
) AS status
FROM
wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE
wes.equipment_code LIKE concat( '921004', '%' )
AND fire.equipment_id != (SELECT id FROM f_equipment WHERE `code` = #{code})
)
</if>
</select>
<select id="selectGasExtinguishing" resultType="java.util.Map"> <select id="selectGasExtinguishing" resultType="java.util.Map">
SELECT SELECT
wes.id, wes.id,
...@@ -1493,13 +1582,23 @@ ...@@ -1493,13 +1582,23 @@
</if> </if>
</where> </where>
ORDER BY ORDER BY
<if test="sortField != null and sortField != ''"> <if test="sortField != null and sortField != '' and sortField == 'createDate'">
<choose>
<when test="sortOrder == 'ascend'">
wlesal.create_date ASC
</when>
<otherwise>
wlesal.create_date DESC
</otherwise>
</choose>
</if>
<if test="sortField != null and sortField != '' and sortField == 'cleanStatus'">
<choose> <choose>
<when test="sortOrder == 'ascend'"> <when test="sortOrder == 'ascend'">
@SORT_FIELD ASC wlesal.clean_time ASC
</when> </when>
<otherwise> <otherwise>
@SORT_FIELD DESC wlesal.clean_time DESC
</otherwise> </otherwise>
</choose> </choose>
</if> </if>
......
...@@ -610,4 +610,35 @@ ...@@ -610,4 +610,35 @@
and biz_org_code = #{bizOrgCode} and biz_org_code = #{bizOrgCode}
GROUP BY plan_name GROUP BY plan_name
</select> </select>
<select id="selectEquipIndexPage" resultType="java.util.Map">
SELECT wesi.id AS id,
wes.code AS equipmentSpecificCode,
wes.name AS equipmentSpecificName,
wesi.equipment_index_name AS equipmentIndexName,
wesi.value AS equipmentIndexValue,
wesi.unit AS equipmentIndexUnit,
wes.position AS location,
wesi.update_date AS updateDate
FROM wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
<where>
<if test="bizOrgCode != null and bizOrgCode != ''">
AND wes.biz_org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
<if test="systemId != null and systemId != ''">
AND wes.system_id = #{systemId}
</if>
<if test="equipName != null and equipName != ''">
AND wes.name LIKE CONCAT('%', #{equipName}, '%')
</if>
<if test="startDate != null and startDate != ''">
AND wesi.update_date >= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
AND wesi.update_date &lt;= #{endDate}
</if>
</where>
ORDER BY wesi.update_date DESC
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -118,8 +118,7 @@ ...@@ -118,8 +118,7 @@
u.name AS unit u.name AS unit
FROM FROM
wl_equipment_specific wesp wl_equipment_specific wesp
LEFT JOIN wl_equipment_detail wsd ON wesp.equipment_detail_id = wsd.id LEFT JOIN wl_equipment we ON we.code = wesp.equipment_code
LEFT JOIN wl_equipment we ON wsd.equipment_id = we.id
LEFT JOIN wl_unit u on u.id = we.unit_id LEFT JOIN wl_unit u on u.id = we.unit_id
<where> <where>
we.id IS NOT NULL AND wesp.system_id IS NOT NULL we.id IS NOT NULL AND wesp.system_id IS NOT NULL
...@@ -127,8 +126,29 @@ ...@@ -127,8 +126,29 @@
AND wesp.biz_org_code like concat(#{bizOrgCode},'%') AND wesp.biz_org_code like concat(#{bizOrgCode},'%')
</if> </if>
</where> </where>
GROUP BY GROUP BY we.code
we.code, wesp.system_id </select>
<select id="getEquipmentCountBySystemId" resultType="Map">
SELECT
wesp.system_id AS systemId,
count(1) AS count
FROM
wl_equipment_specific wesp
LEFT JOIN wl_equipment we ON we.code = wesp.equipment_code
<where>
we.id IS NOT NULL AND wesp.system_id IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''">
AND wesp.biz_org_code like concat(#{bizOrgCode},'%')
</if>
<if test="systemIds != null and systemIds.size() > 0">
AND (
<foreach collection="systemIds" item="systemId" separator="OR">
wesp.system_id LIKE concat('%',#{systemId},'%')
</foreach>
)
</if>
</where>
GROUP BY wesp.system_id
</select> </select>
<select id="selectEquipmentSpecific" resultMap="ComplementCode"> <select id="selectEquipmentSpecific" resultMap="ComplementCode">
SELECT SELECT
...@@ -2999,4 +3019,104 @@ ...@@ -2999,4 +3019,104 @@
</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="code == '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="(code == '92032000' and indexKey == 'CAFS_WaterTank_WaterTankLevel') or (code == '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="code == '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="code == '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}, '%')
AND a.iot_code is not null AND a.iot_code != ''
<if test="bizOrgCode != null and bizOrgCode != ''">
AND a.biz_org_code LIKE concat(#{bizOrgCode}, '%')
</if>
</where>
GROUP BY
a.id
</select>
<select id="getWaterList" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipTrendInfoVo">
SELECT
a.sequence_nbr AS id,
a.`name` AS `name`,
GROUP_CONCAT( c.iot_code ) AS iotCode,
b.min_water_level AS minNum,
b.max_water_level AS maxNum,
'液位(M)' AS unit
FROM
`cb_water_resource` AS a
LEFT JOIN cb_water_resource_pool b ON a.sequence_nbr = b.resource_id
LEFT JOIN wl_equipment_specific c ON FIND_IN_SET( c.id, b.level_device_id )
WHERE
b.level_device_id IS NOT NULL
AND b.level_device_id != ''
AND a.resource_type IN ( 'pool', 'industryPool' )
<if test="bizOrgCode != null and bizOrgCode != ''">
AND a.biz_org_code LIKE concat(#{bizOrgCode}, '%')
</if>
GROUP BY
a.sequence_nbr
HAVING
iotCode IS NOT NULL
AND iotCode != ''
</select>
<select id="getIndexKeyByIotCode" resultType="java.util.Map">
SELECT
a.iot_code as iotCode,
max(case when b.type_code = 'LiquidLevel' then equipment_index_key end) as indexKey
FROM
wl_equipment_specific a
LEFT JOIN wl_equipment_specific_index b ON a.id = b.equipment_specific_id
WHERE
a.iot_code
IN
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
#{item}
</foreach>
GROUP BY
a.iot_code
</select>
<select id="getIndexKeyByIotCodeWaterTank" resultType="java.util.Map">
SELECT
a.iot_code AS iotCode,
GROUP_CONCAT( b.equipment_index_key ) AS indexKey
FROM
wl_equipment_specific a
LEFT JOIN ( SELECT * FROM wl_equipment_specific_index WHERE type_code = 'LiquidLevel' ) b ON a.id = b.equipment_specific_id
WHERE
a.iot_code IN
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
#{item}
</foreach>
GROUP BY
a.iot_code
HAVING
indexKey IS NOT NULL
AND indexKey != ''
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<artifactId>amos-boot-system-jcs</artifactId> <artifactId>amos-boot-system-jcs</artifactId>
<version>3.7.2.0</version> <version>3.7.2.3</version>
<dependencies> <dependencies>
<dependency> <dependency>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</parent> </parent>
<artifactId>amos-boot-system-patrol</artifactId> <artifactId>amos-boot-system-patrol</artifactId>
<version>3.7.2.0</version> <version>3.7.2.3</version>
<dependencies> <dependencies>
<dependency> <dependency>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<version>1.0.0</version> <version>1.0.0</version>
</parent> </parent>
<artifactId>amos-boot-utils-message</artifactId> <artifactId>amos-boot-utils-message</artifactId>
<version>3.7.2.3</version>
<properties> <properties>
<tyboot.version>1.1.25-DL-SNAPSHOT</tyboot.version> <tyboot.version>1.1.25-DL-SNAPSHOT</tyboot.version>
</properties> </properties>
...@@ -52,6 +52,17 @@ ...@@ -52,6 +52,17 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!-- 读取excel文件 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -109,10 +109,13 @@ system.zxj=false ...@@ -109,10 +109,13 @@ system.zxj=false
##\u9700\u8981\u76D1\u542C\u5F97eqm\u6D88\u606F\u4E3B\u9898 \u6839\u636E\u662F\u5426\u662F\u4E2D\u5FC3\u6781\u548C\u7AD9\u7AEF\u9009\u62E9\u9700\u8981\u76D1\u542C\u5F97\u4E3B\u9898\u8FDB\u884C\u914D\u7F6E emq.iot.created, ##\u9700\u8981\u76D1\u542C\u5F97eqm\u6D88\u606F\u4E3B\u9898 \u6839\u636E\u662F\u5426\u662F\u4E2D\u5FC3\u6781\u548C\u7AD9\u7AEF\u9009\u62E9\u9700\u8981\u76D1\u542C\u5F97\u4E3B\u9898\u8FDB\u884C\u914D\u7F6E emq.iot.created,
#emq.topic=ccs-user-login-info,sync.execute,data/mcb/warning,emq.risk.qrcode.put,emq.risk.qrcode.clean #emq.topic=ccs-user-login-info,sync.execute,data/mcb/warning,emq.risk.qrcode.put,emq.risk.qrcode.clean
queue.kafka.topics=null # 现场kafka消息 topic 遥测遥信告警都 配在这个配置中(英文逗号隔开即可)
kafka.auto-startup=false # 原告警topic配置删除queue.kafka.eventAlarm.topics
queue.kafka.topics=T_DC_MQ_REALDATA,T_DC_MQ_STATUS
#浜嬩欢鍛婅瀵规帴Kafka涓婚 kafka.auto-startup=false
queue.kafka.eventAlarm.topics=JKXT2BP-GJ-Topic-site
kafka.station.groupId=shaoxing kafka.station.groupId=shaoxing
#F:\\filterExcel11.xlsx 读取excel文件过滤kafka消息 如不需要将该配置置空,或者不添加该配置即可
filter.excel.path=F:\\filterExcel.xlsx
\ 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