Commit 91cb2a0f authored by 李秀明's avatar 李秀明

Merge branch 'refs/heads/develop_dl' into develop_dl_4.0

# Conflicts: # amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/controller/DataDictionaryController.java # 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-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/fegin/JcsFeign.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentSpecificMapper.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/FireFightingSystemGroupServiceImpl.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-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
parents e57b16a9 e7552b13
......@@ -223,7 +223,7 @@ public class DataDictionaryController extends BaseController {
return ResponseHelper.buildResponse(menus);
}
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/dataDictionaryIdFillMenu", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典,id为SequenceNbr", notes = "根据字典类型查询字典,id为SequenceNbr")
......@@ -243,6 +243,19 @@ public class DataDictionaryController extends BaseController {
}
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/dataDictionaryIdFillMenuHasSort", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典,id为SequenceNbr", notes = "根据字典类型查询字典,id为SequenceNbr")
public ResponseModel<Object> getDictionaryWithTreeFillIdHasSort(@RequestParam String type) throws Exception {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getSortTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName",
"getParent", "getSortNum", null,"getCode");
return ResponseHelper.buildResponse(menus);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/dataDictionary", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典2", notes = "根据字典类型查询字典2")
......@@ -468,6 +481,46 @@ public class DataDictionaryController extends BaseController {
* @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);
}
/**
* 新增数据字典 - 存储默认展示视频
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/saveDefaultVideo", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "存储默认展示视频", notes = "存储默认展示视频")
public boolean saveDefaultVideo(@RequestBody Map<String, Object> map) {
......
......@@ -17,13 +17,21 @@ public class Menu {
public Boolean isRoot;
public List<Menu> children;
public String treeCode;
public int num;
public Integer sortNum;
public int num;
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
public Integer getSortNum() {
return sortNum;
}
public void setSortNum(Integer sortNum) {
this.sortNum = sortNum;
}
public Menu(Long id, String name, Long parentId2,int num) {
super();
this.id = id;
......@@ -31,6 +39,16 @@ public class Menu {
this.parentId = parentId2;
this.num = num;
}
public Menu(Long id, String name, Long parentId2,int num, Integer sortNum) {
super();
this.id = id;
this.name = name;
this.parentId = parentId2;
this.num = num;
this.sortNum = sortNum;
}
public Menu(Long id, String name, Long parentId2,int num,String treeCode) {
super();
this.id = id;
......@@ -39,6 +57,16 @@ public class Menu {
this.num = num;
this.treeCode = treeCode;
}
public Menu(Long id, String name, Long parentId2,int num,String treeCode, Integer sortNum) {
super();
this.id = id;
this.name = name;
this.parentId = parentId2;
this.num = num;
this.treeCode = treeCode;
this.sortNum = sortNum;
}
public Menu(Long id, String name, Long parentId, List<Menu> children,int num) {
super();
this.id = id;
......@@ -56,7 +84,6 @@ public class Menu {
this.children = children;
this.num = num;
}
public Long getId() {
return id;
}
......
......@@ -104,6 +104,75 @@ public class TreeParser {
return resultList;
}
@SuppressWarnings("unchecked")
public static List<Menu> getSortTree(Long topId, @SuppressWarnings("rawtypes") Collection entityList, String packageURL, String IDMethodName, int IDHierarchy, String NAMEMethodName, String PARENTIDMethodName, String SORTMethodName, List<FirefightersTreeDto> list, String treeCode) throws Exception {
List<Menu> resultList = new ArrayList<>();
@SuppressWarnings("rawtypes")
Class clazz = Class.forName(packageURL);
Method IDMethodNameme = null;
switch (IDHierarchy) {
case 1:
IDMethodNameme = clazz.getDeclaredMethod(IDMethodName);
break;
case 2:
IDMethodNameme = clazz.getSuperclass().getDeclaredMethod(IDMethodName);
break;
case 3:
IDMethodNameme = clazz.getSuperclass().getSuperclass().getDeclaredMethod(IDMethodName);
break;
default:
IDMethodNameme = clazz.getDeclaredMethod(IDMethodName);
break;
}
Method NAMEMethodNameme = clazz.getDeclaredMethod(NAMEMethodName);
Method SORTMethodNamee = clazz.getDeclaredMethod(SORTMethodName);
Method PARENTIDMethodNameme = clazz.getDeclaredMethod(PARENTIDMethodName);
Method treeCodeName =null;
if(treeCode!=null){
treeCodeName = clazz.getDeclaredMethod(treeCode);
}
//获取顶层元素集合
Long parentId;
for (Object ob : entityList) {
Object entity = clazz.cast(ob);
parentId = PARENTIDMethodNameme.invoke(entity) != null ? Long.valueOf(String.valueOf(PARENTIDMethodNameme.invoke(entity))) : null;
if (parentId == null || parentId.equals(topId) ) {//陈浩2021-12-01修改 topId == parentId 的判断
String codeString = String.valueOf(IDMethodNameme.invoke(entity));
Integer num = 0;
if (list != null && list.size() > 0) {
for (FirefightersTreeDto map : list) {
if (null != map.getJobTitleCode() && map.getJobTitleCode().equals(codeString)) {
num = Integer.valueOf((String) map.getNum());
break;
}
}
;
}
Menu menu = null;
if(treeCodeName!=null){
String treeCodeNamedat = String.valueOf(treeCodeName.invoke(entity));
menu = new Menu(Long.valueOf(codeString), String.valueOf(NAMEMethodNameme.invoke(entity)), parentId, num,treeCodeNamedat, Integer.valueOf(String.valueOf(SORTMethodNamee.invoke(entity))));
}else{
menu = new Menu(Long.valueOf(codeString), String.valueOf(NAMEMethodNameme.invoke(entity)), parentId, num, Integer.valueOf(String.valueOf(SORTMethodNamee.invoke(entity))));
}
resultList.add(menu);
}
}
//获取每个顶层元素的子数据集合
for (Menu entity : resultList) {
entity.setChildren(getSub(entity.getId(), entityList, packageURL, IDMethodName, IDHierarchy, NAMEMethodName, PARENTIDMethodName, list,treeCode));
}
return resultList;
}
public static List<Menu> getTreeTeam(Long topId, @SuppressWarnings("rawtypes") Collection entityList, String packageURL, String IDMethodName, int IDHierarchy, String NAMEMethodName, String PARENTIDMethodName, List<FirefightersTreeDto> list,String treeCode) throws Exception {
List<Menu> resultList = new ArrayList<>();
@SuppressWarnings("rawtypes")
......
......@@ -15,11 +15,11 @@
<artifactId>amos-boot-module-jcs-api</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-tzs-api</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.amosframework.boot</groupId>-->
<!-- <artifactId>amos-boot-module-tzs-api</artifactId>-->
<!-- <version>${amos-biz-boot.version}</version>-->
<!-- </dependency>-->
<!-- spring-cloud网关-->
<dependency>
<groupId>org.springframework.cloud</groupId>
......
......@@ -94,6 +94,8 @@ public class OrgUsrFormDto implements Serializable {
private String dwfz;
@ApiModelProperty(value = "消防安全负责人")
private String xfaq;
@ApiModelProperty(value = "换流站类型")
private String stationType;
@ApiModelProperty(value = "公司消防信息")
@TableField(exist = false)
......
package com.yeejoin.amos.boot.module.common.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface StationInfoMapper extends BaseMapper {
Long count(@Param("bizOrgCode") String bizOrgCode, @Param("stationType") String stationType);
Map<String, String> selectStationInfo(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> selectStationInfoList();
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.common.api.mapper.StationInfoMapper">
<select id="count" resultType="long">
SELECT
COUNT(1)
FROM idx_biz_station_info t
<where>
<if test="bizOrgCode != null and bizOrgCode != ''">
AND t.BIZ_ORG_CODE LIKE CONCAT(#{bizOrgCode}, '%')
</if>
<if test="stationType != null and stationType != ''">
AND t.STATION_TYPE = #{stationType}
</if>
</where>
</select>
<select id="selectStationInfo" resultType="java.util.Map">
SELECT
*
FROM
idx_biz_station_info t
<where>
<if test="bizOrgCode != null and bizOrgCode != ''">
AND t.BIZ_ORG_CODE = #{bizOrgCode}
</if>
</where>
LIMIT 1
</select>
<select id="selectStationInfoList" resultType="java.util.Map">
SELECT
*
FROM
idx_biz_station_info
</select>
</mapper>
......@@ -14,6 +14,8 @@ import lombok.Data;
public class EquipCountBySystemVO {
@ApiModelProperty(value = "设备定义id")
private Long equipmentId;
@ApiModelProperty(value = "设备定义Code")
private String equipmentCode;
@ApiModelProperty(value = "设备名称")
private String equipmentName;
@ApiModelProperty(value = "设备分类名称")
......@@ -24,4 +26,6 @@ public class EquipCountBySystemVO {
private String unitName;
@ApiModelProperty(value = "图标")
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;
}
}
......@@ -152,6 +152,7 @@ public class UnitTransformUtil {
map.put("unit", "M");
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)) {
......
......@@ -19,15 +19,15 @@
<module>amos-boot-module-common-api</module>
<module>amos-boot-module-command-api</module>
<module>amos-boot-module-patrol-api</module>
<module>amos-boot-module-fas-api</module>
<module>amos-boot-module-maintenance-api</module>
<module>amos-boot-module-supervision-api</module>
<!-- <module>amos-boot-module-fas-api</module>-->
<!-- <module>amos-boot-module-maintenance-api</module>-->
<!-- <module>amos-boot-module-supervision-api</module>-->
<module>amos-boot-module-knowledgebase-api</module>
<module>amos-boot-module-equip-api</module>
<module>amos-boot-module-latentdanger-api</module>
<module>amos-boot-module-ccs-api</module>
<module>amos-boot-module-avic-api</module>
<module>amos-boot-module-precontrol-api</module>
<module>amos-boot-module-kgd-api</module>
<!-- <module>amos-boot-module-latentdanger-api</module>-->
<!-- <module>amos-boot-module-ccs-api</module>-->
<!-- <module>amos-boot-module-avic-api</module>-->
<!-- <module>amos-boot-module-precontrol-api</module>-->
<!-- <module>amos-boot-module-kgd-api</module>-->
</modules>
</project>
\ No newline at end of file
......@@ -1067,6 +1067,36 @@ public class OrgUsrController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@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")
public ResponseModel<String> getBizByAmos(@RequestParam("bizOrgCode") String bizOrgCode) {
LambdaQueryWrapper<OrgUsr> lambda = new QueryWrapper<OrgUsr>().lambda();
......
......@@ -28,10 +28,7 @@ import com.yeejoin.amos.boot.module.common.api.enums.UserUnitTypeEnum;
import com.yeejoin.amos.boot.module.common.api.feign.AmosTrainingFeignClient;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.feign.IdxFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersJacketMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.*;
import com.yeejoin.amos.boot.module.common.api.service.IDataSyncService;
import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
......@@ -126,6 +123,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Autowired
OrgUsrServiceImpl iOrgUsrService;
@Autowired
private StationInfoMapper stationInfoMapper;
@Value("${jcs.company.topic.delete:jcs/company/topic/delete}")
private String airportDeleteTopic;
......@@ -1394,11 +1394,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
Map<String, String> Xfgl = null;
Map<String, String> Dwfz = null;
List<OrgUsr> orgUsrs = getIdByOrgCode(orgUsr.getBizOrgCode(), id);
List<Long> ids = orgUsrs.stream().map(x -> x.getSequenceNbr()).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(ids)) {
Xfaq = orgUsrMapper.getManagePerson("消防安全负责人", ids);
Xfgl = orgUsrMapper.getManagePerson("消防安全管理人", ids);
Dwfz = orgUsrMapper.getManagePerson("法定代表人", ids);
if(orgUsrs!=null){
List<Long> ids = orgUsrs.stream().map(x -> x.getSequenceNbr()).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(ids)) {
Xfaq = orgUsrMapper.getManagePerson("消防安全负责人", ids);
Xfgl = orgUsrMapper.getManagePerson("消防安全管理人", ids);
Dwfz = orgUsrMapper.getManagePerson("法定代表人", ids);
}
}
orgUsrFormVo.setXfaq(Xfaq != null ? Xfaq.get("uname") : "");
orgUsrFormVo.setXfgl(Xfgl != null ? Xfgl.get("uname") : "");
......@@ -1408,6 +1410,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
CompanyInfo info = fireCompanyInfoServiceImpl.getOne(new QueryWrapper<CompanyInfo>().eq("instance_id", id).eq("is_delete", 0));
orgUsrFormVo.setCompanyInfo(info);
// 获取换流站类型
Map<String, String> stationInfo = stationInfoMapper.selectStationInfo(orgUsr.getBizOrgCode());
if (Objects.nonNull(stationInfo)) {
orgUsrFormVo.setStationType(stationInfo.getOrDefault("station_type", ""));
}
return orgUsrFormVo;
}
......
......@@ -15,6 +15,7 @@ import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
......@@ -198,4 +199,20 @@ public class BigScreenController extends AbstractBaseController {
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));
}
}
......@@ -749,7 +749,8 @@ public class EmergencyController extends AbstractBaseController {
@RequestParam(required = false) String systemCode,
@RequestParam(required = false) String createDate,
@RequestParam(required = false) String startDate,
@RequestParam(required = false) String endDate
@RequestParam(required = false) String endDate,
@RequestParam(required = false) String sorter
) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
if (StringUtils.isEmpty(bizOrgCode)) {
......@@ -762,7 +763,13 @@ public class EmergencyController extends AbstractBaseController {
}
}
}
return CommonResponseUtil.success(iEmergencyService.alarmList(page, bizOrgCode, systemCode, types, emergencyLevels, name, cleanStatus, handleStatus, createDate, startDate, endDate));
String sortField = "", sortOrder = "";
if (org.springframework.util.StringUtils.hasText(sorter)) {
sortField = sorter.split("@")[0];
sortOrder = sorter.split("@")[1];
}
return CommonResponseUtil.success(iEmergencyService.alarmList(page, bizOrgCode, systemCode, types, emergencyLevels,
name, cleanStatus, handleStatus, createDate, startDate, endDate, sortField, sortOrder));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
......
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.service.IEquipmentSpecificIndexSerivce;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
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.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -13,11 +17,13 @@ import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.util.Map;
@Slf4j
@RestController
@Api(tags = "装备性能指标API")
@RequestMapping(value = "/equipSpecificIndex")
public class EquipmentSpecificIndexController {
public class EquipmentSpecificIndexController extends AbstractBaseController {
@Autowired
private IEquipmentSpecificIndexSerivce equipmentSpecificIndexService;
......@@ -29,4 +35,24 @@ public class EquipmentSpecificIndexController {
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,57 @@ public class FireFightingSystemController extends AbstractBaseController {
@RequestMapping(value = "/getEquipcountBySystemId", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("根据系统id查询分组设备数量")
public List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId) {
return fireFightingSystemService.getEquipCountBySystemId(systemId);
public List<EquipCountBySystemVO> getEquipCountBySystemId(
@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)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("根据系统id查询分组设备数量")
public Page<EquipCountBySystemVO> getEquipCountPageBySystemId(@RequestParam("systemId") Long systemId,
@RequestParam(value = "pageNumber", required = false) Integer pageNumber,
@RequestParam(value = "pageSize", required = false) Integer pageSize
public Page<EquipCountBySystemVO> getEquipCountPageBySystemId(
@RequestParam(value = "systemId", required = false) Long systemId,
@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 = "/getEquipCountPage", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防器材查询设备数量列表")
public Page<EquipCountBySystemVO> getEquipCountPage(
@RequestParam(value = "systemId", required = false) Long systemId,
@RequestParam(value = "pageNumber", required = false) Integer pageNumber,
@RequestParam(value = "pageSize", required = false) Integer pageSize,
@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.getEquipCountPage(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)
......@@ -934,8 +973,14 @@ public class FireFightingSystemController extends AbstractBaseController {
@ApiOperation(value = "按照组态格式获取设备详情", notes = "按照组态格式获取设备详情")
@GetMapping(value = "/getSystemById")
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);
List<AlarmDataVO> list1 = fireFightingSystemService.getSystemById(id);
List<AlarmDataVO> list1 = fireFightingSystemService.getSystemById(id, bizOrgCode);
Map<String, Object> res = new LinkedHashMap<>();
Boolean status = Boolean.TRUE;
List<Object> ite = new ArrayList<>();
......
......@@ -20,6 +20,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@Slf4j
......@@ -74,4 +76,16 @@ public class FireResourceSupervisionController extends BaseController {
}};
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<LinkedHashMap<String, Object>> fireEquipStats = iFireResourceSupervisionService.getFireEquipStatistic(type, bizOrgCode);
return ResponseHelper.buildResponse(fireEquipStats);
}
}
package com.yeejoin.equipmanage.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.service.IEmergencyService;
import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......
......@@ -8,6 +8,7 @@ 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.FormInstanceEquip;
import com.yeejoin.equipmanage.common.entity.vo.EquipTrendResultVo;
import com.yeejoin.equipmanage.common.enums.IndexStatusEnum;
import com.yeejoin.equipmanage.common.enums.UnitEnum;
import com.yeejoin.equipmanage.common.utils.*;
......@@ -73,6 +74,9 @@ public class SupervisionConfigureController extends AbstractBaseController {
@Autowired
private FormInstanceEquipMapper formInstanceEquipMapper;
@Autowired
private IEquipmentSpecificSerivce equipmentSpecificService;
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
......@@ -287,7 +291,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
for (Map<String, Object> m : res) {
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")));
// m.put("nowLevel", transResult.get("nowValue"));
m.put("nowLevel", transResult.get("nowValue"));
if (StringUtil.isNotEmpty(IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))))) {
m.put("levelStatus", IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))).getDescribe1());
} else {
......@@ -865,4 +869,73 @@ public class SupervisionConfigureController extends AbstractBaseController {
Map<String, Object> list = supervisionVideoService.getPressurePumpPage(bizOrgCode, id, startTime, endTime, pageNum, pageSize, timeSort, stateSort);
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;
/**
* @author DELL
*/
//@FeignClient(name = "${iot.vehicle.track}", path = "iot", configuration = {FeignConfiguration.class})
@FeignClient(name = "AMOS-API-IOT", path = "iot", configuration = { FeignConfiguration.class })
@FeignClient(name = "${iot.vehicle.track}", path = "iot", configuration = {FeignConfiguration.class})
public interface IotFeign {
@RequestMapping(value = "/v1/livedata/list", method = RequestMethod.GET, consumes = "application/json")
......
......@@ -206,6 +206,9 @@ public interface JcsFeign {
@GetMapping(value = "/org-usr/getCompany")
FeignClientResult getCompany( @RequestParam(value = "bizOrgCode") String bizOrgCode);
@GetMapping(value = "/data-dictionary/dataDictionaryIdFillMenu")
@GetMapping(value = "/data-dictionary/dataDictionaryIdFillMenuHasSort")
FeignClientResult<List<DataDictionary>> dataDictionaryIdFillMenu(@RequestParam(value = "type") String type);
@GetMapping(value = "/data-dictionary/getDictListByType")
FeignClientResult<List<DataDictionary>> getDictListByType(@RequestParam(value = "type") String type);
}
......@@ -116,7 +116,7 @@ public interface EmergencyMapper extends BaseMapper{
* @param name 设备名称
* @return
*/
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);
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);
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;
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.Video;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO;
......@@ -105,7 +107,7 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
List<EquipmentIndexVO> getEquipIndexBySpecificIdIn(@Param("list") List<String> specificDetails);
List<EquipmentIndexVO> getEquipIndexByIdIn(@Param("list") List<Long> specificIndexIds);
List<Map<String, Object>> getEquipSpecificIndexByUpdateDateDesc();
List<EquipmentSpecificIndex> getEquipmentSpeIndexByIotCodeTrend(String iotCode, Integer isTrend, String fieldKey);
......@@ -117,4 +119,13 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
List<EquipmentSpecificIndex> getEquipIndexInIndex(@Param("list") List<String> listIndex);
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
);
}
......@@ -12,6 +12,7 @@ import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
......@@ -51,9 +52,11 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
* @param systemId
* @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);
Page<EquipCountBySystemVO> getEquipCountPage(@Param("page") Page<Object> page, @Param("systemId") Long systemId, @Param("bizOrgCode") String bizOrgCode);
/**
* 保存
......@@ -736,10 +739,19 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> getFireCannonInfo(@Param("bizOrgCode") String bizOrgCode, @Param("list") String[] strings);
List<Map<String, Object>> getFEquipInfoList(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getEquipIndexList(@Param("collect") List<String> collect);
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<LinkedHashMap<String, Object>> getFireEquipStatistic(@Param("collect") List<String> collect, @Param("bizOrgCode")String bizOrgCode);
List<LinkedHashMap<String, Object>> getOtherFireEquipStatistic(@Param("collect") List<String> collect, @Param("bizOrgCode")String bizOrgCode);
List<EquipCountBySystemVO> getFireEquipConfigInfo(@Param("codes") List<String> codes, @Param("bizOrgCode")String bizOrgCode);
}
......@@ -73,7 +73,9 @@ public interface IEmergencyService {
List<Map<String, Object>> getPressurePumpDiagnosticAnalysis(String bizOrgCode);
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);
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);
Map<String, List<PressurePumpCountVo>> getPressurePumpDay();
......
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.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.Video;
......@@ -77,4 +79,6 @@ public interface IEquipmentSpecificIndexSerivce extends IService<EquipmentSpecif
List<EquipmentIndexVO> getEquipIndexBySpecificIdIn(List<String> specificDetails);
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.*;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.ParseException;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
......@@ -331,4 +332,10 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
Page<Map<String, Object>> getFireEquipListByDefineCode(String code, String equipStatus, String bizOrgCode, Page<Map<String, Object>> pageBean);
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;
}
......@@ -57,7 +57,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param systemId
* @return
*/
List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId);
List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId, String bizOrgCode);
/**
* 根据系统id查询分组设备数量
......@@ -65,7 +65,15 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param systemId
* @return
*/
Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize);
Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize, String bizOrgCode);
/**
* 消防器材查询设备数量列表
*
* @param systemId
* @return
*/
Page<EquipCountBySystemVO> getEquipCountPage(Long systemId, Integer pageNumber, Integer pageSize, String bizOrgCode);
/**
* 保存
......@@ -128,7 +136,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param id
* @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);
......@@ -311,6 +319,8 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
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);
Page<Map<String, String>> getEquipExpiryListByPage(String bizOrgCode, Integer expiryDayNum, Page page);
......@@ -359,4 +369,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
List<Map<String, Object>> getFEquipInfoList(String bizOrgCode);
List<Map<String, Object>> getFEquipInfoListCategory(String bizOrgCode);
List<EquipCountBySystemVO> getFireEquipConfigInfo(String bizOrgCode);
}
......@@ -2,6 +2,10 @@ package com.yeejoin.equipmanage.service;
import com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* 消防资源监管
*/
......@@ -25,4 +29,6 @@ public interface IFireResourceSupervisionService {
FireResourceStatsDTO getFireCarStats(String bizOrgCode);
FireResourceStatsDTO getFireEquipStats(String bizOrgCode);
List<LinkedHashMap<String, Object>> getFireEquipStatistic(String type, String bizOrgCode);
}
......@@ -664,8 +664,8 @@ public class EmergencyServiceImpl implements IEmergencyService {
@Override
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) {
return emergencyMapper.alarmList(page, bizOrgCode, systemCode, types, emergencyLevels, name, cleanStatus, handleStatus, createDate, startDate, endDate);
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) {
return emergencyMapper.alarmList(page, bizOrgCode, systemCode, types, emergencyLevels, name, cleanStatus, handleStatus, createDate, startDate, endDate, sortField, sortOrder);
}
//稳压泵定时向缓存中存昨日启动次数任务
......
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.google.common.collect.Lists;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
......@@ -11,6 +13,8 @@ import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
......@@ -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;
}
}
......@@ -27,6 +27,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.util.*;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors;
@Slf4j
......@@ -235,12 +236,12 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
}
}
// 查询装备定义的图片 List to Map -> key: systemId@equipmentId, value: 装备定义数量Map
// 查询装备定义的图片 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(Equipment::getId, equipmentIds)
.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()));
......@@ -256,11 +257,13 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
String uniqueKey = id + "@" + equipmentId;
if (equipmentCountMap.containsKey(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);
}
}
List<Map<String, Long>> systemEquipCountMaps = equipmentSpecificMapper.getEquipmentCountBySystemId(bizOrgCode, systemIds);
// 构建分组对象
JSONArray groups = new JSONArray();
......@@ -309,6 +312,13 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
}
}
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);
}
groups.add(group);
......
......@@ -202,15 +202,19 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
private DataDictionaryServiceImpl dataDictionaryService;
@Override
public List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId) {
return this.baseMapper.getEquipCountBySystemId(systemId);
public List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId, String bizOrgCode) {
return this.baseMapper.getEquipCountBySystemId(systemId, bizOrgCode);
}
@Override
public Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize) {
return this.baseMapper.getEquipCountPageBySystemId(new Page(pageNumber, pageSize), systemId);
public Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize, String bizOrgCode) {
return this.baseMapper.getEquipCountPageBySystemId(new Page(pageNumber, pageSize), systemId, bizOrgCode);
}
@Override
public Page<EquipCountBySystemVO> getEquipCountPage(Long systemId, Integer pageNumber, Integer pageSize, String bizOrgCode) {
return this.baseMapper.getEquipCountPage(new Page(pageNumber, pageSize), systemId, bizOrgCode);
}
@Override
public List<EquiplistSpecificBySystemVO>
......@@ -1227,13 +1231,14 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
@Override
public List<AlarmDataVO> getSystemById(Long id) {
public List<AlarmDataVO> getSystemById(Long id, String bizOrgCode) {
List<AlarmDataVO> list = this.baseMapper.getSystemById(id);
// 部件总数
Integer equipmentCount = equipmentSpecificMapper.selectCount(
Wrappers.<EquipmentSpecific>lambdaQuery()
.eq(EquipmentSpecific::getSystemId, id)
.eq(EquipmentSpecific::getSingle, true)
.like(EquipmentSpecific::getSystemId, id)
.isNotNull(EquipmentSpecific::getEquipmentCode)
.likeRight(StringUtils.hasText(bizOrgCode), EquipmentSpecific::getBizOrgCode, bizOrgCode)
);
// 未复归设备
List<EquipmentSpecificAlarm> equipSpecIds = equipmentSpecificAlarmMapper.selectList(
......@@ -1241,6 +1246,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
.select(EquipmentSpecificAlarm::getEquipmentSpecificId)
.like(EquipmentSpecificAlarm::getSystemIds, id)
.eq(EquipmentSpecificAlarm::getStatus, "1")
.likeRight(StringUtils.hasText(bizOrgCode), EquipmentSpecificAlarm::getBizOrgCode, bizOrgCode)
);
int count = (int) equipSpecIds.stream().map(EquipmentSpecificAlarm::getEquipmentSpecificId).distinct().count();
list.add(new AlarmDataVO("部件总数", equipmentCount + " 个", false));
......@@ -2852,6 +2858,11 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
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) {
List<OrgMenuDto> menuList = list.stream()
.map(o -> new OrgMenuDto(Long.parseLong(o.get("id").toString()), o.get("name").toString(),
......@@ -2891,6 +2902,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return Optional.ofNullable(list).orElse(org.apache.commons.compress.utils.Lists.newArrayList());
}
@Override
public List<Map<String, Object>> getFEquipInfoList(String bizOrgCode) {
List<Map<String, Object>> list = this.baseMapper.getFEquipInfoList(bizOrgCode);
......@@ -2939,7 +2951,6 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return CollUtil.isNotEmpty(resultList) ? resultList : closeList;
}
@Override
public List<Map<String, Object>> getFEquipInfoListCategory(String bizOrgCode) {
List<DataDictionary> zdsbfl = jcsFeignClient.dataDictionaryIdFillMenu("ZDSBFL").getResult();
......@@ -2950,9 +2961,6 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
strings.addAll(Arrays.asList(equipIds.split(",")));
});
List<String> collect = strings.stream().distinct().collect(Collectors.toList());
if (CollUtil.isEmpty(collect)) {
return Collections.emptyList();
}
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<>();
......@@ -2969,10 +2977,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
Map<String, Object> map = equipmentSpecificId.get(index);
isOpen = 1;
if (updateDate == null) {
updateDate = DateUtil.parse(map.get("updateDate").toString(), DatePattern.UTC_SIMPLE_PATTERN);
updateDate = DateUtil.parse(map.get("updateDate").toString(), DatePattern.NORM_DATETIME_PATTERN);
} else {
int comparisonResult = DateUtil.compare(updateDate, DateUtil.parse(map.get("updateDate").toString(), DatePattern.UTC_SIMPLE_PATTERN));
updateDate = comparisonResult < 0 ? DateUtil.parse(map.get("updateDate").toString(), DatePattern.UTC_SIMPLE_PATTERN) : updateDate;
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;
}
}
}
......@@ -3000,4 +3008,17 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
});
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;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO;
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.service.IFireResourceSupervisionService;
import liquibase.pro.packaged.X;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.List;
import java.util.Map;
import java.util.*;
@Slf4j
@Service
......@@ -19,6 +24,9 @@ public class IFireResourceSupervisionServiceImpl implements IFireResourceSupervi
@Autowired
private FireFightingSystemMapper fireFightingSystemMapper;
@Autowired
JcsFeign jcsFeignClient;
/**
* 消防系统信息
*
......@@ -64,6 +72,38 @@ public class IFireResourceSupervisionServiceImpl implements IFireResourceSupervi
return buildFireResourceStatsDTO(resultMap);
}
@Override
public List<LinkedHashMap<String, Object>> getFireEquipStatistic(String type, String bizOrgCode) {
List<DataDictionary> dictionaryList = jcsFeignClient.dataDictionaryIdFillMenu(StringUtil.isNotEmpty(type) ? type : "ZYGL_XFQC").getResult();
List<String> list = new ArrayList<>();
Map<Integer, String> sortMap = new TreeMap<>(new Comparator<Integer>(){
@Override
public int compare(Integer o1, Integer o2) {
return o1-o2; //按照key顺序排列,o2-o1是逆序, o1-o2是正序
}
});
if (!CollectionUtils.isEmpty(dictionaryList)) {
dictionaryList.forEach(x -> {
list.add(x.getTreeCode());
sortMap.put(x.getSortNum(), x.getTreeCode());
});
}
List<LinkedHashMap<String, Object>> resultMap = fireFightingSystemMapper.getFireEquipStatistic(list, bizOrgCode);
List<LinkedHashMap<String, Object>> resp = new ArrayList<>();
if (!sortMap.isEmpty()) {
sortMap.entrySet().forEach(x -> {
resultMap.forEach(y -> {
if (x.getValue().equalsIgnoreCase(String.valueOf(y.get("code")))) {
resp.add(y);
}
});
});
}
List<LinkedHashMap<String, Object>> otherMapData = fireFightingSystemMapper.getOtherFireEquipStatistic(list, bizOrgCode);
resp.addAll(otherMapData);
return resp;
}
private FireResourceStatsDTO buildFireResourceStatsDTO(Map<String, Object> resultMap) {
FireResourceStatsDTO fireResourceStats = new FireResourceStatsDTO();
fireResourceStats.setTotalCounts(Long.parseLong(resultMap.get("totalCount").toString()));
......
......@@ -788,6 +788,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
return;
}
String iotCode = equipmentSpecific.getIotCode();
topicEntity.setIotCode(iotCode);
StringBuilder endIndex = new StringBuilder(iotCode).insert(8, '/');
String iotTopic = "influxdb/" + endIndex;
JSONObject msg = new JSONObject();
......@@ -2535,6 +2536,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
prefix = iotCode.substring(0, 8);
suffix = iotCode.substring(8);
} else {
log.error("错误的物联编码是:", topicEntity.getIotCode());
throw new BadRequest("装备物联编码错误,请确认!");
}
switch (valueEnum) {
......
......@@ -53,14 +53,14 @@
<module>amos-boot-module-command-biz</module>
<module>amos-boot-module-knowledgebase-biz</module>
<module>amos-boot-module-patrol-biz</module>
<module>amos-boot-module-fas-biz</module>
<module>amos-boot-module-maintenance-biz</module>
<module>amos-boot-module-supervision-biz</module>
<module>amos-boot-module-latentdanger-biz</module>
<!-- <module>amos-boot-module-fas-biz</module>-->
<!-- <module>amos-boot-module-maintenance-biz</module>-->
<!-- <module>amos-boot-module-supervision-biz</module>-->
<!-- <module>amos-boot-module-latentdanger-biz</module>-->
<module>amos-boot-module-equip-biz</module>
<module>amos-boot-module-ccs-biz</module>
<module>amos-boot-module-avic-biz</module>
<module>amos-boot-module-precontrol-biz</module>
<module>amos-boot-module-kgd-biz</module>
<!-- <module>amos-boot-module-ccs-biz</module>-->
<!-- <module>amos-boot-module-avic-biz</module>-->
<!-- <module>amos-boot-module-precontrol-biz</module>-->
<!-- <module>amos-boot-module-kgd-biz</module>-->
</modules>
</project>
\ No newline at end of file
......@@ -8,7 +8,7 @@
</parent>
<artifactId>amos-boot-system-equip</artifactId>
<version>3.7.2.0</version>
<version>3.7.2.3</version>
<dependencies>
<dependency>
<groupId>com.amosframework.boot</groupId>
......
......@@ -1735,7 +1735,29 @@
</if>
</where>
ORDER BY
<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>
<when test="sortOrder == 'ascend'">
wlesal.clean_time ASC
</when>
<otherwise>
wlesal.clean_time DESC
</otherwise>
</choose>
</if>
<if test="sortField == null or sortField == ''">
wlesal.create_date DESC
</if>
</select>
<select id="alarmListNoPage" resultType="java.util.Map">
......
......@@ -596,4 +596,35 @@
</if>
</where>
</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>
\ No newline at end of file
......@@ -118,8 +118,7 @@
u.name AS unit
FROM
wl_equipment_specific wesp
LEFT JOIN wl_equipment_detail wsd ON wesp.equipment_detail_id = wsd.id
LEFT JOIN wl_equipment we ON wsd.equipment_id = we.id
LEFT JOIN wl_equipment we ON we.code = wesp.equipment_code
LEFT JOIN wl_unit u on u.id = we.unit_id
<where>
we.id IS NOT NULL AND wesp.system_id IS NOT NULL
......@@ -127,8 +126,29 @@
AND wesp.biz_org_code like concat(#{bizOrgCode},'%')
</if>
</where>
GROUP BY
we.code, wesp.system_id
GROUP BY we.code
</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 id="selectEquipmentSpecific" resultMap="ComplementCode">
SELECT
......@@ -3033,4 +3053,104 @@
</if>
</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>
\ No newline at end of file
......@@ -9,7 +9,7 @@
<artifactId>amos-boot-system-jcs</artifactId>
<version>3.7.2.0</version>
<version>3.7.2.3</version>
<dependencies>
<dependency>
......
......@@ -8,7 +8,7 @@
</parent>
<artifactId>amos-boot-system-patrol</artifactId>
<version>3.7.2.0</version>
<version>3.7.2.3</version>
<dependencies>
<dependency>
......
......@@ -8,7 +8,7 @@
<version>1.0.0</version>
</parent>
<artifactId>amos-boot-utils-message</artifactId>
<version>3.7.2.3</version>
<properties>
<tyboot.version>1.1.23-SNAPSHOT</tyboot.version>
</properties>
......
......@@ -333,23 +333,23 @@
<modules>
<module>amos-boot-module</module>
<module>amos-boot-biz-common</module>
<module>amos-boot-system-tzs</module>
<!-- <module>amos-boot-system-tzs</module>-->
<module>amos-boot-system-jcs</module>
<module>amos-boot-system-knowledgebase</module>
<module>amos-boot-system-fas</module>
<!-- <module>amos-boot-system-fas</module>-->
<module>amos-boot-system-patrol</module>
<module>amos-boot-system-maintenance</module>
<module>amos-boot-system-supervision</module>
<!-- <module>amos-boot-system-maintenance</module>-->
<!-- <module>amos-boot-system-supervision</module>-->
<module>amos-boot-system-equip</module>
<module>amos-boot-core</module>
<!-- <module>amos-boot-core</module>-->
<module>amos-boot-utils</module>
<module>amos-boot-system-latentdanger</module>
<module>amos-boot-system-ccs</module>
<module>amos-boot-data</module>
<module>amos-boot-system-precontrol</module>
<module>amos-boot-system-cas</module>
<module>amos-boot-system-tdc</module>
<module>amos-boot-system-kgd</module>
<!-- <module>amos-boot-system-latentdanger</module>-->
<!-- <module>amos-boot-system-ccs</module>-->
<!-- <module>amos-boot-data</module>-->
<!-- <module>amos-boot-system-precontrol</module>-->
<!-- <module>amos-boot-system-cas</module>-->
<!-- <module>amos-boot-system-tdc</module>-->
<!-- <module>amos-boot-system-kgd</module>-->
</modules>
<build>
......
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