增加GIS地图设备详情数据接口第一版(待完善)
This commit is contained in:
@ -0,0 +1,115 @@
|
||||
package com.fastbee.data.controller.devicedetail;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.fastbee.common.core.controller.BaseController;
|
||||
import com.fastbee.common.core.domain.AjaxResult;
|
||||
import com.fastbee.common.model.vo.iot.QueryLogVo;
|
||||
import com.fastbee.common.utils.StringUtils;
|
||||
import com.fastbee.data.service.devicedetail.IDeviceDetailService;
|
||||
import com.fastbee.iot.domain.Device;
|
||||
import com.fastbee.iot.model.DeviceHistoryParam;
|
||||
import com.fastbee.waterele.domain.MaWatereleRecord;
|
||||
import com.fastbee.waterele.domain.dto.MaGuangaiRecordDto;
|
||||
import com.fastbee.waterele.domain.dto.MaWatereleRecordDto;
|
||||
import com.fastbee.xunjian.domain.XjInspectionRecords;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "设备详情数据")
|
||||
@RestController
|
||||
@RequestMapping("/device/detail")
|
||||
public class DeviceDetailController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
IDeviceDetailService deviceDetailService;
|
||||
|
||||
/**
|
||||
* 查询设备刷卡记录
|
||||
* @param maWatereleRecordDto 传参
|
||||
* @return com.fastbee.common.core.domain.AjaxResult
|
||||
*/
|
||||
@ApiOperation("查询刷卡记录")
|
||||
@GetMapping("/shuakaRecord")
|
||||
public AjaxResult shuakaRecord(MaWatereleRecordDto maWatereleRecordDto)
|
||||
{
|
||||
if (null == maWatereleRecordDto.getDeviceId() || maWatereleRecordDto.getDeviceId() == 0L) {
|
||||
return AjaxResult.error("请选择设备");
|
||||
}
|
||||
List<MaWatereleRecord> list = deviceDetailService.shuakaRecord(maWatereleRecordDto);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询灌溉记录
|
||||
* @param maWatereleRecordDto 传参
|
||||
* @return com.fastbee.common.core.domain.AjaxResult
|
||||
*/
|
||||
@ApiOperation("查询灌溉记录")
|
||||
@GetMapping("/guangaiRecord")
|
||||
public AjaxResult guangaiRecord(MaGuangaiRecordDto maWatereleRecordDto)
|
||||
{
|
||||
if (null == maWatereleRecordDto.getDeviceId() || maWatereleRecordDto.getDeviceId() == 0L) {
|
||||
return AjaxResult.error("请选择设备");
|
||||
}
|
||||
List<MaGuangaiRecordDto> list = deviceDetailService.guangaiRecord(maWatereleRecordDto);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取绑定设备列表
|
||||
* @param ids 传参
|
||||
* @return com.fastbee.common.core.domain.AjaxResult
|
||||
*/
|
||||
@ApiOperation("获取绑定设备列表")
|
||||
@GetMapping("/getBindDevices")
|
||||
public AjaxResult getBindDevices(String ids)
|
||||
{
|
||||
List<Device> list = deviceDetailService.getBindDevices(ids);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询供电数据
|
||||
* @param queryLogVo 传参
|
||||
* @return com.fastbee.common.core.domain.AjaxResult
|
||||
*/
|
||||
@ApiOperation("查询供电数据")
|
||||
@GetMapping("/gongdianChart")
|
||||
public AjaxResult gongdianChart(QueryLogVo queryLogVo)
|
||||
{
|
||||
if (null == queryLogVo.getDeviceId() || queryLogVo.getDeviceId() == 0L) {
|
||||
return AjaxResult.error("请选择设备");
|
||||
}
|
||||
List<HashMap<String, Object>> list = deviceDetailService.gongdianChart(queryLogVo);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询巡检记录
|
||||
* @param queryLogVo 传参
|
||||
* @return com.fastbee.common.core.domain.AjaxResult
|
||||
*/
|
||||
@ApiOperation("查询巡检记录")
|
||||
@GetMapping("/xunjianRecord")
|
||||
public AjaxResult xunjianRecord(QueryLogVo queryLogVo)
|
||||
{
|
||||
if (null == queryLogVo.getDeviceId() || queryLogVo.getDeviceId() == 0L) {
|
||||
return AjaxResult.error("请选择设备");
|
||||
}
|
||||
List<XjInspectionRecords> list = deviceDetailService.xunjianRecord(queryLogVo);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.fastbee.data.service.devicedetail;
|
||||
|
||||
import com.fastbee.common.model.vo.iot.QueryLogVo;
|
||||
import com.fastbee.iot.domain.Device;
|
||||
import com.fastbee.waterele.domain.MaWatereleRecord;
|
||||
import com.fastbee.waterele.domain.dto.MaGuangaiRecordDto;
|
||||
import com.fastbee.waterele.domain.dto.MaWatereleRecordDto;
|
||||
import com.fastbee.xunjian.domain.XjInspectionRecords;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public interface IDeviceDetailService {
|
||||
|
||||
/**
|
||||
* 获取刷卡记录
|
||||
* @param maWatereleRecordDto
|
||||
* @return
|
||||
*/
|
||||
List<MaWatereleRecord> shuakaRecord(MaWatereleRecordDto maWatereleRecordDto);
|
||||
|
||||
List<MaGuangaiRecordDto> guangaiRecord(MaGuangaiRecordDto maWatereleRecordDto);
|
||||
|
||||
List<Device> getBindDevices(String ids);
|
||||
|
||||
List<HashMap<String, Object>> gongdianChart(QueryLogVo queryLogVo);
|
||||
|
||||
List<XjInspectionRecords> xunjianRecord(QueryLogVo queryLogVo);
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.fastbee.data.service.devicedetail.impl;
|
||||
|
||||
import com.fastbee.common.model.vo.iot.QueryLogVo;
|
||||
import com.fastbee.data.service.devicedetail.IDeviceDetailService;
|
||||
import com.fastbee.iot.domain.Device;
|
||||
import com.fastbee.iot.mapper.DeviceMapper;
|
||||
import com.fastbee.waterele.domain.MaWatereleRecord;
|
||||
import com.fastbee.waterele.domain.dto.MaGuangaiRecordDto;
|
||||
import com.fastbee.waterele.domain.dto.MaWatereleRecordDto;
|
||||
import com.fastbee.xunjian.domain.XjInspectionRecords;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class DeviceDetailServiceImpl implements IDeviceDetailService {
|
||||
|
||||
private final DeviceMapper deviceMapper;
|
||||
|
||||
public DeviceDetailServiceImpl(DeviceMapper deviceMapper) {
|
||||
this.deviceMapper = deviceMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MaWatereleRecord> shuakaRecord(MaWatereleRecordDto maWatereleRecordDto) {
|
||||
//todo
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MaGuangaiRecordDto> guangaiRecord(MaGuangaiRecordDto maWatereleRecordDto) {
|
||||
//todo
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Device> getBindDevices(String ids) {
|
||||
String[] idArray = ids.split(",");
|
||||
List<Long> idList = new ArrayList<>();
|
||||
for (String id : idArray) {
|
||||
try {
|
||||
idList.add(Long.parseLong(id));
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
List<Device> devices = deviceMapper.selectDeviceListByDeviceIds(idList);
|
||||
return devices;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, Object>> gongdianChart(QueryLogVo queryLogVo) {
|
||||
//todo
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<XjInspectionRecords> xunjianRecord(QueryLogVo queryLogVo) {
|
||||
//todo
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user