| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.Fbs9100Setparam; |
| | | import com.whyc.service.Fbs9100SetparamService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Api(tags = "作业管理-放电计划管理") |
| | | @RestController |
| | |
| | | private Response serchbyDev_id(@RequestParam int num,@RequestParam int testCmd,@RequestParam int devId){ |
| | | return service.serchbyDev_id(num,testCmd,devId); |
| | | } |
| | | |
| | | @ApiOperation("在线监测-实时监控-重启设备") |
| | | @PostMapping("updateMaintain") |
| | | private Response updateMaintain(@RequestBody Fbs9100Setparam fbs9100Setparam){ |
| | | return service.updateMaintain(fbs9100Setparam); |
| | | } |
| | | } |
| | |
| | | |
| | | //右键查看参数和弹出框的刷新按钮-----BTS停止 |
| | | Fbs9100Setparam serchbyDev_id(int devId); |
| | | //离线养护功能 |
| | | Boolean updateMaintain(Fbs9100Setparam fbs9100Setparam); |
| | | } |
| | |
| | | return new Response().setII(1,setparam,bl,bl==true?"查询成功!":"设置9100参数失败,请检查网络!"); |
| | | } |
| | | |
| | | //离线养护功能-----重启设备 |
| | | public Response updateMaintain(Fbs9100Setparam fbs9100Setparam) { |
| | | boolean bl=false; |
| | | int flag=0; |
| | | String msg=""; |
| | | if(fbs9100Setparam.getOpCmd()==FBS9100_ComBase.CMD_ResetSystem){ |
| | | bl=sendCmdToFBS9100Dev(fbs9100Setparam.getOpCmd(),0,fbs9100Setparam.getDevId().intValue()); |
| | | if(bl){ |
| | | flag=1; |
| | | msg="重启成功!"; |
| | | }else{ |
| | | flag=0; |
| | | msg="重启失败,请检查网络!"; |
| | | } |
| | | }else{ |
| | | Boolean b=mapper.updateMaintain(fbs9100Setparam); |
| | | if(b){ |
| | | bl=sendCmdToFBS9100Dev(fbs9100Setparam.getOpCmd(),0,fbs9100Setparam.getDevId().intValue()); |
| | | if(bl){ |
| | | flag=1; |
| | | msg="修改成功!"; |
| | | }else{ |
| | | flag=0; |
| | | msg="启动离线养护失败,请检查网络!"; |
| | | } |
| | | }else{ |
| | | flag=0; |
| | | msg="修改失败!"; |
| | | } |
| | | } |
| | | return new Response().set(1,flag>0?true:false,msg); |
| | | } |
| | | |
| | | //机房命令操作设备时的cmd和ack校验 test_type -->默认启动测试的类型 |
| | | public boolean sendCmdToFBS9100Dev(int cmd,int test_type,int dev_id) |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.Fbs9100SetparamMapper"> |
| | | |
| | | <select id="serchbyDev_id" resultType="com.whyc.pojo.Fbs9100Setparam"> |
| | | <update id="updateMaintain" parameterType="Fbs9100Setparam"> |
| | | replace into db_ram_db.tb_fbs9100_setparam(dev_id,MonomerTmp_High,OnLineVol_Low,OffLineYH_Cycle,OffLineYHstarttime,OffLineYHTimes,OffLineYHOnceCycle) |
| | | values(#{devId},#{monomertmpHigh},#{onlinevolLow},#{offlineyhCycle},#{OffLineYHstarttime},#{OffLineYHTimes},#{OffLineYHOnceCycle}) |
| | | </update> |
| | | |
| | | <select id="serchbyDev_id" resultType="com.whyc.pojo.Fbs9100Setparam"> |
| | | select db_battinf.tb_battinf.StationName,db_battinf.tb_battinf.FBSDeviceId,db_battinf.tb_battinf.FBSDeviceIp,db_battinf.tb_battinf.BattGroupName,db_battinf.tb_battinf.BattGroupId |
| | | ,db_battinf.tb_battinf.GroupIndexInFBSDevice,db_battinf.tb_battinf.MonCount,db_battinf.tb_battinf.MonVolStd,db_battinf.tb_battinf.MonCapStd,db_battinf.tb_battinf.load_curr |
| | | ,db_ram_db.tb_fbs9100_setparam.HourRate,db_ram_db.tb_fbs9100_setparam.DisCurr,db_ram_db.tb_fbs9100_setparam.DisCap |