drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/controller/FwDevicePerShareController.java
New file @@ -0,0 +1,151 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.sxkj.fw.fwDevicePerShare.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.fwDevicePerShare.entity.FwDevicePerShareEntity; import org.sxkj.fw.fwDevicePerShare.vo.FwDevicePerShareVO; import org.sxkj.fw.fwDevicePerShare.excel.FwDevicePerShareExcel; import org.sxkj.fw.fwDevicePerShare.wrapper.FwDevicePerShareWrapper; import org.sxkj.fw.fwDevicePerShare.service.IFwDevicePerShareService; 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 springfox.documentation.annotations.ApiIgnore; import java.util.Map; import java.util.List; import javax.servlet.http.HttpServletResponse; /** * 设备权限分享表 控制器 * * @author lw * @since 2026-01-28 */ @RestController @AllArgsConstructor @RequestMapping("fwDevicePerShare/fwDevicePerShare") @Api(value = "设备权限分享表", tags = "设备权限分享表接口") public class FwDevicePerShareController extends BladeController { private final IFwDevicePerShareService fwDevicePerShareService; /** * 设备权限分享表 详情 */ @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入fwDevicePerShare") public R<FwDevicePerShareVO> detail(FwDevicePerShareEntity fwDevicePerShare) { FwDevicePerShareEntity detail = fwDevicePerShareService.getOne(Condition.getQueryWrapper(fwDevicePerShare)); return R.data(FwDevicePerShareWrapper.build().entityVO(detail)); } /** * 设备权限分享表 分页 */ @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("/page") @ApiOperationSupport(order = 3) @ApiOperation(value = "分页", notes = "传入fwDevicePerShare") public R<IPage<FwDevicePerShareVO>> page(FwDevicePerShareVO fwDevicePerShare, Query query) { IPage<FwDevicePerShareVO> pages = fwDevicePerShareService.selectFwDevicePerSharePage(Condition.getPage(query), fwDevicePerShare); return R.data(pages); } /** * 设备权限分享表 新增 */ @PostMapping("/save") @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入fwDevicePerShare") public R save(@Valid @RequestBody FwDevicePerShareEntity fwDevicePerShare) { return R.status(fwDevicePerShareService.save(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("/remove") @ApiOperationSupport(order = 7) @ApiOperation(value = "逻辑删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { return R.status(fwDevicePerShareService.deleteLogic(Func.toLongList(ids))); } /** * 导出数据 */ @GetMapping("/export-fwDevicePerShare") @ApiOperationSupport(order = 9) @ApiOperation(value = "导出数据", notes = "传入fwDevicePerShare") public void exportFwDevicePerShare(@ApiIgnore @RequestParam Map<String, Object> fwDevicePerShare, BladeUser bladeUser, HttpServletResponse response) { QueryWrapper<FwDevicePerShareEntity> queryWrapper = Condition.getQueryWrapper(fwDevicePerShare, FwDevicePerShareEntity.class); //if (!AuthUtil.isAdministrator()) { // queryWrapper.lambda().eq(FwDevicePerShare::getTenantId, bladeUser.getTenantId()); //} queryWrapper.lambda().eq(FwDevicePerShareEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); List<FwDevicePerShareExcel> list = fwDevicePerShareService.exportFwDevicePerShare(queryWrapper); ExcelUtil.export(response, "设备权限分享表数据" + DateUtil.time(), "设备权限分享表数据表", list, FwDevicePerShareExcel.class); } } drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/dto/FwDevicePerShareDTO.java
New file @@ -0,0 +1,34 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.sxkj.fw.fwDevicePerShare.dto; import org.sxkj.fw.fwDevicePerShare.entity.FwDevicePerShareEntity; import lombok.Data; import lombok.EqualsAndHashCode; /** * 设备权限分享表 数据传输对象实体类 * * @author lw * @since 2026-01-28 */ @Data @EqualsAndHashCode(callSuper = true) public class FwDevicePerShareDTO extends FwDevicePerShareEntity { private static final long serialVersionUID = 1L; } drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/entity/FwDevicePerShareEntity.java
New file @@ -0,0 +1,65 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.sxkj.fw.fwDevicePerShare.entity; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.BaseEntity; import org.springblade.core.tenant.mp.TenantEntity; /** * 设备权限分享表 实体类 * * @author lw * @since 2026-01-28 */ @Data @TableName("ja_fw_device_per_share") @ApiModel(value = "FwDevicePerShare对象", description = "设备权限分享表") @EqualsAndHashCode(callSuper = true) public class FwDevicePerShareEntity extends BaseEntity { /** * 设备编号 */ @ApiModelProperty(value = "设备编号") private String deviceSn; /** * 借出方部门ID */ @ApiModelProperty(value = "借出方部门ID") private Long loanFromDeptId; /** * 借入方部门ID */ @ApiModelProperty(value = "借入方部门ID") private Long loanToDeptId; /** * 设备权限菜单ID */ @ApiModelProperty(value = "设备权限菜单ID") private String devicePerMenuId; /** * 区域编码 */ @ApiModelProperty(value = "区域编码") private String areaCode; } drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/excel/FwDevicePerShareExcel.java
New file @@ -0,0 +1,80 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.sxkj.fw.fwDevicePerShare.excel; 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; /** * 设备权限分享表 Excel实体类 * * @author lw * @since 2026-01-28 */ @Data @ColumnWidth(25) @HeadRowHeight(20) @ContentRowHeight(18) public class FwDevicePerShareExcel implements Serializable { private static final long serialVersionUID = 1L; /** * 设备编号 */ @ColumnWidth(20) @ExcelProperty("设备编号") private String deviceSn; /** * 借出方部门ID */ @ColumnWidth(20) @ExcelProperty("借出方部门ID") private Long loanFromDeptId; /** * 借入方部门ID */ @ColumnWidth(20) @ExcelProperty("借入方部门ID") private Long loanToDeptId; /** * 设备权限菜单ID */ @ColumnWidth(20) @ExcelProperty("设备权限菜单ID") private String devicePerMenuId; /** * 区域编码 */ @ColumnWidth(20) @ExcelProperty("区域编码") private String areaCode; /** * 删除标志(0存在 1删除) */ @ColumnWidth(20) @ExcelProperty("删除标志(0存在 1删除)") private Byte isDeleted; } drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/mapper/FwDevicePerShareMapper.java
New file @@ -0,0 +1,54 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.sxkj.fw.fwDevicePerShare.mapper; import org.sxkj.fw.fwDevicePerShare.entity.FwDevicePerShareEntity; import org.sxkj.fw.fwDevicePerShare.vo.FwDevicePerShareVO; import org.sxkj.fw.fwDevicePerShare.excel.FwDevicePerShareExcel; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.apache.ibatis.annotations.Param; import java.util.List; /** * 设备权限分享表 Mapper 接口 * * @author lw * @since 2026-01-28 */ public interface FwDevicePerShareMapper extends BaseMapper<FwDevicePerShareEntity> { /** * 自定义分页 * * @param page * @param fwDevicePerShare * @return */ List<FwDevicePerShareVO> selectFwDevicePerSharePage(IPage page, FwDevicePerShareVO fwDevicePerShare); /** * 获取导出数据 * * @param queryWrapper * @return */ List<FwDevicePerShareExcel> exportFwDevicePerShare(@Param("ew") Wrapper<FwDevicePerShareEntity> queryWrapper); } drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/mapper/FwDevicePerShareMapper.xml
New file @@ -0,0 +1,32 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="org.sxkj.fw.fwDevicePerShare.mapper.FwDevicePerShareMapper"> <!-- 通用查询映射结果 --> <resultMap id="fwDevicePerShareResultMap" type="org.sxkj.fw.fwDevicePerShare.entity.FwDevicePerShareEntity"> <result column="id" property="id"/> <result column="device_sn" property="deviceSn"/> <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"/> <result column="create_time" property="createTime"/> <result column="update_user" property="updateUser"/> <result column="update_time" property="updateTime"/> <result column="status" property="status"/> <result column="is_deleted" property="isDeleted"/> </resultMap> <select id="selectFwDevicePerSharePage" resultMap="fwDevicePerShareResultMap"> select * from ja_fw_device_per_share where is_deleted = 0 </select> <select id="exportFwDevicePerShare" resultType="org.sxkj.fw.fwDevicePerShare.excel.FwDevicePerShareExcel"> SELECT * FROM ja_fw_device_per_share ${ew.customSqlSegment} </select> </mapper> drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/service/IFwDevicePerShareService.java
New file @@ -0,0 +1,52 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.sxkj.fw.fwDevicePerShare.service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import org.sxkj.fw.fwDevicePerShare.entity.FwDevicePerShareEntity; import org.sxkj.fw.fwDevicePerShare.vo.FwDevicePerShareVO; import org.sxkj.fw.fwDevicePerShare.excel.FwDevicePerShareExcel; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.core.mp.base.BaseService; import java.util.List; /** * 设备权限分享表 服务类 * * @author lw * @since 2026-01-28 */ public interface IFwDevicePerShareService extends BaseService<FwDevicePerShareEntity> { /** * 自定义分页 * * @param page * @param fwDevicePerShare * @return */ IPage<FwDevicePerShareVO> selectFwDevicePerSharePage(IPage<FwDevicePerShareVO> page, FwDevicePerShareVO fwDevicePerShare); /** * 导出数据 * * @param queryWrapper * @return */ List<FwDevicePerShareExcel> exportFwDevicePerShare(Wrapper<FwDevicePerShareEntity> queryWrapper); } drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/service/impl/FwDevicePerShareServiceImpl.java
New file @@ -0,0 +1,54 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.sxkj.fw.fwDevicePerShare.service.impl; import org.sxkj.fw.fwDevicePerShare.entity.FwDevicePerShareEntity; import org.sxkj.fw.fwDevicePerShare.vo.FwDevicePerShareVO; import org.sxkj.fw.fwDevicePerShare.excel.FwDevicePerShareExcel; import org.sxkj.fw.fwDevicePerShare.mapper.FwDevicePerShareMapper; import org.sxkj.fw.fwDevicePerShare.service.IFwDevicePerShareService; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.core.mp.base.BaseServiceImpl; import java.util.List; /** * 设备权限分享表 服务实现类 * * @author lw * @since 2026-01-28 */ @Service public class FwDevicePerShareServiceImpl extends BaseServiceImpl<FwDevicePerShareMapper, FwDevicePerShareEntity> implements IFwDevicePerShareService { @Override public IPage<FwDevicePerShareVO> selectFwDevicePerSharePage(IPage<FwDevicePerShareVO> page, FwDevicePerShareVO fwDevicePerShare) { return page.setRecords(baseMapper.selectFwDevicePerSharePage(page, fwDevicePerShare)); } @Override public List<FwDevicePerShareExcel> exportFwDevicePerShare(Wrapper<FwDevicePerShareEntity> queryWrapper) { List<FwDevicePerShareExcel> fwDevicePerShareList = baseMapper.exportFwDevicePerShare(queryWrapper); //fwDevicePerShareList.forEach(fwDevicePerShare -> { // fwDevicePerShare.setTypeName(DictCache.getValue(DictEnum.YES_NO, FwDevicePerShare.getType())); //}); return fwDevicePerShareList; } } drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/vo/FwDevicePerShareVO.java
New file @@ -0,0 +1,35 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.sxkj.fw.fwDevicePerShare.vo; import org.sxkj.fw.fwDevicePerShare.entity.FwDevicePerShareEntity; import org.springblade.core.tool.node.INode; import lombok.Data; import lombok.EqualsAndHashCode; /** * 设备权限分享表 视图实体类 * * @author lw * @since 2026-01-28 */ @Data @EqualsAndHashCode(callSuper = true) public class FwDevicePerShareVO extends FwDevicePerShareEntity { private static final long serialVersionUID = 1L; } drone-service/drone-fw/src/main/java/org/sxkj/fw/fwDevicePerShare/wrapper/FwDevicePerShareWrapper.java
New file @@ -0,0 +1,50 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.sxkj.fw.fwDevicePerShare.wrapper; import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.tool.utils.BeanUtil; import org.sxkj.fw.fwDevicePerShare.entity.FwDevicePerShareEntity; import org.sxkj.fw.fwDevicePerShare.vo.FwDevicePerShareVO; import java.util.Objects; /** * 设备权限分享表 包装类,返回视图层所需的字段 * * @author lw * @since 2026-01-28 */ public class FwDevicePerShareWrapper extends BaseEntityWrapper<FwDevicePerShareEntity, FwDevicePerShareVO> { public static FwDevicePerShareWrapper build() { return new FwDevicePerShareWrapper(); } @Override public FwDevicePerShareVO entityVO(FwDevicePerShareEntity fwDevicePerShare) { FwDevicePerShareVO fwDevicePerShareVO = Objects.requireNonNull(BeanUtil.copy(fwDevicePerShare, FwDevicePerShareVO.class)); //User createUser = UserCache.getUser(fwDevicePerShare.getCreateUser()); //User updateUser = UserCache.getUser(fwDevicePerShare.getUpdateUser()); //fwDevicePerShareVO.setCreateUserName(createUser.getName()); //fwDevicePerShareVO.setUpdateUserName(updateUser.getName()); return fwDevicePerShareVO; } }