diff --git a/blade-service-api/blade-desk-api/pom.xml b/blade-service-api/blade-desk-api/pom.xml
index 5f492341..6e04f3e3 100644
--- a/blade-service-api/blade-desk-api/pom.xml
+++ b/blade-service-api/blade-desk-api/pom.xml
@@ -18,6 +18,12 @@
+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *
+ * 1. This software is for development use only under a valid license + * from BladeX. + *
+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *
+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *
+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *
+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.desk.device.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import java.io.Serial; +import java.math.BigDecimal; + +/** + * 设备信息表 实体类 + * + * @author qyl + * @since 2025-12-26 + */ +@Data +@TableName("MES_EQUIPMENT") +@Schema(description = "MesEquipment对象") +@EqualsAndHashCode(callSuper = true) +public class EquipmentEntity extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 设备编码 + */ + @Schema(description = "设备编码") + private String deviceCode; + /** + * 设备名称 + */ + @Schema(description = "设备名称") + private String deviceName; + /** + * 类别名称 + */ + @Schema(description = "类别名称") + private String typeName; + /** + * 规格型号 + */ + @Schema(description = "规格型号") + private String macSpec; + /** + * 服役状态;1、正常服役,2、暂停服役 + */ + @Schema(description = "服役状态;1、正常服役,2、暂停服役") + private BigDecimal used; + /** + * RFID + */ + @Schema(description = "RFID") + private String rfId; + /** + * 虚拟设备;1.是, 0.否 + */ + @Schema(description = "虚拟设备;1.是, 0.否") + private String virtualMac; + /** + * 是否对接;1.是, 0.否 + */ + @Schema(description = "是否对接;1.是, 0.否") + private String docking; + /** + * 类别说明 + */ + @Schema(description = "类别说明") + private String memo; + /** + * 绑定数量 + */ + @Schema(description = "绑定数量") + private BigDecimal bindQty; + /** + * 设备分类 + */ + @Schema(description = "设备分类") + private String category; + /** + * 设备ip + */ + @Schema(description = "设备ip") + private String deviceIp; + /** + * 设备分类 + */ + @Schema(description = "设备分类") + private String categorys; + +} diff --git a/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/device/pojo/excel/EquipmentExcel.java b/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/device/pojo/excel/EquipmentExcel.java new file mode 100644 index 00000000..ddaff0d3 --- /dev/null +++ b/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/device/pojo/excel/EquipmentExcel.java @@ -0,0 +1,146 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *
+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *
+ * 1. This software is for development use only under a valid license + * from BladeX. + *
+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *
+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *
+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *
+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.desk.device.pojo.excel; + + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentRowHeight; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; + + +/** + * 设备信息表 Excel实体类 + * + * @author qyl + * @since 2025-12-26 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class EquipmentExcel implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ColumnWidth(20) + @ExcelProperty("ID") + private BigDecimal id; + /** + * 设备编码 + */ + @ColumnWidth(20) + @ExcelProperty("设备编码") + private String deviceCode; + /** + * 设备名称 + */ + @ColumnWidth(20) + @ExcelProperty("设备名称") + private String deviceName; + /** + * 类别名称 + */ + @ColumnWidth(20) + @ExcelProperty("类别名称") + private String typeName; + /** + * 规格型号 + */ + @ColumnWidth(20) + @ExcelProperty("规格型号") + private String macSpec; + /** + * 服役状态;1、正常服役,2、暂停服役 + */ + @ColumnWidth(20) + @ExcelProperty("服役状态;1、正常服役,2、暂停服役") + private BigDecimal used; + /** + * RFID + */ + @ColumnWidth(20) + @ExcelProperty("RFID") + private String rfId; + /** + * 虚拟设备;1.是, 0.否 + */ + @ColumnWidth(20) + @ExcelProperty("虚拟设备;1.是, 0.否") + private String virtualMac; + /** + * 是否对接;1.是, 0.否 + */ + @ColumnWidth(20) + @ExcelProperty("是否对接;1.是, 0.否") + private String docking; + /** + * 类别说明 + */ + @ColumnWidth(20) + @ExcelProperty("类别说明") + private String memo; + /** + * 绑定数量 + */ + @ColumnWidth(20) + @ExcelProperty("绑定数量") + private BigDecimal bindQty; + /** + * 设备分类 + */ + @ColumnWidth(20) + @ExcelProperty("设备分类") + private String category; + /** + * 设备ip + */ + @ColumnWidth(20) + @ExcelProperty("设备ip") + private String deviceIp; + /** + * 设备分类 + */ + @ColumnWidth(20) + @ExcelProperty("设备分类") + private String categorys; + /** + * 是否已删除 + */ + @ColumnWidth(20) + @ExcelProperty("是否已删除") + private Long isDeleted; + +} diff --git a/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/device/pojo/vo/EquipmentVO.java b/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/device/pojo/vo/EquipmentVO.java new file mode 100644 index 00000000..b618d9d8 --- /dev/null +++ b/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/device/pojo/vo/EquipmentVO.java @@ -0,0 +1,56 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *
+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *
+ * 1. This software is for development use only under a valid license + * from BladeX. + *
+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *
+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *
+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *
+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.desk.device.pojo.vo; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.desk.device.pojo.entity.EquipmentEntity; + +import java.io.Serial; + +/** + * 设备信息表 视图实体类 + * + * @author qyl + * @since 2025-12-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class EquipmentVO extends EquipmentEntity { + @Serial + private static final long serialVersionUID = 1L; + /** + * 主键ID + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + /** + * 状态名称 + */ + String statusName; +} diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/device/controller/EquipmentController.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/device/controller/EquipmentController.java new file mode 100644 index 00000000..0076ff56 --- /dev/null +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/device/controller/EquipmentController.java @@ -0,0 +1,161 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *
+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *
+ * 1. This software is for development use only under a valid license + * from BladeX. + *
+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *
+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *
+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.desk.device.controller;
+
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import jakarta.validation.Valid;
+
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.annotation.IsAdmin;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.desk.device.pojo.excel.EquipmentExcel;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.desk.device.pojo.entity.EquipmentEntity;
+import org.springblade.desk.device.pojo.vo.EquipmentVO;
+import org.springblade.desk.device.wrapper.EquipmentWrapper;
+import org.springblade.desk.device.service.IEquipmentService;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.excel.util.ExcelUtil;
+import org.springblade.core.tool.constant.BladeConstant;
+import java.util.Map;
+import java.util.List;
+import jakarta.servlet.http.HttpServletResponse;
+
+/**
+ * 设备信息表 控制器
+ *
+ * @author qyl
+ * @since 2025-12-26
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/equipment")
+@Tag(name = "设备信息表", description = "设备信息表接口")
+public class EquipmentController extends BladeController {
+
+ private final IEquipmentService equipmentService;
+
+ /**
+ * 设备信息表 详情
+ */
+ @GetMapping("/detail")
+ @ApiOperationSupport(order = 1)
+ @Operation(summary = "详情", description = "传入equipment")
+ public R
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ *
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ *
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ *
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ *
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ *
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.desk.device.mapper;
+
+import org.springblade.desk.device.pojo.entity.EquipmentEntity;
+import org.springblade.desk.device.pojo.excel.EquipmentExcel;
+import org.springblade.desk.device.pojo.vo.EquipmentVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import java.util.List;
+
+/**
+ * 设备信息表 Mapper 接口
+ *
+ * @author qyl
+ * @since 2025-12-26
+ */
+public interface EquipmentMapper extends BaseMapper
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ *
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ *
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ *
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ *
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ *
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.desk.device.service;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import org.springblade.desk.device.pojo.entity.EquipmentEntity;
+import org.springblade.desk.device.pojo.excel.EquipmentExcel;
+import org.springblade.desk.device.pojo.vo.EquipmentVO;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import java.util.List;
+
+/**
+ * 设备信息表 服务类
+ *
+ * @author qyl
+ * @since 2025-12-26
+ */
+public interface IEquipmentService extends BaseService
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ *
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ *
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ *
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ *
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ *
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.desk.device.service.impl;
+
+import org.springblade.desk.device.pojo.entity.EquipmentEntity;
+import org.springblade.desk.device.pojo.excel.EquipmentExcel;
+import org.springblade.desk.device.pojo.vo.EquipmentVO;
+import org.springblade.desk.device.mapper.EquipmentMapper;
+import org.springblade.desk.device.service.IEquipmentService;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import java.util.List;
+
+/**
+ * 设备信息表 服务实现类
+ *
+ * @author qyl
+ * @since 2025-12-26
+ */
+@Service
+public class EquipmentServiceImpl extends BaseServiceImpl
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ *
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ *
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ *
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ *
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ *
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.desk.device.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.desk.device.pojo.entity.EquipmentEntity;
+import org.springblade.desk.device.pojo.vo.EquipmentVO;
+import java.util.Objects;
+
+/**
+ * 设备信息表 包装类,返回视图层所需的字段
+ *
+ * @author qyl
+ * @since 2025-12-26
+ */
+public class EquipmentWrapper extends BaseEntityWrapper