Compare commits

...

16 Commits

Author SHA1 Message Date
lxj
c2f0b64e6f 修复比对失败没写入事件表的问题
All checks were successful
Build and Push to Target Registry / 构建并推送镜像到目标仓库 (push) Successful in 12m7s
2025-08-27 19:42:33 +08:00
lxj
0330b023a3 修复打包失败
All checks were successful
Build and Push to Target Registry / 构建并推送镜像到目标仓库 (push) Successful in 12m38s
2025-08-27 19:18:46 +08:00
lxj
1eb95bf6f6 修复打包失败
All checks were successful
Build and Push to Target Registry / 构建并推送镜像到目标仓库 (push) Successful in 12m8s
2025-08-27 18:37:12 +08:00
lxj
df9adf700c Merge branch 'prod' of http://47.109.37.87:3000/by2025/SmartParks
Some checks failed
Build and Push to Target Registry / 构建并推送镜像到目标仓库 (push) Failing after 9m11s
2025-08-27 18:22:20 +08:00
lxj
19e259a15e 修复配置文件 2025-08-27 18:10:11 +08:00
6133d7761d 修改了水电抄表bug 2025-08-27 18:03:49 +08:00
lxj
318da3f0ee Merge branch 'master' of http://47.109.37.87:3000/by2025/SmartParks
# Conflicts:
#	ruoyi-modules/Sis/src/main/java/org/dromara/sis/rocketmq/RocketMqConstants.java
#	ruoyi-modules/Sis/src/main/java/org/dromara/sis/rocketmq/consumer/FaceCaptureConsumer.java
#	ruoyi-modules/Sis/src/main/java/org/dromara/sis/rocketmq/consumer/FaceCompareConsumer.java
2025-08-27 18:01:31 +08:00
lxj
3c8eb59165 rocketmq消费者组修改 2025-08-27 17:59:56 +08:00
3c480d92f0 修改了水电抄表bug 2025-08-27 17:58:28 +08:00
78d97e14ee refactor(rocketmq): 1 2025-08-27 15:46:17 +08:00
c2c1818ba6 refactor(rocketmq): 1 2025-08-27 15:43:27 +08:00
3ebc58f5e3 refactor(rocketmq): 手动装配rocketMQ 2025-08-26 21:02:38 +08:00
07b9e8b722 Merge remote-tracking branch 'origin/master' 2025-08-26 20:33:13 +08:00
b20828a800 feat(rocketmq): 添加仪表记录消费者和生产者服务 2025-08-26 20:32:51 +08:00
c4495d2cf2 Merge pull request '修改了车辆收费bug' (#1) from master into prod
All checks were successful
Build and Push to Target Registry / 构建并推送镜像到目标仓库 (push) Successful in 11m47s
Reviewed-on: #1
2025-08-26 13:57:40 +08:00
6e84a1c646 发布
All checks were successful
Build and Push to Target Registry / 构建并推送镜像到目标仓库 (push) Successful in 16m48s
2025-08-26 10:52:59 +08:00
21 changed files with 501 additions and 38 deletions

View File

@@ -15,7 +15,7 @@ jobs:
- name: 拉取代码 - name: 拉取代码
uses: http://git.missmoc.top/mocheng/checkout@v4 uses: http://git.missmoc.top/mocheng/checkout@v4
with: with:
fetch-depth: 1 fetch-depth: 0
- name: 使用Maven构建项目 - name: 使用Maven构建项目
run: | run: |

View File

@@ -125,6 +125,11 @@
<artifactId>ruoyi-common-websocket</artifactId> <artifactId>ruoyi-common-websocket</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-spring-boot-starter</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@@ -47,7 +47,7 @@ public class TbLightInfoBo extends BaseEntity {
/** /**
* 楼层ID * 楼层ID
*/ */
@NotNull(message = "层ID不能为空", groups = {AddGroup.class, EditGroup.class}) @NotNull(message = "层ID不能为空", groups = {AddGroup.class, EditGroup.class})
private Long floorId; private Long floorId;
/** /**

View File

@@ -9,6 +9,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*; import jakarta.validation.constraints.*;
import java.math.BigDecimal;
/** /**
* 水电气业务对象 tb_meter_info * 水电气业务对象 tb_meter_info
* *
@@ -53,6 +55,33 @@ public class TbMeterInfoBo extends BaseEntity {
@NotNull(message = "计量单位(1-度2-吨3-立方米)不能为空", groups = {AddGroup.class, EditGroup.class}) @NotNull(message = "计量单位(1-度2-吨3-立方米)不能为空", groups = {AddGroup.class, EditGroup.class})
private Long meterUnit; private Long meterUnit;
/**
* 采集器IP
*/
@NotNull(message = "采集器IP不能为空", groups = {AddGroup.class, EditGroup.class})
private String hostIp;
/**
* 楼层ID
*/
@NotNull(message = "楼层ID不能为空", groups = {AddGroup.class, EditGroup.class})
private Long floorId;
/**
* 园区编码
*/
private Long communityId;
/**
* 建筑名称
*/
private Long buildingId;
/**
* 单元编码
*/
private Long unitId;
/** /**
* 安装位置 * 安装位置
*/ */
@@ -61,12 +90,12 @@ public class TbMeterInfoBo extends BaseEntity {
/** /**
* 初始读数 * 初始读数
*/ */
private Long initReading; private BigDecimal initReading;
/** /**
* 最大量程 * 最大量程
*/ */
private Long maxRang; private BigDecimal maxRang;
/** /**
* 通信状态 * 通信状态

View File

@@ -6,6 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.io.Serial; import java.io.Serial;
import java.math.BigDecimal;
/** /**
* 水电气对象 tb_meter_info * 水电气对象 tb_meter_info
@@ -60,12 +61,12 @@ public class TbMeterInfo extends TenantEntity {
/** /**
* 初始读数 * 初始读数
*/ */
private Long initReading; private BigDecimal initReading;
/** /**
* 最大量程 * 最大量程
*/ */
private Long maxRang; private BigDecimal maxRang;
/** /**
* 通信状态 * 通信状态
@@ -82,5 +83,30 @@ public class TbMeterInfo extends TenantEntity {
*/ */
private String remark; private String remark;
/**
* 园区编码
*/
private Long communityId;
/**
* 建筑名称
*/
private Long buildingId;
/**
* 单元编码
*/
private Long unitId;
/**
* 所属楼层ID
*/
private Long floorId;
/**
* 采集器IP
*/
private String hostIp;
} }

View File

@@ -10,7 +10,7 @@ import lombok.Data;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
/** /**
@@ -75,13 +75,13 @@ public class TbMeterInfoVo implements Serializable {
* 初始读数 * 初始读数
*/ */
@ExcelProperty(value = "初始读数") @ExcelProperty(value = "初始读数")
private Long initReading; private BigDecimal initReading;
/** /**
* 最大量程 * 最大量程
*/ */
@ExcelProperty(value = "最大量程") @ExcelProperty(value = "最大量程")
private Long maxRang; private BigDecimal maxRang;
/** /**
* 通信状态 * 通信状态
@@ -97,6 +97,42 @@ public class TbMeterInfoVo implements Serializable {
@ExcelDictFormat(dictType = "sis_device_status") @ExcelDictFormat(dictType = "sis_device_status")
private Long runningState; private Long runningState;
/**
* 园区编码
*/
@ExcelProperty(value = "园区编码")
private Long communityId;
/**
* 建筑名称
*/
@ExcelProperty(value = "建筑名称")
private Long buildingId;
/**
* 单元编码
*/
@ExcelProperty(value = "单元编码")
private Long unitId;
/**
* 楼层ID
*/
@ExcelProperty(value = "楼层ID")
private Long floorId;
/**
* 楼层
*/
@ExcelProperty(value = "楼层")
private String floorName;
/**
* 采集器IP
*/
@ExcelProperty(value = "采集器IP")
private String hostIp;
/** /**
* 备注 * 备注
*/ */

View File

@@ -1,5 +1,6 @@
package org.dromara.property.mapper.smartDevicesMapper; package org.dromara.property.mapper.smartDevicesMapper;
import org.apache.ibatis.annotations.Mapper;
import org.dromara.property.domain.entity.smartDevices.TbMeterInfo; import org.dromara.property.domain.entity.smartDevices.TbMeterInfo;
import org.dromara.property.domain.vo.smartDevicesVo.TbMeterInfoVo; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterInfoVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
@@ -8,8 +9,9 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
* 水电气Mapper接口 * 水电气Mapper接口
* *
* @author lsm * @author lsm
* @date 2025-07-19 * @since 2025-07-19
*/ */
@Mapper
public interface TbMeterInfoMapper extends BaseMapperPlus<TbMeterInfo, TbMeterInfoVo> { public interface TbMeterInfoMapper extends BaseMapperPlus<TbMeterInfo, TbMeterInfoVo> {
} }

View File

@@ -0,0 +1,18 @@
package org.dromara.property.rocketmq;
/**
* @author lsm
* @apiNote RocketMqConstants
* @since 2025/8/25
*/
public interface RocketMqConstants {
// mq topic
String TOPIC = "SmartParks";
// mq GROUP
String METER_GROUP = "METER_GROUP";
/*-----------------------------------消息tag------------------------------------*/
String METER_RECORD = "METER_RECORD_TAG";
}

View File

@@ -0,0 +1,40 @@
package org.dromara.property.rocketmq.consumer;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.dromara.property.rocketmq.RocketMqConstants;
import org.springframework.stereotype.Component;
import java.util.Arrays;
/**
* @author lsm
* @apiNote MeterRecordConsumer
* @since 2025/8/25
*/
@Slf4j
@Component
@RequiredArgsConstructor
@RocketMQMessageListener(
topic = RocketMqConstants.TOPIC,
consumerGroup = RocketMqConstants.METER_GROUP,
selectorExpression = RocketMqConstants.METER_RECORD
)
public class MeterRecordConsumer implements RocketMQListener<MessageExt> {
@Override
public void onMessage(MessageExt ext) {
log.info("消费仪表上报数据,数据长度={}", ext.getBody().length);
try {
String message = new String(ext.getBody());
log.info("物业仪表上报数据,数据={}", message);
} catch (Exception e) {
log.error("消费仪表上报数据处理失败,", e);
}
}
}

View File

@@ -67,8 +67,8 @@ public class CustomerFeedbacksServiceImpl implements ICustomerFeedbacksService {
public CustomerFeedbacksVo queryById(Long id) { public CustomerFeedbacksVo queryById(Long id) {
CustomerFeedbacksVo customerFeedbacksVo = baseMapper.selectVoById(id); CustomerFeedbacksVo customerFeedbacksVo = baseMapper.selectVoById(id);
ServiceWorkOrdersType serviceWorkOrdersType = serviceWorkOrdersTypeMapper.selectById(customerFeedbacksVo.getFeedbackType()); ServiceWorkOrdersType serviceWorkOrdersType = serviceWorkOrdersTypeMapper.selectById(customerFeedbacksVo.getFeedbackType());
customerFeedbacksVo.setFeedbackTypeName(StringUtils.isNotBlank(serviceWorkOrdersType.getOrderTypeName()) ? serviceWorkOrdersType.getOrderTypeName() : null); customerFeedbacksVo.setFeedbackTypeName(ObjectUtil.isNotEmpty(serviceWorkOrdersType) ? serviceWorkOrdersType.getOrderTypeName() : null);
String nikName = remoteUserService.selectNicknameById(customerFeedbacksVo.getFeedbackPersion()); String nikName = remoteUserService.selectNicknameById(ObjectUtil.isNotEmpty(customerFeedbacksVo) ?customerFeedbacksVo.getFeedbackPersion():null);
customerFeedbacksVo.setFeedbackPersionName(nikName); customerFeedbacksVo.setFeedbackPersionName(nikName);
return customerFeedbacksVo; return customerFeedbacksVo;
} }
@@ -115,11 +115,11 @@ public class CustomerFeedbacksServiceImpl implements ICustomerFeedbacksService {
if (CollUtil.isNotEmpty(remoteUserVos)) { if (CollUtil.isNotEmpty(remoteUserVos)) {
RemoteUserVo remoteUserVo = remoteUserVos.stream() RemoteUserVo remoteUserVo = remoteUserVos.stream()
.filter(vo -> vo.getUserId() != null && vo.getUserId().equals(customerFeedbacksVo.getFeedbackPersion())).findFirst().orElse(null); .filter(vo -> vo.getUserId() != null && vo.getUserId().equals(customerFeedbacksVo.getFeedbackPersion())).findFirst().orElse(null);
customerFeedbacksVo.setFeedbackPersionName(ObjectUtil.isNotNull(remoteUserVo) ? remoteUserVo.getNickName() : null); customerFeedbacksVo.setFeedbackPersionName(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getNickName() : null);
} }
if (CollUtil.isNotEmpty(serviceWorkOrdersTypes)) { if (CollUtil.isNotEmpty(serviceWorkOrdersTypes)) {
ServiceWorkOrdersType serviceWorkOrdersType = serviceWorkOrdersTypes.stream().filter(vo -> vo.getId() != null && vo.getId().equals(customerFeedbacksVo.getFeedbackType())).findFirst().orElse(null); ServiceWorkOrdersType serviceWorkOrdersType = serviceWorkOrdersTypes.stream().filter(vo -> vo.getId() != null && vo.getId().equals(customerFeedbacksVo.getFeedbackType())).findFirst().orElse(null);
customerFeedbacksVo.setFeedbackTypeName(ObjectUtil.isNotNull(serviceWorkOrdersType) ? serviceWorkOrdersType.getOrderTypeName() : null); customerFeedbacksVo.setFeedbackTypeName(ObjectUtil.isNotEmpty(serviceWorkOrdersType) ? serviceWorkOrdersType.getOrderTypeName() : null);
} }
} }

View File

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.dromara.property.domain.bo.TbFloorBo;
import org.dromara.property.domain.vo.TbFloorVo; import org.dromara.property.domain.vo.TbFloorVo;
import org.dromara.property.service.ITbFloorService; import org.dromara.property.service.ITbFloorService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -23,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Collection; import java.util.Collection;
import java.util.stream.Collectors;
/** /**
* 灯控开关信息Service业务层处理 * 灯控开关信息Service业务层处理
@@ -60,7 +62,19 @@ public class TbLightInfoServiceImpl implements ITbLightInfoService {
public TableDataInfo<TbLightInfoVo> queryPageList(TbLightInfoBo bo, PageQuery pageQuery) { public TableDataInfo<TbLightInfoVo> queryPageList(TbLightInfoBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<TbLightInfo> lqw = buildQueryWrapper(bo); LambdaQueryWrapper<TbLightInfo> lqw = buildQueryWrapper(bo);
Page<TbLightInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); Page<TbLightInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
result.getRecords().forEach(r -> r.setFloorName(floorService.queryById(r.getFloorId()).getFloorName()));
// 创建楼层ID到楼层名称的映射避免重复查询
List<TbFloorVo> floorVo = floorService.queryList(new TbFloorBo());
Map<Long, String> floorMap = floorVo.stream()
.collect(Collectors.toMap(TbFloorVo::getId, TbFloorVo::getFloorName, (key1, key2) -> key1));
// 为每个灯控信息设置楼层名称
result.getRecords().forEach(record -> {
String floorName = floorMap.get(record.getFloorId());
if (floorName != null) {
record.setFloorName(floorName);
}
});
return TableDataInfo.build(result); return TableDataInfo.build(result);
} }

View File

@@ -1,5 +1,6 @@
package org.dromara.property.service.impl.smartDevicesImpl; package org.dromara.property.service.impl.smartDevicesImpl;
import cn.hutool.core.lang.Assert;
import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.mybatis.core.page.TableDataInfo;
@@ -9,16 +10,21 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.dromara.property.domain.bo.TbFloorBo;
import org.dromara.property.domain.vo.TbFloorVo;
import org.dromara.property.service.ITbFloorService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.dromara.property.domain.bo.smartDevicesBo.TbMeterInfoBo; import org.dromara.property.domain.bo.smartDevicesBo.TbMeterInfoBo;
import org.dromara.property.domain.vo.smartDevicesVo.TbMeterInfoVo; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterInfoVo;
import org.dromara.property.domain.entity.smartDevices.TbMeterInfo; import org.dromara.property.domain.entity.smartDevices.TbMeterInfo;
import org.dromara.property.mapper.smartDevicesMapper.TbMeterInfoMapper; import org.dromara.property.mapper.smartDevicesMapper.TbMeterInfoMapper;
import org.dromara.property.service.smartDevicesService.ITbMeterInfoService; import org.dromara.property.service.smartDevicesService.ITbMeterInfoService;
import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Collection; import java.util.Collection;
import java.util.stream.Collectors;
/** /**
* 水电气Service业务层处理 * 水电气Service业务层处理
@@ -27,11 +33,12 @@ import java.util.Collection;
* @since 2025-07-19 * @since 2025-07-19
*/ */
@Slf4j @Slf4j
@RequiredArgsConstructor
@Service @Service
@RequiredArgsConstructor
public class TbMeterInfoServiceImpl implements ITbMeterInfoService { public class TbMeterInfoServiceImpl implements ITbMeterInfoService {
private final TbMeterInfoMapper baseMapper; private final TbMeterInfoMapper baseMapper;
private final ITbFloorService floorService;
/** /**
* 查询水电气 * 查询水电气
@@ -55,6 +62,19 @@ public class TbMeterInfoServiceImpl implements ITbMeterInfoService {
public TableDataInfo<TbMeterInfoVo> queryPageList(TbMeterInfoBo bo, PageQuery pageQuery) { public TableDataInfo<TbMeterInfoVo> queryPageList(TbMeterInfoBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<TbMeterInfo> lqw = buildQueryWrapper(bo); LambdaQueryWrapper<TbMeterInfo> lqw = buildQueryWrapper(bo);
Page<TbMeterInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); Page<TbMeterInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
// 创建楼层ID到楼层名称的映射避免重复查询
List<TbFloorVo> floorList = floorService.queryList(new TbFloorBo());
Map<Long, String> floorMap = floorList.stream()
.collect(Collectors.toMap(TbFloorVo::getId, TbFloorVo::getFloorName, (key1, key2) -> key1));
// 为每个灯控信息设置楼层名称
result.getRecords().forEach(record -> {
String floorName = floorMap.get(record.getFloorId());
if (floorName != null) {
record.setFloorName(floorName);
}
});
return TableDataInfo.build(result); return TableDataInfo.build(result);
} }
@@ -94,13 +114,15 @@ public class TbMeterInfoServiceImpl implements ITbMeterInfoService {
* @return 是否新增成功 * @return 是否新增成功
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Boolean insertByBo(TbMeterInfoBo bo) { public Boolean insertByBo(TbMeterInfoBo bo) {
TbMeterInfo add = MapstructUtils.convert(bo, TbMeterInfo.class); TbMeterInfo add = MapstructUtils.convert(bo, TbMeterInfo.class);
validEntityBeforeSave(add); assert add != null;
TbFloorVo floor = floorService.queryById(add.getFloorId());
add.setBuildingId(floor.getBuildingId());
add.setCommunityId(floor.getCommunityId());
boolean flag = baseMapper.insert(add) > 0; boolean flag = baseMapper.insert(add) > 0;
if (flag) { Assert.isTrue(flag, "新增水电气信息失败");
bo.setId(add.getId());
}
return flag; return flag;
} }

View File

@@ -0,0 +1,75 @@
//package org.dromara.sis.config;
//
//import org.apache.rocketmq.client.producer.DefaultMQProducer;
//import org.apache.rocketmq.spring.core.RocketMQTemplate;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @author lsm
// * @apiNote RocketMQClusterConfig
// * @since 2025/8/26
// */
//@Configuration
//public class RocketMQClusterConfig {
//
// // 从配置文件中读取 cluster 的配置
// @Value("${rocketmq.cluster1.name-server}")
// private String nameServer1;
//
// @Value("${rocketmq.cluster1.producer.group}")
// private String producerGroup1;
//
// // 为第一个集群创建生产者实例
// @Bean({"clusterProducerOne"})
// public DefaultMQProducer clusterProducerOne() throws Exception {
// DefaultMQProducer producer = new DefaultMQProducer(producerGroup1);
// producer.setNamesrvAddr(nameServer1);
// // 设置发送超时时间
// producer.setSendMsgTimeout(5000);
// // 设置重试次数
// producer.setRetryTimesWhenSendFailed(2);
// producer.setRetryTimesWhenSendAsyncFailed(2);
// return producer;
// }
//
// // 使用上面的生产者实例创建 RocketMQTemplate
// @Bean("rocketMQTemplateClusterOne")
// public RocketMQTemplate rocketMQTemplateClusterOne(@Qualifier("clusterProducerOne") DefaultMQProducer producer) {
// RocketMQTemplate template = new RocketMQTemplate();
// template.setProducer(producer);
// return template;
// }
//
//
// // 从配置文件中读取 cluster 的配置
//// @Value("${rocketmq.cluster2.name-server}")
//// private String nameServer2;
////
//// @Value("${rocketmq.cluster2.producer.group}")
//// private String producerGroup2;
////
//// // 为第二个集群创建生产者实例
//// @Bean({"clusterProducerTwo"})
//// public DefaultMQProducer clusterProducerTwo() throws Exception {
//// DefaultMQProducer producer = new DefaultMQProducer(producerGroup2);
//// producer.setNamesrvAddr(nameServer2);
//// // 设置发送超时时间
//// producer.setSendMsgTimeout(5000);
//// // 设置重试次数
//// producer.setRetryTimesWhenSendFailed(2);
//// producer.setRetryTimesWhenSendAsyncFailed(2);
//// return producer;
//// }
////
//// // 使用上面的生产者实例创建 RocketMQTemplate
//// @Bean("rocketMQTemplateClusterTwo")
//// public RocketMQTemplate rocketMQTemplateClusterTwo(@Qualifier("clusterProducerTwo") DefaultMQProducer producer) {
//// RocketMQTemplate template = new RocketMQTemplate();
//// template.setProducer(producer);
//// return template;
//// }
//
//}

View File

@@ -0,0 +1,85 @@
package org.dromara.sis.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import lombok.RequiredArgsConstructor;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.sis.domain.bo.SisPersonLibImgBo;
import org.dromara.sis.domain.vo.SisPersonLibImgVo;
import org.dromara.sis.sdk.e8.E8PlatformApi;
import org.dromara.sis.sdk.e8.domain.QueryDto;
import org.dromara.sis.sdk.e8.domain.accessControl.req.AccessRecordFindReq;
import org.dromara.sis.sdk.e8.domain.accessControl.res.AccessRecordFindRes;
import org.dromara.sis.service.ISisPersonLibImgService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @author yuyongle
* @version 1.0
* @description:
* @date 2025/8/27 15:57
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/visitor")
public class SisVisitorController {
private final E8PlatformApi e8PlatformApi;
/**
* 查询人员通行记录
*/
@GetMapping("/list")
public TableDataInfo<AccessRecordFindRes> list(QueryDto dto) {
// TableDataInfo tableDataInfo = new TableDataInfo();
// List<AccessRecordFindRes> accessRecordFindResList = new ArrayList<>();
// AccessRecordFindRes accessRecordFindRes = new AccessRecordFindRes();
// accessRecordFindRes.setDeviceName("4#岗亭09");
// accessRecordFindRes.setDoorName("4#岗亭09");
// accessRecordFindRes.setDeviceType(1102);
// accessRecordFindRes.setReaderName("");
// accessRecordFindRes.setGatewayType(1);
// accessRecordFindRes.setCustomerName("德隆吴鹏");
// accessRecordFindRes.setOrganFullPath("主楼11楼");
// accessRecordFindRes.setPictureUrl("https://bpic.588ku.com/back_list_pic/23/04/21/ef5e2a3dd5cfc336fdcf2fd000474f0f.jpg");
// accessRecordFindRes.setCardType(34);
// accessRecordFindRes.setRecordType(2);
// accessRecordFindRes.setActionTime(new Date());
// accessRecordFindResList.add(accessRecordFindRes);
// tableDataInfo.setRows(accessRecordFindResList);
// tableDataInfo.setTotal(1);
// tableDataInfo.setCode(200);
// return tableDataInfo;
dto.setPageIndex(1);
dto.setMaxResultCount(20);
// 10秒内
String starTime = DateUtil.format(DateUtil.offset(new Date(), DateField.SECOND, -10), "yyyy-MM-dd HH:mm:ss");
String endTime = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
AccessRecordFindReq lift = new AccessRecordFindReq();
lift.setStartTime(starTime);
lift.setEndTime(endTime);
lift.setRecordType(2);
// 9号电梯
lift.setDeviceId(550757939925061L);
dto.setQueryDto(lift);
// TableDataInfo<AccessRecordFindRes> nineLiftList = e8PlatformApi.getPageAccessRecordList(dto);
TableDataInfo<AccessRecordFindRes> pageAccessRecordList = new TableDataInfo();
return e8PlatformApi.getPageAccessRecordList(dto);
//如果pageAccessRecordList报错就捕获并封装
}
}

View File

@@ -9,8 +9,10 @@ public interface RocketMqConstants {
// mq topic // mq topic
String TOPIC = "SmartParks"; String TOPIC = "SmartParks";
// mq GROUP // 人比比对消费者组
String GROUP = "SmartParksEqp"; String COMPAREGROUP = "SmartParks-compare";
// 人脸抓拍消费者组
String CAPTUREGROUP = "SmartParks-capture";
/*-----------------------------------消息tag------------------------------------*/ /*-----------------------------------消息tag------------------------------------*/
String HIKADD = "ADD_HIK_DEVICE_TAG"; String HIKADD = "ADD_HIK_DEVICE_TAG";

View File

@@ -22,7 +22,7 @@ import org.springframework.stereotype.Component;
@RequiredArgsConstructor @RequiredArgsConstructor
@RocketMQMessageListener( @RocketMQMessageListener(
topic = RocketMqConstants.TOPIC, topic = RocketMqConstants.TOPIC,
consumerGroup = RocketMqConstants.GROUP, consumerGroup = RocketMqConstants.CAPTUREGROUP,
selectorExpression = RocketMqConstants.FACECAPTURE selectorExpression = RocketMqConstants.FACECAPTURE
) )
public class FaceCaptureConsumer implements RocketMQListener<MessageExt> { public class FaceCaptureConsumer implements RocketMQListener<MessageExt> {

View File

@@ -21,7 +21,7 @@ import org.springframework.stereotype.Component;
@RequiredArgsConstructor @RequiredArgsConstructor
@RocketMQMessageListener( @RocketMQMessageListener(
topic = RocketMqConstants.TOPIC, topic = RocketMqConstants.TOPIC,
consumerGroup = RocketMqConstants.GROUP, consumerGroup = RocketMqConstants.COMPAREGROUP,
selectorExpression = RocketMqConstants.FACECOMPARE selectorExpression = RocketMqConstants.FACECOMPARE
) )
public class FaceCompareConsumer implements RocketMQListener<MessageExt> { public class FaceCompareConsumer implements RocketMQListener<MessageExt> {

View File

@@ -0,0 +1,44 @@
//package org.dromara.sis.rocketmq.consumer;
//
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.rocketmq.common.message.MessageExt;
//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
//import org.apache.rocketmq.spring.core.RocketMQListener;
//import org.dromara.sis.rocketmq.RocketMqConstants;
//import org.dromara.sis.rocketmq.producer.ProducerService;
//import org.springframework.stereotype.Component;
//
///**
// * @author lsm
// * @apiNote MeterRecordConsumer
// * @since 2025/8/25
// */
//@Slf4j
//@Component
//@RequiredArgsConstructor
//@RocketMQMessageListener(
// topic = RocketMqConstants.TOPIC,
// consumerGroup = RocketMqConstants.METER_GROUP,
// selectorExpression = RocketMqConstants.METER_RECORD,
// nameServer = "${rocketmq.cluster1.name-server}"
//)
//public class MeterRecordConsumer implements RocketMQListener<MessageExt> {
//
// private final ProducerService producerService;
//
// @Override
// public void onMessage(MessageExt ext) {
// try {
// if (ext.getBody() == null) {
// log.info("仪表上报消息数据,不转发!");
// } else {
// producerService.defaultSend(RocketMqConstants.TOPIC, RocketMqConstants.METER_RECORD, new String(ext.getBody()));
// log.info("转发仪表上报数据处理成功");
// }
// } catch (Exception e) {
// log.error("转发仪表上报数据处理失败,", e);
// }
//
// }
//}

View File

@@ -0,0 +1,65 @@
//package org.dromara.sis.rocketmq.producer;
//
//import lombok.extern.slf4j.Slf4j;
//import org.apache.rocketmq.common.message.Message;
//import org.apache.rocketmq.spring.core.RocketMQTemplate;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.stereotype.Component;
//
///**
// * @author lsm
// * @apiNote ProducerService
// * @since 2025/8/26
// */
//@Slf4j
//@Component
//public class ProducerService {
//
// @Autowired
// @Qualifier("rocketMQTemplateClusterOne")
// private RocketMQTemplate rocketMQTemplateClusterOne;
//
//// @Autowired
//// @Qualifier("rocketMQTemplateClusterTwo")
//// private RocketMQTemplate rocketMQTemplateClusterTwo;
//
// /**
// * 向mq写入消息
// *
// * @param topic 消息topic
// * @param tag 消息tag
// * @param msg 消息
// */
// public void defaultSend(String topic, String tag, String msg) {
// try {
// String destination = topic + ":" + tag;
// // 使用 RocketMQTemplate 的同步发送方法
// rocketMQTemplateClusterOne.syncSend(destination, msg);
//
// log.info("发送RocketMQOne消息成功, nameServer:{}", rocketMQTemplateClusterOne.getProducer().getNamesrvAddr());
// } catch (Exception e) {
// log.error("发送RocketMQOne消息失败", e);
// }
// }
//
//
// /**
// * 向mq写入消息
// *
// * @param topic 消息topic
// * @param tag 消息tag
// * @param msg 消息
// */
//// public void clusterSend(String topic, String tag, String msg) {
//// try {
//// String destination = topic + ":" + tag;
//// // 使用 RocketMQTemplate 的同步发送方法
//// rocketMQTemplateClusterTwo.syncSend(destination, msg);
////
//// log.info("发送RocketMQTwo消息成功, nameServer:{}", rocketMQTemplateClusterTwo.getProducer().getNamesrvAddr());
//// } catch (Exception e) {
//// log.error("发送RocketMQTwo消息失败", e);
//// }
//// }
//}

View File

@@ -63,7 +63,7 @@ public class ZeroSensationPassageServiceImpl implements IZeroSensationPassageSer
if (result.getCode() != 200) { if (result.getCode() != 200) {
log.info("华为盒子比对失败,msg={}", result.getMessage()); log.info("华为盒子比对失败,msg={}", result.getMessage());
// 产生告警数据 // 产生告警数据
// alarmEventsService.createAlarmRecord(deviceIp, 1, 1, "人脸比对失败", smallImg, bigImg); alarmEventsService.createAlarmRecord(deviceIp, 1, 1, "人脸比对失败", smallImg, bigImg);
return; return;
} }
log.info("人脸比对执行完成,耗时:{}ms", interval.intervalMs()); log.info("人脸比对执行完成,耗时:{}ms", interval.intervalMs());

View File

@@ -40,9 +40,9 @@ spring.sql.init.platform=mysql
db.num=1 db.num=1
### Connect URL of DB: ### Connect URL of DB:
db.url.0=jdbc:mysql://192.168.159.129:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true db.url.0=jdbc:mysql://10.20.1.65:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
db.user.0=root db.user.0=root
db.password.0=123456 db.password.0=By@2025!
### the maximum retry times for push ### the maximum retry times for push
nacos.config.push.maxRetryTime=50 nacos.config.push.maxRetryTime=50