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); |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoSe; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeWaterType; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/6/28 15:29 |
| | | * @LastEditTime :2024/6/28 15:29 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface SeWaterTypeMapper extends BaseMapper<SeWaterType> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(SeWaterType record); |
| | | |
| | | int insertSelective(SeWaterType record); |
| | | |
| | | SeWaterType selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(SeWaterType record); |
| | | |
| | | int updateByPrimaryKey(SeWaterType record); |
| | | } |
| | |
| | | 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 ;// 水价,单位为元。 |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoSe; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/6/28 15:29 |
| | | * @LastEditTime :2024/6/28 15:29 |
| | | * @Description |
| | | */ |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | import org.apache.logging.log4j.core.config.plugins.validation.constraints.NotBlank; |
| | | |
| | | /** |
| | | * 用水类型表 |
| | | */ |
| | | @TableName(value="se_water_type", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "用水类型实体") |
| | | public class SeWaterType implements BaseEntity { |
| | | public static final long serialVersionUID = 202406281535001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 用水类型 |
| | | */ |
| | | @Schema(description = "用水类型", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "用水类型不能为空") |
| | | private String typename; |
| | | |
| | | } |
| | |
| | | public class VoClient implements BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(title = "ID") |
| | | private Long id; |
| | | |
| | | @Schema(title = "县ID") |
| | | private String countyId; |
| | |
| | | actutorPort: 9070 |
| | | idSuffix: 0 |
| | | sso: |
| | | cacheMaximumSize: 10000 #登录用户缓存可缓存用户的最大值 |
| | | cacheDuration: 720 #缓存登录用户发呆最大时长(分钟) |
| | | checkUrl: http://127.0.0.1:8079/sso/sso/ssoCheck |
| | | webPort: 8079 |
| | | actutorPort: 9079 |
| | |
| | | <item4 item_name="controllerType" item_value="57" remarks="控制器类型"/> |
| | | <item5 item_name="protocolName" item_value="p206V202404" remarks="协议名称"/> |
| | | </settings> |
| | | <waterTypes> |
| | | <item1 typeName="灌溉用水"/> |
| | | <item2 typeName="工业用水"/> |
| | | <item3 typeName="生活用水"/> |
| | | <item4 typeName="养殖用水"/> |
| | | <item5 typeName="绿化用水"/> |
| | | </waterTypes> |
| | | </org1> |
| | | </orgs> |
| | | </config> |
| | |
| | | <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} |
| | |
| | | <!--根据指定条件获取农户数据--> |
| | | <select id="getClients" resultType="com.dy.pipIrrGlobal.voSe.VoClient"> |
| | | SELECT |
| | | (@i:=@i+1) AS id, |
| | | CAST(cli.countyId AS char) AS countyId, |
| | | dis_con.name AS countryName, |
| | | CAST(cli.townId AS char) AS townId, |
| | |
| | | LEFT JOIN ba_block blo ON cli.blockId = blo.id |
| | | LEFT JOIN pr_divide divi ON cli.divideId = divi.id |
| | | LEFT JOIN se_water_type wat ON cli.typeId = wat.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | AND cli.disabled = 0 |
| | | AND cli.deleted = 0 |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dy.pipIrrGlobal.daoSe.SeWaterTypeMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeWaterType"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table se_water_type--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="typeName" jdbcType="VARCHAR" property="typename" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, typeName |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from se_water_type |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from se_water_type |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWaterType"> |
| | | <!--@mbg.generated--> |
| | | insert into se_water_type (id, typeName) |
| | | values (#{id,jdbcType=BIGINT}, #{typename,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWaterType"> |
| | | <!--@mbg.generated--> |
| | | insert into se_water_type |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="typename != null"> |
| | | typeName, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="typename != null"> |
| | | #{typename,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWaterType"> |
| | | <!--@mbg.generated--> |
| | | update se_water_type |
| | | <set> |
| | | <if test="typename != null"> |
| | | typeName = #{typename,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWaterType"> |
| | | <!--@mbg.generated--> |
| | | update se_water_type |
| | | set typeName = #{typename,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | List<Map<String, Object>> list_towns = Optional.ofNullable(sv.getDistrictsBySupperId(countyId)).orElse(new ArrayList<>()); |
| | | if (list_towns.size() > 0) { |
| | | array_towns = JSONArray.parseArray(JSON.toJSONString(list_towns)); |
| | | job_county.put("children", array_towns); |
| | | // 遍历每一个镇,将镇下村列表加到镇的子集 |
| | | for (int j = 0; j < array_towns.size(); j++) { |
| | | JSONObject job_town = array_towns.getJSONObject(j); |
| | |
| | | //System.out.println("----" + array_towns); |
| | | } |
| | | // 镇村组装完毕,将镇村加到县下 |
| | | job_county.put("children", array_towns); |
| | | // job_county.put("children", array_towns); |
| | | } |
| | | // 县组装完毕 |
| | | //String a = array_counties.toJSONString(); |
| | |
| | | import com.dy.pipIrrGlobal.daoBa.BaSettingsMapper; |
| | | import com.dy.pipIrrGlobal.daoBa.BaUserMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SePaymentMethodMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeWaterTypeMapper; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaDistrict; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaSettings; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaUser; |
| | | import com.dy.pipIrrGlobal.pojoSe.SePaymentMethod; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeWaterType; |
| | | import com.dy.pipIrrGlobal.util.DistrictLevel; |
| | | import org.jdom2.Document; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private BaUserMapper userDao ; |
| | | private SePaymentMethodMapper paymentMethodDao ; |
| | | private BaSettingsMapper settingsDao ; |
| | | private SeWaterTypeMapper waterTypeDao ; |
| | | |
| | | @Autowired |
| | | public void setDistriDao(BaDistrictMapper distriDao){ |
| | |
| | | @Autowired |
| | | public void setSettingsDao(BaSettingsMapper settingsDao){ |
| | | this.settingsDao = settingsDao ; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setWaterTypeDao(SeWaterTypeMapper waterTypeDao){ |
| | | this.waterTypeDao = waterTypeDao ; |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | if(!this.existWaterTypes()){ |
| | | if(configXml.existElement(doc, "config.orgs.org" + num + ".waterTypes")){ |
| | | for(int i = 1 ; i < 10000; i++){ |
| | | if(configXml.existElement(doc, "config.orgs.org" + num + ".waterTypes.item" + i)){ |
| | | String typeName = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".waterTypes.item" + i,"typeName", null, false, null) ; |
| | | this.saveWaterType(orgTag, typeName); |
| | | }else{ |
| | | break ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | break ; |
| | | } |
| | |
| | | */ |
| | | private boolean existSettings(){ |
| | | Long total = this.settingsDao.selectCount(null) ; |
| | | return (total != null && total > 0) ; |
| | | } |
| | | |
| | | /** |
| | | * 数据库中是否存在用水类型数据 |
| | | * @return 存在否 |
| | | */ |
| | | private boolean existWaterTypes(){ |
| | | Long total = this.waterTypeDao.selectCount(null) ; |
| | | return (total != null && total > 0) ; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存用水类型 |
| | | * @param orgTag 机构标签 |
| | | * @param typeName 名称 |
| | | */ |
| | | private void saveWaterType(String orgTag, String typeName) throws Exception{ |
| | | if(typeName != null && !typeName.trim().equals("")){ |
| | | SeWaterType po = new SeWaterType() ; |
| | | po.setTypename(typeName); |
| | | this.waterTypeDao.insert(po) ; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | //@Mapping(target = "cardCount", source = "cardCount") |
| | | @Mapping(target = "address", source = "address") |
| | | @Mapping(target = "operateDt", source = "operatedt") |
| | | @Mapping(target = "waterTypeId", source = "typeid") |
| | | VoClient po2vo(SeClient po); |
| | | } |
| | |
| | | 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; |
| | | } |