refactor(rfid): 重命名及优化设备唯一性校验逻辑

- 将系统启动欢迎信息与文案由“RuoYi-Vue-Plus”改为“RFID”
- 更新相关文档中心名称及描述为RFID
- 注释掉设备编号的非空校验,保留设备地址的非空与唯一校验
- 删除设备编号唯一性校验逻辑,新增针对设备地址的唯一性校验
- 修正Issue模板及文案中的多余空白和重复描述
- 补充设备位置树与设备绑定的业务逻辑说明文档
main
zangch@mesnac.com 3 weeks ago
parent 9a817946fb
commit 832d1486ca

@ -25,7 +25,7 @@ body:
attributes: attributes:
label: 这个问题是否已经存在? label: 这个问题是否已经存在?
options: options:
- label: 我已经搜索过现有的问题 (https://gitee.com/dromara/RuoYi-Vue-Plus/issues) - label: 我已经搜索过现有的问题
required: true required: true
- type: textarea - type: textarea
attributes: attributes:

@ -1,5 +1,5 @@
blank_issues_enabled: false blank_issues_enabled: false
contact_links: contact_links:
- name: RuoYi-Vue-Plus 文档中心 - name: RFID 文档中心
url: https://plus-doc.dromara.org url: https://plus-doc.dromara.org
about: 提供 RuoYi-Vue-Plus 搭建使用指南、平台基本开发使用方式、介绍、基础知识和常见问题解答 about: 提供 RFID 搭建使用指南、平台基本开发使用方式、介绍、基础知识和常见问题解答

@ -58,6 +58,11 @@
# 业务逻辑 # 业务逻辑
# 位置树与设备
- 位置树分为车间/机台/工位,共三级
- 设备绑定在工位上
- IP地址 deviceAddress 唯一校验
- 端口号devicePort应该都是20108创建的时候先默认这个如果有需要再修改
## 设备记录 ## 设备记录
### 分页查询 ### 分页查询
- 分页查询逻辑参考rfid-middleware\ruoyi-modules\hw-rfid\ShardingQuery.md文档 - 分页查询逻辑参考rfid-middleware\ruoyi-modules\hw-rfid\ShardingQuery.md文档

@ -10,7 +10,7 @@
<name>RuoYi-Vue-Plus</name> <name>RuoYi-Vue-Plus</name>
<url>https://gitee.com/dromara/RuoYi-Vue-Plus</url> <url>https://gitee.com/dromara/RuoYi-Vue-Plus</url>
<description>Dromara RuoYi-Vue-Plus多租户管理系统</description> <description>RFID多租户管理系统</description>
<properties> <properties>
<revision>5.5.1</revision> <revision>5.5.1</revision>

@ -17,7 +17,7 @@ public class DromaraApplication {
SpringApplication application = new SpringApplication(DromaraApplication.class); SpringApplication application = new SpringApplication(DromaraApplication.class);
application.setApplicationStartup(new BufferingApplicationStartup(2048)); application.setApplicationStartup(new BufferingApplicationStartup(2048));
application.run(args); application.run(args);
System.out.println("(♥◠‿◠)ノ゙ RuoYi-Vue-Plus启动成功 ლ(´ڡ`ლ)゙"); System.out.println("(♥◠‿◠)ノ゙ RFID启动成功 ლ(´ڡ`ლ)゙");
} }
} }

@ -106,7 +106,7 @@ public class AuthController {
Long userId = LoginHelper.getUserId(); Long userId = LoginHelper.getUserId();
scheduledExecutorService.schedule(() -> { scheduledExecutorService.schedule(() -> {
SseMessageDto dto = new SseMessageDto(); SseMessageDto dto = new SseMessageDto();
dto.setMessage("欢迎登录RuoYi-Vue-Plus后台管理系统"); dto.setMessage("欢迎登录RFID后台管理系统");
dto.setUserIds(List.of(userId)); dto.setUserIds(List.of(userId));
SseMessageUtils.publishMessage(dto); SseMessageUtils.publishMessage(dto);
}, 5, TimeUnit.SECONDS); }, 5, TimeUnit.SECONDS);

@ -31,7 +31,7 @@ public class RfidDeviceBo extends BaseEntity {
/** /**
* *
*/ */
@NotBlank(message = "设备编号不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "设备编号不能为空", groups = { AddGroup.class, EditGroup.class })
private String deviceCode; private String deviceCode;
/** /**
@ -48,6 +48,7 @@ public class RfidDeviceBo extends BaseEntity {
/** /**
* (IP) * (IP)
*/ */
@NotBlank(message = "设备地址不能为空", groups = { AddGroup.class, EditGroup.class })
private String deviceAddress; private String deviceAddress;
/** /**
@ -63,13 +64,13 @@ public class RfidDeviceBo extends BaseEntity {
/** /**
* 线(0-线;1-线) * 线(0-线;1-线)
*/ */
@NotBlank(message = "在线状态不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "在线状态不能为空", groups = { AddGroup.class, EditGroup.class })
private String onlineStatus; private String onlineStatus;
/** /**
* (0-;1-) * (0-;1-)
*/ */
@NotBlank(message = "告警状态不能为空", groups = { AddGroup.class, EditGroup.class }) // @NotBlank(message = "告警状态不能为空", groups = { AddGroup.class, EditGroup.class })
private String alarmStatus; private String alarmStatus;
/** /**

@ -153,12 +153,22 @@ public class RfidDeviceServiceImpl implements IRfidDeviceService {
*/ */
private void validEntityBeforeSave(RfidDevice entity){ private void validEntityBeforeSave(RfidDevice entity){
// 业务编号 deviceCode 唯一校验 // 业务编号 deviceCode 唯一校验
if (StringUtils.isNotBlank(entity.getDeviceCode())) { // if (StringUtils.isNotBlank(entity.getDeviceCode())) {
boolean exists = baseMapper.existsRfidDevice(Wrappers.<RfidDevice>lambdaQuery() // boolean exists = baseMapper.existsRfidDevice(Wrappers.<RfidDevice>lambdaQuery()
.eq(RfidDevice::getDeviceCode, entity.getDeviceCode()) // .eq(RfidDevice::getDeviceCode, entity.getDeviceCode())
// .ne(entity.getId() != null, RfidDevice::getId, entity.getId()));
// if (exists) {
// throw new ServiceException("设备编号已存在");
// }
// }
// IP地址 deviceAddress 唯一校验
if (StringUtils.isNotBlank(entity.getDeviceAddress())) {
boolean existsAddress = baseMapper.existsRfidDevice(Wrappers.<RfidDevice>lambdaQuery()
.eq(RfidDevice::getDeviceAddress, entity.getDeviceAddress())
.ne(entity.getId() != null, RfidDevice::getId, entity.getId())); .ne(entity.getId() != null, RfidDevice::getId, entity.getId()));
if (exists) { if (existsAddress) {
throw new ServiceException("设备编号已存在"); throw new ServiceException("设备地址已存在");
} }
} }

Loading…
Cancel
Save