| | |
| | | throw new Exception("设备终端年用水量必须是0~99999999范围内的整数") ; |
| | | } |
| | | |
| | | byte[] bs = new byte[14] ; |
| | | byte[] bs = new byte[13] ; |
| | | int index = 0 ; |
| | | bs[index] = (byte)(Integer.parseInt(cvo.controllerType, 16)); |
| | | |
| | |
| | | bs[index++] = 0 ; |
| | | } |
| | | |
| | | index ++ ; |
| | | GlCreate.createPw(bs, index); |
| | | |
| | | index += 2 ; |
| | |
| | | |
| | | return bytes ; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | VoUnclosedParam getUncloseParam(@Param("onLineMap") String onLineMap, @Param("intakeId")Long intakeId); |
| | | |
| | | |
| | | /** |
| | | * 根据取水口ID获取该取水口未关阀参数,平台选择取水口关阀使用 |
| | | * @param intakeId |
| | | * @return |
| | | */ |
| | | VoUnclosedParam getUncloseParamByCd(@Param("onLineMap") String onLineMap, @Param("intakeId")Long intakeId, @Param("code")String code); |
| | | |
| | | /** |
| | | * 根据指定条件获取命令日志历史记录总数 |
| | | * @param params |
| | |
| | | LIMIT 0,1 |
| | | </select> |
| | | |
| | | <!--根据取水口ID获取该取水口未关阀参数--> |
| | | <select id="getUncloseParamByCd" resultType="com.dy.pipIrrGlobal.voRm.VoUnclosedParam"> |
| | | SELECT com.rtu_addr AS rtuAddr, |
| | | com.param ->> '$.orderNo' AS orderNo, |
| | | com.param ->> '$.icCardNo' AS vcNum |
| | | FROM rm_command_history com |
| | | INNER JOIN pr_controller con ON com.rtu_addr = con.rtuAddr |
| | | INNER JOIN pr_intake inta ON con.intakeId = inta.id |
| | | INNER JOIN JSON_TABLE( |
| | | <!-- '[{"rtuAddr":"620201000029","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',--> |
| | | #{onLineMap}, |
| | | '$[*]' COLUMNS ( |
| | | rtuAddr VARCHAR(20) PATH '$.rtuAddr', |
| | | isOnLine BOOLEAN PATH '$.isOnLine' |
| | | ) |
| | | ) rtus ON com.rtu_addr = rtus.rtuAddr |
| | | WHERE com.command_code = #{code} |
| | | AND con.intakeId = #{intakeId} |
| | | AND NOT EXISTS( |
| | | SELECT * |
| | | FROM rm_command_history |
| | | WHERE (result IS NULL OR result = 1) |
| | | AND (command_code = '93' OR command_code = 'A3' OR command_code = '98') |
| | | AND param ->> '$.orderNo' = com.param ->> '$.orderNo' |
| | | ) |
| | | ORDER BY com.send_time DESC |
| | | LIMIT 0,1 |
| | | </select> |
| | | |
| | | <!--根据指定条件获取命令日志历史记录总数--> |
| | | <select id="getCommandHistoriesCount" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS recordCount |
| | |
| | | # 甘州: 60103 |
| | | # 凉州: 60104 |
| | | # 金川: 60105 |
| | | tcp.port=60000ba_divide |
| | | tcp.port=60000 |
| | | |
| | | #RTU上行数据最小间隔,大于这个间隔认为设备离线了,测控一体阀是3,表阀一体机是6,默认采用时间最长的6 |
| | | base.upData.min.interval=6 |
| | |
| | | package com.dy.pipIrrRemote; |
| | | |
| | | import com.dy.common.multiDataSource.EnableMultiDataSource; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.CommandLineRunner; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.context.annotation.ComponentScan; |
| | |
| | | |
| | | import org.springframework.boot.web.servlet.ServletComponentScan; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | |
| | | @Slf4j |
| | | @SpringBootApplication |
| | | @EnableScheduling //启动定时任务,本模块websocket发送心跳 |
| | | @ServletComponentScan //扫描servlet,本模块中启动websocket |
| | |
| | | } |
| | | |
| | | } |
| | | //public class PipIrrRemoteApplication implements CommandLineRunner { |
| | | // |
| | | // public static void main(String[] args) { |
| | | // SpringApplication.run(PipIrrRemoteApplication.class, args); |
| | | // } |
| | | // //验证log是否输出 |
| | | // @Override |
| | | // public void run(String... args) throws Exception { |
| | | // log.trace("Trace level log"); |
| | | // log.debug("Debug level log"); |
| | | // log.info("Info level log"); |
| | | // log.warn("Warn level log"); |
| | | // log.error("Error level log"); |
| | | // } |
| | | //} |
| | |
| | | jsonArr.add(jsonObj); |
| | | return rmCommandHistoryDao.getUncloseParam(jsonArr.toJSONString(), intakeId); |
| | | } |
| | | |
| | | /** |
| | | * 根据取水口ID获取该取水口未关阀参数,平台选择取水口关阀使用 |
| | | * @param intakeId |
| | | * @param rtuAddr |
| | | * @param code |
| | | * @return |
| | | */ |
| | | public VoUnclosedParam selectUncloseParamByCd(Long intakeId, String rtuAddr, String code) { |
| | | JSONArray jsonArr = new JSONArray(); |
| | | JSONObject jsonObj = new JSONObject(); |
| | | jsonObj.put("rtuAddr", rtuAddr); |
| | | jsonObj.put("isOnLine", true); |
| | | jsonArr.add(jsonObj); |
| | | return rmCommandHistoryDao.getUncloseParamByCd(jsonArr.toJSONString(), intakeId, code); |
| | | } |
| | | } |
| | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.mw.protocol.Command; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd55Vo; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd65Vo; |
| | | import com.dy.common.util.Callback; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | |
| | | protected String dealComResult(String code, JSONObject resultData, Callback callback){ |
| | | String msg; |
| | | if(resultData != null){ |
| | | JSONArray codeData = resultData.getJSONArray("data") ; |
| | | JSONObject codeData = resultData.getJSONObject("data") ; |
| | | JSONArray codeDataArray = null ; |
| | | if(codeData == null){ |
| | | codeDataArray = resultData.getJSONArray("data") ; |
| | | } |
| | | if(codeData == null && codeDataArray == null){ |
| | | msg = RtuSuccessMsg ; |
| | | }else { |
| | | String json = codeData.toJSONString(); |
| | | String json = null ; |
| | | if(codeData != null){ |
| | | json = codeData.toJSONString() ; |
| | | }else if(codeDataArray != null){ |
| | | json = codeDataArray.toJSONString() ; |
| | | } |
| | | List<DataCd55Vo> list = JSON.parseArray(json, DataCd55Vo.class) ; |
| | | if(list != null && list.size() > 0){ |
| | | msg = "" ; |
| | | msg = "\n" ; |
| | | for(DataCd55Vo cvo : list){ |
| | | msg += cvo.toStr(false) + "\n"; |
| | | msg += cvo.toStr(false) ; |
| | | msg += "\n" ; |
| | | } |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | |
| | | } |
| | | return msg; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd5C; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.mw.protocol.Command; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd55Vo; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd5CVo; |
| | | import com.dy.common.util.Callback; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | |
| | | String msg; |
| | | if(resultData != null){ |
| | | JSONObject codeData = resultData.getJSONObject("data") ; |
| | | JSONArray codeDataArray = null ; |
| | | if(codeData == null){ |
| | | codeDataArray = resultData.getJSONArray("data") ; |
| | | } |
| | | if(codeData == null && codeDataArray == null){ |
| | | msg = RtuSuccessMsg ; |
| | | }else { |
| | | String json = codeData.toJSONString(); |
| | | String json = null ; |
| | | if(codeData != null){ |
| | | json = codeData.toJSONString() ; |
| | | }else if(codeDataArray != null){ |
| | | json = codeDataArray.toJSONString() ; |
| | | } |
| | | List<DataCd5CVo> list = JSON.parseArray(json, DataCd5CVo.class) ; |
| | | if(list != null && list.size() > 0){ |
| | | msg = "" ; |
| | | msg = "\n" ; |
| | | for(DataCd5CVo cvo : list){ |
| | | msg += cvo.toStr(false) + "\n"; |
| | | msg += cvo.toStr(false) ; |
| | | msg += "\n" ; |
| | | } |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |
| | |
| | | } |
| | | return msg; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd65; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.mw.protocol.Command; |
| | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | String msg; |
| | | if(resultData != null){ |
| | | JSONObject codeData = resultData.getJSONObject("data") ; |
| | | JSONArray codeDataArray = null ; |
| | | if(codeData == null){ |
| | | codeDataArray = resultData.getJSONArray("data") ; |
| | | } |
| | | if(codeData == null && codeDataArray == null){ |
| | | msg = RtuSuccessMsg ; |
| | | }else { |
| | | String json = codeData.toJSONString(); |
| | | String json = null ; |
| | | if(codeData != null){ |
| | | json = codeData.toJSONString() ; |
| | | }else if(codeDataArray != null){ |
| | | json = codeDataArray.toJSONString() ; |
| | | } |
| | | List<DataCd65Vo> list = JSON.parseArray(json, DataCd65Vo.class) ; |
| | | if(list != null && list.size() > 0){ |
| | | msg = "" ; |
| | | msg = "\n" ; |
| | | for(DataCd65Vo cvo : list){ |
| | | msg += cvo.toStr(false) ; |
| | | msg += "\n" ; |
| | | } |
| | | }else{ |
| | | msg = RtuSuccessMsg ; |