吉安感知网项目-后端
linwei
2026-01-09 bbc3d8a4b43256e6cafefc7ab33f34e1459aed9b
Merge remote-tracking branch 'origin/master'
21 files modified
669 ■■■■■ changed files
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceMaintainPlanController.java 3 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceMaintainRecordController.java 86 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceScrapController.java 106 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceMaintainPlanDTO.java 1 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceMaintainRecordDTO.java 44 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceScrapDTO.java 41 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/entity/FwDeviceMaintainRecordEntity.java 9 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/excel/FwDeviceMaintainRecordExcel.java 7 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMaintainRecordMapper.java 3 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMaintainRecordMapper.xml 34 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceScrapMapper.java 19 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceScrapMapper.xml 98 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceMaintainRecordService.java 3 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceScrapService.java 18 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceMaintainRecordServiceImpl.java 3 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceScrapServiceImpl.java 35 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceMaintainPlanVO.java 1 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceMaintainRecordVO.java 44 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceScrapVO.java 87 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/wrapper/FwDeviceMaintainRecordWrapper.java 12 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/wrapper/FwDeviceScrapWrapper.java 15 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceMaintainPlanController.java
@@ -96,6 +96,9 @@
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "新增或修改", notes = "传入fwDeviceMaintainPlan")
    public R submit(@Valid @RequestBody FwDeviceMaintainPlanDTO fwDeviceMaintainPlan) {
        if (null == fwDeviceMaintainPlan.getDeviceId()) {
            return R.fail("参数错误");
        }
        return R.status(fwDeviceMaintainPlanService.saveOrUpdate(FwDeviceMaintainPlanWrapper.build().entityDTO(fwDeviceMaintainPlan)));
    }
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceMaintainRecordController.java
@@ -16,34 +16,35 @@
 */
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.FwDeviceMaintainRecordDTO;
import org.sxkj.fw.device.entity.FwDeviceMaintainRecordEntity;
import org.sxkj.fw.device.vo.FwDeviceMaintainRecordVO;
import org.sxkj.fw.device.excel.FwDeviceMaintainRecordExcel;
import org.sxkj.fw.device.wrapper.FwDeviceMaintainRecordWrapper;
import org.sxkj.fw.device.service.IFwDeviceMaintainRecordService;
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.FwDeviceMaintainRecordVO;
import org.sxkj.fw.device.wrapper.FwDeviceMaintainRecordWrapper;
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;
/**
 * 设备维护记录表 控制器
@@ -65,67 +66,45 @@
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入fwDeviceMaintainRecord")
    public R<FwDeviceMaintainRecordVO> detail(FwDeviceMaintainRecordEntity fwDeviceMaintainRecord) {
        FwDeviceMaintainRecordEntity detail = fwDeviceMaintainRecordService.getOne(Condition.getQueryWrapper(fwDeviceMaintainRecord));
    public R<FwDeviceMaintainRecordVO> detail(FwDeviceMaintainRecordDTO fwDeviceMaintainRecord) {
        FwDeviceMaintainRecordEntity detail = fwDeviceMaintainRecordService.getOne(
                Condition.getQueryWrapper(
                        FwDeviceMaintainRecordWrapper.build().entityDTO(fwDeviceMaintainRecord)));
        return R.data(FwDeviceMaintainRecordWrapper.build().entityVO(detail));
    }
    /**
     * 设备维护记录表 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入fwDeviceMaintainRecord")
    public R<IPage<FwDeviceMaintainRecordVO>> list(@ApiIgnore @RequestParam Map<String, Object> fwDeviceMaintainRecord, Query query) {
        IPage<FwDeviceMaintainRecordEntity> pages = fwDeviceMaintainRecordService.page(Condition.getPage(query), Condition.getQueryWrapper(fwDeviceMaintainRecord, FwDeviceMaintainRecordEntity.class));
        return R.data(FwDeviceMaintainRecordWrapper.build().pageVO(pages));
    }
    /**
     * 设备维护记录表 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入fwDeviceMaintainRecord")
    public R<IPage<FwDeviceMaintainRecordVO>> page(FwDeviceMaintainRecordVO fwDeviceMaintainRecord, Query query) {
    public R<IPage<FwDeviceMaintainRecordVO>> page(FwDeviceMaintainRecordDTO fwDeviceMaintainRecord, Query query) {
        IPage<FwDeviceMaintainRecordVO> pages = fwDeviceMaintainRecordService.selectFwDeviceMaintainRecordPage(Condition.getPage(query), fwDeviceMaintainRecord);
        return R.data(pages);
    }
    /**
     * 设备维护记录表 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入fwDeviceMaintainRecord")
    public R save(@Valid @RequestBody FwDeviceMaintainRecordEntity fwDeviceMaintainRecord) {
        return R.status(fwDeviceMaintainRecordService.save(fwDeviceMaintainRecord));
    }
    /**
     * 设备维护记录表 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入fwDeviceMaintainRecord")
    public R update(@Valid @RequestBody FwDeviceMaintainRecordEntity fwDeviceMaintainRecord) {
        return R.status(fwDeviceMaintainRecordService.updateById(fwDeviceMaintainRecord));
    }
    /**
     * 设备维护记录表 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "新增或修改", notes = "传入fwDeviceMaintainRecord")
    public R submit(@Valid @RequestBody FwDeviceMaintainRecordEntity fwDeviceMaintainRecord) {
        return R.status(fwDeviceMaintainRecordService.saveOrUpdate(fwDeviceMaintainRecord));
    public R submit(@Valid @RequestBody FwDeviceMaintainRecordDTO fwDeviceMaintainRecord) {
        if (null == fwDeviceMaintainRecord.getDeviceId() || null == fwDeviceMaintainRecord.getPlanId()) {
            return R.fail("设备和计划参数为空");
        }
        return R.status(fwDeviceMaintainRecordService.saveOrUpdate(
                FwDeviceMaintainRecordWrapper.build().entityDTO(fwDeviceMaintainRecord)));
    }
    /**
     * 设备维护记录表 删除
     */
    @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(fwDeviceMaintainRecordService.deleteLogic(Func.toLongList(ids)));
