dev #2

Merged
dashixiong merged 349 commits from dev into main 2026-02-11 01:55:46 +00:00
354 changed files with 52685 additions and 1113 deletions
Showing only changes of commit 16d414f092 - Show all commits

View File

@ -1,23 +1,21 @@
package com.xzzn.web.controller.ems;
import com.alibaba.fastjson2.JSON;
import com.xzzn.common.constant.RedisKeyConstants;
import com.xzzn.common.core.redis.RedisCache;
import com.xzzn.common.enums.TopicHandleType;
import com.xzzn.common.utils.StringUtils;
import com.xzzn.ems.domain.EmsMqttTopicConfig;
import com.xzzn.ems.domain.MqttSyncLog;
import com.xzzn.ems.mapper.EmsMqttTopicConfigMapper;
import com.xzzn.ems.service.*;
import com.xzzn.framework.manager.MqttLifecycleManager;
import com.xzzn.framework.web.service.MqttPublisher;
import com.xzzn.framework.web.service.MqttSubscriber;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.eclipse.paho.client.mqttv3.IMqttMessageListener;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -27,8 +25,7 @@ import java.util.List;
@Service
public class MqttMessageController implements MqttPublisher, MqttSubscriber {
private static final Log log = LogFactory.getLog(MqttMessageController.class);
private static final Logger log = LoggerFactory.getLogger(MqttMessageController.class);
private final MqttLifecycleManager mqttLifecycleManager;

View File

@ -5,11 +5,11 @@ import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DataUtils {
private static final Log log = LogFactory.getLog(DataUtils.class);
private static final Logger log = LoggerFactory.getLogger(DataUtils.class);
public static String getJSONFromFile(InputStream inputStream) {
BufferedReader bufferReader = null;

View File

@ -36,7 +36,6 @@ import com.xzzn.ems.service.IDeviceDataProcessService;
import com.xzzn.ems.service.IEmsAlarmRecordsService;
import com.xzzn.ems.service.IEmsDeviceSettingService;
import com.xzzn.ems.service.IEmsEnergyPriceConfigService;
import com.xzzn.ems.service.IFXXDataProcessService;
import com.xzzn.ems.utils.AbstractBatteryDataProcessor;
import com.xzzn.ems.utils.DevicePointMatchDataProcessor;
@ -62,15 +61,15 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class DeviceDataProcessServiceImpl extends AbstractBatteryDataProcessor implements IDeviceDataProcessService {
private static final Log log = LogFactory.getLog(DeviceDataProcessServiceImpl.class);
private static final Logger log = LoggerFactory.getLogger(DeviceDataProcessServiceImpl.class);
private static final Pattern PATTERN = Pattern.compile("(BMSD\\d{2})(ZT|SOC|SOH|DL|DY|BDSC)");
// 匹配DTDC+数字格式的正则(提取序号)

View File

@ -2,22 +2,17 @@ package com.xzzn.ems.service.impl;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.alibaba.fastjson2.JSON;
import com.xzzn.common.constant.RedisKeyConstants;
import com.xzzn.common.core.redis.RedisCache;
import com.xzzn.common.enums.PointType;
import com.xzzn.common.exception.ServiceException;
import com.xzzn.common.utils.StringUtils;
import com.xzzn.common.utils.bean.BeanValidators;
import org.apache.commons.compress.utils.Lists;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
@ -188,6 +183,7 @@ public class EmsPointMatchServiceImpl implements IEmsPointMatchService {
EmsPointMatch savePoint = new EmsPointMatch();
BeanUtils.copyProperties(pointMatch, savePoint);
savePoint.setSiteId(siteId);
savePoint.setDeviceId(deviceId);
savePoint.setDeviceCategory(deviceCategory);
if (StringUtils.isNotBlank(pointMatch.getIsAlarm()) && String.valueOf(PointType.YES.getCode()).equals(pointMatch.getIsAlarm())) {
savePoint.setMatchTable(DeviceMatchTable.getAlarmMatchTableByCode(deviceCategory));
@ -243,6 +239,9 @@ public class EmsPointMatchServiceImpl implements IEmsPointMatchService {
String pointMatchKey = DevicePointMatchDataProcessor.getPointMacthCacheKey(siteId, deviceId, deviceCategory);
List<EmsPointMatch> pointMatchData = emsPointMatchMapper.getDevicePointMatchList(siteId, deviceId, deviceCategory);
// log.info("同步点位匹配数据到Redis key:{} data:{}", pointMatchKey, pointMatchData);
if (CollectionUtils.isEmpty(pointMatchData)) {
return;
}
if (redisCache.hasKey(pointMatchKey)) {
redisCache.deleteObject(pointMatchKey);
}

View File

@ -6,15 +6,13 @@ import com.alibaba.fastjson2.JSONObject;
import com.xzzn.common.annotation.Excel;
import com.xzzn.common.constant.RedisKeyConstants;
import com.xzzn.common.core.redis.RedisCache;
import com.xzzn.common.enums.DeviceCategory;
import com.xzzn.common.enums.PointType;
import com.xzzn.common.utils.DataUtils;
import com.xzzn.common.utils.StringUtils;
import com.xzzn.ems.domain.EmsDevicesSetting;
import com.xzzn.ems.domain.EmsPointEnumMatch;
import com.xzzn.ems.domain.EmsPointMatch;
import com.xzzn.ems.domain.vo.DevicePointMatchInfo;
import com.xzzn.ems.domain.vo.StackStatisListVo;
import com.xzzn.ems.enums.DeviceMatchTable;
import com.xzzn.ems.mapper.EmsDevicesSettingMapper;
import com.xzzn.ems.mapper.EmsPointEnumMatchMapper;
@ -27,14 +25,13 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Service;
@ -42,7 +39,7 @@ import org.springframework.stereotype.Service;
@Service
public class DevicePointMatchDataProcessor {
private static final Log log = LogFactory.getLog(DevicePointMatchDataProcessor.class);
private static final Logger log = LoggerFactory.getLogger(DevicePointMatchDataProcessor.class);
private DevicePointMatchInfo devicePointMatchInfo;

View File

@ -100,6 +100,7 @@
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="isAlarm != null">#{isAlarm},</if>
<if test="deviceId != null">#{deviceId},</if>
</trim>
</insert>