1、灌溉记录从php获取

2、设备接口改成无需权限获取
This commit is contained in:
wyw
2024-08-15 23:17:32 +08:00
parent 5f40c70a81
commit 30b310e4c8
6 changed files with 140 additions and 34 deletions

View File

@ -60,7 +60,7 @@ public class DeviceController extends BaseController {
/**
* 查询设备列表
*/
@PreAuthorize("@ss.hasPermi('iot:device:list')")
// @PreAuthorize("@ss.hasPermi('iot:device:list')")
@GetMapping("/list")
@ApiOperation("设备分页列表")
public TableDataInfo list(Device device) {
@ -75,7 +75,7 @@ public class DeviceController extends BaseController {
/**
* 查询未分配授权码设备列表
*/
@PreAuthorize("@ss.hasPermi('iot:device:list')")
// @PreAuthorize("@ss.hasPermi('iot:device:list')")
@GetMapping("/unAuthlist")
@ApiOperation("设备分页列表")
public TableDataInfo unAuthlist(Device device) {
@ -89,7 +89,7 @@ public class DeviceController extends BaseController {
/**
* 查询分组可添加设备
*/
@PreAuthorize("@ss.hasPermi('iot:device:list')")
// @PreAuthorize("@ss.hasPermi('iot:device:list')")
@GetMapping("/listByGroup")
@ApiOperation("查询分组可添加设备分页列表")
public TableDataInfo listByGroup(Device device) {
@ -108,7 +108,7 @@ public class DeviceController extends BaseController {
/**
* 查询设备简短列表,主页列表数据
*/
@PreAuthorize("@ss.hasPermi('iot:device:list')")
// @PreAuthorize("@ss.hasPermi('iot:device:list')")
@GetMapping("/shortList")
@ApiOperation("设备分页简短列表")
public TableDataInfo shortList(Device device) {
@ -134,7 +134,7 @@ public class DeviceController extends BaseController {
/**
* 查询所有设备简短列表
*/
@PreAuthorize("@ss.hasPermi('iot:device:list')")
// @PreAuthorize("@ss.hasPermi('iot:device:list')")
@GetMapping("/all")
@ApiOperation("查询所有设备简短列表")
public TableDataInfo allShortList() {
@ -147,7 +147,7 @@ public class DeviceController extends BaseController {
/**
* 导出设备列表
*/
@PreAuthorize("@ss.hasPermi('iot:device:export')")
// @PreAuthorize("@ss.hasPermi('iot:device:export')")
@Log(title = "设备", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ApiOperation("导出设备")
@ -160,7 +160,7 @@ public class DeviceController extends BaseController {
/**
* 获取设备详细信息
*/
@PreAuthorize("@ss.hasPermi('iot:device:query')")
// @PreAuthorize("@ss.hasPermi('iot:device:query')")
@GetMapping(value = "/{deviceId}")
@ApiOperation("获取设备详情")
public AjaxResult getInfo(@PathVariable("deviceId") Long deviceId) {
@ -185,7 +185,7 @@ public class DeviceController extends BaseController {
/**
* 设备数据同步
*/
@PreAuthorize("@ss.hasPermi('iot:device:query')")
// @PreAuthorize("@ss.hasPermi('iot:device:query')")
@GetMapping(value = "/synchronization/{serialNumber}")
@ApiOperation("设备数据同步")
public AjaxResult deviceSynchronization(@PathVariable("serialNumber") String serialNumber) {
@ -195,7 +195,7 @@ public class DeviceController extends BaseController {
/**
* 根据设备编号详细信息
*/
@PreAuthorize("@ss.hasPermi('iot:device:query')")
// @PreAuthorize("@ss.hasPermi('iot:device:query')")
@GetMapping(value = "/getDeviceBySerialNumber/{serialNumber}")
@ApiOperation("根据设备编号获取设备详情")
public AjaxResult getInfoBySerialNumber(@PathVariable("serialNumber") String serialNumber) {
@ -205,7 +205,7 @@ public class DeviceController extends BaseController {
/**
* 获取设备统计信息
*/
@PreAuthorize("@ss.hasPermi('iot:device:query')")
// @PreAuthorize("@ss.hasPermi('iot:device:query')")
@GetMapping(value = "/statistic")
@ApiOperation("获取设备统计信息")
public AjaxResult getDeviceStatistic() {
@ -215,7 +215,7 @@ public class DeviceController extends BaseController {
/**
* 获取设备详细信息
*/
@PreAuthorize("@ss.hasPermi('iot:device:query')")
// @PreAuthorize("@ss.hasPermi('iot:device:query')")
@GetMapping(value = "/runningStatus")
@ApiOperation("获取设备详情和运行状态")
public AjaxResult getRunningStatusInfo(Long deviceId) {
@ -225,7 +225,7 @@ public class DeviceController extends BaseController {
/**
* 新增设备
*/
@PreAuthorize("@ss.hasPermi('iot:device:add')")
// @PreAuthorize("@ss.hasPermi('iot:device:add')")
@Log(title = "添加设备", businessType = BusinessType.INSERT)
@PostMapping
@ApiOperation("添加设备")
@ -237,7 +237,7 @@ public class DeviceController extends BaseController {
* TODO --APP
* 终端用户绑定设备
*/
@PreAuthorize("@ss.hasPermi('iot:device:add')")
// @PreAuthorize("@ss.hasPermi('iot:device:add')")
@Log(title = "设备关联用户", businessType = BusinessType.UPDATE)
@PostMapping("/relateUser")
@ApiOperation("终端-设备关联用户")
@ -254,7 +254,7 @@ public class DeviceController extends BaseController {
/**
* 修改设备
*/
@PreAuthorize("@ss.hasPermi('iot:device:edit')")
// @PreAuthorize("@ss.hasPermi('iot:device:edit')")
@Log(title = "修改设备", businessType = BusinessType.UPDATE)
@PutMapping
@ApiOperation("修改设备")
@ -265,7 +265,7 @@ public class DeviceController extends BaseController {
/**
* 重置设备状态
*/
@PreAuthorize("@ss.hasPermi('iot:device:edit')")
// @PreAuthorize("@ss.hasPermi('iot:device:edit')")
@Log(title = "重置设备状态", businessType = BusinessType.UPDATE)
@PutMapping("/reset/{serialNumber}")
@ApiOperation("重置设备状态")
@ -278,7 +278,7 @@ public class DeviceController extends BaseController {
/**
* 删除设备
*/
@PreAuthorize("@ss.hasPermi('iot:device:remove')")
// @PreAuthorize("@ss.hasPermi('iot:device:remove')")
@Log(title = "删除设备", businessType = BusinessType.DELETE)
@DeleteMapping("/{deviceIds}")
@ApiOperation("批量删除设备")
@ -289,7 +289,7 @@ public class DeviceController extends BaseController {
/**
* 生成设备编号
*/
@PreAuthorize("@ss.hasPermi('iot:device:add')")
// @PreAuthorize("@ss.hasPermi('iot:device:add')")
@GetMapping("/generator")
@ApiOperation("生成设备编号")
public AjaxResult generatorDeviceNum(Integer type) {
@ -302,14 +302,14 @@ public class DeviceController extends BaseController {
* @param deviceId 设备主键id
* @return
*/
@PreAuthorize("@ss.hasPermi('iot:device:query')")
// @PreAuthorize("@ss.hasPermi('iot:device:query')")
@GetMapping("/getMqttConnectData")
@ApiOperation("获取设备MQTT连接参数")
public AjaxResult getMqttConnectData(Long deviceId) {
return AjaxResult.success(deviceService.getMqttConnectData(deviceId));
}
@PreAuthorize("@ss.hasPermi('iot:device:add')")
// @PreAuthorize("@ss.hasPermi('iot:device:add')")
@ApiOperation("下载设备导入模板")
@PostMapping("/uploadTemplate")
public void uploadTemplate(HttpServletResponse response, @RequestParam(name = "type") Integer type) {
@ -323,7 +323,7 @@ public class DeviceController extends BaseController {
}
}
@PreAuthorize("@ss.hasPermi('iot:device:add')")
// @PreAuthorize("@ss.hasPermi('iot:device:add')")
@ApiOperation("批量导入设备")
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
@PostMapping("/importData")
@ -344,7 +344,7 @@ public class DeviceController extends BaseController {
return StringUtils.isEmpty(message) ? success(MessageUtils.message("import.success")) : error(message);
}
@PreAuthorize("@ss.hasPermi('iot:device:assignment')")
// @PreAuthorize("@ss.hasPermi('iot:device:assignment')")
@ApiOperation("批量导入分配设备")
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
@PostMapping("/importAssignmentData")
@ -372,7 +372,7 @@ public class DeviceController extends BaseController {
* @return com.fastbee.common.core.domain.AjaxResult
* @param: deviceIds 设备id字符串
*/
@PreAuthorize("@ss.hasPermi('iot:device:assignment')")
// @PreAuthorize("@ss.hasPermi('iot:device:assignment')")
@ApiOperation("分配设备")
@PostMapping("/assignment")
public AjaxResult assignment(@RequestParam("deptId") Long deptId, @RequestParam("deviceIds") String deviceIds) {
@ -391,7 +391,7 @@ public class DeviceController extends BaseController {
* @return com.fastbee.common.core.domain.AjaxResult
* @param: deviceIds 设备id字符串
*/
@PreAuthorize("@ss.hasPermi('iot:device:recovery')")
// @PreAuthorize("@ss.hasPermi('iot:device:recovery')")
@ApiOperation("回收设备")
@PostMapping("/recovery")
public AjaxResult recovery(@RequestParam("deviceIds") String deviceIds, @RequestParam("recoveryDeptId") Long recoveryDeptId) {
@ -404,7 +404,7 @@ public class DeviceController extends BaseController {
/**
* 批量生成设备编号
*/
@PreAuthorize("@ss.hasPermi('iot:device:batchGenerator')")
// @PreAuthorize("@ss.hasPermi('iot:device:batchGenerator')")
@PostMapping("/batchGenerator")
@ApiOperation("批量生成设备编号")
public void batchGeneratorDeviceNum(HttpServletResponse response, @RequestParam("count") Integer count) {
@ -425,7 +425,7 @@ public class DeviceController extends BaseController {
/**
* 查询变量概况
*/
@PreAuthorize("@ss.hasPermi('iot:device:query')")
// @PreAuthorize("@ss.hasPermi('iot:device:query')")
@GetMapping("/listThingsModel")
@ApiOperation("查询变量概况")
public TableDataInfo listThingsModel(Integer pageNum, Integer pageSize, Long deviceId, String modelName, Integer type) {

View File

@ -46,10 +46,10 @@ public class MaGuangaiRecordController extends BaseController
@ApiOperation("查询灌溉记录列表")
public TableDataInfo list(MaGuangaiRecord maGuangaiRecord)
{
startPage();
List<MaGuangaiRecord> list
// startPage();
TableDataInfo tableDataInfo
= maGuangaiRecordService.selectMaGuangaiRecordList(maGuangaiRecord);
return getDataTable(list);
return tableDataInfo;
}
/**
@ -60,7 +60,8 @@ public class MaGuangaiRecordController extends BaseController
@PostMapping("/export")
public void export(HttpServletResponse response, MaGuangaiRecord maGuangaiRecord)
{
List<MaGuangaiRecord> list = maGuangaiRecordService.selectMaGuangaiRecordList(maGuangaiRecord);
TableDataInfo tableDataInfo = maGuangaiRecordService.selectMaGuangaiRecordList(maGuangaiRecord);
List<MaGuangaiRecord> list = (List<MaGuangaiRecord>) tableDataInfo.getRows();
ExcelUtil<MaGuangaiRecord> util = new ExcelUtil<MaGuangaiRecord>(MaGuangaiRecord.class);
util.exportExcel(response, list, "灌溉记录数据");
}