drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceController.java
@@ -16,36 +16,35 @@ */ package org.sxkj.fw.device.controller; import com.github.xiaoymin.knife4j.annotations.Ignore; 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.FwDeviceDTO; import org.sxkj.fw.device.entity.FwDeviceEntity; import org.sxkj.fw.device.vo.FwDeviceVO; import org.sxkj.fw.device.excel.FwDeviceExcel; import org.sxkj.fw.device.wrapper.FwDeviceWrapper; import org.sxkj.fw.device.service.IFwDeviceService; 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.FwDeviceVO; import org.sxkj.fw.device.wrapper.FwDeviceWrapper; 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; /** * 设备表 控制器 @@ -69,6 +68,11 @@ @ApiOperation(value = "详情", notes = "传入fwDevice") public R<FwDeviceVO> detail(FwDeviceDTO fwDevice) { FwDeviceEntity detail = fwDeviceService.getOne(Condition.getQueryWrapper(FwDeviceWrapper.build().entityDTO(fwDevice))); if (detail == null) { return R.fail("该设备不存在"); } return R.data(FwDeviceWrapper.build().entityVO(detail)); } @@ -79,8 +83,8 @@ @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入fwDevice") public R<IPage<FwDeviceVO>> page(FwDeviceDTO fwDevice, Query query) { IPage<FwDeviceVO> pages = fwDeviceService.selectFwDevicePage(Condition.getPage(query), fwDevice); return R.data(pages); IPage<FwDeviceEntity> pages = fwDeviceService.selectFwDevicePage(Condition.getPage(query), fwDevice); return R.data(FwDeviceWrapper.build().pageVO(pages)); } /** @@ -110,7 +114,7 @@ @GetMapping("/export-fwDevice") @ApiOperationSupport(order = 5) @ApiOperation(value = "导出数据", notes = "传入fwDevice") @Ignore @ApiIgnore public void exportFwDevice(@ApiIgnore @RequestParam Map<String, Object> fwDevice, BladeUser bladeUser, HttpServletResponse response) { QueryWrapper<FwDeviceEntity> queryWrapper = Condition.getQueryWrapper(fwDevice, FwDeviceEntity.class); //if (!AuthUtil.isAdministrator()) { drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceTrackController.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.FwDeviceTrackDTO; import org.sxkj.fw.device.entity.FwDeviceTrackEntity; import org.sxkj.fw.device.vo.FwDeviceTrackVO; import org.sxkj.fw.device.excel.FwDeviceTrackExcel; import org.sxkj.fw.device.wrapper.FwDeviceTrackWrapper; import org.sxkj.fw.device.service.IFwDeviceTrackService; 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.FwDeviceTrackVO; import org.sxkj.fw.device.wrapper.FwDeviceTrackWrapper; 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,50 +66,25 @@ @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入fwDeviceTrack") public R<FwDeviceTrackVO> detail(FwDeviceTrackEntity fwDeviceTrack) { FwDeviceTrackEntity detail = fwDeviceTrackService.getOne(Condition.getQueryWrapper(fwDeviceTrack)); public R<FwDeviceTrackVO> detail(FwDeviceTrackDTO fwDeviceTrack) { FwDeviceTrackEntity detail = fwDeviceTrackService.getOne(Condition.getQueryWrapper(FwDeviceTrackWrapper.build().entityDTO(fwDeviceTrack))); if (detail == null) { return R.fail("该记录不存在"); } return R.data(FwDeviceTrackWrapper.build().entityVO(detail)); } /** * 设备跟踪流转表 分页 */ @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入fwDeviceTrack") public R<IPage<FwDeviceTrackVO>> list(@ApiIgnore @RequestParam Map<String, Object> fwDeviceTrack, Query query) { IPage<FwDeviceTrackEntity> pages = fwDeviceTrackService.page(Condition.getPage(query), Condition.getQueryWrapper(fwDeviceTrack, FwDeviceTrackEntity.class)); return R.data(FwDeviceTrackWrapper.build().pageVO(pages)); } /** * 设备跟踪流转表 自定义分页 */ @GetMapping("/page") @ApiOperationSupport(order = 3) @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入fwDeviceTrack") public R<IPage<FwDeviceTrackVO>> page(FwDeviceTrackVO fwDeviceTrack, Query query) { IPage<FwDeviceTrackVO> pages = fwDeviceTrackService.selectFwDeviceTrackPage(Condition.getPage(query), fwDeviceTrack); return R.data(pages); } /** * 设备跟踪流转表 新增 */ @PostMapping("/save") @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入fwDeviceTrack") public R save(@Valid @RequestBody FwDeviceTrackEntity fwDeviceTrack) { return R.status(fwDeviceTrackService.save(fwDeviceTrack)); } /** * 设备跟踪流转表 修改 */ @PostMapping("/update") @ApiOperationSupport(order = 5) @ApiOperation(value = "修改", notes = "传入fwDeviceTrack") public R update(@Valid @RequestBody FwDeviceTrackEntity fwDeviceTrack) { return R.status(fwDeviceTrackService.updateById(fwDeviceTrack)); public R<IPage<FwDeviceTrackVO>> page(FwDeviceTrackDTO fwDeviceTrack, Query query) { IPage<FwDeviceTrackEntity> pages = fwDeviceTrackService.selectFwDeviceTrackPage(Condition.getPage(query), fwDeviceTrack); return R.data(FwDeviceTrackWrapper.build().pageVO(pages)); } /** @@ -117,8 +93,8 @@ @PostMapping("/submit") @ApiOperationSupport(order = 6) @ApiOperation(value = "新增或修改", notes = "传入fwDeviceTrack") public R submit(@Valid @RequestBody FwDeviceTrackEntity fwDeviceTrack) { return R.status(fwDeviceTrackService.saveOrUpdate(fwDeviceTrack)); public R submit(@Valid @RequestBody FwDeviceTrackDTO fwDeviceTrack) { return R.status(fwDeviceTrackService.saveOrUpdate(FwDeviceTrackWrapper.build().entityDTO(fwDeviceTrack))); } /** @@ -138,6 +114,7 @@ @GetMapping("/export-fwDeviceTrack") @ApiOperationSupport(order = 9) @ApiOperation(value = "导出数据", notes = "传入fwDeviceTrack") @ApiIgnore public void exportFwDeviceTrack(@ApiIgnore @RequestParam Map<String, Object> fwDeviceTrack, BladeUser bladeUser, HttpServletResponse response) { QueryWrapper<FwDeviceTrackEntity> queryWrapper = Condition.getQueryWrapper(fwDeviceTrack, FwDeviceTrackEntity.class); //if (!AuthUtil.isAdministrator()) { drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceTrackDTO.java
@@ -16,9 +16,13 @@ */ package org.sxkj.fw.device.dto; import io.swagger.annotations.ApiModelProperty; import org.sxkj.fw.device.entity.FwDeviceTrackEntity; import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serializable; import java.util.Date; /** * 设备跟踪流转表 数据传输对象实体类 @@ -27,8 +31,42 @@ * @since 2026-01-08 */ @Data @EqualsAndHashCode(callSuper = true) public class FwDeviceTrackDTO extends FwDeviceTrackEntity { public class FwDeviceTrackDTO implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "主键") private Long id; /** * 设备ID */ @ApiModelProperty(value = "设备ID") private Long deviceId; /** * 出库时间 */ @ApiModelProperty(value = "出库时间") private Date outTime; /** * 出库去向 */ @ApiModelProperty(value = "出库去向") private String outTarget; /** * 用途 */ @ApiModelProperty(value = "用途") private String purpose; /** * 负责人 */ @ApiModelProperty(value = "负责人") private String charger; /** * 联系电话 */ @ApiModelProperty(value = "联系电话") private String contactPhone; } drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.java
@@ -41,7 +41,7 @@ * @param fwDevice * @return */ List<FwDeviceVO> selectFwDevicePage(IPage page, FwDeviceDTO fwDevice); List<FwDeviceEntity> selectFwDevicePage(IPage page, FwDeviceDTO fwDevice); /** drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceTrackMapper.java
@@ -16,13 +16,14 @@ */ package org.sxkj.fw.device.mapper; import org.sxkj.fw.device.entity.FwDeviceTrackEntity; import org.sxkj.fw.device.vo.FwDeviceTrackVO; import org.sxkj.fw.device.excel.FwDeviceTrackExcel; 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.FwDeviceTrackDTO; import org.sxkj.fw.device.entity.FwDeviceTrackEntity; import org.sxkj.fw.device.excel.FwDeviceTrackExcel; import java.util.List; /** @@ -40,7 +41,7 @@ * @param fwDeviceTrack * @return */ List<FwDeviceTrackVO> selectFwDeviceTrackPage(IPage page, FwDeviceTrackVO fwDeviceTrack); List<FwDeviceTrackEntity> selectFwDeviceTrackPage(IPage page, FwDeviceTrackDTO fwDeviceTrack); /** drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceTrackMapper.xml
@@ -23,7 +23,16 @@ <select id="selectFwDeviceTrackPage" resultMap="fwDeviceTrackResultMap"> select * from ja_fw_device_track where is_deleted = 0 select * from ja_fw_device_track <where> is_deleted = 0 <if test="param2.id != null and param2.id != ''"> and id = #{param2.id} </if> <if test="param2.deviceId != null and param2.deviceId != ''"> and device_id = #{param2.deviceId} </if> </where> </select> drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceService.java
@@ -39,7 +39,7 @@ * @param fwDevice * @return */ IPage<FwDeviceVO> selectFwDevicePage(IPage<FwDeviceVO> page, FwDeviceDTO fwDevice); IPage<FwDeviceEntity> selectFwDevicePage(IPage<FwDeviceEntity> page, FwDeviceDTO fwDevice); /** drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceTrackService.java
@@ -17,6 +17,7 @@ package org.sxkj.fw.device.service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import org.sxkj.fw.device.dto.FwDeviceTrackDTO; import org.sxkj.fw.device.entity.FwDeviceTrackEntity; import org.sxkj.fw.device.vo.FwDeviceTrackVO; import org.sxkj.fw.device.excel.FwDeviceTrackExcel; @@ -38,7 +39,7 @@ * @param fwDeviceTrack * @return */ IPage<FwDeviceTrackVO> selectFwDeviceTrackPage(IPage<FwDeviceTrackVO> page, FwDeviceTrackVO fwDeviceTrack); IPage<FwDeviceTrackEntity> selectFwDeviceTrackPage(IPage<FwDeviceTrackEntity> page, FwDeviceTrackDTO fwDeviceTrack); /** drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java
@@ -38,7 +38,7 @@ public class FwDeviceServiceImpl extends BaseServiceImpl<FwDeviceMapper, FwDeviceEntity> implements IFwDeviceService { @Override public IPage<FwDeviceVO> selectFwDevicePage(IPage<FwDeviceVO> page, FwDeviceDTO fwDevice) { public IPage<FwDeviceEntity> selectFwDevicePage(IPage<FwDeviceEntity> page, FwDeviceDTO fwDevice) { return page.setRecords(baseMapper.selectFwDevicePage(page, fwDevice)); } drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceTrackServiceImpl.java
@@ -16,6 +16,7 @@ */ package org.sxkj.fw.device.service.impl; import org.sxkj.fw.device.dto.FwDeviceTrackDTO; import org.sxkj.fw.device.entity.FwDeviceTrackEntity; import org.sxkj.fw.device.vo.FwDeviceTrackVO; import org.sxkj.fw.device.excel.FwDeviceTrackExcel; @@ -37,7 +38,7 @@ public class FwDeviceTrackServiceImpl extends BaseServiceImpl<FwDeviceTrackMapper, FwDeviceTrackEntity> implements IFwDeviceTrackService { @Override public IPage<FwDeviceTrackVO> selectFwDeviceTrackPage(IPage<FwDeviceTrackVO> page, FwDeviceTrackVO fwDeviceTrack) { public IPage<FwDeviceTrackEntity> selectFwDeviceTrackPage(IPage<FwDeviceTrackEntity> page, FwDeviceTrackDTO fwDeviceTrack) { return page.setRecords(baseMapper.selectFwDeviceTrackPage(page, fwDeviceTrack)); } drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceTrackVO.java
@@ -16,10 +16,14 @@ */ package org.sxkj.fw.device.vo; import io.swagger.annotations.ApiModelProperty; import org.sxkj.fw.device.entity.FwDeviceTrackEntity; import org.springblade.core.tool.node.INode; import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serializable; import java.util.Date; /** * 设备跟踪流转表 视图实体类 @@ -28,8 +32,42 @@ * @since 2026-01-08 */ @Data @EqualsAndHashCode(callSuper = true) public class FwDeviceTrackVO extends FwDeviceTrackEntity { public class FwDeviceTrackVO implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "主键") private Long id; /** * 设备ID */ @ApiModelProperty(value = "设备ID") private Long deviceId; /** * 出库时间 */ @ApiModelProperty(value = "出库时间") private Date outTime; /** * 出库去向 */ @ApiModelProperty(value = "出库去向") private String outTarget; /** * 用途 */ @ApiModelProperty(value = "用途") private String purpose; /** * 负责人 */ @ApiModelProperty(value = "负责人") private String charger; /** * 联系电话 */ @ApiModelProperty(value = "联系电话") private String contactPhone; } drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/FwDeviceVO.java
@@ -24,6 +24,8 @@ import lombok.EqualsAndHashCode; import org.sxkj.system.cache.SysCache; import java.io.Serializable; /** * 设备表 视图实体类 * @@ -32,7 +34,7 @@ */ @Data @Getter public class FwDeviceVO { public class FwDeviceVO implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "主键") @@ -108,7 +110,6 @@ if (belongDept == null) { return null; } System.out.println("12312312312:" + SysCache.getDeptName(belongDept)); return SysCache.getDeptName(belongDept); } drone-service/drone-fw/src/main/java/org/sxkj/fw/device/wrapper/FwDeviceTrackWrapper.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.FwDeviceTrackDTO; import org.sxkj.fw.device.entity.FwDeviceTrackEntity; import org.sxkj.fw.device.vo.FwDeviceTrackVO; import java.util.Objects; /** @@ -36,14 +38,11 @@ @Override public FwDeviceTrackVO entityVO(FwDeviceTrackEntity fwDeviceTrack) { FwDeviceTrackVO fwDeviceTrackVO = Objects.requireNonNull(BeanUtil.copy(fwDeviceTrack, FwDeviceTrackVO.class)); return Objects.requireNonNull(BeanUtil.copy(fwDeviceTrack, FwDeviceTrackVO.class)); } //User createUser = UserCache.getUser(fwDeviceTrack.getCreateUser()); //User updateUser = UserCache.getUser(fwDeviceTrack.getUpdateUser()); //fwDeviceTrackVO.setCreateUserName(createUser.getName()); //fwDeviceTrackVO.setUpdateUserName(updateUser.getName()); return fwDeviceTrackVO; public FwDeviceTrackEntity entityDTO(FwDeviceTrackDTO fwDevice) { return Objects.requireNonNull(BeanUtil.copy(fwDevice, FwDeviceTrackEntity.class)); }