wuzeyu
2024-06-28 9357012ee7684579464a2d9b5b7c6859245ba283
Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
10个文件已修改
199 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_C0_Up.java 108 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/global/GlParse.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/upVos/DataCdC0Vo.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmOnHourReportHistory.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmOnHourReportLast.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportHistoryMapper.xml 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportLastMapper.xml 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/config/CaffeineCacheConfiguration.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_C0_Up.java
@@ -120,99 +120,39 @@
        */
        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){
            //报警数据
@@ -224,14 +164,10 @@
        }
        //水价: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) ;
    }
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/global/GlParse.java
@@ -20,11 +20,11 @@
        阀门:报警
        */
        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 ;
@@ -32,7 +32,7 @@
    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) ;
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/upVos/DataCdC0Vo.java
@@ -12,7 +12,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 ;//控制器时钟
@@ -35,9 +34,6 @@
        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);
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmOnHourReportHistory.java
@@ -96,11 +96,6 @@
    public Double batteryVolt;
    /**
     * 太阳能电压,单位为V
     */
    public Double sunVolt;
    /**
     * 信号强度,取值范围0~99
     */
    public Integer signalValue;
@@ -117,7 +112,6 @@
        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 ;//  水价,单位为元。
    }
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmOnHourReportLast.java
@@ -96,11 +96,6 @@
    public Double batteryVolt;
    /**
    * 太阳能电压,单位为V
    */
    public Double sunVolt;
    /**
    * 信号强度,取值范围0~99
    */
    public Integer signalValue;
@@ -119,7 +114,6 @@
        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 ;//  水价,单位为元。
    }
pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml
@@ -79,6 +79,8 @@
        actutorPort: 9070
        idSuffix: 0
    sso:
        cacheMaximumSize: 10000 #登录用户缓存可缓存用户的最大值
        cacheDuration: 720  #缓存登录用户发呆最大时长(分钟)
        checkUrl: http://127.0.0.1:8079/sso/sso/ssoCheck
        webPort: 8079
        actutorPort: 9079
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportHistoryMapper.xml
@@ -15,14 +15,13 @@
    <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-->
@@ -41,12 +40,12 @@
    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">
@@ -85,9 +84,6 @@
      </if>
      <if test="batteryVolt != null">
        battery_volt,
      </if>
      <if test="sunVolt != null">
        sun_volt,
      </if>
      <if test="signalValue != null">
        signal_value,
@@ -129,9 +125,6 @@
      </if>
      <if test="batteryVolt != null">
        #{batteryVolt,jdbcType=FLOAT},
      </if>
      <if test="sunVolt != null">
        #{sunVolt,jdbcType=FLOAT},
      </if>
      <if test="signalValue != null">
        #{signalValue,jdbcType=INTEGER},
@@ -175,9 +168,6 @@
      <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>
@@ -200,7 +190,6 @@
      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}
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportLastMapper.xml
@@ -15,14 +15,13 @@
    <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-->
@@ -41,12 +40,12 @@
    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">
@@ -85,9 +84,6 @@
      </if>
      <if test="batteryVolt != null">
        battery_volt,
      </if>
      <if test="sunVolt != null">
        sun_volt,
      </if>
      <if test="signalValue != null">
        signal_value,
@@ -129,9 +125,6 @@
      </if>
      <if test="batteryVolt != null">
        #{batteryVolt,jdbcType=FLOAT},
      </if>
      <if test="sunVolt != null">
        #{sunVolt,jdbcType=FLOAT},
      </if>
      <if test="signalValue != null">
        #{signalValue,jdbcType=INTEGER},
@@ -175,9 +168,6 @@
      <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>
@@ -200,7 +190,6 @@
      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}
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml
@@ -391,7 +391,7 @@
  <!--根据农户编号获取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,补卡过程中开新卡使用-->
@@ -401,7 +401,7 @@
  <!--根据农户编号获取农户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-->
pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/config/CaffeineCacheConfiguration.java
@@ -1,7 +1,9 @@
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;
@@ -10,6 +12,15 @@
@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]: 缓存的最大条数
@@ -28,11 +39,23 @@
     */
    @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;
    }