parent
364c5e7436
commit
d1a429a024
14 changed files with 11 additions and 498 deletions
@ -1,46 +0,0 @@ |
|||||||
/** |
|
||||||
* 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.produce.pojo.dto; |
|
||||||
|
|
||||||
import lombok.Data; |
|
||||||
import lombok.EqualsAndHashCode; |
|
||||||
import org.springblade.desk.produce.pojo.entity.MesEquipmentCardEntity; |
|
||||||
|
|
||||||
import java.io.Serial; |
|
||||||
|
|
||||||
/** |
|
||||||
* 设备卡片 数据传输对象实体类 |
|
||||||
* |
|
||||||
* @author BladeX |
|
||||||
* @since 2026-02-03 |
|
||||||
*/ |
|
||||||
@Data |
|
||||||
@EqualsAndHashCode(callSuper = true) |
|
||||||
public class MesEquipmentCardDTO extends MesEquipmentCardEntity { |
|
||||||
@Serial |
|
||||||
private static final long serialVersionUID = 1L; |
|
||||||
|
|
||||||
} |
|
||||||
@ -1,110 +0,0 @@ |
|||||||
package org.springblade.desk.produce.pojo.entity; |
|
||||||
|
|
||||||
import lombok.Data; |
|
||||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||||
import com.baomidou.mybatisplus.annotation.TableName; |
|
||||||
import java.math.BigDecimal; |
|
||||||
import java.util.Date; |
|
||||||
import lombok.EqualsAndHashCode; |
|
||||||
import org.springblade.core.mp.base.BaseEntity; |
|
||||||
import org.springblade.core.tenant.mp.TenantEntity; |
|
||||||
import java.io.Serial; |
|
||||||
import java.util.HashMap; |
|
||||||
import java.util.Map; |
|
||||||
|
|
||||||
/** |
|
||||||
* 设备卡片 实体类 |
|
||||||
* |
|
||||||
* @author BladeX |
|
||||||
* @since 2026-02-03 |
|
||||||
*/ |
|
||||||
@Data |
|
||||||
@TableName("MES_EQUIPMENT_CARD") |
|
||||||
@Schema(description = "MesEquipmentCard对象") |
|
||||||
@EqualsAndHashCode(callSuper = true) |
|
||||||
public class MesEquipmentCardEntity 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、服役中,3、暂停服役 |
|
||||||
*/ |
|
||||||
@Schema(description = "服役状态 1、正常服役,2、服役中,3、暂停服役") |
|
||||||
private Long used; |
|
||||||
/** |
|
||||||
* RFID |
|
||||||
*/ |
|
||||||
@Schema(description = "RFID") |
|
||||||
private String rfId; |
|
||||||
/** |
|
||||||
* 虚拟设备:0、否; 1、是 |
|
||||||
*/ |
|
||||||
@Schema(description = "虚拟设备:0、否; 1、是") |
|
||||||
private Boolean virtualMac=false; |
|
||||||
/** |
|
||||||
* 是否对接 |
|
||||||
*/ |
|
||||||
@Schema(description = "是否对接") |
|
||||||
private boolean docking=false; |
|
||||||
/** |
|
||||||
* 类别说明 |
|
||||||
*/ |
|
||||||
@Schema(description = "类别说明") |
|
||||||
private String memo; |
|
||||||
/** |
|
||||||
* 绑定数量 |
|
||||||
*/ |
|
||||||
@Schema(description = "绑定数量") |
|
||||||
private Integer bindQty=0; |
|
||||||
/** |
|
||||||
* 设备分类 |
|
||||||
*/ |
|
||||||
@Schema(description = "设备分类") |
|
||||||
private String categorys; |
|
||||||
/** |
|
||||||
* 设备IP |
|
||||||
*/ |
|
||||||
@Schema(description = "设备IP") |
|
||||||
private String deviceIp; |
|
||||||
/** |
|
||||||
* 正常服役 |
|
||||||
*/ |
|
||||||
public static Short USED_OK = 1; |
|
||||||
/** |
|
||||||
* 服役中 |
|
||||||
*/ |
|
||||||
public static Short USED_AFOOT = 2; |
|
||||||
/** |
|
||||||
* 暂停服役 |
|
||||||
*/ |
|
||||||
public static Short USED_PAUSE = 3; |
|
||||||
|
|
||||||
public static Map<Short, String> usedMap = new HashMap<Short, String>(); |
|
||||||
|
|
||||||
static { |
|
||||||
usedMap.put(USED_OK, "正常服役"); |
|
||||||
usedMap.put(USED_AFOOT, "服役中"); |
|
||||||
usedMap.put(USED_PAUSE, "暂停服役"); |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,46 +0,0 @@ |
|||||||
/** |
|
||||||
* 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.produce.pojo.vo; |
|
||||||
|
|
||||||
import lombok.Data; |
|
||||||
import lombok.EqualsAndHashCode; |
|
||||||
import org.springblade.desk.produce.pojo.entity.MesEquipmentCardEntity; |
|
||||||
|
|
||||||
import java.io.Serial; |
|
||||||
|
|
||||||
/** |
|
||||||
* 设备卡片 视图实体类 |
|
||||||
* |
|
||||||
* @author BladeX |
|
||||||
* @since 2026-02-03 |
|
||||||
*/ |
|
||||||
@Data |
|
||||||
@EqualsAndHashCode(callSuper = true) |
|
||||||
public class MesEquipmentCardVO extends MesEquipmentCardEntity { |
|
||||||
@Serial |
|
||||||
private static final long serialVersionUID = 1L; |
|
||||||
|
|
||||||
} |
|
||||||
@ -1,109 +0,0 @@ |
|||||||
package org.springblade.desk.produce.controller; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
||||||
import io.swagger.v3.oas.annotations.Operation; |
|
||||||
import io.swagger.v3.oas.annotations.Parameter; |
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag; |
|
||||||
import jakarta.validation.Valid; |
|
||||||
import lombok.AllArgsConstructor; |
|
||||||
import org.springblade.core.boot.ctrl.BladeController; |
|
||||||
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.produce.pojo.entity.MesEquipmentCardEntity; |
|
||||||
import org.springblade.desk.produce.pojo.vo.MesEquipmentCardVO; |
|
||||||
import org.springblade.desk.produce.service.IMesEquipmentCardService; |
|
||||||
import org.springblade.desk.produce.wrapper.MesEquipmentCardWrapper; |
|
||||||
import org.springframework.web.bind.annotation.*; |
|
||||||
|
|
||||||
import java.util.Map; |
|
||||||
|
|
||||||
/** |
|
||||||
* 设备卡片 控制器 |
|
||||||
* |
|
||||||
* @author BladeX |
|
||||||
* @since 2026-02-03 |
|
||||||
*/ |
|
||||||
@RestController |
|
||||||
@AllArgsConstructor |
|
||||||
@RequestMapping("/mesEquipmentCard") |
|
||||||
@Tag(name = "设备卡片", description = "设备卡片接口") |
|
||||||
public class MesEquipmentCardController extends BladeController { |
|
||||||
|
|
||||||
private final IMesEquipmentCardService mesEquipmentCardService; |
|
||||||
|
|
||||||
/** |
|
||||||
* 设备卡片 详情 |
|
||||||
*/ |
|
||||||
@GetMapping("/detail") |
|
||||||
@ApiOperationSupport(order = 1) |
|
||||||
@Operation(summary = "详情", description = "传入mesEquipmentCard") |
|
||||||
public R<MesEquipmentCardVO> detail(MesEquipmentCardEntity mesEquipmentCard) { |
|
||||||
MesEquipmentCardEntity detail = mesEquipmentCardService.getOne(Condition.getQueryWrapper(mesEquipmentCard)); |
|
||||||
return R.data(MesEquipmentCardWrapper.build().entityVO(detail)); |
|
||||||
} |
|
||||||
/** |
|
||||||
* 设备卡片 分页 |
|
||||||
*/ |
|
||||||
@GetMapping("/list") |
|
||||||
@ApiOperationSupport(order = 2) |
|
||||||
@Operation(summary = "分页", description = "传入mesEquipmentCard") |
|
||||||
public R<IPage<MesEquipmentCardVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> mesEquipmentCard, Query query) { |
|
||||||
IPage<MesEquipmentCardEntity> pages = mesEquipmentCardService.page(Condition.getPage(query), Condition.getQueryWrapper(mesEquipmentCard, MesEquipmentCardEntity.class)); |
|
||||||
return R.data(MesEquipmentCardWrapper.build().pageVO(pages)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 设备卡片 自定义分页 |
|
||||||
*/ |
|
||||||
@GetMapping("/page") |
|
||||||
@ApiOperationSupport(order = 3) |
|
||||||
@Operation(summary = "分页", description = "传入mesEquipmentCard") |
|
||||||
public R<IPage<MesEquipmentCardVO>> page(MesEquipmentCardVO mesEquipmentCard, Query query) { |
|
||||||
IPage<MesEquipmentCardVO> pages = mesEquipmentCardService.selectMesEquipmentCardPage(Condition.getPage(query), mesEquipmentCard); |
|
||||||
return R.data(pages); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 设备卡片 新增 |
|
||||||
*/ |
|
||||||
@PostMapping("/save") |
|
||||||
@ApiOperationSupport(order = 4) |
|
||||||
@Operation(summary = "新增", description = "传入mesEquipmentCard") |
|
||||||
public R save(@Valid @RequestBody MesEquipmentCardEntity mesEquipmentCard) { |
|
||||||
return R.status(mesEquipmentCardService.save(mesEquipmentCard)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 设备卡片 修改 |
|
||||||
*/ |
|
||||||
@PostMapping("/update") |
|
||||||
@ApiOperationSupport(order = 5) |
|
||||||
@Operation(summary = "修改", description = "传入mesEquipmentCard") |
|
||||||
public R update(@Valid @RequestBody MesEquipmentCardEntity mesEquipmentCard) { |
|
||||||
return R.status(mesEquipmentCardService.updateById(mesEquipmentCard)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 设备卡片 新增或修改 |
|
||||||
*/ |
|
||||||
@PostMapping("/submit") |
|
||||||
@ApiOperationSupport(order = 6) |
|
||||||
@Operation(summary = "新增或修改", description = "传入mesEquipmentCard") |
|
||||||
public R submit(@Valid @RequestBody MesEquipmentCardEntity mesEquipmentCard) { |
|
||||||
return R.status(mesEquipmentCardService.saveOrUpdate(mesEquipmentCard)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 设备卡片 删除 |
|
||||||
*/ |
|
||||||
@PostMapping("/remove") |
|
||||||
@ApiOperationSupport(order = 7) |
|
||||||
@Operation(summary = "逻辑删除", description = "传入ids") |
|
||||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { |
|
||||||
return R.status(mesEquipmentCardService.deleteLogic(Func.toLongList(ids))); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
@ -1,34 +0,0 @@ |
|||||||
<?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.produce.mapper.MesEquipmentCardMapper"> |
|
||||||
|
|
||||||
<!-- 通用查询映射结果 --> |
|
||||||
<resultMap id="mesEquipmentCardResultMap" type="org.springblade.desk.produce.pojo.entity.MesEquipmentCardEntity"> |
|
||||||
<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="CATEGORYS" property="categorys"/> |
|
||||||
<result column="DEVICE_IP" property="deviceIp"/> |
|
||||||
<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="selectMesEquipmentCardPage" resultMap="mesEquipmentCardResultMap"> |
|
||||||
select * from MES_EQUIPMENT_CARD where is_deleted = 0 |
|
||||||
</select> |
|
||||||
|
|
||||||
</mapper> |
|
||||||
@ -1,31 +0,0 @@ |
|||||||
package org.springblade.desk.produce.mapper; |
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
||||||
import org.springblade.desk.produce.pojo.entity.MesEquipmentCardEntity; |
|
||||||
import org.springblade.desk.produce.pojo.vo.MesEquipmentCardVO; |
|
||||||
|
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* 设备卡片 Mapper 接口 |
|
||||||
* |
|
||||||
* @author BladeX |
|
||||||
* @since 2026-02-03 |
|
||||||
*/ |
|
||||||
public interface MesEquipmentCardMapper extends BaseMapper<MesEquipmentCardEntity> { |
|
||||||
|
|
||||||
/** |
|
||||||
* 自定义分页 |
|
||||||
* |
|
||||||
* @param page 分页参数 |
|
||||||
* @param mesEquipmentCard 查询参数 |
|
||||||
* @return List<MesEquipmentCardVO> |
|
||||||
*/ |
|
||||||
List<MesEquipmentCardVO> selectMesEquipmentCardPage(IPage page, MesEquipmentCardVO mesEquipmentCard); |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} |
|
||||||
@ -1,29 +0,0 @@ |
|||||||
package org.springblade.desk.produce.service; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
||||||
import org.springblade.core.mp.base.BaseService; |
|
||||||
import org.springblade.desk.produce.pojo.entity.MesEquipmentCardEntity; |
|
||||||
import org.springblade.desk.produce.pojo.vo.MesEquipmentCardVO; |
|
||||||
|
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* 设备卡片 服务类 |
|
||||||
* |
|
||||||
* @author BladeX |
|
||||||
* @since 2026-02-03 |
|
||||||
*/ |
|
||||||
public interface IMesEquipmentCardService extends BaseService<MesEquipmentCardEntity> { |
|
||||||
/** |
|
||||||
* 自定义分页 |
|
||||||
* |
|
||||||
* @param page 分页参数 |
|
||||||
* @param mesEquipmentCard 查询参数 |
|
||||||
* @return IPage<MesEquipmentCardVO> |
|
||||||
*/ |
|
||||||
IPage<MesEquipmentCardVO> selectMesEquipmentCardPage(IPage<MesEquipmentCardVO> page, MesEquipmentCardVO mesEquipmentCard); |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} |
|
||||||
@ -1,27 +0,0 @@ |
|||||||
package org.springblade.desk.produce.service.impl; |
|
||||||
|
|
||||||
import org.springblade.desk.produce.mapper.MesEquipmentCardMapper; |
|
||||||
import org.springblade.desk.produce.pojo.entity.MesEquipmentCardEntity; |
|
||||||
import org.springblade.desk.produce.pojo.vo.MesEquipmentCardVO; |
|
||||||
import org.springblade.desk.produce.service.IMesEquipmentCardService; |
|
||||||
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 BladeX |
|
||||||
* @since 2026-02-03 |
|
||||||
*/ |
|
||||||
@Service |
|
||||||
public class MesEquipmentCardServiceImpl extends BaseServiceImpl<MesEquipmentCardMapper, MesEquipmentCardEntity> implements IMesEquipmentCardService { |
|
||||||
|
|
||||||
@Override |
|
||||||
public IPage<MesEquipmentCardVO> selectMesEquipmentCardPage(IPage<MesEquipmentCardVO> page, MesEquipmentCardVO mesEquipmentCard) { |
|
||||||
return page.setRecords(baseMapper.selectMesEquipmentCardPage(page, mesEquipmentCard)); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
@ -1,35 +0,0 @@ |
|||||||
package org.springblade.desk.produce.wrapper; |
|
||||||
|
|
||||||
import org.springblade.core.mp.support.BaseEntityWrapper; |
|
||||||
import org.springblade.core.tool.utils.BeanUtil; |
|
||||||
import org.springblade.desk.produce.pojo.entity.MesEquipmentCardEntity; |
|
||||||
import org.springblade.desk.produce.pojo.vo.MesEquipmentCardVO; |
|
||||||
|
|
||||||
import java.util.Objects; |
|
||||||
|
|
||||||
/** |
|
||||||
* 设备卡片 包装类,返回视图层所需的字段 |
|
||||||
* |
|
||||||
* @author BladeX |
|
||||||
* @since 2026-02-03 |
|
||||||
*/ |
|
||||||
public class MesEquipmentCardWrapper extends BaseEntityWrapper<MesEquipmentCardEntity, MesEquipmentCardVO> { |
|
||||||
|
|
||||||
public static MesEquipmentCardWrapper build() { |
|
||||||
return new MesEquipmentCardWrapper(); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public MesEquipmentCardVO entityVO(MesEquipmentCardEntity mesEquipmentCard) { |
|
||||||
MesEquipmentCardVO mesEquipmentCardVO = Objects.requireNonNull(BeanUtil.copyProperties(mesEquipmentCard, MesEquipmentCardVO.class)); |
|
||||||
|
|
||||||
//User createUser = UserCache.getUser(mesEquipmentCard.getCreateUser());
|
|
||||||
//User updateUser = UserCache.getUser(mesEquipmentCard.getUpdateUser());
|
|
||||||
//mesEquipmentCardVO.setCreateUserName(createUser.getName());
|
|
||||||
//mesEquipmentCardVO.setUpdateUserName(updateUser.getName());
|
|
||||||
|
|
||||||
return mesEquipmentCardVO; |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
} |
|
||||||
Loading…
Reference in new issue