1、完善水肥、墒情、气象相关Mapper代码;
2、解决表阀一体机远程关阀出现的订单号不一致专制不能关阀问题(王江海测试发现)。
| | |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandHistory; |
| | | import com.dy.pipIrrGlobal.rtuMw.Web2RtuMw; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | |
| | |
| | | * @param operator |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public RmCommandHistory saveComHistoryPo(RmCommandHistoryMapper rmCommandHistoryDao, |
| | | Long comId, |
| | | String protocol, |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmManureHistory; |
| | | import com.dy.pipIrrGlobal.voRm.VoManure; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @Date: 2025/6/25 10:03 |
| | | * @Description |
| | | */ |
| | | public interface RmManureHistoryMapper { |
| | | @Mapper |
| | | public interface RmManureHistoryMapper extends BaseMapper<RmManureHistory> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(RmManureHistory record); |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmManureLast; |
| | | import com.dy.pipIrrGlobal.voRm.VoManure; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * @Date: 2025/6/25 10:03 |
| | | * @Description |
| | | */ |
| | | public interface RmManureLastMapper { |
| | | @Mapper |
| | | public interface RmManureLastMapper extends BaseMapper<RmManureLast> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(RmManureLast record); |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmManureLast; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmSoilDay; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmSoilLast; |
| | | import com.dy.pipIrrGlobal.voRm.VoSoil; |
| | | import com.dy.pipIrrGlobal.voRm.VoSoilDay; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * @Date: 2025/6/25 10:04 |
| | | * @Description |
| | | */ |
| | | public interface RmSoilDayMapper { |
| | | @Mapper |
| | | public interface RmSoilDayMapper extends BaseMapper<RmSoilDay> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(RmSoilDay record); |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmSoilDay; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmSoilHistory; |
| | | import com.dy.pipIrrGlobal.voRm.VoSoil; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @Date: 2025/6/25 10:04 |
| | | * @Description |
| | | */ |
| | | public interface RmSoilHistoryMapper { |
| | | @Mapper |
| | | public interface RmSoilHistoryMapper extends BaseMapper<RmSoilHistory> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(RmSoilHistory record); |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmSoilHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmSoilLast; |
| | | import com.dy.pipIrrGlobal.voRm.VoSoil; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * @Date: 2025/6/25 10:04 |
| | | * @Description |
| | | */ |
| | | public interface RmSoilLastMapper { |
| | | @Mapper |
| | | public interface RmSoilLastMapper extends BaseMapper<RmSoilLast> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(RmSoilLast record); |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmSoilLast; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmWeatherHistory; |
| | | import com.dy.pipIrrGlobal.voRm.VoWeather; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @Date: 2025/6/25 10:39 |
| | | * @Description |
| | | */ |
| | | public interface RmWeatherHistoryMapper { |
| | | @Mapper |
| | | public interface RmWeatherHistoryMapper extends BaseMapper<RmWeatherHistory> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(RmWeatherHistory record); |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmWeatherHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmWeatherLast; |
| | | import com.dy.pipIrrGlobal.voRm.VoWeather; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * @Date: 2025/6/25 10:39 |
| | | * @Description |
| | | */ |
| | | public interface RmWeatherLastMapper { |
| | | @Mapper |
| | | public interface RmWeatherLastMapper extends BaseMapper<RmWeatherLast> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(RmWeatherLast record); |
| | |
| | | # 测试: mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos= |
| | | # 梅江: mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos= |
| | | # 121服务器: |
| | | # 民勤: mqtt.enable=true mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather/1,1;soil/1,1;manure/1,1;state/1,1 |
| | | # 民勤: mqtt.enable=true mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather/1,1;soil/1,1;manure/1,1 |
| | | # 延庆: mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos= |
| | | # 黑龙江: mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos= |
| | | # 甘州: mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos= |
| | | # 凉州: mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos= |
| | | # 金川: mqtt.enable=true mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather/1,1;soil/1,1;manure/1,1;state/1,1 |
| | | # 嘉峪关: mqtt.enable=true mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather/1,1;soil/1,1;manure/1,1;state/1,1 |
| | | # 金川: mqtt.enable=true mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather/1,1;soil/1,1;manure/1,1 |
| | | # 嘉峪关: mqtt.enable=true mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather/1,1;soil/1,1;manure/1,1 |
| | | mqtt.enable=false |
| | | mqtt.ip=127.0.0.1 |
| | | mqtt.port=1883 |
| | |
| | | * @param intakeId |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public PrCommonIntakes addOrUpdateOftenUseIntake(Long operatorId, Long intakeId) { |
| | | PrCommonIntakes po = prCommonIntakesDao.selectByOperatorAndIntake(operatorId, intakeId); |
| | | if(po == null) { |
| | |
| | | import com.dy.common.util.Callback; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen; |
| | | import com.dy.pipIrrGlobal.voSe.VoVirtualCard; |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import com.dy.pipIrrRemote.monitor.common.ComCtrl; |
| | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | if(waterPrice == null){ |
| | | return BaseResponseUtils.buildErrorMsg("服务端出错,未得到水价") ; |
| | | } |
| | | String orderNo = RandomStringUtils.randomNumeric(16) ; |
| | | CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType) |
| | | .icCardNo("" + vcPo.getVcNum())//用户卡序列号(17位数字)(6字节BCD,2字节HEX) |
| | | .waterRemain(0.0)//用户剩余水量, 两个小数点, 单位m3, 0~99999999.99 |
| | | .moneyRemain(vcPo.getMoney())//用户剩余水量, 两个小数点, 单位m3, 0~99999999.99 |
| | | .waterPrice(waterPrice)//水量单价 单位:元, 2个小数点 |
| | | .elePrice(0.0)//电量单价 单位:元, 2个小数点 |
| | | .orderNo(RandomStringUtils.randomNumeric(16))//订单号(16位数字) |
| | | .orderNo(orderNo)//订单号(16位数字) |
| | | .build(); |
| | | //发送命令前-3:保存命令日志 |
| | | res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam); |
| | |
| | | sv.addOrUpdateOftenUseIntake(dto.getOperator(), dto.getIntakeId()) ; |
| | | //开阀成功,虚拟卡记录上标记已被占用 |
| | | sv.setVcUsed(vcPo.getId(), dto.getIntakeId()); |
| | | //记录开阀命令,以备远程关阀 |
| | | RmCommandOpen comOpen = sv.getCommandOpen(dto.getIntakeId()); |
| | | if(comOpen == null){ |
| | | RmCommandOpen po = newRmCommandOpen(comId, ctrlPo.getProtocol(), ComCode, comName, dto.getIntakeId(), ctrlPo.getRtuAddr(), vcPo.getVcNum(), orderNo, dto.getOperator()) ; |
| | | sv.saveCommandOpen(po); |
| | | }else{ |
| | | setRmCommandOpen(comOpen, comId, ctrlPo.getProtocol(), ComCode, comName, dto.getIntakeId(), ctrlPo.getRtuAddr(), vcPo.getVcNum(), orderNo, dto.getOperator()) ; |
| | | sv.updateCommandOpen(comOpen); |
| | | } |
| | | } |
| | | } |
| | | @Override |
| | |
| | | } |
| | | return msg; |
| | | } |
| | | |
| | | private RmCommandOpen newRmCommandOpen(Long comId, |
| | | String protocol, |
| | | String comCode, |
| | | String comName, |
| | | Long intakeId, |
| | | String rtuAddr, |
| | | Long vcNum, |
| | | String orderNo, |
| | | Long operator){ |
| | | RmCommandOpen po = new RmCommandOpen() ; |
| | | this.setRmCommandOpen(po, comId, protocol, comCode, comName, intakeId, rtuAddr, vcNum, orderNo, operator); |
| | | return po ; |
| | | } |
| | | private void setRmCommandOpen(RmCommandOpen po, |
| | | Long comId, |
| | | String protocol, |
| | | String comCode, |
| | | String comName, |
| | | Long intakeId, |
| | | String rtuAddr, |
| | | Long vcNum, |
| | | String orderNo, |
| | | Long operator){ |
| | | po.comId = comId ; |
| | | po.protocol = protocol ; |
| | | po.commandCode = comCode ; |
| | | po.commandName = comName ; |
| | | po.intakeId = intakeId ; |
| | | po.rtuAddr = rtuAddr ; |
| | | po.vcNum = vcNum ; |
| | | po.orderNo = orderNo ; |
| | | po.operator = operator ; |
| | | po.sendTime = new Date() ; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.dy.pipIrrGlobal.daoPr.PrIntakeVcMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmCommandOpenMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoVirtualCard; |
| | | import com.dy.pipIrrRemote.monitor.common.ComSv; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | protected PrWaterPriceMapper prWaterPriceDao ; |
| | | @Autowired |
| | | protected PrIntakeVcMapper prIntakeVcDao ; |
| | | @Autowired |
| | | protected RmCommandOpenMapper rmCommandOpenDao ; |
| | | |
| | | public VoVirtualCard selectClientVtCardById(Long id){ |
| | | return seVirtualCardDao.getVcById(id) ; |
| | |
| | | /** |
| | | * 设置虚拟卡被占用 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void setVcUsed(Long id, Long intakeId){ |
| | | SeVirtualCard po = new SeVirtualCard() ; |
| | | po.setId(id); |
| | |
| | | po.setOpenTime(new Date()); |
| | | seVirtualCardDao.updateByPrimaryKeySelective(po); |
| | | } |
| | | |
| | | public RmCommandOpen getCommandOpen(Long intakeId){ |
| | | List<RmCommandOpen> list = rmCommandOpenDao.selectByIntakeId(intakeId) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveCommandOpen(RmCommandOpen po){ |
| | | rmCommandOpenDao.insert(po) ; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateCommandOpen(RmCommandOpen po){ |
| | | rmCommandOpenDao.updateByPrimaryKeySelective(po) ; |
| | | } |
| | | } |
| | |
| | | import com.dy.common.util.Callback; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrGlobal.voRm.VoUnclosedParam; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen; |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import com.dy.pipIrrRemote.monitor.common.ComCtrl; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | res = super.pre2(sv, ComCode, dto, bindingResult); |
| | | if (res == null) { |
| | | //获取开阀命令参数 |
| | | /* |
| | | 2025-06-27原来的实现,原来没有设计RmCommandOpen对象及其对应的数据库表 |
| | | VoUnclosedParam opPa = sv.selectUncloseParam(dto.getIntakeId(), ctrlPo.getRtuAddr()); |
| | | if(opPa == null) { |
| | | return BaseResponseUtils.buildFail("该取水口上无您最近的开阀操作"); |
| | |
| | | .icCardNo(opPa.getVcNum())//用户卡序列号(17位数字)(6字节BCD,2字节HEX) |
| | | .orderNo(opPa.getOrderNo())//订单号(16位数字) |
| | | .build(); |
| | | */ |
| | | RmCommandOpen comOpen = sv.getCommandOpen(dto.getIntakeId()) ; |
| | | if(comOpen == null) { |
| | | return BaseResponseUtils.buildFail("该取水口上无您最近的开阀操作"); |
| | | } |
| | | Long vcId = sv.getVcIdByNum("" + comOpen.vcNum) ; |
| | | if(vcId == null) { |
| | | return BaseResponseUtils.buildFail("服务端出错,未得到虚拟卡ID"); |
| | | } |
| | | //发送命令前-3:保存命令日志 |
| | | CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType) |
| | | .icCardNo("" + comOpen.vcNum)//用户卡序列号(17位数字)(6字节BCD,2字节HEX) |
| | | .orderNo(comOpen.orderNo)//订单号(16位数字) |
| | | .build(); |
| | | res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam); |
| | | if (res == null) { |
| | | //发送命令前-4:准备Feature |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd93; |
| | | |
| | | import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmCommandOpenMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoVirtualCard; |
| | | import com.dy.pipIrrRemote.monitor.common.ComSv; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | |
| | | @Autowired |
| | | protected SeVirtualCardMapper seVirtualCardDao ; |
| | | |
| | | @Autowired |
| | | protected PrWaterPriceMapper prWaterPriceDao ; |
| | | |
| | | @Autowired |
| | | protected RmCommandOpenMapper rmCommandOpenDao ; |
| | | /** |
| | | * 解除虚拟卡被占用 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void setVcNoUsed(Long id){ |
| | | SeVirtualCard po = new SeVirtualCard() ; |
| | | po.setId(id); |
| | |
| | | public Long getVcIdByNum(String vcNum){ |
| | | return seVirtualCardDao.getVcIdByNum(vcNum) ; |
| | | } |
| | | |
| | | |
| | | public RmCommandOpen getCommandOpen(Long intakeId){ |
| | | List<RmCommandOpen> list = rmCommandOpenDao.selectByIntakeId(intakeId) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | } |
| | |
| | | import com.dy.common.util.Callback; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen; |
| | | import com.dy.pipIrrGlobal.voSe.VoVirtualCard; |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import com.dy.pipIrrRemote.monitor.common.ComCtrl; |
| | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | if(waterPrice == null){ |
| | | return BaseResponseUtils.buildErrorMsg("服务端出错,未得到水价") ; |
| | | } |
| | | String orderNo = RandomStringUtils.randomNumeric(16) ; |
| | | CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType) |
| | | .icCardNo("" + vcPo.getVcNum())//用户卡序列号(17位数字)(6字节BCD,2字节HEX) |
| | | .waterRemain(0.0)//用户剩余水量, 两个小数点, 单位m3, 0~99999999.99 |
| | | .moneyRemain(vcPo.getMoney())//用户剩余水量, 两个小数点, 单位m3, 0~99999999.99 |
| | | .waterPrice(waterPrice)//水量单价 单位:元, 2个小数点 |
| | | .elePrice(0.0)//电量单价 单位:元, 2个小数点 |
| | | .orderNo(RandomStringUtils.randomNumeric(16))//订单号(16位数字) |
| | | .orderNo(orderNo)//订单号(16位数字) |
| | | .build(); |
| | | //发送命令前-3:保存命令日志 |
| | | res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam); |
| | |
| | | sv.addOrUpdateOftenUseIntake(dto.getOperator(), dto.getIntakeId()) ; |
| | | //开阀成功,虚拟卡记录上标记已被占用 |
| | | sv.setVcUsed(vcPo.getId(), dto.getIntakeId()); |
| | | //记录开阀命令,以备远程关阀 |
| | | RmCommandOpen comOpen = sv.getCommandOpen(dto.getIntakeId()); |
| | | if(comOpen == null){ |
| | | RmCommandOpen po = newRmCommandOpen(comId, ctrlPo.getProtocol(), ComCode, comName, dto.getIntakeId(), ctrlPo.getRtuAddr(), vcPo.getVcNum(), orderNo, dto.getOperator()) ; |
| | | sv.saveCommandOpen(po); |
| | | }else{ |
| | | setRmCommandOpen(comOpen, comId, ctrlPo.getProtocol(), ComCode, comName, dto.getIntakeId(), ctrlPo.getRtuAddr(), vcPo.getVcNum(), orderNo, dto.getOperator()) ; |
| | | sv.updateCommandOpen(comOpen); |
| | | } |
| | | } |
| | | } |
| | | @Override |
| | |
| | | } |
| | | return msg; |
| | | } |
| | | |
| | | private RmCommandOpen newRmCommandOpen(Long comId, |
| | | String protocol, |
| | | String comCode, |
| | | String comName, |
| | | Long intakeId, |
| | | String rtuAddr, |
| | | Long vcNum, |
| | | String orderNo, |
| | | Long operator){ |
| | | RmCommandOpen po = new RmCommandOpen() ; |
| | | this.setRmCommandOpen(po, comId, protocol, comCode, comName, intakeId, rtuAddr, vcNum, orderNo, operator); |
| | | return po ; |
| | | } |
| | | private void setRmCommandOpen(RmCommandOpen po, |
| | | Long comId, |
| | | String protocol, |
| | | String comCode, |
| | | String comName, |
| | | Long intakeId, |
| | | String rtuAddr, |
| | | Long vcNum, |
| | | String orderNo, |
| | | Long operator){ |
| | | po.comId = comId ; |
| | | po.protocol = protocol ; |
| | | po.commandCode = comCode ; |
| | | po.commandName = comName ; |
| | | po.intakeId = intakeId ; |
| | | po.rtuAddr = rtuAddr ; |
| | | po.vcNum = vcNum ; |
| | | po.orderNo = orderNo ; |
| | | po.operator = operator ; |
| | | po.sendTime = new Date() ; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.dy.pipIrrGlobal.daoPr.PrIntakeVcMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmCommandOpenMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoVirtualCard; |
| | | import com.dy.pipIrrRemote.monitor.common.ComSv; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | protected PrWaterPriceMapper prWaterPriceDao ; |
| | | @Autowired |
| | | protected PrIntakeVcMapper prIntakeVcDao ; |
| | | @Autowired |
| | | protected RmCommandOpenMapper rmCommandOpenDao ; |
| | | |
| | | public VoVirtualCard selectClientVtCardById(Long id){ |
| | | return seVirtualCardDao.getVcById(id) ; |
| | |
| | | po.setOpenTime(new Date()); |
| | | seVirtualCardDao.updateByPrimaryKeySelective(po); |
| | | } |
| | | |
| | | public RmCommandOpen getCommandOpen(Long intakeId){ |
| | | List<RmCommandOpen> list = rmCommandOpenDao.selectByIntakeId(intakeId) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveCommandOpen(RmCommandOpen po){ |
| | | rmCommandOpenDao.insert(po) ; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateCommandOpen(RmCommandOpen po){ |
| | | rmCommandOpenDao.updateByPrimaryKeySelective(po) ; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.dy.common.util.Callback; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen; |
| | | import com.dy.pipIrrGlobal.voRm.VoUnclosedParam; |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import com.dy.pipIrrRemote.monitor.common.ComCtrl; |
| | | import com.dy.pipIrrRemote.monitor.p202404V201.cd93.CdParam; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | res = super.pre2(sv, ComCode, dto, bindingResult); |
| | | if (res == null) { |
| | | //获取开阀命令参数 |
| | | /* |
| | | 2025-06-27原来的实现,原来没有设计RmCommandOpen对象及其对应的数据库表 |
| | | VoUnclosedParam opPa = sv.selectUncloseParam(dto.getIntakeId(), ctrlPo.getRtuAddr()); |
| | | if(opPa == null) { |
| | | return BaseResponseUtils.buildFail("该取水口上无您最近的开阀操作"); |
| | |
| | | .icCardNo(opPa.getVcNum())//用户卡序列号(17位数字)(6字节BCD,2字节HEX) |
| | | .orderNo(opPa.getOrderNo())//订单号(16位数字) |
| | | .build(); |
| | | */ |
| | | RmCommandOpen comOpen = sv.getCommandOpen(dto.getIntakeId()) ; |
| | | if(comOpen == null) { |
| | | return BaseResponseUtils.buildFail("该取水口上无您最近的开阀操作"); |
| | | } |
| | | Long vcId = sv.getVcIdByNum("" + comOpen.vcNum) ; |
| | | if(vcId == null) { |
| | | return BaseResponseUtils.buildFail("服务端出错,未得到虚拟卡ID"); |
| | | } |
| | | //发送命令前-3:保存命令日志 |
| | | com.dy.pipIrrRemote.monitor.p202404V201.cd93.CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType) |
| | | .icCardNo("" + comOpen.vcNum)//用户卡序列号(17位数字)(6字节BCD,2字节HEX) |
| | | .orderNo(comOpen.orderNo)//订单号(16位数字) |
| | | .build(); |
| | | res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam); |
| | | if (res == null) { |
| | | //发送命令前-4:准备Feature |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cdA3; |
| | | |
| | | import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmCommandOpenMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoVirtualCard; |
| | | import com.dy.pipIrrRemote.monitor.common.ComSv; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | |
| | | @Autowired |
| | | protected SeVirtualCardMapper seVirtualCardDao ; |
| | | |
| | | @Autowired |
| | | protected PrWaterPriceMapper prWaterPriceDao ; |
| | | |
| | | @Autowired |
| | | protected RmCommandOpenMapper rmCommandOpenDao ; |
| | | /** |
| | | * 解除虚拟卡被占用 |
| | | */ |
| | |
| | | public Long getVcIdByNum(String vcNum){ |
| | | return seVirtualCardDao.getVcIdByNum(vcNum) ; |
| | | } |
| | | |
| | | |
| | | public RmCommandOpen getCommandOpen(Long intakeId){ |
| | | List<RmCommandOpen> list = rmCommandOpenDao.selectByIntakeId(intakeId) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | | return null ; |
| | | } |
| | | } |