From 89ab720fddfe24e007d294e1a5d2bf810a7b7ac2 Mon Sep 17 00:00:00 2001 From: lxj <15683799673@163.com> Date: Wed, 18 Jun 2025 14:28:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BE=E5=A4=87=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- ruoyi-modules/Iot/Dockerfile | 27 ++++ ruoyi-modules/Iot/pom.xml | 133 ++++++++++++++++ .../org/dromara/property/IotyApplication.java | 22 +++ .../controller/TbAccessControlController.java | 106 +++++++++++++ .../controller/TdFactoryController.java | 106 +++++++++++++ .../property/domain/TbAccessControl.java | 108 +++++++++++++ .../dromara/property/domain/TdFactory.java | 58 +++++++ .../property/domain/bo/TbAccessControlBo.java | 105 +++++++++++++ .../property/domain/bo/TdFactoryBo.java | 55 +++++++ .../property/domain/vo/TbAccessControlVo.java | 118 ++++++++++++++ .../property/domain/vo/TdFactoryVo.java | 64 ++++++++ .../mapper/TbAccessControlMapper.java | 15 ++ .../property/mapper/TdFactoryMapper.java | 15 ++ .../service/ITbAccessControlService.java | 69 +++++++++ .../property/service/ITdFactoryService.java | 69 +++++++++ .../impl/TbAccessControlServiceImpl.java | 144 ++++++++++++++++++ .../service/impl/TdFactoryServiceImpl.java | 134 ++++++++++++++++ .../Iot/src/main/resources/application.yml | 34 +++++ .../Iot/src/main/resources/banner.txt | 10 ++ .../Iot/src/main/resources/logback-plus.xml | 28 ++++ .../mapper/Property/TbAccessControlMapper.xml | 7 + .../mapper/Property/TbBuildingMapper.xml | 7 + .../Property/TbCeremonialServeMapper.xml | 7 + .../TbCeremonialserveRoombookingMapper.xml | 7 + .../mapper/Property/TbCityAreaMapper.xml | 7 + .../mapper/Property/TbCommunityMapper.xml | 7 + .../mapper/Property/TbConferenceMapper.xml | 7 + .../mapper/Property/TbE8ConfigMapper.xml | 7 + .../mapper/Property/TbFloorMapper.xml | 7 + .../mapper/Property/TbRoomBookingMapper.xml | 7 + .../TbServiceClassificationMapper.xml | 7 + .../Property/TbVisitorManagementMapper.xml | 7 + .../mapper/Property/TdDeviceTypeMapper.xml | 7 + .../mapper/Property/TdFactoryMapper.xml | 7 + .../mapper/Property/TsConfigMapper.xml | 7 + .../mapper/Property/TsOperationLogMapper.xml | 7 + .../mapper/system/TbCeremonialServeMapper.xml | 7 + .../TbCeremonialserveRoombookingMapper.xml | 7 + .../mapper/system/TbE8ConfigMapper.xml | 7 + .../system/TbServiceClassificationMapper.xml | 7 + .../mapper/system/TsConfigMapper.xml | 7 + .../mapper/system/TsDictDefMapper.xml | 7 + .../resources/mapper/system/TsDictMapper.xml | 7 + .../mapper/system/TsLoginLogMapper.xml | 7 + .../resources/mapper/system/TsMenuMapper.xml | 7 + .../mapper/system/TsOperationLogMapper.xml | 7 + .../resources/mapper/system/TsOrgMapper.xml | 7 + .../resources/mapper/system/TsRoleMapper.xml | 7 + .../mapper/system/TsRoleMenuMapper.xml | 7 + .../resources/mapper/system/TsUserMapper.xml | 7 + .../mapper/system/TsUserRoleMapper.xml | 7 + ruoyi-modules/pom.xml | 1 + 53 files changed, 1639 insertions(+), 1 deletion(-) create mode 100644 ruoyi-modules/Iot/Dockerfile create mode 100644 ruoyi-modules/Iot/pom.xml create mode 100644 ruoyi-modules/Iot/src/main/java/org/dromara/property/IotyApplication.java create mode 100644 ruoyi-modules/Iot/src/main/java/org/dromara/property/controller/TbAccessControlController.java create mode 100644 ruoyi-modules/Iot/src/main/java/org/dromara/property/controller/TdFactoryController.java create mode 100644 ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/TbAccessControl.java create mode 100644 ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/TdFactory.java create mode 100644 ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/bo/TbAccessControlBo.java create mode 100644 ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/bo/TdFactoryBo.java create mode 100644 ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/vo/TbAccessControlVo.java create mode 100644 ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/vo/TdFactoryVo.java create mode 100644 ruoyi-modules/Iot/src/main/java/org/dromara/property/mapper/TbAccessControlMapper.java create mode 100644 ruoyi-modules/Iot/src/main/java/org/dromara/property/mapper/TdFactoryMapper.java create mode 100644 ruoyi-modules/Iot/src/main/java/org/dromara/property/service/ITbAccessControlService.java create mode 100644 ruoyi-modules/Iot/src/main/java/org/dromara/property/service/ITdFactoryService.java create mode 100644 ruoyi-modules/Iot/src/main/java/org/dromara/property/service/impl/TbAccessControlServiceImpl.java create mode 100644 ruoyi-modules/Iot/src/main/java/org/dromara/property/service/impl/TdFactoryServiceImpl.java create mode 100644 ruoyi-modules/Iot/src/main/resources/application.yml create mode 100644 ruoyi-modules/Iot/src/main/resources/banner.txt create mode 100644 ruoyi-modules/Iot/src/main/resources/logback-plus.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/Property/TbAccessControlMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/Property/TbBuildingMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/Property/TbCeremonialServeMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/Property/TbCeremonialserveRoombookingMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/Property/TbCityAreaMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/Property/TbCommunityMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/Property/TbConferenceMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/Property/TbE8ConfigMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/Property/TbFloorMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/Property/TbRoomBookingMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/Property/TbServiceClassificationMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/Property/TbVisitorManagementMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/Property/TdDeviceTypeMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/Property/TdFactoryMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/Property/TsConfigMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/Property/TsOperationLogMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/system/TbCeremonialServeMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/system/TbCeremonialserveRoombookingMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/system/TbE8ConfigMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/system/TbServiceClassificationMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/system/TsConfigMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/system/TsDictDefMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/system/TsDictMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/system/TsLoginLogMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/system/TsMenuMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/system/TsOperationLogMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/system/TsOrgMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/system/TsRoleMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/system/TsRoleMenuMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/system/TsUserMapper.xml create mode 100644 ruoyi-modules/Iot/src/main/resources/mapper/system/TsUserRoleMapper.xml diff --git a/pom.xml b/pom.xml index b221dff1..ffbb36ea 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ ruoyi-cloud-plus ${revision} - RuoYi-Cloud-Plus + SmartParks https://gitee.com/dromara/RuoYi-Cloud-Plus Dromara RuoYi-Cloud-Plus微服务系统 diff --git a/ruoyi-modules/Iot/Dockerfile b/ruoyi-modules/Iot/Dockerfile new file mode 100644 index 00000000..e70c56cf --- /dev/null +++ b/ruoyi-modules/Iot/Dockerfile @@ -0,0 +1,27 @@ +# 贝尔实验室 Spring 官方推荐镜像 JDK下载地址 https://bell-sw.com/pages/downloads/ +FROM bellsoft/liberica-openjdk-debian:17.0.11-cds +#FROM bellsoft/liberica-openjdk-debian:21.0.5-cds +#FROM findepi/graalvm:java17-native + +LABEL maintainer="Lion Li" + +RUN mkdir -p /ruoyi/system/logs \ + /ruoyi/system/temp \ + /ruoyi/skywalking/agent + +WORKDIR /ruoyi/system + +ENV SERVER_PORT=9201 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="" + +EXPOSE ${SERVER_PORT} + +ADD ./target/ruoyi-system.jar ./iot.jar + +SHELL ["/bin/bash", "-c"] + +ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \ + #-Dskywalking.agent.service_name=ruoyi-system \ + #-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar \ + -XX:+HeapDumpOnOutOfMemoryError -XX:+UseZGC ${JAVA_OPTS} \ + -jar iot.jar + diff --git a/ruoyi-modules/Iot/pom.xml b/ruoyi-modules/Iot/pom.xml new file mode 100644 index 00000000..952197a8 --- /dev/null +++ b/ruoyi-modules/Iot/pom.xml @@ -0,0 +1,133 @@ + + + + org.dromara + ruoyi-modules + ${revision} + + 4.0.0 + + Iot + + + 物业管理模块 + + + + + + org.dromara + ruoyi-common-nacos + + + + org.dromara + ruoyi-common-sentinel + + + + + org.dromara + ruoyi-common-log + + + + org.dromara + ruoyi-common-service-impl + + + + org.dromara + ruoyi-common-doc + + + + org.dromara + ruoyi-common-web + + + + org.dromara + ruoyi-common-mybatis + + + + org.dromara + ruoyi-common-dubbo + + + + org.dromara + ruoyi-common-seata + + + + org.dromara + ruoyi-common-idempotent + + + + org.dromara + ruoyi-common-tenant + + + + org.dromara + ruoyi-common-security + + + + org.dromara + ruoyi-common-translation + + + + org.dromara + ruoyi-common-sensitive + + + + org.dromara + ruoyi-common-encrypt + + + + + org.dromara + ruoyi-api-system + + + + org.dromara + ruoyi-api-resource + + + + + org.dromara + ruoyi-api-workflow + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + repackage + + + + + + + + diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/property/IotyApplication.java b/ruoyi-modules/Iot/src/main/java/org/dromara/property/IotyApplication.java new file mode 100644 index 00000000..c535de57 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/java/org/dromara/property/IotyApplication.java @@ -0,0 +1,22 @@ +package org.dromara.property; + +import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; + +/** + * 物业模块 + * + * @author ruoyi + */ +@EnableDubbo +@SpringBootApplication +public class IotyApplication { + public static void main(String[] args) { + SpringApplication application = new SpringApplication(IotyApplication.class); + application.setApplicationStartup(new BufferingApplicationStartup(2048)); + application.run(args); + System.out.println("(♥◠‿◠)ノ゙ 物业模块启动成功 ლ(´ڡ`ლ)゙ "); + } +} diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/property/controller/TbAccessControlController.java b/ruoyi-modules/Iot/src/main/java/org/dromara/property/controller/TbAccessControlController.java new file mode 100644 index 00000000..28b840cf --- /dev/null +++ b/ruoyi-modules/Iot/src/main/java/org/dromara/property/controller/TbAccessControlController.java @@ -0,0 +1,106 @@ +package org.dromara.property.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.property.domain.vo.TbAccessControlVo; +import org.dromara.property.domain.bo.TbAccessControlBo; +import org.dromara.property.service.ITbAccessControlService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 门禁管理 + * 前端访问路由地址为:/property/accessControl + * + * @author mocheng + * @date 2025-06-17 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/accessControl") +public class TbAccessControlController extends BaseController { + + private final ITbAccessControlService tbAccessControlService; + + /** + * 查询门禁管理列表 + */ + @SaCheckPermission("property:accessControl:list") + @GetMapping("/list") + public TableDataInfo list(TbAccessControlBo bo, PageQuery pageQuery) { + return tbAccessControlService.queryPageList(bo, pageQuery); + } + + /** + * 导出门禁管理列表 + */ + @SaCheckPermission("property:accessControl:export") + @Log(title = "门禁管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(TbAccessControlBo bo, HttpServletResponse response) { + List list = tbAccessControlService.queryList(bo); + ExcelUtil.exportExcel(list, "门禁管理", TbAccessControlVo.class, response); + } + + /** + * 获取门禁管理详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("property:accessControl:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable("id") Long id) { + return R.ok(tbAccessControlService.queryById(id)); + } + + /** + * 新增门禁管理 + */ + @SaCheckPermission("property:accessControl:add") + @Log(title = "门禁管理", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody TbAccessControlBo bo) { + return toAjax(tbAccessControlService.insertByBo(bo)); + } + + /** + * 修改门禁管理 + */ + @SaCheckPermission("property:accessControl:edit") + @Log(title = "门禁管理", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody TbAccessControlBo bo) { + return toAjax(tbAccessControlService.updateByBo(bo)); + } + + /** + * 删除门禁管理 + * + * @param ids 主键串 + */ + @SaCheckPermission("property:accessControl:remove") + @Log(title = "门禁管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable("ids") Long[] ids) { + return toAjax(tbAccessControlService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/property/controller/TdFactoryController.java b/ruoyi-modules/Iot/src/main/java/org/dromara/property/controller/TdFactoryController.java new file mode 100644 index 00000000..04f4932e --- /dev/null +++ b/ruoyi-modules/Iot/src/main/java/org/dromara/property/controller/TdFactoryController.java @@ -0,0 +1,106 @@ +package org.dromara.property.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.property.domain.vo.TdFactoryVo; +import org.dromara.property.domain.bo.TdFactoryBo; +import org.dromara.property.service.ITdFactoryService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 厂商管理 + * 前端访问路由地址为:/property/factory + * + * @author mocheng + * @date 2025-06-17 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/factory") +public class TdFactoryController extends BaseController { + + private final ITdFactoryService tdFactoryService; + + /** + * 查询厂商管理列表 + */ + @SaCheckPermission("property:factory:list") + @GetMapping("/list") + public TableDataInfo list(TdFactoryBo bo, PageQuery pageQuery) { + return tdFactoryService.queryPageList(bo, pageQuery); + } + + /** + * 导出厂商管理列表 + */ + @SaCheckPermission("property:factory:export") + @Log(title = "厂商管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(TdFactoryBo bo, HttpServletResponse response) { + List list = tdFactoryService.queryList(bo); + ExcelUtil.exportExcel(list, "厂商管理", TdFactoryVo.class, response); + } + + /** + * 获取厂商管理详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("property:factory:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable("id") Long id) { + return R.ok(tdFactoryService.queryById(id)); + } + + /** + * 新增厂商管理 + */ + @SaCheckPermission("property:factory:add") + @Log(title = "厂商管理", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody TdFactoryBo bo) { + return toAjax(tdFactoryService.insertByBo(bo)); + } + + /** + * 修改厂商管理 + */ + @SaCheckPermission("property:factory:edit") + @Log(title = "厂商管理", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody TdFactoryBo bo) { + return toAjax(tdFactoryService.updateByBo(bo)); + } + + /** + * 删除厂商管理 + * + * @param ids 主键串 + */ + @SaCheckPermission("property:factory:remove") + @Log(title = "厂商管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable("ids") Long[] ids) { + return toAjax(tdFactoryService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/TbAccessControl.java b/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/TbAccessControl.java new file mode 100644 index 00000000..360bfb83 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/TbAccessControl.java @@ -0,0 +1,108 @@ +package org.dromara.property.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serial; + +/** + * 门禁管理对象 tb_access_control + * + * @author mocheng + * @date 2025-06-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("tb_access_control") +public class TbAccessControl extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(value = "id") + private Long id; + + /** + * 门禁设备编码 + */ + private String accessCode; + + /** + * 门禁名称 + */ + private String accessName; + + /** + * 园区编码 + */ + private String communityCode; + + /** + * 建筑编码 + */ + private String buildingCode; + + /** + * 门禁设备ip + */ + private String accessIp; + + /** + * 设备端口 + */ + private Long accessPort; + + /** + * 门禁设备类型 + */ + private Long accssType; + + /** + * 工程编号 + */ + private String factoryCode; + + /** + * 控制卡类型:1-系统,2-E8 + */ + private Long controlType; + + /** + * 控制卡类型编码 + */ + private String controlCode; + + /** + * 外部编码 + */ + private String outCode; + + /** + * 组织编码 + */ + private String orgCode; + + /** + * 数据状态:1有效,0无效 + */ + private Long dataState; + + /** + * 创建人 + */ + private Long createEmpId; + + /** + * 修改时间 + */ + private Date modifyTime; + + +} diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/TdFactory.java b/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/TdFactory.java new file mode 100644 index 00000000..585f888b --- /dev/null +++ b/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/TdFactory.java @@ -0,0 +1,58 @@ +package org.dromara.property.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serial; + +/** + * 厂商管理对象 td_factory + * + * @author mocheng + * @date 2025-06-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("td_factory") +public class TdFactory extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 数据库id + */ + @TableId(value = "id") + private Long id; + + /** + * 厂商编码 + */ + private String factoryNo; + + /** + * 设备厂商名称 + */ + private String factoryName; + + /** + * 备注 + */ + private String remark; + + /** + * 数据状态:1有效,0无效 + */ + private Long dataState; + + /** + * 修改时间 + */ + private Date modifyTime; + + +} diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/bo/TbAccessControlBo.java b/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/bo/TbAccessControlBo.java new file mode 100644 index 00000000..b19692d6 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/bo/TbAccessControlBo.java @@ -0,0 +1,105 @@ +package org.dromara.property.domain.bo; + +import org.dromara.property.domain.TbAccessControl; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +/** + * 门禁管理业务对象 tb_access_control + * + * @author mocheng + * @date 2025-06-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = TbAccessControl.class, reverseConvertGenerate = false) +public class TbAccessControlBo extends BaseEntity { + + /** + * id + */ + private Long id; + + /** + * 门禁设备编码 + */ + @NotBlank(message = "门禁设备编码不能为空", groups = { AddGroup.class, EditGroup.class }) + private String accessCode; + + /** + * 门禁名称 + */ + @NotBlank(message = "门禁名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String accessName; + + /** + * 园区编码 + */ + @NotBlank(message = "园区编码不能为空", groups = { AddGroup.class, EditGroup.class }) + private String communityCode; + + /** + * 建筑编码 + */ + @NotBlank(message = "建筑编码不能为空", groups = { AddGroup.class, EditGroup.class }) + private String buildingCode; + + /** + * 门禁设备ip + */ + private String accessIp; + + /** + * 设备端口 + */ + private Long accessPort; + + /** + * 门禁设备类型 + */ + @NotNull(message = "门禁设备类型不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long accssType; + + /** + * 工程编号 + */ + @NotBlank(message = "工程编号不能为空", groups = { AddGroup.class, EditGroup.class }) + private String factoryCode; + + /** + * 控制卡类型:1-系统,2-E8 + */ + @NotNull(message = "控制卡类型:1-系统,2-E8不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long controlType; + + /** + * 控制卡类型编码 + */ + private String controlCode; + + /** + * 外部编码 + */ + private String outCode; + + /** + * 组织编码 + */ + @NotBlank(message = "组织编码不能为空", groups = { AddGroup.class, EditGroup.class }) + private String orgCode; + + /** + * 数据状态:1有效,0无效 + */ + @NotNull(message = "数据状态:1有效,0无效不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long dataState; + + +} diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/bo/TdFactoryBo.java b/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/bo/TdFactoryBo.java new file mode 100644 index 00000000..7ebf5af4 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/bo/TdFactoryBo.java @@ -0,0 +1,55 @@ +package org.dromara.property.domain.bo; + +import org.dromara.property.domain.TdFactory; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +/** + * 厂商管理业务对象 td_factory + * + * @author mocheng + * @date 2025-06-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = TdFactory.class, reverseConvertGenerate = false) +public class TdFactoryBo extends BaseEntity { + + /** + * 数据库id + */ + @NotNull(message = "数据库id不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 厂商编码 + */ + @NotBlank(message = "厂商编码不能为空", groups = { AddGroup.class, EditGroup.class }) + private String factoryNo; + + /** + * 设备厂商名称 + */ + @NotBlank(message = "设备厂商名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String factoryName; + + /** + * 备注 + */ + private String remark; + + /** + * 数据状态:1有效,0无效 + */ + @NotNull(message = "数据状态:1有效,0无效不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long dataState; + + +} diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/vo/TbAccessControlVo.java b/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/vo/TbAccessControlVo.java new file mode 100644 index 00000000..eeefe5c6 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/vo/TbAccessControlVo.java @@ -0,0 +1,118 @@ +package org.dromara.property.domain.vo; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.dromara.property.domain.TbAccessControl; +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 门禁管理视图对象 tb_access_control + * + * @author mocheng + * @date 2025-06-17 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = TbAccessControl.class) +public class TbAccessControlVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ExcelProperty(value = "id") + private Long id; + + /** + * 门禁设备编码 + */ + @ExcelProperty(value = "门禁设备编码") + private String accessCode; + + /** + * 门禁名称 + */ + @ExcelProperty(value = "门禁名称") + private String accessName; + + /** + * 园区编码 + */ + @ExcelProperty(value = "园区编码") + private String communityCode; + + /** + * 建筑编码 + */ + @ExcelProperty(value = "建筑编码") + private String buildingCode; + + /** + * 门禁设备ip + */ + @ExcelProperty(value = "门禁设备ip") + private String accessIp; + + /** + * 设备端口 + */ + @ExcelProperty(value = "设备端口") + private Long accessPort; + + /** + * 门禁设备类型 + */ + @ExcelProperty(value = "门禁设备类型") + private Long accssType; + + /** + * 工程编号 + */ + @ExcelProperty(value = "工程编号") + private String factoryCode; + + /** + * 控制卡类型:1-系统,2-E8 + */ + @ExcelProperty(value = "控制卡类型:1-系统,2-E8") + private Long controlType; + + /** + * 控制卡类型编码 + */ + @ExcelProperty(value = "控制卡类型编码") + private String controlCode; + + /** + * 外部编码 + */ + @ExcelProperty(value = "外部编码") + private String outCode; + + /** + * 组织编码 + */ + @ExcelProperty(value = "组织编码") + private String orgCode; + + /** + * 数据状态:1有效,0无效 + */ + @ExcelProperty(value = "数据状态:1有效,0无效") + private Long dataState; + + +} diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/vo/TdFactoryVo.java b/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/vo/TdFactoryVo.java new file mode 100644 index 00000000..d409b5b4 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/java/org/dromara/property/domain/vo/TdFactoryVo.java @@ -0,0 +1,64 @@ +package org.dromara.property.domain.vo; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.dromara.property.domain.TdFactory; +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 厂商管理视图对象 td_factory + * + * @author mocheng + * @date 2025-06-17 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = TdFactory.class) +public class TdFactoryVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 数据库id + */ + @ExcelProperty(value = "数据库id") + private Long id; + + /** + * 厂商编码 + */ + @ExcelProperty(value = "厂商编码") + private String factoryNo; + + /** + * 设备厂商名称 + */ + @ExcelProperty(value = "设备厂商名称") + private String factoryName; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 数据状态:1有效,0无效 + */ + @ExcelProperty(value = "数据状态:1有效,0无效") + private Long dataState; + + +} diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/property/mapper/TbAccessControlMapper.java b/ruoyi-modules/Iot/src/main/java/org/dromara/property/mapper/TbAccessControlMapper.java new file mode 100644 index 00000000..279ea31d --- /dev/null +++ b/ruoyi-modules/Iot/src/main/java/org/dromara/property/mapper/TbAccessControlMapper.java @@ -0,0 +1,15 @@ +package org.dromara.property.mapper; + +import org.dromara.property.domain.TbAccessControl; +import org.dromara.property.domain.vo.TbAccessControlVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 门禁管理Mapper接口 + * + * @author mocheng + * @date 2025-06-17 + */ +public interface TbAccessControlMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/property/mapper/TdFactoryMapper.java b/ruoyi-modules/Iot/src/main/java/org/dromara/property/mapper/TdFactoryMapper.java new file mode 100644 index 00000000..fbfa311f --- /dev/null +++ b/ruoyi-modules/Iot/src/main/java/org/dromara/property/mapper/TdFactoryMapper.java @@ -0,0 +1,15 @@ +package org.dromara.property.mapper; + +import org.dromara.property.domain.TdFactory; +import org.dromara.property.domain.vo.TdFactoryVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 厂商管理Mapper接口 + * + * @author mocheng + * @date 2025-06-17 + */ +public interface TdFactoryMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/property/service/ITbAccessControlService.java b/ruoyi-modules/Iot/src/main/java/org/dromara/property/service/ITbAccessControlService.java new file mode 100644 index 00000000..fdde4d26 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/java/org/dromara/property/service/ITbAccessControlService.java @@ -0,0 +1,69 @@ +package org.dromara.property.service; + +import org.dromara.property.domain.TbAccessControl; +import org.dromara.property.domain.vo.TbAccessControlVo; +import org.dromara.property.domain.bo.TbAccessControlBo; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 门禁管理Service接口 + * + * @author mocheng + * @date 2025-06-17 + */ +public interface ITbAccessControlService { + + /** + * 查询门禁管理 + * + * @param id 主键 + * @return 门禁管理 + */ + TbAccessControlVo queryById(Long id); + + /** + * 分页查询门禁管理列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 门禁管理分页列表 + */ + TableDataInfo queryPageList(TbAccessControlBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的门禁管理列表 + * + * @param bo 查询条件 + * @return 门禁管理列表 + */ + List queryList(TbAccessControlBo bo); + + /** + * 新增门禁管理 + * + * @param bo 门禁管理 + * @return 是否新增成功 + */ + Boolean insertByBo(TbAccessControlBo bo); + + /** + * 修改门禁管理 + * + * @param bo 门禁管理 + * @return 是否修改成功 + */ + Boolean updateByBo(TbAccessControlBo bo); + + /** + * 校验并批量删除门禁管理信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/property/service/ITdFactoryService.java b/ruoyi-modules/Iot/src/main/java/org/dromara/property/service/ITdFactoryService.java new file mode 100644 index 00000000..c907d569 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/java/org/dromara/property/service/ITdFactoryService.java @@ -0,0 +1,69 @@ +package org.dromara.property.service; + +import org.dromara.property.domain.TdFactory; +import org.dromara.property.domain.vo.TdFactoryVo; +import org.dromara.property.domain.bo.TdFactoryBo; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 厂商管理Service接口 + * + * @author mocheng + * @date 2025-06-17 + */ +public interface ITdFactoryService { + + /** + * 查询厂商管理 + * + * @param id 主键 + * @return 厂商管理 + */ + TdFactoryVo queryById(Long id); + + /** + * 分页查询厂商管理列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 厂商管理分页列表 + */ + TableDataInfo queryPageList(TdFactoryBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的厂商管理列表 + * + * @param bo 查询条件 + * @return 厂商管理列表 + */ + List queryList(TdFactoryBo bo); + + /** + * 新增厂商管理 + * + * @param bo 厂商管理 + * @return 是否新增成功 + */ + Boolean insertByBo(TdFactoryBo bo); + + /** + * 修改厂商管理 + * + * @param bo 厂商管理 + * @return 是否修改成功 + */ + Boolean updateByBo(TdFactoryBo bo); + + /** + * 校验并批量删除厂商管理信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/property/service/impl/TbAccessControlServiceImpl.java b/ruoyi-modules/Iot/src/main/java/org/dromara/property/service/impl/TbAccessControlServiceImpl.java new file mode 100644 index 00000000..00442ba7 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/java/org/dromara/property/service/impl/TbAccessControlServiceImpl.java @@ -0,0 +1,144 @@ +package org.dromara.property.service.impl; + +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.dromara.property.domain.bo.TbAccessControlBo; +import org.dromara.property.domain.vo.TbAccessControlVo; +import org.dromara.property.domain.TbAccessControl; +import org.dromara.property.mapper.TbAccessControlMapper; +import org.dromara.property.service.ITbAccessControlService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 门禁管理Service业务层处理 + * + * @author mocheng + * @date 2025-06-17 + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class TbAccessControlServiceImpl implements ITbAccessControlService { + + private final TbAccessControlMapper baseMapper; + + /** + * 查询门禁管理 + * + * @param id 主键 + * @return 门禁管理 + */ + @Override + public TbAccessControlVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询门禁管理列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 门禁管理分页列表 + */ + @Override + public TableDataInfo queryPageList(TbAccessControlBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的门禁管理列表 + * + * @param bo 查询条件 + * @return 门禁管理列表 + */ + @Override + public List queryList(TbAccessControlBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(TbAccessControlBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByAsc(TbAccessControl::getId); + lqw.eq(StringUtils.isNotBlank(bo.getAccessCode()), TbAccessControl::getAccessCode, bo.getAccessCode()); + lqw.like(StringUtils.isNotBlank(bo.getAccessName()), TbAccessControl::getAccessName, bo.getAccessName()); + lqw.eq(StringUtils.isNotBlank(bo.getCommunityCode()), TbAccessControl::getCommunityCode, bo.getCommunityCode()); + lqw.eq(StringUtils.isNotBlank(bo.getBuildingCode()), TbAccessControl::getBuildingCode, bo.getBuildingCode()); + lqw.eq(StringUtils.isNotBlank(bo.getAccessIp()), TbAccessControl::getAccessIp, bo.getAccessIp()); + lqw.eq(bo.getAccessPort() != null, TbAccessControl::getAccessPort, bo.getAccessPort()); + lqw.eq(bo.getAccssType() != null, TbAccessControl::getAccssType, bo.getAccssType()); + lqw.eq(StringUtils.isNotBlank(bo.getFactoryCode()), TbAccessControl::getFactoryCode, bo.getFactoryCode()); + lqw.eq(bo.getControlType() != null, TbAccessControl::getControlType, bo.getControlType()); + lqw.eq(StringUtils.isNotBlank(bo.getControlCode()), TbAccessControl::getControlCode, bo.getControlCode()); + lqw.eq(StringUtils.isNotBlank(bo.getOutCode()), TbAccessControl::getOutCode, bo.getOutCode()); + lqw.eq(StringUtils.isNotBlank(bo.getOrgCode()), TbAccessControl::getOrgCode, bo.getOrgCode()); + lqw.eq(bo.getDataState() != null, TbAccessControl::getDataState, bo.getDataState()); + return lqw; + } + + /** + * 新增门禁管理 + * + * @param bo 门禁管理 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(TbAccessControlBo bo) { + TbAccessControl add = MapstructUtils.convert(bo, TbAccessControl.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改门禁管理 + * + * @param bo 门禁管理 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(TbAccessControlBo bo) { + TbAccessControl update = MapstructUtils.convert(bo, TbAccessControl.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(TbAccessControl entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除门禁管理信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/ruoyi-modules/Iot/src/main/java/org/dromara/property/service/impl/TdFactoryServiceImpl.java b/ruoyi-modules/Iot/src/main/java/org/dromara/property/service/impl/TdFactoryServiceImpl.java new file mode 100644 index 00000000..f200e5a4 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/java/org/dromara/property/service/impl/TdFactoryServiceImpl.java @@ -0,0 +1,134 @@ +package org.dromara.property.service.impl; + +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.dromara.property.domain.bo.TdFactoryBo; +import org.dromara.property.domain.vo.TdFactoryVo; +import org.dromara.property.domain.TdFactory; +import org.dromara.property.mapper.TdFactoryMapper; +import org.dromara.property.service.ITdFactoryService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 厂商管理Service业务层处理 + * + * @author mocheng + * @date 2025-06-17 + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class TdFactoryServiceImpl implements ITdFactoryService { + + private final TdFactoryMapper baseMapper; + + /** + * 查询厂商管理 + * + * @param id 主键 + * @return 厂商管理 + */ + @Override + public TdFactoryVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询厂商管理列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 厂商管理分页列表 + */ + @Override + public TableDataInfo queryPageList(TdFactoryBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的厂商管理列表 + * + * @param bo 查询条件 + * @return 厂商管理列表 + */ + @Override + public List queryList(TdFactoryBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(TdFactoryBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByAsc(TdFactory::getId); + lqw.eq(StringUtils.isNotBlank(bo.getFactoryNo()), TdFactory::getFactoryNo, bo.getFactoryNo()); + lqw.like(StringUtils.isNotBlank(bo.getFactoryName()), TdFactory::getFactoryName, bo.getFactoryName()); + lqw.eq(bo.getDataState() != null, TdFactory::getDataState, bo.getDataState()); + return lqw; + } + + /** + * 新增厂商管理 + * + * @param bo 厂商管理 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(TdFactoryBo bo) { + TdFactory add = MapstructUtils.convert(bo, TdFactory.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改厂商管理 + * + * @param bo 厂商管理 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(TdFactoryBo bo) { + TdFactory update = MapstructUtils.convert(bo, TdFactory.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(TdFactory entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除厂商管理信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/ruoyi-modules/Iot/src/main/resources/application.yml b/ruoyi-modules/Iot/src/main/resources/application.yml new file mode 100644 index 00000000..55dfe652 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/application.yml @@ -0,0 +1,34 @@ +# Tomcat +server: + port: 10001 + +# Spring +spring: + application: + # 应用名称 + name: Property + profiles: + # 环境配置 + active: @profiles.active@ + +--- # nacos 配置 +spring: + cloud: + nacos: + # nacos 服务地址 + server-addr: @nacos.server@ + username: @nacos.username@ + password: @nacos.password@ + discovery: + # 注册组 + group: @nacos.discovery.group@ + namespace: ${spring.profiles.active} + config: + # 配置组 + group: @nacos.config.group@ + namespace: ${spring.profiles.active} + config: + import: + - optional:nacos:application-common.yml + - optional:nacos:datasource.yml + - optional:nacos:${spring.application.name}.yml diff --git a/ruoyi-modules/Iot/src/main/resources/banner.txt b/ruoyi-modules/Iot/src/main/resources/banner.txt new file mode 100644 index 00000000..fbd45f53 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/banner.txt @@ -0,0 +1,10 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} + _ _ + (_) | | + _ __ _ _ ___ _ _ _ ______ ___ _ _ ___ | |_ ___ _ __ ___ +| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \ +| | | |_| || (_) || |_| || | \__ \| |_| |\__ \| |_ | __/| | | | | | +|_| \__,_| \___/ \__, ||_| |___/ \__, ||___/ \__| \___||_| |_| |_| + __/ | __/ | + |___/ |___/ \ No newline at end of file diff --git a/ruoyi-modules/Iot/src/main/resources/logback-plus.xml b/ruoyi-modules/Iot/src/main/resources/logback-plus.xml new file mode 100644 index 00000000..00d30896 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/logback-plus.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + ${console.log.pattern} + utf-8 + + + + + + + + + + + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbAccessControlMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbAccessControlMapper.xml new file mode 100644 index 00000000..ac7f1040 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbAccessControlMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbBuildingMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbBuildingMapper.xml new file mode 100644 index 00000000..432ae650 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbBuildingMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbCeremonialServeMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbCeremonialServeMapper.xml new file mode 100644 index 00000000..dbfea2bc --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbCeremonialServeMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbCeremonialserveRoombookingMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbCeremonialserveRoombookingMapper.xml new file mode 100644 index 00000000..67e4136e --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbCeremonialserveRoombookingMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbCityAreaMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbCityAreaMapper.xml new file mode 100644 index 00000000..6ee1cd71 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbCityAreaMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbCommunityMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbCommunityMapper.xml new file mode 100644 index 00000000..e0956de7 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbCommunityMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbConferenceMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbConferenceMapper.xml new file mode 100644 index 00000000..75f81151 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbConferenceMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbE8ConfigMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbE8ConfigMapper.xml new file mode 100644 index 00000000..85b5e2a2 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbE8ConfigMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbFloorMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbFloorMapper.xml new file mode 100644 index 00000000..38393a6a --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbFloorMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbRoomBookingMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbRoomBookingMapper.xml new file mode 100644 index 00000000..f487e457 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbRoomBookingMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbServiceClassificationMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbServiceClassificationMapper.xml new file mode 100644 index 00000000..3ee8a2af --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbServiceClassificationMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbVisitorManagementMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbVisitorManagementMapper.xml new file mode 100644 index 00000000..d8a8b781 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TbVisitorManagementMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/Property/TdDeviceTypeMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TdDeviceTypeMapper.xml new file mode 100644 index 00000000..3bb0bb4d --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TdDeviceTypeMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/Property/TdFactoryMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TdFactoryMapper.xml new file mode 100644 index 00000000..e5f1557a --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TdFactoryMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/Property/TsConfigMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TsConfigMapper.xml new file mode 100644 index 00000000..8285caac --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TsConfigMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/Property/TsOperationLogMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TsOperationLogMapper.xml new file mode 100644 index 00000000..4c36b6f9 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/Property/TsOperationLogMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/system/TbCeremonialServeMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/system/TbCeremonialServeMapper.xml new file mode 100644 index 00000000..dbfea2bc --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/system/TbCeremonialServeMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/system/TbCeremonialserveRoombookingMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/system/TbCeremonialserveRoombookingMapper.xml new file mode 100644 index 00000000..67e4136e --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/system/TbCeremonialserveRoombookingMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/system/TbE8ConfigMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/system/TbE8ConfigMapper.xml new file mode 100644 index 00000000..85b5e2a2 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/system/TbE8ConfigMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/system/TbServiceClassificationMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/system/TbServiceClassificationMapper.xml new file mode 100644 index 00000000..3ee8a2af --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/system/TbServiceClassificationMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/system/TsConfigMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsConfigMapper.xml new file mode 100644 index 00000000..8285caac --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsConfigMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/system/TsDictDefMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsDictDefMapper.xml new file mode 100644 index 00000000..aeeeb017 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsDictDefMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/system/TsDictMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsDictMapper.xml new file mode 100644 index 00000000..a8a83b94 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsDictMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/system/TsLoginLogMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsLoginLogMapper.xml new file mode 100644 index 00000000..4d1a1680 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsLoginLogMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/system/TsMenuMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsMenuMapper.xml new file mode 100644 index 00000000..6d5beb10 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsMenuMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/system/TsOperationLogMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsOperationLogMapper.xml new file mode 100644 index 00000000..4c36b6f9 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsOperationLogMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/system/TsOrgMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsOrgMapper.xml new file mode 100644 index 00000000..4eaafc70 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsOrgMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/system/TsRoleMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsRoleMapper.xml new file mode 100644 index 00000000..6e92ecf7 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsRoleMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/system/TsRoleMenuMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsRoleMenuMapper.xml new file mode 100644 index 00000000..cedf02f4 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsRoleMenuMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/system/TsUserMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsUserMapper.xml new file mode 100644 index 00000000..0c06866d --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsUserMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/Iot/src/main/resources/mapper/system/TsUserRoleMapper.xml b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsUserRoleMapper.xml new file mode 100644 index 00000000..bf082765 --- /dev/null +++ b/ruoyi-modules/Iot/src/main/resources/mapper/system/TsUserRoleMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/pom.xml b/ruoyi-modules/pom.xml index 909565b2..25f0253b 100644 --- a/ruoyi-modules/pom.xml +++ b/ruoyi-modules/pom.xml @@ -15,6 +15,7 @@ ruoyi-resource ruoyi-workflow Property + Iot ruoyi-modules