| | |
| | | */ |
| | | 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; |
| | | |
| | | /** |
| | | * 设备表 控制器 |
| | |
| | | @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)); |
| | | } |
| | | |
| | |
| | | @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)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @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()) { |