| | |
| | | package com.dy.pipIrrRemote.monitor; |
| | | |
| | | import com.dy.pipIrrGlobal.daoPr.PrIntakeMapper; |
| | | import com.dy.pipIrrGlobal.rtuMw.Web2RtuMw; |
| | | import com.dy.pipIrrGlobal.command.CommandSv; |
| | | import com.dy.pipIrrGlobal.daoPr.PrControllerMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmCommandHistoryMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandHistory; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.env.Environment; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComTransSv extends Web2RtuMw { |
| | | public class ComTransSv extends CommandSv { |
| | | |
| | | @Autowired |
| | | private PrIntakeMapper prIntakeMapper; |
| | | |
| | | private PrControllerMapper prControllerDao ; |
| | | @Autowired |
| | | private Environment env; |
| | | private RmCommandHistoryMapper rmCommandHistoryDao ; |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | public PrController getRtu(Long intakeId){ |
| | | return this.getRtu(prControllerDao, intakeId); |
| | | } |
| | | /** |
| | | * 创建命令日志对象 |
| | | * |
| | | * @param comId 主键 |
| | | * @param commandCode 功能码 |
| | | * @param rtuAddr 阀控器地址 |
| | | * @param protocol 通讯协议名称 |
| | | * @param param 参数数据 |
| | | * @param operator 操作员 |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public RmCommandHistory saveComHistoryPo(Long comId, |
| | | String protocol, |
| | | String commandCode, |
| | | String commandName, |
| | | Long intakeId, |
| | | String rtuAddr, |
| | | Object param, |
| | | Long operator) { |
| | | return this.saveComHistoryPo(rmCommandHistoryDao, comId, protocol, commandCode, commandName, intakeId, rtuAddr, param, operator) ; |
| | | } |
| | | } |