@@ -136,8 +115,9 @@
     * 导出数据
     */
    @GetMapping("/export-fwDeviceMaintainRecord")
    @ApiOperationSupport(order = 9)
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "导出数据", notes = "传入fwDeviceMaintainRecord")
    @ApiIgnore
    public void exportFwDeviceMaintainRecord(@ApiIgnore @RequestParam Map<String, Object> fwDeviceMaintainRecord, BladeUser bladeUser, HttpServletResponse response) {
        QueryWrapper<FwDeviceMaintainRecordEntity> queryWrapper = Condition.getQueryWrapper(fwDeviceMaintainRecord, FwDeviceMaintainRecordEntity.class);
        //if (!AuthUtil.isAdministrator()) {
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceScrapController.java
@@ -16,34 +16,33 @@
 */
package org.sxkj.fw.device.controller;
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.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.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.sxkj.fw.device.entity.FwDeviceScrapEntity;
import org.sxkj.fw.device.vo.FwDeviceScrapVO;
import org.sxkj.fw.device.excel.FwDeviceScrapExcel;
import org.sxkj.fw.device.wrapper.FwDeviceScrapWrapper;
import org.sxkj.fw.device.service.IFwDeviceScrapService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
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.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.springframework.web.bind.annotation.*;
import org.sxkj.fw.device.dto.FwDeviceScrapDTO;
import org.sxkj.fw.device.entity.FwDeviceScrapEntity;
import org.sxkj.fw.device.excel.FwDeviceScrapExcel;
import org.sxkj.fw.device.service.IFwDeviceScrapService;
import org.sxkj.fw.device.vo.FwDeviceScrapVO;
import org.sxkj.fw.device.wrapper.FwDeviceScrapWrapper;
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;
/**
 * 设备报废记录表 控制器
@@ -65,19 +64,19 @@
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入fwDeviceScrap")
    public R<FwDeviceScrapVO> detail(FwDeviceScrapEntity fwDeviceScrap) {
        FwDeviceScrapEntity detail = fwDeviceScrapService.getOne(Condition.getQueryWrapper(fwDeviceScrap));
    public R<FwDeviceScrapVO> detail(FwDeviceScrapDTO fwDeviceScrap) {
        if (fwDeviceScrap.getId() == null) {
            return R.fail("参数错误");
        }
        FwDeviceScrapEntity detail = fwDeviceScrapService.getOne(
                Condition.getQueryWrapper(
                        FwDeviceScrapWrapper.build().entityDTO(fwDeviceScrap)));
        if (detail == null) {
            return R.fail("数据不存在");
        }
        return R.data(FwDeviceScrapWrapper.build().entityVO(detail));
    }
    /**
     * 设备报废记录表 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入fwDeviceScrap")
    public R<IPage<FwDeviceScrapVO>> list(@ApiIgnore @RequestParam Map<String, Object> fwDeviceScrap, Query query) {
        IPage<FwDeviceScrapEntity> pages = fwDeviceScrapService.page(Condition.getPage(query), Condition.getQueryWrapper(fwDeviceScrap, FwDeviceScrapEntity.class));
        return R.data(FwDeviceScrapWrapper.build().pageVO(pages));
    }
    /**
@@ -86,7 +85,7 @@
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入fwDeviceScrap")
    public R<IPage<FwDeviceScrapVO>> page(FwDeviceScrapVO fwDeviceScrap, Query query) {
    public R<IPage<FwDeviceScrapVO>> page(FwDeviceScrapDTO fwDeviceScrap, Query query) {
        IPage<FwDeviceScrapVO> pages = fwDeviceScrapService.selectFwDeviceScrapPage(Condition.getPage(query), fwDeviceScrap);
        return R.data(pages);
    }
@@ -96,41 +95,15 @@
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入fwDeviceScrap")
    public R save(@Valid @RequestBody FwDeviceScrapEntity fwDeviceScrap) {
        return R.status(fwDeviceScrapService.save(fwDeviceScrap));
    }
    @ApiOperation(value = "新增报废记录", notes = "传入fwDeviceScrap,deviceId必填")
    public R save(@Valid @RequestBody FwDeviceScrapDTO fwDeviceScrap) {
    /**
     * 设备报废记录表 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入fwDeviceScrap")
    public R update(@Valid @RequestBody FwDeviceScrapEntity fwDeviceScrap) {
        return R.status(fwDeviceScrapService.updateById(fwDeviceScrap));
    }
        if (fwDeviceScrap.getDeviceId() == null) {
            return R.fail("参数错误");
        }
    /**
     * 设备报废记录表 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入fwDeviceScrap")
    public R submit(@Valid @RequestBody FwDeviceScrapEntity fwDeviceScrap) {
        return R.status(fwDeviceScrapService.saveOrUpdate(fwDeviceScrap));
        return R.status(fwDeviceScrapService.saveFwDeviceScrap(fwDeviceScrap));
    }
    /**
     * 设备报废记录表 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(fwDeviceScrapService.deleteLogic(Func.toLongList(ids)));
    }
    /**
     * 导出数据
@@ -138,6 +111,7 @@
    @GetMapping("/export-fwDeviceScrap")
    @ApiOperationSupport(order = 9)
    @ApiOperation(value = "导出数据", notes = "传入fwDeviceScrap")
    @ApiIgnore
    public void exportFwDeviceScrap(@ApiIgnore @RequestParam Map<String, Object> fwDeviceScrap, BladeUser bladeUser, HttpServletResponse response) {
        QueryWrapper<FwDeviceScrapEntity> queryWrapper = Condition.getQueryWrapper(fwDeviceScrap, FwDeviceScrapEntity.class);
        //if (!AuthUtil.isAdministrator()) {
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceMaintainPlanDTO.java
@@ -41,7 +41,6 @@
     * 设备ID
     */
    @ApiModelProperty(value = "设备ID")
    @NotNull
    private Long deviceId;
    /**
     * 计划周期(每年、每月、每周)
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceMaintainRecordDTO.java
@@ -16,9 +16,14 @@
 */
package org.sxkj.fw.device.dto;
import io.swagger.annotations.ApiModelProperty;
import org.sxkj.fw.device.entity.FwDeviceMaintainRecordEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
 * 设备维护记录表 数据传输对象实体类
@@ -27,8 +32,43 @@
 * @since 2026-01-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class FwDeviceMaintainRecordDTO extends FwDeviceMaintainRecordEntity {
public class FwDeviceMaintainRecordDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键")
    private    Long id;
    /**
     * 设备ID
     */
    @ApiModelProperty(value = "设备ID")
    private Long deviceId;
    /**
     * 对应计划ID(空表示临时维护)
     */
    @ApiModelProperty(value = "对应计划ID")
    private Long planId;
    /**
     * 实际维护时间
     */
    @ApiModelProperty(value = "实际维护时间")
    private Date maintainTime;
    /**
     * 维护内容
     */
    @ApiModelProperty(value = "维护内容")
    private String maintainContent;
    /**
     * 更换部件
     */
    @ApiModelProperty(value = "更换部件")
    private String replacePart;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remark;
}
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceScrapDTO.java
@@ -16,9 +16,14 @@
 */
package org.sxkj.fw.device.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import org.sxkj.fw.device.entity.FwDeviceScrapEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
 * 设备报废记录表 数据传输对象实体类
@@ -27,8 +32,40 @@
 * @since 2026-01-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class FwDeviceScrapDTO extends FwDeviceScrapEntity {
public class FwDeviceScrapDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键")
    private    Long id;
    /**
     * 设备ID(关联ja_fw_device.id)
     */
    @ApiModelProperty(value = "设备ID")
    private Long deviceId;
    /**
     * 报废时间
     */
    @ApiModelProperty(value = "报废时间")
    private Date scrapTime;
    /**
     * 报废原因
     */
    @ApiModelProperty(value = "报废原因")
    private String scrapReason;
    /**
     * 处置方式
     */
    @ApiModelProperty(value = "处置方式")
    private String disposeWay;
    // 查询使用
    @ApiModelProperty(value = "设备名称")
    private String deviceName;
    @ApiModelProperty(value = "设备类型")
    private String deviceType;
    @ApiModelProperty(value = "所属部门")
    private Long belongDept;
}
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/entity/FwDeviceMaintainRecordEntity.java
@@ -48,7 +48,7 @@
     * 对应计划ID(空表示临时维护)
     */
    @TableField("plan_id")
    @ApiModelProperty(value = "对应计划ID(空表示临时维护)")
    @ApiModelProperty(value = "对应计划ID")
    private Long planId;
    /**
     * 实际维护时间
@@ -68,12 +68,7 @@
    @TableField("replace_part")
    @ApiModelProperty(value = "更换部件")
    private String replacePart;
    /**
     * 维护结果(已维护/已保养/故障未修复等)
     */
    @TableField("maintain_result")
    @ApiModelProperty(value = "维护结果(已维护/已保养/故障未修复等)")
    private String maintainResult;
    /**
     * 备注
     */
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/excel/FwDeviceMaintainRecordExcel.java
@@ -71,12 +71,7 @@
    @ColumnWidth(20)
    @ExcelProperty("更换部件")
    private String replacePart;
    /**
     * 维护结果(已维护/已保养/故障未修复等)
     */
    @ColumnWidth(20)
    @ExcelProperty("维护结果(已维护/已保养/故障未修复等)")
    private String maintainResult;
    /**
     * 备注
     */
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMaintainRecordMapper.java
@@ -16,6 +16,7 @@
 */
package org.sxkj.fw.device.mapper;
import org.sxkj.fw.device.dto.FwDeviceMaintainRecordDTO;
import org.sxkj.fw.device.entity.FwDeviceMaintainRecordEntity;
import org.sxkj.fw.device.vo.FwDeviceMaintainRecordVO;
import org.sxkj.fw.device.excel.FwDeviceMaintainRecordExcel;
@@ -40,7 +41,7 @@
     * @param fwDeviceMaintainRecord
     * @return
     */
    List<FwDeviceMaintainRecordVO> selectFwDeviceMaintainRecordPage(IPage page, FwDeviceMaintainRecordVO fwDeviceMaintainRecord);
    List<FwDeviceMaintainRecordVO> selectFwDeviceMaintainRecordPage(IPage page, FwDeviceMaintainRecordDTO fwDeviceMaintainRecord);
    /**
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMaintainRecordMapper.xml
@@ -10,7 +10,6 @@
        <result column="maintain_time" property="maintainTime"/>
        <result column="maintain_content" property="maintainContent"/>
        <result column="replace_part" property="replacePart"/>
        <result column="maintain_result" property="maintainResult"/>
        <result column="remark" property="remark"/>
        <result column="area_code" property="areaCode"/>
        <result column="create_user" property="createUser"/>
@@ -41,39 +40,6 @@
            </if>
            <if test="param2.maintainContent != null and param2.maintainContent != ''">
                and maintain_content = #{param2.maintainContent}
            </if>
            <if test="param2.replacePart != null and param2.replacePart != ''">
                and replace_part = #{param2.replacePart}
            </if>
            <if test="param2.maintainResult != null and param2.maintainResult != ''">
                and maintain_result = #{param2.maintainResult}
            </if>
            <if test="param2.remark != null and param2.remark != ''">
                and remark = #{param2.remark}
            </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>
        </where>
    </select>
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceScrapMapper.java
@@ -16,13 +16,15 @@
 */
package org.sxkj.fw.device.mapper;
import org.sxkj.fw.device.entity.FwDeviceScrapEntity;
import org.sxkj.fw.device.vo.FwDeviceScrapVO;
import org.sxkj.fw.device.excel.FwDeviceScrapExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.sxkj.fw.device.dto.FwDeviceScrapDTO;
import org.sxkj.fw.device.entity.FwDeviceScrapEntity;
import org.sxkj.fw.device.excel.FwDeviceScrapExcel;
import org.sxkj.fw.device.vo.FwDeviceScrapVO;
import java.util.List;
/**
@@ -34,13 +36,20 @@
public interface FwDeviceScrapMapper extends BaseMapper<FwDeviceScrapEntity> {
    /**
     * 获取详情
     * @param id 计划id
     * @return 计划详情
     */
    FwDeviceScrapVO getFwDeviceScrapById(@Param("id") Long id);
    /**
     * 自定义分页
     *
     * @param page
     * @param fwDeviceScrap
     * @return
     */
    List<FwDeviceScrapVO> selectFwDeviceScrapPage(IPage page, FwDeviceScrapVO fwDeviceScrap);
    List<FwDeviceScrapVO> selectFwDeviceScrapPage(IPage page, FwDeviceScrapDTO fwDeviceScrap);
    /**
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceScrapMapper.xml
@@ -3,65 +3,75 @@
<mapper namespace="org.sxkj.fw.device.mapper.FwDeviceScrapMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="fwDeviceScrapResultMap" type="org.sxkj.fw.device.entity.FwDeviceScrapEntity">
    <resultMap id="fwDeviceScrapResultMap" type="org.sxkj.fw.device.vo.FwDeviceScrapVO">
        <result column="id" property="id"/>
        <result column="device_id" property="deviceId"/>
        <result column="scrap_time" property="scrapTime"/>
        <result column="scrap_reason" property="scrapReason"/>
        <result column="dispose_way" property="disposeWay"/>
        <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="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="getFwDeviceScrapById" resultMap="fwDeviceScrapResultMap">
        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_scrap 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="selectFwDeviceScrapPage" resultMap="fwDeviceScrapResultMap">
        select * from ja_fw_device_scrap
        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_scrap 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.scrapTime != null and param2.scrapTime != ''">
                and scrap_time = #{param2.scrapTime}
            <if test="param2.deviceName != null and param2.deviceName != ''">
                and device_name like concat('%',#{param2.deviceName},'%')
            </if>
            <if test="param2.scrapReason != null and param2.scrapReason != ''">
                and scrap_reason = #{param2.scrapReason}
            <if test="param2.deviceType != null and param2.deviceType != ''">
                and device_type = #{param2.deviceType}
            </if>
            <if test="param2.disposeWay != null and param2.disposeWay != ''">
                and dispose_way = #{param2.disposeWay}
            </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>
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceMaintainRecordService.java
@@ -17,6 +17,7 @@
package org.sxkj.fw.device.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.sxkj.fw.device.dto.FwDeviceMaintainRecordDTO;
import org.sxkj.fw.device.entity.FwDeviceMaintainRecordEntity;
import org.sxkj.fw.device.vo.FwDeviceMaintainRecordVO;
import org.sxkj.fw.device.excel.FwDeviceMaintainRecordExcel;
@@ -38,7 +39,7 @@
     * @param fwDeviceMaintainRecord
     * @return
     */
    IPage<FwDeviceMaintainRecordVO> selectFwDeviceMaintainRecordPage(IPage<FwDeviceMaintainRecordVO> page, FwDeviceMaintainRecordVO fwDeviceMaintainRecord);
    IPage<FwDeviceMaintainRecordVO> selectFwDeviceMaintainRecordPage(IPage<FwDeviceMaintainRecordVO> page, FwDeviceMaintainRecordDTO fwDeviceMaintainRecord);
    /**
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceScrapService.java
@@ -17,11 +17,13 @@
package org.sxkj.fw.device.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.sxkj.fw.device.entity.FwDeviceScrapEntity;
import org.sxkj.fw.device.vo.FwDeviceScrapVO;
import org.sxkj.fw.device.excel.FwDeviceScrapExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.sxkj.fw.device.dto.FwDeviceScrapDTO;
import org.sxkj.fw.device.entity.FwDeviceScrapEntity;
import org.sxkj.fw.device.excel.FwDeviceScrapExcel;
import org.sxkj.fw.device.vo.FwDeviceScrapVO;
import java.util.List;
/**
@@ -31,6 +33,14 @@
 * @since 2026-01-08
 */
public interface IFwDeviceScrapService extends BaseService<FwDeviceScrapEntity> {
    /**
     * 新增报废记录
     * @param dto 报废记录
     * @return true/false
     */
    boolean saveFwDeviceScrap(FwDeviceScrapDTO dto);
    /**
     * 自定义分页
     *
@@ -38,7 +48,7 @@
     * @param fwDeviceScrap
     * @return
     */
    IPage<FwDeviceScrapVO> selectFwDeviceScrapPage(IPage<FwDeviceScrapVO> page, FwDeviceScrapVO fwDeviceScrap);
    IPage<FwDeviceScrapVO> selectFwDeviceScrapPage(IPage<FwDeviceScrapVO> page, FwDeviceScrapDTO fwDeviceScrap);
    /**
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceMaintainRecordServiceImpl.java
@@ -16,6 +16,7 @@
 */
package org.sxkj.fw.device.service.impl;
import org.sxkj.fw.device.dto.FwDeviceMaintainRecordDTO;
import org.sxkj.fw.device.entity.FwDeviceMaintainRecordEntity;
import org.sxkj.fw.device.vo.FwDeviceMaintainRecordVO;
import org.sxkj.fw.device.excel.FwDeviceMaintainRecordExcel;
@@ -37,7 +38,7 @@
public class FwDeviceMaintainRecordServiceImpl extends BaseServiceImpl<FwDeviceMaintainRecordMapper, FwDeviceMaintainRecordEntity> implements IFwDeviceMaintainRecordService {
    @Override
    public IPage<FwDeviceMaintainRecordVO> selectFwDeviceMaintainRecordPage(IPage<FwDeviceMaintainRecordVO> page, FwDeviceMaintainRecordVO fwDeviceMaintainRecord) {
    public IPage<FwDeviceMaintainRecordVO> selectFwDeviceMaintainRecordPage(IPage<FwDeviceMaintainRecordVO> page, FwDeviceMaintainRecordDTO fwDeviceMaintainRecord) {
        return page.setRecords(baseMapper.selectFwDeviceMaintainRecordPage(page, fwDeviceMaintainRecord));
    }
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceScrapServiceImpl.java
@@ -16,15 +16,22 @@
 */
package org.sxkj.fw.device.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.sxkj.fw.device.dto.FwDeviceScrapDTO;
import org.sxkj.fw.device.entity.FwDeviceEntity;
import org.sxkj.fw.device.entity.FwDeviceScrapEntity;
import org.sxkj.fw.device.vo.FwDeviceScrapVO;
import org.sxkj.fw.device.excel.FwDeviceScrapExcel;
import org.sxkj.fw.device.mapper.FwDeviceScrapMapper;
import org.sxkj.fw.device.service.IFwDeviceScrapService;
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 org.sxkj.fw.device.service.IFwDeviceService;
import org.sxkj.fw.device.vo.FwDeviceScrapVO;
import org.sxkj.fw.device.wrapper.FwDeviceScrapWrapper;
import java.util.List;
/**
@@ -34,10 +41,26 @@
 * @since 2026-01-08
 */
@Service
@AllArgsConstructor
public class FwDeviceScrapServiceImpl extends BaseServiceImpl<FwDeviceScrapMapper, FwDeviceScrapEntity> implements IFwDeviceScrapService {
    private final IFwDeviceService fwDeviceService;
    @Override
    public IPage<FwDeviceScrapVO> selectFwDeviceScrapPage(IPage<FwDeviceScrapVO> page, FwDeviceScrapVO fwDeviceScrap) {
    @Transactional
    public boolean saveFwDeviceScrap(FwDeviceScrapDTO dto) {
        boolean isSuccess = super.save(FwDeviceScrapWrapper.build().entityDTO(dto));
        if (isSuccess) {
            FwDeviceEntity fwDevice = new FwDeviceEntity();
            fwDevice.setId(dto.getDeviceId());
            fwDevice.setStatus(3);
            isSuccess = fwDeviceService.updateById(fwDevice);
        }
        return isSuccess;
    }
    @Override
    public IPage<FwDeviceScrapVO> selectFwDeviceScrapPage(IPage<FwDeviceScrapVO> page, FwDeviceScrapDTO fwDeviceScrap) {
        return page.setRecords(baseMapper.selectFwDeviceScrapPage(page, fwDeviceScrap));
    }
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceMaintainPlanVO.java
@@ -52,6 +52,7 @@
    @ApiModelProperty(value = "计划周期具体值,数组对象[1,2,3]")
    private List<String> planCycleValue;
    // 设备相关
    /**
     * 设备名称
     */
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceMaintainRecordVO.java
@@ -16,10 +16,15 @@
 */
package org.sxkj.fw.device.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import org.sxkj.fw.device.entity.FwDeviceMaintainRecordEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
 * 设备维护记录表 视图实体类
@@ -28,8 +33,43 @@
 * @since 2026-01-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class FwDeviceMaintainRecordVO extends FwDeviceMaintainRecordEntity {
public class FwDeviceMaintainRecordVO implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键")
    private    Long id;
    /**
     * 设备ID
     */
    @ApiModelProperty(value = "设备ID")
    private Long deviceId;
    /**
     * 对应计划ID(空表示临时维护)
     */
    @ApiModelProperty(value = "对应计划ID")
    private Long planId;
    /**
     * 实际维护时间
     */
    @ApiModelProperty(value = "实际维护时间")
    private Date maintainTime;
    /**
     * 维护内容
     */
    @ApiModelProperty(value = "维护内容")
    private String maintainContent;
    /**
     * 更换部件
     */
    @ApiModelProperty(value = "更换部件")
    private String replacePart;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remark;
}
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceScrapVO.java
@@ -16,10 +16,14 @@
 */
package org.sxkj.fw.device.vo;
import io.swagger.annotations.ApiModelProperty;
import org.sxkj.fw.device.entity.FwDeviceScrapEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
 * 设备报废记录表 视图实体类
@@ -28,8 +32,87 @@
 * @since 2026-01-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class FwDeviceScrapVO extends FwDeviceScrapEntity {
public class FwDeviceScrapVO implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键")
    private    Long id;
    /**
     * 设备ID(关联ja_fw_device.id)
     */
    @ApiModelProperty(value = "设备ID")
    private Long deviceId;
    /**
     * 报废时间
     */
    @ApiModelProperty(value = "报废时间")
    private Date scrapTime;
    /**
     * 报废原因
     */
    @ApiModelProperty(value = "报废原因")
    private String scrapReason;
    /**
     * 处置方式
     */
    @ApiModelProperty(value = "处置方式")
    private String disposeWay;
    // 设备相关
    /**
     * 设备名称
     */
    @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;
}
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/wrapper/FwDeviceMaintainRecordWrapper.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.FwDeviceMaintainRecordDTO;
import org.sxkj.fw.device.entity.FwDeviceMaintainRecordEntity;
import org.sxkj.fw.device.vo.FwDeviceMaintainRecordVO;
import java.util.Objects;
@@ -36,14 +37,11 @@
    @Override
    public FwDeviceMaintainRecordVO entityVO(FwDeviceMaintainRecordEntity fwDeviceMaintainRecord) {
        FwDeviceMaintainRecordVO fwDeviceMaintainRecordVO = Objects.requireNonNull(BeanUtil.copy(fwDeviceMaintainRecord, FwDeviceMaintainRecordVO.class));
        return Objects.requireNonNull(BeanUtil.copy(fwDeviceMaintainRecord, FwDeviceMaintainRecordVO.class));
    }
        //User createUser = UserCache.getUser(fwDeviceMaintainRecord.getCreateUser());
        //User updateUser = UserCache.getUser(fwDeviceMaintainRecord.getUpdateUser());
        //fwDeviceMaintainRecordVO.setCreateUserName(createUser.getName());
        //fwDeviceMaintainRecordVO.setUpdateUserName(updateUser.getName());
        return fwDeviceMaintainRecordVO;
    public FwDeviceMaintainRecordEntity entityDTO(FwDeviceMaintainRecordDTO fwDeviceMaintainRecord) {
        return Objects.requireNonNull(BeanUtil.copy(fwDeviceMaintainRecord, FwDeviceMaintainRecordEntity.class));
    }
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/wrapper/FwDeviceScrapWrapper.java
@@ -18,8 +18,10 @@
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.sxkj.fw.device.dto.FwDeviceScrapDTO;
import org.sxkj.fw.device.entity.FwDeviceScrapEntity;
import org.sxkj.fw.device.vo.FwDeviceScrapVO;
import java.util.Objects;
/**
@@ -36,15 +38,10 @@
    @Override
    public FwDeviceScrapVO entityVO(FwDeviceScrapEntity fwDeviceScrap) {
        FwDeviceScrapVO fwDeviceScrapVO = Objects.requireNonNull(BeanUtil.copy(fwDeviceScrap, FwDeviceScrapVO.class));
        //User createUser = UserCache.getUser(fwDeviceScrap.getCreateUser());
        //User updateUser = UserCache.getUser(fwDeviceScrap.getUpdateUser());
        //fwDeviceScrapVO.setCreateUserName(createUser.getName());
        //fwDeviceScrapVO.setUpdateUserName(updateUser.getName());
        return fwDeviceScrapVO;
        return Objects.requireNonNull(BeanUtil.copy(fwDeviceScrap, FwDeviceScrapVO.class));
    }
    public FwDeviceScrapEntity entityDTO(FwDeviceScrapDTO fwDeviceScrap) {
        return Objects.requireNonNull(BeanUtil.copy(fwDeviceScrap, FwDeviceScrapEntity.class));
    }
}