2024-07-03 朱宝民 获取充值记录兼容10位水卡编号
| | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandHistory; |
| | | import com.dy.pipIrrGlobal.voRm.VoUnclosedParam; |
| | | import com.dy.pipIrrGlobal.voRm.VoUnclosedValve; |
| | | import com.dy.pipIrrGlobal.voRm.VoCommand; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | * @return |
| | | */ |
| | | VoUnclosedParam getUncloseParam(@Param("onLineMap") String onLineMap, @Param("intakeId")Long intakeId); |
| | | |
| | | //获取命令历史记录 |
| | | List<VoCommand> getCommandHistories(Map<?, ?> params); |
| | | } |
File was renamed from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCommand.java |
| | |
| | | package com.dy.pipIrrGlobal.voSe; |
| | | package com.dy.pipIrrGlobal.voRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | |
| | | @Schema(title = "农户编号") |
| | | private String clientNum; |
| | | |
| | | /** |
| | | * 水卡余额 |
| | | */ |
| | | private Float money; |
| | | |
| | | @Schema(title = "水卡编号") |
| | |
| | | LIMIT 0,1 |
| | | </select> |
| | | |
| | | <select id="getCommandHistories" resultType="com.dy.pipIrrGlobal.voRm.VoCommand"> |
| | | |
| | | SELECT |
| | | his.id, |
| | | his.command_name AS commandName, |
| | | inta.name AS intakeName, |
| | | his.rtu_addr AS rtuAddr, |
| | | his.protocol, |
| | | his.send_time AS sendTime, |
| | | his.result_time AS resultTime, |
| | | (CASE |
| | | WHEN his.result = 1 THEN "成功" |
| | | ELSE "失败" |
| | | END) AS result, |
| | | his.result_text, |
| | | IFNULL(cli.name, user.name) AS userName |
| | | FROM rm_command_history his |
| | | INNER JOIN pr_intake inta ON inta.id = his.intake_id |
| | | LEFT JOIN se_client cli ON cli.id = his.operator |
| | | LEFT JOIN ba_user user ON user.id = his.operator |
| | | WHERE his.command_name LIKE '%关阀%' AND his.result =1 AND his.send_time BETWEEN '2024-06-01 00:00:00' AND '2024-07-31 23:59:59' |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | @GetMapping(path = "/getRecharges") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoRecharge>>> get(QoRecharge vo){ |
| | | // 如果传入的是10位的水卡编号,升为17位水卡编号 |
| | | if(vo != null && vo.getCardNum() != null) { |
| | | String cardNumS = String.valueOf(vo.getCardNum()).trim(); |
| | | if(cardNumS.length() == 10) { |
| | | cardNumS = "100000" + cardNumS.substring(0,6) + "0" + cardNumS.substring(6); |
| | | vo.setCardNum(Long.parseLong(cardNumS)); |
| | | } |
| | | } |
| | | |
| | | try { |
| | | QueryResultVo<List<VoRecharge>> res = cardOperateSv.getRecharges(vo); |
| | | //if(res.itemTotal == 0) { |
| | | // return BaseResponseUtils.buildFail(SellResultCode.No_RECHARGES.getMessage()); |
| | | //} |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取充值记录异常", e); |