Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
Conflicts:
pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml
| | |
| | | * 2:刷卡关阀; |
| | | * 3:中心站开阀; |
| | | * 4:中心站关阀; |
| | | * 5:欠费关阀; |
| | | * 5:余额不足关阀; |
| | | * 6:流量计故障关阀; |
| | | * 7:紧急关闭; |
| | | * 8:用户远程开阀; |
| | |
| | | case 2 -> "刷卡关阀"; |
| | | case 3 -> "中心站开阀"; |
| | | case 4 -> "中心站关阀"; |
| | | case 5 -> "欠费关阀"; |
| | | case 5 -> "余额不足关阀"; |
| | | case 6 -> "流量计故障关阀"; |
| | | case 7 -> "紧急关阀"; |
| | | case 8 -> "用户远程开阀"; |
| | |
| | | if(cvo.icCardNo == null){ |
| | | throw new Exception("虚拟IC卡编号不能为空") ; |
| | | } |
| | | if(cvo.moneyRemain == null){ |
| | | throw new Exception("剩余金额不能为空") ; |
| | | if(cvo.moneyRemain == null || cvo.moneyRemain == 0.0){ |
| | | throw new Exception("剩余金额不能为空或为0") ; |
| | | } |
| | | if(cvo.waterPrice == null){ |
| | | throw new Exception("水价不能为空") ; |
| | | if(cvo.waterPrice == null || cvo.waterPrice == 0.0){ |
| | | throw new Exception("水价不能为空或为0") ; |
| | | } |
| | | if(cvo.minutes == null){ |
| | | throw new Exception("用水时长不能为空") ; |
| | | if(cvo.minutes == null || cvo.minutes == 0.0){ |
| | | throw new Exception("用水时长不能为空或为0") ; |
| | | } |
| | | if(cvo.minutes < 0 || cvo.minutes > 9999){ |
| | | throw new Exception("用水时长取值范围是0~9999分钟") ; |
| | |
| | | if(cvo.icCardNo == null){ |
| | | throw new Exception("虚拟IC卡编号不能为空") ; |
| | | } |
| | | if(cvo.moneyRemain == null){ |
| | | throw new Exception("剩余金额不能为空") ; |
| | | if(cvo.moneyRemain == null || cvo.moneyRemain == 0.0){ |
| | | throw new Exception("剩余金额不能为空或为0") ; |
| | | } |
| | | if(cvo.waterPrice == null){ |
| | | throw new Exception("水价不能为空") ; |
| | | if(cvo.waterPrice == null || cvo.waterPrice == 0.0){ |
| | | throw new Exception("水价不能为空或为0") ; |
| | | } |
| | | if(cvo.waterAmount == null){ |
| | | throw new Exception("预用水量不能为空") ; |
| | | if(cvo.waterAmount == null || cvo.waterAmount == 0.0){ |
| | | throw new Exception("预用水量不能为空或为0") ; |
| | | } |
| | | if(cvo.waterAmount < 0 || cvo.waterAmount > 9999){ |
| | | throw new Exception("预用水量取值范围是0~9999m3") ; |
| | |
| | | // midRs.param = icCardNoGrp[0] ; |
| | | //} |
| | | //ByteUtil.string2BCD_LE(bs, icCardNoGrp[1], index) ; |
| | | byte[] bs = new byte[16] ; |
| | | byte[] bs = new byte[8] ; |
| | | index = 0 ; |
| | | GlCreate.createIcCardNo(cvo.icCardNo, bs, 0); |
| | | bytes = ByteUtil.bytesMerge(bsHead, bs) ; |
| | |
| | | if(cvo.icCardNo == null){ |
| | | throw new Exception("虚拟IC卡编号不能为空") ; |
| | | } |
| | | if(cvo.moneyRemain == null){ |
| | | throw new Exception("剩余金额不能为空") ; |
| | | if(cvo.moneyRemain == null || cvo.moneyRemain == 0.0){ |
| | | throw new Exception("剩余金额不能为空或为0") ; |
| | | } |
| | | if(cvo.waterPrice == null){ |
| | | throw new Exception("水价不能为空") ; |
| | | if(cvo.waterPrice == null || cvo.waterPrice == 0.0){ |
| | | throw new Exception("水价不能为空或为0") ; |
| | | } |
| | | if(cvo.minutes == null){ |
| | | throw new Exception("用水时长不能为空") ; |
| | | if(cvo.minutes == null || cvo.minutes == 0.0){ |
| | | throw new Exception("用水时长不能为空或为0") ; |
| | | } |
| | | if(cvo.minutes < 0 || cvo.minutes > 9999){ |
| | | throw new Exception("用水时长取值范围是0~9999分钟") ; |
| | |
| | | if(cvo.icCardNo == null){ |
| | | throw new Exception("虚拟IC卡编号不能为空") ; |
| | | } |
| | | if(cvo.moneyRemain == null){ |
| | | throw new Exception("剩余金额不能为空") ; |
| | | if(cvo.moneyRemain == null || cvo.moneyRemain == 0.0){ |
| | | throw new Exception("剩余金额不能为空或为0") ; |
| | | } |
| | | if(cvo.waterPrice == null){ |
| | | throw new Exception("水价不能为空") ; |
| | | if(cvo.waterPrice == null || cvo.waterPrice == 0.0){ |
| | | throw new Exception("水价不能为空或为0") ; |
| | | } |
| | | if(cvo.waterAmount == null){ |
| | | throw new Exception("预用水量不能为空") ; |
| | | if(cvo.waterAmount == null || cvo.waterAmount == 0.0){ |
| | | throw new Exception("预用水量不能为空或为0") ; |
| | | } |
| | | if(cvo.waterAmount < 0 || cvo.waterAmount > 9999){ |
| | | throw new Exception("预用水量取值范围是0~9999m3") ; |
| | |
| | | // midRs.param = icCardNoGrp[0] ; |
| | | //} |
| | | //ByteUtil.string2BCD_LE(bs, icCardNoGrp[1], index) ; |
| | | byte[] bs = new byte[16] ; |
| | | byte[] bs = new byte[8] ; |
| | | index = 0 ; |
| | | GlCreate.createIcCardNo(cvo.icCardNo, bs, 0); |
| | | bytes = ByteUtil.bytesMerge(bsHead, bs) ; |
| | |
| | | List<VoIntake> getNotOnlineIntakes(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 指定时间段内用水量超过指定值的取水口数量 |
| | | * 指定时间段内累积流量超过指定值的取水口数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getUseWaterGtValueIntakesCount(Map<String, Object> params); |
| | | Long getTotalFlowGtValueIntakesCount(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 指定时间段内用水量超过指定值的取水口 |
| | | * 指定时间段内累积流量超过指定值的取水口 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoIntakeAccumulateAmount> getUseWaterGtValueIntakes(Map<String, Object> params); |
| | | List<VoIntakeAccumulateAmount> getTotalFlowGtValueIntakes(Map<String, Object> params); |
| | | } |
| | |
| | | import com.dy.pipIrrGlobal.voRm.VoOpenCloseValve; |
| | | import com.dy.pipIrrGlobal.voSt.VoClient; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntake; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeAccumulateAmount; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeOpenCount; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<VoClient> getLargeWaterDurationClients(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 指定时间段用水量超过指定值的取水口数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getUseWaterGtValueIntakesCount(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 指定时间段用水量超过指定值的取水口 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoIntakeAccumulateAmount> getUseWaterGtValueIntakes(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 指定时间段内消费金额超过指定值的取水口的数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getExpenseGtValueIntakesCount(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 指定时间段内消费金额超过指定值的取水口 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoIntakeAccumulateAmount> getExpenseGtValueIntakes(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 指定时间段内用水时长超过指定值的取水口数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getUseWaterDurationGtValueIntakesCount(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 指定时间段内用水时长超过指定值的取水口 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoIntakeOpenCount> getUseWaterDurationGtValueIntakes(Map<String, Object> params); |
| | | } |
| | |
| | | * @author :WuZeYu |
| | | * @Date :2024/8/5 10:45 |
| | | * @LastEditTime :2024/8/5 10:45 |
| | | * @Description 取水口累积流量 大于 指定值 |
| | | * @Description 取水口 累积流量 大于 指定值 视图 |
| | | * 用水量 大于 指定值 |
| | | * 消费金额 大于 指定值 |
| | | */ |
| | | @Data |
| | | public class VoIntakeAccumulateAmount extends VoIntake{ |
| | |
| | | package com.dy.pipIrrGlobal.voSt; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/8/5 10:45 |
| | | * @LastEditTime :2024/8/5 10:45 |
| | | * @Description 取水口开阀 指定值 次数 |
| | | * @Description 取水口开阀 > 指定值 (次数) |
| | | * 用水时长 > 指定值 (分钟) |
| | | */ |
| | | @Data |
| | | public class VoIntakeOpenCount extends VoIntake{ |
| | |
| | | |
| | | pipIrr: |
| | | global: |
| | | dev: true #是否开发阶段,true或false |
| | | dev: flase #是否开发阶段,true或false |
| | | dsName: ym #开发阶段,设置临时的数据库名称 |
| | | mw: |
| | | webPort: 8070 |
| | |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | <!--指定时间段内用水量超过指定值的取水口数量--> |
| | | <select id="getUseWaterGtValueIntakesCount" resultType="java.lang.Long"> |
| | | <!--指定时间段内累积流量超过指定值的取水口数量--> |
| | | <select id="getTotalFlowGtValueIntakesCount" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from |
| | |
| | | WHERE IFNULL(b.total_amount, 0)-IFNULL(a.total_amount, 0) > #{value} AND inta.deleted = 0 |
| | | ) c |
| | | </select> |
| | | <!--指定时间段内用水量超过指定值的取水口--> |
| | | <select id="getUseWaterGtValueIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAccumulateAmount"> |
| | | <!--指定时间段内累积流量超过指定值的取水口--> |
| | | <select id="getTotalFlowGtValueIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAccumulateAmount"> |
| | | SELECT |
| | | inta.id AS intakeId, |
| | | inta.NAME AS intakeNum, |
| | |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | <!--指定时间段用水量超过指定值的取水口数量--> |
| | | <select id="getUseWaterGtValueIntakesCount" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from |
| | | ( SELECT |
| | | inta.id AS intakeId, |
| | | inta.NAME AS intakeNum, |
| | | blo.NAME AS blockName , |
| | | IFNULL(SUM(rocvh.cl_this_amount),0) AS value |
| | | FROM |
| | | pr_intake inta |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | LEFT JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id |
| | | WHERE rocvh.op_dt >= #{timeStart} AND rocvh.cl_dt <= #{timeStop} AND inta.deleted = 0 |
| | | GROUP BY inta.id |
| | | HAVING IFNULL(SUM(rocvh.cl_this_amount),0) > #{value}) c |
| | | </select> |
| | | <!--指定时间段用水量超过指定值的取水口--> |
| | | <select id="getUseWaterGtValueIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAccumulateAmount"> |
| | | SELECT |
| | | inta.id AS intakeId, |
| | | inta.NAME AS intakeNum, |
| | | blo.NAME AS blockName , |
| | | IFNULL(SUM(rocvh.cl_this_amount),0) AS value |
| | | FROM |
| | | pr_intake inta |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | LEFT JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id |
| | | WHERE rocvh.op_dt >= #{timeStart} AND rocvh.cl_dt <= #{timeStop} AND inta.deleted = 0 |
| | | GROUP BY inta.id |
| | | HAVING IFNULL(SUM(rocvh.cl_this_amount),0) > #{value} |
| | | ORDER BY inta.id |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | <!--指定时间段内消费金额超过指定值的取水口的数量--> |
| | | <select id="getExpenseGtValueIntakesCount" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from |
| | | ( SELECT |
| | | inta.id AS intakeId, |
| | | inta.NAME AS intakeNum, |
| | | blo.NAME AS blockName , |
| | | IFNULL(SUM(rocvh.cl_this_money),0) AS value |
| | | FROM |
| | | pr_intake inta |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | LEFT JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id |
| | | WHERE rocvh.op_dt >= #{timeStart} AND rocvh.cl_dt <= #{timeStop} AND inta.deleted = 0 |
| | | GROUP BY inta.id |
| | | HAVING IFNULL(SUM(rocvh.cl_this_money),0) > #{value}) c |
| | | </select> |
| | | <!--指定时间段内消费金额超过指定值的取水口--> |
| | | <select id="getExpenseGtValueIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAccumulateAmount"> |
| | | SELECT |
| | | inta.id AS intakeId, |
| | | inta.NAME AS intakeNum, |
| | | blo.NAME AS blockName , |
| | | IFNULL(SUM(rocvh.cl_this_money),0) AS value |
| | | FROM |
| | | pr_intake inta |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | LEFT JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id |
| | | WHERE rocvh.op_dt >= #{timeStart} AND rocvh.cl_dt <= #{timeStop} AND inta.deleted = 0 |
| | | GROUP BY inta.id |
| | | HAVING IFNULL(SUM(rocvh.cl_this_money),0) > #{value} |
| | | ORDER BY inta.id |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | <!--指定时间段内用水时长超过指定值的取水口数量--> |
| | | <select id="getUseWaterDurationGtValueIntakesCount" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from |
| | | ( SELECT |
| | | inta.id AS intakeId, |
| | | inta.NAME AS intakeNum, |
| | | blo.NAME AS blockName , |
| | | IFNULL(SUM(rocvh.cl_this_time),0) AS recordCount |
| | | FROM |
| | | pr_intake inta |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | LEFT JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id |
| | | WHERE rocvh.op_dt >= #{timeStart} AND rocvh.cl_dt <= #{timeStop} AND inta.deleted = 0 |
| | | GROUP BY inta.id |
| | | HAVING IFNULL(SUM(rocvh.cl_this_time),0) > #{value}) c |
| | | </select> |
| | | <!--指定时间段内用水时长超过指定值的取水口--> |
| | | <select id="getUseWaterDurationGtValueIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeOpenCount"> |
| | | SELECT |
| | | inta.id AS intakeId, |
| | | inta.NAME AS intakeNum, |
| | | blo.NAME AS blockName , |
| | | IFNULL(SUM(rocvh.cl_this_time),0) AS recordCount |
| | | FROM |
| | | pr_intake inta |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | LEFT JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id |
| | | WHERE rocvh.op_dt >= #{timeStart} AND rocvh.cl_dt <= #{timeStop} AND inta.deleted = 0 |
| | | GROUP BY inta.id |
| | | HAVING IFNULL(SUM(rocvh.cl_this_time),0) > #{value} |
| | | ORDER BY inta.id |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | </mapper> |
| | |
| | | private BaseResponse cdA0(){ |
| | | ComA0Vo comVo = new ComA0Vo() ; |
| | | comVo.icCardNo = CommandP206V1_0_0Ctrl.vsIcCardNo; |
| | | comVo.moneyRemain = 234.56 ; |
| | | comVo.moneyRemain = 1.23 ; |
| | | comVo.waterPrice = 1.2 ; |
| | | comVo.waterAmount = 10 ; |
| | | return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_A0, comVo, null)) ; |
| | |
| | | private BaseResponse cdA1() throws Exception { |
| | | ComA1Vo comVo = new ComA1Vo() ; |
| | | comVo.icCardNo = CommandP206V1_0_0Ctrl.vsIcCardNo; |
| | | comVo.moneyRemain = 234.56 ; |
| | | comVo.moneyRemain = 1.23 ; |
| | | comVo.waterPrice = 1.2 ; |
| | | comVo.minutes = 3 ; |
| | | String nextDtStr = DateTime.nextXMinute_yyyy_MM_dd_HH_mm_ss(DateTime.yyyy_MM_dd_HH_mm_ss(), comVo.minutes) ;//将来X分钟 |
| | | comVo.minutes = 30 ; |
| | | String nextDtStr = DateTime.nextXMinute_yyyy_MM_dd_HH_mm_ss(DateTime.yyyy_MM_dd_HH_mm_ss(), 3) ;//将来X分钟 |
| | | int[] nextDt = DateTime.yyyy_MM_dd_HH_MM_SS_2_ymdhmsGroup(nextDtStr) ; |
| | | comVo.year = nextDt[0] ; |
| | | comVo.month = nextDt[1] ; |
| | |
| | | comVo.moneyRemain = 234.56 ; |
| | | comVo.waterPrice = 1.2 ; |
| | | comVo.waterAmount = 10 ; |
| | | String nextDtStr = DateTime.nextXMinute_yyyy_MM_dd_HH_mm_ss(DateTime.yyyy_MM_dd_HH_mm_ss(), 5) ;//将来5分钟 |
| | | String nextDtStr = DateTime.nextXMinute_yyyy_MM_dd_HH_mm_ss(DateTime.yyyy_MM_dd_HH_mm_ss(), 3) ;//将来X分钟 |
| | | int[] nextDt = DateTime.yyyy_MM_dd_HH_MM_SS_2_ymdhmsGroup(nextDtStr) ; |
| | | comVo.year = nextDt[0] ; |
| | | comVo.month = nextDt[1] ; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 指定时间段内累积流量超过指定值的取水口 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoIntakeAccumulateAmount>> getTotalFlowGtValueIntakes(IntakeAmountValueQO qo) { |
| | | String timeStart = qo.getTimeStart(); |
| | | String timeStop = qo.getTimeStop(); |
| | | if(timeStart != null && timeStart != "") { |
| | | timeStart = timeStart + " 00:00:00"; |
| | | } else { |
| | | timeStart = LocalDateTime.of(2024, 1, 1, 0, 0, 0).toString(); |
| | | } |
| | | qo.setTimeStart(timeStart); |
| | | |
| | | if(timeStop != null && timeStop != "") { |
| | | timeStop = timeStop + " 23:59:59"; |
| | | }else { |
| | | timeStop = LocalDate.now() + " 23:59:59"; |
| | | } |
| | | qo.setTimeStop(timeStop); |
| | | |
| | | if (qo.getValue() == null){ |
| | | qo.setValue(0.0); |
| | | } |
| | | |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | | Long itemTotal = rmOnHourReportHistoryMapper.getTotalFlowGtValueIntakesCount(params); |
| | | |
| | | QueryResultVo<List<VoIntakeAccumulateAmount>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmOnHourReportHistoryMapper.getTotalFlowGtValueIntakes(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 指定时间段内用水量超过指定值的取水口 |
| | | * @param qo |
| | | * @return |
| | |
| | | |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | | Long itemTotal = rmOnHourReportHistoryMapper.getUseWaterGtValueIntakesCount(params); |
| | | Long itemTotal = rmOpenCloseValveHistoryMapper.getUseWaterGtValueIntakesCount(params); |
| | | |
| | | QueryResultVo<List<VoIntakeAccumulateAmount>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmOnHourReportHistoryMapper.getUseWaterGtValueIntakes(params); |
| | | rsVo.obj = rmOpenCloseValveHistoryMapper.getUseWaterGtValueIntakes(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 指定时间段内消费金额超过指定值的取水口 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoIntakeAccumulateAmount>> getExpenseGtValueIntakes(IntakeAmountValueQO qo) { |
| | | String timeStart = qo.getTimeStart(); |
| | | String timeStop = qo.getTimeStop(); |
| | | if(timeStart != null && timeStart != "") { |
| | | timeStart = timeStart + " 00:00:00"; |
| | | } else { |
| | | timeStart = LocalDateTime.of(2024, 1, 1, 0, 0, 0).toString(); |
| | | } |
| | | qo.setTimeStart(timeStart); |
| | | |
| | | if(timeStop != null && timeStop != "") { |
| | | timeStop = timeStop + " 23:59:59"; |
| | | }else { |
| | | timeStop = LocalDate.now() + " 23:59:59"; |
| | | } |
| | | qo.setTimeStop(timeStop); |
| | | |
| | | if (qo.getValue() == null){ |
| | | qo.setValue(0.0); |
| | | } |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | | Long itemTotal = rmOpenCloseValveHistoryMapper.getExpenseGtValueIntakesCount(params); |
| | | |
| | | QueryResultVo<List<VoIntakeAccumulateAmount>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmOpenCloseValveHistoryMapper.getExpenseGtValueIntakes(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 指定时间段内用水时长超过指定值的取水口 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoIntakeOpenCount>> getUseWaterDurationGtValueIntakes(IntakeCountValueQO qo) { |
| | | String timeStart = qo.getTimeStart(); |
| | | String timeStop = qo.getTimeStop(); |
| | | if(timeStart != null && timeStart != "") { |
| | | timeStart = timeStart + " 00:00:00"; |
| | | } else { |
| | | timeStart = LocalDateTime.of(2024, 1, 1, 0, 0, 0).toString(); |
| | | } |
| | | qo.setTimeStart(timeStart); |
| | | |
| | | if(timeStop != null && timeStop != "") { |
| | | timeStop = timeStop + " 23:59:59"; |
| | | }else { |
| | | timeStop = LocalDate.now() + " 23:59:59"; |
| | | } |
| | | qo.setTimeStop(timeStop); |
| | | |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | | Long itemTotal = rmOpenCloseValveHistoryMapper.getUseWaterDurationGtValueIntakesCount(params); |
| | | |
| | | QueryResultVo<List<VoIntakeOpenCount>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmOpenCloseValveHistoryMapper.getUseWaterDurationGtValueIntakes(params); |
| | | return rsVo ; |
| | | } |
| | | } |
| | |
| | | */ |
| | | @GetMapping(path = "/getNeverOpenValveIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntake>>> getNeverOpenValveIntakes(CommonQO qo) { |
| | | public BaseResponse<QueryResultVo<List<VoIntake>>> getNeverOpenValveIntakes(@Valid CommonQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | QueryResultVo<List<VoIntake>> res = intakeSv.getNeverOpenValveIntakes(qo); |
| | | if(res.itemTotal == 0) { |
| | | return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.NO_RECORDS.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取记录异常", e); |
| | |
| | | */ |
| | | @GetMapping(path = "/getOpenValveGtIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntakeOpenCount>>> getOpenValveGtIntakes(IntakeCountValueQO qo) { |
| | | public BaseResponse<QueryResultVo<List<VoIntakeOpenCount>>> getOpenValveGtIntakes(@Valid IntakeCountValueQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | QueryResultVo<List<VoIntakeOpenCount>> res = intakeSv.getOpenValveGtIntakes(qo); |
| | | if(res.itemTotal == 0) { |
| | | return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.NO_RECORDS.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取记录异常", e); |
| | |
| | | */ |
| | | @GetMapping(path = "/getOpenValveLtIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntakeOpenCount>>> getOpenValveLtIntakes(IntakeCountValueQO qo) { |
| | | public BaseResponse<QueryResultVo<List<VoIntakeOpenCount>>> getOpenValveLtIntakes(@Valid IntakeCountValueQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | QueryResultVo<List<VoIntakeOpenCount>> res = intakeSv.getOpenValveLtIntakes(qo); |
| | | if(res.itemTotal == 0) { |
| | | return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.NO_RECORDS.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 指定时间段内累积流量(定时报里的累积流量)超过指定值的取水口 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getTotalFlowGtValueIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntakeAccumulateAmount>>> getTotalFlowGtValueIntakes(@Valid IntakeAmountValueQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | QueryResultVo<List<VoIntakeAccumulateAmount>> res = intakeSv.getTotalFlowGtValueIntakes(qo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取记录异常", e); |
| | |
| | | */ |
| | | @GetMapping(path = "/getUseWaterGtValueIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntakeAccumulateAmount>>> getUseWaterGtValueIntakes(IntakeAmountValueQO qo) { |
| | | public BaseResponse<QueryResultVo<List<VoIntakeAccumulateAmount>>> getUseWaterGtValueIntakes(@Valid IntakeAmountValueQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | QueryResultVo<List<VoIntakeAccumulateAmount>> res = intakeSv.getUseWaterGtValueIntakes(qo); |
| | | if(res.itemTotal == 0) { |
| | | return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.NO_RECORDS.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 指定时间段内消费金额超过指定值的取水口 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getExpenseGtValueIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntakeAccumulateAmount>>> getExpenseGtValueIntakes(@Valid IntakeAmountValueQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | QueryResultVo<List<VoIntakeAccumulateAmount>> res = intakeSv.getExpenseGtValueIntakes(qo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 指定时间段内用水时长超过指定值的取水口 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getUseWaterDurationGtValueIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntakeOpenCount>>> getUseWaterDurationGtValueIntakes(@Valid IntakeCountValueQO qo, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | try { |
| | | QueryResultVo<List<VoIntakeOpenCount>> res = intakeSv.getUseWaterDurationGtValueIntakes(qo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取记录异常", e); |