设备台账表逆向生成代码

develop-QA
qinyulong 4 months ago
parent 3e0fe62616
commit d4ed71c968
  1. 6
      blade-service-api/blade-desk-api/pom.xml
  2. 118
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/device/pojo/entity/EquipmentEntity.java
  3. 146
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/device/pojo/excel/EquipmentExcel.java
  4. 56
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/device/pojo/vo/EquipmentVO.java
  5. 161
      blade-service/blade-desk/src/main/java/org/springblade/desk/device/controller/EquipmentController.java
  6. 63
      blade-service/blade-desk/src/main/java/org/springblade/desk/device/mapper/EquipmentMapper.java
  7. 40
      blade-service/blade-desk/src/main/java/org/springblade/desk/device/mapper/EquipmentMapper.xml
  8. 61
      blade-service/blade-desk/src/main/java/org/springblade/desk/device/service/IEquipmentService.java
  9. 63
      blade-service/blade-desk/src/main/java/org/springblade/desk/device/service/impl/EquipmentServiceImpl.java
  10. 59
      blade-service/blade-desk/src/main/java/org/springblade/desk/device/wrapper/EquipmentWrapper.java

@ -18,6 +18,12 @@
<groupId>org.springblade</groupId>
<artifactId>blade-starter-data-record</artifactId>
</dependency>
<!--excel-->
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-excel</artifactId>
</dependency>
</dependencies>
</project>

@ -0,0 +1,118 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* 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;
}

@ -0,0 +1,146 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* 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;
}

@ -0,0 +1,56 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* 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;
}

@ -0,0 +1,161 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* 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<EquipmentVO> 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<IPage<EquipmentVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> equipment, Query query) {
IPage<EquipmentEntity> 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<IPage<EquipmentVO>> page(EquipmentVO equipment, Query query) {
IPage<EquipmentVO> 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<String, Object> equipment, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<EquipmentEntity> 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<EquipmentExcel> list = equipmentService.exportEquipment(queryWrapper);
ExcelUtil.export(response, "设备信息表数据" + DateUtil.time(), "设备信息表数据表", list, EquipmentExcel.class);
}
}

@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* 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<EquipmentEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param equipment 查询参数
* @return List<EquipmentVO>
*/
List<EquipmentVO> selectEquipmentPage(IPage page, EquipmentVO equipment);
/**
* 获取导出数据
*
* @param queryWrapper 查询条件
* @return List<EquipmentExcel>
*/
List<EquipmentExcel> exportEquipment(@Param("ew") Wrapper<EquipmentEntity> queryWrapper);
}

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.desk.device.mapper.EquipmentMapper">
<!-- 通用查询映射结果 -->
<resultMap id="equipmentResultMap" type="org.springblade.desk.device.pojo.entity.EquipmentEntity">
<result column="ID" property="id"/>
<result column="DEVICE_CODE" property="deviceCode"/>
<result column="DEVICE_NAME" property="deviceName"/>
<result column="TYPE_NAME" property="typeName"/>
<result column="MAC_SPEC" property="macSpec"/>
<result column="USED" property="used"/>
<result column="RF_ID" property="rfId"/>
<result column="VIRTUAL_MAC" property="virtualMac"/>
<result column="DOCKING" property="docking"/>
<result column="MEMO" property="memo"/>
<result column="BIND_QTY" property="bindQty"/>
<result column="CATEGORY" property="category"/>
<result column="DEVICE_IP" property="deviceIp"/>
<result column="CATEGORYS" property="categorys"/>
<result column="CREATE_USER" property="createUser"/>
<result column="CREATE_DEPT" property="createDept"/>
<result column="CREATE_TIME" property="createTime"/>
<result column="UPDATE_USER" property="updateUser"/>
<result column="UPDATE_TIME" property="updateTime"/>
<result column="STATUS" property="status"/>
<result column="IS_DELETED" property="isDeleted"/>
</resultMap>
<select id="selectEquipmentPage" resultMap="equipmentResultMap">
select * from MES_EQUIPMENT where is_deleted = 0
</select>
<select id="exportEquipment" resultType="org.springblade.desk.device.pojo.excel.EquipmentExcel">
SELECT * FROM MES_EQUIPMENT ${ew.customSqlSegment}
</select>
</mapper>

@ -0,0 +1,61 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* 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<EquipmentEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param equipment 查询参数
* @return IPage<EquipmentVO>
*/
IPage<EquipmentVO> selectEquipmentPage(IPage<EquipmentVO> page, EquipmentVO equipment);
/**
* 导出数据
*
* @param queryWrapper 查询条件
* @return List<EquipmentExcel>
*/
List<EquipmentExcel> exportEquipment(Wrapper<EquipmentEntity> queryWrapper);
}

@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* 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<EquipmentMapper, EquipmentEntity> implements IEquipmentService {
@Override
public IPage<EquipmentVO> selectEquipmentPage(IPage<EquipmentVO> page, EquipmentVO equipment) {
return page.setRecords(baseMapper.selectEquipmentPage(page, equipment));
}
@Override
public List<EquipmentExcel> exportEquipment(Wrapper<EquipmentEntity> queryWrapper) {
List<EquipmentExcel> equipmentList = baseMapper.exportEquipment(queryWrapper);
//equipmentList.forEach(equipment -> {
// equipment.setTypeName(DictCache.getValue(DictEnum.YES_NO, Equipment.getType()));
//});
return equipmentList;
}
}

@ -0,0 +1,59 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* 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<EquipmentEntity, EquipmentVO> {
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;
}
}
Loading…
Cancel
Save