From fbb48357d807b6e776821decacda68af6b2cc6aa Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Fri, 09 Jan 2026 14:02:53 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceTrackController.java | 6
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/excel/FwDeviceMaintainPlanExcel.java | 21 +-
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceMaintainPlanVO.java | 89 ++++++++++
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMaintainPlanMapper.java | 14 +
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceMaintainPlanService.java | 15 +
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceMaintainPlanDTO.java | 43 ++++
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceMaintainPlanServiceImpl.java | 13 +
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/entity/FwDeviceMaintainPlanEntity.java | 28 +-
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceMaintainPlanController.java | 91 ++++-------
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceVO.java | 4
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMaintainPlanMapper.xml | 100 +++++++-----
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/wrapper/FwDeviceMaintainPlanWrapper.java | 16 +-
12 files changed, 285 insertions(+), 155 deletions(-)
diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceMaintainPlanController.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceMaintainPlanController.java
index 8110269..89644b3 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceMaintainPlanController.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceMaintainPlanController.java
@@ -16,40 +16,41 @@
*/
package org.sxkj.fw.device.controller;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
-import javax.validation.Valid;
-
-import org.springblade.core.secure.BladeUser;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.constant.BladeConstant;
+import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.sxkj.fw.device.dto.FwDeviceMaintainPlanDTO;
import org.sxkj.fw.device.entity.FwDeviceMaintainPlanEntity;
-import org.sxkj.fw.device.vo.FwDeviceMaintainPlanVO;
import org.sxkj.fw.device.excel.FwDeviceMaintainPlanExcel;
-import org.sxkj.fw.device.wrapper.FwDeviceMaintainPlanWrapper;
import org.sxkj.fw.device.service.IFwDeviceMaintainPlanService;
-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 org.sxkj.fw.device.vo.FwDeviceMaintainPlanVO;
+import org.sxkj.fw.device.wrapper.FwDeviceMaintainPlanWrapper;
import springfox.documentation.annotations.ApiIgnore;
-import java.util.Map;
-import java.util.List;
+
import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
/**
* 设备维护计划表 控制器
*
- * @author lw
- * @since 2026-01-08
+ * @author Aix
+ * @since 2026-01-09
*/
@RestController
@AllArgsConstructor
@@ -65,67 +66,44 @@
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入fwDeviceMaintainPlan")
- public R<FwDeviceMaintainPlanVO> detail(FwDeviceMaintainPlanEntity fwDeviceMaintainPlan) {
- FwDeviceMaintainPlanEntity detail = fwDeviceMaintainPlanService.getOne(Condition.getQueryWrapper(fwDeviceMaintainPlan));
- return R.data(FwDeviceMaintainPlanWrapper.build().entityVO(detail));
- }
- /**
- * 设备维护计划表 分页
- */
- @GetMapping("/list")
- @ApiOperationSupport(order = 2)
- @ApiOperation(value = "分页", notes = "传入fwDeviceMaintainPlan")
- public R<IPage<FwDeviceMaintainPlanVO>> list(@ApiIgnore @RequestParam Map<String, Object> fwDeviceMaintainPlan, Query query) {
- IPage<FwDeviceMaintainPlanEntity> pages = fwDeviceMaintainPlanService.page(Condition.getPage(query), Condition.getQueryWrapper(fwDeviceMaintainPlan, FwDeviceMaintainPlanEntity.class));
- return R.data(FwDeviceMaintainPlanWrapper.build().pageVO(pages));
+ public R<FwDeviceMaintainPlanVO> detail(FwDeviceMaintainPlanDTO fwDeviceMaintainPlan) {
+ if (fwDeviceMaintainPlan.getId() == null) {
+ return R.fail("参数错误");
+ }
+
+ FwDeviceMaintainPlanVO detailVO = fwDeviceMaintainPlanService.getFwDeviceMaintainPlanById(fwDeviceMaintainPlan.getId());
+ if (detailVO == null) {
+ return R.fail("数据不存在");
+ }
+ return R.data(detailVO);
}
/**
* 设备维护计划表 自定义分页
*/
@GetMapping("/page")
- @ApiOperationSupport(order = 3)
+ @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入fwDeviceMaintainPlan")
- public R<IPage<FwDeviceMaintainPlanVO>> page(FwDeviceMaintainPlanVO fwDeviceMaintainPlan, Query query) {
+ public R<IPage<FwDeviceMaintainPlanVO>> page(FwDeviceMaintainPlanDTO fwDeviceMaintainPlan, Query query) {
IPage<FwDeviceMaintainPlanVO> pages = fwDeviceMaintainPlanService.selectFwDeviceMaintainPlanPage(Condition.getPage(query), fwDeviceMaintainPlan);
return R.data(pages);
- }
-
- /**
- * 设备维护计划表 新增
- */
- @PostMapping("/save")
- @ApiOperationSupport(order = 4)
- @ApiOperation(value = "新增", notes = "传入fwDeviceMaintainPlan")
- public R save(@Valid @RequestBody FwDeviceMaintainPlanEntity fwDeviceMaintainPlan) {
- return R.status(fwDeviceMaintainPlanService.save(fwDeviceMaintainPlan));
- }
-
- /**
- * 设备维护计划表 修改
- */
- @PostMapping("/update")
- @ApiOperationSupport(order = 5)
- @ApiOperation(value = "修改", notes = "传入fwDeviceMaintainPlan")
- public R update(@Valid @RequestBody FwDeviceMaintainPlanEntity fwDeviceMaintainPlan) {
- return R.status(fwDeviceMaintainPlanService.updateById(fwDeviceMaintainPlan));
}
/**
* 设备维护计划表 新增或修改
*/
@PostMapping("/submit")
- @ApiOperationSupport(order = 6)
+ @ApiOperationSupport(order = 3)
@ApiOperation(value = "新增或修改", notes = "传入fwDeviceMaintainPlan")
- public R submit(@Valid @RequestBody FwDeviceMaintainPlanEntity fwDeviceMaintainPlan) {
- return R.status(fwDeviceMaintainPlanService.saveOrUpdate(fwDeviceMaintainPlan));
+ public R submit(@Valid @RequestBody FwDeviceMaintainPlanDTO fwDeviceMaintainPlan) {
+ return R.status(fwDeviceMaintainPlanService.saveOrUpdate(FwDeviceMaintainPlanWrapper.build().entityDTO(fwDeviceMaintainPlan)));
}
/**
* 设备维护计划表 删除
*/
@PostMapping("/remove")
- @ApiOperationSupport(order = 7)
+ @ApiOperationSupport(order = 4)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(fwDeviceMaintainPlanService.deleteLogic(Func.toLongList(ids)));
@@ -136,8 +114,9 @@
* 导出数据
*/
@GetMapping("/export-fwDeviceMaintainPlan")
- @ApiOperationSupport(order = 9)
+ @ApiOperationSupport(order = 5)
@ApiOperation(value = "导出数据", notes = "传入fwDeviceMaintainPlan")
+ @ApiIgnore
public void exportFwDeviceMaintainPlan(@ApiIgnore @RequestParam Map<String, Object> fwDeviceMaintainPlan, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<FwDeviceMaintainPlanEntity> queryWrapper = Condition.getQueryWrapper(fwDeviceMaintainPlan, FwDeviceMaintainPlanEntity.class);
//if (!AuthUtil.isAdministrator()) {
diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceTrackController.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceTrackController.java
index 488286e..a6bed6a 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceTrackController.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceTrackController.java
@@ -32,6 +32,7 @@
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.*;
import org.sxkj.fw.device.dto.FwDeviceTrackDTO;
import org.sxkj.fw.device.entity.FwDeviceTrackEntity;
@@ -94,6 +95,11 @@
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入fwDeviceTrack")
public R submit(@Valid @RequestBody FwDeviceTrackDTO fwDeviceTrack) {
+
+ if (null != fwDeviceTrack.getDeviceId()) {
+ return R.fail("设备ID不能为空");
+ }
+
return R.status(fwDeviceTrackService.saveOrUpdate(FwDeviceTrackWrapper.build().entityDTO(fwDeviceTrack)));
}
diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceMaintainPlanDTO.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceMaintainPlanDTO.java
index 5a75f2a..11a7e54 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceMaintainPlanDTO.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceMaintainPlanDTO.java
@@ -16,19 +16,50 @@
*/
package org.sxkj.fw.device.dto;
-import org.sxkj.fw.device.entity.FwDeviceMaintainPlanEntity;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
-import lombok.EqualsAndHashCode;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.List;
/**
* 设备维护计划表 数据传输对象实体类
*
- * @author lw
- * @since 2026-01-08
+ * @author Aix
+ * @since 2026-01-09
*/
@Data
-@EqualsAndHashCode(callSuper = true)
-public class FwDeviceMaintainPlanDTO extends FwDeviceMaintainPlanEntity {
+public class FwDeviceMaintainPlanDTO implements Serializable {
+
private static final long serialVersionUID = 1L;
+ @ApiModelProperty(value = "主键")
+ private Long id;
+
+ /**
+ * 设备ID
+ */
+ @ApiModelProperty(value = "设备ID")
+ @NotNull
+ private Long deviceId;
+ /**
+ * 计划周期(每年、每月、每周)
+ */
+ @ApiModelProperty(value = "计划周期(1:每年、2:每月、3:每周)")
+ private String planCycleType;
+ /**
+ * 计划周期具体值,数组对象[1,2,3]
+ */
+ @ApiModelProperty(value = "计划周期具体值,数组对象[1,2,3]")
+ private List<String> planCycleValue;
+
+ // 查询使用
+ @ApiModelProperty(value = "设备名称")
+ private String deviceName;
+ @ApiModelProperty(value = "设备类型")
+ private String deviceType;
+ @ApiModelProperty(value = "所属部门")
+ private Long belongDept;
+
}
diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/entity/FwDeviceMaintainPlanEntity.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/entity/FwDeviceMaintainPlanEntity.java
index 5e24400..e521e73 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/entity/FwDeviceMaintainPlanEntity.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/entity/FwDeviceMaintainPlanEntity.java
@@ -16,24 +16,25 @@
*/
package org.sxkj.fw.device.entity;
-import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
-import java.time.LocalDate;
+import java.util.List;
/**
* 设备维护计划表 实体类
*
- * @author lw
- * @since 2026-01-08
+ * @author Aix
+ * @since 2026-01-09
*/
@Data
-@TableName("ja_fw_device_maintain_plan")
+@TableName(value ="ja_fw_device_maintain_plan", autoResultMap = true)
@ApiModel(value = "FwDeviceMaintainPlan对象", description = "设备维护计划表")
@EqualsAndHashCode(callSuper = true)
public class FwDeviceMaintainPlanEntity extends BaseEntity {
@@ -41,25 +42,22 @@
/**
* 设备ID
*/
- @TableField("device_id")
@ApiModelProperty(value = "设备ID")
private Long deviceId;
/**
- * 计划周期(每月1日/每季1日等)
+ * 计划周期(每年、每月、每周)
*/
- @TableField("plan_cycle")
- @ApiModelProperty(value = "计划周期(每月1日/每季1日等)")
- private String planCycle;
+ @ApiModelProperty(value = "计划周期(每年、每月、每周)")
+ private String planCycleType;
/**
- * 计划日期(YYYY-MM-DD)
+ * 计划周期具体值,数组对象[1,2,3]
*/
- @TableField("plan_time")
- @ApiModelProperty(value = "计划日期(YYYY-MM-DD)")
- private LocalDate planTime;
+ @ApiModelProperty(value = "计划周期具体值,数组对象[1,2,3]")
+ @TableField(typeHandler = FastjsonTypeHandler.class)
+ private List<String> planCycleValue;
/**
* 区域编码
*/
- @TableField("area_code")
@ApiModelProperty(value = "区域编码")
private String areaCode;
diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/excel/FwDeviceMaintainPlanExcel.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/excel/FwDeviceMaintainPlanExcel.java
index 317a02a..3393c2d 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/excel/FwDeviceMaintainPlanExcel.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/excel/FwDeviceMaintainPlanExcel.java
@@ -17,21 +17,20 @@
package org.sxkj.fw.device.excel;
+import lombok.Data;
+
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.Serializable;
-import java.time.LocalDate;
/**
* 设备维护计划表 Excel实体类
*
- * @author lw
- * @since 2026-01-08
+ * @author Aix
+ * @since 2026-01-09
*/
@Data
@ColumnWidth(25)
@@ -48,17 +47,17 @@
@ExcelProperty("设备ID")
private Long deviceId;
/**
- * 计划周期(每月1日/每季1日等)
+ * 计划周期(每年、每月、每周)
*/
@ColumnWidth(20)
- @ExcelProperty("计划周期(每月1日/每季1日等)")
- private String planCycle;
+ @ExcelProperty("计划周期(每年、每月、每周)")
+ private String planCycleType;
/**
- * 计划日期(YYYY-MM-DD)
+ * 计划周期具体值,数组对象[1,2,3]
*/
@ColumnWidth(20)
- @ExcelProperty("计划日期(YYYY-MM-DD)")
- private LocalDate planTime;
+ @ExcelProperty("计划周期具体值,数组对象[1,2,3]")
+ private String planCycleValue;
/**
* 区域编码
*/
diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMaintainPlanMapper.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMaintainPlanMapper.java
index 0d1c8be..c63f0cc 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMaintainPlanMapper.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMaintainPlanMapper.java
@@ -16,6 +16,7 @@
*/
package org.sxkj.fw.device.mapper;
+import org.sxkj.fw.device.dto.FwDeviceMaintainPlanDTO;
import org.sxkj.fw.device.entity.FwDeviceMaintainPlanEntity;
import org.sxkj.fw.device.vo.FwDeviceMaintainPlanVO;
import org.sxkj.fw.device.excel.FwDeviceMaintainPlanExcel;
@@ -28,10 +29,17 @@
/**
* 设备维护计划表 Mapper 接口
*
- * @author lw
- * @since 2026-01-08
+ * @author Aix
+ * @since 2026-01-09
*/
public interface FwDeviceMaintainPlanMapper extends BaseMapper<FwDeviceMaintainPlanEntity> {
+
+ /**
+ * 获取详情
+ * @param id 计划id
+ * @return 计划详情
+ */
+ FwDeviceMaintainPlanVO getFwDeviceMaintainPlanById(@Param("id") Long id);
/**
* 自定义分页
@@ -40,7 +48,7 @@
* @param fwDeviceMaintainPlan
* @return
*/
- List<FwDeviceMaintainPlanVO> selectFwDeviceMaintainPlanPage(IPage page, FwDeviceMaintainPlanVO fwDeviceMaintainPlan);
+ List<FwDeviceMaintainPlanVO> selectFwDeviceMaintainPlanPage(IPage page, FwDeviceMaintainPlanDTO fwDeviceMaintainPlan);
/**
diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMaintainPlanMapper.xml b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMaintainPlanMapper.xml
index df7d844..1c83f79 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMaintainPlanMapper.xml
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMaintainPlanMapper.xml
@@ -3,61 +3,75 @@
<mapper namespace="org.sxkj.fw.device.mapper.FwDeviceMaintainPlanMapper">
<!-- 通用查询映射结果 -->
- <resultMap id="fwDeviceMaintainPlanResultMap" type="org.sxkj.fw.device.entity.FwDeviceMaintainPlanEntity">
+ <resultMap id="fwDeviceMaintainPlanResultMap" type="org.sxkj.fw.device.vo.FwDeviceMaintainPlanVO">
<result column="id" property="id"/>
<result column="device_id" property="deviceId"/>
- <result column="plan_cycle" property="planCycle"/>
- <result column="plan_time" property="planTime"/>
- <result column="area_code" property="areaCode"/>
- <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"/>
+ <result column="plan_cycle_type" property="planCycleType"/>
+ <result column="plan_cycle_value" property="planCycleValue"
+ typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
+ <result column="device_name" property="deviceName"/>
+ <result column="device_type" property="deviceType"/>
+ <result column="device_att" property="deviceAtt"/>
+ <result column="device_model" property="deviceModel"/>
+ <result column="belong_dept" property="belongDept"/>
+ <result column="device_specification" property="deviceSpecification"/>
+ <result column="manufacturer" property="manufacturer"/>
+ <result column="source" property="source"/>
+ <result column="purpose" property="purpose"/>
</resultMap>
+ <select id="getFwDeviceMaintainPlanById" resultMap="fwDeviceMaintainPlanResultMap">
+ select
+ b.device_name,
+ b.device_type,
+ b.device_att,
+ b.device_model,
+ b.belong_dept,
+ b.device_specification,
+ b.manufacturer,
+ b.source,
+ b.purpose,
+ a.*
+ from
+ ja_fw_device_maintain_plan a
+ left join ja_fw_device b on (a.device_id = b.id)
+ <where>
+ a.is_deleted = 0
+ <if test="id != null and id != ''">
+ and a.id = #{id}
+ </if>
+ </where>
+ limit 1
+ </select>
<select id="selectFwDeviceMaintainPlanPage" resultMap="fwDeviceMaintainPlanResultMap">
- select * from ja_fw_device_maintain_plan
+ select
+ b.device_name,
+ b.device_type,
+ b.device_att,
+ b.device_model,
+ b.belong_dept,
+ b.device_specification,
+ b.manufacturer,
+ b.source,
+ b.purpose,
+ a.*
+ from
+ ja_fw_device_maintain_plan a
+ left join ja_fw_device b on (a.device_id = b.id)
<where>
- is_deleted = 0
- <if test="param2.id != null and param2.id != ''">
- and id = #{param2.id}
- </if>
+ a.is_deleted = 0
<if test="param2.deviceId != null and param2.deviceId != ''">
and device_id = #{param2.deviceId}
</if>
- <if test="param2.planCycle != null and param2.planCycle != ''">
- and plan_cycle = #{param2.planCycle}
+ <if test="param2.deviceName != null and param2.deviceName != ''">
+ and device_name like concat('%',#{param2.deviceName},'%')
</if>
- <if test="param2.planTime != null and param2.planTime != ''">
- and plan_time = #{param2.planTime}
+ <if test="param2.deviceType != null and param2.deviceType != ''">
+ and device_type = #{param2.deviceType}
</if>
- <if test="param2.areaCode != null and param2.areaCode != ''">
- and area_code = #{param2.areaCode}
- </if>
- <if test="param2.createUser != null and param2.createUser != ''">
- and create_user = #{param2.createUser}
- </if>
- <if test="param2.createDept != null and param2.createDept != ''">
- and create_dept = #{param2.createDept}
- </if>
- <if test="param2.createTime != null and param2.createTime != ''">
- and create_time = #{param2.createTime}
- </if>
- <if test="param2.updateUser != null and param2.updateUser != ''">
- and update_user = #{param2.updateUser}
- </if>
- <if test="param2.updateTime != null and param2.updateTime != ''">
- and update_time = #{param2.updateTime}
- </if>
- <if test="param2.status != null and param2.status != ''">
- and status = #{param2.status}
- </if>
- <if test="param2.isDeleted != null and param2.isDeleted != ''">
- and is_deleted = #{param2.isDeleted}
+ <if test="param2.belongDept != null and param2.belongDept != ''">
+ and belong_dept = #{param2.belongDept}
</if>
</where>
</select>
diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceMaintainPlanService.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceMaintainPlanService.java
index 1d95678..1002cbc 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceMaintainPlanService.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceMaintainPlanService.java
@@ -17,6 +17,7 @@
package org.sxkj.fw.device.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import org.sxkj.fw.device.dto.FwDeviceMaintainPlanDTO;
import org.sxkj.fw.device.entity.FwDeviceMaintainPlanEntity;
import org.sxkj.fw.device.vo.FwDeviceMaintainPlanVO;
import org.sxkj.fw.device.excel.FwDeviceMaintainPlanExcel;
@@ -27,10 +28,18 @@
/**
* 设备维护计划表 服务类
*
- * @author lw
- * @since 2026-01-08
+ * @author Aix
+ * @since 2026-01-09
*/
public interface IFwDeviceMaintainPlanService extends BaseService<FwDeviceMaintainPlanEntity> {
+
+ /**
+ * 获取详情
+ * @param id 计划id
+ * @return 计划详情
+ */
+ FwDeviceMaintainPlanVO getFwDeviceMaintainPlanById(Long id);
+
/**
* 自定义分页
*
@@ -38,7 +47,7 @@
* @param fwDeviceMaintainPlan
* @return
*/
- IPage<FwDeviceMaintainPlanVO> selectFwDeviceMaintainPlanPage(IPage<FwDeviceMaintainPlanVO> page, FwDeviceMaintainPlanVO fwDeviceMaintainPlan);
+ IPage<FwDeviceMaintainPlanVO> selectFwDeviceMaintainPlanPage(IPage<FwDeviceMaintainPlanVO> page, FwDeviceMaintainPlanDTO fwDeviceMaintainPlan);
/**
diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceMaintainPlanServiceImpl.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceMaintainPlanServiceImpl.java
index 03b64ee..5e37ba6 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceMaintainPlanServiceImpl.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceMaintainPlanServiceImpl.java
@@ -16,6 +16,7 @@
*/
package org.sxkj.fw.device.service.impl;
+import org.sxkj.fw.device.dto.FwDeviceMaintainPlanDTO;
import org.sxkj.fw.device.entity.FwDeviceMaintainPlanEntity;
import org.sxkj.fw.device.vo.FwDeviceMaintainPlanVO;
import org.sxkj.fw.device.excel.FwDeviceMaintainPlanExcel;
@@ -30,14 +31,20 @@
/**
* 设备维护计划表 服务实现类
*
- * @author lw
- * @since 2026-01-08
+ * @author Aix
+ * @since 2026-01-09
*/
@Service
public class FwDeviceMaintainPlanServiceImpl extends BaseServiceImpl<FwDeviceMaintainPlanMapper, FwDeviceMaintainPlanEntity> implements IFwDeviceMaintainPlanService {
+
@Override
- public IPage<FwDeviceMaintainPlanVO> selectFwDeviceMaintainPlanPage(IPage<FwDeviceMaintainPlanVO> page, FwDeviceMaintainPlanVO fwDeviceMaintainPlan) {
+ public FwDeviceMaintainPlanVO getFwDeviceMaintainPlanById(Long id) {
+ return baseMapper.getFwDeviceMaintainPlanById(id);
+ }
+
+ @Override
+ public IPage<FwDeviceMaintainPlanVO> selectFwDeviceMaintainPlanPage(IPage<FwDeviceMaintainPlanVO> page, FwDeviceMaintainPlanDTO fwDeviceMaintainPlan) {
return page.setRecords(baseMapper.selectFwDeviceMaintainPlanPage(page, fwDeviceMaintainPlan));
}
diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceMaintainPlanVO.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceMaintainPlanVO.java
index b8a7556..8d1098a 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceMaintainPlanVO.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceMaintainPlanVO.java
@@ -16,20 +16,95 @@
*/
package org.sxkj.fw.device.vo;
-import org.sxkj.fw.device.entity.FwDeviceMaintainPlanEntity;
-import org.springblade.core.tool.node.INode;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
-import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.List;
/**
* 设备维护计划表 视图实体类
*
- * @author lw
- * @since 2026-01-08
+ * @author Aix
+ * @since 2026-01-09
*/
@Data
-@EqualsAndHashCode(callSuper = true)
-public class FwDeviceMaintainPlanVO extends FwDeviceMaintainPlanEntity {
+public class FwDeviceMaintainPlanVO implements Serializable {
+
private static final long serialVersionUID = 1L;
+ @ApiModelProperty(value = "主键")
+ private Long id;
+
+ /**
+ * 设备ID
+ */
+ @ApiModelProperty(value = "设备ID")
+ private Long deviceId;
+ /**
+ * 计划周期(每年、每月、每周)
+ */
+ @ApiModelProperty(value = "计划周期(每年、每月、每周)")
+ private String planCycleType;
+ /**
+ * 计划周期具体值,数组对象[1,2,3]
+ */
+ @ApiModelProperty(value = "计划周期具体值,数组对象[1,2,3]")
+ private List<String> planCycleValue;
+
+ /**
+ * 设备名称
+ */
+ @ApiModelProperty(value = "设备名称")
+ private String deviceName;
+
+ /**
+ * 设备类型
+ */
+ @ApiModelProperty(value = "设备类型")
+ private String deviceType;
+
+ /**
+ * 设备属性
+ */
+ @ApiModelProperty(value = "设备属性")
+ private String deviceAtt;
+
+ /**
+ * 设备型号
+ */
+ @ApiModelProperty(value = "设备型号")
+ private String deviceModel;
+
+ /**
+ * 所属部门
+ */
+ @ApiModelProperty(value = "所属部门")
+ private Long belongDept;
+
+ /**
+ * 设备规格
+ */
+ @ApiModelProperty(value = "设备规格")
+ private String deviceSpecification;
+
+ /**
+ * 生产厂商
+ */
+ @ApiModelProperty(value = "生产厂商")
+ private String manufacturer;
+
+ /**
+ * 来源
+ */
+ @ApiModelProperty(value = "来源")
+ private String source;
+
+ /**
+ * 用途
+ */
+ @ApiModelProperty(value = "用途")
+ private String purpose;
+
+
}
diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceVO.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceVO.java
index 788e9eb..6ba55b1 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceVO.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceVO.java
@@ -26,6 +26,7 @@
import java.io.Serializable;
import java.math.BigDecimal;
+import java.util.Date;
/**
* 设备表 视图实体类
@@ -106,6 +107,9 @@
@ApiModelProperty("运行状态(0:在线/1:离线/2:故障/3:报废)")
private Integer status;
+ @ApiModelProperty("创建时间")
+ private Date createTime;
+
/**
* 电量百分比 0-100
*/
diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/wrapper/FwDeviceMaintainPlanWrapper.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/wrapper/FwDeviceMaintainPlanWrapper.java
index 5b304da..cea3f8e 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/wrapper/FwDeviceMaintainPlanWrapper.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/wrapper/FwDeviceMaintainPlanWrapper.java
@@ -18,6 +18,7 @@
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
+import org.sxkj.fw.device.dto.FwDeviceMaintainPlanDTO;
import org.sxkj.fw.device.entity.FwDeviceMaintainPlanEntity;
import org.sxkj.fw.device.vo.FwDeviceMaintainPlanVO;
import java.util.Objects;
@@ -25,8 +26,8 @@
/**
* 设备维护计划表 包装类,返回视图层所需的字段
*
- * @author lw
- * @since 2026-01-08
+ * @author Aix
+ * @since 2026-01-09
*/
public class FwDeviceMaintainPlanWrapper extends BaseEntityWrapper<FwDeviceMaintainPlanEntity, FwDeviceMaintainPlanVO> {
@@ -36,14 +37,13 @@
@Override
public FwDeviceMaintainPlanVO entityVO(FwDeviceMaintainPlanEntity fwDeviceMaintainPlan) {
- FwDeviceMaintainPlanVO fwDeviceMaintainPlanVO = Objects.requireNonNull(BeanUtil.copy(fwDeviceMaintainPlan, FwDeviceMaintainPlanVO.class));
- //User createUser = UserCache.getUser(fwDeviceMaintainPlan.getCreateUser());
- //User updateUser = UserCache.getUser(fwDeviceMaintainPlan.getUpdateUser());
- //fwDeviceMaintainPlanVO.setCreateUserName(createUser.getName());
- //fwDeviceMaintainPlanVO.setUpdateUserName(updateUser.getName());
+ return Objects.requireNonNull(BeanUtil.copy(fwDeviceMaintainPlan, FwDeviceMaintainPlanVO.class));
+ }
- return fwDeviceMaintainPlanVO;
+ public FwDeviceMaintainPlanEntity entityDTO(FwDeviceMaintainPlanDTO fwDeviceMaintainPlan) {
+
+ return Objects.requireNonNull(BeanUtil.copy(fwDeviceMaintainPlan, FwDeviceMaintainPlanEntity.class));
}
--
Gitblit v1.9.3