增加接口
This commit is contained in:
parent
14cf3ee91b
commit
14ba1cd442
|
|
@ -154,6 +154,8 @@ public class ShiroConfig {
|
|||
// update-begin--author:liusq Date:20230522 for:[issues/4829]访问不存在的url时会提示Token失效,请重新登录呢
|
||||
//错误路径排除
|
||||
filterChainDefinitionMap.put("/error", "anon");
|
||||
//内部接口
|
||||
filterChainDefinitionMap.put("/appmana/inner/**", "anon");
|
||||
// update-end--author:liusq Date:20230522 for:[issues/4829]访问不存在的url时会提示Token失效,请重新登录呢
|
||||
|
||||
|
||||
|
|
|
|||
1
pom.xml
1
pom.xml
|
|
@ -72,6 +72,7 @@
|
|||
<!-- Log4j2爆雷漏洞 -->
|
||||
<log4j2.version>2.17.0</log4j2.version>
|
||||
<logback.version>1.2.9</logback.version>
|
||||
<EasyExcel.version>4.0.2</EasyExcel.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
|
|
|
|||
|
|
@ -68,5 +68,6 @@
|
|||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-crypto</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
package org.jeecg.modules.appmana.controller;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.iot.common.VOIntegrateStatistic;
|
||||
import org.jeecg.common.iot.common.VOSurvIntegrateParam;
|
||||
import org.jeecg.common.iot.common.VOSurvIntegrateResult;
|
||||
import org.jeecg.common.iot.common.VOWaterSurvIntegrateParam;
|
||||
import org.jeecg.modules.appmana.service.impl.IotCommonServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/appmana/inner/api")
|
||||
@Api(tags="内部接口")
|
||||
public class InnerController {
|
||||
|
||||
@Autowired
|
||||
private IotCommonServiceImpl iotCommonService;
|
||||
|
||||
|
||||
@ApiOperation(value = "1. 空气土壤监测综合数据统计", notes = "")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@PostMapping(value = "/survIntegrateStatistic")
|
||||
public Result<VOIntegrateStatistic> survIntegrateStatistic(@RequestBody VOSurvIntegrateParam voSurvIntegrateParam) {
|
||||
VOIntegrateStatistic voIntegrateStatistic = iotCommonService.airSoilIntegrate(voSurvIntegrateParam);
|
||||
return Result.ok(voIntegrateStatistic);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "2. 水质监测综合数据统计", notes = "")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@PostMapping(value = "/WaterIntegrateStatistic")
|
||||
public Result<VOIntegrateStatistic> WaterIntegrateStatistic(@RequestBody VOWaterSurvIntegrateParam voSurvIntegrateParam) {
|
||||
VOIntegrateStatistic voIntegrateStatistic = iotCommonService.waterIntegrate(voSurvIntegrateParam);
|
||||
return Result.OK(voIntegrateStatistic);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package org.jeecg.modules.appmana.controller;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.iot.common.VOIntegrateStatistic;
|
||||
import org.jeecg.common.iot.common.VOSurvIntegrateParam;
|
||||
import org.jeecg.common.iot.common.VOWaterSurvIntegrateParam;
|
||||
import org.jeecg.modules.appmana.service.impl.IotCommonServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/appmana/statistic")
|
||||
@Api(tags="内部接口")
|
||||
public class StatisticsContoller {
|
||||
|
||||
@Autowired
|
||||
private IotCommonServiceImpl iotCommonService;
|
||||
|
||||
|
||||
@ApiOperation(value = "1. 空气土壤监测综合数据统计", notes = "")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@PostMapping(value = "/airSoilIntegrate")
|
||||
public Result<VOIntegrateStatistic> survIntegrateStatistic(@RequestBody VOSurvIntegrateParam voSurvIntegrateParam) {
|
||||
VOIntegrateStatistic voIntegrateStatistic = iotCommonService.airSoilIntegrate(voSurvIntegrateParam);
|
||||
return Result.ok(voIntegrateStatistic);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "2. 水质监测综合数据统计", notes = "")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@PostMapping(value = "/WaterIntegrateStatistic")
|
||||
public Result<VOIntegrateStatistic> WaterIntegrateStatistic(@RequestBody VOWaterSurvIntegrateParam voSurvIntegrateParam) {
|
||||
VOIntegrateStatistic voIntegrateStatistic = iotCommonService.waterIntegrate(voSurvIntegrateParam);
|
||||
return Result.OK(voIntegrateStatistic);
|
||||
}
|
||||
}
|
||||
|
|
@ -22,4 +22,6 @@ public interface SurvDeviceDeployMapper extends BaseMapper<SurvDeviceDeploy> {
|
|||
SurvDeviceDeploy getOneByCode(String deployCode);
|
||||
|
||||
List<SurvDeviceDeploy> getDeviceListByStations(@Param("stationCode") String stationCode,@Param("deployTypeList") List<String> deployTypeList);
|
||||
|
||||
List<SurvDeviceDeploy> getByIdsWithZhiBiao(@Param("ids")List<String> ids);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.common.entity.SurvHisdataAir;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.common.iot.common.VOSurvIntegrateAirDetail;
|
||||
import org.jeecg.common.vo.AirDataTrans;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
|
@ -23,4 +24,6 @@ public interface SurvHisdataAirMapper extends BaseMapper<SurvHisdataAir> {
|
|||
List<AirDataTrans> getMonthSummry(@Param("airList") List<String> airList, @Param("yearStr") String yearStr);
|
||||
|
||||
List<SurvHisdataAir> listByParams(@Param("deployCode")String deployCode, @Param("startDateTime") LocalDateTime startDateTime, @Param("endDateTime") LocalDateTime endDateTime);
|
||||
|
||||
List<VOSurvIntegrateAirDetail> integrateSummary(@Param("tenantId") String tenantId,@Param("airDevice") List<String> airDevice,@Param("timeDataFormat") String timeDataFormat, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.common.entity.SurvHisdataSoil;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.common.iot.common.VOSurvIntegrateSoilDetail;
|
||||
import org.jeecg.common.vo.DataTrans;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
|
@ -23,4 +24,5 @@ public interface SurvHisdataSoilMapper extends BaseMapper<SurvHisdataSoil> {
|
|||
|
||||
List<SurvHisdataSoil> listByParams(@Param("deployCode") String deployCode,@Param("startDateTime") LocalDateTime startDateTime, @Param("endDateTime")LocalDateTime endDateTime);
|
||||
|
||||
List<VOSurvIntegrateSoilDetail> integrateSummary(@Param("tenantId")String tenantId, @Param("soilDevice") List<String> soilDevice,@Param("timeDataFormat") String timeDataFormat, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,4 +13,12 @@
|
|||
<select id="getALlZhiBiaoCount" resultType="java.lang.Integer">
|
||||
select count(distinct name) from sc_equ_zhibiao
|
||||
</select>
|
||||
|
||||
<select id="getChemicalByDeploy" resultType="org.jeecg.common.entity.ScEquZhibiao">
|
||||
select *
|
||||
from sc_equ_zhibiao
|
||||
where zhibiao_type = '1'
|
||||
AND equ_id = #{depolyId}
|
||||
order by sort_no, create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
</sql>
|
||||
|
||||
<select id="getStationName" resultType="String">
|
||||
select s.STATION_NAME from surv_device_deploy t left join surv_station_info s on t.STATION_CODE = s.STATION_CODE where t.DEPLOY_CODE= #{DEPLOY_CODE}
|
||||
select s.STATION_NAME from surv_device_deploy t left join surv_station_info s on t.STATION_CODE = s.STATION_CODE where t.IS_DEL = 0 AND t.DEPLOY_CODE= #{DEPLOY_CODE}
|
||||
</select>
|
||||
|
||||
<select id="pages" resultMap="baseResultMap">
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@
|
|||
<collection property="scContExe" column="DEPLOY_CODE" select="getScCont"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="org.jeecg.common.entity.SurvDeviceDeploy" id="zhibiaoMap" extends="baseResultMap">
|
||||
<collection property="zhibiaos" column="{depolyId = ID}"
|
||||
select="org.jeecg.modules.appmana.mapper.ScEquZhibiaoMapper.getChemicalByDeploy"></collection>
|
||||
</resultMap>
|
||||
|
||||
<sql id="basesql" >
|
||||
ID,DEPLOY_CODE,STATION_CODE,RUN_STATUS,POWER_STATUS,LASTSYNC_TIME,DEVICE_CODE,DEPLOY_DES,DEPLOY_PIC,DEVICE_URL,SORT_NO,TENANT_ID,RE_VISION,CREATED_BY,CREATE_TIME,UPDATED_BY,IS_DEL,UPDATED_TIME,DEPLOY_TYPE,DEVICE_LATITUDE,DEVICE_LONGITUDE,GROUP_ID,IZ_BAOJING,IP_ADDR,PORT,SEND_INFO,MAP_ICON,DEVICE_IOT_URL,DEVICE_REVERSE_IOT_URL,DEVICE_LONGLAT,PROTOCOL_CODE,PROTOCOL_TYPE,DEPLOY_CATE,DEPLOY_SECONDARY_TYPE,CATE_ID,SURV_CONFIG_ID
|
||||
</sql>
|
||||
|
|
@ -71,12 +76,12 @@
|
|||
</select>
|
||||
|
||||
<select id="getStationNameByDeployCode" resultType="String">
|
||||
select t.STATION_NAME from surv_station_info t join surv_device_deploy s on s.STATION_CODE = t.STATION_CODE where s.DEPLOY_CODE = #{deplyCode}
|
||||
select t.STATION_NAME from surv_station_info t join surv_device_deploy s on s.STATION_CODE = t.STATION_CODE where s.DEPLOY_CODE = #{deplyCode} AND s.IS_DEL = 0
|
||||
</select>
|
||||
|
||||
|
||||
<select id="pages" resultMap="extMap">
|
||||
select <include refid="basesql" /> from surv_device_deploy where 1=1
|
||||
select <include refid="basesql" /> from surv_device_deploy where IS_DEL = 0
|
||||
<if test="query.stationCode!=null and query.stationCode!=''">
|
||||
and STATION_CODE = #{query.stationCode}
|
||||
</if>
|
||||
|
|
@ -90,7 +95,7 @@
|
|||
</select>
|
||||
|
||||
<select id="getDeviceListByStation" resultType="java.lang.String">
|
||||
select DEPLOY_CODE from surv_device_deploy where 1=1
|
||||
select DEPLOY_CODE from surv_device_deploy where IS_DEL = 0
|
||||
<if test="deployType != null and deployType != ''">
|
||||
and DEPLOY_TYPE = #{deployType}
|
||||
</if>
|
||||
|
|
@ -100,12 +105,13 @@
|
|||
</select>
|
||||
|
||||
<select id="getOneByCode" resultMap="extMap">
|
||||
select <include refid="basesql"/> from surv_device_deploy where DEPLOY_CODE = #{deployCode} limit 1
|
||||
select <include refid="basesql"/> from surv_device_deploy where IS_DEL = 0 AND DEPLOY_CODE = #{deployCode} limit 1
|
||||
</select>
|
||||
|
||||
<select id="getDeviceListByStations" resultMap="baseResultMap">
|
||||
select <include refid="basesql"/> from surv_device_deploy
|
||||
<where>
|
||||
AND IS_DEL = 0
|
||||
<if test="deployTypeList != null and deployTypeList.size()>0">
|
||||
and DEPLOY_TYPE IN
|
||||
<foreach collection="deployTypeList" index="index" item="id" open="(" separator="," close=")">
|
||||
|
|
@ -118,4 +124,14 @@
|
|||
</where>
|
||||
order by SORT_NO,CREATE_TIME desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getByIdsWithZhiBiao" resultMap="zhibiaoMap">
|
||||
select *
|
||||
from surv_device_deploy
|
||||
where IS_DEL = 0 AND ID IN
|
||||
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -29,11 +29,12 @@
|
|||
<result property="updatedBy" column="UPDATED_BY" jdbcType="VARCHAR"/>
|
||||
<result property="isDel" column="IS_DEL" jdbcType="INTEGER"/>
|
||||
<result property="updatedTime" column="UPDATED_TIME"/>
|
||||
<result property="deployId" column="DEPLOY_ID"/>
|
||||
<association property="stationName" column="{deplyCode = DEVICE_CODE}" javaType="java.lang.String" select="org.jeecg.modules.appmana.mapper.SurvDeviceDeployMapper.getStationNameByDeployCode"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="baseSql">
|
||||
ID,DATA_AIR_TEMP,DATA_AIR_WET,DATA_AIR_PRESS,DATA_RAIN_FALL,DATA_WIND_SPEED,DATA_WIND_DIRECTION,DATA_SUN_FALLOUT,DATA_SUN_TOTAL,DATA_RAIN_TOTAL,DATA_DATE_TIME,DATA_GATHER_TYPE,STATION_ID,DEVICE_ID,STATION_CODE,DEVICE_CODE,CORP_ID,STATION_NAME,DEVICE_NAME,TRANS_DATE,TENANT_ID,RE_VISION,CREATED_BY,CREATE_TIME,UPDATED_BY,IS_DEL,UPDATED_TIME
|
||||
ID,DATA_AIR_TEMP,DATA_AIR_WET,DATA_AIR_PRESS,DATA_RAIN_FALL,DATA_WIND_SPEED,DATA_WIND_DIRECTION,DATA_SUN_FALLOUT,DATA_SUN_TOTAL,DATA_RAIN_TOTAL,DATA_DATE_TIME,DATA_GATHER_TYPE,STATION_ID,DEVICE_ID,STATION_CODE,DEVICE_CODE,CORP_ID,STATION_NAME,DEVICE_NAME,TRANS_DATE,TENANT_ID,RE_VISION,CREATED_BY,CREATE_TIME,UPDATED_BY,IS_DEL,UPDATED_TIME,DEPLOY_ID
|
||||
</sql>
|
||||
|
||||
<select id="pages" resultMap="baseResultMap">
|
||||
|
|
@ -81,4 +82,44 @@
|
|||
<select id="listByParams" resultMap="baseResultMap">
|
||||
select <include refid="baseSql"/> from surv_hisdata_air where DEVICE_CODE = #{deployCode} AND DATA_DATE_TIME >= #{startDateTime} AND DATA_DATE_TIME <= #{endDateTime} order by DATA_DATE_TIME DESC
|
||||
</select>
|
||||
|
||||
<select id="integrateSummary" resultType="org.jeecg.common.iot.common.VOSurvIntegrateAirDetail">
|
||||
select date_format(t.DATA_DATE_TIME,#{timeDataFormat}) as dates,
|
||||
ifnull(ROUND(avg(cast(DATA_AIR_TEMP as decimal(10,1))), 2),'0') as dataAirTemp,
|
||||
ifnull(ROUND(avg(cast(DATA_AIR_WET as decimal(10,1))), 2),'0') as dataAirWet,
|
||||
ifnull(ROUND(avg(cast(DATA_AIR_PRESS as decimal(10,1))), 2),'0') as dataAirPress,
|
||||
ifnull(ROUND(avg(cast(DATA_RAIN_FALL as decimal(10,1))), 2),'0') as dataRainFall,
|
||||
ifnull(ROUND(avg(cast(DATA_WIND_SPEED as decimal(10,1))), 2),'0') as dataWindSpeed,
|
||||
ifnull(ROUND(avg(cast(DATA_WIND_DIRECTION as decimal(10,1))), 2),'0') as dataWindDirection,
|
||||
ifnull(ROUND(MAX(cast(DATA_SUN_TOTAL as decimal(10,1))), 2),'0') as dataSunTotal,
|
||||
ifnull(ROUND(avg(cast(DATA_SUN_FALLOUT as decimal(10,1))), 2),'0') as dataSunFallout,
|
||||
<!-- ifnull(ROUND(MAX(cast(DATA_SUN_HOUR as decimal(10,1))), 2),'0') as dataSunHour,-->
|
||||
ifnull(ROUND(MAX(cast(DATA_RAIN_TOTAL as decimal(10,1))), 2),'0') as dataRainTotal
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_PM_25 as decimal(10,1))), 2),'0') as dataPm25,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SUN_RATE as decimal(10,1))), 2),'0') as dataSunRate,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_AIR_COD as decimal(10,1))), 2),'0') as dataAirCod,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_LEAF_TEMP as decimal(10,1))), 2),'0') as dataLeafTemp,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_LEAF_WET as decimal(10,1))), 2),'0') as dataLeafWet,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_PHOTOSYNTHETIC as decimal(10,1))), 2),'0') as dataPhotosynthetic,-->
|
||||
<!-- ifnull(ROUND(MAX(cast(DATA_EVAPORATION as decimal(10,1))), 2),'0') as dataEvaporation,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_AIR_NEO as decimal(10,1))), 2),'0') as dataAirNeo,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_AIR_TOTAL_RADIATION as decimal(10,1))), 2),'0') as dataAirTotalRadiation,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_AIR_NH as decimal(10,1))), 2),'0') as dataAirNh,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_AIR_HS as decimal(10,1))), 2),'0') as dataAirHs,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_AIR_EONE as decimal(10,1))), 2),'0') as dataAirEone,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_AIR_ETWO as decimal(10,1))), 2),'0') as dataAirEtwo,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_AIR_ETHREE as decimal(10,1))), 2),'0') as dataAirEthree-->
|
||||
from surv_hisdata_air t
|
||||
<where>
|
||||
<if test="tenantId != null and tenantId != ''">
|
||||
AND TENANT_ID = #{tenantId}
|
||||
</if>
|
||||
AND DEVICE_CODE IN
|
||||
<foreach item="id" collection="airDevice" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
and DATA_DATE_TIME between #{startTime} and #{endTime}
|
||||
group by dates
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -30,11 +30,12 @@
|
|||
<result property="updatedBy" column="UPDATED_BY" jdbcType="VARCHAR"/>
|
||||
<result property="isDel" column="IS_DEL" jdbcType="INTEGER"/>
|
||||
<result property="updatedTime" column="UPDATED_TIME"/>
|
||||
<result property="deployId" column="DEPLOY_ID"/>
|
||||
<association property="stationName" column="{deplyCode = DEVICE_CODE}" javaType="java.lang.String" select="org.jeecg.modules.appmana.mapper.SurvDeviceDeployMapper.getStationNameByDeployCode"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="baseSql">
|
||||
ID,DATA_SOIL_TEMP,DATA_SOIL_WET,DATA_SOIL_SALT,DATA_SOIL_TEMP2,DATA_SOIL_WET2,DATA_SOIL_TEMP3,DATA_SOIL_WET3,DATA_SOIL_DDL,DATA_SOIL_DDL2,DATA_SOIL_DDL3,DATA_DATE_TIME,DATA_GATHER_TYPE,STATION_ID,DEVICE_ID,STATION_CODE,DEVICE_CODE,CORP_ID,STATION_NAME,DEVICE_NAME,TRANS_DATE,TENANT_ID,RE_VISION,CREATED_BY,CREATE_TIME,UPDATED_BY,IS_DEL,UPDATED_TIME
|
||||
ID,DATA_SOIL_TEMP,DATA_SOIL_WET,DATA_SOIL_SALT,DATA_SOIL_TEMP2,DATA_SOIL_WET2,DATA_SOIL_TEMP3,DATA_SOIL_WET3,DATA_SOIL_DDL,DATA_SOIL_DDL2,DATA_SOIL_DDL3,DATA_DATE_TIME,DATA_GATHER_TYPE,STATION_ID,DEVICE_ID,STATION_CODE,DEVICE_CODE,CORP_ID,STATION_NAME,DEVICE_NAME,TRANS_DATE,TENANT_ID,RE_VISION,CREATED_BY,CREATE_TIME,UPDATED_BY,IS_DEL,UPDATED_TIME,DEPLOY_ID
|
||||
</sql>
|
||||
|
||||
|
||||
|
|
@ -67,4 +68,54 @@
|
|||
<select id="listByParams" resultMap="baseResultMap">
|
||||
select <include refid="baseSql"/> from surv_hisdata_soil where DEVICE_CODE = #{deployCode} AND DATA_DATE_TIME >= #{startDateTime} AND DATA_DATE_TIME <= #{endDateTime} order by DATA_DATE_TIME DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="integrateSummary" resultType="org.jeecg.common.iot.common.VOSurvIntegrateSoilDetail">
|
||||
select date_format(t.DATA_DATE_TIME,#{timeDataFormat}) as dates,
|
||||
ifnull(ROUND(avg(cast(DATA_SOIL_TEMP as decimal(10,1))), 2),'0') as dataSoilTemp,
|
||||
ifnull(ROUND(avg(cast(DATA_SOIL_WET as decimal(10,1))), 2),'0') as dataSoilWet,
|
||||
ifnull(ROUND(avg(cast(DATA_SOIL_SALT as decimal(10,1))), 2),'0') as dataSoilSalt,
|
||||
ifnull(ROUND(avg(cast(DATA_SOIL_TEMP2 as decimal(10,1))), 2),'0') as dataSoilTemp2,
|
||||
ifnull(ROUND(avg(cast(DATA_SOIL_WET2 as decimal(10,1))), 2),'0') as dataSoilWet2,
|
||||
ifnull(ROUND(avg(cast(DATA_SOIL_TEMP3 as decimal(10,1))), 2),'0') as dataSoilTemp3,
|
||||
ifnull(ROUND(avg(cast(DATA_SOIL_WET3 as decimal(10,1))), 2),'0') as dataSoilWet3,
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_TEMP4 as decimal(10,1))), 2),'0') as dataSoilTemp4,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_WET4 as decimal(10,1))), 2),'0') as dataSoilWet4,-->
|
||||
ifnull(ROUND(avg(cast(DATA_SOIL_DDL as decimal(10,1))), 2),'0') as dataSoilDdl,
|
||||
ifnull(ROUND(avg(cast(DATA_SOIL_DDL2 as decimal(10,1))), 2),'0') as dataSoilDdl2,
|
||||
ifnull(ROUND(avg(cast(DATA_SOIL_DDL3 as decimal(10,1))), 2),'0') as dataSoilDdl3
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_DDL4 as decimal(10,1))), 2),'0') as dataSoilDdl4,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_PH as decimal(10,1))), 2),'0') as dataSoilPh,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_NION as decimal(10,1))), 2),'0') as dataSoilNion,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_PION as decimal(10,1))), 2),'0') as dataSoilPion,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_KION as decimal(10,1))), 2),'0') as dataSoilKion,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_NION2 as decimal(10,1))), 2),'0') as dataSoilNion2,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_PION2 as decimal(10,1))), 2),'0') as dataSoilPion2,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_KION2 as decimal(10,1))), 2),'0') as dataSoilKion2,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_NION3 as decimal(10,1))), 2),'0') as dataSoilNion3,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_PION3 as decimal(10,1))), 2),'0') as dataSoilPion3,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_KION3 as decimal(10,1))), 2),'0') as dataSoilKion3,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_NION4 as decimal(10,1))), 2),'0') as dataSoilNion4,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_PION4 as decimal(10,1))), 2),'0') as dataSoilPion4,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_KION4 as decimal(10,1))), 2),'0') as dataSoilKion4,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_NHION as decimal(10,1))), 2),'0') as dataSoilNhion,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_NOION as decimal(10,1))), 2),'0') as dataSoilNoion,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_CUION as decimal(10,1))), 2),'0') as dataSoilCuion,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_PBION as decimal(10,1))), 2),'0') as dataSoilPbion,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_SOIL_CDION as decimal(10,1))), 2),'0') as dataSoilCdion,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_LEAF_TEMP as decimal(10,1))), 2),'0') as dataLeafTemp,-->
|
||||
<!-- ifnull(ROUND(avg(cast(DATA_LEAF_WET as decimal(10,1))), 2),'0') as dataLeafWet-->
|
||||
from surv_hisdata_soil t
|
||||
<where>
|
||||
<if test="tenantId != null and tenantId != ''">
|
||||
AND TENANT_ID = #{tenantId}
|
||||
</if>
|
||||
AND DEVICE_CODE IN
|
||||
<foreach item="id" collection="soilDevice" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
and DATA_DATE_TIME between #{startTime} and #{endTime}
|
||||
</where>
|
||||
group by dates order by dates
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -29,6 +29,7 @@
|
|||
<result property="updatedBy" column="UPDATED_BY" jdbcType="VARCHAR"/>
|
||||
<result property="isDel" column="IS_DEL" jdbcType="INTEGER"/>
|
||||
<result property="updatedTime" column="UPDATED_TIME"/>
|
||||
<result property="deployId" column="DEPLOY_ID"/>
|
||||
<association property="stationName" column="{deplyCode = DEVICE_CODE}" javaType="java.lang.String" select="org.jeecg.modules.appmana.mapper.SurvDeviceDeployMapper.getStationNameByDeployCode"/>
|
||||
</resultMap>
|
||||
|
||||
|
|
@ -43,10 +44,11 @@
|
|||
<result property="dataRainTotal" column="DATA_RAIN_TOTAL" jdbcType="VARCHAR"/>
|
||||
<result property="dataSunFallout" column="DATA_SUN_FALLOUT" jdbcType="VARCHAR"/>
|
||||
<result property="dataDateTime" column="DATA_DATE_TIME" />
|
||||
<result property="deployId" column="DEPLOY_ID"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="baseSql">
|
||||
ID,DATA_AIR_TEMP,DATA_AIR_WET,DATA_AIR_PRESS,DATA_RAIN_FALL,DATA_WIND_SPEED,DATA_WIND_DIRECTION,DATA_SUN_FALLOUT,DATA_SUN_TOTAL,DATA_RAIN_TOTAL,DATA_DATE_TIME,DATA_GATHER_TYPE,STATION_ID,DEVICE_ID,STATION_CODE,DEVICE_CODE,CORP_ID,STATION_NAME,DEVICE_NAME,TENANT_ID,RE_VISION,CREATED_BY,CREATE_TIME,UPDATED_BY,IS_DEL,UPDATED_TIME
|
||||
ID,DATA_AIR_TEMP,DATA_AIR_WET,DATA_AIR_PRESS,DATA_RAIN_FALL,DATA_WIND_SPEED,DATA_WIND_DIRECTION,DATA_SUN_FALLOUT,DATA_SUN_TOTAL,DATA_RAIN_TOTAL,DATA_DATE_TIME,DATA_GATHER_TYPE,STATION_ID,DEVICE_ID,STATION_CODE,DEVICE_CODE,CORP_ID,STATION_NAME,DEVICE_NAME,TENANT_ID,RE_VISION,CREATED_BY,CREATE_TIME,UPDATED_BY,IS_DEL,UPDATED_TIME,DEPLOY_ID
|
||||
</sql>
|
||||
|
||||
<select id="getNewestData" resultMap="simpleResultMap">
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
<result property="updatedBy" column="UPDATED_BY" jdbcType="VARCHAR"/>
|
||||
<result property="isDel" column="IS_DEL" jdbcType="INTEGER"/>
|
||||
<result property="updatedTime" column="UPDATED_TIME"/>
|
||||
<result property="deployId" column="DEPLOY_ID"/>
|
||||
<association property="stationName" column="{deplyCode = DEVICE_CODE}" javaType="java.lang.String" select="org.jeecg.modules.appmana.mapper.SurvDeviceDeployMapper.getStationNameByDeployCode"/>
|
||||
</resultMap>
|
||||
|
||||
|
|
@ -44,10 +45,11 @@
|
|||
<result property="dataSoilDdl2" column="DATA_SOIL_DDL2" jdbcType="VARCHAR"/>
|
||||
<result property="dataSoilDdl3" column="DATA_SOIL_DDL3" jdbcType="VARCHAR"/>
|
||||
<result property="dataDateTime" column="DATA_DATE_TIME"/>
|
||||
<result property="deployId" column="DEPLOY_ID"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="baseSql">
|
||||
ID,DATA_SOIL_TEMP,DATA_SOIL_WET,DATA_SOIL_SALT,DATA_DATE_TIME,DATA_SOIL_TEMP2,DATA_SOIL_WET2,DATA_SOIL_TEMP3,DATA_SOIL_WET3,DATA_SOIL_DDL,DATA_SOIL_DDL2,DATA_SOIL_DDL3,DATA_GATHER_TYPE,STATION_ID,DEVICE_ID,STATION_CODE,DEVICE_CODE,CORP_ID,STATION_NAME,DEVICE_NAME,TENANT_ID,RE_VISION,CREATED_BY,CREATE_TIME,UPDATED_BY,IS_DEL,UPDATED_TIME
|
||||
ID,DATA_SOIL_TEMP,DATA_SOIL_WET,DATA_SOIL_SALT,DATA_DATE_TIME,DATA_SOIL_TEMP2,DATA_SOIL_WET2,DATA_SOIL_TEMP3,DATA_SOIL_WET3,DATA_SOIL_DDL,DATA_SOIL_DDL2,DATA_SOIL_DDL3,DATA_GATHER_TYPE,STATION_ID,DEVICE_ID,STATION_CODE,DEVICE_CODE,CORP_ID,STATION_NAME,DEVICE_NAME,TENANT_ID,RE_VISION,CREATED_BY,CREATE_TIME,UPDATED_BY,IS_DEL,UPDATED_TIME,DEPLOY_ID
|
||||
</sql>
|
||||
|
||||
<select id="getNewestData" resultMap="simpleResultMap">
|
||||
|
|
|
|||
|
|
@ -16,4 +16,6 @@ public interface IScEquZhibiaoService extends IService<ScEquZhibiao> {
|
|||
List<ScEquZhibiao> getAllChemical(List<String> deviceList);
|
||||
|
||||
Integer getALlZhiBiaoCount();
|
||||
|
||||
List<ScEquZhibiao> getListByEquid(String deployId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,4 +30,9 @@ public interface ISurvDeviceDeployService extends IService<SurvDeviceDeploy> {
|
|||
void saveDeploy(SurvDeviceDeploy survDeviceDeploy);
|
||||
|
||||
void updateDeploy(SurvDeviceDeploy survDeviceDeploy);
|
||||
|
||||
|
||||
List<SurvDeviceDeploy> getByIdsWithZhiBiao(List<String> deployId);
|
||||
|
||||
List<SurvDeviceDeploy> getAllDevice(List<String> deployTypes);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.jeecg.common.entity.SurvHisdataAir;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.common.iot.common.VOSurvIntegrateAirDetail;
|
||||
import org.jeecg.common.vo.AirDataTrans;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
|
@ -22,4 +23,6 @@ public interface ISurvHisdataAirService extends IService<SurvHisdataAir> {
|
|||
List<AirDataTrans> getMonthSummry(List<String> airList, String yearStr);
|
||||
|
||||
List<SurvHisdataAir> listByParams(String deployCode, LocalDateTime startDateTime, LocalDateTime endDateTime);
|
||||
|
||||
List<VOSurvIntegrateAirDetail> integrateSummary(String tenantId, List<String> airDevice, String timeDataFormat, LocalDateTime startTime, LocalDateTime endTime);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.jeecg.common.entity.SurvHisdataSoil;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.common.iot.common.VOSurvIntegrateSoilDetail;
|
||||
import org.jeecg.common.vo.DataTrans;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
|
@ -23,4 +24,6 @@ public interface ISurvHisdataSoilService extends IService<SurvHisdataSoil> {
|
|||
IPage<SurvHisdataSoil> pages(IPage<SurvHisdataSoil> page, SurvHisdataSoil survHisdataSoil,List<String> deviceList);
|
||||
|
||||
List<SurvHisdataSoil> listByParams(String deployCode, LocalDateTime startDateTime, LocalDateTime endDateTime);
|
||||
|
||||
List<VOSurvIntegrateSoilDetail> integrateSummary(String tenantId, List<String> soilDevice, String timeDataFormat, LocalDateTime startTime, LocalDateTime endTime);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,4 +20,6 @@ public interface ISurvTransdataAirService extends IService<SurvTransdataAir> {
|
|||
SurvTransdataAirVo getNewestData(String deployCode);
|
||||
|
||||
IPage<SurvTransdataAir> pages(Page<SurvTransdataAir> page, SurvTransdataAir survTransdataAir, List<String> deviceList);
|
||||
|
||||
SurvTransdataAir getOneByDeviceCode(String deployCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,4 +21,6 @@ public interface ISurvTransdataSoilService extends IService<SurvTransdataSoil> {
|
|||
|
||||
|
||||
IPage<SurvTransdataSoil> pages(Page<SurvTransdataSoil> page, SurvTransdataSoil survTransdataSoil, List<String> deviceList);
|
||||
|
||||
SurvTransdataSoil getOneByDeviceCode(String deployCode);
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,5 +1,6 @@
|
|||
package org.jeecg.modules.appmana.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.jeecg.common.entity.ScEquZhibiao;
|
||||
import org.jeecg.common.entity.SurvDeviceDeploy;
|
||||
import org.jeecg.modules.appmana.mapper.ScEquZhibiaoMapper;
|
||||
|
|
@ -34,4 +35,16 @@ public class ScEquZhibiaoServiceImpl extends ServiceImpl<ScEquZhibiaoMapper, ScE
|
|||
.eq(ScEquZhibiao::getEquId, deploy.getId())
|
||||
.remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ScEquZhibiao> getListByEquid(String equid) {
|
||||
QueryWrapper<ScEquZhibiao> queryWrapper = new QueryWrapper<ScEquZhibiao>();
|
||||
queryWrapper.eq("equ_id", equid)
|
||||
.isNotNull("code")
|
||||
.ne("code", "")
|
||||
.orderByAsc("code");
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import org.springframework.stereotype.Service;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
|
|
@ -390,4 +391,22 @@ public class SurvDeviceDeployServiceImpl extends ServiceImpl<SurvDeviceDeployMap
|
|||
}
|
||||
return matchStr;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<SurvDeviceDeploy> getByIdsWithZhiBiao(List<String> deployId) {
|
||||
return baseMapper.getByIdsWithZhiBiao(deployId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SurvDeviceDeploy> getAllDevice(List<String> deployTypes) {
|
||||
List<SurvDeviceDeploy> deploys = lambdaQuery()
|
||||
.in(SurvDeviceDeploy::getDeployType,deployTypes)
|
||||
.eq(SurvDeviceDeploy::getIsDel,0)
|
||||
.eq(SurvDeviceDeploy::getRunStatus,0)
|
||||
.orderByAsc(SurvDeviceDeploy::getSortNo)
|
||||
.orderByDesc(SurvDeviceDeploy::getCreateTime)
|
||||
.list();
|
||||
return deploys;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import org.jeecg.common.vo.AirDataTrans;
|
|||
import org.jeecg.modules.appmana.mapper.SurvHisdataAirMapper;
|
||||
import org.jeecg.modules.appmana.service.ISurvHisdataAirService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.jeecg.common.iot.common.VOSurvIntegrateAirDetail;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
|
@ -36,4 +36,9 @@ public class SurvHisdataAirServiceImpl extends ServiceImpl<SurvHisdataAirMapper,
|
|||
public List<SurvHisdataAir> listByParams(String deployCode, LocalDateTime startDateTime, LocalDateTime endDateTime) {
|
||||
return baseMapper.listByParams(deployCode,startDateTime,endDateTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VOSurvIntegrateAirDetail> integrateSummary(String tenantId, List<String> airDevice,String timeDataFormat, LocalDateTime startTime, LocalDateTime endTime) {
|
||||
return baseMapper.integrateSummary(tenantId,airDevice,timeDataFormat, startTime, endTime);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,8 @@
|
|||
package org.jeecg.modules.appmana.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.jeecg.common.constant.PollutionConstants;
|
||||
import org.jeecg.common.entity.SurvHisdataLivestockwater;
|
||||
import org.jeecg.common.entity.SurvTransdataLivestockwater;
|
||||
import org.jeecg.common.util.BigDecimalRandomAdjuster;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.jeecg.common.vo.LiveDataTrans;
|
||||
import org.jeecg.modules.appmana.mapper.SurvHisdataLivestockwaterMapper;
|
||||
import org.jeecg.modules.appmana.service.ISurvHisdataLivestockwaterService;
|
||||
|
|
@ -16,11 +11,8 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @Description: surv_hisdata_livestockwater
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
package org.jeecg.modules.appmana.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.jeecg.common.constant.PollutionConstants;
|
||||
import org.jeecg.common.entity.SurvHisdataOrientwater;
|
||||
import org.jeecg.common.entity.SurvTransdataOrientwater;
|
||||
import org.jeecg.common.util.BigDecimalRandomAdjuster;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.jeecg.common.vo.DataTrans;
|
||||
import org.jeecg.common.vo.OrientDataTrans;
|
||||
import org.jeecg.modules.appmana.mapper.SurvHisdataOrientwaterMapper;
|
||||
import org.jeecg.modules.appmana.service.ISurvHisdataOrientwaterService;
|
||||
|
|
@ -19,12 +12,9 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @Description: surv_hisdata_orientwater
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.jeecg.modules.appmana.service.impl;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.jeecg.common.entity.SurvHisdataSoil;
|
||||
import org.jeecg.common.iot.common.VOSurvIntegrateSoilDetail;
|
||||
import org.jeecg.common.vo.DataTrans;
|
||||
import org.jeecg.modules.appmana.mapper.SurvHisdataSoilMapper;
|
||||
import org.jeecg.modules.appmana.service.ISurvHisdataSoilService;
|
||||
|
|
@ -37,4 +38,9 @@ public class SurvHisdataSoilServiceImpl extends ServiceImpl<SurvHisdataSoilMappe
|
|||
return baseMapper.listByParams(deployCode,startDateTime,endDateTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VOSurvIntegrateSoilDetail> integrateSummary(String tenantId, List<String> soilDevice, String timeDataFormat, LocalDateTime startTime, LocalDateTime endTime) {
|
||||
return baseMapper.integrateSummary(tenantId,soilDevice,timeDataFormat, startTime, endTime);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.jeecg.modules.appmana.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.jeecg.common.entity.SurvTransdataAir;
|
||||
|
|
@ -31,4 +32,12 @@ public class SurvTransdataAirServiceImpl extends ServiceImpl<SurvTransdataAirMap
|
|||
public IPage<SurvTransdataAir> pages(Page<SurvTransdataAir> page, SurvTransdataAir survTransdataAir, List<String> deviceList) {
|
||||
return baseMapper.pages(page,survTransdataAir,deviceList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SurvTransdataAir getOneByDeviceCode(String deployCode) {
|
||||
|
||||
QueryWrapper<SurvTransdataAir> queryWrapper = new QueryWrapper<SurvTransdataAir>();
|
||||
queryWrapper.eq("DEVICE_CODE", deployCode).last("limit 1");
|
||||
return getOne(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.jeecg.modules.appmana.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.jeecg.common.entity.SurvTransdataSoil;
|
||||
|
|
@ -32,5 +33,11 @@ public class SurvTransdataSoilServiceImpl extends ServiceImpl<SurvTransdataSoilM
|
|||
return baseMapper.pages(page,survTransdataSoil,deviceList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SurvTransdataSoil getOneByDeviceCode(String deployCode) {
|
||||
|
||||
QueryWrapper<SurvTransdataSoil> queryWrapper = new QueryWrapper<SurvTransdataSoil>();
|
||||
queryWrapper.eq("DEVICE_CODE", deployCode).last("limit 1");
|
||||
return getOne(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,11 +1,17 @@
|
|||
package org.jeecg.modules.appmana.utils;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.jeecg.common.constant.enums.PollutionEnum;
|
||||
import org.jeecg.common.entity.SurvDeviceDeploy;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.modules.appmana.service.ISurvConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -18,6 +24,17 @@ public class Iotutils {
|
|||
@Autowired
|
||||
private ISurvConfigService survConfigService ;
|
||||
|
||||
public static String isValidTimeFormat(String time, String format) {
|
||||
try {
|
||||
DateFormat dateFormat = new SimpleDateFormat(format);
|
||||
dateFormat.setLenient(false); // 设置为不宽容模式,如果输入不匹配将抛出异常
|
||||
Date date = dateFormat.parse(time);
|
||||
return dateFormat.format(date);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Integer checkIsOnline(String tenantId, String protocolCode, Date lastSyncTime, String deployType) {
|
||||
|
||||
long limitTime = survConfigService.getOfflineConfig(tenantId,deployType);
|
||||
|
|
@ -61,4 +78,51 @@ public class Iotutils {
|
|||
}
|
||||
return deploy;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 校验是否为累计类型的监测项
|
||||
*/
|
||||
public static boolean isAccumulate(String survItem){
|
||||
String column = StrUtil.toCamelCase(survItem);
|
||||
return isEntityAccumulate(column);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 除了这还要改sql FHisdataAirMapper中的sql,用于综合统计,目前只有空气有累计情况,20250928
|
||||
* @param entityColumnName
|
||||
* @return
|
||||
*/
|
||||
public static boolean isEntityAccumulate(String entityColumnName){
|
||||
boolean flag = false;
|
||||
if(PollutionEnum.dataRainTotal.getCode().equals(entityColumnName)){//雨量累计
|
||||
flag = true;
|
||||
}
|
||||
else if (PollutionEnum.dataSunHour.getCode().equals(entityColumnName)) {//日照时数
|
||||
flag = true;
|
||||
}
|
||||
else if (PollutionEnum.dataSunTotal.getCode().equals(entityColumnName)) {//辐射累计
|
||||
flag = true;
|
||||
}
|
||||
else if (PollutionEnum.dataEvaporation.getCode().equals(entityColumnName)) {//蒸发
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一的四舍五入,保留2位小小数,无负值
|
||||
*/
|
||||
public static String toStringData(BigDecimal datas){
|
||||
String result = "0";
|
||||
if(datas!=null){
|
||||
// if(datas.compareTo(BigDecimal.ZERO)<0){
|
||||
// datas = BigDecimal.ZERO;
|
||||
// }
|
||||
result = datas.setScale(2, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,10 +57,14 @@
|
|||
select STATION_TYPE from surv_station_info where STATION_CODE = #{STATION_CODE}
|
||||
</select>
|
||||
|
||||
<select id="getDeviceInfo" resultMap="org.jeecg.system.applet.mapper.SurvDeviceInfoMapper.baseResultMap">
|
||||
<select id="getDeviceInfo2" resultMap="org.jeecg.system.applet.mapper.SurvDeviceInfoMapper.baseResultMap">
|
||||
select * from surv_device_info where DEVICE_CODE = #{DEVICE_CODE}
|
||||
</select>
|
||||
|
||||
<select id="getDeviceInfo" resultType="org.jeecg.common.entity.SurvDictDeviceDetail">
|
||||
select * from surv_dict_device_detail where ID = #{DEVICE_CODE}
|
||||
</select>
|
||||
|
||||
<sql id="baseSql" >
|
||||
ID,DEPLOY_CODE,STATION_CODE,RUN_STATUS,POWER_STATUS,LASTSYNC_TIME,DEVICE_CODE,DEPLOY_DES,DEPLOY_PIC,DEVICE_URL,SORT_NO,TENANT_ID,RE_VISION,CREATED_BY,CREATE_TIME,UPDATED_BY,IS_DEL,UPDATED_TIME,DEPLOY_TYPE,DEVICE_LATITUDE,DEVICE_LONGITUDE,GROUP_ID,IZ_BAOJING,IP_ADDR,PORT,SEND_INFO,MAP_ICON,DEVICE_IOT_URL,DEVICE_REVERSE_IOT_URL,DEVICE_LONGLAT,PROTOCOL_CODE,PROTOCOL_TYPE,DEPLOY_CATE,DEPLOY_SECONDARY_TYPE,CATE_ID,SURV_CONFIG_ID
|
||||
</sql>
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
<result property="dataRainTotal" column="DATA_RAIN_TOTAL" jdbcType="VARCHAR"/>
|
||||
<result property="deviceCode" column="DEVICE_CODE" jdbcType="VARCHAR"/>
|
||||
<result property="dataDateTime" column="DATA_DATE_TIME"/>
|
||||
<result property="deployId" column="DEPLOY_ID"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getMonthSummry" resultType="org.jeecg.common.vo.AirDataTrans">
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
<result property="dataSoilDdl3" column="DATA_SOIL_DDL3" jdbcType="VARCHAR"/>
|
||||
<result property="dataDateTime" column="DATA_DATE_TIME"/>
|
||||
<result property="deviceCode" column="DEVICE_CODE" jdbcType="VARCHAR"/>
|
||||
<result property="deployId" column="DEPLOY_ID"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getMonthSummry" resultType="org.jeecg.common.vo.SoilDataTrans">
|
||||
|
|
|
|||
|
|
@ -45,26 +45,26 @@
|
|||
</resultMap>
|
||||
|
||||
<select id="getDeviceCount" resultType="Integer">
|
||||
select count(*) from surv_device_deploy where STATION_CODE = #{STATION_CODE}
|
||||
select count(*) from surv_device_deploy where IS_DEL = 0 AND STATION_CODE = #{STATION_CODE}
|
||||
</select>
|
||||
|
||||
<select id="getSurvItemCount" resultType="Integer">
|
||||
select SUM(LENGTH(di.SURV_ITEM) - LENGTH(replace (di.SURV_ITEM,',','')) +1) from surv_device_info di where di.DEVICE_CODE in (select dd.DEVICE_CODE from surv_device_deploy dd where dd.STATION_CODE = #{STATION_CODE})
|
||||
select SUM(LENGTH(di.SURV_ITEM) - LENGTH(replace (di.SURV_ITEM,',','')) +1) from surv_device_info di where di.DEVICE_CODE in (select dd.DEVICE_CODE from surv_device_deploy dd where dd.IS_DEL = 0 AND dd.STATION_CODE = #{STATION_CODE})
|
||||
</select>
|
||||
|
||||
<select id="getZhiBiaoCount" resultType="Integer">
|
||||
select count(s.name) from surv_device_deploy t join sc_equ_zhibiao s on t.id = s.equ_id and t.STATION_CODE = #{STATION_CODE} and s.zhibiao_type = '1'
|
||||
select count(s.name) from surv_device_deploy t join sc_equ_zhibiao s on t.id = s.equ_id and t.IS_DEL =0 and t.STATION_CODE = #{STATION_CODE} and s.zhibiao_type = '1'
|
||||
</select>
|
||||
|
||||
<select id="getDeviceList" resultType="org.jeecg.common.entity.SurvDeviceDeploy">
|
||||
select ID,DEPLOY_TYPE,DEVICE_URL,DEPLOY_CODE,DEVICE_CODE,DEPLOY_DES,#{ysToken} as ysToken from surv_device_deploy where STATION_CODE = #{STATION_CODE}
|
||||
select ID,DEPLOY_TYPE,DEVICE_URL,DEPLOY_CODE,DEVICE_CODE,DEPLOY_DES,#{ysToken} as ysToken from surv_device_deploy where IS_DEL = 0 AND STATION_CODE = #{STATION_CODE}
|
||||
<if test="deviceType != null and deviceType != ''">
|
||||
AND DEPLOY_TYPE = #{deviceType}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getSimpleDeviceList" resultType="org.jeecg.common.entity.SurvDeviceDeploy">
|
||||
select ID,DEPLOY_TYPE,DEVICE_URL,DEPLOY_CODE,DEVICE_CODE,DEPLOY_DES,DEPLOY_PIC from surv_device_deploy where STATION_CODE = #{STATION_CODE}
|
||||
select ID,DEPLOY_TYPE,DEVICE_URL,DEPLOY_CODE,DEVICE_CODE,DEPLOY_DES,DEPLOY_PIC from surv_device_deploy where IS_DEL = 0 AND STATION_CODE = #{STATION_CODE}
|
||||
</select>
|
||||
|
||||
<sql id="baseSql" >
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
<result property="dataSunFallout" column="DATA_SUN_FALLOUT" jdbcType="VARCHAR"/>
|
||||
<result property="dataDateTime" column="DATA_DATE_TIME" />
|
||||
<result property="deviceCode" column="DEVICE_CODE" />
|
||||
<result property="deployId" column="DEPLOY_ID"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getNewestData" resultMap="simpleResultMap">
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
<result property="dataSoilDdl3" column="DATA_SOIL_DDL3" jdbcType="VARCHAR"/>
|
||||
<result property="dataDateTime" column="DATA_DATE_TIME"/>
|
||||
<result property="deviceCode" column="DEVICE_CODE"/>
|
||||
<result property="deployId" column="DEPLOY_ID"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getNewestData" resultMap="simpleResultMap">
|
||||
|
|
|
|||
|
|
@ -68,6 +68,16 @@
|
|||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
<version>${knife4j-spring-boot-starter.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
<!-- <version>2.13.0</version>-->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>${EasyExcel.version}</version>
|
||||
</dependency>
|
||||
<!-- Swagger3依赖 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>io.springfox</groupId>-->
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
package org.jeecg.common.constant;
|
||||
|
||||
|
||||
public interface DeviceReadConstants {
|
||||
String READ_NORMAL = "normal";
|
||||
|
||||
String READ_TOO_HIGH = "high";
|
||||
|
||||
String READ_TOO_LOW = "low";
|
||||
}
|
||||
|
|
@ -3,44 +3,98 @@ package org.jeecg.common.constant.enums;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
public enum PollutionEnum {
|
||||
dataAirTemp("dataAirTemp","大气温度","℃","sys/icon/shebei_icon_qixiang.png","air","#22BB8A"),
|
||||
dataAirWet("dataAirWet","大气湿度","%RH","sys/icon/zhandian_icon_kongqishidu.png","air","#EE701C"),
|
||||
dataAirPress("dataAirPress","大气压力","hPa","sys/icon/zhandian_icon_daqiyali.png","air","#52AC2A"),
|
||||
dataRainFall("dataRainFall","雨量","mm","sys/icon/zhandian_icon_jiangyuliang.png","air","#2BADB9"),
|
||||
dataRainTotal("dataRainTotal","雨量累计","mm","sys/icon/zhandian_icon_jiangyuliang.png","air","#102B6A"),
|
||||
dataWindSpeed("dataWindSpeed","风速","m/s","sys/icon/zhandian_icon_fengsu.png","air","#7CD6CF"),
|
||||
dataWindDirection("dataWindDirection","风向","°","sys/icon/zhandian_icon_fengxiang.png","air","#26A3CC"),
|
||||
dataSunTotal("dataSunTotal","辐射累计","MJ/m2","sys/icon/zhandian_icon_taiyangquanfushe.png","air","#6C48C7"),
|
||||
dataSunFallout("dataSunFallout","太阳全辐射","W/m2","sys/icon/zhandian_icon_taiyangquanfushe.png","air","#22BB8A"),
|
||||
dataSoilWet("dataSoilWet","20CM土壤湿度","%","sys/icon/zhandian_icon_turangshidu.png","soil","#6495ED"),
|
||||
dataSoilWet2("dataSoilWet2","40CM土壤湿度","%","sys/icon/zhandian_icon_turangshidu.png","soil","#4169E1"),
|
||||
dataSoilWet3("dataSoilWet3","60CM土壤湿度","%","sys/icon/zhandian_icon_turangshidu.png","soil","#0000CD"),
|
||||
dataSoilTemp("dataSoilTemp","20CM土壤温度","℃","sys/icon/zhandian_icon_turangwendu.png","soil","#C71585"),
|
||||
dataSoilTemp2("dataSoilTemp2","40CM土壤温度","℃","sys/icon/zhandian_icon_turangwendu.png","soil","#FF1493"),
|
||||
dataSoilTemp3("dataSoilTemp3","60CM土壤温度","℃","sys/icon/zhandian_icon_turangwendu.png","soil","#FF69B4"),
|
||||
dataSoilDdl("dataSoilDdl","20CM电导率","uS/cm","sys/icon/zhandian_icon_ec.png","soil","#92D0D0"),
|
||||
dataSoilDdl2("dataSoilDdl2","40CM电导率","uS/cm","sys/icon/zhandian_icon_ec.png","soil","#73A2A2"),
|
||||
dataSoilDdl3("dataSoilDdl3","60CM电导率","uS/cm","sys/icon/zhandian_icon_ec.png","soil","#567777"),
|
||||
dataSoilSalt("dataSoilSalt","土壤盐分","","sys/icon/zhandian_icon_ec.png","soil","#4F5555"),
|
||||
dataAirTemp("dataAirTemp", "大气温度", "℃", "sys/icon/shebei_icon_qixiang.png", "air", "#22BB8A", "sys/mobile/icon/shebei_icon_qixiang.png", "sys/bs/icon/shebei_icon_qixiang.png", "shebei_icon_qixiang.png"),
|
||||
dataAirWet("dataAirWet", "大气湿度", "%RH", "sys/icon/zhandian_icon_kongqishidu.png", "air", "#EE701C", "sys/mobile/icon/zhandian_icon_kongqishidu.png", "sys/bs/icon/zhandian_icon_kongqishidu.png", "zhandian_icon_kongqishidu.png"),
|
||||
dataAirPress("dataAirPress", "大气压力", "hPa", "sys/icon/zhandian_icon_daqiyali.png", "air", "#52AC2A", "sys/mobile/icon/zhandian_icon_daqiyali.png", "sys/bs/icon/zhandian_icon_daqiyali.png", "zhandian_icon_daqiyali.png"),
|
||||
dataRainFall("dataRainFall", "雨量", "mm", "sys/icon/zhandian_icon_jiangyuliang.png", "air", "#2BADB9", "sys/mobile/icon/zhandian_icon_jiangyuliang.png", "sys/bs/icon/zhandian_icon_jiangyuliang.png", "zhandian_icon_jiangyuliang.png"),
|
||||
dataRainTotal("dataRainTotal", "雨量累计", "mm", "sys/icon/zhandian_icon_jiangyuliangtotal.png", "air", "#102B6A", "sys/mobile/icon/zhandian_icon_jiangyuliangtotal.png", "sys/bs/icon/zhandian_icon_jiangyuliangtotal.png", "zhandian_icon_jiangyuliangtotal.png"),
|
||||
dataWindSpeed("dataWindSpeed", "风速", "m/s", "sys/icon/zhandian_icon_fengsu.png", "air", "#7CD6CF", "sys/mobile/icon/zhandian_icon_fengsu.png", "sys/bs/icon/zhandian_icon_fengsu.png", "zhandian_icon_fengsu.png"),
|
||||
dataWindDirection("dataWindDirection", "风向", "°", "sys/icon/zhandian_icon_fengxiang.png", "air", "#26A3CC", "sys/mobile/icon/zhandian_icon_fengxiang.png", "sys/bs/icon/zhandian_icon_fengxiang.png", "zhandian_icon_fengxiang.png"),
|
||||
dataSunTotal("dataSunTotal", "辐射累计", "MJ/m2", "sys/icon/zhandian_icon_fusheleiji.png", "air", "#6C48C7", "sys/mobile/icon/zhandian_icon_fusheleiji.png", "sys/bs/icon/zhandian_icon_fusheleiji.png", "zhandian_icon_fusheleiji.png"),
|
||||
dataSunFallout("dataSunFallout", "太阳全辐射", "W/m2", "sys/icon/zhandian_icon_taiyangquanfushe.png", "air", "#22BB8A", "sys/mobile/icon/zhandian_icon_taiyangquanfushe.png", "sys/bs/icon/zhandian_icon_taiyangquanfushe.png", "zhandian_icon_taiyangquanfushe.png"),
|
||||
dataSunHour("dataSunHour", "日照时数", "h", "sys/icon/shebei_icon_sunhour.png", "air", "#72a680", "sys/mobile/icon/shebei_icon_sunhour.png", "sys/bs/icon/shebei_icon_sunhour.png", "shebei_icon_sunhour.png"),
|
||||
dataPhotosynthetic("dataPhotosynthetic", "光合", "W/M2", "sys/icon/shebei_icon_photosynthetic.png", "air", "#72a680", "sys/mobile/icon/shebei_icon_photosynthetic.png", "sys/bs/icon/shebei_icon_photosynthetic.png", "shebei_icon_photosynthetic.png"),
|
||||
dataEvaporation("dataEvaporation", "蒸发", "mm", "sys/icon/shebei_icon_evaporation.png", "air", "#72a680", "sys/mobile/icon/shebei_icon_evaporation.png", "sys/bs/icon/shebei_icon_evaporation.png", "shebei_icon_evaporation.png"),
|
||||
|
||||
dataSoilWetMark("dataSoilWetMark","土壤湿度","%","sys/icon/zhandian_icon_turangshidu.png","soil","#6495ED"),
|
||||
dataSoilMark("dataSoilMark","土壤温度","℃","sys/icon/zhandian_icon_turangwendu.png","soil","#C71585"),
|
||||
dataSoilDdlMark("dataSoilDdlMark","电导率","uS/cm","sys/icon/zhandian_icon_ec.png","soil","#92D0D0"),
|
||||
dataSunRate("dataSunRate", "照度", "Lux", "sys/icon/zhandian_icon_sunrate.png", "air", "#EE400F", "sys/mobile/icon/zhandian_icon_sunrate.png", "sys/bs/icon/zhandian_icon_sunrate.png", "zhandian_icon_sunrate.png"),
|
||||
dataPm25("dataPm25", "PM2.5", "ug/m3", "sys/icon/zhandian_icon_pm25.png", "air", "#26A3AA", "sys/mobile/icon/zhandian_icon_pm25.png", "sys/bs/icon/zhandian_icon_pm25.png", "zhandian_icon_pm25.png"),
|
||||
dataAirCod("dataAirCod", "二氧化碳", "ppm", "sys/icon/zhandian_icon_cod2.png", "air", "#72a680", "sys/mobile/icon/zhandian_icon_cod2.png", "sys/bs/icon/zhandian_icon_cod2.png", "zhandian_icon_cod2.png"),
|
||||
|
||||
dataWaterTp("dataWaterTp","总磷","mg/L","sys/icon/shebei_icon_tp.png","water","#C8CC00"),
|
||||
dataWaterTn("dataWaterTn","总氮","mg/L","sys/icon/shebei_icon_tn.png","water","#009DB2"),
|
||||
dataWaterNo("dataWaterNo","硝态氮","mg/L","sys/icon/shebei_icon_no3n.png","water_orient","#72BAA7"),
|
||||
dataWaterNh("dataWaterNh","氨氮","mg/L","sys/icon/shebei_icon_nh3n.png","water_live","#225A1F"),
|
||||
dataWaterCod("dataWaterCod","化学需氧量","mg/L","sys/icon/shebei_icon_cod.png","water_live","#FDB933"),
|
||||
dataAirNeo("dataAirNeo", "负氧离子", "个/cm³", "sys/icon/shebei_icon_airneo.png", "air", "#72a680", "sys/mobile/icon/shebei_icon_airneo.png", "sys/bs/icon/shebei_icon_airneo.png", "shebei_icon_airneo.png"),
|
||||
dataAirTotalRadiation("dataAirTotalRadiation", "全辐射", "mm", "sys/icon/shebei_icon_total_radiation.png", "air", "#72a680", "sys/mobile/icon/shebei_icon_total_radiation.png", "sys/bs/icon/shebei_icon_total_radiation.png", "shebei_icon_total_radiation.png"),
|
||||
|
||||
//仁科 20250911
|
||||
dataAirNh("dataAirNh", "氨气", "ppm", "sys/icon/shebei_icon_airnh3.png", "air", "#72a680", "sys/mobile/icon/shebei_icon_airnh3.png", "sys/bs/icon/shebei_icon_airnh3.png", "shebei_icon_airnh3.png"),
|
||||
dataAirHs("dataAirHs", "硫化氢", "ppm", "sys/icon/shebei_icon_airh2s.png", "air", "#72a680", "sys/mobile/icon/shebei_icon_airh2s.png", "sys/bs/icon/shebei_icon_airh2s.png", "shebei_icon_airh2s.png"),
|
||||
dataAirEone("dataAirEone", "预留1", "ppm", "sys/icon/shebei_icon_eone.png", "air", "#72a680", "sys/mobile/icon/shebei_icon_eone.png", "sys/bs/icon/shebei_icon_eone.png", "shebei_icon_eone.png"),
|
||||
dataAirETwo("dataAirETWO", "预留2", "ppm", "sys/icon/shebei_icon_etwo.png", "air", "#72a680", "sys/mobile/icon/shebei_icon_etwo.png", "sys/bs/icon/shebei_icon_etwo.png", "shebei_icon_etwo.png"),
|
||||
dataAirEThree("dataAirEThree", "预留3", "ppm", "sys/icon/shebei_icon_ethree.png", "air", "#72a680", "sys/mobile/icon/shebei_icon_ethree.png", "sys/bs/icon/shebei_icon_ethree.png", "shebei_icon_ethree.png"),
|
||||
|
||||
|
||||
dataStinkOu("dataOu","臭气浓度","mg/m³","sys/icon/zhandian_icon_ou.png","stink","#f47a75"),
|
||||
dataStinkNh3("dataNh3","氨气","mg/m³","sys/icon/zhandian_icon_nh3.png","stink","#d05c7c"),
|
||||
dataStinkH2s("dataH2s","硫化氢","mg/m³","sys/icon/zhandian_icon_h2s.png","stink","#d05c9f"),
|
||||
dataStinkTvoc("dataTvoc","总挥发性有机物","mg/m³","sys/icon/zhandian_icon_tvoc.png","stink","#f06464"),
|
||||
dataSoilWet("dataSoilWet", "土壤湿度", "%", "sys/icon/zhandian_icon_turangshidu.png", "soil", "#6495ED", "sys/mobile/icon/zhandian_icon_turangshidu.png", "sys/bs/icon/zhandian_icon_turangshidu.png", "zhandian_icon_turangshidu.png"),
|
||||
dataSoilWet2("dataSoilWet2", "40CM土壤湿度", "%", "sys/icon/zhandian_icon_turangshidu.png", "soil", "#4169E1", "sys/mobile/icon/zhandian_icon_turangshidu.png", "sys/bs/icon/zhandian_icon_turangshidu.png", "zhandian_icon_turangshidu.png"),
|
||||
dataSoilWet3("dataSoilWet3", "60CM土壤湿度", "%", "sys/icon/zhandian_icon_turangshidu.png", "soil", "#0000CD", "sys/mobile/icon/zhandian_icon_turangshidu.png", "sys/bs/icon/zhandian_icon_turangshidu.png", "zhandian_icon_turangshidu.png"),
|
||||
dataSoilWet4("dataSoilWet4", "80CM土壤湿度", "%", "sys/icon/zhandian_icon_turangshidu.png", "soil", "#0000CG", "sys/mobile/icon/zhandian_icon_turangshidu.png", "sys/bs/icon/zhandian_icon_turangshidu.png", "zhandian_icon_turangshidu.png"),
|
||||
dataSoilTemp("dataSoilTemp", "土壤温度", "℃", "sys/icon/zhandian_icon_turangwendu.png", "soil", "#C71585", "sys/mobile/icon/zhandian_icon_turangwendu.png", "sys/bs/icon/zhandian_icon_turangwendu.png", "zhandian_icon_turangwendu.png"),
|
||||
dataSoilTemp2("dataSoilTemp2", "40CM土壤温度", "℃", "sys/icon/zhandian_icon_turangwendu.png", "soil", "#FF1493", "sys/mobile/icon/zhandian_icon_turangwendu.png", "sys/bs/icon/zhandian_icon_turangwendu.png", "zhandian_icon_turangwendu.png"),
|
||||
dataSoilTemp3("dataSoilTemp3", "60CM土壤温度", "℃", "sys/icon/zhandian_icon_turangwendu.png", "soil", "#FF69B4", "sys/mobile/icon/zhandian_icon_turangwendu.png", "sys/bs/icon/zhandian_icon_turangwendu.png", "zhandian_icon_turangwendu.png"),
|
||||
dataSoilTemp4("dataSoilTemp4", "80CM土壤温度", "℃", "sys/icon/zhandian_icon_turangwendu.png", "soil", "#FF69B9", "sys/mobile/icon/zhandian_icon_turangwendu.png", "sys/bs/icon/zhandian_icon_turangwendu.png", "zhandian_icon_turangwendu.png"),
|
||||
dataSoilDdl("dataSoilDdl", "电导率", "uS/cm", "sys/icon/zhandian_icon_ec.png", "soil", "#92D0D0", "sys/mobile/icon/zhandian_icon_ec.png", "sys/bs/icon/zhandian_icon_ec.png", "zhandian_icon_ec.png"),
|
||||
dataSoilDdl2("dataSoilDdl2", "40CM电导率", "uS/cm", "sys/icon/zhandian_icon_ec.png", "soil", "#73A2A2", "sys/mobile/icon/zhandian_icon_ec.png", "sys/bs/icon/zhandian_icon_ec.png", "zhandian_icon_ec.png"),
|
||||
dataSoilDdl3("dataSoilDdl3", "60CM电导率", "uS/cm", "sys/icon/zhandian_icon_ec.png", "soil", "#567777", "sys/mobile/icon/zhandian_icon_ec.png", "sys/bs/icon/zhandian_icon_ec.png", "zhandian_icon_ec.png"),
|
||||
dataSoilDdl4("dataSoilDdl4", "80CM电导率", "uS/cm", "sys/icon/zhandian_icon_ec.png", "soil", "#567789", "sys/mobile/icon/zhandian_icon_ec.png", "sys/bs/icon/zhandian_icon_ec.png", "zhandian_icon_ec.png"),
|
||||
|
||||
dataSoilSalt("dataSoilSalt", "土壤盐分", "", "sys/icon/zhandian_icon_ec.png", "soil", "#4F5555", "sys/mobile/icon/zhandian_icon_ec.png", "sys/bs/icon/zhandian_icon_ec.png", "zhandian_icon_ec.png"),
|
||||
|
||||
dataSoilWetMark("dataSoilWetMark", "土壤湿度mark", "%", "sys/icon/zhandian_icon_turangshidu.png", "soil", "#6495ED", "sys/mobile/icon/zhandian_icon_turangshidu.png", "sys/bs/icon/zhandian_icon_turangshidu.png", "zhandian_icon_turangshidu.png"),
|
||||
dataSoilMark("dataSoilMark", "土壤温度mark", "℃", "sys/icon/zhandian_icon_turangwendu.png", "soil", "#C71585", "sys/mobile/icon/zhandian_icon_turangwendu.png", "sys/bs/icon/zhandian_icon_turangwendu.png", "zhandian_icon_turangwendu.png"),
|
||||
dataSoilDdlMark("dataSoilDdlMark", "电导率mark", "uS/cm", "sys/icon/zhandian_icon_ec.png", "soil", "#92D0D0", "sys/mobile/icon/zhandian_icon_ec.png", "sys/bs/icon/zhandian_icon_ec.png", "zhandian_icon_ec.png"),
|
||||
|
||||
|
||||
dataDefault("default","默认","台","","default","#DEAB8A");
|
||||
dataLeafTemp("dataLeafTemp", "叶面温度", "℃", "sys/icon/zhandian_icon_leaftemp.png", "air", "#FF1493", "sys/mobile/icon/zhandian_icon_leaftemp.png", "sys/bs/icon/zhandian_icon_leaftemp.png", "zhandian_icon_leaftemp.png"),
|
||||
dataLeafWet("dataLeafWet", "叶面湿度", "%", "sys/icon/zhandian_icon_leafwet.png", "air", "#4169E1", "sys/mobile/icon/zhandian_icon_leafwet.png", "sys/bs/icon/zhandian_icon_leafwet.png", "zhandian_icon_leafwet.png"),
|
||||
|
||||
dataSoilPh("dataSoilPh", "土壤PH", "", "sys/icon/zhandian_icon_ph.png", "soil", "#92D0F1", "sys/mobile/icon/zhandian_icon_ph.png", "sys/bs/icon/zhandian_icon_ph.png", "zhandian_icon_ph.png"),
|
||||
dataSoilNion("dataSoilNion", "氮离子", "mg/KG", "sys/icon/zhandian_icon_nion.png", "soil", "#92D0F3", "sys/mobile/icon/zhandian_icon_nion.png", "sys/bs/icon/zhandian_icon_nion.png", "zhandian_icon_nion.png"),
|
||||
dataSoilPion("dataSoilPion", "磷离子", "mg/KG", "sys/icon/zhandian_icon_pion.png", "soil", "#92D0F5", "sys/mobile/icon/zhandian_icon_pion.png", "sys/bs/icon/zhandian_icon_pion.png", "zhandian_icon_pion.png"),
|
||||
dataSoilKion("dataSoilKion", "钾离子", "mg/KG", "sys/icon/shebei_icon_k-.png", "soil", "#92D0F7", "sys/mobile/icon/shebei_icon_k-.png", "sys/bs/icon/shebei_icon_k-.png", "shebei_icon_k-.png"),
|
||||
|
||||
dataSoilNion2("dataSoilNion2", "氮离子", "mg/KG", "sys/icon/zhandian_icon_nion.png", "soil", "#92D0F3", "sys/mobile/icon/zhandian_icon_nion.png", "sys/bs/icon/zhandian_icon_nion.png", "zhandian_icon_nion.png"),
|
||||
dataSoilPion2("dataSoilPion2", "磷离子", "mg/KG", "sys/icon/zhandian_icon_pion.png", "soil", "#92D0F5", "sys/mobile/icon/zhandian_icon_pion.png", "sys/bs/icon/zhandian_icon_pion.png", "zhandian_icon_pion.png"),
|
||||
dataSoilKion2("dataSoilKion2", "钾离子", "mg/KG", "sys/icon/shebei_icon_k-.png", "soil", "#92D0F7", "sys/mobile/icon/shebei_icon_k-.png", "sys/bs/icon/shebei_icon_k-.png", "shebei_icon_k-.png"),
|
||||
|
||||
|
||||
dataSoilNion3("dataSoilNion3", "氮离子", "mg/KG", "sys/icon/zhandian_icon_nion.png", "soil", "#92D0F3", "sys/mobile/icon/zhandian_icon_nion.png", "sys/bs/icon/zhandian_icon_nion.png", "zhandian_icon_nion.png"),
|
||||
dataSoilPion3("dataSoilPion3", "磷离子", "mg/KG", "sys/icon/zhandian_icon_pion.png", "soil", "#92D0F5", "sys/mobile/icon/zhandian_icon_pion.png", "sys/bs/icon/zhandian_icon_pion.png", "zhandian_icon_pion.png"),
|
||||
dataSoilKion3("dataSoilKion3", "钾离子", "mg/KG", "sys/icon/shebei_icon_k-.png", "soil", "#92D0F7", "sys/mobile/icon/shebei_icon_k-.png", "sys/bs/icon/shebei_icon_k-.png", "shebei_icon_k-.png"),
|
||||
|
||||
|
||||
dataSoilNion4("dataSoilNion4", "氮离子", "mg/KG", "sys/icon/zhandian_icon_nion.png", "soil", "#92D0F3", "sys/mobile/icon/zhandian_icon_nion.png", "sys/bs/icon/zhandian_icon_nion.png", "zhandian_icon_nion.png"),
|
||||
dataSoilPion4("dataSoilPion4", "磷离子", "mg/KG", "sys/icon/zhandian_icon_pion.png", "soil", "#92D0F5", "sys/mobile/icon/zhandian_icon_pion.png", "sys/bs/icon/zhandian_icon_pion.png", "zhandian_icon_pion.png"),
|
||||
dataSoilKion4("dataSoilKion4", "钾离子", "mg/KG", "sys/icon/shebei_icon_k-.png", "soil", "#92D0F7", "sys/mobile/icon/shebei_icon_k-.png", "sys/bs/icon/shebei_icon_k-.png", "shebei_icon_k-.png"),
|
||||
|
||||
|
||||
dataSoilNhion("dataSoilNhion", "土壤铵离子", "mg-L", "sys/icon/shebei_icon_nh4-.png", "soil", "#92D0F9", "sys/mobile/icon/shebei_icon_nh4-.png", "sys/bs/icon/shebei_icon_nh4-.png", "shebei_icon_nh4-.png"),
|
||||
dataSoilNoion("dataSoilNoion", "土壤硝酸根离子", "ppm", "sys/icon/shebei_icon_no3-.png", "soil", "#92D0FE", "sys/mobile/icon/shebei_icon_no3-.png", "sys/bs/icon/shebei_icon_no3-.png", "shebei_icon_no3-.png"),
|
||||
dataSoilCuion("dataSoilCuion", "土壤铜离子", "ppm", "sys/icon/zhandian_icon_cu-.png", "soil", "#92D1F1", "sys/mobile/icon/zhandian_icon_cu-.png", "sys/bs/icon/zhandian_icon_cu-.png", "zhandian_icon_cu-.png"),
|
||||
dataSoilPbion("dataSoilPbion", "土壤铅离子", "ppm", "sys/icon/zhandian_icon_pb-.png", "soil", "#92D1F3", "sys/mobile/icon/zhandian_icon_pb-.png", "sys/bs/icon/zhandian_icon_pb-.png", "zhandian_icon_pb-.png"),
|
||||
dataSoilCdion("dataSoilCdion", "土壤镉离子", "ppm", "sys/icon/zhandian_icon_cd-.png", "soil", "#92D1F5", "sys/mobile/icon/zhandian_icon_cd-.png", "sys/bs/icon/zhandian_icon_cd-.png", "zhandian_icon_cd-.png"),
|
||||
|
||||
|
||||
dataWaterTp("dataWaterTp", "总磷", "mg/L", "sys/icon/shebei_icon_tp.png", "water", "#C8CC00", "sys/mobile/icon/shebei_icon_tp.png", "sys/bs/icon/shebei_icon_tp.png", "shebei_icon_tp.png"),
|
||||
dataWaterTn("dataWaterTn", "总氮", "mg/L", "sys/icon/shebei_icon_tn.png", "water", "#009DB2", "sys/mobile/icon/shebei_icon_tn.png", "sys/bs/icon/shebei_icon_tn.png", "shebei_icon_tn.png"),
|
||||
dataWaterNo("dataWaterNo", "硝态氮", "mg/L", "sys/icon/shebei_icon_no3n.png", "water_orient", "#72BAA7", "sys/mobile/icon/shebei_icon_no3n.png", "sys/bs/icon/shebei_icon_no3n.png", "shebei_icon_no3n.png"),
|
||||
dataWaterNh("dataWaterNh", "氨氮", "mg/L", "sys/icon/shebei_icon_nh3n.png", "water_live", "#225A1F", "sys/mobile/icon/shebei_icon_nh3n.png", "sys/bs/icon/shebei_icon_nh3n.png", "shebei_icon_nh3n.png"),
|
||||
dataWaterCod("dataWaterCod", "化学需氧量", "mg/L", "sys/icon/shebei_icon_cod.png", "water_live", "#FDB933", "sys/mobile/icon/shebei_icon_cod.png", "sys/bs/icon/shebei_icon_cod.png", "shebei_icon_cod.png"),
|
||||
|
||||
dataStinkOu("dataOu","臭气浓度","mg/m³","sys/icon/zhandian_icon_ou.png","stink","#f47a75", "sys/mobile/icon/shebei_icon_ou.png", "sys/bs/icon/shebei_icon_ou.png", "shebei_icon_ou.png"),
|
||||
dataStinkNh3("dataNh3","氨气","mg/m³","sys/icon/zhandian_icon_nh3.png","stink","#d05c7c", "sys/mobile/icon/shebei_icon_nh3.png", "sys/bs/icon/shebei_icon_nh3.png", "shebei_icon_nh3.png"),
|
||||
dataStinkH2s("dataH2s","硫化氢","mg/m³","sys/icon/zhandian_icon_h2s.png","stink","#d05c9f", "sys/mobile/icon/shebei_icon_h2s.png", "sys/bs/icon/shebei_icon_h2s.png", "shebei_icon_h2s.png"),
|
||||
dataStinkTvoc("dataTvoc","总挥发性有机物","mg/m³","sys/icon/zhandian_icon_tvoc.png","stink","#f06464", "sys/mobile/icon/shebei_icon_tvoc.png", "sys/bs/icon/shebei_icon_tvoc.png", "shebei_icon_tvoc.png"),
|
||||
|
||||
dataPestLight("ct","杀虫次数","次","","9_pestlight","","","",""),
|
||||
|
||||
dataDefault("default", "默认", "台", "", "default", "#DEAB8A", "", "", "");
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
|
@ -71,13 +125,32 @@ public enum PollutionEnum {
|
|||
*/
|
||||
private String color;
|
||||
|
||||
PollutionEnum(String code,String description,String unit,String icon,String type,String color) {
|
||||
|
||||
/**
|
||||
* 手机端图标
|
||||
*/
|
||||
private String mobileIcon;
|
||||
|
||||
/**
|
||||
* 大屏图标
|
||||
*/
|
||||
private String bsIcon;
|
||||
|
||||
/**
|
||||
* 大屏图标
|
||||
*/
|
||||
private String iconName;
|
||||
|
||||
PollutionEnum(String code, String description, String unit, String icon, String type, String color, String mobileIcon, String bsIcon, String iconName) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
this.unit = unit;
|
||||
this.icon = icon;
|
||||
this.type = type;
|
||||
this.color = color;
|
||||
this.mobileIcon = mobileIcon;
|
||||
this.bsIcon = bsIcon;
|
||||
this.iconName = iconName;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
|
|
@ -128,14 +201,37 @@ public enum PollutionEnum {
|
|||
this.color = color;
|
||||
}
|
||||
|
||||
public String getMobileIcon() {
|
||||
return mobileIcon;
|
||||
}
|
||||
|
||||
public void setMobileIcon(String mobileIcon) {
|
||||
this.mobileIcon = mobileIcon;
|
||||
}
|
||||
|
||||
public String getBsIcon() {
|
||||
return bsIcon;
|
||||
}
|
||||
|
||||
public void setBsIcon(String bsIcon) {
|
||||
this.bsIcon = bsIcon;
|
||||
}
|
||||
|
||||
|
||||
public String getIconName() {
|
||||
return iconName;
|
||||
}
|
||||
|
||||
public void setIconName(String iconName) {
|
||||
this.iconName = iconName;
|
||||
}
|
||||
|
||||
public static PollutionEnum catchMessage(String msg) {
|
||||
|
||||
PollutionEnum result = null;
|
||||
|
||||
for (PollutionEnum s : values()) {
|
||||
if (s.description.equals(msg)) {
|
||||
if (s.code.equals(msg)) {
|
||||
result = s;
|
||||
break;
|
||||
}
|
||||
|
|
@ -165,7 +261,6 @@ public enum PollutionEnum {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
public JSONObject getJsonStr() {
|
||||
JSONObject job = new JSONObject();
|
||||
job.put("code", this.code);
|
||||
|
|
@ -174,6 +269,9 @@ public enum PollutionEnum {
|
|||
job.put("type", this.type);
|
||||
job.put("icon", this.icon);
|
||||
job.put("color", this.color);
|
||||
job.put("mobileIcon", this.mobileIcon);
|
||||
job.put("bsIcon", this.bsIcon);
|
||||
job.put("iconName", this.iconName);
|
||||
return job;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,180 @@
|
|||
package org.jeecg.common.constant.enums;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
public enum PollutionEnumBak {
|
||||
dataAirTemp("dataAirTemp","大气温度","℃","sys/icon/shebei_icon_qixiang.png","air","#22BB8A"),
|
||||
dataAirWet("dataAirWet","大气湿度","%RH","sys/icon/zhandian_icon_kongqishidu.png","air","#EE701C"),
|
||||
dataAirPress("dataAirPress","大气压力","hPa","sys/icon/zhandian_icon_daqiyali.png","air","#52AC2A"),
|
||||
dataRainFall("dataRainFall","雨量","mm","sys/icon/zhandian_icon_jiangyuliang.png","air","#2BADB9"),
|
||||
dataRainTotal("dataRainTotal","雨量累计","mm","sys/icon/zhandian_icon_jiangyuliang.png","air","#102B6A"),
|
||||
dataWindSpeed("dataWindSpeed","风速","m/s","sys/icon/zhandian_icon_fengsu.png","air","#7CD6CF"),
|
||||
dataWindDirection("dataWindDirection","风向","°","sys/icon/zhandian_icon_fengxiang.png","air","#26A3CC"),
|
||||
dataSunTotal("dataSunTotal","辐射累计","MJ/m2","sys/icon/zhandian_icon_taiyangquanfushe.png","air","#6C48C7"),
|
||||
dataSunFallout("dataSunFallout","太阳全辐射","W/m2","sys/icon/zhandian_icon_taiyangquanfushe.png","air","#22BB8A"),
|
||||
dataSoilWet("dataSoilWet","20CM土壤湿度","%","sys/icon/zhandian_icon_turangshidu.png","soil","#6495ED"),
|
||||
dataSoilWet2("dataSoilWet2","40CM土壤湿度","%","sys/icon/zhandian_icon_turangshidu.png","soil","#4169E1"),
|
||||
dataSoilWet3("dataSoilWet3","60CM土壤湿度","%","sys/icon/zhandian_icon_turangshidu.png","soil","#0000CD"),
|
||||
dataSoilTemp("dataSoilTemp","20CM土壤温度","℃","sys/icon/zhandian_icon_turangwendu.png","soil","#C71585"),
|
||||
dataSoilTemp2("dataSoilTemp2","40CM土壤温度","℃","sys/icon/zhandian_icon_turangwendu.png","soil","#FF1493"),
|
||||
dataSoilTemp3("dataSoilTemp3","60CM土壤温度","℃","sys/icon/zhandian_icon_turangwendu.png","soil","#FF69B4"),
|
||||
dataSoilDdl("dataSoilDdl","20CM电导率","uS/cm","sys/icon/zhandian_icon_ec.png","soil","#92D0D0"),
|
||||
dataSoilDdl2("dataSoilDdl2","40CM电导率","uS/cm","sys/icon/zhandian_icon_ec.png","soil","#73A2A2"),
|
||||
dataSoilDdl3("dataSoilDdl3","60CM电导率","uS/cm","sys/icon/zhandian_icon_ec.png","soil","#567777"),
|
||||
dataSoilSalt("dataSoilSalt","土壤盐分","","sys/icon/zhandian_icon_ec.png","soil","#4F5555"),
|
||||
|
||||
dataSoilWetMark("dataSoilWetMark","土壤湿度","%","sys/icon/zhandian_icon_turangshidu.png","soil","#6495ED"),
|
||||
dataSoilMark("dataSoilMark","土壤温度","℃","sys/icon/zhandian_icon_turangwendu.png","soil","#C71585"),
|
||||
dataSoilDdlMark("dataSoilDdlMark","电导率","uS/cm","sys/icon/zhandian_icon_ec.png","soil","#92D0D0"),
|
||||
|
||||
dataWaterTp("dataWaterTp","总磷","mg/L","sys/icon/shebei_icon_tp.png","water","#C8CC00"),
|
||||
dataWaterTn("dataWaterTn","总氮","mg/L","sys/icon/shebei_icon_tn.png","water","#009DB2"),
|
||||
dataWaterNo("dataWaterNo","硝态氮","mg/L","sys/icon/shebei_icon_no3n.png","water_orient","#72BAA7"),
|
||||
dataWaterNh("dataWaterNh","氨氮","mg/L","sys/icon/shebei_icon_nh3n.png","water_live","#225A1F"),
|
||||
dataWaterCod("dataWaterCod","化学需氧量","mg/L","sys/icon/shebei_icon_cod.png","water_live","#FDB933"),
|
||||
|
||||
|
||||
dataStinkOu("dataOu","臭气浓度","mg/m³","sys/icon/zhandian_icon_ou.png","stink","#f47a75"),
|
||||
dataStinkNh3("dataNh3","氨气","mg/m³","sys/icon/zhandian_icon_nh3.png","stink","#d05c7c"),
|
||||
dataStinkH2s("dataH2s","硫化氢","mg/m³","sys/icon/zhandian_icon_h2s.png","stink","#d05c9f"),
|
||||
dataStinkTvoc("dataTvoc","总挥发性有机物","mg/m³","sys/icon/zhandian_icon_tvoc.png","stink","#f06464"),
|
||||
|
||||
|
||||
dataDefault("default","默认","台","","default","#DEAB8A");
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 污染物类别
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String color;
|
||||
|
||||
PollutionEnumBak(String code,String description,String unit,String icon,String type,String color) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
this.unit = unit;
|
||||
this.icon = icon;
|
||||
this.type= type;
|
||||
this.color=color;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static PollutionEnumBak catchMessage(String msg) {
|
||||
|
||||
PollutionEnumBak result = null;
|
||||
|
||||
for (PollutionEnumBak s : values()) {
|
||||
if (s.description.equals(msg)) {
|
||||
result = s;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(result==null){
|
||||
return dataDefault;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public static PollutionEnumBak catchPollution(String survItem) {
|
||||
|
||||
PollutionEnumBak result = null;
|
||||
|
||||
for (PollutionEnumBak s : values()) {
|
||||
if (s.code.equals(survItem)) {
|
||||
result = s;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(result==null){
|
||||
return dataDefault;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public JSONObject getJsonStr(){
|
||||
JSONObject job = new JSONObject();
|
||||
job.put("code",this.code);
|
||||
job.put("description",this.description);
|
||||
job.put("unit",this.unit);
|
||||
job.put("type",this.type);
|
||||
job.put("icon",this.icon);
|
||||
job.put("color",this.color);
|
||||
return job;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -64,6 +64,7 @@ public class SurvDeviceDeploy implements Serializable {
|
|||
/**逻辑删除*/
|
||||
@Excel(name = "逻辑删除", width = 15)
|
||||
@ApiModelProperty(value = "逻辑删除")
|
||||
@TableLogic
|
||||
private java.lang.Integer isDel;
|
||||
/**更新时间*/
|
||||
@Excel(name = "更新时间", width = 15, format = "yyyy-MM-dd")
|
||||
|
|
@ -213,7 +214,7 @@ public class SurvDeviceDeploy implements Serializable {
|
|||
private String deviceName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private SurvDeviceInfo deviceInfo;
|
||||
private SurvDictDeviceDetail deviceInfo;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.jeecg.common.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
|
@ -144,4 +145,10 @@ public class SurvHisdataAir implements Serializable {
|
|||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "转储时间")
|
||||
private Date transDate;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("DEPLOY_ID")
|
||||
private String deployId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.jeecg.common.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
|
@ -155,4 +156,10 @@ public class SurvHisdataSoil implements Serializable {
|
|||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "转储时间")
|
||||
private Date transDate;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("DEPLOY_ID")
|
||||
private String deployId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.jeecg.common.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
|
@ -13,6 +14,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
|||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -105,7 +107,7 @@ public class SurvTransdataAir implements Serializable {
|
|||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "数据更新时间")
|
||||
private Date dataDateTime;
|
||||
private LocalDateTime dataDateTime;
|
||||
/**数据类型;realTime=实时,dayTime=日数据,month=月数据,year=年数据*/
|
||||
@Excel(name = "数据类型;realTime=实时,dayTime=日数据,month=月数据,year=年数据", width = 15)
|
||||
@ApiModelProperty(value = "数据类型;realTime=实时,dayTime=日数据,month=月数据,year=年数据")
|
||||
|
|
@ -138,4 +140,10 @@ public class SurvTransdataAir implements Serializable {
|
|||
@Excel(name = "设备名称", width = 15)
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("DEPLOY_ID")
|
||||
private String deployId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.jeecg.common.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
|
@ -13,6 +14,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
|||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -117,7 +119,7 @@ public class SurvTransdataSoil implements Serializable {
|
|||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "数据更新时间")
|
||||
private Date dataDateTime;
|
||||
private LocalDateTime dataDateTime;
|
||||
/**数据类型;realTime=实时,dayTime=日数据,month=月数据,year=年数据*/
|
||||
@Excel(name = "数据类型;realTime=实时,dayTime=日数据,month=月数据,year=年数据", width = 15)
|
||||
@ApiModelProperty(value = "数据类型;realTime=实时,dayTime=日数据,month=月数据,year=年数据")
|
||||
|
|
@ -150,4 +152,10 @@ public class SurvTransdataSoil implements Serializable {
|
|||
@Excel(name = "设备名称", width = 15)
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("DEPLOY_ID")
|
||||
private String deployId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package org.jeecg.common.iot.common;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecg.common.entity.SurvDeviceDeploy;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 不同的物联网监测设备,不同定义为监测项不同,即配置的监测项不完全一致
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class IotSurvDistinctDeploy {
|
||||
/**
|
||||
* 设备列表
|
||||
*/
|
||||
private List<SurvDeviceDeploy> deploys;
|
||||
/**
|
||||
* 监测项目
|
||||
*/
|
||||
private List<String> survItems;
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package org.jeecg.common.iot.common;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VODeployGroupId {
|
||||
private String groupName;
|
||||
private String groupId;
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package org.jeecg.common.iot.common;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VODeviceCate {
|
||||
private String deviceCate;
|
||||
private String deviceCount;
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package org.jeecg.common.iot.common;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecg.common.entity.SurvDeviceDeploy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class VODeviceWithData {
|
||||
@ApiModelProperty("设备统计")
|
||||
private List<VODeviceCate> deviceCate = new ArrayList<>();
|
||||
@ApiModelProperty("设备统计对象格式")
|
||||
private Map<String, String> deviceCateMap = new HashMap<>();
|
||||
@ApiModelProperty("总设备数")
|
||||
private String deviceCounts;
|
||||
@ApiModelProperty("空气设备")
|
||||
private List<SurvDeviceDeploy> airDevice = new ArrayList<>();
|
||||
@ApiModelProperty("土壤设备")
|
||||
private List<SurvDeviceDeploy> soilDevice = new ArrayList<>();
|
||||
@ApiModelProperty("水质设备")
|
||||
private List<SurvDeviceDeploy> waterDevice = new ArrayList<>();
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package org.jeecg.common.iot.common;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecg.common.vo.CommonDataTrans;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class VOIntegrateStatistic {
|
||||
@ApiModelProperty("对象格式结果")
|
||||
private LinkedHashMap<String, List<String>> objResults;
|
||||
@ApiModelProperty("表头")
|
||||
private List<VOSurvElement> tableHead;
|
||||
@ApiModelProperty("表序号")
|
||||
private List<String> tableIndex;
|
||||
@ApiModelProperty("数组格式结果")
|
||||
private List<LinkedHashMap<String,String>> tableData;
|
||||
@ApiModelProperty("二维数据格式结果")
|
||||
private String[][] tableData2;
|
||||
@ApiModelProperty("实时数据")
|
||||
private List<CommonDataTrans> realTimeData;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package org.jeecg.common.iot.common;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 监测数据元素说明
|
||||
*/
|
||||
@Data
|
||||
public class VOSurvElement {
|
||||
@ApiModelProperty("元素字段")
|
||||
private String eleField;
|
||||
@ApiModelProperty("元素中文")
|
||||
private String eleDesc;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package org.jeecg.common.iot.common;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 监测数据元素说明
|
||||
*/
|
||||
@Data
|
||||
public class VOSurvElementValue {
|
||||
@ApiModelProperty("元素字段")
|
||||
private String eleField;
|
||||
@ApiModelProperty("元素值")
|
||||
private String eleValue;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package org.jeecg.common.iot.common;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 监测数据综合统计
|
||||
*/
|
||||
@Data
|
||||
public class VOSurvIntegrate {
|
||||
@ApiModelProperty("空气温度")
|
||||
private String airTempOne;
|
||||
}
|
||||
|
|
@ -0,0 +1,158 @@
|
|||
package org.jeecg.common.iot.common;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
@Data
|
||||
public class VOSurvIntegrateAirDetail {
|
||||
@ApiModelProperty("时间")
|
||||
private String dates;
|
||||
|
||||
/**
|
||||
* 大气温度
|
||||
*/
|
||||
@Excel(name = "大气温度(℃)", width = 15)
|
||||
@ApiModelProperty(value = "大气温度(℃)")
|
||||
private String dataAirTemp;
|
||||
|
||||
/**
|
||||
* 大气湿度
|
||||
*/
|
||||
@Excel(name = "大气湿度(%RH)", width = 15)
|
||||
@ApiModelProperty(value = "大气湿度(%RH)")
|
||||
private String dataAirWet;
|
||||
|
||||
/**
|
||||
* 大气压力
|
||||
*/
|
||||
// @Excel(name = "大气压力", width = 15)
|
||||
@ApiModelProperty(value = "大气压力")
|
||||
private String dataAirPress;
|
||||
|
||||
/**
|
||||
* 雨量
|
||||
*/
|
||||
// @Excel(name = "雨量", width = 15)
|
||||
@ApiModelProperty(value = "雨量")
|
||||
private String dataRainFall;
|
||||
|
||||
/**
|
||||
* 风速
|
||||
*/
|
||||
// @Excel(name = "风速", width = 15)
|
||||
@ApiModelProperty(value = "风速")
|
||||
private String dataWindSpeed;
|
||||
|
||||
/**
|
||||
* 风向
|
||||
*/
|
||||
// @Excel(name = "风向", width = 15)
|
||||
@ApiModelProperty(value = "风向")
|
||||
private String dataWindDirection;
|
||||
|
||||
/**
|
||||
* 太阳全辐射
|
||||
*/
|
||||
// @Excel(name = "太阳全辐射", width = 15)
|
||||
@ApiModelProperty(value = "太阳全辐射")
|
||||
private String dataSunFallout;
|
||||
|
||||
/**
|
||||
* 辐射累计
|
||||
*/
|
||||
// @Excel(name = "辐射累计", width = 15)
|
||||
@ApiModelProperty(value = "辐射累计")
|
||||
private String dataSunTotal;
|
||||
|
||||
@ApiModelProperty(value = "日照时数")
|
||||
private String dataSunHour;
|
||||
|
||||
/**
|
||||
* 雨量累计
|
||||
*/
|
||||
// @Excel(name = "雨量累计", width = 15)
|
||||
@ApiModelProperty(value = "雨量累计")
|
||||
private String dataRainTotal;
|
||||
|
||||
/**
|
||||
* pm2.5
|
||||
*/
|
||||
@ApiModelProperty(value = "pm2.5")
|
||||
private String dataPm25;
|
||||
|
||||
/**
|
||||
* 照度
|
||||
*/
|
||||
@Excel(name = "照度(Lux)", width = 15)
|
||||
@ApiModelProperty(value = "照度(Lux)")
|
||||
private String dataSunRate;
|
||||
|
||||
/**
|
||||
* 二氧化碳
|
||||
*/
|
||||
@Excel(name = "二氧化碳(ppm)", width = 15)
|
||||
@ApiModelProperty(value = "二氧化碳(ppm)")
|
||||
private String dataAirCod;
|
||||
|
||||
/**
|
||||
* 叶面温度
|
||||
*/
|
||||
@Excel(name = "叶面温度(℃)", width = 15)
|
||||
@ApiModelProperty(value = "叶面温度(℃)")
|
||||
private String dataLeafTemp;
|
||||
/**
|
||||
* 叶面湿度
|
||||
*/
|
||||
@Excel(name = "叶面湿度(%)", width = 15)
|
||||
@ApiModelProperty(value = "叶面湿度(%)")
|
||||
private String dataLeafWet;
|
||||
|
||||
|
||||
/**
|
||||
* 光合
|
||||
*/
|
||||
private String dataPhotosynthetic;
|
||||
|
||||
/**
|
||||
* 蒸发
|
||||
*/
|
||||
private String dataEvaporation;
|
||||
|
||||
/**
|
||||
* 负氧离子
|
||||
*/
|
||||
private String dataAirNeo;
|
||||
|
||||
|
||||
/**
|
||||
* 全辐射
|
||||
*/
|
||||
private String dataAirTotalRadiation;
|
||||
|
||||
/**
|
||||
* 氨气
|
||||
*/
|
||||
private String dataAirNh;
|
||||
|
||||
/**
|
||||
* 硫化氢
|
||||
*/
|
||||
private String dataAirHs;
|
||||
|
||||
/**
|
||||
* 预备一
|
||||
*/
|
||||
private String dataAirEone;
|
||||
|
||||
/**
|
||||
* 预备二
|
||||
*/
|
||||
private String dataAirEtwo;
|
||||
|
||||
/**
|
||||
* 预备三
|
||||
*/
|
||||
private String dataAirEthree;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package org.jeecg.common.iot.common;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class VOSurvIntegrateParam {
|
||||
@ApiModelProperty("设备部署id")
|
||||
private List<String> deployIds;
|
||||
@ApiModelProperty("开始时间")
|
||||
private String startTime;
|
||||
@ApiModelProperty("结束时间")
|
||||
private String endTime;
|
||||
@ApiModelProperty("统计模式,dayhours=日小时统计,monthDays=月每日统计,yearMonth=年每月统计")
|
||||
private String summrayMode;
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package org.jeecg.common.iot.common;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecg.common.vo.CommonDataTrans;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 监测数据综合统计
|
||||
*/
|
||||
@Data
|
||||
public class VOSurvIntegrateResult {
|
||||
@ApiModelProperty("统计结果")
|
||||
private LinkedHashMap<String,List<String>> survResult;
|
||||
@ApiModelProperty("表头")
|
||||
private List<VOSurvElement> headers;
|
||||
@ApiModelProperty("表序号")
|
||||
private List<String> indexs;
|
||||
@ApiModelProperty("内部用序号,前端不调")
|
||||
private List<String> subIndexs;
|
||||
@ApiModelProperty("实时数据")
|
||||
private List<CommonDataTrans> liveData;
|
||||
}
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
package org.jeecg.common.iot.common;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
@Data
|
||||
public class VOSurvIntegrateSoilDetail {
|
||||
@ApiModelProperty("时间")
|
||||
private String dates;
|
||||
/**
|
||||
* 土壤温度1;106
|
||||
*/
|
||||
@Excel(name = "土壤温度(%)", width = 15)
|
||||
@ApiModelProperty(value = "土壤温度(%)")
|
||||
private String dataSoilTemp;
|
||||
|
||||
/**
|
||||
* 土壤湿度1;107
|
||||
*/
|
||||
@Excel(name = "土壤湿度(%)", width = 15)
|
||||
@ApiModelProperty(value = "土壤湿度(%)")
|
||||
private String dataSoilWet;
|
||||
|
||||
/**
|
||||
* 土壤盐分;198
|
||||
*/
|
||||
// @Excel(name = "土壤盐分", width = 15)
|
||||
@ApiModelProperty(value = "土壤盐分")
|
||||
private String dataSoilSalt;
|
||||
|
||||
/**
|
||||
* 土壤温度2
|
||||
*/
|
||||
@ApiModelProperty(value = "土壤温度2")
|
||||
private String dataSoilTemp2;
|
||||
|
||||
/**
|
||||
* 土壤湿度2
|
||||
*/
|
||||
@ApiModelProperty(value = "土壤湿度2")
|
||||
private String dataSoilWet2;
|
||||
|
||||
/**
|
||||
* 土壤温度3
|
||||
*/
|
||||
@ApiModelProperty(value = "土壤温度3")
|
||||
private String dataSoilTemp3;
|
||||
|
||||
/**
|
||||
* 土壤湿度3
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "土壤湿度3")
|
||||
private String dataSoilWet3;
|
||||
|
||||
/**
|
||||
* 土壤温度4
|
||||
*/
|
||||
@ApiModelProperty(value = "土壤温度4")
|
||||
private String dataSoilTemp4;
|
||||
|
||||
/**
|
||||
* 土壤湿度4
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "土壤湿度4")
|
||||
private String dataSoilWet4;
|
||||
|
||||
/**
|
||||
* 电导率1
|
||||
*/
|
||||
@Excel(name = "电导率(uS/cm)", width = 15)
|
||||
@ApiModelProperty(value = "电导率(uS/cm)")
|
||||
private String dataSoilDdl;
|
||||
|
||||
/**
|
||||
* 电导率2
|
||||
*/
|
||||
@ApiModelProperty(value = "电导率2")
|
||||
private String dataSoilDdl2;
|
||||
|
||||
/**
|
||||
* 电导率3
|
||||
*/
|
||||
@ApiModelProperty(value = "电导率3")
|
||||
private String dataSoilDdl3;
|
||||
|
||||
/**
|
||||
* 电导率4
|
||||
*/
|
||||
@ApiModelProperty(value = "电导率4")
|
||||
private String dataSoilDdl4;
|
||||
|
||||
/**
|
||||
* 土壤PH
|
||||
*/
|
||||
@Excel(name = "土壤PH", width = 15)
|
||||
private String dataSoilPh;
|
||||
|
||||
/**
|
||||
* 氮离子
|
||||
*/
|
||||
@Excel(name = "氮离子(mg/KG)", width = 15)
|
||||
private String dataSoilNion;
|
||||
|
||||
/**
|
||||
* 磷离子
|
||||
*/
|
||||
@Excel(name = "磷离子(mg/KG)", width = 15)
|
||||
private String dataSoilPion;
|
||||
|
||||
/**
|
||||
* 钾离子
|
||||
*/
|
||||
@Excel(name = "钾离子(mg/KG)", width = 15)
|
||||
private String dataSoilKion;
|
||||
|
||||
|
||||
/**
|
||||
* 氮离子
|
||||
*/
|
||||
private String dataSoilNion2;
|
||||
|
||||
/**
|
||||
* 磷离子
|
||||
*/
|
||||
private String dataSoilPion2;
|
||||
|
||||
/**
|
||||
* 钾离子
|
||||
*/
|
||||
private String dataSoilKion2;
|
||||
|
||||
|
||||
/**
|
||||
* 氮离子
|
||||
*/
|
||||
private String dataSoilNion3;
|
||||
|
||||
/**
|
||||
* 磷离子
|
||||
*/
|
||||
private String dataSoilPion3;
|
||||
|
||||
/**
|
||||
* 钾离子
|
||||
*/
|
||||
private String dataSoilKion3;
|
||||
|
||||
|
||||
/**
|
||||
* 氮离子
|
||||
*/
|
||||
private String dataSoilNion4;
|
||||
|
||||
/**
|
||||
* 磷离子
|
||||
*/
|
||||
private String dataSoilPion4;
|
||||
|
||||
/**
|
||||
* 钾离子
|
||||
*/
|
||||
private String dataSoilKion4;
|
||||
|
||||
/**
|
||||
* 土壤铵离子
|
||||
*/
|
||||
@Excel(name = "土壤铵离子(mg-L)", width = 15)
|
||||
private String dataSoilNhion;
|
||||
|
||||
/**
|
||||
* 土壤硝酸根离子
|
||||
*/
|
||||
@Excel(name = "土壤硝酸根离子(ppm)", width = 15)
|
||||
private String dataSoilNoion;
|
||||
|
||||
/**
|
||||
* 土壤铜离子
|
||||
*/
|
||||
private String dataSoilCuion;
|
||||
|
||||
/**
|
||||
* 土壤铅离子
|
||||
*/
|
||||
private String dataSoilPbion;
|
||||
|
||||
/**
|
||||
* 土壤镉离子
|
||||
*/
|
||||
private String dataSoilCdion;
|
||||
|
||||
/**
|
||||
* 叶面温度
|
||||
*/
|
||||
@ApiModelProperty(value = "叶面温度")
|
||||
private String dataLeafTemp;
|
||||
/**
|
||||
* 叶面湿度
|
||||
*/
|
||||
@ApiModelProperty(value = "叶面湿度")
|
||||
private String dataLeafWet;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
package org.jeecg.common.iot.common;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.ContentStyle;
|
||||
import com.alibaba.excel.annotation.write.style.HeadStyle;
|
||||
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
|
||||
@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)//表头样式
|
||||
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)//内容样式
|
||||
public class VOSurvIntegrateTotal {
|
||||
|
||||
@ExcelProperty(value = "时间", index = 0)
|
||||
@ColumnWidth(20)
|
||||
private String dates;
|
||||
|
||||
@ExcelProperty(value = "20cm-土壤湿度", index = 1)
|
||||
@ColumnWidth(20)
|
||||
private String dataSoilWet;
|
||||
|
||||
@ExcelProperty(value = "40cm-土壤湿度", index = 2)
|
||||
@ColumnWidth(20)
|
||||
private String dataSoilWet2;
|
||||
|
||||
@ExcelProperty(value = "20cm-土壤温度", index = 3)
|
||||
@ColumnWidth(20)
|
||||
private String dataSoilTemp;
|
||||
|
||||
@ExcelProperty(value = "40cm-土壤温度", index = 4)
|
||||
@ColumnWidth(20)
|
||||
private String dataSoilTemp2;
|
||||
|
||||
|
||||
|
||||
@ExcelProperty(value = "20cm-电导率", index = 5)
|
||||
@ColumnWidth(20)
|
||||
private String dataSoilDdl;
|
||||
|
||||
@ExcelProperty(value = "40cm-电导率", index = 6)
|
||||
@ColumnWidth(20)
|
||||
private String dataSoilDdl2;
|
||||
|
||||
|
||||
|
||||
@ExcelProperty(value = "20cm-钾离子", index = 7)
|
||||
@ColumnWidth(20)
|
||||
private String dataSoilKion;
|
||||
|
||||
@ExcelProperty(value = "20cm-氮离子", index = 8)
|
||||
@ColumnWidth(20)
|
||||
private String dataSoilNion;
|
||||
|
||||
@ExcelProperty(value = "40cm-磷离子", index = 9)
|
||||
@ColumnWidth(20)
|
||||
private String dataSoilPion;
|
||||
|
||||
@ExcelProperty(value = "40cm-钾离子", index = 10)
|
||||
@ColumnWidth(20)
|
||||
private String dataSoilKion2;
|
||||
@ExcelProperty(value = "40cm-氮离子", index = 11)
|
||||
@ColumnWidth(20)
|
||||
private String dataSoilNion2;
|
||||
@ExcelProperty(value = "40cm-磷离子", index = 12)
|
||||
@ColumnWidth(20)
|
||||
private String dataSoilPion2;
|
||||
|
||||
|
||||
@ExcelProperty(value = "风速", index = 13)
|
||||
@ColumnWidth(20)
|
||||
private String dataWindSpeed;
|
||||
|
||||
@ExcelProperty(value = "雨量累计", index = 14)
|
||||
@ColumnWidth(20)
|
||||
private String dataRainTotal;
|
||||
|
||||
@ExcelProperty(value = "大气温度", index = 15)
|
||||
@ColumnWidth(20)
|
||||
private String dataAirTemp;
|
||||
|
||||
@ExcelProperty(value = "大气湿度", index = 16)
|
||||
@ColumnWidth(20)
|
||||
private String dataAirWet;
|
||||
|
||||
@ExcelProperty(value = "数字气压", index = 17)
|
||||
@ColumnWidth(20)
|
||||
private String dataAirPress;
|
||||
|
||||
@ExcelProperty(value = "PM2.5", index = 18)
|
||||
@ColumnWidth(20)
|
||||
private String dataPm25;
|
||||
|
||||
@ExcelProperty(value = "风向", index = 19)
|
||||
@ColumnWidth(20)
|
||||
private String dataWindDirection;
|
||||
|
||||
@ExcelProperty(value = "日照时数", index = 20)
|
||||
@ColumnWidth(20)
|
||||
private String dataSunHour;
|
||||
|
||||
@ExcelProperty(value = "总辐射", index = 21)
|
||||
@ColumnWidth(20)
|
||||
private String dataAirTotalRadiation;
|
||||
|
||||
@ExcelProperty(value = "辐射累计", index = 22)
|
||||
@ColumnWidth(20)
|
||||
private String dataSunTotal;
|
||||
|
||||
@ExcelProperty(value = "蒸发", index = 23)
|
||||
@ColumnWidth(20)
|
||||
private String dataEvaporation;
|
||||
|
||||
@ExcelProperty(value = "负氧离子", index = 24)
|
||||
@ColumnWidth(20)
|
||||
private String dataAirNeo;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package org.jeecg.common.iot.common;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecg.common.entity.SurvDeviceDeploy;
|
||||
import org.jeecg.common.vo.CommonDataTrans;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class VOTransData {
|
||||
private List<CommonDataTrans> transData;
|
||||
private SurvDeviceDeploy deploy;
|
||||
private long current;
|
||||
private long pages;
|
||||
private long size;
|
||||
private long total;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package org.jeecg.common.iot.common;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class VOWaterSurvIntegrateParam {
|
||||
@ApiModelProperty("设备部署id")
|
||||
private List<String> deployIds;
|
||||
@ApiModelProperty("开始时间")
|
||||
private String startTime;
|
||||
@ApiModelProperty("结束时间")
|
||||
private String endTime;
|
||||
@ApiModelProperty("统计模式,dayhours=日小时统计,monthDays=月每日统计,yearMonth=年每月统计")
|
||||
private String summrayMode;
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package org.jeecg.common.iot.common;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VOZhiBiao {
|
||||
private String fieldName;
|
||||
private Double valHigh;
|
||||
private Double valLow;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,192 @@
|
|||
package org.jeecg.common.util;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 时间范围工具类 - JDK 1.8兼容版本
|
||||
*/
|
||||
public class DateTimeRangeUtils {
|
||||
|
||||
/**
|
||||
* 时间单位枚举
|
||||
*/
|
||||
public enum TimeUnit {
|
||||
YEAR, // 年
|
||||
MONTH, // 月
|
||||
DAY, // 日
|
||||
HOUR // 小时
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取时间范围内的所有时间点列表
|
||||
* @param start 开始时间
|
||||
* @param end 结束时间
|
||||
* @param unit 时间单位
|
||||
* @return 按照正序排列的时间列表
|
||||
*/
|
||||
public static List<LocalDateTime> getDateTimeRange2(LocalDateTime start, LocalDateTime end, TimeUnit unit) {
|
||||
// 参数校验
|
||||
if (start == null || end == null || unit == null) {
|
||||
throw new IllegalArgumentException("参数不能为null");
|
||||
}
|
||||
|
||||
if (start.isAfter(end)) {
|
||||
throw new IllegalArgumentException("开始时间不能晚于结束时间");
|
||||
}
|
||||
|
||||
List<LocalDateTime> result = new ArrayList<>();
|
||||
|
||||
switch (unit) {
|
||||
case YEAR:
|
||||
result = getYearRange(start, end);
|
||||
break;
|
||||
case MONTH:
|
||||
result = getMonthRange(start, end);
|
||||
break;
|
||||
case DAY:
|
||||
result = getDayRange(start, end);
|
||||
break;
|
||||
case HOUR:
|
||||
result = getHourRange(start, end);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("不支持的时间单位: " + unit);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取年份范围
|
||||
*/
|
||||
private static List<LocalDateTime> getYearRange(LocalDateTime start, LocalDateTime end) {
|
||||
LocalDateTime adjustedStart = start.withMonth(1).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
|
||||
LocalDateTime adjustedEnd = end.withMonth(1).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
|
||||
|
||||
return generateRange(adjustedStart, adjustedEnd, ChronoUnit.YEARS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取月份范围
|
||||
*/
|
||||
private static List<LocalDateTime> getMonthRange(LocalDateTime start, LocalDateTime end) {
|
||||
LocalDateTime adjustedStart = start.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
|
||||
LocalDateTime adjustedEnd = end.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
|
||||
|
||||
return generateRange(adjustedStart, adjustedEnd, ChronoUnit.MONTHS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取日期范围
|
||||
*/
|
||||
private static List<LocalDateTime> getDayRange(LocalDateTime start, LocalDateTime end) {
|
||||
LocalDateTime adjustedStart = start.withHour(0).withMinute(0).withSecond(0).withNano(0);
|
||||
LocalDateTime adjustedEnd = end.withHour(0).withMinute(0).withSecond(0).withNano(0);
|
||||
|
||||
return generateRange(adjustedStart, adjustedEnd, ChronoUnit.DAYS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取小时范围
|
||||
*/
|
||||
private static List<LocalDateTime> getHourRange(LocalDateTime start, LocalDateTime end) {
|
||||
LocalDateTime adjustedStart = start.withMinute(0).withSecond(0).withNano(0);
|
||||
LocalDateTime adjustedEnd = end.withMinute(0).withSecond(0).withNano(0);
|
||||
|
||||
return generateRange(adjustedStart, adjustedEnd, ChronoUnit.HOURS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成时间范围 - JDK 1.8兼容版本
|
||||
*/
|
||||
private static List<LocalDateTime> generateRange(LocalDateTime start, LocalDateTime end, ChronoUnit unit) {
|
||||
List<LocalDateTime> result = new ArrayList<>();
|
||||
|
||||
LocalDateTime current = start;
|
||||
while (!current.isAfter(end)) {
|
||||
result.add(current);
|
||||
current = current.plus(1, unit);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重载方法:返回字符串列表(格式化的时间)
|
||||
*/
|
||||
public static List<String> getDateTimeRange(LocalDateTime start, LocalDateTime end,
|
||||
TimeUnit unit, String pattern) {
|
||||
List<LocalDateTime> dateTimes = getDateTimeRange2(start, end, unit);
|
||||
|
||||
java.time.format.DateTimeFormatter formatter =
|
||||
java.time.format.DateTimeFormatter.ofPattern(pattern);
|
||||
|
||||
return dateTimes.stream()
|
||||
.map(formatter::format)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 重载方法:返回特定格式的字符串列表
|
||||
*/
|
||||
public static List<String> getDateTimeRange(LocalDateTime start, LocalDateTime end, TimeUnit unit) {
|
||||
List<LocalDateTime> dateTimes = getDateTimeRange2(start, end, unit);
|
||||
|
||||
// 根据时间单位返回合适的格式
|
||||
String pattern;
|
||||
switch (unit) {
|
||||
case YEAR:
|
||||
pattern = "yyyy";
|
||||
break;
|
||||
case MONTH:
|
||||
pattern = "yyyy-MM";
|
||||
break;
|
||||
case DAY:
|
||||
pattern = "yyyy-MM-dd";
|
||||
break;
|
||||
case HOUR:
|
||||
pattern = "yyyy-MM-dd HH";
|
||||
break;
|
||||
default:
|
||||
pattern = "yyyy-MM-dd HH:mm:ss";
|
||||
}
|
||||
|
||||
java.time.format.DateTimeFormatter formatter =
|
||||
java.time.format.DateTimeFormatter.ofPattern(pattern);
|
||||
|
||||
return dateTimes.stream()
|
||||
.map(formatter::format)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
LocalDateTime start = LocalDateTime.of(2023, 1, 15, 10, 30);
|
||||
LocalDateTime end = LocalDateTime.of(2023, 3, 20, 15, 45);
|
||||
|
||||
// 测试月份范围
|
||||
System.out.println("月份范围 (LocalDateTime):");
|
||||
List<LocalDateTime> months = DateTimeRangeUtils.getDateTimeRange2(
|
||||
start, end, TimeUnit.MONTH);
|
||||
months.forEach(System.out::println);
|
||||
|
||||
System.out.println("\n月份范围 (格式化字符串):");
|
||||
List<String> monthStrs = DateTimeRangeUtils.getDateTimeRange(
|
||||
start, end, TimeUnit.MONTH);
|
||||
monthStrs.forEach(System.out::println);
|
||||
|
||||
// 测试日期范围
|
||||
System.out.println("\n日期范围:");
|
||||
List<String> days = DateTimeRangeUtils.getDateTimeRange(
|
||||
start, end, TimeUnit.DAY);
|
||||
days.forEach(System.out::println);
|
||||
|
||||
// 测试自定义格式
|
||||
System.out.println("\n自定义格式:");
|
||||
List<String> customFormat = DateTimeRangeUtils.getDateTimeRange(
|
||||
start, end, TimeUnit.MONTH, "yyyy年MM月");
|
||||
customFormat.forEach(System.out::println);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,699 @@
|
|||
/**
|
||||
* Copyright © 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
|
||||
*/
|
||||
package org.jeecg.common.util;
|
||||
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.*;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.DateTimeParseException;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
/**
|
||||
* 日期工具类, 继承org.apache.commons.lang.time.DateUtils类
|
||||
*
|
||||
* @author WGX
|
||||
* @version 2014-4-15
|
||||
*/
|
||||
public class DateUtilTools extends org.apache.commons.lang3.time.DateUtils {
|
||||
|
||||
private static String[] parsePatterns = {
|
||||
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss:SSS", "yyyy-MM-dd HH:mm", "yyyy-MM",
|
||||
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
||||
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
|
||||
|
||||
// public static void main(String[] args) throws ParseException {
|
||||
// String d = "2020-3-31 3:5";
|
||||
// Date da = parseDate(d, parsePatterns[2]);
|
||||
// System.out.println(formatDate(da, parsePatterns[1]));
|
||||
// System.out.println(formatDate(plusOneDay(da), parsePatterns[1]));
|
||||
// System.out.println(formatDate(getNextDateZero(da), parsePatterns[1]));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 日期加一天
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static Date plusOneDay(Date date) {
|
||||
if (date == null) {
|
||||
return null;
|
||||
}
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(date);
|
||||
calendar.add(calendar.DATE, 1); //把日期往后增加一天,整数 往后推,负数往前移动
|
||||
return calendar.getTime(); //这个时间就是日期往后推一天的结果
|
||||
}
|
||||
|
||||
public static Date plusDay(Date date, int num) {
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(date);
|
||||
calendar.add(calendar.DATE, num); //把日期往后增加一天,整数 往后推,负数往前移动
|
||||
return calendar.getTime(); //这个时间就是日期往后推一天的结果
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本周星期一
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static Date getFirstDayOfWeek(Date date) {
|
||||
Calendar cale = Calendar.getInstance();
|
||||
cale.setTime(date);
|
||||
cale.set(Calendar.DAY_OF_WEEK, 2);//星期一
|
||||
cale.set(Calendar.HOUR_OF_DAY, 0);
|
||||
cale.set(Calendar.MINUTE, 0);
|
||||
cale.set(Calendar.SECOND, 0);
|
||||
cale.set(Calendar.MILLISECOND, 0);
|
||||
return cale.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本周星期日
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static Date getLastDayOfWeek(Date date) {
|
||||
Calendar cale = Calendar.getInstance();
|
||||
cale.setTime(date);
|
||||
cale.set(Calendar.DAY_OF_WEEK, 1);//星期日
|
||||
cale.set(Calendar.HOUR_OF_DAY, 0);
|
||||
cale.set(Calendar.MINUTE, 0);
|
||||
cale.set(Calendar.SECOND, 0);
|
||||
cale.set(Calendar.MILLISECOND, 0);
|
||||
return cale.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下星期一
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static Date getFirstDateOfLastWeek(Date date) {
|
||||
Calendar cale = Calendar.getInstance();
|
||||
cale.setTime(date);
|
||||
cale.add(Calendar.DAY_OF_YEAR, 7);//星期日
|
||||
cale.set(Calendar.DAY_OF_WEEK, 2);//星期日
|
||||
cale.set(Calendar.HOUR_OF_DAY, 0);
|
||||
cale.set(Calendar.MINUTE, 0);
|
||||
cale.set(Calendar.SECOND, 0);
|
||||
cale.set(Calendar.MILLISECOND, 0);
|
||||
return cale.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下月第一天
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static Date getFirstDayOfNextMonth(Date date) {
|
||||
Calendar cale = Calendar.getInstance();
|
||||
cale.setTime(date);
|
||||
cale.add(Calendar.MONTH, 1);
|
||||
cale.set(Calendar.HOUR_OF_DAY, 0);
|
||||
cale.set(Calendar.MINUTE, 0);
|
||||
cale.set(Calendar.SECOND, 0);
|
||||
cale.set(Calendar.MILLISECOND, 0);
|
||||
return cale.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当月第一天
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static Date getFirstDayOfMonth(Date date) {
|
||||
Calendar cale = Calendar.getInstance();
|
||||
cale.setTime(date);
|
||||
cale.add(Calendar.MONTH, 0);
|
||||
cale.set(Calendar.DAY_OF_MONTH, 1);
|
||||
cale.set(Calendar.HOUR_OF_DAY, 0);
|
||||
cale.set(Calendar.MINUTE, 0);
|
||||
cale.set(Calendar.SECOND, 0);
|
||||
cale.set(Calendar.MILLISECOND, 0);
|
||||
return cale.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当月最后一天
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static Date getLastDayOfMonth(Date date) {
|
||||
Calendar cale = Calendar.getInstance();
|
||||
cale.setTime(date);
|
||||
cale.add(Calendar.MONTH, 1);
|
||||
cale.set(Calendar.DAY_OF_MONTH, 1);
|
||||
cale.set(Calendar.HOUR_OF_DAY, 0);
|
||||
cale.set(Calendar.MINUTE, 0);
|
||||
cale.set(Calendar.SECOND, 0);
|
||||
cale.set(Calendar.MILLISECOND, 0);
|
||||
return cale.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前日期是本月第几天
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static int getDaysOfMonth(Date date) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
return calendar.get(Calendar.DAY_OF_MONTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本月最大天数
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static int getMaxDaysOfMonth(Date date) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
return calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下一天的零点
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static Date getNextDateZero(Date date) {
|
||||
if (date == null) {
|
||||
return null;
|
||||
}
|
||||
return getDateZero(plusOneDay(date));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取日期0点Date
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static Date getDateZero(Date date) {
|
||||
if (date == null) {
|
||||
return null;
|
||||
}
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(date);
|
||||
cal.set(Calendar.HOUR_OF_DAY, 0);
|
||||
cal.set(Calendar.SECOND, 0);
|
||||
cal.set(Calendar.MINUTE, 0);
|
||||
cal.set(Calendar.MILLISECOND, 000);
|
||||
// long l = System.currentTimeMillis()/86400000 * 86400000 - TimeZone.getTimeZone("Hongkong").getRawOffset()+86400000;
|
||||
// long zero = date.getTime() / (1000 * 3600 * 24) * (1000 * 3600 * 24) - TimeZone.getDefault().getRawOffset();
|
||||
return new Date(cal.getTimeInMillis());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取今日0点Date
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static Date getDateZero() {
|
||||
return getDateZero(new Date());
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到当前日期字符串 格式(yyyy-MM-dd)
|
||||
*/
|
||||
public static String getDate() {
|
||||
return getDate("yyyy-MM-dd");
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到当前日期字符串 格式(yyyy-MM-dd) pattern可以为:"yyyy-MM-dd" "HH:mm:ss" "E"
|
||||
*/
|
||||
public static String getDate(String pattern) {
|
||||
return DateFormatUtils.format(new Date(), pattern);
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到日期字符串 默认格式(yyyy-MM-dd) pattern可以为:"yyyy-MM-dd" "HH:mm:ss" "E"
|
||||
*/
|
||||
public static String formatDate(Date date, Object... pattern) {
|
||||
String formatDate = null;
|
||||
if (pattern != null && pattern.length > 0) {
|
||||
formatDate = DateFormatUtils.format(date, pattern[0].toString());
|
||||
} else {
|
||||
formatDate = DateFormatUtils.format(date, "yyyy-MM-dd");
|
||||
}
|
||||
return formatDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到日期时间字符串,转换格式(yyyy-MM-dd HH:mm:ss)
|
||||
*/
|
||||
public static String formatDateTime(Date date) {
|
||||
return formatDate(date, "yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到当前时间字符串 格式(HH:mm:ss)
|
||||
*/
|
||||
public static String getTime() {
|
||||
return formatDate(new Date(), "HH:mm:ss");
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到当前日期和时间字符串 格式(yyyy-MM-dd HH:mm:ss)
|
||||
*/
|
||||
public static String getDateTime() {
|
||||
return formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到当前年份字符串 格式(yyyy)
|
||||
*/
|
||||
public static String getYear() {
|
||||
return formatDate(new Date(), "yyyy");
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到当前月份字符串 格式(MM)
|
||||
*/
|
||||
public static String getMonth() {
|
||||
return formatDate(new Date(), "MM");
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到当天字符串 格式(dd)
|
||||
*/
|
||||
public static String getDay() {
|
||||
return formatDate(new Date(), "dd");
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到当前星期字符串 格式(E)星期几
|
||||
*/
|
||||
public static String getWeek() {
|
||||
return formatDate(new Date(), "E");
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期型字符串转化为日期 格式
|
||||
* { "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm",
|
||||
* "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm",
|
||||
* "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm" }
|
||||
*/
|
||||
public static Date parseDate(Object str) {
|
||||
if (str == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
String text = str.toString();
|
||||
try {
|
||||
long time = Long.parseLong(text);
|
||||
return new Date(time);
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
return parseDate(text, parsePatterns);
|
||||
} catch (ParseException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取过去的天数
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static long pastDays(Date date) {
|
||||
long t = new Date().getTime() - date.getTime();
|
||||
return t / (24 * 60 * 60 * 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取过去的小时
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static long pastHour(Date date) {
|
||||
long t = new Date().getTime() - date.getTime();
|
||||
return t / (60 * 60 * 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取过去的分钟
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static long pastMinutes(Date date) {
|
||||
long t = new Date().getTime() - date.getTime();
|
||||
return t / (60 * 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为时间(天,时:分:秒.毫秒)
|
||||
*
|
||||
* @param timeMillis
|
||||
* @return
|
||||
*/
|
||||
public static String formatDateTime(long timeMillis) {
|
||||
long day = timeMillis / (24 * 60 * 60 * 1000);
|
||||
long hour = (timeMillis / (60 * 60 * 1000) - day * 24);
|
||||
long min = ((timeMillis / (60 * 1000)) - day * 24 * 60 - hour * 60);
|
||||
long s = (timeMillis / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - min * 60);
|
||||
long sss = (timeMillis - day * 24 * 60 * 60 * 1000 - hour * 60 * 60 * 1000 - min * 60 * 1000 - s * 1000);
|
||||
return (day > 0 ? day + "," : "") + hour + ":" + min + ":" + s + "." + sss;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取两个日期之间的天数
|
||||
*
|
||||
* @param before
|
||||
* @param after
|
||||
* @return
|
||||
*/
|
||||
public static double getDistanceOfTwoDate(Date before, Date after) {
|
||||
long beforeTime = before.getTime();
|
||||
long afterTime = after.getTime();
|
||||
return (afterTime - beforeTime) / (1000 * 60 * 60 * 24);
|
||||
}
|
||||
|
||||
//毫秒数转天时分秒
|
||||
public static String millisecondsConvertToDHMS(long milliseconds) {
|
||||
|
||||
final long day = TimeUnit.MILLISECONDS.toDays(milliseconds);
|
||||
|
||||
final long hours = TimeUnit.MILLISECONDS.toHours(milliseconds)
|
||||
- TimeUnit.DAYS.toHours(TimeUnit.MILLISECONDS.toDays(milliseconds));
|
||||
|
||||
final long minutes = TimeUnit.MILLISECONDS.toMinutes(milliseconds)
|
||||
- TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(milliseconds));
|
||||
|
||||
final long seconds = TimeUnit.MILLISECONDS.toSeconds(milliseconds)
|
||||
- TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(milliseconds));
|
||||
|
||||
final long ms = TimeUnit.MILLISECONDS.toMillis(milliseconds)
|
||||
- TimeUnit.SECONDS.toMillis(TimeUnit.MILLISECONDS.toSeconds(milliseconds));
|
||||
|
||||
String format = String.format("%d 天 %d 小时 %d 分钟 ", day, hours, minutes);
|
||||
if (ms < 0) {
|
||||
return "0 天";
|
||||
}
|
||||
return format;
|
||||
}
|
||||
|
||||
public static String calTimeGap(LocalDateTime date1, LocalDateTime date2) {
|
||||
Instant instant1 = date1.toInstant(ZoneOffset.UTC);
|
||||
Instant instant2 = date2.toInstant(ZoneOffset.UTC);
|
||||
Duration duration = Duration.between(date1, date2);
|
||||
|
||||
// Long mins = TimeUnit.MILLISECONDS.toMinutes(duration.toMillis());
|
||||
Long senconds = Math.abs(duration.getSeconds());
|
||||
return String.valueOf(senconds) + "秒";
|
||||
}
|
||||
|
||||
public static String convertSecondsToMinutes(int seconds) {
|
||||
int minutes = seconds / 60; // 计算整数部分
|
||||
double remainingSeconds = seconds % 60; // 计算小数部分
|
||||
double minutesWithSeconds = minutes + remainingSeconds / 60; // 整数部分加上小数部分
|
||||
return String.valueOf(minutesWithSeconds);
|
||||
}
|
||||
|
||||
public static List<LocalDate> getDatesBetween(LocalDate startDate, LocalDate endDate) {
|
||||
List<LocalDate> dates = new ArrayList<>();
|
||||
long numOfDaysBetween = ChronoUnit.DAYS.between(startDate, endDate);
|
||||
for (int i = 0; i <= numOfDaysBetween; i++) {
|
||||
LocalDate date = startDate.plusDays(i);
|
||||
dates.add(date);
|
||||
}
|
||||
return dates;
|
||||
}
|
||||
public static List<String> getStringDatesBetween(String startDate, String endDate) {
|
||||
List<String> dates = new ArrayList<>();
|
||||
DateTimeFormatter datef = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
LocalDate sDate = LocalDate.parse(startDate, datef);
|
||||
LocalDate eDate = LocalDate.parse(endDate, datef);
|
||||
long numOfDaysBetween = ChronoUnit.DAYS.between(sDate, eDate);
|
||||
for (int i = 0; i <= numOfDaysBetween; i++) {
|
||||
LocalDate date = sDate.plusDays(i);
|
||||
dates.add(datef.format(date));
|
||||
}
|
||||
return dates;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将秒级时间戳转换为 Date 对象
|
||||
* @param timestamp 秒级时间戳
|
||||
* @return Date 对象
|
||||
*/
|
||||
public static Date toDateFromSeconds(long timestamp) {
|
||||
return new Date(timestamp * 1000L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将毫秒级时间戳转换为 Date 对象
|
||||
* @param timestamp 毫秒级时间戳
|
||||
* @return Date 对象
|
||||
*/
|
||||
public static Date toDateFromMillis(long timestamp) {
|
||||
return new Date(timestamp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 严格验证字符串是否符合指定的时间格式(使用java.time API)
|
||||
* @param dateTimeStr 要验证的时间字符串
|
||||
* @param formatPattern 时间格式模式
|
||||
* @return true-完全匹配,false-不匹配
|
||||
*/
|
||||
public static boolean isStrictlyValidFormat(String dateTimeStr, String formatPattern) {
|
||||
if (dateTimeStr == null || formatPattern == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(formatPattern, Locale.getDefault());
|
||||
// 根据格式长度进行初步筛选
|
||||
if (dateTimeStr.length() != formatPattern.replaceAll("'[^']*'", "").length()) {
|
||||
return false;
|
||||
}
|
||||
// 反向验证:将解析后的对象重新格式化为字符串,必须与原字符串完全一致
|
||||
String reformatted;
|
||||
if (formatPattern.startsWith("HH") || formatPattern.startsWith("hh")) {
|
||||
reformatted = LocalTime.parse(dateTimeStr, formatter).format(formatter);
|
||||
} else if (formatPattern.equals("yyyy")){
|
||||
DateTimeFormatter temp = DateTimeFormatter.ofPattern(formatPattern+"-MM-dd", Locale.getDefault());
|
||||
reformatted = LocalDate.parse(dateTimeStr+"-01-01", temp).format(formatter);
|
||||
}else if (formatPattern.equals("yyyy-MM")){
|
||||
DateTimeFormatter temp = DateTimeFormatter.ofPattern(formatPattern+"-dd", Locale.getDefault());
|
||||
reformatted = LocalDate.parse(dateTimeStr+"-01", temp).format(formatter);
|
||||
}
|
||||
else if (formatPattern.contains("yyyy") && !formatPattern.contains("HH") && !formatPattern.contains("hh") && !formatPattern.contains("mm") && !formatPattern.contains("ss")) {
|
||||
reformatted = LocalDate.parse(dateTimeStr, formatter).format(formatter);
|
||||
}else{
|
||||
reformatted = LocalDateTime.parse(dateTimeStr, formatter).format(formatter);
|
||||
}
|
||||
return dateTimeStr.equals(reformatted);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 严格验证日期格式(Legacy API版本)
|
||||
* @param dateStr 日期字符串
|
||||
* @param formatPattern 格式模式
|
||||
* @return true-完全匹配,false-不匹配
|
||||
*/
|
||||
public static boolean isStrictlyValidLegacyFormat(String dateStr, String formatPattern) {
|
||||
if (dateStr == null || formatPattern == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(formatPattern, Locale.getDefault());
|
||||
sdf.setLenient(false);
|
||||
|
||||
try {
|
||||
sdf.parse(dateStr);
|
||||
// 反向验证
|
||||
return dateStr.equals(sdf.format(sdf.parse(dateStr)));
|
||||
} catch (ParseException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 常用格式的快捷验证方法
|
||||
public static boolean isStrictlyValidISODate(String dateStr) {
|
||||
return isStrictlyValidFormat(dateStr, "yyyy-MM-dd");
|
||||
}
|
||||
|
||||
public static boolean isStrictlyValidISOTime(String timeStr) {
|
||||
return isStrictlyValidFormat(timeStr, "HH:mm:ss");
|
||||
}
|
||||
|
||||
public static boolean isStrictlyValidISODateTime(String dateTimeStr) {
|
||||
return isStrictlyValidFormat(dateTimeStr, "yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
||||
public static boolean isStrictlyValidChineseDate(String dateStr) {
|
||||
return isStrictlyValidFormat(dateStr, "yyyy年MM月dd日");
|
||||
}
|
||||
|
||||
|
||||
private static void validateYears(int startYear, int endYear) {
|
||||
if (startYear < 0 || endYear < 0) {
|
||||
throw new IllegalArgumentException("年份不能为负数");
|
||||
}
|
||||
if (startYear > endYear) {
|
||||
throw new IllegalArgumentException("开始年份不能大于结束年份");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期的月初和月末日期(LocalDate版本)
|
||||
* @param date 当前日期
|
||||
* @return 包含月初和月末的数组,[0]=月初,[1]=月末
|
||||
*/
|
||||
public static String[] getMonthStartAndEnd(LocalDate date) {
|
||||
DateTimeFormatter sdf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
YearMonth yearMonth = YearMonth.from(date);
|
||||
LocalDate start = yearMonth.atDay(1);
|
||||
LocalDate end = yearMonth.atEndOfMonth();
|
||||
return new String[]{sdf.format(start), sdf.format(end)};
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取两个年份之间的所有月份(格式:yyyy-MM)
|
||||
* @param startYear 开始年份(包含)
|
||||
* @param endYear 结束年份(包含)
|
||||
* @return 月份字符串列表,按正序排列
|
||||
*/
|
||||
public static List<String> getMonthsBetweenYears(int startYear, int endYear) {
|
||||
validateYears(startYear, endYear);
|
||||
|
||||
List<YearMonth> yearMonths = new ArrayList<>();
|
||||
YearMonth start = YearMonth.of(startYear, 1);
|
||||
YearMonth end = YearMonth.of(endYear, 12);
|
||||
|
||||
while (!start.isAfter(end)) {
|
||||
yearMonths.add(start);
|
||||
start = start.plusMonths(1);
|
||||
}
|
||||
|
||||
return yearMonths.stream()
|
||||
.map(ym -> ym.format(DateTimeFormatter.ofPattern("yyyy-MM")))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取两个日期之间的所有月份(默认格式:yyyy-MM)
|
||||
* @param startDateStr 开始日期(格式:yyyy-MM-dd)
|
||||
* @param endDateStr 结束日期(格式:yyyy-MM-dd)
|
||||
* @return 月份字符串列表,按正序排列
|
||||
* @throws DateTimeParseException 如果日期格式无效
|
||||
*/
|
||||
public static List<String> getMonthsBetweenDates(String startDateStr, String endDateStr) throws DateTimeParseException {
|
||||
return getMonthsBetweenDates(startDateStr, endDateStr, "yyyy-MM-dd", "yyyy-MM");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取两个日期之间的所有月份(自定义格式)
|
||||
* @param startDateStr 开始日期字符串
|
||||
* @param endDateStr 结束日期字符串
|
||||
* @param inputPattern 输入日期格式(如 "yyyy-MM-dd")
|
||||
* @param outputPattern 输出月份格式(如 "yyyy年MM月")
|
||||
* @return 月份字符串列表,按正序排列
|
||||
* @throws DateTimeParseException 如果日期格式无效
|
||||
*/
|
||||
public static List<String> getMonthsBetweenDates(String startDateStr, String endDateStr,
|
||||
String inputPattern, String outputPattern) throws DateTimeParseException {
|
||||
// 验证输入
|
||||
if (startDateStr == null || endDateStr == null || inputPattern == null || outputPattern == null) {
|
||||
throw new IllegalArgumentException("参数不能为null");
|
||||
}
|
||||
|
||||
// 解析日期
|
||||
DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern(inputPattern);
|
||||
LocalDate startDate = LocalDate.parse(startDateStr, inputFormatter);
|
||||
LocalDate endDate = LocalDate.parse(endDateStr, inputFormatter);
|
||||
|
||||
// 验证日期顺序
|
||||
if (startDate.isAfter(endDate)) {
|
||||
// throw new IllegalArgumentException("开始日期不能晚于结束日期");
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
// 转换为YearMonth
|
||||
YearMonth startYearMonth = YearMonth.from(startDate);
|
||||
YearMonth endYearMonth = YearMonth.from(endDate);
|
||||
|
||||
// 收集所有月份
|
||||
List<YearMonth> yearMonths = new ArrayList<>();
|
||||
YearMonth current = startYearMonth;
|
||||
while (!current.isAfter(endYearMonth)) {
|
||||
yearMonths.add(current);
|
||||
current = current.plusMonths(1);
|
||||
}
|
||||
|
||||
// 格式化为字符串
|
||||
DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern(outputPattern);
|
||||
return yearMonths.stream()
|
||||
.map(ym -> ym.format(outputFormatter))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取两个年份之间的所有年份(包含开始和结束年份)
|
||||
* @param startYearStr 开始年份字符串(如 "2020")
|
||||
* @param endYearStr 结束年份字符串(如 "2023")
|
||||
* @return 年份字符串列表,按正序排列
|
||||
* @throws IllegalArgumentException 如果年份无效或开始年份大于结束年份
|
||||
*/
|
||||
public static List<String> getYearsBetween(String startYearStr, String endYearStr) {
|
||||
// 参数校验
|
||||
if (startYearStr == null || endYearStr == null) {
|
||||
throw new IllegalArgumentException("年份参数不能为null");
|
||||
}
|
||||
|
||||
// 转换为整数
|
||||
int startYear = parseYear(startYearStr);
|
||||
int endYear = parseYear(endYearStr);
|
||||
|
||||
// 验证年份顺序
|
||||
if (startYear > endYear) {
|
||||
// throw new IllegalArgumentException("开始年份不能大于结束年份");
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
// 生成年份范围
|
||||
return IntStream.rangeClosed(startYear, endYear)
|
||||
.mapToObj(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 解析年份字符串
|
||||
private static int parseYear(String yearStr) {
|
||||
try {
|
||||
int year = Integer.parseInt(yearStr);
|
||||
if (year < 0) {
|
||||
throw new IllegalArgumentException("年份不能为负数: " + yearStr);
|
||||
}
|
||||
return year;
|
||||
} catch (NumberFormatException e) {
|
||||
throw new IllegalArgumentException("无效的年份格式: " + yearStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,168 @@
|
|||
package org.jeecg.common.util;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Java 反射工具类
|
||||
*
|
||||
* @author wgx
|
||||
* date 2022.3.21
|
||||
*/
|
||||
public class ReflectionUtils extends org.springframework.util.ReflectionUtils {
|
||||
|
||||
|
||||
/**
|
||||
* 递归查找包括所有父类class内field属性
|
||||
*
|
||||
* @param clazz
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public static Field getField(Class clazz, String name) {
|
||||
Field f = null;
|
||||
Field[] fields = clazz.getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
if (field.getName().equals(name)) {
|
||||
f = field;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (f == null) {
|
||||
Class superclass = clazz.getSuperclass();
|
||||
if (null != superclass && !(superclass.equals(Object.class))) {
|
||||
f = getField(superclass, name);
|
||||
}
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
public static Object getValueByFieldName(Object clazz, String fieldName) {
|
||||
Class<?> aClass = clazz.getClass();
|
||||
Field field = getField(aClass, fieldName);
|
||||
if (field == null) {
|
||||
return null;
|
||||
}
|
||||
field.setAccessible(true);
|
||||
try {
|
||||
return field.get(clazz);
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Class所有field,包含继承父类的
|
||||
*
|
||||
* @param clazz
|
||||
* @return
|
||||
*/
|
||||
public static List<Field> getAllFields(Class clazz) {
|
||||
Field[] f = clazz.getDeclaredFields();
|
||||
List<Field> fields = new ArrayList(Arrays.asList(f));
|
||||
Class superclass = clazz.getSuperclass();
|
||||
if (null != superclass && !(superclass.equals(Object.class))) {
|
||||
List<Field> fields1 = getAllFields(superclass);
|
||||
if (!fields1.isEmpty()) {
|
||||
fields.addAll(fields1);
|
||||
}
|
||||
}
|
||||
return fields;
|
||||
}
|
||||
|
||||
public static boolean setField(Object target, String fieldName, Object val) {
|
||||
List<Field> allFields = getAllFields(target.getClass());
|
||||
for (Field field : allFields) {
|
||||
if (field.getName().equals(fieldName)) {
|
||||
field.setAccessible(true);
|
||||
try {
|
||||
field.set(target, val);
|
||||
return true;
|
||||
} catch (IllegalAccessException e) {
|
||||
System.out.println("反射设置值失败.: " + ReflectionUtils.class.getName() + ".setField()");
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 反射获取 class 实例,待用
|
||||
*
|
||||
* @param clazz
|
||||
* @param objects
|
||||
* @param <E>
|
||||
* @return
|
||||
*/
|
||||
private <E> E getInstance(Class<E> clazz, Object... objects) {
|
||||
int length = objects.length;
|
||||
Class[] classes = new Class[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
classes[i] = objects[i].getClass();
|
||||
}
|
||||
try {
|
||||
Constructor<E> constructor = clazz.getConstructor(classes);
|
||||
E e = constructor.newInstance(objects);
|
||||
return e;
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过反射获取 对象指定field list
|
||||
* 示例: getIntegerIdList(list, "userId", "");
|
||||
*
|
||||
* @param list
|
||||
* @param fieldName
|
||||
* @param <E>
|
||||
* @return
|
||||
*/
|
||||
public static <E, R> List<R> getStringIdList(List<E> list, String fieldName, Class<R> c) {
|
||||
ArrayList<R> arrayList = Lists.newArrayList();
|
||||
if (list != null && !list.isEmpty()) {
|
||||
Field field1 = ReflectionUtils.getField(list.get(0).getClass(), fieldName);
|
||||
if (field1 == null) {
|
||||
return arrayList;
|
||||
}
|
||||
// Class<?> aClass = c.getClass();
|
||||
try {
|
||||
field1.setAccessible(true);
|
||||
for (E o : list) {
|
||||
Object o1 = field1.get(o);
|
||||
if (o1 != null && c.equals(o1.getClass())) {
|
||||
arrayList.add((R) o1);
|
||||
}
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
//去重
|
||||
if (!arrayList.isEmpty()) {
|
||||
Set set = Sets.newHashSet();
|
||||
set.addAll(arrayList);
|
||||
arrayList.clear();
|
||||
arrayList.addAll(set);
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -2,28 +2,72 @@ package org.jeecg.common.vo;
|
|||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecg.common.constant.DeviceReadConstants;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CommonDataTrans {
|
||||
@ApiModelProperty("设备编号")
|
||||
private String deployId;
|
||||
@ApiModelProperty("监测类型")
|
||||
private String survType;
|
||||
@ApiModelProperty("监测项名称")
|
||||
private String name;
|
||||
@ApiModelProperty("单位")
|
||||
private String unit;
|
||||
@ApiModelProperty("图标")
|
||||
private String icon;
|
||||
@ApiModelProperty("手机端图标")
|
||||
private String mobileIcon;
|
||||
@ApiModelProperty("大屏图标")
|
||||
private String bsIcon;
|
||||
// @ApiModelProperty("监测项字段名")
|
||||
// private String item;
|
||||
@ApiModelProperty("监测值")
|
||||
private String value;
|
||||
@ApiModelProperty("颜色")
|
||||
private String color;
|
||||
@ApiModelProperty("图标名称")
|
||||
private String iconName;
|
||||
@ApiModelProperty("更新时间")
|
||||
private String lastUpdate;
|
||||
@ApiModelProperty("读数情况")
|
||||
private String readStatus = DeviceReadConstants.READ_NORMAL;
|
||||
@ApiModelProperty
|
||||
private String limitStr = "*~*";
|
||||
@ApiModelProperty("h5图标路径")
|
||||
private String h5IconPath;
|
||||
@ApiModelProperty("中台图标路径")
|
||||
private String midIconPath;
|
||||
@ApiModelProperty("app图标路径")
|
||||
private String appIconPath;
|
||||
@ApiModelProperty("大屏图标路径")
|
||||
private String bsIconPath;
|
||||
@ApiModelProperty("大屏图标路径2")
|
||||
private String bsIconPath2;
|
||||
|
||||
|
||||
@ApiModelProperty("监测项名称")
|
||||
private String trend;
|
||||
private String survItem;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "数据更新时间")
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化
|
||||
private LocalDateTime dataDateTime;
|
||||
private String stationName;
|
||||
private String stationCode;
|
||||
private String stationType;
|
||||
private Integer dataCounts;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package org.jeecg.common.vo;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CommonDataTrans_bak {
|
||||
private String name;
|
||||
private String unit;
|
||||
private String value;
|
||||
private String color;
|
||||
private String trend;
|
||||
private String survItem;
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "数据更新时间")
|
||||
private LocalDateTime dataDateTime;
|
||||
private String stationName;
|
||||
private String stationCode;
|
||||
private String stationType;
|
||||
private Integer dataCounts;
|
||||
}
|
||||
|
|
@ -86,4 +86,9 @@ public class SurvTransdataAirVo implements Serializable {
|
|||
@TableField(exist = false)
|
||||
private Integer dataCounts;
|
||||
|
||||
/**设备ID*/
|
||||
@Excel(name = "设备ID", width = 15)
|
||||
@ApiModelProperty(value = "设备ID")
|
||||
private String deployId;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,4 +101,9 @@ public class SurvTransdataSoilVo implements Serializable {
|
|||
@TableField(exist = false)
|
||||
private Integer dataCounts;
|
||||
|
||||
/**设备ID*/
|
||||
@Excel(name = "设备ID", width = 15)
|
||||
@ApiModelProperty(value = "设备ID")
|
||||
private String deployId;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue