6 files added
5 files modified
| | |
| | | List<Map<String, Object>> response = govMonitorPointService.getGovMonitorPointsByOrganizationId(organizationId); |
| | | return ResultMessage.ok(response); |
| | | } |
| | | |
| | | @GetMapping("getGovMonitorPoints") |
| | | @ApiOperation("获取国控站信息") |
| | | public ResultMessage getGovMonitorPoints(){ |
| | | List<GovMonitorPoint> govMonitorPoints = govMonitorPointService.selectPoint(); |
| | | return ResultMessage.ok(govMonitorPoints); |
| | | } |
| | | } |
| | |
| | | package com.moral.api.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.moral.api.pojo.dto.historyAqi.HistoryAqiDto; |
| | | import com.moral.api.pojo.dto.historyFiveMinutely.DeviceAndFiveMinuteDataDTO; |
| | | import com.moral.api.pojo.form.historyFiveMinutely.QueryDeviceAndFiveMinuteDataForm; |
| | | import com.moral.api.pojo.vo.historyFiveMinutely.DeviceAndFiveMinuteDataVO; |
| | | import com.moral.api.pojo.vo.historyFiveMinutely.QueryFiveDataByMacVO; |
| | | import com.moral.api.service.HistoryAqiService; |
| | | import com.moral.api.service.HistoryFiveMinutelyService; |
| | | import com.moral.constant.ResponseCodeEnum; |
| | | import com.moral.constant.ResultMessage; |
| | |
| | | |
| | | @Autowired |
| | | HistoryFiveMinutelyService historyFiveMinutelyService; |
| | | @Autowired |
| | | private HistoryAqiService historyAqiService; |
| | | |
| | | /** |
| | | * @Description: 查询组织区域对应的设备以及对应因子的五分钟数据 |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("historyAqi") |
| | | @ApiOperation("显示国控站设备") |
| | | public ResultMessage historyAqiQuery(String guid){ |
| | | List<HistoryAqiDto> reveal = historyAqiService.reveal(guid); |
| | | return ResultMessage.ok(reveal); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| New file |
| | |
| | | package com.moral.api.entity; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | |
| | | /** |
| | | * <p> |
| | | * 国控aqi数据表 |
| | | * </p> |
| | | * |
| | | * @author moral |
| | | * @since 2024-11-13 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class HistoryAqi extends Model<HistoryAqi> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 国控/省控/县控站点id |
| | | */ |
| | | private String guid; |
| | | |
| | | /** |
| | | * 时间 |
| | | */ |
| | | private Date time; |
| | | |
| | | /** |
| | | * 数据 |
| | | */ |
| | | private String value; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return null; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.moral.api.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.moral.api.entity.HistoryAqi; |
| | | import com.moral.api.pojo.dto.historyAqi.HistoryAqiDto; |
| | | |
| | | /** |
| | | * <p> |
| | | * 国控aqi数据表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author moral |
| | | * @since 2021-12-23 |
| | | */ |
| | | public interface HistoryAqiMapper extends BaseMapper<HistoryAqi> { |
| | | |
| | | List<HistoryAqiDto> query(String guid); |
| | | |
| | | } |
| New file |
| | |
| | | package com.moral.api.pojo.dto.historyAqi; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Description //todo |
| | | * |
| | | * @author swb |
| | | * @ClassName HistoryAqiDto |
| | | * @date 2024.11.13 15:35 |
| | | */ |
| | | @Data |
| | | public class HistoryAqiDto { |
| | | |
| | | //co |
| | | private Double a21005; |
| | | //o3 |
| | | private Double a05024; |
| | | //no2 |
| | | private Double a21004; |
| | | //so2 |
| | | private Double a21026; |
| | | //pm10 |
| | | private Double a34002; |
| | | //pm2.5 |
| | | private Double a34004; |
| | | //时间 |
| | | private String dataTime; |
| | | //风速 |
| | | private Double a01007; |
| | | //风向 |
| | | private Double a01008; |
| | | //tvoc |
| | | private Double a99054; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | Map<String, Object> queryGovMonitorPointHoutlyDatyByGuidsAndOrgid(Map map); |
| | | |
| | | List<Map<String, Object>> getGovMonitorPointsByOrganizationId(Integer organizationId); |
| | | |
| | | /** |
| | | * 获取国控站信息 |
| | | * @return |
| | | */ |
| | | List<GovMonitorPoint> selectPoint(); |
| | | } |
| New file |
| | |
| | | package com.moral.api.service; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.moral.api.entity.HistoryAqi; |
| | | import com.moral.api.pojo.dto.historyAqi.HistoryAqiDto; |
| | | |
| | | /** |
| | | * <p> |
| | | * 国控aqi数据表 服务类 |
| | | * </p> |
| | | * |
| | | * @author moral |
| | | * @since 2024-11-13 |
| | | */ |
| | | public interface HistoryAqiService extends IService<HistoryAqi> { |
| | | |
| | | List<HistoryAqiDto> reveal(String guid); |
| | | } |
| | |
| | | package com.moral.api.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.moral.api.entity.Device; |
| | |
| | | import com.moral.pojo.AQI; |
| | | import com.moral.util.AQIUtils; |
| | | import com.moral.util.RegionCodeUtils; |
| | | import com.moral.util.TokenUtils; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | |
| | | .in("city_code", cityCodes); |
| | | return govMonitorPointMapper.selectMaps(govMonitorPointQueryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * 获取国控站信息 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<GovMonitorPoint> selectPoint() { |
| | | Map<String, Object> userInfo = (Map<String, Object>) TokenUtils.getUserInfo(); |
| | | Map<String, Object> orgInfo = (Map<String, Object>) userInfo.get("organization"); |
| | | Integer orId =(Integer) orgInfo.get("id"); |
| | | Integer code = null; |
| | | LambdaQueryWrapper<GovMonitorPoint> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.select(GovMonitorPoint::getGuid,GovMonitorPoint::getLatitude,GovMonitorPoint::getLongitude,GovMonitorPoint::getName); |
| | | if (orId!=24){ |
| | | code = (Integer) orgInfo.get("locationLevelCode"); |
| | | wrapper.eq(GovMonitorPoint::getAreaCode,code); |
| | | } |
| | | wrapper.eq(GovMonitorPoint::getIsDelete,Constants.NOT_DELETE); |
| | | |
| | | List<GovMonitorPoint> govMonitorPoints = govMonitorPointMapper.selectList(wrapper); |
| | | return govMonitorPoints; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.moral.api.service.impl; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.moral.api.entity.HistoryAqi; |
| | | import com.moral.api.mapper.HistoryAqiMapper; |
| | | import com.moral.api.pojo.dto.historyAqi.HistoryAqiDto; |
| | | import com.moral.api.service.HistoryAqiService; |
| | | import com.moral.util.TokenUtils; |
| | | |
| | | /** |
| | | * <p> |
| | | * 国控aqi数据表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author moral |
| | | * @since 2024-11-13 |
| | | */ |
| | | @Service |
| | | public class HistoryAqiServiceImpl extends ServiceImpl<HistoryAqiMapper, HistoryAqi> implements HistoryAqiService { |
| | | |
| | | |
| | | @Autowired |
| | | private HistoryAqiMapper historyAqiMapper; |
| | | /** |
| | | * 显示国控站 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<HistoryAqiDto> reveal(String guid) { |
| | | if (ObjectUtils.isEmpty(guid)){ |
| | | return null; |
| | | } |
| | | List<HistoryAqiDto> query = historyAqiMapper.query(guid); |
| | | return query; |
| | | } |
| | | } |
| New file |
| | |
| | | <?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.moral.api.mapper.HistoryAqiMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.moral.api.entity.HistoryAqi"> |
| | | <result column="guid" property="guid"/> |
| | | <result column="time" property="time"/> |
| | | <result column="value" property="value"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="query" resultType="com.moral.api.pojo.dto.historyAqi.HistoryAqiDto"> |
| | | SELECT `value` -> '$.co' as a21005, |
| | | `value` -> '$.o3' as a05024, |
| | | `value` -> '$.no2' as a21004, |
| | | `value` -> '$.so2' as a21026, |
| | | `value` -> '$.pm10' as a34002, |
| | | `value` -> '$.pm2_5' as a34004, |
| | | `value` -> '$.pubtime' as dataTime |
| | | FROM history_aqi where guid=#{guid} and history_aqi.time =(SELECT MAX(time) FROM history_aqi) |
| | | </select> |
| | | </mapper> |
| | | |
| | | |
| | |
| | | return new ResultMessage(); |
| | | } |
| | | |
| | | @GetMapping("insertHistoryHourly") |
| | | @ApiOperation(value = "缺失小时数据补充", notes = "缺失小时数据补充") |
| | | public ResultMessage insertHistoryHourly() { |
| | | historyHourlyService.insertHistoryHourly(); |
| | | return new ResultMessage(); |
| | | } |
| | | |
| | | @GetMapping("insertHCHistoryAqi") |
| | | @ApiOperation(value = "海城省控", notes = "海城省控") |
| | | public ResultMessage insertHCHistoryAqi() { |
| | |
| | | @GetMapping("secondCruiserSort") |
| | | @ApiOperation(value = "走航车排名", notes = "走航车排名") |
| | | public ResultMessage secondCruiserSort() { |
| | | String startTime ="2024-06-06 00:07:01"; |
| | | String endTime ="2024-06-06 23:07:01"; |
| | | String startTime ="2024-11-13 00:00:00"; |
| | | String endTime ="2024-11-14 00:00:00"; |
| | | historySecondCruiserService.sort(startTime,endTime); |
| | | return new ResultMessage(); |
| | | } |