吉安感知网项目-后端
linwei
2026-01-29 badca50df3e909ab8e0432c16595964e26120e67
共享设备表
4 files modified
77 ■■■■■ changed files
drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/controller/FwDevicePerShareController.java 46 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/dto/FwDevicePerShareDTO.java 24 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/entity/FwDevicePerShareEntity.java 6 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/mapper/FwDevicePerShareMapper.xml 1 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/controller/FwDevicePerShareController.java
@@ -27,10 +27,12 @@
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.BeanUtil;
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.fwDevicePerShare.dto.FwDevicePerShareDTO;
import org.sxkj.fw.fwDevicePerShare.entity.FwDevicePerShareEntity;
import org.sxkj.fw.fwDevicePerShare.vo.FwDevicePerShareVO;
import org.sxkj.fw.fwDevicePerShare.excel.FwDevicePerShareExcel;
@@ -43,6 +45,7 @@
import springfox.documentation.annotations.ApiIgnore;
import java.util.Map;
import java.util.List;
import java.util.Objects;
import javax.servlet.http.HttpServletResponse;
/**
@@ -72,13 +75,13 @@
    /**
     * 设备权限分享表 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入fwDevicePerShare")
    public R<IPage<FwDevicePerShareVO>> list(@ApiIgnore @RequestParam Map<String, Object> fwDevicePerShare, Query query) {
        IPage<FwDevicePerShareEntity> pages = fwDevicePerShareService.page(Condition.getPage(query), Condition.getQueryWrapper(fwDevicePerShare, FwDevicePerShareEntity.class));
        return R.data(FwDevicePerShareWrapper.build().pageVO(pages));
    }
    // @GetMapping("/list")
    // @ApiOperationSupport(order = 2)
    // @ApiOperation(value = "分页", notes = "传入fwDevicePerShare")
    // public R<IPage<FwDevicePerShareVO>> list(@ApiIgnore @RequestParam Map<String, Object> fwDevicePerShare, Query query) {
    //     IPage<FwDevicePerShareEntity> pages = fwDevicePerShareService.page(Condition.getPage(query), Condition.getQueryWrapper(fwDevicePerShare, FwDevicePerShareEntity.class));
    //     return R.data(FwDevicePerShareWrapper.build().pageVO(pages));
    // }
    /**
     * 设备权限分享表 自定义分页
@@ -97,29 +100,30 @@
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入fwDevicePerShare")
    public R save(@Valid @RequestBody FwDevicePerShareEntity fwDevicePerShare) {
        return R.status(fwDevicePerShareService.save(fwDevicePerShare));
    public R save(@Valid @RequestBody FwDevicePerShareDTO fwDevicePerShare) {
        FwDevicePerShareEntity fwDevicePerShareEntity = Objects.requireNonNull(BeanUtil.copy(fwDevicePerShare, FwDevicePerShareEntity.class));
        return R.status(fwDevicePerShareService.save(fwDevicePerShareEntity));
    }
    /**
     * 设备权限分享表 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入fwDevicePerShare")
    public R update(@Valid @RequestBody FwDevicePerShareEntity fwDevicePerShare) {
        return R.status(fwDevicePerShareService.updateById(fwDevicePerShare));
    }
    // @PostMapping("/update")
    // @ApiOperationSupport(order = 5)
    // @ApiOperation(value = "修改", notes = "传入fwDevicePerShare")
    // public R update(@Valid @RequestBody FwDevicePerShareEntity fwDevicePerShare) {
    //     return R.status(fwDevicePerShareService.updateById(fwDevicePerShare));
    // }
    /**
     * 设备权限分享表 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入fwDevicePerShare")
    public R submit(@Valid @RequestBody FwDevicePerShareEntity fwDevicePerShare) {
        return R.status(fwDevicePerShareService.saveOrUpdate(fwDevicePerShare));
    }
    // @PostMapping("/submit")
    // @ApiOperationSupport(order = 6)
    // @ApiOperation(value = "新增或修改", notes = "传入fwDevicePerShare")
    // public R submit(@Valid @RequestBody FwDevicePerShareEntity fwDevicePerShare) {
    //     return R.status(fwDevicePerShareService.saveOrUpdate(fwDevicePerShare));
    // }
    /**
     * 设备权限分享表 删除
drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/dto/FwDevicePerShareDTO.java
@@ -16,9 +16,8 @@
 */
package org.sxkj.fw.fwDevicePerShare.dto;
import org.sxkj.fw.fwDevicePerShare.entity.FwDevicePerShareEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 设备权限分享表 数据传输对象实体类
@@ -27,8 +26,25 @@
 * @since 2026-01-28
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class FwDevicePerShareDTO extends FwDevicePerShareEntity {
public class FwDevicePerShareDTO  {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "设备ID")
    private Long deviceId;
    /**
     * 设备编号
     */
    @ApiModelProperty(value = "设备编号")
    private String deviceSn;
    /**
     * 借出方部门ID
     */
    @ApiModelProperty(value = "借出方部门ID")
    private Long loanFromDeptId;
    /**
     * 借入方部门ID
     */
    @ApiModelProperty(value = "借入方部门ID")
    private Long loanToDeptId;
}
drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/entity/FwDevicePerShareEntity.java
@@ -53,11 +53,7 @@
     */
    @ApiModelProperty(value = "借入方部门ID")
    private Long loanToDeptId;
    /**
     * 设备权限菜单ID
     */
    @ApiModelProperty(value = "设备权限菜单ID")
    private String devicePerMenuId;
    /**
     * 区域编码
     */
drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/mapper/FwDevicePerShareMapper.xml
@@ -9,7 +9,6 @@
        <result column="device_id" property="deviceId"/>
        <result column="loan_from_dept_id" property="loanFromDeptId"/>
        <result column="loan_to_dept_id" property="loanToDeptId"/>
        <result column="device_per_menu_id" property="devicePerMenuId"/>
        <result column="area_code" property="areaCode"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>