From d4ed71c968871b54adc53e25d5d3de398d2bf2a4 Mon Sep 17 00:00:00 2001 From: qinyulong Date: Mon, 29 Dec 2025 10:21:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=8F=B0=E8=B4=A6=E8=A1=A8?= =?UTF-8?q?=E9=80=86=E5=90=91=E7=94=9F=E6=88=90=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blade-service-api/blade-desk-api/pom.xml | 6 + .../device/pojo/entity/EquipmentEntity.java | 118 +++++++++++++ .../device/pojo/excel/EquipmentExcel.java | 146 ++++++++++++++++ .../desk/device/pojo/vo/EquipmentVO.java | 56 ++++++ .../controller/EquipmentController.java | 161 ++++++++++++++++++ .../desk/device/mapper/EquipmentMapper.java | 63 +++++++ .../desk/device/mapper/EquipmentMapper.xml | 40 +++++ .../device/service/IEquipmentService.java | 61 +++++++ .../service/impl/EquipmentServiceImpl.java | 63 +++++++ .../desk/device/wrapper/EquipmentWrapper.java | 59 +++++++ 10 files changed, 773 insertions(+) create mode 100644 blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/device/pojo/entity/EquipmentEntity.java create mode 100644 blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/device/pojo/excel/EquipmentExcel.java create mode 100644 blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/device/pojo/vo/EquipmentVO.java create mode 100644 blade-service/blade-desk/src/main/java/org/springblade/desk/device/controller/EquipmentController.java create mode 100644 blade-service/blade-desk/src/main/java/org/springblade/desk/device/mapper/EquipmentMapper.java create mode 100644 blade-service/blade-desk/src/main/java/org/springblade/desk/device/mapper/EquipmentMapper.xml create mode 100644 blade-service/blade-desk/src/main/java/org/springblade/desk/device/service/IEquipmentService.java create mode 100644 blade-service/blade-desk/src/main/java/org/springblade/desk/device/service/impl/EquipmentServiceImpl.java create mode 100644 blade-service/blade-desk/src/main/java/org/springblade/desk/device/wrapper/EquipmentWrapper.java 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 @@ org.springblade blade-starter-data-record + + + + org.springblade + blade-starter-excel + diff --git a/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/device/pojo/entity/EquipmentEntity.java b/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/device/pojo/entity/EquipmentEntity.java new file mode 100644 index 00000000..90350af0 --- /dev/null +++ b/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/device/pojo/entity/EquipmentEntity.java @@ -0,0 +1,118 @@ +/** + * 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.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 detail(EquipmentEntity equipment) { + EquipmentEntity detail = equipmentService.getOne(Condition.getQueryWrapper(equipment)); + return R.data(EquipmentWrapper.build().entityVO(detail)); + } + /** + * 设备信息表 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @Operation(summary = "分页", description = "传入equipment") + public R> list(@Parameter(hidden = true) @RequestParam Map equipment, Query query) { + IPage pages = equipmentService.page(Condition.getPage(query), Condition.getQueryWrapper(equipment, EquipmentEntity.class)); + return R.data(EquipmentWrapper.build().pageVO(pages)); + } + + /** + * 设备信息表 自定义分页 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @Operation(summary = "分页", description = "传入equipment") + public R> page(EquipmentVO equipment, Query query) { + IPage pages = equipmentService.selectEquipmentPage(Condition.getPage(query), equipment); + return R.data(pages); + } + + /** + * 设备信息表 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @Operation(summary = "新增", description = "传入equipment") + public R save(@Valid @RequestBody EquipmentEntity equipment) { + return R.status(equipmentService.save(equipment)); + } + + /** + * 设备信息表 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @Operation(summary = "修改", description = "传入equipment") + public R update(@Valid @RequestBody EquipmentEntity equipment) { + return R.status(equipmentService.updateById(equipment)); + } + + /** + * 设备信息表 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @Operation(summary = "新增或修改", description = "传入equipment") + public R submit(@Valid @RequestBody EquipmentEntity equipment) { + return R.status(equipmentService.saveOrUpdate(equipment)); + } + + /** + * 设备信息表 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @Operation(summary = "逻辑删除", description = "传入ids") + public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { + return R.status(equipmentService.deleteLogic(Func.toLongList(ids))); + } + + + /** + * 导出数据 + */ + @IsAdmin + @GetMapping("/export-equipment") + @ApiOperationSupport(order = 9) + @Operation(summary = "导出数据", description = "传入equipment") + public void exportEquipment(@Parameter(hidden = true) @RequestParam Map equipment, BladeUser bladeUser, HttpServletResponse response) { + QueryWrapper queryWrapper = Condition.getQueryWrapper(equipment, EquipmentEntity.class); + //if (!AuthUtil.isAdministrator()) { + // queryWrapper.lambda().eq(Equipment::getTenantId, bladeUser.getTenantId()); + //} + //queryWrapper.lambda().eq(EquipmentEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); + List list = equipmentService.exportEquipment(queryWrapper); + ExcelUtil.export(response, "设备信息表数据" + DateUtil.time(), "设备信息表数据表", list, EquipmentExcel.class); + } + +} diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/device/mapper/EquipmentMapper.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/device/mapper/EquipmentMapper.java new file mode 100644 index 00000000..b879fc4f --- /dev/null +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/device/mapper/EquipmentMapper.java @@ -0,0 +1,63 @@ +/** + * 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.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 { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param equipment 查询参数 + * @return List + */ + List selectEquipmentPage(IPage page, EquipmentVO equipment); + + + /** + * 获取导出数据 + * + * @param queryWrapper 查询条件 + * @return List + */ + List exportEquipment(@Param("ew") Wrapper queryWrapper); + +} diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/device/mapper/EquipmentMapper.xml b/blade-service/blade-desk/src/main/java/org/springblade/desk/device/mapper/EquipmentMapper.xml new file mode 100644 index 00000000..538c8478 --- /dev/null +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/device/mapper/EquipmentMapper.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/device/service/IEquipmentService.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/device/service/IEquipmentService.java new file mode 100644 index 00000000..94a1c7d7 --- /dev/null +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/device/service/IEquipmentService.java @@ -0,0 +1,61 @@ +/** + * 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.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 { + /** + * 自定义分页 + * + * @param page 分页参数 + * @param equipment 查询参数 + * @return IPage + */ + IPage selectEquipmentPage(IPage page, EquipmentVO equipment); + + + /** + * 导出数据 + * + * @param queryWrapper 查询条件 + * @return List + */ + List exportEquipment(Wrapper queryWrapper); + +} diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/device/service/impl/EquipmentServiceImpl.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/device/service/impl/EquipmentServiceImpl.java new file mode 100644 index 00000000..809b3ed5 --- /dev/null +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/device/service/impl/EquipmentServiceImpl.java @@ -0,0 +1,63 @@ +/** + * 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.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 implements IEquipmentService { + + @Override + public IPage selectEquipmentPage(IPage page, EquipmentVO equipment) { + return page.setRecords(baseMapper.selectEquipmentPage(page, equipment)); + } + + + @Override + public List exportEquipment(Wrapper queryWrapper) { + List equipmentList = baseMapper.exportEquipment(queryWrapper); + //equipmentList.forEach(equipment -> { + // equipment.setTypeName(DictCache.getValue(DictEnum.YES_NO, Equipment.getType())); + //}); + return equipmentList; + } + +} diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/device/wrapper/EquipmentWrapper.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/device/wrapper/EquipmentWrapper.java new file mode 100644 index 00000000..932087ec --- /dev/null +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/device/wrapper/EquipmentWrapper.java @@ -0,0 +1,59 @@ +/** + * 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.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 { + + public static EquipmentWrapper build() { + return new EquipmentWrapper(); + } + + @Override + public EquipmentVO entityVO(EquipmentEntity equipment) { + EquipmentVO equipmentVO = Objects.requireNonNull(BeanUtil.copyProperties(equipment, EquipmentVO.class)); + + //User createUser = UserCache.getUser(equipment.getCreateUser()); + //User updateUser = UserCache.getUser(equipment.getUpdateUser()); + //equipmentVO.setCreateUserName(createUser.getName()); + //equipmentVO.setUpdateUserName(updateUser.getName()); + + return equipmentVO; + } + + +}