From 832d1486ca3798aeca7cf02c847e5e6548e86cfa Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Mon, 1 Dec 2025 14:04:07 +0800 Subject: [PATCH] =?UTF-8?q?refactor(rfid):=20=E9=87=8D=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E5=8F=8A=E4=BC=98=E5=8C=96=E8=AE=BE=E5=A4=87=E5=94=AF=E4=B8=80?= =?UTF-8?q?=E6=80=A7=E6=A0=A1=E9=AA=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将系统启动欢迎信息与文案由“RuoYi-Vue-Plus”改为“RFID” - 更新相关文档中心名称及描述为RFID - 注释掉设备编号的非空校验,保留设备地址的非空与唯一校验 - 删除设备编号唯一性校验逻辑,新增针对设备地址的唯一性校验 - 修正Issue模板及文案中的多余空白和重复描述 - 补充设备位置树与设备绑定的业务逻辑说明文档 --- .gitee/ISSUE_TEMPLATE/bug.yml | 2 +- .gitee/ISSUE_TEMPLATE/config.yml | 4 ++-- RFID.md | 5 +++++ pom.xml | 2 +- .../java/org/dromara/DromaraApplication.java | 2 +- .../web/controller/AuthController.java | 2 +- .../dromara/rfid/domain/bo/RfidDeviceBo.java | 7 ++++--- .../service/impl/RfidDeviceServiceImpl.java | 20 ++++++++++++++----- 8 files changed, 30 insertions(+), 14 deletions(-) diff --git a/.gitee/ISSUE_TEMPLATE/bug.yml b/.gitee/ISSUE_TEMPLATE/bug.yml index 0450013..1c52336 100644 --- a/.gitee/ISSUE_TEMPLATE/bug.yml +++ b/.gitee/ISSUE_TEMPLATE/bug.yml @@ -25,7 +25,7 @@ body: attributes: label: 这个问题是否已经存在? options: - - label: 我已经搜索过现有的问题 (https://gitee.com/dromara/RuoYi-Vue-Plus/issues) + - label: 我已经搜索过现有的问题 required: true - type: textarea attributes: diff --git a/.gitee/ISSUE_TEMPLATE/config.yml b/.gitee/ISSUE_TEMPLATE/config.yml index 9450a98..b2a229d 100644 --- a/.gitee/ISSUE_TEMPLATE/config.yml +++ b/.gitee/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: false contact_links: - - name: RuoYi-Vue-Plus 文档中心 + - name: RFID 文档中心 url: https://plus-doc.dromara.org - about: 提供 RuoYi-Vue-Plus 搭建使用指南、平台基本开发使用方式、介绍、基础知识和常见问题解答 + about: 提供 RFID 搭建使用指南、平台基本开发使用方式、介绍、基础知识和常见问题解答 diff --git a/RFID.md b/RFID.md index d23d115..563436a 100644 --- a/RFID.md +++ b/RFID.md @@ -58,6 +58,11 @@ # 业务逻辑 +# 位置树与设备 +- 位置树分为车间/机台/工位,共三级 +- 设备绑定在工位上 +- IP地址 deviceAddress 唯一校验 +- 端口号devicePort应该都是20108,创建的时候先默认这个,如果有需要再修改 ## 设备记录 ### 分页查询 - 分页查询逻辑参考rfid-middleware\ruoyi-modules\hw-rfid\ShardingQuery.md文档 diff --git a/pom.xml b/pom.xml index b6baf1b..bcbd424 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ RuoYi-Vue-Plus https://gitee.com/dromara/RuoYi-Vue-Plus - Dromara RuoYi-Vue-Plus多租户管理系统 + RFID多租户管理系统 5.5.1 diff --git a/ruoyi-admin/src/main/java/org/dromara/DromaraApplication.java b/ruoyi-admin/src/main/java/org/dromara/DromaraApplication.java index 8ef33fe..bfd7ac5 100644 --- a/ruoyi-admin/src/main/java/org/dromara/DromaraApplication.java +++ b/ruoyi-admin/src/main/java/org/dromara/DromaraApplication.java @@ -17,7 +17,7 @@ public class DromaraApplication { SpringApplication application = new SpringApplication(DromaraApplication.class); application.setApplicationStartup(new BufferingApplicationStartup(2048)); application.run(args); - System.out.println("(♥◠‿◠)ノ゙ RuoYi-Vue-Plus启动成功 ლ(´ڡ`ლ)゙"); + System.out.println("(♥◠‿◠)ノ゙ RFID启动成功 ლ(´ڡ`ლ)゙"); } } diff --git a/ruoyi-admin/src/main/java/org/dromara/web/controller/AuthController.java b/ruoyi-admin/src/main/java/org/dromara/web/controller/AuthController.java index 89b9ab6..2ab1da6 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/controller/AuthController.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/controller/AuthController.java @@ -106,7 +106,7 @@ public class AuthController { Long userId = LoginHelper.getUserId(); scheduledExecutorService.schedule(() -> { SseMessageDto dto = new SseMessageDto(); - dto.setMessage("欢迎登录RuoYi-Vue-Plus后台管理系统"); + dto.setMessage("欢迎登录RFID后台管理系统"); dto.setUserIds(List.of(userId)); SseMessageUtils.publishMessage(dto); }, 5, TimeUnit.SECONDS); diff --git a/ruoyi-modules/hw-rfid/src/main/java/org/dromara/rfid/domain/bo/RfidDeviceBo.java b/ruoyi-modules/hw-rfid/src/main/java/org/dromara/rfid/domain/bo/RfidDeviceBo.java index e42dc54..e0abbb0 100644 --- a/ruoyi-modules/hw-rfid/src/main/java/org/dromara/rfid/domain/bo/RfidDeviceBo.java +++ b/ruoyi-modules/hw-rfid/src/main/java/org/dromara/rfid/domain/bo/RfidDeviceBo.java @@ -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; /** @@ -48,6 +48,7 @@ public class RfidDeviceBo extends BaseEntity { /** * 设备地址(IP等) */ + @NotBlank(message = "设备地址不能为空", groups = { AddGroup.class, EditGroup.class }) private String deviceAddress; /** @@ -63,13 +64,13 @@ public class RfidDeviceBo extends BaseEntity { /** * 在线状态(0-离线;1-在线) */ - @NotBlank(message = "在线状态不能为空", groups = { AddGroup.class, EditGroup.class }) + // @NotBlank(message = "在线状态不能为空", groups = { AddGroup.class, EditGroup.class }) private String onlineStatus; /** * 告警状态(0-正常;1-告警) */ - @NotBlank(message = "告警状态不能为空", groups = { AddGroup.class, EditGroup.class }) + // @NotBlank(message = "告警状态不能为空", groups = { AddGroup.class, EditGroup.class }) private String alarmStatus; /** diff --git a/ruoyi-modules/hw-rfid/src/main/java/org/dromara/rfid/service/impl/RfidDeviceServiceImpl.java b/ruoyi-modules/hw-rfid/src/main/java/org/dromara/rfid/service/impl/RfidDeviceServiceImpl.java index 056ec07..5cccf3a 100644 --- a/ruoyi-modules/hw-rfid/src/main/java/org/dromara/rfid/service/impl/RfidDeviceServiceImpl.java +++ b/ruoyi-modules/hw-rfid/src/main/java/org/dromara/rfid/service/impl/RfidDeviceServiceImpl.java @@ -153,12 +153,22 @@ public class RfidDeviceServiceImpl implements IRfidDeviceService { */ private void validEntityBeforeSave(RfidDevice entity){ // 业务编号 deviceCode 唯一校验 - if (StringUtils.isNotBlank(entity.getDeviceCode())) { - boolean exists = baseMapper.existsRfidDevice(Wrappers.lambdaQuery() - .eq(RfidDevice::getDeviceCode, entity.getDeviceCode()) + // if (StringUtils.isNotBlank(entity.getDeviceCode())) { + // boolean exists = baseMapper.existsRfidDevice(Wrappers.lambdaQuery() + // .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.lambdaQuery() + .eq(RfidDevice::getDeviceAddress, entity.getDeviceAddress()) .ne(entity.getId() != null, RfidDevice::getId, entity.getId())); - if (exists) { - throw new ServiceException("设备编号已存在"); + if (existsAddress) { + throw new ServiceException("设备地址已存在"); } }