feat: 天然气实时数据相关接口
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
package com.jero.modules.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.jero.common.api.vo.Results;
|
||||
import com.jero.modules.entity.KhNgRealtimeData;
|
||||
import com.jero.modules.service.IKhNgRealtimeDataService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 天然气数据远传终端实时数据
|
||||
* @Author: jero-boot
|
||||
* @Date: 2024-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "天然气数据远传终端实时数据")
|
||||
@RestController
|
||||
@RequestMapping("/cbta/khNgRealtimeData")
|
||||
@Slf4j
|
||||
public class KhNgRealtimeDataController extends JeroController<KhNgRealtimeData, IKhNgRealtimeDataService> {
|
||||
@Autowired
|
||||
private IKhNgRealtimeDataService khNgRealtimeDataService;
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "天然气数据远传终端实时数据-通过id查询")
|
||||
@ApiOperation(value = "天然气数据远传终端实时数据-通过id查询", notes = "天然气数据远传终端实时数据-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Results<KhNgRealtimeData> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
KhNgRealtimeData khNgRealtimeData = khNgRealtimeDataService.queryById(id);
|
||||
if (khNgRealtimeData == null) {
|
||||
return Results.error("未找到对应数据");
|
||||
}
|
||||
return Results.OK(khNgRealtimeData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回动态数据
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "天然气数据远传终端实时数据-返回动态数据")
|
||||
@ApiOperation(value = "天然气数据远传终端实时数据-返回动态数据", notes = "油井实时数据-返回动态数据")
|
||||
@GetMapping(value = "/realtimeDataResults")
|
||||
public Results<Map<String, Object>> realtimeDataResults(@RequestParam(name = "id", required = true) String id) {
|
||||
if (!id.equals("default")) {
|
||||
return Results.error("未找到对应数据");
|
||||
}
|
||||
Map<String, Object> khOilRealtimeData = khNgRealtimeDataService.realtimeDataResults(id);
|
||||
return Results.OK(khOilRealtimeData);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.jero.modules.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 天然气数据远传终端实时数据
|
||||
* @Author: jero-boot
|
||||
* @Date: 2024-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("kh_ng_realtime_data")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="kh_ng_realtime_data对象", description="天然气数据远传终端实时数据")
|
||||
public class KhNgRealtimeData implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private Date updateTime;
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sysOrgCode;
|
||||
/**设备编号*/
|
||||
@Excel(name = "设备编号", width = 15)
|
||||
@ApiModelProperty(value = "设备编号")
|
||||
private String deviceNo;
|
||||
/**实时温度*/
|
||||
@Excel(name = "实时温度", width = 15)
|
||||
@ApiModelProperty(value = "实时温度")
|
||||
private Double realTimeTemp;
|
||||
/**累计流量*/
|
||||
@Excel(name = "累计流量", width = 15)
|
||||
@ApiModelProperty(value = "累计流量")
|
||||
private Double cumulativeFlow;
|
||||
/**实时压力*/
|
||||
@Excel(name = "实时压力", width = 15)
|
||||
@ApiModelProperty(value = "实时压力")
|
||||
private Double realTimePressure;
|
||||
/**标况瞬时*/
|
||||
@Excel(name = "标况瞬时", width = 15)
|
||||
@ApiModelProperty(value = "标况瞬时")
|
||||
private Double stdInstant;
|
||||
/**工况瞬时*/
|
||||
@Excel(name = "工况瞬时", width = 15)
|
||||
@ApiModelProperty(value = "工况瞬时")
|
||||
private Double operationalInstant;
|
||||
/**同步时间*/
|
||||
@Excel(name = "同步时间", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "同步时间")
|
||||
private Date syncDate;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.jero.modules.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.jero.modules.entity.KhNgRealtimeData;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 天然气数据远传终端实时数据
|
||||
* @Author: jero-boot
|
||||
* @Date: 2024-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface KhNgRealtimeDataMapper extends BaseMapper<KhNgRealtimeData> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?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="com.jero.modules.mapper.KhNgRealtimeDataMapper">
|
||||
<resultMap id="KhNgRealtimeDataResultMap" type="com.jero.modules.entity.KhNgRealtimeData">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="device_no" property="deviceNo" />
|
||||
<result column="real_time_temp" property="realTimeTemp" />
|
||||
<result column="cumulative_flow" property="cumulativeFlow" />
|
||||
<result column="real_time_pressure" property="realTimePressure" />
|
||||
<result column="std_instant" property="stdInstant" />
|
||||
<result column="operational_instant" property="operationalInstant" />
|
||||
<result column="sync_date" property="syncDate" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.jero.modules.service;
|
||||
|
||||
import com.jero.modules.entity.KhNgRealtimeData;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 天然气数据远传终端实时数据
|
||||
* @Author: jero-boot
|
||||
* @Date: 2024-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IKhNgRealtimeDataService extends IService<KhNgRealtimeData> {
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param khNgRealtimeData
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
List<KhNgRealtimeData> queryList(KhNgRealtimeData khNgRealtimeData, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
KhNgRealtimeData queryById(String id);
|
||||
|
||||
/**
|
||||
* 实时数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> realtimeDataResults(String id);
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.jero.modules.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.modules.entity.KhNgRealtimeData;
|
||||
import com.jero.modules.mapper.KhNgRealtimeDataMapper;
|
||||
import com.jero.modules.service.IKhNgRealtimeDataService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 天然气数据远传终端实时数据
|
||||
* @Author: jero-boot
|
||||
* @Date: 2024-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public class KhNgRealtimeDataServiceImpl extends ServiceImpl<KhNgRealtimeDataMapper, KhNgRealtimeData> implements IKhNgRealtimeDataService {
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param khNgRealtimeData
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<KhNgRealtimeData> queryList(KhNgRealtimeData khNgRealtimeData, HttpServletRequest req) {
|
||||
return list(QueryGenerator.initQueryWrapper(khNgRealtimeData, req.getParameterMap()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public KhNgRealtimeData queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> realtimeDataResults(String id) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user