Commit 9023e830 authored by 张森's avatar 张森

Merge remote-tracking branch 'origin/develop_dl' into develop_dl_bugfix

# Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/AnalysisReportLogServiceImpl.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/CheckServiceImpl.java # amos-boot-system-equip/src/main/resources/application-dev.properties
parents 9dce97e6 366e1dfe
...@@ -22,15 +22,21 @@ public class AlarmKafkaConsumer { ...@@ -22,15 +22,21 @@ public class AlarmKafkaConsumer {
PointSystemServiceImpl pointSystemServiceImpl; PointSystemServiceImpl pointSystemServiceImpl;
//消费者来处理消息 //消费者来处理消息
@KafkaListener(id="user1" , topics ={"${kafka.equipment.alarm}"}) @KafkaListener(id="alarmInfo" , topics ={"${kafka.equipment.alarm}"})
public void message1( String record, Acknowledgment ack){ public void message1( String record, Acknowledgment ack){
// 处理业务 // 处理业务
String date=record; String date=record;
System.out.println("消息进来了" +record);
//异步触发预警 //异步触发预警
pointSystemServiceImpl.sendWarningAsync(date); pointSystemServiceImpl.sendWarningAsync(date);
//手动提交 //手动提交
ack.acknowledge(); ack.acknowledge();
}
@KafkaListener(id="user2" , topics ={"${kafka.equipment.test}"})
public void message2( String record, Acknowledgment ack){
String date=record;
System.out.println("消息进来了 8888888888888888888888");
} }
......
...@@ -99,12 +99,18 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point ...@@ -99,12 +99,18 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
//通过测点地址获取,和对应值 获取kks //通过测点地址获取,和对应值 获取kks
QueryWrapper<PointSystem> pointSystemWrapper = new QueryWrapper<>(); QueryWrapper<PointSystem> pointSystemWrapper = new QueryWrapper<>();
pointSystemWrapper.lambda().eq(PointSystem::getAddress, address); pointSystemWrapper.lambda().eq(PointSystem::getAddress, address);
pointSystemWrapper.lambda().eq(PointSystem::getValue, value); if(!value.equals("false") && !value.equals("true")){
pointSystemWrapper.lambda().eq(PointSystem::getValue, value);
}
pointSystemWrapper.lambda().eq(PointSystem::getGatewayId, gatewayId); pointSystemWrapper.lambda().eq(PointSystem::getGatewayId, gatewayId);
PointSystem pointSystem = pointSystemMapper.selectOne(pointSystemWrapper); List<PointSystem> pointSystems = pointSystemMapper.selectList(pointSystemWrapper);
if (pointSystem == null) { if (pointSystems == null || pointSystems.size() < 1 ) {
throw new RuntimeException("获取kks码失败!"); throw new RuntimeException("获取kks码失败!");
} }
PointSystem pointSystem = pointSystems.get(0);
if (pointSystem.getType().equals("遥信")){
return;
}
//调用获取设备相关信息 //调用获取设备相关信息
Map<String, String> maps = new HashMap<>(); Map<String, String> maps = new HashMap<>();
maps.put("type", "equipinfo"); maps.put("type", "equipinfo");
......
...@@ -53,7 +53,8 @@ spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.Str ...@@ -53,7 +53,8 @@ spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.Str
kafka.equipment.alarm=EQUIPMENT_ALARM88 kafka.equipment.alarm=EQUIPMENT_ALARM
kafka.equipment.test=test88888
#电站对接第三方查询设备kks码 #电站对接第三方查询设备kks码
power.station.url=http://139.9.169.123:5024/prod-api/fdgl/process/DataInterface power.station.url=http://139.9.169.123:5024/prod-api/fdgl/process/DataInterface
......
...@@ -393,6 +393,14 @@ public class WaterResourceDto extends BaseDto { ...@@ -393,6 +393,14 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty("水池液位显示装置id") @ApiModelProperty("水池液位显示装置id")
private String levelDeviceId; private String levelDeviceId;
@ExcelIgnore
@ApiModelProperty("消防泵装置id")
private String pumpDeviceId;
@ExcelIgnore
@ApiModelProperty("消防泵装置名称")
private String pumpDeviceName;
@ApiModelProperty("水池液位显示装置名称") @ApiModelProperty("水池液位显示装置名称")
@ExcelProperty(value = "水池液位显示装置", index = 45) @ExcelProperty(value = "水池液位显示装置", index = 45)
@ExplicitConstraint(indexNum = 45, sourceClass = CommonExplicitConstraint.class, method = "getListByEquipmentCode") @ExplicitConstraint(indexNum = 45, sourceClass = CommonExplicitConstraint.class, method = "getListByEquipmentCode")
......
package com.yeejoin.amos.boot.module.common.api.dto; package com.yeejoin.amos.boot.module.common.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
...@@ -76,4 +77,16 @@ public class WaterResourcePoolDto extends BaseDto { ...@@ -76,4 +77,16 @@ public class WaterResourcePoolDto extends BaseDto {
@ApiModelProperty(value = "出口流量(L/s)") @ApiModelProperty(value = "出口流量(L/s)")
private Float outputFlowRate; private Float outputFlowRate;
/**
* 消防泵装置ids
*/
@TableField("pump_device_id")
private String pumpDeviceId;
/**
* 消防泵装置名称s
*/
@TableField("pump_device_name")
private String pumpDeviceName;
} }
package com.yeejoin.amos.boot.module.common.api.entity; package com.yeejoin.amos.boot.module.common.api.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
...@@ -113,6 +115,18 @@ public class WaterResourcePool extends BaseEntity { ...@@ -113,6 +115,18 @@ public class WaterResourcePool extends BaseEntity {
private String levelDeviceName; private String levelDeviceName;
/** /**
* 消防泵装置ids
*/
@TableField("pump_device_id")
private String pumpDeviceId;
/**
* 消防泵装置名称s
*/
@TableField("pump_device_name")
private String pumpDeviceName;
/**
* 出口流量(L/s) * 出口流量(L/s)
*/ */
@TableField("output_flow_rate") @TableField("output_flow_rate")
......
...@@ -173,6 +173,10 @@ public class EquipmentSpecific extends BaseEntity { ...@@ -173,6 +173,10 @@ public class EquipmentSpecific extends BaseEntity {
@TableField("warranty_info") @TableField("warranty_info")
private String warrantyInfo; private String warrantyInfo;
@ApiModelProperty(value = "指标类型编码")
@TableField("type_code")
private String typeCode;
@ApiModelProperty(value = "质保周期") @ApiModelProperty(value = "质保周期")
@TableField("warranty_period") @TableField("warranty_period")
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
......
...@@ -33,12 +33,12 @@ public class UnitTransformUtil { ...@@ -33,12 +33,12 @@ public class UnitTransformUtil {
if (nowVal.compareTo(new BigDecimal(minValue)) < 0) { if (nowVal.compareTo(new BigDecimal(minValue)) < 0) {
map.put("status", "0"); map.put("status", "0");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2)); 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) { } else if (nowVal.compareTo(new BigDecimal(maxValue)) == 0) {
map.put("status", "1"); map.put("status", "1");
map.put("abs", 100); map.put("abs", 100);
} else if (nowVal.compareTo(new BigDecimal(0)) == 0) {
map.put("status", "1");
map.put("abs", "--");
} else { } else {
map.put("status", "1"); map.put("status", "1");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2)); map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
...@@ -149,6 +149,7 @@ public class UnitTransformUtil { ...@@ -149,6 +149,7 @@ public class UnitTransformUtil {
map.put("abs", "--"); map.put("abs", "--");
} }
} }
map.put("unit", "M");
return map; return map;
} }
} }
...@@ -12,6 +12,8 @@ public interface FireResourceSupervisionMapper extends BaseMapper<OrgUsr> { ...@@ -12,6 +12,8 @@ public interface FireResourceSupervisionMapper extends BaseMapper<OrgUsr> {
List<Map<String, Object>> selectPersonnelStats(@Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> selectPersonnelStats(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> selectQualificationStats(@Param("bizOrgCode") String bizOrgCode, @Param("peopleType") Integer peopleType);
Map<String, Object> getPersonStatus(@Param("bizOrgCode") String bizOrgCode, @Param("peopleType") Integer peopleType); Map<String, Object> getPersonStatus(@Param("bizOrgCode") String bizOrgCode, @Param("peopleType") Integer peopleType);
Long selectTodayAttendance(@Param("bizOrgCode") String bizOrgCode); Long selectTodayAttendance(@Param("bizOrgCode") String bizOrgCode);
......
package com.yeejoin.amos.boot.module.jcs.api.service; package com.yeejoin.amos.boot.module.jcs.api.service;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -13,5 +14,7 @@ public interface IFireResourceSupervisionService { ...@@ -13,5 +14,7 @@ public interface IFireResourceSupervisionService {
*/ */
Map<String, Map<String, Number>> getPersonnelStats(String bizOrgCode); Map<String, Map<String, Number>> getPersonnelStats(String bizOrgCode);
List<Map<String, Object>> selectQualificationStats(String bizOrgCode, Integer peopleType);
Map<String, Map<String, String>> getPersonInfo(String bizOrgCode); Map<String, Map<String, String>> getPersonInfo(String bizOrgCode);
} }
...@@ -19,6 +19,30 @@ ...@@ -19,6 +19,30 @@
HAVING peopleType in (0, 1); HAVING peopleType in (0, 1);
</select> </select>
<select id="selectQualificationStats" resultType="java.util.HashMap">
SELECT
LEFT(u.biz_org_code, 18) AS bizOrgCode,
COUNT(DISTINCT u.sequence_nbr) AS total,
SUM(IF(ISNULL(cfp.post_qualification), 0, 1)) AS certifiedCount,
SUM(CASE WHEN cfp.post_qualification_code LIKE '%1421%' THEN 1 ELSE 0 END) AS level5,
SUM(CASE WHEN cfp.post_qualification_code LIKE '%1422%' THEN 1 ELSE 0 END) AS level4
FROM
cb_org_usr u
INNER JOIN cb_dynamic_form_instance dfi ON dfi.instance_id = u.sequence_nbr AND dfi.field_code = 'peopleType'
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = u.sequence_nbr AND cfp.is_delete = false
<where>
u.is_delete = false
<if test="peopleType != null and peopleType != ''">
AND dfi.field_value = #{peopleType}
</if>
<if test="bizOrgCode != null and bizOrgCode != ''">
AND u.biz_org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
</where>
GROUP BY
LEFT(u.biz_org_code, 18)
</select>
<select id="getPersonStatus" resultType="Map"> <select id="getPersonStatus" resultType="Map">
SELECT SELECT
IF(dfi.field_value = 1601, 1, IF(dfi.field_value = 1602, 0, -1)) AS peopleType, IF(dfi.field_value = 1601, 1, IF(dfi.field_value = 1602, 0, -1)) AS peopleType,
......
...@@ -135,7 +135,7 @@ public class EquipmentIotMqttReceiveConfig { ...@@ -135,7 +135,7 @@ public class EquipmentIotMqttReceiveConfig {
list.add("+/+/perspective"); // 添加交换站事件监听 list.add("+/+/perspective"); // 添加交换站事件监听
list.add(riskMsgCenterEquipTopic); list.add(riskMsgCenterEquipTopic);
list.add(riskMsgCenterPatrolTopic); list.add(riskMsgCenterPatrolTopic);
list.add("+/+/shaoshan"); // 添加换流站韶山监听事件 list.add("+/+/eventAlarm"); // 添加换流站韶山监听事件 --- shaoshan 修改为 eventAlarm:事件告警 - 统一
String[] arr = list.toArray(new String[list.size()]); String[] arr = list.toArray(new String[list.size()]);
adapter = new MqttPahoMessageDrivenChannelAdapter(clientId + "_inbound", mqttPahoClientFactory(), arr); adapter = new MqttPahoMessageDrivenChannelAdapter(clientId + "_inbound", mqttPahoClientFactory(), arr);
adapter.setCompletionTimeout(completionTimeout); adapter.setCompletionTimeout(completionTimeout);
...@@ -161,7 +161,7 @@ public class EquipmentIotMqttReceiveConfig { ...@@ -161,7 +161,7 @@ public class EquipmentIotMqttReceiveConfig {
mqttEventReceiveService.handlerMqttIncrementMessage(topic, msg); mqttEventReceiveService.handlerMqttIncrementMessage(topic, msg);
}else if (dataType.equals("transmit") && StringUtil.isNotEmpty(msg)){ // 遥信遥测信号 }else if (dataType.equals("transmit") && StringUtil.isNotEmpty(msg)){ // 遥信遥测信号
mqttReceiveService.handlerMqttRomaMessage(topic,msg); mqttReceiveService.handlerMqttRomaMessage(topic,msg);
}else if (dataType.equals("shaoshan") && StringUtil.isNotEmpty(msg)){ // 告警信号 }else if (dataType.equals("eventAlarm") && StringUtil.isNotEmpty(msg)){ // 告警信号
mqttReceiveService.handlerMqttStationMessage(topic,msg); mqttReceiveService.handlerMqttStationMessage(topic,msg);
} }
} }
......
package com.yeejoin.equipmanage.controller; package com.yeejoin.equipmanage.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.equipmanage.common.entity.Alarm; import com.yeejoin.equipmanage.common.entity.Alarm;
import com.yeejoin.equipmanage.common.utils.NameUtils; import com.yeejoin.equipmanage.common.utils.NameUtils;
import com.yeejoin.equipmanage.config.PersonIdentify;
import com.yeejoin.equipmanage.service.IAlarmService; import com.yeejoin.equipmanage.service.IAlarmService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import liquibase.pro.packaged.O;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.util.ReflectionUtils; import org.springframework.util.ReflectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
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 org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
import java.util.Map;
/** /**
* *
...@@ -33,6 +45,9 @@ public class AlarmController { ...@@ -33,6 +45,9 @@ public class AlarmController {
@Autowired @Autowired
IAlarmService iAlarmService; IAlarmService iAlarmService;
@Autowired
RedisUtils redisUtils;
/** /**
* 新增 * 新增
* *
...@@ -60,7 +75,7 @@ public class AlarmController { ...@@ -60,7 +75,7 @@ public class AlarmController {
/** /**
* 修改 * 修改
* *
* @return * @return
*/ */
@RequestMapping(value = "/updateById", method = RequestMethod.PUT) @RequestMapping(value = "/updateById", method = RequestMethod.PUT)
...@@ -129,4 +144,45 @@ public class AlarmController { ...@@ -129,4 +144,45 @@ public class AlarmController {
page = iAlarmService.page(pageBean, alarmQueryWrapper); page = iAlarmService.page(pageBean, alarmQueryWrapper);
return page; return page;
} }
/**
* 设备平台告警数量统计,按系统
*
* @return
*/
@PersonIdentify
@RequestMapping(value = "/totalAlarmNum", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "设备平台告警数量统计,按系统", notes = "设备平台告警数量统计,按系统")
public ResponseModel<Object> totalAlarmNum(String bizOrgCode, String systemId) {
if(StringUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return ResponseHelper.buildResponse(iAlarmService.totalNum(bizOrgCode, systemId));
}
/**
* 设备告警信息导出
*
* @return
*/
@RequestMapping(value = "/downList", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "告警信息导出", notes = "告警信息导出")
public void downList(HttpServletResponse response, @RequestParam(required = false) List<String> types,
@RequestParam(required = false) List<String> emergencyLevels,
@RequestParam(required = false) String name,
@RequestParam(required = false) Integer cleanStatus,
@RequestParam(required = false) Integer handleStatus,
@RequestParam(required = false) String bizOrgCode,
@RequestParam(required = false) String systemCode,
@RequestParam(required = false) String createDate,
@RequestParam(required = false) String startDate,
@RequestParam(required = false) String endDate ) {
iAlarmService.downList(response,bizOrgCode, systemCode, types, emergencyLevels, name, cleanStatus, handleStatus, createDate, startDate, endDate);
}
} }
...@@ -707,7 +707,9 @@ public class EmergencyController extends AbstractBaseController { ...@@ -707,7 +707,9 @@ public class EmergencyController extends AbstractBaseController {
@RequestParam(required = false) Integer handleStatus, @RequestParam(required = false) Integer handleStatus,
@RequestParam(required = false) String bizOrgCode, @RequestParam(required = false) String bizOrgCode,
@RequestParam(required = false) String systemCode, @RequestParam(required = false) String systemCode,
@RequestParam(required = false) String createDate @RequestParam(required = false) String createDate,
@RequestParam(required = false) String startDate,
@RequestParam(required = false) String endDate
) { ) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize); Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
if (StringUtils.isEmpty(bizOrgCode)) { if (StringUtils.isEmpty(bizOrgCode)) {
...@@ -720,7 +722,7 @@ public class EmergencyController extends AbstractBaseController { ...@@ -720,7 +722,7 @@ public class EmergencyController extends AbstractBaseController {
} }
} }
} }
return CommonResponseUtil.success(iEmergencyService.alarmList(page, bizOrgCode, systemCode, types, emergencyLevels, name, cleanStatus, handleStatus, createDate)); return CommonResponseUtil.success(iEmergencyService.alarmList(page, bizOrgCode, systemCode, types, emergencyLevels, name, cleanStatus, handleStatus, createDate, startDate, endDate));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
......
...@@ -58,10 +58,10 @@ public class FileManageController extends BaseController { ...@@ -58,10 +58,10 @@ public class FileManageController extends BaseController {
} }
@PersonIdentify @PersonIdentify
@RequestMapping(value = "/getFileManageByName", method = RequestMethod.GET) @RequestMapping(value = "/getFileManageByName", method = RequestMethod.POST)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "列表行点击查看按钮", produces = "application/json;charset=UTF-8", notes = "列表行点击查看按钮") @ApiOperation(httpMethod = "POST", value = "列表行点击查看按钮", produces = "application/json;charset=UTF-8", notes = "列表行点击查看按钮")
public ResponseModel<Page<Map<String, Object>>> getFileManageByName(FileManageDto dto) { public ResponseModel<Page<Map<String, Object>>> getFileManageByName(@RequestBody FileManageDto dto) {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
dto.setBizOrgCode(reginParams.getPersonIdentity().getBizOrgCode()); dto.setBizOrgCode(reginParams.getPersonIdentity().getBizOrgCode());
return CommonResponseUtil.success(fileManageService.getFileManageByName(dto)); return CommonResponseUtil.success(fileManageService.getFileManageByName(dto));
......
package com.yeejoin.equipmanage.controller; package com.yeejoin.equipmanage.controller;
import com.yeejoin.equipmanage.common.entity.SignalClassify;
import com.yeejoin.equipmanage.common.vo.EquipCategoryVo; import com.yeejoin.equipmanage.common.vo.EquipCategoryVo;
import com.yeejoin.equipmanage.service.IStatisticsService; import com.yeejoin.equipmanage.service.IStatisticsService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -10,6 +11,8 @@ import org.springframework.http.MediaType; ...@@ -10,6 +11,8 @@ import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
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 org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
...@@ -95,4 +98,11 @@ public class StatisticsController { ...@@ -95,4 +98,11 @@ public class StatisticsController {
public List<EquipCategoryVo> equipCategoryVoList(@PathVariable String systemCode) { public List<EquipCategoryVo> equipCategoryVoList(@PathVariable String systemCode) {
return iStatisticsService.equipCategoryVoList(systemCode); return iStatisticsService.equipCategoryVoList(systemCode);
} }
@RequestMapping(value = "/test", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public ResponseModel<String> getStr() {
return ResponseHelper.buildResponse(iStatisticsService.getStr());
}
} }
...@@ -3,14 +3,17 @@ package com.yeejoin.equipmanage.controller; ...@@ -3,14 +3,17 @@ package com.yeejoin.equipmanage.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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;
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.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;
import com.yeejoin.equipmanage.fegin.IotFeign; import com.yeejoin.equipmanage.fegin.IotFeign;
import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper; import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.mapper.FormInstanceEquipMapper;
import com.yeejoin.equipmanage.service.*; import com.yeejoin.equipmanage.service.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -66,6 +69,9 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -66,6 +69,9 @@ public class SupervisionConfigureController extends AbstractBaseController {
@Value("${equipment.pressurepump.start}") @Value("${equipment.pressurepump.start}")
private String pressurePumpStart; private String pressurePumpStart;
@Autowired
private FormInstanceEquipMapper formInstanceEquipMapper;
@PersonIdentify @PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -106,17 +112,59 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -106,17 +112,59 @@ public class SupervisionConfigureController extends AbstractBaseController {
} else { } else {
m.put("levelAbs", transResult.get("abs")); m.put("levelAbs", transResult.get("abs"));
} }
if (m.containsKey("pumpDeviceId") && !ObjectUtils.isEmpty(m.get("pumpDeviceId"))) {
// 计算可使用时间:储水量(L) / 出口流量(L/s), 单位为小时 List<String> pumpDeviceIds = Arrays.asList(m.get("pumpDeviceId").toString().split(","));
float outputFlowRate = Float.parseFloat(m.getOrDefault("outputFlowRate", "0").toString()); LambdaQueryWrapper<FormInstanceEquip> wrapper = new LambdaQueryWrapper<>();
if (levelAbsLiter.compareTo(new BigDecimal(0)) != 0 && outputFlowRate != 0) { wrapper.in(FormInstanceEquip::getInstanceId, pumpDeviceIds);
double availableSeconds = levelAbsLiter.divide(new BigDecimal(outputFlowRate), 0, RoundingMode.HALF_UP).doubleValue(); wrapper.eq(FormInstanceEquip::getFieldName, "outputFlowRate");
double availableHours = availableSeconds / 3600.0; List<FormInstanceEquip> formInstanceEquips = formInstanceEquipMapper.selectList(wrapper);
m.put("availableTime", String.format("%.1fh", availableHours)); // 启动一台时 Map<Long, String> collect = formInstanceEquips.stream().collect(Collectors.toMap(FormInstanceEquip::getInstanceId, FormInstanceEquip::getFieldValue));
m.put("availableTimeOnStartTwo", String.format("%.1fh", availableHours / 2)); // 启动两台时 List<String> dataInfo = new ArrayList<>();
} else { int i = 1;
m.put("availableTime", "--"); double addFlowRate = 0.0;
m.put("availableTimeOnStartTwo", "--"); List<Map<String, Object>> info = new ArrayList<>();
for (String pumpDeviceId : pumpDeviceIds) {
HashMap<String, Object> map = new HashMap<>();
map.put("pumpDeviceId", pumpDeviceId);
if (collect.containsKey(Long.valueOf(pumpDeviceId)) && StringUtil.isNotEmpty(collect.get(Long.valueOf(pumpDeviceId)))) {
map.put("outputFlowRate", collect.get(Long.valueOf(pumpDeviceId)));
} else {
map.put("outputFlowRate", 0);
}
info.add(map);
}
// 按流量排序
Collections.sort(info, new Comparator<Map<String, Object>>() {
@Override
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
Float bl1 = Float.valueOf(o1.get("outputFlowRate").toString());
Float bl2 = Float.valueOf(o2.get("outputFlowRate").toString());
return bl2.compareTo(bl1);
}
});
for (Map<String, Object> map : info) {
String message = "启动%s台消防泵可使用时间≈%s";
String availableTimeFirst = "0.0";
// 计算可使用时间:储水量(L) / 出口流量(L/s), 单位为小时
float outputFlowRate = Float.parseFloat(map.getOrDefault("outputFlowRate", "0").toString());
addFlowRate = outputFlowRate + addFlowRate;
if (levelAbsLiter.compareTo(new BigDecimal(0)) != 0 && addFlowRate != 0) {
double availableSeconds = levelAbsLiter.divide(BigDecimal.valueOf(addFlowRate), 0, RoundingMode.HALF_UP).doubleValue();
double availableHours = availableSeconds / 3600.0;
message = String.format(message, i, String.format("%.1fh", availableHours)); // 启动一台时
availableTimeFirst = String.format("%.1fh", availableHours);
} else {
message = String.format(message, i, "--");
availableTimeFirst = "--";
}
dataInfo.add(message);
if (i == 1) {
m.put("availableTime", availableTimeFirst);
}
i++;
}
m.put("availableTimeInfo", dataInfo);
} }
} }
} }
...@@ -149,7 +197,9 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -149,7 +197,9 @@ public class SupervisionConfigureController extends AbstractBaseController {
m.put("levelStatus", "--"); m.put("levelStatus", "--");
} }
m.put("levelAbs", transResult.get("abs")); m.put("levelAbs", transResult.get("abs"));
if (transResult.containsKey("unit")) {
m.put("unit", transResult.get("unit"));
}
// 计算可使用时间:储水量(L) / 出口流量(L/s), 单位为小时 // 计算可使用时间:储水量(L) / 出口流量(L/s), 单位为小时
BigDecimal levelAbsLiter = new BigDecimal(0); // 储水量(升) BigDecimal levelAbsLiter = new BigDecimal(0); // 储水量(升)
BigDecimal volume = new BigDecimal(0); BigDecimal volume = new BigDecimal(0);
......
package com.yeejoin.equipmanage.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
@Data
public class AlarmExportDto {
@ExcelProperty(value = "设备名称", index = 0)
private String equipmentSpecificName;
@ExcelProperty(value = "类型", index = 1)
private String type;
@ExcelProperty(value = "等级", index = 2)
private String emergencyLevelDescribe;
@ExcelProperty(value = "消除状态", index = 3)
private String cleanStatus;
@ExcelProperty(value = "时间", index = 4)
private String createDate;
@ExcelProperty(value = "所在位置", index = 5)
private String location;
@ExcelProperty(value = "告警确认", index = 6)
private String handleStatus;
}
package com.yeejoin.equipmanage.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* @author keyong
* @title: ReportAlarmDto
* <pre>
* @description: TODO
* </pre>
* @date 2024/5/11 9:56
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ReportAlarmDto {
private String equipmentSpecificId;
private String specificName;
private String location;
private String equipmentSpecificIndexName;
private String alamContent;
private BigDecimal alarmNum;
private String createDate;
private String updateDate;
private String type;
}
...@@ -2,6 +2,10 @@ package com.yeejoin.equipmanage.mapper; ...@@ -2,6 +2,10 @@ package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.Alarm; import com.yeejoin.equipmanage.common.entity.Alarm;
import liquibase.pro.packaged.S;
import java.util.List;
import java.util.Map;
/** /**
* Mapper 接口 * Mapper 接口
...@@ -11,4 +15,5 @@ import com.yeejoin.equipmanage.common.entity.Alarm; ...@@ -11,4 +15,5 @@ import com.yeejoin.equipmanage.common.entity.Alarm;
*/ */
public interface AlarmMapper extends BaseMapper<Alarm> { public interface AlarmMapper extends BaseMapper<Alarm> {
List<Map<String,String>> totalNum(String bizOrgCode, String systemId);
} }
...@@ -107,7 +107,9 @@ public interface EmergencyMapper extends BaseMapper{ ...@@ -107,7 +107,9 @@ 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, @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); 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);
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);
IPage<EquipTypeImgAmountVO> getEmergencyEquipList(@Param("page") IPage page, @Param("equipTypeAmountPage") EquipTypeAmountPageDTO equipTypeAmountPage, @Param("list") List<String> list); IPage<EquipTypeImgAmountVO> getEmergencyEquipList(@Param("page") IPage page, @Param("equipTypeAmountPage") EquipTypeAmountPageDTO equipTypeAmountPage, @Param("list") List<String> list);
......
...@@ -11,6 +11,7 @@ import com.yeejoin.equipmanage.common.entity.dto.EquipSpecificAlarmDTO; ...@@ -11,6 +11,7 @@ import com.yeejoin.equipmanage.common.entity.dto.EquipSpecificAlarmDTO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentIotAlarmVO; import com.yeejoin.equipmanage.common.entity.vo.EquipmentIotAlarmVO;
import com.yeejoin.equipmanage.common.utils.CommonPageInfoParam; import com.yeejoin.equipmanage.common.utils.CommonPageInfoParam;
import com.yeejoin.equipmanage.common.vo.EquipAlarmLineVo; import com.yeejoin.equipmanage.common.vo.EquipAlarmLineVo;
import com.yeejoin.equipmanage.dto.ReportAlarmDto;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -235,5 +236,5 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif ...@@ -235,5 +236,5 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
void clearAlarmData(@Param("equipmentSpecificId") Long equipmentSpecificId); void clearAlarmData(@Param("equipmentSpecificId") Long equipmentSpecificId);
List<Map<String, Object>> getAlarmDetailByDate(@Param("bizOrgCode") String bizOrgCode, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("sysId") Long sysId); List<ReportAlarmDto> getAlarmDetailByDate(@Param("bizOrgCode") String bizOrgCode, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("sysId") Long sysId);
} }
package com.yeejoin.equipmanage.service; package com.yeejoin.equipmanage.service;
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.Alarm; import com.yeejoin.equipmanage.common.entity.Alarm;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/** /**
* 服务类 * 服务类
* *
...@@ -11,4 +16,7 @@ import com.yeejoin.equipmanage.common.entity.Alarm; ...@@ -11,4 +16,7 @@ import com.yeejoin.equipmanage.common.entity.Alarm;
*/ */
public interface IAlarmService extends IService<Alarm> { public interface IAlarmService extends IService<Alarm> {
List<Map<String,String>> totalNum(String bizOrgCode, String systemId);
void downList(HttpServletResponse response, String bizOrgCode, String systemCode, List<String> types, List<String> emergencyLevels, String name, Integer cleanStatus, Integer handleStatus, String createDate, String startDate, String endDate);
} }
...@@ -69,7 +69,7 @@ public interface IEmergencyService { ...@@ -69,7 +69,7 @@ public interface IEmergencyService {
List<Map<String, Object>> getPressurePumpDiagnosticAnalysis(String bizOrgCode); 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); 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);
Map<String, List<PressurePumpCountVo>> getPressurePumpDay(); Map<String, List<PressurePumpCountVo>> getPressurePumpDay();
......
...@@ -22,5 +22,6 @@ public interface IStatisticsService { ...@@ -22,5 +22,6 @@ public interface IStatisticsService {
*/ */
List<EquipCategoryVo> equipCategoryVoList(String systemCode); List<EquipCategoryVo> equipCategoryVoList(String systemCode);
String getStr();
} }
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import com.alibaba.fastjson.JSONObject;
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.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
import com.yeejoin.equipmanage.common.entity.Alarm; import com.yeejoin.equipmanage.common.entity.Alarm;
import com.yeejoin.equipmanage.common.vo.EquipmentAlarmDownloadVO;
import com.yeejoin.equipmanage.dto.AlarmExportDto;
import com.yeejoin.equipmanage.mapper.AlarmMapper; import com.yeejoin.equipmanage.mapper.AlarmMapper;
import com.yeejoin.equipmanage.mapper.EmergencyMapper;
import com.yeejoin.equipmanage.service.IAlarmService; import com.yeejoin.equipmanage.service.IAlarmService;
import liquibase.pro.packaged.L;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/** /**
* 服务实现类 * 服务实现类
* *
...@@ -15,4 +29,30 @@ import org.springframework.stereotype.Service; ...@@ -15,4 +29,30 @@ import org.springframework.stereotype.Service;
@Service @Service
public class AlarmServiceImpl extends ServiceImpl<AlarmMapper, Alarm> implements IAlarmService { public class AlarmServiceImpl extends ServiceImpl<AlarmMapper, Alarm> implements IAlarmService {
@Autowired
AlarmMapper alarmMapper;
@Autowired
EmergencyMapper emergencyMapper;
@Override
public void downList(HttpServletResponse response, String bizOrgCode, String systemCode, List<String> types, List<String> emergencyLevels, String name, Integer cleanStatus, Integer handleStatus, String createDate, String startDate, String endDate) {
List<Map<String, Object>> list = emergencyMapper.alarmListNoPage(bizOrgCode, systemCode, types, emergencyLevels, name, cleanStatus, handleStatus, createDate, startDate, endDate);
List<AlarmExportDto> alarmExportDtoList = new ArrayList<>();
if(list.size() > 0) {
for (Map m :list
) {
String s = JSONObject.toJSONString(m);
AlarmExportDto dto = JSONObject.parseObject(s, AlarmExportDto.class);
alarmExportDtoList.add(dto);
}
ExcelUtil.createTemplate(response, "设备告警信息", "设备告警信息", alarmExportDtoList, AlarmExportDto.class, null, false);
}
}
@Override
public List<Map<String,String>> totalNum(String bizOrgCode, String systemId) {
return alarmMapper.totalNum(bizOrgCode, systemId);
}
} }
...@@ -113,8 +113,8 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM ...@@ -113,8 +113,8 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM
String indicator = String.valueOf(collect.get(0).get("index")); String indicator = String.valueOf(collect.get(0).get("index"));
// 权限处理 // 权限处理
PermissionInterceptorContext.setDataAuthRule(authKey); PermissionInterceptorContext.setDataAuthRule(authKey);
analysisReportMonthMapper.insertSystemMonthData(new ArrayList<>(Arrays.asList(indicator.split(","))), beginDateStr, endDateStr, Long.valueOf(f.get("id").toString())); analysisReportMonthMapper.insertSystemMonthData(new ArrayList<>(), beginDateStr, endDateStr, Long.valueOf(f.get("id").toString()));
analysisReportSummaryMapper.insertSystemMonthSummaryData(new ArrayList<>(Arrays.asList(indicator.split(","))), beginDateStr, endDateStr, Long.valueOf(f.get("id").toString())); analysisReportSummaryMapper.insertSystemMonthSummaryData(new ArrayList<>(), beginDateStr, endDateStr, Long.valueOf(f.get("id").toString()));
} }
}); });
} }
...@@ -148,8 +148,8 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM ...@@ -148,8 +148,8 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM
String indicator = String.valueOf(collect.get(0).get("index")); String indicator = String.valueOf(collect.get(0).get("index"));
// 权限处理 // 权限处理
PermissionInterceptorContext.setDataAuthRule(authKey); PermissionInterceptorContext.setDataAuthRule(authKey);
analysisReportMonthMapper.insertSystemMonthData(new ArrayList<>(Arrays.asList(indicator.split(","))), beginDateStr, endDateStr, Long.valueOf(f.get("id").toString())); analysisReportMonthMapper.insertSystemMonthData(new ArrayList<>(), beginDateStr, endDateStr, Long.valueOf(f.get("id").toString()));
analysisReportSummaryMapper.insertSystemMonthSummaryData(new ArrayList<>(Arrays.asList(indicator.split(","))), beginDateStr, endDateStr, Long.valueOf(f.get("id").toString())); analysisReportSummaryMapper.insertSystemMonthSummaryData(new ArrayList<>(), beginDateStr, endDateStr, Long.valueOf(f.get("id").toString()));
} }
}); });
} }
......
...@@ -643,8 +643,8 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -643,8 +643,8 @@ public class EmergencyServiceImpl implements IEmergencyService {
@Override @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) { 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); return emergencyMapper.alarmList(page, bizOrgCode, systemCode, types, emergencyLevels, name, cleanStatus, handleStatus, createDate, startDate, endDate);
} }
//稳压泵定时向缓存中存昨日启动次数任务 //稳压泵定时向缓存中存昨日启动次数任务
......
...@@ -390,15 +390,14 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe ...@@ -390,15 +390,14 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
} }
} }
// 剩余服役天数 = 报废日期 - 当前日期 // 剩余服役天数 = 报废日期 - 当前日期
String scrapDate = scrapInfo.getOrDefault("scrapDate", "").toString(); Date scrapDate = equipmentDetail.getScrapDate();
if (Objects.nonNull(scrapDate)) { if (Objects.nonNull(scrapDate)) {
Date nowDate = DateUtils.getDateNow(); Date nowDate = DateUtils.getDateNow();
try { try {
Date date = dateFormat.parse(scrapDate); int i = DateUtils.dateBetween(scrapDate, nowDate);
int i = DateUtils.dateBetween(date, nowDate); equipmentDetail.setRemainingDays(Integer.parseInt(String.valueOf(i).replace("-", "")));
equipmentDetail.setRemainingDays(i);
} catch (ParseException e) { } catch (ParseException e) {
log.error("时间格式异常:", e); log.error("时间计算异常:", e);
} }
} }
} }
...@@ -421,7 +420,7 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe ...@@ -421,7 +420,7 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
String qrCodeImage = QRCodeUtil.genQrCodeBase64PngWithWord(equipmentSpecific.getQrCode(), 200, 200, equipmentSpecific.getQrCode(),200, type); String qrCodeImage = QRCodeUtil.genQrCodeBase64PngWithWord(equipmentSpecific.getQrCode(), 200, 200, equipmentSpecific.getQrCode(),200, type);
equipmentDetail.setQrCodeImage(qrCodeImage); equipmentDetail.setQrCodeImage(qrCodeImage);
// 消防系统 // 消防系统
if (Objects.nonNull(equipmentSpecific.getSystemId())) { if (StringUtil.isNotEmpty(equipmentSpecific.getSystemId())) {
List<FireFightingSystemEntity> sys = fireFightingSystemMapper.getFightingSysByIds(equipmentSpecific.getSystemId().split(",")); List<FireFightingSystemEntity> sys = fireFightingSystemMapper.getFightingSysByIds(equipmentSpecific.getSystemId().split(","));
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (FireFightingSystemEntity entity : sys) { for (FireFightingSystemEntity entity : sys) {
......
...@@ -38,8 +38,6 @@ import com.yeejoin.equipmanage.mapper.*; ...@@ -38,8 +38,6 @@ import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.remote.RemoteSecurityService; import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*; import com.yeejoin.equipmanage.service.*;
import com.yeejoin.equipmanage.utils.RelationRedisUtil; import com.yeejoin.equipmanage.utils.RelationRedisUtil;
import liquibase.pro.packaged.J;
import liquibase.pro.packaged.S;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
...@@ -1732,6 +1730,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1732,6 +1730,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
es.setRealtimeIotIndexId(index.getEquipmentIndexId()); es.setRealtimeIotIndexId(index.getEquipmentIndexId());
es.setRealtimeIotIndexUpdateDate(index.getUpdateDate()); es.setRealtimeIotIndexUpdateDate(index.getUpdateDate());
es.setValueLabel(index.getValueLabel()); es.setValueLabel(index.getValueLabel());
es.setTypeCode(index.getTypeCode());
equipmentSpecificMapper.updateById(es); equipmentSpecificMapper.updateById(es);
} }
} }
......
...@@ -52,7 +52,7 @@ public class FormInstanceEquipServiceImpl extends ServiceImpl<FormInstanceEquipM ...@@ -52,7 +52,7 @@ public class FormInstanceEquipServiceImpl extends ServiceImpl<FormInstanceEquipM
@Autowired @Autowired
private Sequence sequence; private Sequence sequence;
final static String[] list = {"92031900", "92011000", "92010700", "92032000"}; final static String[] list = {"92031900", "92011000", "92010700", "92032000", "92010600"};
private final String CODE = "code"; private final String CODE = "code";
......
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import com.yeejoin.equipmanage.utils.ClassToJsonUtil;
import org.springframework.core.io.Resource;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...@@ -16,6 +18,7 @@ import com.yeejoin.equipmanage.mapper.StockDetailMapper; ...@@ -16,6 +18,7 @@ import com.yeejoin.equipmanage.mapper.StockDetailMapper;
import com.yeejoin.equipmanage.remote.RemoteSecurityService; import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*; import com.yeejoin.equipmanage.service.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
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.StringUtils; import org.springframework.util.StringUtils;
...@@ -221,6 +224,16 @@ public class StatisticsServiceImpl implements IStatisticsService { ...@@ -221,6 +224,16 @@ public class StatisticsServiceImpl implements IStatisticsService {
return equipmentSpecificMapper.selectEquipCategoryNumber(fightingSystemEntity.getId()); return equipmentSpecificMapper.selectEquipCategoryNumber(fightingSystemEntity.getId());
} }
@Value("classpath:/json/commonMessage.json")
private Resource commonMessage;
@Override
public String getStr() {
String s = "{\"code\":2000,\"id\":1,\"body\":{\"warns\":[{\"systemid\":\"2\",\"pointId\":\"73811\",\"level\":\"3\",\"time\":\"2024-04-08 09:17:56.226\",\"type\":\"遥信变位\",\"deviceId\":\"\",\"content\":\"火灾报警主机_主控楼二层1#蓄电池室可燃气体火警屏蔽状态 消失\"}]}}";
String s1 = "{\"data_class\":\"realdata\",\"data_type\":\"alarm\",\"op_type\":\"subscribe_emergency\",\"condition\":{\"station_psr_id\":\"50edcb6c1b8a811030493c80a2014950ed9d4f59e8\",\"station_name\":\"中州换流站\",\"alarm_type\":\"yx_bw\"},\"data\":[{\"psrId\":\"D017020000000000000000999\",\"astId\":\"D017020000000000000000999\",\"equipType\":\"ASTType_0000111\",\"eventType\":\"OtherSignal\",\"alarmSource\":\"OWS\",\"alarmLevel\":\"3\",\"description\":\"2024-03-11 09:06:17::585 S2WCL12A E3.C01软水器再生结束信号 出现\",\"dateTime\":\"2024-03-11 09:06:17.585\"}]}";
String s2 = "{\"code\":2000,\"id\":1,\"body\":{\"time_stamp\":\"2024-04-07 16:42:52.616\",\"datatype\":\"analog\",\"name\":\"直流接地极电流IDEE\",\"value\":12.969970703125,\"key\":\"0000YC00010100409C\",\"quality\":0,”code”:1001}}";
return ClassToJsonUtil.class2json(s1, commonMessage, "k1");
}
private Double getExtinguishingCountByWarehouseId(String categoryCode, Long warehouseId) { private Double getExtinguishingCountByWarehouseId(String categoryCode, Long warehouseId) {
......
...@@ -620,8 +620,10 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -620,8 +620,10 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
String url = ""; String url = "";
if ("hls".equals(vedioFormat)) { if ("hls".equals(vedioFormat)) {
url = getVideoUrl(code); url = getVideoUrl(code);
} else { } else if("rtps".equals(vedioFormat)) {
url = getFlvUrlByVideoId(code); return "";
} else {
url = getFlvUrlByVideoId(code);
} }
return ObjectUtils.isEmpty(url) ? defaultUrl : url; return ObjectUtils.isEmpty(url) ? defaultUrl : url;
} }
......
package com.yeejoin.equipmanage.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonObject;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.core.io.Resource;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author keyong
* @title: ClassToJsonUtil
* <pre>
* @description: TODO
* </pre>
* @date 2024/4/11 11:28
*/
public class ClassToJsonUtil {
private static Map<String, Object> map = new HashMap<>();
public static String class2json(Object obj, Resource commonMessage, String topic) {
String json;
try {
json = IOUtils.toString(commonMessage.getInputStream(), String.valueOf(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException("获取kafka信息模板失败!");
}
List<Map> listModel = JSONObject.parseArray(json, Map.class);
if (0 < listModel.size()) {
List<Map> mapList = listModel.stream().filter(x -> String.valueOf(x.get("kafkaTopic")).equalsIgnoreCase(topic)).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(mapList)) {
Map<String, Object> map1 = mapList.get(0);
JSONObject object = JSON.parseObject(String.valueOf(obj));
analysisJson(object, "");
JSONObject res = analyseJson(JSON.toJSONString(map1), map);
res.put("kafkaTopic", map1.get("kafkaTopic"));
res.put("mqTopic", map1.get("mqTopic"));
return JSON.toJSONString(res);
}
}
return null;
}
private static JSONObject analysisJson(Object objJson, String flag) {
if (objJson instanceof JSONArray) {//如果obj为json数组
JSONArray objArray = (JSONArray) objJson;
for (int i = 0; i < objArray.size(); i++) {
analysisJson(objArray.get(i), flag);
}
} else if (objJson instanceof JSONObject) {//如果为json对象
JSONObject jsonObject = (JSONObject) objJson;
Iterator it = jsonObject.keySet().iterator();
while (it.hasNext()) {
String key = it.next().toString();
Object object = jsonObject.get(key);
//如果得到的是数组
if (object instanceof JSONArray) {
JSONArray objArray = (JSONArray) object;
String path = "";
if (StringUtils.isNotBlank(flag)) {
path = flag + "." + key;
} else {
path = key;
}
analysisJson(objArray, path);
} else if (object instanceof JSONObject) {//如果key中是一个json对象
String path = "";
if (StringUtils.isNotBlank(flag)) {
path = flag + "." + key;
} else {
path = key;
}
analysisJson((JSONObject) object, path);
} else {//如果key中是其他
String path = "";
if (StringUtils.isNotBlank(flag)) {
path = flag + "." + key;
} else {
path = key;
}
// System.out.println(path+":"+object.toString()+" ");
map.put(path, String.valueOf(object));
}
}
} else {//如果key中是其他
// System.out.println(flag+":"+objJson.toString()+" ");
map.put(flag, String.valueOf(objJson));
}
return JSONObject.parseObject(JSON.toJSONString(map));
}
public static JSONObject analyseJson(String jsonData, Map<String, Object> keyMap) {
SortedMap<String, Object> map = new TreeMap<>();
JSONObject jsonObject = JSON.parseObject(jsonData);
for (String key : jsonObject.keySet()) {
String resKey = keyMap.get(key) == null ? key : String.valueOf(keyMap.get(key));
Object value = jsonObject.get(key);
if (value instanceof JSONArray) {
JSONArray jsonArray = new JSONArray(new LinkedList<>());
JSONArray array = jsonObject.getJSONArray(key);
for (int i = 0; i < array.size(); i++) {
Object object = array.get(i);
if (object instanceof String) {
map.put(resKey, array);
} else {
JSONObject sortJson = analyseJson(String.valueOf(object), keyMap);
jsonArray.add(sortJson);
map.put(resKey, jsonArray);
}
}
} else if (value instanceof JSONObject) {
JSONObject sortJson = analyseJson(String.valueOf(value), keyMap);
map.put(resKey, sortJson);
} else {
map.put(resKey, ObjectUtils.isNotEmpty(keyMap.get(value)) ? keyMap.get(value) : "");
}
}
return new JSONObject(map);
}
}
...@@ -38,6 +38,20 @@ public class FireResourceSupervisionController extends BaseController { ...@@ -38,6 +38,20 @@ public class FireResourceSupervisionController extends BaseController {
return ResponseHelper.buildResponse(personnelStats); return ResponseHelper.buildResponse(personnelStats);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "驻站消防员、运维人员统计信息查询", notes = "驻站消防员、运维人员统计信息查询")
@RequestMapping(value = "/person/stats", method = RequestMethod.GET)
public ResponseModel<Object> personStats(
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "peopleType", required = false) Integer peopleType
) {
if (StringUtils.isBlank(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtils.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
}
return ResponseHelper.buildResponse(iFireResourceSupervisionService.selectQualificationStats(bizOrgCode, peopleType));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "设备平台驻站消防员、运维人员统计信息查询", notes = "驻站消防员、运维人员统计信息查询") @ApiOperation(httpMethod = "GET", value = "设备平台驻站消防员、运维人员统计信息查询", notes = "驻站消防员、运维人员统计信息查询")
@RequestMapping(value = "/person/info", method = RequestMethod.GET) @RequestMapping(value = "/person/info", method = RequestMethod.GET)
......
...@@ -15,6 +15,7 @@ import java.util.HashMap; ...@@ -15,6 +15,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -65,6 +66,11 @@ public class FireResourceSupervisionServiceImpl implements IFireResourceSupervis ...@@ -65,6 +66,11 @@ public class FireResourceSupervisionServiceImpl implements IFireResourceSupervis
} }
@Override @Override
public List<Map<String, Object>> selectQualificationStats(String bizOrgCode, Integer peopleType) {
return fireResourceSupervisionMapper.selectQualificationStats(bizOrgCode, peopleType);
}
@Override
public Map<String, Map<String, String>> getPersonInfo(String bizOrgCode) { public Map<String, Map<String, String>> getPersonInfo(String bizOrgCode) {
List<Map<String, Object>> maps = fireResourceSupervisionMapper.selectPersonnelStats(bizOrgCode); List<Map<String, Object>> maps = fireResourceSupervisionMapper.selectPersonnelStats(bizOrgCode);
// Long attendanceCount = fireResourceSupervisionMapper.selectTodayAttendance(bizOrgCode); // Long attendanceCount = fireResourceSupervisionMapper.selectTodayAttendance(bizOrgCode);
......
...@@ -319,6 +319,9 @@ public interface PlanTaskMapper extends BaseMapper { ...@@ -319,6 +319,9 @@ public interface PlanTaskMapper extends BaseMapper {
Map<String, Object> getDefectEquipInfo(@Param(value="id") String id); Map<String, Object> getDefectEquipInfo(@Param(value="id") String id);
List<Map<String, String>> getDefectEquipInfoByIds(@Param(value="ids") List<String> ids);
List<Map<String, Object>> getCheckMissedEquipInfo(@Param(value="taskDetailId") String taskDetailId); List<Map<String, Object>> getCheckMissedEquipInfo(@Param(value="taskDetailId") String taskDetailId);
List<Map<String, Object>> getCheckQualifiedEquipInfo(@Param(value="taskDetailId") String taskDetailId); List<Map<String, Object>> getCheckQualifiedEquipInfo(@Param(value="taskDetailId") String taskDetailId);
......
...@@ -30,4 +30,7 @@ public interface IdxFeign { ...@@ -30,4 +30,7 @@ public interface IdxFeign {
@PostMapping(value = "/defect/check/list") @PostMapping(value = "/defect/check/list")
FeignClientResult queryDefectByCodes(@RequestBody List<String> codes, @RequestParam (value="checkId") String checkId); FeignClientResult queryDefectByCodes(@RequestBody List<String> codes, @RequestParam (value="checkId") String checkId);
@PostMapping(value = "/defect/check/listNew")
FeignClientResult queryDefectByIdList(@RequestBody List<String> checkIdList);
} }
...@@ -120,6 +120,8 @@ public class CheckServiceImpl implements ICheckService { ...@@ -120,6 +120,8 @@ public class CheckServiceImpl implements ICheckService {
@Value("${auth-key-auth-enabled:}") @Value("${auth-key-auth-enabled:}")
private String authKey; private String authKey;
public static final Logger log = LoggerFactory.getLogger(CheckServiceImpl.class);
@Value("${auth-key-auth-enabled:}") @Value("${auth-key-auth-enabled:}")
private String authKeyEnabled; private String authKeyEnabled;
...@@ -195,26 +197,27 @@ public class CheckServiceImpl implements ICheckService { ...@@ -195,26 +197,27 @@ public class CheckServiceImpl implements ICheckService {
if (total == 0) { if (total == 0) {
return new PageImpl<>(content, param, total); return new PageImpl<>(content, param, total);
} }
// content = checkMapper.getPeopleCheckPage(param);
content = checkMapper.getPeopleCheckPageNew(param); content = checkMapper.getPeopleCheckPageNew(param);
List<String> collect = content.stream().map(CheckInfoVo::getId).collect(Collectors.toList());
FeignClientResult responseModel = new FeignClientResult();
List<Map<String, String>> result = new ArrayList();
try {
responseModel = idxFeign.queryDefectByIdList(collect);
result = (List) responseModel.getResult();
} catch (Exception e) {
e.printStackTrace();
}
Map<String, Map<String, String>> checkIdMap = new HashMap<>();
if (result != null && 0 < result.size()) {
checkIdMap = result.stream().collect(Collectors.toMap(t -> t.get("checkId"), t -> t, (k1, k2) -> k2));
}
for (CheckInfoVo infoVo : content) { for (CheckInfoVo infoVo : content) {
FeignClientResult responseModel = new FeignClientResult(); if (!ObjectUtils.isEmpty(checkIdMap) && checkIdMap.containsKey(infoVo.getId()) && !ObjectUtils.isEmpty(checkIdMap.get(infoVo.getId()))) {
List result = new ArrayList(); Map<String, String> map = checkIdMap.get(infoVo.getId());
try { DefectVo vo = JSON.parseObject(JSON.toJSONString(map), DefectVo.class);
responseModel = idxFeign.queryDefectByCodes(new ArrayList<>(), infoVo.getId()); infoVo.setError(vo.getDefectDescribe());
result = (List) responseModel.getResult(); infoVo.setProblemNum(vo.getDefectNum());
} catch (Exception e) { infoVo.setHandleStatus(String.valueOf(vo.getDefectStatus()));
e.printStackTrace();
}
List<DefectVo> res = new ArrayList();
if (result != null && 0 < result.size()) {
for(Object object : result) {
DefectVo vo = JSON.parseObject(JSON.toJSONString(object), DefectVo.class);
res.add(vo);
}
infoVo.setError(ObjectUtils.isEmpty(res.get(0)) ? "" : res.get(0).getDefectDescribe());
infoVo.setProblemNum(ObjectUtils.isEmpty(res.get(0)) ? "" : res.get(0).getDefectNum());
infoVo.setHandleStatus(ObjectUtils.isEmpty(res.get(0)) ? "" : String.valueOf(res.get(0).getDefectStatus()));
} }
} }
return new PageImpl<>(content, param, total); return new PageImpl<>(content, param, total);
......
...@@ -1975,13 +1975,17 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -1975,13 +1975,17 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
if (x.getDefectEquipmentIds().contains(",")){ if (x.getDefectEquipmentIds().contains(",")){
String[] ids = x.getDefectEquipmentIds().split(","); String[] ids = x.getDefectEquipmentIds().split(",");
List<String> equipIds = Arrays.asList(ids); List<String> equipIds = Arrays.asList(ids);
if (0 < equipIds.size()) { List<String> collect = equipIds.stream().distinct().collect(Collectors.toList());
List<Map<String, String>> defectEquipInfoByIds = planTaskMapper.getDefectEquipInfoByIds(collect);
Map<String, String> equipLocationMap = defectEquipInfoByIds.stream().collect(Collectors.toMap(t -> t.get("id"), t -> t.get("equipLocation")));
if (CollectionUtils.isNotEmpty(equipIds)) {
for (String s : equipIds) { for (String s : equipIds) {
sb.append(planTaskMapper.getDefectEquipInfo(x.getDefectEquipmentIds()) == null ? "": planTaskMapper.getDefectEquipInfo(x.getDefectEquipmentIds()) .get("equipLocation")).append(","); sb.append(!ObjectUtils.isEmpty(equipLocationMap) ? equipLocationMap.getOrDefault(s, "") : "").append(",");
} }
} }
}else { }else {
sb.append(planTaskMapper.getDefectEquipInfo(x.getDefectEquipmentIds()) == null ? "": planTaskMapper.getDefectEquipInfo(x.getDefectEquipmentIds()) .get("equipLocation")); Map<String, Object> defectEquipInfo = planTaskMapper.getDefectEquipInfo(x.getDefectEquipmentIds());
sb.append(ObjectUtils.isEmpty(defectEquipInfo) ? "": defectEquipInfo.getOrDefault("equipLocation", ""));
} }
} }
defectMap.put("defect_equip_position", sb == null ? "" :sb); defectMap.put("defect_equip_position", sb == null ? "" :sb);
......
...@@ -19,6 +19,7 @@ eureka.instance.prefer-ip-address = true ...@@ -19,6 +19,7 @@ eureka.instance.prefer-ip-address = true
#eureka服务ip配置,可填写固定ip地址 #eureka服务ip配置,可填写固定ip地址
eureka.instance.hostname=172.16.11.201 eureka.instance.hostname=172.16.11.201
#eureka服务配置的校验账号及密码,配置需和eureka服务后台配置文件中一致 #eureka服务配置的校验账号及密码,配置需和eureka服务后台配置文件中一致
#eureka????????????,????eureka???????????
spring.security.user.name=admin spring.security.user.name=admin
spring.security.user.password=ENC(8Avkl0Wjal6xBOWKXQ+X1QCbtDt3n1JZS7dHehmtYFTPYNd+6diNNogVGZCPVHjE) spring.security.user.password=ENC(8Avkl0Wjal6xBOWKXQ+X1QCbtDt3n1JZS7dHehmtYFTPYNd+6diNNogVGZCPVHjE)
eureka.client.serviceUrl.defaultZone=http://${spring.security.user.name}:${spring.security.user.password}@${eureka.instance.hostname}:10001/eureka/ eureka.client.serviceUrl.defaultZone=http://${spring.security.user.name}:${spring.security.user.password}@${eureka.instance.hostname}:10001/eureka/
......
...@@ -46,8 +46,8 @@ iot.vehicle.track=AMOS-API-IOT ...@@ -46,8 +46,8 @@ iot.vehicle.track=AMOS-API-IOT
jcs.fegin.name=JCS jcs.fegin.name=JCS
video.fegin.name=VIDEO video.fegin.name=VIDEO
idx.feign.name=AMOS-IDX idx.feign.name=AMOS-IDX
mcb.feign.name=MCB-SERVER mcb.feign.name=MCB-SERVER
#\u9879\u76EE\u521D\u59CB\u5316\u753B\u5E03id #\u9879\u76EE\u521D\u59CB\u5316\u753B\u5E03id
morphic.projectSeq=1390314016458514433 morphic.projectSeq=1390314016458514433
#wl_equipment_category \u8868id \uFF08\u53D6\u706B\u707E\u62A5\u8B66\u7CFB\u7EDFid\uFF09 #wl_equipment_category \u8868id \uFF08\u53D6\u706B\u707E\u62A5\u8B66\u7CFB\u7EDFid\uFF09
...@@ -155,30 +155,34 @@ management.endpoint.health.show-details=always ...@@ -155,30 +155,34 @@ management.endpoint.health.show-details=always
logic=false logic=false
##电力报表定时任务 ##????????
jobs.month.cron = 0 50 0 1 * ? jobs.month.cron = 0 50 0 1 * ?
jobs.day.cron = 0 5 0 * * ? jobs.day.cron = 0 5 0 * * ?
jobs.week.cron = 0 25 0 ? * 1 jobs.week.cron = 0 25 0 ? * 1
jobs.day.cron.old = 0 25 0 * * ? jobs.day.cron.old = 0 25 0 * * ?
# ?????????
update.car.qrCode=0 01 00 * * ?
#预案消防炮设备类型编码 #???????????
equipment.plan.monitor=92030200,92032200 equipment.plan.monitor=92030200,92032200
#消防泵设备类型编码 #?????????
equipment.plan.pump=92010600,92030600,92130400,92140200,92150300 equipment.plan.pump=92010600,92030600,92130400,92140200,92150300
#电力设备报废业务,在设备报废前30日 每日9点执行 系统推送提醒。设备报废后停止消息推送提醒 #???????????????30? ??9??? ????????????????????
equipment.scrap.day=30 equipment.scrap.day=30
equipment.scrap.cron=0 0 9 * * ? equipment.scrap.cron=0 0 9 * * ?
#???????????kks?
power.station.url=http://139.9.169.123:5024/process/DataInterface
#稳压泵定时向缓存中存昨日启动次数任务 #??????????????????
equipment.pressurepump.start.cron=0 0 0 * * ? equipment.pressurepump.start.cron=0 0 0 * * ?
#稳压泵启停指标 #???????
equipment.pressurepump.start=FHS_PressurePump_Start equipment.pressurepump.start=FHS_PressurePump_Start
#稳压泵压力指标 #???????
equipment.pressurepump.pipepressure=FHS_PipePressureDetector_PipePressure equipment.pressurepump.pipepressure=FHS_PipePressureDetector_PipePressure
#液位指标编码 #??????
water.level.indexKey=FHS_FirePoolDevice_WaterLevel,FHS_LevelDetector_WaterLevel,FHS_WirelessliquidDetector_WaterLevel,CAFS_FoamTank_FoamTankLevel,CAFS_WaterTank_WaterTankLevel water.level.indexKey=FHS_FirePoolDevice_WaterLevel,FHS_LevelDetector_WaterLevel,FHS_WirelessliquidDetector_WaterLevel,CAFS_FoamTank_FoamTankLevel,CAFS_WaterTank_WaterTankLevel
...@@ -1101,4 +1101,30 @@ ...@@ -1101,4 +1101,30 @@
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="zs" id="20240401-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="cb_water_resource_pool" columnName="pump_device_id"/>
</not>
</preConditions>
<comment>modify table cb_water_resource_pool add columns</comment>
<sql>
ALTER TABLE `cb_water_resource_pool`
ADD pump_device_id varchar(1000) DEFAULT NULL COMMENT '消防泵装置ids',
ADD pump_device_name varchar(1500) DEFAULT NULL COMMENT '消防泵装置名称s';
</sql>
</changeSet>
<changeSet author="xxz" id="20240510-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_equipment_specific" columnName="type_code"/>
</not>
</preConditions>
<comment>wl_equipment_specific表新增属性字段type_code</comment>
<sql>
ALTER TABLE `wl_equipment_specific` ADD COLUMN `type_code` VARCHAR (50) NULL COMMENT '指标类型编码';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
[
{
"kafkaTopic": "k1",
"mqTopic": "romaSite/data/transmit",
"data": {
"dataType": "condition.station_psr_id",
"value": "condition.station_psr_id",
"timeStamp": "condition.station_psr_id",
"quality": "condition.station_psr_id",
"scadaId": "condition.station_psr_id",
"key": "condition.station_psr_id",
"disCreate": "condition.station_psr_id",
"name": "condition.station_psr_id"
}
},
{
"kafkaTopic": "k2",
"mqTopic": "romaSite/data/eventAlarm",
"data": {
"timeStamp": "body.warns.time",
"warns": [
{
"eventTextL1": "body.warns.systemid",
"pointId": "body.warns.pointId",
"time": "body.warns.type",
"deviceId": "deviceId",
"eventstatus": "body.warns.content"
}
]
}
}
]
\ No newline at end of file
...@@ -2,4 +2,39 @@ ...@@ -2,4 +2,39 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.equipmanage.mapper.AlarmMapper"> <mapper namespace="com.yeejoin.equipmanage.mapper.AlarmMapper">
<select id="totalNum" resultType="java.util.Map">
SELECT count(*) num, 'qlgj' as code from wl_equipment_specific_alarm_log a
where a.biz_org_code like concat(#{bizOrgCode}, '%')
<if test="systemId != null and systemId !=''">
and FIND_IN_SET(#{systemId},a.system_ids)
</if>
and date_format(a.`create_date`,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
UNION ALL
SELECT count(*) num, 'wfggj' as code from wl_equipment_specific_alarm_log a where a.`status` = 1
and a.biz_org_code like concat(#{bizOrgCode}, '%')
<if test="systemId != null and systemId !=''">
and FIND_IN_SET(#{systemId},a.system_ids)
</if>
UNION ALL
SELECT count(*) num, 'hzgj' as code from wl_equipment_specific_alarm_log a where a.`type` = 'FIREALARM'
and a.`status` = 1
and a.biz_org_code like concat(#{bizOrgCode}, '%')
<if test="systemId != null and systemId !=''">
and FIND_IN_SET(#{systemId},a.system_ids)
</if>
UNION ALL
SELECT count(*) num, 'gzgj' as code from wl_equipment_specific_alarm_log a where a.`type` = 'BREAKDOWN'
a.`status` = 1
and a.biz_org_code like concat(#{bizOrgCode}, '%')
<if test="systemId != null and systemId !=''">
and FIND_IN_SET(#{systemId},a.system_ids)
</if>
UNION ALL
SELECT count(*) num, 'pbgj' as code from wl_equipment_specific_alarm_log a where a.`type` = 'SHIELD'
and a.`status` = 1
and a.biz_org_code like concat(#{bizOrgCode}, '%')
<if test="systemId != null and systemId !=''">
and FIND_IN_SET(#{systemId},a.system_ids)
</if>
</select>
</mapper> </mapper>
...@@ -1602,18 +1602,19 @@ ...@@ -1602,18 +1602,19 @@
DELETE FROM wl_equipment_alarm_report_day WHERE equipment_specific_id = #{equipmentSpecificId}; DELETE FROM wl_equipment_alarm_report_day WHERE equipment_specific_id = #{equipmentSpecificId};
</delete> </delete>
<select id="getAlarmDetailByDate" resultType="Map"> <select id="getAlarmDetailByDate" resultType="com.yeejoin.equipmanage.dto.ReportAlarmDto">
SELECT SELECT
wlesa.equipment_specific_id, wlesa.equipment_specific_id AS equipmentSpecificId,
wlesa.equipment_specific_name AS specificName, wlesa.equipment_specific_name AS specificName,
wlesa.location AS location, wlesa.location AS location,
wlesa.equipment_specific_index_name, wlesa.equipment_specific_index_name AS equipmentSpecificIndexName,
concat(wlesa.equipment_specific_name, wlesa.equipment_specific_index_name) AS alamContent, concat(wlesa.equipment_specific_name, wlesa.equipment_specific_index_name) AS alamContent,
wlesa.frequency AS alarmNum, IFNULL(SUM(wlesa.frequency), 0) AS alarmNum,
DATE_FORMAT(wlesa.create_date, '%Y-%m-%d %H:%i:%s') AS createDate wlesa.type AS type,
DATE_FORMAT(wlesa.update_date, '%Y-%m-%d %H:%i:%s') AS updateDate,
DATE_FORMAT(wlesa.create_date, '%Y-%m-%d %H:%i:%s') AS createDate
FROM FROM
`wl_equipment_specific_alarm` `wlesa` `wl_equipment_specific_alarm` `wlesa`
LEFT JOIN f_fire_fighting_system AS sys ON FIND_IN_SET(sys.id, wlesa.system_ids)
<where> <where>
<if test="bizOrgCode != null and bizOrgCode != ''">AND <if test="bizOrgCode != null and bizOrgCode != ''">AND
wlesa.biz_org_code like concat (#{bizOrgCode},'%') wlesa.biz_org_code like concat (#{bizOrgCode},'%')
...@@ -1624,6 +1625,7 @@ ...@@ -1624,6 +1625,7 @@
AND find_in_set(#{sysId}, wlesa.system_ids) AND find_in_set(#{sysId}, wlesa.system_ids)
</if> </if>
</where> </where>
ORDER BY wlesa.create_date DESC GROUP BY wlesa.equipment_specific_id, wlesa.type
ORDER BY wlesa.update_date DESC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -576,7 +576,8 @@ ...@@ -576,7 +576,8 @@
wesi.emergency_level as emergencyLevel, wesi.emergency_level as emergencyLevel,
wesi.emergency_level_describe as emergencyLevelDescribe, wesi.emergency_level_describe as emergencyLevelDescribe,
wes.biz_org_name AS bizOrgName, wes.biz_org_name AS bizOrgName,
wes.biz_org_code AS bizOrgCode wes.biz_org_code AS bizOrgCode,
wes.position AS location
FROM wl_equipment_specific_index AS wesi FROM wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_detail ed ON ed.id = wes.equipment_detail_id LEFT JOIN wl_equipment_detail ed ON ed.id = wes.equipment_detail_id
......
...@@ -2779,10 +2779,10 @@ ...@@ -2779,10 +2779,10 @@
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE WHERE
ed.production_date IS NOT NULL ed.production_date IS NOT NULL
AND ( (sd.`status` != 3) or (sd.`status` is null) or (sd.`status` = '')) AND e.expiry_date IS NOT NULL
AND e.expiry_date IS NOT NULL AND es.biz_org_code LIKE concat(#{equipmentSpecific.bizOrgCode}, '%')
AND es.biz_org_code LIKE concat(#{bizOrgCode}, '%') AND 0 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )
AND 0 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) AND ( (sd.`status` != 3) or (sd.`status` is null) or (sd.`status` = ''))
) AS `value` UNION ALL ) AS `value` UNION ALL
SELECT SELECT
'超期未报废' AS `name`, '超期未报废' AS `name`,
...@@ -2796,10 +2796,10 @@ ...@@ -2796,10 +2796,10 @@
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE WHERE
ed.production_date IS NOT NULL ed.production_date IS NOT NULL
AND ( (sd.`status` != 7) or (sd.`status` is null) or (sd.`status` = '')) AND e.expiry_date IS NOT NULL
AND e.expiry_date IS NOT NULL AND es.biz_org_code LIKE concat(#{equipmentSpecific.bizOrgCode}, '%')
AND es.biz_org_code LIKE concat(#{bizOrgCode}, '%') AND 0 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )
AND 0 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) AND ( (sd.`status` != 7) or (sd.`status` is null) or (sd.`status` = ''))
) AS `value` UNION ALL ) AS `value` UNION ALL
SELECT SELECT
'近1月临期设备' AS `name`, '近1月临期设备' AS `name`,
...@@ -2812,12 +2812,12 @@ ...@@ -2812,12 +2812,12 @@
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE WHERE
ed.production_date IS NOT NULL ed.production_date IS NOT NULL
AND ( (sd.`status` != 7) or (sd.`status` is null) or (sd.`status` = '')) AND e.expiry_date IS NOT NULL
AND e.expiry_date IS NOT NULL AND es.biz_org_code LIKE concat(#{equipmentSpecific.bizOrgCode}, '%')
AND es.biz_org_code LIKE concat(#{bizOrgCode}, '%') AND ( (sd.`status` != 7) or (sd.`status` is null) or (sd.`status` = ''))
AND 30 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) AND 30 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )
AND DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) >= 0 AND DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) >= 0
) AS `value` ) AS `value`
</select> </select>
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
</if> </if>
</where> </where>
group by `name` group by `name`
order by create_date desc
</select> </select>
<select id="getCountInfo" resultType="java.util.Map"> <select id="getCountInfo" resultType="java.util.Map">
......
...@@ -3957,4 +3957,18 @@ ...@@ -3957,4 +3957,18 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="zs" id="20240401-zs-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="cb_water_resource_pool" columnName="pump_device_id"/>
</not>
</preConditions>
<comment>modify table cb_water_resource_pool add columns</comment>
<sql>
ALTER TABLE `cb_water_resource_pool`
ADD pump_device_id varchar(1000) DEFAULT NULL COMMENT '消防泵装置ids',
ADD pump_device_name varchar(1500) DEFAULT NULL COMMENT '消防泵装置名称s';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
...@@ -442,10 +442,6 @@ ...@@ -442,10 +442,6 @@
and a.org_code LIKE CONCAT(#{bizOrgCode},'%') and a.org_code LIKE CONCAT(#{bizOrgCode},'%')
</if> </if>
</trim> </trim>
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose>
</select> </select>
<select id="getPeopleCheckPage" resultMap="checkInfoMap"> <select id="getPeopleCheckPage" resultMap="checkInfoMap">
......
...@@ -1265,6 +1265,23 @@ ...@@ -1265,6 +1265,23 @@
</where> </where>
</select> </select>
<select id="getDefectEquipInfoByIds" resultType="Map">
SELECT
es.position AS equipLocation,
es.id as id
FROM
wl_equipment_specific es
<where>
<if test="ids != null">
es.id in
<foreach item="id" collection="ids" index="index" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</select>
<select id="getCheckMissedEquipInfo" resultType="Map"> <select id="getCheckMissedEquipInfo" resultType="Map">
SELECT SELECT
cl.`name` AS equipName, cl.`name` AS equipName,
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>amos-boot-utils</artifactId>
<groupId>com.amosframework.boot</groupId>
<version>1.0.0</version>
</parent>
<artifactId>amos-boot-utils-adpter</artifactId>
<properties>
<tyboot.version>1.1.23-SNAPSHOT</tyboot.version>
</properties>
<dependencies>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-core</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<dependency>
<artifactId>mysql-connector-java</artifactId>
<groupId>mysql</groupId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
package com.yeejoin.amos;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import java.net.InetAddress;
import java.net.UnknownHostException;
/**
* <pre>
* 服务启动类
* </pre>
*
* @author amos
* @version $Id: AmosBootUtilsAdpterApplication, v 0.1 2024年5月7日 下午4:56:29 amos Exp $
*/
@SpringBootApplication
@EnableConfigurationProperties
@ServletComponentScan
@EnableDiscoveryClient
@EnableFeignClients
@EnableAsync
@EnableEurekaClient
@ComponentScan({"org.typroject","com.yeejoin.amos"})
public class AmosBootUtilsAdpterApplication {
private static final Logger logger = LoggerFactory.getLogger(AmosBootUtilsAdpterApplication.class);
public static void main(String[] args) throws UnknownHostException {
ConfigurableApplicationContext context = SpringApplication.run(AmosBootUtilsAdpterApplication.class, args);
Environment env = context.getEnvironment();
String ip = InetAddress.getLocalHost().getHostAddress();
String port = env.getProperty("server.port");
String path = env.getProperty("server.servlet.context-path");
logger.info("\n----------------------------------------------------------\n\t" +
"Application Amos-Biz-Boot is running! Access URLs:\n\t" +
"Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n" +
"----------------------------------------------------------");
}
}
package com.yeejoin.amos.adpter.controller;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.adpter.service.AdpterService;
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.web.bind.annotation.*;
import java.util.Map;
/**
* 同步接口
*
* @author system_generator
* @date 2021-06-29
*/
@RestController
@Slf4j
@Api(tags = "同步接口Api")
@RequestMapping(value = "/adpter")
public class AdpterController {
@Autowired
AdpterService adpterService;
/**
* 同步接口Api
*
* @return
*/
@GetMapping(value = "/tran")
@ApiOperation(httpMethod = "GET", value = "同步接口Api", notes = "同步接口Api")
public Map<String,String> tran() {
Map<String, String> handle = adpterService.handle();
return handle;
}
}
\ No newline at end of file
#\u6CE8\u518C\u4E2D\u5FC3\u5730\u5740
#eureka.client.service-url.defaultZone =http://172.16.11.201:10001/eureka/
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url-path=/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.11.201:${server.port}${server.servlet.context-path}/swagger-ui.html
#服务实例ip地址,若eureka.instance.prefer-ip-address=false,ip-address设置失效,一般情况不用设置。
#eureka.instance.ip-address= 172.16.3.135
#eureka服务ip配置,可填写固定ip地址
eureka.instance.hostname=172.16.11.201
#eureka服务配置的校验账号及密码,配置需和eureka服务后台配置文件中一致
spring.security.user.name=admin
spring.security.user.password=a1234560
eureka.client.serviceUrl.defaultZone=http://${spring.security.user.name}:${spring.security.user.password}@${eureka.instance.hostname}:10001/eureka/
##########eureka配置信息###############
management.health.redis.enabled=false
source.jdbc.ip=jdbc:mysql://172.16.11.201:3306/dl_amos_common_biz?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
goal.jdbc.ip=jdbc:mysql://172.16.11.201:3306/dl_amos_common_biz_20230828?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
source.jdbc.ip.idx=jdbc:mysql://172.16.11.201:3306/dl_amos_idx_biz?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
goal.jdbc.ip.idx=jdbc:mysql://172.16.11.201:3306/dl_amos_idx_biz_bak?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
source.jdbc.ip.buss=jdbc:mysql://172.16.11.201:3306/dl_business?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
goal.jdbc.ip.buss=jdbc:mysql://172.16.11.201:3306/dl_business_copy?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
yeejoin.user=root
yeejoin.pwd=Yeejoin@2020
\ No newline at end of file
spring.application.name=AMOS-ADPTER
server.servlet.context-path=/adpter
server.port=8120
spring.profiles.active=dev
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.serialization.write-dates-as-timestamps=true
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
logging.config=classpath:logback-${spring.profiles.active}.xml
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property name="LOG_HOME" value="log" />
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/jpush.log.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>30</MaxHistory>
<!--日志文件大小-->
<MaxFileSize>30mb</MaxFileSize>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
</encoder>
</appender>
<!-- 控制台输出 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
</encoder>
</appender>
<!-- show parameters for hibernate sql 专为 Hibernate 定制
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
<logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="DEBUG" />
<logger name="org.hibernate.SQL" level="DEBUG" />
<logger name="org.hibernate.engine.QueryParameters" level="DEBUG" />
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
-->
<!--myibatis log configure-->
<logger name="com.apache.ibatis" level="DEBUG"/>
<logger name="org.mybatis" level="DEBUG" />
<logger name="java.sql.Connection" level="DEBUG"/>
<logger name="java.sql.Statement" level="DEBUG"/>
<logger name="java.sql.PreparedStatement" level="DEBUG"/>
<logger name="org.springframework" level="DEBUG"/>
<!-- 日志输出级别 -->
<root level="DEBUG">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property name="LOG_HOME" value="log"/>
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/jpush.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>30</MaxHistory>
<!--按大小分割同一天的-->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
</encoder>
</appender>
<!-- show parameters for hibernate sql 专为 Hibernate 定制
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
<logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="DEBUG" />
<logger name="org.hibernate.SQL" level="DEBUG" />
<logger name="org.hibernate.engine.QueryParameters" level="DEBUG" />
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
-->
<!--myibatis log configure-->
<logger name="com.apache.ibatis" level="INFO"/>
<logger name="org.mybatis" level="INFO"/>
<logger name="java.sql.Connection" level="INFO"/>
<logger name="java.sql.Statement" level="INFO"/>
<logger name="java.sql.PreparedStatement" level="INFO"/>
<logger name="com.baomidou.mybatisplus" level="INFO"/>
<logger name="org.typroject" level="INFO"/>
<logger name="com.yeejoin.amos" level="INFO"/>
<logger name="org.springframework" level="INFO"/>
<!-- 日志输出级别 -->
<root level="INFO">
<appender-ref ref="FILE"/>
</root>
</configuration>
\ No newline at end of file
package com.yeejoin.amos.message.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.core.io.Resource;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author keyong
* @title: ClassToJsonUtil
* <pre>
* @description: TODO
* </pre>
* @date 2024/4/11 11:28
*/
public class ClassToJsonUtil {
private static Map<String, Object> map = new HashMap<>();
public static JSONObject class2json(Object obj, Resource commonMessage, String topic) {
String json;
try {
json = IOUtils.toString(commonMessage.getInputStream(), String.valueOf(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException("获取kafka信息模板失败!");
}
List<Map> listModel = JSONObject.parseArray(json, Map.class);
if (0 < listModel.size()) {
List<Map> mapList = listModel.stream().filter(x -> String.valueOf(x.get("kafkaTopic")).equalsIgnoreCase(topic)).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(mapList)) {
Map<String, Object> map1 = mapList.get(0);
JSONObject object = JSON.parseObject(String.valueOf(obj));
analysisJson(object, "");
JSONObject res = analyseJson(JSON.toJSONString(map1), map);
res.put("kafkaTopic", map1.get("kafkaTopic"));
res.put("mqTopic", map1.get("mqTopic"));
return res;
}
}
return null;
}
private static JSONObject analysisJson(Object objJson, String flag) {
if (objJson instanceof JSONArray) {//如果obj为json数组
JSONArray objArray = (JSONArray) objJson;
for (int i = 0; i < objArray.size(); i++) {
analysisJson(objArray.get(i), flag);
}
} else if (objJson instanceof JSONObject) {//如果为json对象
JSONObject jsonObject = (JSONObject) objJson;
Iterator it = jsonObject.keySet().iterator();
while (it.hasNext()) {
String key = it.next().toString();
Object object = jsonObject.get(key);
//如果得到的是数组
if (object instanceof JSONArray) {
JSONArray objArray = (JSONArray) object;
String path = "";
if (StringUtils.isNotBlank(flag)) {
path = flag + "." + key;
} else {
path = key;
}
analysisJson(objArray, path);
} else if (object instanceof JSONObject) {//如果key中是一个json对象
String path = "";
if (StringUtils.isNotBlank(flag)) {
path = flag + "." + key;
} else {
path = key;
}
analysisJson((JSONObject) object, path);
} else {//如果key中是其他
String path = "";
if (StringUtils.isNotBlank(flag)) {
path = flag + "." + key;
} else {
path = key;
}
// System.out.println(path+":"+object.toString()+" ");
map.put(path, String.valueOf(object));
}
}
} else {//如果key中是其他
// System.out.println(flag+":"+objJson.toString()+" ");
map.put(flag, String.valueOf(objJson));
}
return JSONObject.parseObject(JSON.toJSONString(map));
}
public static JSONObject analyseJson(String jsonData, Map<String, Object> keyMap) {
SortedMap<String, Object> map = new TreeMap<>();
JSONObject jsonObject = JSON.parseObject(jsonData);
for (String key : jsonObject.keySet()) {
String resKey = keyMap.get(key) == null ? key : String.valueOf(keyMap.get(key));
Object value = jsonObject.get(key);
if (value instanceof JSONArray) {
JSONArray jsonArray = new JSONArray(new LinkedList<>());
JSONArray array = jsonObject.getJSONArray(key);
for (int i = 0; i < array.size(); i++) {
Object object = array.get(i);
if (object instanceof String) {
map.put(resKey, array);
} else {
JSONObject sortJson = analyseJson(String.valueOf(object), keyMap);
jsonArray.add(sortJson);
map.put(resKey, jsonArray);
}
}
} else if (value instanceof JSONObject) {
JSONObject sortJson = analyseJson(String.valueOf(value), keyMap);
map.put(resKey, sortJson);
} else {
map.put(resKey, ObjectUtils.isNotEmpty(keyMap.get(value)) ? keyMap.get(value) : "");
}
}
return new JSONObject(map);
}
}
#\u6CE8\u518C\u4E2D\u5FC3\u5730\u5740 #\u6CE8\u518C\u4E2D\u5FC3\u5730\u5740
eureka.client.service-url.defaultZone =http://172.16.11.201:10001/eureka/ #eureka.client.service-url.defaultZone =http://172.16.11.201:10001/eureka/
eureka.instance.prefer-ip-address=true eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=* management.endpoints.web.exposure.include=*
...@@ -7,14 +7,26 @@ eureka.instance.health-check-url-path=/actuator/health ...@@ -7,14 +7,26 @@ eureka.instance.health-check-url-path=/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url-path=/actuator/info eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.11.201:${server.port}${server.servlet.context-path}/swagger-ui.html eureka.instance.metadata-map.management.api-docs=http://172.16.11.201:${server.port}${server.servlet.context-path}/swagger-ui.html
#服务实例ip地址,若eureka.instance.prefer-ip-address=false,ip-address设置失效,一般情况不用设置。
#eureka.instance.ip-address= 172.16.3.135
#eureka服务ip配置,可填写固定ip地址
eureka.instance.hostname=172.16.11.201
#eureka服务配置的校验账号及密码,配置需和eureka服务后台配置文件中一致
spring.security.user.name=admin
spring.security.user.password=a1234560
eureka.client.serviceUrl.defaultZone=http://${spring.security.user.name}:${spring.security.user.password}@${eureka.instance.hostname}:10001/eureka/
##########eureka配置信息###############
# kafka\u96C6\u7FA4\u4FE1\u606F # kafka\u96C6\u7FA4\u4FE1\u606F
spring.kafka.bootstrap-servers=172.16.10.215:9092 spring.kafka.bootstrap-servers=172.16.10.241:9092
# \u751F\u4EA7\u8005\u914D\u7F6E # \u751F\u4EA7\u8005\u914D\u7F6E
# \u8BBE\u7F6E\u5927\u4E8E0\u7684\u503C\uFF0C\u5219\u5BA2\u6237\u7AEF\u4F1A\u5C06\u53D1\u9001\u5931\u8D25\u7684\u8BB0\u5F55\u91CD\u65B0\u53D1\u9001 # \u91CD\u8BD5\u6B21\u6570 # \u8BBE\u7F6E\u5927\u4E8E0\u7684\u503C\uFF0C\u5219\u5BA2\u6237\u7AEF\u4F1A\u5C06\u53D1\u9001\u5931\u8D25\u7684\u8BB0\u5F55\u91CD\u65B0\u53D1\u9001 # \u91CD\u8BD5\u6B21\u6570
spring.kafka.producer.retries=1 spring.kafka.producer.retries=1
spring.kafka.producer.bootstrap-servers=172.16.10.215:9092 spring.kafka.producer.bootstrap-servers=172.16.10.241:9092
#16K #16K
spring.kafka.producer.batch-size=16384 spring.kafka.producer.batch-size=16384
spring.kafka.producer.buffer-memory=33554432 spring.kafka.producer.buffer-memory=33554432
...@@ -42,7 +54,7 @@ spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.Str ...@@ -42,7 +54,7 @@ spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.Str
# latest:\u91CD\u7F6E\u4E3A\u5206\u533A\u4E2D\u6700\u65B0\u7684offset(\u6D88\u8D39\u5206\u533A\u4E2D\u65B0\u4EA7\u751F\u7684\u6570\u636E) # latest:\u91CD\u7F6E\u4E3A\u5206\u533A\u4E2D\u6700\u65B0\u7684offset(\u6D88\u8D39\u5206\u533A\u4E2D\u65B0\u4EA7\u751F\u7684\u6570\u636E)
# none:\u53EA\u8981\u6709\u4E00\u4E2A\u5206\u533A\u4E0D\u5B58\u5728\u5DF2\u63D0\u4EA4\u7684offset,\u5C31\u629B\u51FA\u5F02\u5E38 # none:\u53EA\u8981\u6709\u4E00\u4E2A\u5206\u533A\u4E0D\u5B58\u5728\u5DF2\u63D0\u4EA4\u7684offset,\u5C31\u629B\u51FA\u5F02\u5E38
spring.kafka.consumer.group-id=zhTestGroup spring.kafka.consumer.group-id=zhTestGroup
spring.kafka.consumer.bootstrap-servers=172.16.10.215:9092 spring.kafka.consumer.bootstrap-servers=172.16.10.241:9092
spring.kafka.consumer.enable-auto-commit=false spring.kafka.consumer.enable-auto-commit=false
# \u5F53\u5404\u5206\u533A\u4E0B\u6709\u5DF2\u63D0\u4EA4\u7684offset\u65F6\uFF0C\u4ECE\u63D0\u4EA4\u7684offset\u5F00\u59CB\u6D88\u8D39\uFF1B\u65E0\u63D0\u4EA4\u7684offset\u65F6\uFF0C\u4ECE\u5934\u5F00\u59CB\u6D88\u8D39 # \u5F53\u5404\u5206\u533A\u4E0B\u6709\u5DF2\u63D0\u4EA4\u7684offset\u65F6\uFF0C\u4ECE\u63D0\u4EA4\u7684offset\u5F00\u59CB\u6D88\u8D39\uFF1B\u65E0\u63D0\u4EA4\u7684offset\u65F6\uFF0C\u4ECE\u5934\u5F00\u59CB\u6D88\u8D39
# # \u81EA\u52A8\u63D0\u4EA4\u7684\u9891\u7387 \u5355\u4F4D ms # # \u81EA\u52A8\u63D0\u4EA4\u7684\u9891\u7387 \u5355\u4F4D ms
...@@ -98,4 +110,7 @@ system.zxj=false ...@@ -98,4 +110,7 @@ system.zxj=false
#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 queue.kafka.topics=null
kafka.auto-startup=false kafka.auto-startup=false
\ No newline at end of file
#浜嬩欢鍛婅瀵规帴Kafka涓婚
queue.kafka.eventAlarm.topics=JKXT2BP-GJ-Topic-site
[
{
"kafkaTopic": "T_DC_MQ_REALDATA__guanggu",
"mqTopic": "romaSite/data/transmit",
"data": {
"dataType": "body.datatype",
"value": "body.value",
"timeStamp": "body.time_stamp",
"quality": "body.quality",
"scadaId": "body.key",
"key": "body.key",
"disCreate": "body.station_psr_id",
"name": "body.name"
}
},
{
"kafkaTopic": "T_DC_MQ_ALARM__guanggu",
"mqTopic": "romaSite/data/eventAlarm",
"data": {
"timeStamp": "body.warns.time",
"warns": [
{
"eventTextL1": "body.warns.systemid",
"pointId": "body.warns.pointId",
"time": "body.warns.type",
"deviceId": "deviceId",
"eventstatus": "body.warns.content"
}
]
}
}
]
\ No newline at end of file
...@@ -21,5 +21,6 @@ ...@@ -21,5 +21,6 @@
<module>amos-boot-utils-video</module> <module>amos-boot-utils-video</module>
<module>amos-boot-utils-speech</module> <module>amos-boot-utils-speech</module>
<module>amos-boot-utils-message</module> <module>amos-boot-utils-message</module>
<module>amos-boot-utils-adpter</module>
</modules> </modules>
</project> </project>
\ 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