增加GIS地图设备详情数据接口第一版(待完善)
This commit is contained in:
parent
daa2d1d918
commit
1355f06015
@ -0,0 +1,22 @@
|
||||
package com.fastbee.common.model.vo.iot;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 设备数据查询
|
||||
*/
|
||||
@Data
|
||||
public class QueryLogVo {
|
||||
|
||||
private Long deviceId;
|
||||
//开始时间
|
||||
private String startTime;
|
||||
//结束时间
|
||||
private String endTime;
|
||||
/**
|
||||
* 类型:year=年度,btw=时间段,不传默认btw(时间段),非必传项
|
||||
*/
|
||||
private String type="btw";
|
||||
//非必传项,不传默认查询全部图表数据点
|
||||
private String identity;
|
||||
}
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.fastbee.waterele.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -7,70 +8,96 @@ import lombok.EqualsAndHashCode;
|
||||
import com.fastbee.common.annotation.Excel;
|
||||
import com.fastbee.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 灌溉记录对象 ma_guangai_record
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-08-12
|
||||
*/
|
||||
@ApiModel(value = "MaGuangaiRecord",description = "灌溉记录 ma_guangai_record")
|
||||
@ApiModel(value = "MaGuangaiRecord", description = "灌溉记录 ma_guangai_record")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class MaGuangaiRecord extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class MaGuangaiRecord extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 序号 */
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/** 设备编号 */
|
||||
/**
|
||||
* 设备编号
|
||||
*/
|
||||
@Excel(name = "设备编号")
|
||||
@ApiModelProperty("设备编号")
|
||||
private String devSn;
|
||||
|
||||
/** 开泵时间 */
|
||||
/**
|
||||
* 开泵时间
|
||||
*/
|
||||
@Excel(name = "开泵时间")
|
||||
@ApiModelProperty("开泵时间")
|
||||
private Long startTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/** 关泵时间 */
|
||||
/**
|
||||
* 关泵时间
|
||||
*/
|
||||
@Excel(name = "关泵时间")
|
||||
@ApiModelProperty("关泵时间")
|
||||
private Long endTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
/** 灌溉最新上报时间 */
|
||||
/**
|
||||
* 灌溉最新上报时间
|
||||
*/
|
||||
@Excel(name = "灌溉最新上报时间")
|
||||
@ApiModelProperty("灌溉最新上报时间")
|
||||
private Long lastTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastTime;
|
||||
|
||||
/** 卡编号 */
|
||||
/**
|
||||
* 卡编号
|
||||
*/
|
||||
@Excel(name = "卡编号")
|
||||
@ApiModelProperty("卡编号")
|
||||
private String cardId;
|
||||
|
||||
/** 区域号 */
|
||||
/**
|
||||
* 区域号
|
||||
*/
|
||||
@Excel(name = "区域号")
|
||||
@ApiModelProperty("区域号")
|
||||
private String areaCode;
|
||||
|
||||
/** 卡内余额 */
|
||||
/**
|
||||
* 卡内余额
|
||||
*/
|
||||
@Excel(name = "卡内余额")
|
||||
@ApiModelProperty("卡内余额")
|
||||
private String userBalance;
|
||||
|
||||
/** 本次用水量 */
|
||||
/**
|
||||
* 本次用水量
|
||||
*/
|
||||
@Excel(name = "本次用水量")
|
||||
@ApiModelProperty("本次用水量")
|
||||
private String curFlow;
|
||||
|
||||
/** 本次用电量 */
|
||||
/**
|
||||
* 本次用电量
|
||||
*/
|
||||
@Excel(name = "本次用电量")
|
||||
@ApiModelProperty("本次用电量")
|
||||
private String curEle;
|
||||
|
||||
/** 灌溉状态 */
|
||||
/**
|
||||
* 灌溉状态
|
||||
*/
|
||||
@Excel(name = "灌溉状态")
|
||||
@ApiModelProperty("灌溉状态")
|
||||
@ApiModelProperty("灌溉状态:1=开始灌溉,2=结束灌溉")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 当前动作 */
|
||||
@Excel(name = "当前动作")
|
||||
@ApiModelProperty("当前动作")
|
||||
@ApiModelProperty("当前动作:timeMsg=灌溉定时报,startPump=开始灌溉,stopPump=停止灌溉,safeMsg=定时报")
|
||||
private String action;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,37 @@
|
||||
package com.fastbee.waterele.domain.dto;
|
||||
|
||||
import com.fastbee.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 灌溉记录查询入参
|
||||
*/
|
||||
@Data
|
||||
public class MaGuangaiRecordDto {
|
||||
|
||||
/** 设备编号 */
|
||||
private String devSn;
|
||||
/** 开泵开始时间 */
|
||||
private String startBeginTime;
|
||||
/** 开泵结束时间 */
|
||||
private String startEndTime;
|
||||
/** 关泵开始时间 */
|
||||
private String endBeginTime;
|
||||
/** 关泵结束时间 */
|
||||
private String endEndTime;
|
||||
|
||||
/** 卡编号 */
|
||||
private String cardId;
|
||||
|
||||
/** 区域号 */
|
||||
private String areaCode;
|
||||
|
||||
/** 灌溉状态 */
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
private Long deviceId;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.fastbee.waterele.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MaWatereleRecordDto {
|
||||
|
||||
/** 设备编号 */
|
||||
private String devSn;
|
||||
|
||||
/** 工作状态:0=关泵,1=开泵 */
|
||||
private Integer workstate;
|
||||
/** 卡编号 */
|
||||
private String cardid;
|
||||
|
||||
/** 区域号 */
|
||||
private String areacode;
|
||||
|
||||
/** 当前动作:timeMsg=灌溉定时报,startPump=开始灌溉,stopPump=停止灌溉,safeMsg=定时报 */
|
||||
private String action;
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
private Long deviceId;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user