2024-10-19 朱宝民 优化获取未关阀记录接口,增加强制隐藏未关阀记录接口
| | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOpenCloseValveLast; |
| | | import com.dy.pipIrrGlobal.voRm.VoOpenCloseValve; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @return |
| | | */ |
| | | Integer getCountByCloseType(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 为指定(阀控器地址、水卡编号、无关阀记录)开关阀最新记录添加关阀时间,使之不在未关阀记录中显示 |
| | | * @param rtuAddr |
| | | * @param icCardNo |
| | | * @return |
| | | */ |
| | | Integer addCloseTime(@Param("rtuAddr") String rtuAddr, @Param("icCardNo")String icCardNo); |
| | | } |
| | |
| | | <where> |
| | | AND com.operator = #{operator} |
| | | AND (com.protocol = 'p206V1_0_1' AND (com.command_code = '92' OR com.command_code = '97' OR com.command_code = '99' OR com.command_code = 'A0' OR com.command_code = 'A1' OR com.command_code = 'A2')) |
| | | AND NOT EXISTS( |
| | | SELECT * FROM rm_command_history |
| | | WHERE (result IS NULL OR result = 1) |
| | | AND (com.protocol = 'p206V1_0_1' AND (command_code = '93' OR command_code = '98' OR command_code = '00')) |
| | | AND param ->> '$.orderNo' = com.param ->> '$.orderNo' |
| | | ) |
| | | AND ( |
| | | SELECT cl_dt FROM rm_open_close_valve_last |
| | | WHERE rtu_addr = com.rtu_addr AND op_ic_card_no = com.param ->> '$.icCardNo' |
| | | ORDER BY op_dt DESC |
| | | LIMIT 1 |
| | | ) IS NULL |
| | | </where> |
| | | GROUP BY inta.name, rtus.isOnLine, com.rtu_addr, com.param ->> '$.icCardNo', com.command_code, com.send_time |
| | | ORDER BY com.send_time DESC |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--为指定(阀控器地址、水卡编号、无关阀记录)开关阀最新记录添加关阀时间,使之不在未关阀记录中显示--> |
| | | <update id="addCloseTime"> |
| | | UPDATE rm_open_close_valve_last |
| | | SET cl_dt = NOW() |
| | | WHERE rtu_addr = #{rtuAddr} AND op_ic_card_no = #{icCardNo} AND cl_dt IS NULL |
| | | </update> |
| | | </mapper> |
| | |
| | | import com.dy.pipIrrGlobal.daoPr.PrIntakeVcMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmCommandHistoryMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveLastMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandHistory; |
| | |
| | | private final PrWaterPriceMapper prWaterPriceMapper; |
| | | private final PrIntakeVcMapper prIntakeVcMapper; |
| | | private final SeClientCardMapper seClientCardMapper; |
| | | private RmOpenCloseValveLastMapper rmOpenCloseValveLastMapper; |
| | | |
| | | /** |
| | | * pro_mw:属性 |
| | |
| | | private String pro_mw = "mw"; |
| | | private String key_mw = "comSendUrl"; |
| | | @Autowired |
| | | public CommandSv(RmCommandHistoryMapper rmCommandHistoryMapper, SeVirtualCardMapper seVirtualCardMapper, PrIntakeMapper prIntakeMapper, PrWaterPriceMapper prWaterPriceMapper, PrIntakeVcMapper prIntakeVcMapper, SeClientCardMapper seClientCardMapper, Environment env) { |
| | | public CommandSv(RmCommandHistoryMapper rmCommandHistoryMapper,RmOpenCloseValveLastMapper rmOpenCloseValveLastMapper, SeVirtualCardMapper seVirtualCardMapper, PrIntakeMapper prIntakeMapper, PrWaterPriceMapper prWaterPriceMapper, PrIntakeVcMapper prIntakeVcMapper, SeClientCardMapper seClientCardMapper, Environment env) { |
| | | this.rmCommandHistoryMapper = rmCommandHistoryMapper; |
| | | this.rmOpenCloseValveLastMapper = rmOpenCloseValveLastMapper; |
| | | this.seVirtualCardMapper = seVirtualCardMapper; |
| | | this.prIntakeMapper = prIntakeMapper; |
| | | this.prWaterPriceMapper = prWaterPriceMapper; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 为指定(阀控器地址、水卡编号、无关阀记录)开关阀最新记录添加关阀时间,使之不在未关阀记录中显示 |
| | | * @param rtuAddr |
| | | * @param icCardNo |
| | | * @return |
| | | */ |
| | | public Integer addClostTime(String rtuAddr, String icCardNo) { |
| | | return rmOpenCloseValveLastMapper.addCloseTime(rtuAddr, icCardNo); |
| | | } |
| | | |
| | | /** |
| | | * 修改命令日志记录,回调报错时将命令记录的执行结果改为失败 |
| | | * @param po |
| | | * @return |
| | |
| | | import com.dy.pipIrrRemote.common.CommandSv; |
| | | import com.dy.pipIrrRemote.common.dto.*; |
| | | import com.dy.pipIrrRemote.result.RemoteResultCode; |
| | | import com.dy.pipIrrRemote.valve.dto.deleteUnclosedParam; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 强制因此未关阀记录:为指定(阀控器地址、水卡编号、无关阀记录)开关阀最新记录添加关阀时间,使之不在未关阀记录中显示 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "deleteUnclosed", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> deleteUnclosed(@RequestBody @Valid deleteUnclosedParam po, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | commandSv.addClostTime(po.getRtuAddr(), po.getVcNum()); |
| | | return BaseResponseUtils.buildSuccess(); |
| | | } |
| | | |
| | | /** |
| | | * 平台远程充值 |
| | | * @param po |
| | | * @param bindingResult |
New file |
| | |
| | | package com.dy.pipIrrRemote.valve.dto; |
| | | |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-10-19 10:48 |
| | | * @LastEditTime 2024-10-19 10:48 |
| | | * @Description 删除未关阀记录传入参数 |
| | | */ |
| | | |
| | | @Data |
| | | public class deleteUnclosedParam { |
| | | public static final long serialVersionUID = 202410191049001L; |
| | | |
| | | /** |
| | | * 阀控器地址 |
| | | */ |
| | | @NotBlank(message = "阀控器地址不能为空") |
| | | private String rtuAddr; |
| | | |
| | | /** |
| | | * 虚拟卡编号 |
| | | */ |
| | | @NotBlank(message = "虚拟卡编号不能为空") |
| | | private String vcNum; |
| | | } |
| | |
| | | import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmCommandHistoryMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmIrrigateProfileMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveLastMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandHistory; |
| | |
| | | private final PrIntakeVcMapper prIntakeVcMapper; |
| | | private final SeClientCardMapper seClientCardMapper; |
| | | private final RmIrrigateProfileMapper rmIrrigateProfileMapper; |
| | | private RmOpenCloseValveLastMapper rmOpenCloseValveLastMapper; |
| | | |
| | | /** |
| | | * pro_mw:属性 |
| | |
| | | private String pro_mw = "mw"; |
| | | private String key_mw = "comSendUrl"; |
| | | @Autowired |
| | | public CommandSv(RmCommandHistoryMapper rmCommandHistoryMapper, SeVirtualCardMapper seVirtualCardMapper, PrIntakeMapper prIntakeMapper, PrWaterPriceMapper prWaterPriceMapper, PrIntakeVcMapper prIntakeVcMapper, SeClientCardMapper seClientCardMapper, RmIrrigateProfileMapper rmIrrigateProfileMapper, Environment env) { |
| | | public CommandSv(RmCommandHistoryMapper rmCommandHistoryMapper,RmOpenCloseValveLastMapper rmOpenCloseValveLastMapper, SeVirtualCardMapper seVirtualCardMapper, PrIntakeMapper prIntakeMapper, PrWaterPriceMapper prWaterPriceMapper, PrIntakeVcMapper prIntakeVcMapper, SeClientCardMapper seClientCardMapper, RmIrrigateProfileMapper rmIrrigateProfileMapper, Environment env) { |
| | | this.rmCommandHistoryMapper = rmCommandHistoryMapper; |
| | | this.rmOpenCloseValveLastMapper = rmOpenCloseValveLastMapper; |
| | | this.seVirtualCardMapper = seVirtualCardMapper; |
| | | this.prIntakeMapper = prIntakeMapper; |
| | | this.prWaterPriceMapper = prWaterPriceMapper; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 为指定(阀控器地址、水卡编号、无关阀记录)开关阀最新记录添加关阀时间,使之不在未关阀记录中显示 |
| | | * @param rtuAddr |
| | | * @param icCardNo |
| | | * @return |
| | | */ |
| | | public Integer addClostTime(String rtuAddr, String icCardNo) { |
| | | return rmOpenCloseValveLastMapper.addCloseTime(rtuAddr, icCardNo); |
| | | } |
| | | |
| | | /** |
| | | * 根据取水口ID获取与之绑定虚拟卡ID |
| | | * @param intakeId |
| | | * @return |
| | |
| | | import com.dy.pipIrrGlobal.voRm.VoIrrigaterProfile; |
| | | import com.dy.pipIrrGlobal.voRm.VoUnclosedValve; |
| | | import com.dy.pipIrrGlobal.voSe.VoVirtualCard; |
| | | import com.dy.pipIrrWechat.command.dto.AutomaticClose; |
| | | import com.dy.pipIrrWechat.command.dto.Recharge; |
| | | import com.dy.pipIrrWechat.command.dto.ValveClose; |
| | | import com.dy.pipIrrWechat.command.dto.ValveOpen; |
| | | import com.dy.pipIrrWechat.command.dto.*; |
| | | import com.dy.pipIrrWechat.result.WechatResultCode; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 强制因此未关阀记录:为指定(阀控器地址、水卡编号、无关阀记录)开关阀最新记录添加关阀时间,使之不在未关阀记录中显示 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "deleteUnclosed", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | public BaseResponse<Boolean> deleteUnclosed(@RequestBody @Valid deleteUnclosedParam po, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | commandSv.addClostTime(po.getRtuAddr(), po.getVcNum()); |
| | | return BaseResponseUtils.buildSuccess(); |
| | | } |
| | | |
| | | /** |
| | | * 小程序远程充值 |
| | | * @param po |
| | | * @param bindingResult |
New file |
| | |
| | | package com.dy.pipIrrWechat.command.dto; |
| | | |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-10-19 11:07 |
| | | * @LastEditTime 2024-10-19 11:07 |
| | | * @Description 删除未关阀记录传入参数 |
| | | */ |
| | | @Data |
| | | public class deleteUnclosedParam { |
| | | public static final long serialVersionUID = 202410191108001L; |
| | | |
| | | /** |
| | | * 阀控器地址 |
| | | */ |
| | | @NotBlank(message = "阀控器地址不能为空") |
| | | private String rtuAddr; |
| | | |
| | | /** |
| | | * 虚拟卡编号 |
| | | */ |
| | | @NotBlank(message = "虚拟卡编号不能为空") |
| | | private String vcNum; |
| | | } |