Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
| | |
| | | */ |
| | | if(hasWaterAmount){ |
| | | //瞬时流量:5字节BCD码,取值范围0~9999999.999,单位为m3/h。 |
| | | cdData.instantAmount = 0.0D ; |
| | | int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.instantAmount += tpInt/1000.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.instantAmount += tpInt/10.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.instantAmount += tpInt * 10.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.instantAmount += tpInt * 1000.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.instantAmount += tpInt * 100000.0 ; |
| | | int tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 4) ; |
| | | cdData.instantAmount = tpInt/1000.0 ; |
| | | |
| | | //累计流量:5字节BCD码,取值范围0~9999999999,单位为m3。 |
| | | cdData.totalAmount = 0.0D ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.totalAmount += tpInt; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.totalAmount += tpInt * 100.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.totalAmount += tpInt * 10000.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.totalAmount += tpInt * 1000000.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.totalAmount += tpInt * 100000000.0 ; |
| | | index += 5 ; |
| | | //累计流量:5字节BCD码,取值范围0~99999999.99,单位为m3。 |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 4) ; |
| | | cdData.totalAmount = tpInt/100.0; |
| | | |
| | | index += 5 ; |
| | | //损失流量:5字节BCD码,取值范围0~9999999999,单位为m3。 |
| | | cdData.lossAmount = 0.0D ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.lossAmount += tpInt; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.lossAmount += tpInt * 100.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.lossAmount += tpInt * 10000.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.lossAmount += tpInt * 1000000.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.lossAmount += tpInt * 100000000.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 4) ; |
| | | cdData.lossAmount = tpInt/100.0; |
| | | |
| | | index += 5 ; |
| | | } |
| | | if(hasWaterPress){ |
| | | //水压:4字节BCD码,取值范围0~999999.99,单位为KPa。 |
| | | cdData.waterPress = 0.0D ; |
| | | int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.waterPress += tpInt/100.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.waterPress += tpInt; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.waterPress += tpInt * 100.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.waterPress += tpInt * 10000.0 ; |
| | | int tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 3) ; |
| | | cdData.waterPress = tpInt/100.0 ; |
| | | index += 4 ; |
| | | } |
| | | if(hasEleVolt){ |
| | | //电池电压:2字节BCD码,取值范围0~99.99,单位为V。 |
| | | cdData.batteryVolt = 0.0D ;//蓄电池电压 |
| | | cdData.sunVolt = 0.0D ;//太阳能电压 |
| | | int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.batteryVolt += tpInt/100.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.batteryVolt += tpInt; |
| | | // //太阳能电压:4字节BCD码,取值范围0~99.99,单位为V。 |
| | | // tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | // index++ ; |
| | | // cdData.sunVolt += tpInt/100.0 ; |
| | | // tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | // index++ ; |
| | | // cdData.sunVolt += tpInt; |
| | | //蓄电池电压 |
| | | int tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 1) ; |
| | | cdData.batteryVolt = tpInt/100.0 ; |
| | | index += 2 ; |
| | | } |
| | | if(hasSignal){ |
| | | //信号强度:1字节BCD码,取值范围0~99。 |
| | | cdData.signalValue = 0 ; |
| | | int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | cdData.signalValue = tpInt ; |
| | | index++ ; |
| | | cdData.signalValue += tpInt ; |
| | | } |
| | | if(hasAlarmStatus){ |
| | | //报警数据 |
| | |
| | | } |
| | | |
| | | //水价:2字节BCD码,取值范围0~99.99,单位为元。 |
| | | cdData.waterPrice = 0.0D ;//水价 |
| | | int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.waterPrice += tpInt/100.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.waterPrice += tpInt; |
| | | int tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 1) ; |
| | | cdData.waterPrice = tpInt/100.0 ; |
| | | |
| | | index += 2 ; |
| | | cdData.rtuDt = GlParse.parseTp(bs, index) ; |
| | | |
| | | } |
| | |
| | | 阀门:报警 |
| | | */ |
| | | DataAlarmVo avo = new DataAlarmVo() ; |
| | | byte b = bs[index + 1] ; |
| | | byte b = bs[index] ; |
| | | avo.batteryVolt = (byte)((b & 0x2) >> 1) ; |
| | | avo.meter = (byte)((b & 0x20) >> 5) ; |
| | | |
| | | b = bs[index] ; |
| | | b = bs[index + 1] ; |
| | | avo.loss = (byte)((b & 0x2) >> 1) ; |
| | | avo.valve = (byte)((b & 0x4) >> 2) ; |
| | | return avo ; |
| | |
| | | |
| | | public static DataStateVo parseState(byte[] bs, short index){ |
| | | DataStateVo avo = new DataStateVo() ; |
| | | byte b = bs[index + 1] ; |
| | | byte b = bs[index] ; |
| | | avo.icCard = (byte)((b & 0x4) >> 2) ; |
| | | avo.working = (byte)((b & 0x10) >> 4) ; |
| | | avo.powerType = (byte)((b & 0x40) >> 6) ; |
| | |
| | | public Double lossAmount; //损失流量(从0时到当前的漏损累计流量,24时一个周期,0时归0):5字节BCD码,取值范围0~9999999999,单位为m3。 |
| | | public Double waterPress; //水压:4字节BCD码,取值范围0~999999.99,单位为KPa。 |
| | | public Double batteryVolt;//蓄电池电压:2字节BCD码,取值范围0~99.99,单位为V。 |
| | | public Double sunVolt ;//太阳能电压:2字节BCD码,取值范围0~99.99,单位为V。 |
| | | public Integer signalValue; //信号强度:1字节BCD码,取值范围0~99。 |
| | | public Double waterPrice ;//水价:2字节BCD码,取值范围0~99.99,单位为V。 |
| | | public String rtuDt ;//控制器时钟 |
| | |
| | | sb.append("\n"); |
| | | sb.append(" 蓄电池电压:"); |
| | | sb.append(batteryVolt==null?"":batteryVolt); |
| | | sb.append("\n"); |
| | | sb.append(" 太阳能电压:"); |
| | | sb.append(sunVolt==null?"":sunVolt); |
| | | sb.append("\n"); |
| | | sb.append(" 信号强度:"); |
| | | sb.append(signalValue ==null?"": signalValue); |
| | |
| | | public Double batteryVolt; |
| | | |
| | | /** |
| | | * 太阳能电压,单位为V |
| | | */ |
| | | public Double sunVolt; |
| | | |
| | | /** |
| | | * 信号强度,取值范围0~99 |
| | | */ |
| | | public Integer signalValue; |
| | |
| | | this.lossAmount = cdData.lossAmount ;// 损失流量(从0时到当前的漏损累计流量,24时一个周期,0时归0)单位为m3。 |
| | | this.waterPress = cdData.waterPress ;// 水压,单位为KPa |
| | | this.batteryVolt = cdData.batteryVolt ;// 蓄电池电压,单位为V |
| | | this.sunVolt = cdData.sunVolt ;// 太阳能电压,单位为V |
| | | this.signalValue = cdData.signalValue ;// 信号强度,取值范围0~99 |
| | | this.waterPrice = cdData.waterPrice ;// 水价,单位为元。 |
| | | } |
| | |
| | | public Double batteryVolt; |
| | | |
| | | /** |
| | | * 太阳能电压,单位为V |
| | | */ |
| | | public Double sunVolt; |
| | | |
| | | /** |
| | | * 信号强度,取值范围0~99 |
| | | */ |
| | | public Integer signalValue; |
| | |
| | | this.lossAmount = cdData.lossAmount ;// 损失流量(从0时到当前的漏损累计流量,24时一个周期,0时归0)单位为m3。 |
| | | this.waterPress = cdData.waterPress ;// 水压,单位为KPa |
| | | this.batteryVolt = cdData.batteryVolt ;// 蓄电池电压,单位为V |
| | | this.sunVolt = cdData.sunVolt ;// 太阳能电压,单位为V |
| | | this.signalValue = cdData.signalValue ;// 信号强度,取值范围0~99 |
| | | this.waterPrice = cdData.waterPrice ;// 水价,单位为元。 |
| | | } |
| | |
| | | actutorPort: 9070 |
| | | idSuffix: 0 |
| | | sso: |
| | | cacheMaximumSize: 10000 #登录用户缓存可缓存用户的最大值 |
| | | cacheDuration: 720 #缓存登录用户发呆最大时长(分钟) |
| | | checkUrl: http://127.0.0.1:8079/sso/sso/ssoCheck |
| | | webPort: 8079 |
| | | actutorPort: 9079 |
| | |
| | | <result column="loss_amount" jdbcType="FLOAT" property="lossAmount" /> |
| | | <result column="water_press" jdbcType="FLOAT" property="waterPress" /> |
| | | <result column="battery_volt" jdbcType="FLOAT" property="batteryVolt" /> |
| | | <result column="sun_volt" jdbcType="FLOAT" property="sunVolt" /> |
| | | <result column="signal_value" jdbcType="INTEGER" property="signalValue" /> |
| | | <result column="water_price" jdbcType="FLOAT" property="waterPrice" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controller_id, intake_id, rtu_addr, dt, rtu_dt, instant_amount, total_amount, |
| | | loss_amount, water_press, battery_volt, sun_volt, signal_value, water_price |
| | | loss_amount, water_press, battery_volt, signal_value, water_price |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | insert into rm_on_hour_report_history (id, controller_id, intake_id, |
| | | rtu_addr, dt, rtu_dt, |
| | | instant_amount, total_amount, loss_amount, |
| | | water_press, battery_volt, sun_volt, |
| | | water_press, battery_volt, |
| | | signal_value, water_price) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtuDt,jdbcType=TIMESTAMP}, |
| | | #{instantAmount,jdbcType=FLOAT}, #{totalAmount,jdbcType=FLOAT}, #{lossAmount,jdbcType=FLOAT}, |
| | | #{waterPress,jdbcType=FLOAT}, #{batteryVolt,jdbcType=FLOAT}, #{sunVolt,jdbcType=FLOAT}, |
| | | #{waterPress,jdbcType=FLOAT}, #{batteryVolt,jdbcType=FLOAT}, |
| | | #{signalValue,jdbcType=INTEGER}, #{waterPrice,jdbcType=FLOAT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOnHourReportHistory"> |
| | |
| | | </if> |
| | | <if test="batteryVolt != null"> |
| | | battery_volt, |
| | | </if> |
| | | <if test="sunVolt != null"> |
| | | sun_volt, |
| | | </if> |
| | | <if test="signalValue != null"> |
| | | signal_value, |
| | |
| | | </if> |
| | | <if test="batteryVolt != null"> |
| | | #{batteryVolt,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="sunVolt != null"> |
| | | #{sunVolt,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="signalValue != null"> |
| | | #{signalValue,jdbcType=INTEGER}, |
| | |
| | | <if test="batteryVolt != null"> |
| | | battery_volt = #{batteryVolt,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="sunVolt != null"> |
| | | sun_volt = #{sunVolt,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="signalValue != null"> |
| | | signal_value = #{signalValue,jdbcType=INTEGER}, |
| | | </if> |
| | |
| | | loss_amount = #{lossAmount,jdbcType=FLOAT}, |
| | | water_press = #{waterPress,jdbcType=FLOAT}, |
| | | battery_volt = #{batteryVolt,jdbcType=FLOAT}, |
| | | sun_volt = #{sunVolt,jdbcType=FLOAT}, |
| | | signal_value = #{signalValue,jdbcType=INTEGER}, |
| | | water_price = #{waterPrice,jdbcType=FLOAT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | |
| | | <result column="loss_amount" jdbcType="FLOAT" property="lossAmount" /> |
| | | <result column="water_press" jdbcType="FLOAT" property="waterPress" /> |
| | | <result column="battery_volt" jdbcType="FLOAT" property="batteryVolt" /> |
| | | <result column="sun_volt" jdbcType="FLOAT" property="sunVolt" /> |
| | | <result column="signal_value" jdbcType="INTEGER" property="signalValue" /> |
| | | <result column="water_price" jdbcType="FLOAT" property="waterPrice" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controller_id, intake_id, rtu_addr, dt, rtu_dt, instant_amount, total_amount, |
| | | loss_amount, water_press, battery_volt, sun_volt, signal_value, water_price |
| | | loss_amount, water_press, battery_volt, signal_value, water_price |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | insert into rm_on_hour_report_last (id, controller_id, intake_id, |
| | | rtu_addr, dt, rtu_dt, |
| | | instant_amount, total_amount, loss_amount, |
| | | water_press, battery_volt, sun_volt, |
| | | water_press, battery_volt, |
| | | signal_value, water_price) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtuDt,jdbcType=TIMESTAMP}, |
| | | #{instantAmount,jdbcType=FLOAT}, #{totalAmount,jdbcType=FLOAT}, #{lossAmount,jdbcType=FLOAT}, |
| | | #{waterPress,jdbcType=FLOAT}, #{batteryVolt,jdbcType=FLOAT}, #{sunVolt,jdbcType=FLOAT}, |
| | | #{waterPress,jdbcType=FLOAT}, #{batteryVolt,jdbcType=FLOAT}, |
| | | #{signalValue,jdbcType=INTEGER}, #{waterPrice,jdbcType=FLOAT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmOnHourReportLast"> |
| | |
| | | </if> |
| | | <if test="batteryVolt != null"> |
| | | battery_volt, |
| | | </if> |
| | | <if test="sunVolt != null"> |
| | | sun_volt, |
| | | </if> |
| | | <if test="signalValue != null"> |
| | | signal_value, |
| | |
| | | </if> |
| | | <if test="batteryVolt != null"> |
| | | #{batteryVolt,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="sunVolt != null"> |
| | | #{sunVolt,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="signalValue != null"> |
| | | #{signalValue,jdbcType=INTEGER}, |
| | |
| | | <if test="batteryVolt != null"> |
| | | battery_volt = #{batteryVolt,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="sunVolt != null"> |
| | | sun_volt = #{sunVolt,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="signalValue != null"> |
| | | signal_value = #{signalValue,jdbcType=INTEGER}, |
| | | </if> |
| | |
| | | loss_amount = #{lossAmount,jdbcType=FLOAT}, |
| | | water_press = #{waterPress,jdbcType=FLOAT}, |
| | | battery_volt = #{batteryVolt,jdbcType=FLOAT}, |
| | | sun_volt = #{sunVolt,jdbcType=FLOAT}, |
| | | signal_value = #{signalValue,jdbcType=INTEGER}, |
| | | water_price = #{waterPrice,jdbcType=FLOAT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | |
| | | |
| | | <!--根据农户编号获取5级行政区划代码--> |
| | | <select id="getAreaCodeByNum" resultType="java.lang.Long"> |
| | | SELECT districtNum FROM se_client WHERE clientNum = ${clientNum} |
| | | SELECT districtNum FROM se_client WHERE clientNum = ${clientNum} LIMIT 0,1 |
| | | </select> |
| | | |
| | | <!--根据农户编号获取5级行政区划串areaCode,补卡过程中开新卡使用--> |
| | |
| | | |
| | | <!--根据农户编号获取农户ID--> |
| | | <select id="getClientIdByNum" resultType="java.lang.Long"> |
| | | SELECT id FROM se_client WHERE clientNum = ${clientNum} |
| | | SELECT id FROM se_client WHERE clientNum = ${clientNum} LIMIT 0,1 |
| | | </select> |
| | | |
| | | <!--根据电话号码获取农户ID--> |
| | |
| | | package com.dy.sso.config; |
| | | |
| | | |
| | | import com.dy.common.util.NumUtil; |
| | | import com.github.benmanes.caffeine.cache.Caffeine; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.cache.CacheManager; |
| | | import org.springframework.cache.caffeine.CaffeineCacheManager; |
| | | import org.springframework.context.annotation.Bean; |
| | |
| | | |
| | | @Configuration |
| | | public class CaffeineCacheConfiguration { |
| | | private static final int cacheInitialCapacityDefault = 10 ; |
| | | private static final int cacheMaximumSizeDefault = 10000 ; |
| | | private static final int cacheDurationDefault = 720 ; |
| | | |
| | | @Value("${pipIrr.sso.cacheMaximumSize}") |
| | | private String cacheMaximumSize ; |
| | | |
| | | @Value("${pipIrr.sso.cacheDuration}") |
| | | private String cacheDuration ; |
| | | /* |
| | | initialCapacity=[integer]: 初始的缓存空间大小 |
| | | maximumSize=[long]: 缓存的最大条数 |
| | |
| | | */ |
| | | @Bean |
| | | public CacheManager cacheManager() { |
| | | int cacheMaximumSizeInt; |
| | | int cacheDurationInt; |
| | | if(NumUtil.isPlusIntNumber(cacheMaximumSize)){ |
| | | cacheMaximumSizeInt = Integer.parseInt(cacheMaximumSize) ; |
| | | }else{ |
| | | cacheMaximumSizeInt = cacheMaximumSizeDefault ; |
| | | } |
| | | if(NumUtil.isPlusIntNumber(cacheDuration)){ |
| | | cacheDurationInt = Integer.parseInt(cacheDuration) ; |
| | | }else{ |
| | | cacheDurationInt = cacheDurationDefault ; |
| | | } |
| | | CaffeineCacheManager cacheManager = new CaffeineCacheManager(); |
| | | cacheManager.setCaffeine(Caffeine.newBuilder() |
| | | .initialCapacity(10) |
| | | .maximumSize(10000) |
| | | .expireAfterAccess(30, TimeUnit.MINUTES)); |
| | | .initialCapacity(cacheInitialCapacityDefault) |
| | | .maximumSize(cacheMaximumSizeInt) |
| | | .expireAfterAccess(cacheDurationInt, TimeUnit.MINUTES)); |
| | | |
| | | return cacheManager; |
| | | } |