| | |
| | | |
| | | @ApiOperation(value = "根据设备id查询系统参数") |
| | | @GetMapping("serchByCondition") |
| | | public Response serchByCondition(@RequestParam int devId){ |
| | | public Response serchByCondition(@RequestParam int devId) { |
| | | return service.serchByCondition(devId); |
| | | } |
| | | |
| | | @ApiOperation(value = "均衡控制参数设置-获取参数") |
| | | @GetMapping("searchJunHengParam") |
| | | public Response searchJunHengParam(@RequestParam int devId){ |
| | | public Response searchJunHengParam(@RequestParam int devId) { |
| | | return service.searchJunHengParam(devId); |
| | | } |
| | | @ApiOperation(value = "均衡控制参数设置-设置参数",notes="JunHeng_Enabled,JunHeng_StVol,JunHeng_StCurr,dev_id,opCmd") |
| | | |
| | | @ApiOperation(value = "均衡控制参数设置-设置参数", notes = "JunHeng_Enabled,JunHeng_StVol,JunHeng_StCurr,dev_id,opCmd") |
| | | @PostMapping("update61850JunHeng") |
| | | public Response update61850JunHeng(@RequestBody Fbs9100Sysparam fbs9100Sysparam){ |
| | | public Response update61850JunHeng(@RequestBody Fbs9100Sysparam fbs9100Sysparam) { |
| | | return service.update61850JunHeng(fbs9100Sysparam); |
| | | } |
| | | |
| | | @ApiOperation(value = "并联设备-获取参数") |
| | | @GetMapping("searchBL") |
| | | public Response searchBL(@RequestParam int devId) { |
| | | return service.searchBL(devId); |
| | | } |
| | | |
| | | @ApiOperation(value = "并联设备-设置参数", notes = "floatChargeVolt,disChargeVolt,dischargeVoltLimit,monomerLowVolt,monomerLowCount,autoEQChargeStartimeTime,autoEQChargetTime,opCmd") |
| | | @PostMapping("updateBL") |
| | | public Response updateBL(@RequestBody Fbs9100Sysparam fbs9100Sysparam) { |
| | | return service.updateBL(fbs9100Sysparam); |
| | | } |
| | | } |
| | |
| | | final public static int CMD_61850_START_RES=1; //核容测试停止内阻测试启动 |
| | | final public static int CMD_61850_STOP=0; //核容测试内阻测试均停止 |
| | | final public static int CMD_61850_START_ACK=100; //核容测试或内阻测试启动成功 |
| | | final public static int CMD_61850_STOP_ACK=101; //核容测试或内阻测试均停止成功 |
| | | final public static int CMD_61850_CHANGE=99; //核容测试或内阻测试均停止成功 |
| | | |
| | | final public static int CMD_61850_STOP_ACK = 101; //核容测试或内阻测试均停止成功 |
| | | final public static int CMD_61850_CHANGE = 99; //核容测试或内阻测试均停止成功 |
| | | |
| | | //FBS9600S设备内阻测试的启动命令 |
| | | final public static int CMD_9600_Start=1; |
| | | |
| | | |
| | | final public static int CMD_9600_Start = 1; |
| | | |
| | | |
| | | //6185设备工作状态对应关系workstate |
| | | final public static int DEV_ONLINE_CHARGE=0; //在线浮充 |
| | | final public static int DEV_PRE_CHARGE=1; //预充电 |
| | | final public static int DEV_NUCLEAR_CAP=2; //核容测试 |
| | | final public static int DEV_POWER_CUT=3; //停电测试 |
| | | final public static int DEV_RES_TEST=4; //内阻测试 |
| | | final public static int DEV_KD_TEST=5; //kd测试 |
| | | final public static int DEV_ONLINE_CHARGE = 0; //在线浮充 |
| | | final public static int DEV_PRE_CHARGE = 1; //预充电 |
| | | final public static int DEV_NUCLEAR_CAP = 2; //核容测试 |
| | | final public static int DEV_POWER_CUT = 3; //停电测试 |
| | | final public static int DEV_RES_TEST = 4; //内阻测试 |
| | | final public static int DEV_KD_TEST = 5; //kd测试 |
| | | |
| | | //-----------------------------61850均衡参数 |
| | | public static final int CMD_GetJunHengParam = 0xC1; //读取均衡参数 |
| | | public static final int CMD_GetJunHengParamAck = 0xC2; //读取均衡参数成功 |
| | | public static final int CMD_SetJunHengParam = 0xC3; //设置均衡参数 |
| | | public static final int CMD_SetJunHengParamAck = 0xC4; //设置均衡参数成功 |
| | | public static final int CMD_GetJunHengParam = 0xC1; //读取均衡参数 |
| | | public static final int CMD_GetJunHengParamAck = 0xC2; //读取均衡参数成功 |
| | | public static final int CMD_SetJunHengParam = 0xC3; //设置均衡参数 |
| | | public static final int CMD_SetJunHengParamAck = 0xC4; //设置均衡参数成功 |
| | | |
| | | /**电源一体机 充电/放电/活化测试命令/文件命令*/ |
| | | //-----------------------------并联设备参数 |
| | | public static final int CMD_GetBLParam = 0xC5; //读取参数 |
| | | public static final int CMD_GetBLParamAck = 0xC6; //读取参数成功 |
| | | public static final int CMD_SetBLParam = 0xC7; //设置参数 |
| | | public static final int CMD_SetBLParamAck = 0xC8; //设置参数成功 |
| | | |
| | | /** |
| | | * 电源一体机 充电/放电/活化测试命令/文件命令 |
| | | */ |
| | | //-----------------------------启动/停止放电测试命令 |
| | | public static final int CMD_StartDischarge = 0x25; //启动放电 |
| | | public static final int CMD_StartDischargeAck = 0x26; //启动放电成功 |
| | | public static final int CMD_StopDischarge = 0x23; //停止放电 |
| | | public static final int CMD_StopDischargeAck = 0x24; //停止放电成功 |
| | | public static final int CMD_PauseDischarge = 0x21; //暂停放电 |
| | | public static final int CMD_PauseDischargeAck = 0x22; //暂停放电成功 |
| | | public static final int CMD_StartDischarge = 0x25; //启动放电 |
| | | public static final int CMD_StartDischargeAck = 0x26; //启动放电成功 |
| | | public static final int CMD_StopDischarge = 0x23; //停止放电 |
| | | public static final int CMD_StopDischargeAck = 0x24; //停止放电成功 |
| | | public static final int CMD_PauseDischarge = 0x21; //暂停放电 |
| | | public static final int CMD_PauseDischargeAck = 0x22; //暂停放电成功 |
| | | //-----------------------------启动/停止充电测试命令 |
| | | public static final int CMD_StartCharTest = 0xB1; //启动充电 |
| | | public static final int CMD_StartCharTestAck = 0xB2; //启动充电成功 |
| | | public static final int CMD_StopCharTest = 0xB3; //停止充电 |
| | | public static final int CMD_StopCharTestAck = 0xB4; //停止充电成功 |
| | | public static final int CMD_PauseCharTest = 0xB5; //暂停充电 |
| | | public static final int CMD_PauseCharTestAck = 0xB6; //暂停充电成功 |
| | | public static final int CMD_StartCharTest = 0xB1; //启动充电 |
| | | public static final int CMD_StartCharTestAck = 0xB2; //启动充电成功 |
| | | public static final int CMD_StopCharTest = 0xB3; //停止充电 |
| | | public static final int CMD_StopCharTestAck = 0xB4; //停止充电成功 |
| | | public static final int CMD_PauseCharTest = 0xB5; //暂停充电 |
| | | public static final int CMD_PauseCharTestAck = 0xB6; //暂停充电成功 |
| | | //-----------------------------启动活化测试命令 |
| | | public static final int CMD_StartHUOHUATest = 0xC1; //启动活化测试 |
| | | public static final int CMD_StartHUOHUATestACK = 0xC2; //启动活化测试成功 |
| | | public static final int CMD_StartHUOHUATest = 0xC1; //启动活化测试 |
| | | public static final int CMD_StartHUOHUATestACK = 0xC2; //启动活化测试成功 |
| | | public static final int CMD_StopHUOHUATest = 0xC3; //停止活化测试 |
| | | public static final int CMD_StopHUOHUATestACK = 0xC4; //停止活化测试成功 |
| | | public static final int CMD_PauseHUOHUATest = 0xC5; //暂停活化测试 |
| | |
| | | |
| | | import com.whyc.pojo.Fbs9100Sysparam; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface Fbs9100SysparamMapper extends CustomMapper<Fbs9100Sysparam>{ |
| | | public interface Fbs9100SysparamMapper extends CustomMapper<Fbs9100Sysparam> { |
| | | |
| | | //修改61850设备系统参数 |
| | | int update61850(Fbs9100Sysparam fbs9100Sysparam); |
| | | |
| | | //根据设备id查询系统参数---先将记录插入表有则改无则添加 |
| | | boolean replace(int devId); |
| | | |
| | | //根据设备id查询系统参数---查询系统参数 |
| | | Fbs9100Sysparam serchByCondition(int intValue); |
| | | |
| | | //均衡控制参数设置-设置参数 |
| | | boolean update61850JunHeng(Fbs9100Sysparam fbs9100Sysparam); |
| | | |
| | | //并联设备-设置参数 |
| | | boolean updateBL(Fbs9100Sysparam fbs9100Sysparam); |
| | | } |
| | |
| | | @TableField("StandyVolt") |
| | | private Float standyVolt; |
| | | |
| | | @ApiModelProperty(value = "浮充电压[并联电源]") |
| | | @TableField("floatChargeVolt") |
| | | private Float floatChargeVolt; |
| | | |
| | | @ApiModelProperty(value = "后备放电电压[并联电源]") |
| | | @TableField("disChargeVolt") |
| | | private Float disChargeVolt; |
| | | |
| | | @ApiModelProperty(value = "放电电压下限[并联电源]") |
| | | @TableField("dischargeVoltLimit") |
| | | private Float dischargeVoltLimit; |
| | | |
| | | @ApiModelProperty(value = "单体下限[并联电源]") |
| | | @TableField("monomerLowVolt") |
| | | private Float monomerLowVolt; |
| | | |
| | | @ApiModelProperty(value = "单体下限个数[并联电源]") |
| | | @TableField("monomerLowCount") |
| | | private Integer monomerLowCount; |
| | | |
| | | @ApiModelProperty(value = "自动启动均充周期(天)[并联电源]") |
| | | @TableField("autoEQChargeStartimeTime") |
| | | private Integer autoEQChargeStartimeTime; |
| | | |
| | | @ApiModelProperty(value = "均充时长[并联电源]") |
| | | @TableField("autoEQChargetTime") |
| | | private Integer autoEQChargetTime; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private String stationName; |
| | | @TableField(exist = false) |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.FBS9100_ComBase; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.Fbs9100SysparamMapper; |
| | | import com.whyc.pojo.Fbs9100Setparam; |
| | | import com.whyc.pojo.Fbs9100Sysparam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import sun.applet.resources.MsgAppletViewer; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class Fbs9100SysparamService { |
| | |
| | | } |
| | | //均衡控制参数设置-设置参数 |
| | | public Response update61850JunHeng(Fbs9100Sysparam fbs9100Sysparam) { |
| | | boolean b=mapper.update61850JunHeng(fbs9100Sysparam); |
| | | boolean bl=false; |
| | | String msg=""; |
| | | if(b){ |
| | | bl=sendCmdToFBS9100DevSysParam(fbs9100Sysparam.getOpCmd(), fbs9100Sysparam.getDevId().intValue()); |
| | | if(bl){ |
| | | msg="修改成功!"; |
| | | }else{ |
| | | msg="设置61850均衡参数失败,请检查网络!"; |
| | | boolean b = mapper.update61850JunHeng(fbs9100Sysparam); |
| | | boolean bl = false; |
| | | String msg = ""; |
| | | if (b) { |
| | | bl = sendCmdToFBS9100DevSysParam(fbs9100Sysparam.getOpCmd(), fbs9100Sysparam.getDevId().intValue()); |
| | | if (bl) { |
| | | msg = "修改成功!"; |
| | | } else { |
| | | msg = "设置61850均衡参数失败,请检查网络!"; |
| | | } |
| | | }else { |
| | | msg="修改失败!"; |
| | | } else { |
| | | msg = "修改失败!"; |
| | | } |
| | | return new Response().set(1,bl,msg); |
| | | return new Response().set(1, bl, msg); |
| | | } |
| | | |
| | | //并联设备-获取参数 |
| | | public Response searchBL(int devId) { |
| | | boolean b = sendCmdToFBS9100DevSysParam(FBS9100_ComBase.CMD_GetBLParam, devId); |
| | | PageHelper.startPage(1, 1); |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.eq("dev_id", devId); |
| | | Fbs9100Sysparam sysparam = mapper.selectOne(wrapper); |
| | | return new Response().setII(1, b, sysparam, b == true ? "获取参数成功!" : "获取参数失败!"); |
| | | } |
| | | |
| | | //并联设备-设置参数 |
| | | public Response updateBL(Fbs9100Sysparam fbs9100Sysparam) { |
| | | boolean b = mapper.updateBL(fbs9100Sysparam); |
| | | boolean bl = false; |
| | | String msg = ""; |
| | | if (b) { |
| | | bl = sendCmdToFBS9100DevSysParam(fbs9100Sysparam.getOpCmd(), fbs9100Sysparam.getDevId().intValue()); |
| | | if (bl) { |
| | | msg = "修改成功!"; |
| | | } else { |
| | | msg = "并联设备-设置参数失败,请检查网络!"; |
| | | } |
| | | } else { |
| | | msg = "修改失败!"; |
| | | } |
| | | return new Response().set(1, bl, msg); |
| | | } |
| | | |
| | | //系统参数命令操作设备时的cmd和ack校验 |
| | | public boolean sendCmdToFBS9100DevSysParam(int cmd,int dev_id) |
| | | { |
| | | public boolean sendCmdToFBS9100DevSysParam(int cmd, int dev_id) { |
| | | int m_cmd = cmd; |
| | | int m_cmd_ack = cmd; |
| | | switch(m_cmd) { |
| | | case FBS9100_ComBase.CMD_GetSYSSetParam: m_cmd_ack = FBS9100_ComBase.CMD_GetSYSSetParamAck; break; |
| | | case FBS9100_ComBase.CMD_SetSYSSetParam: m_cmd_ack = FBS9100_ComBase.CMD_SetSYSSetParamAck; break; |
| | | case FBS9100_ComBase.CMD_ClearSysAlarm: m_cmd_ack = FBS9100_ComBase.CMD_ClearSysAlarm_ACK; break; |
| | | case FBS9100_ComBase.CMD_SetJunHengParam: m_cmd_ack = FBS9100_ComBase.CMD_SetJunHengParamAck;break; |
| | | case FBS9100_ComBase.CMD_GetJunHengParam: m_cmd_ack = FBS9100_ComBase.CMD_GetJunHengParamAck;break; |
| | | default: return false; |
| | | switch (m_cmd) { |
| | | case FBS9100_ComBase.CMD_GetSYSSetParam: |
| | | m_cmd_ack = FBS9100_ComBase.CMD_GetSYSSetParamAck; |
| | | break; |
| | | case FBS9100_ComBase.CMD_SetSYSSetParam: |
| | | m_cmd_ack = FBS9100_ComBase.CMD_SetSYSSetParamAck; |
| | | break; |
| | | case FBS9100_ComBase.CMD_ClearSysAlarm: |
| | | m_cmd_ack = FBS9100_ComBase.CMD_ClearSysAlarm_ACK; |
| | | break; |
| | | case FBS9100_ComBase.CMD_SetJunHengParam: |
| | | m_cmd_ack = FBS9100_ComBase.CMD_SetJunHengParamAck; |
| | | break; |
| | | case FBS9100_ComBase.CMD_GetJunHengParam: |
| | | m_cmd_ack = FBS9100_ComBase.CMD_GetJunHengParamAck; |
| | | break; |
| | | case FBS9100_ComBase.CMD_GetBLParam: |
| | | m_cmd_ack = FBS9100_ComBase.CMD_GetBLParamAck; |
| | | break; |
| | | case FBS9100_ComBase.CMD_SetBLParam: |
| | | m_cmd_ack = FBS9100_ComBase.CMD_SetBLParamAck; |
| | | break; |
| | | default: |
| | | return false; |
| | | } |
| | | UpdateWrapper updateWrapper=new UpdateWrapper(); |
| | | updateWrapper.set("op_cmd",m_cmd); |
| | | updateWrapper.eq("dev_id",dev_id); |
| | | int flag=mapper.update(null,updateWrapper); |
| | | UpdateWrapper updateWrapper = new UpdateWrapper(); |
| | | updateWrapper.set("op_cmd", m_cmd); |
| | | updateWrapper.eq("dev_id", dev_id); |
| | | int flag = mapper.update(null, updateWrapper); |
| | | boolean res_exe = false; |
| | | if(flag>0) |
| | | { |
| | | PageHelper.startPage(1,1); |
| | | QueryWrapper queryWrapper=new QueryWrapper(); |
| | | queryWrapper.eq("dev_id",dev_id); |
| | | for(int n=0; n<40; n++) |
| | | { |
| | | Fbs9100Sysparam sysparam=mapper.selectOne(queryWrapper); |
| | | if(sysparam!=null){ |
| | | if(sysparam.getOpCmd()==m_cmd_ack){ |
| | | if (flag > 0) { |
| | | PageHelper.startPage(1, 1); |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("dev_id", dev_id); |
| | | for (int n = 0; n < 40; n++) { |
| | | Fbs9100Sysparam sysparam = mapper.selectOne(queryWrapper); |
| | | if (sysparam != null) { |
| | | if (sysparam.getOpCmd() == m_cmd_ack) { |
| | | res_exe = true; |
| | | break; |
| | | } |
| | |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | }else{ |
| | | } else { |
| | | break; |
| | | } |
| | | |
| | |
| | | } |
| | | return res_exe; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | <update id="update61850"> |
| | | update db_ram_db.tb_fbs9100_sysparam set GroupVolSorce=#{GroupVolSorce},CurrentTyte=#{CurrentTyte},MonomerOrder=#{MonomerOrder} |
| | | ,PowerBreakChargeCurr=#{PowerBreakChargeCurr},POF_BG_Boost_VolStop=#{pofBgBoostVolstop},POF_BG_Boost_VolStart=#{pofBgBoostVolstart} |
| | | where dev_id=#{devId} |
| | | update db_ram_db.tb_fbs9100_sysparam |
| | | set GroupVolSorce=#{GroupVolSorce} |
| | | , CurrentTyte=#{CurrentTyte} |
| | | , MonomerOrder=#{MonomerOrder} |
| | | , PowerBreakChargeCurr=#{PowerBreakChargeCurr} |
| | | , POF_BG_Boost_VolStop=#{pofBgBoostVolstop} |
| | | , POF_BG_Boost_VolStart=#{pofBgBoostVolstart} |
| | | where dev_id = #{devId} |
| | | </update> |
| | | |
| | | <update id="replace" > |
| | | REPLACE into db_ram_db.tb_fbs9100_sysparam(dev_id) values(#{devId}) |
| | | <update id="replace"> |
| | | REPLACE |
| | | into db_ram_db.tb_fbs9100_sysparam(dev_id) values( |
| | | #{devId} |
| | | ) |
| | | </update> |
| | | <update id="update61850JunHeng"> |
| | | update db_ram_db.tb_fbs9100_sysparam set JunHeng_Enabled=#{junhengEnabled},JunHeng_StVol=#{junhengStvol},JunHeng_StCurr=#{junhengStcurr},StandyVolt=#{standyVolt} |
| | | where dev_id=#{devId} |
| | | update db_ram_db.tb_fbs9100_sysparam |
| | | set JunHeng_Enabled=#{junhengEnabled}, |
| | | JunHeng_StVol=#{junhengStvol}, |
| | | JunHeng_StCurr=#{junhengStcurr}, |
| | | StandyVolt=#{standyVolt} |
| | | where dev_id = #{devId} |
| | | </update> |
| | | <update id="updateBL"> |
| | | update db_ram_db.tb_fbs9100_sysparam |
| | | set floatChargeVolt=#{floatChargeVolt}, |
| | | disChargeVolt=#{disChargeVolt}, |
| | | dischargeVoltLimit=#{dischargeVoltLimit}, |
| | | monomerLowVolt=#{monomerLowVolt}, |
| | | monomerLowCount=#{monomerLowCount}, |
| | | autoEQChargeStartimeTime=#{autoEQChargeStartimeTime}, |
| | | autoEQChargetTime=#{autoEQChargetTime} |
| | | where dev_id = #{devId} |
| | | </update> |
| | | <select id="serchByCondition" resultType="com.whyc.pojo.Fbs9100Sysparam"> |
| | | select distinct dev_ip,dev_id,op_cmd,IPADDR,SubIPADDR,NetGateADDR,GroupVolRange,GroupVolSorce,CurrentRange,CurrentTyte,MonomerOrder,BackLightTime |
| | | ,MACADDR,LoaderCount,DtCardCount,PowerBreakChargeCurr,MajorBattGroupNum,POF_BG_Boost_Cnt,POF_BG_Boost_VolStop,POF_BG_Boost_VolStart |
| | | ,db_battinf.tb_battinf.FBSDeviceName,db_battinf.tb_battinf.StationName |
| | | from db_ram_db.tb_fbs9100_sysparam,db_battinf.tb_battinf |
| | | where db_ram_db.tb_fbs9100_sysparam.dev_id=db_battinf.tb_battinf.FBSDeviceId |
| | | and db_ram_db.tb_fbs9100_sysparam.dev_id=#{devId} |
| | | select distinct dev_ip |
| | | , dev_id |
| | | , op_cmd |
| | | , IPADDR |
| | | , SubIPADDR |
| | | , NetGateADDR |
| | | , GroupVolRange |
| | | , GroupVolSorce |
| | | , CurrentRange |
| | | , CurrentTyte |
| | | , MonomerOrder |
| | | , BackLightTime |
| | | , MACADDR |
| | | , LoaderCount |
| | | , DtCardCount |
| | | , PowerBreakChargeCurr |
| | | , MajorBattGroupNum |
| | | , POF_BG_Boost_Cnt |
| | | , POF_BG_Boost_VolStop |
| | | , POF_BG_Boost_VolStart |
| | | , db_battinf.tb_battinf.FBSDeviceName |
| | | , db_battinf.tb_battinf.StationName |
| | | from db_ram_db.tb_fbs9100_sysparam, |
| | | db_battinf.tb_battinf |
| | | where db_ram_db.tb_fbs9100_sysparam.dev_id = db_battinf.tb_battinf.FBSDeviceId |
| | | and db_ram_db.tb_fbs9100_sysparam.dev_id = #{devId} |
| | | </select> |
| | | |
| | | </mapper> |