whycrzg
2021-02-19 656bd1b190ed296a7bf63623dc8e9fe2bc9d3098
src/main/java/com/fgkj/controller/ram/Fbs9100_setparamController.java
@@ -17,7 +17,7 @@
@RequestMapping("fbs9100SetParam")
@RestController
@Api(tags = "fbs9100SetParam接口")
@Api(tags = "fbs9100SetParam接口 TODO待测 ")
public class Fbs9100_setparamController{
   @Resource
@@ -27,60 +27,108 @@
   private User_logService uservice;
   //根据机房编号和维护区查询放电机房的信息和放电参数
   @GetMapping("byCondition")
   @PostMapping("byCondition")
   @ApiOperation(notes = "",value="机房编号和维护区查询放电机房的信息和放电参数")
   public ServiceModel serchByCondition(@RequestBody BattInf binf){
      // BattInf binf = getGson().fromJson(json, BattInf.class);
   public ServiceModel serchByCondition(@RequestParam Integer num,@RequestParam String stationName1,
                               @RequestParam String stationName,@RequestParam Integer battGroupId) {
      BattInf binf = new BattInf();
      binf.setNum(num);
      binf.setStationName1(stationName1);
      binf.setStationName(stationName);
      binf.setBattGroupId(battGroupId);
      ServiceModel model = service.serchByCondition(binf);
      return model;
   }
    //根据设备id查询设备的放电参数
   @GetMapping("devParamById")
   @PostMapping("devParamById")
   @ApiOperation(notes = "",value="设备id查询设备的放电参数")
   public ServiceModel serchdevParam(@RequestBody BattInf binf){
   public ServiceModel serchdevParam(@RequestParam Integer fbsDeviceId) {
      BattInf binf = new BattInf();
      binf.setFbsDeviceId(fbsDeviceId);
      ServiceModel model = service.serchdevParam(binf);
      return model;
   }
   //弹出框的确定操作
   @PutMapping("update")
   @ApiOperation(notes = "",value="弹出框的确定操作")
   @ApiOperation(notes = "{\n" +
         "  \"num\": 82,\n" +
         "  \"dev_id\": 961100001,\n" +
         "  \"testCmd\": 0,\n" +
         "  \"hourRate\": 0,\n" +
         "  \"disCurr\": 0.0,\n" +
         "  \"disCap\": 0.0,\n" +
         "  \"disTime\": 0,\n" +
         "  \"groupVol_Low\": 0.0,\n" +
         "  \"monomerVol_Low\": 0.0,\n" +
         "  \"monomerLowCount\": 0,\n" +
         "  \"battGroupNum\": 0,\n" +
         "  \"onlineLowAction\": 0,\n" +
         "  \"dCVolHighLimit\": 0.0,\n" +
         "  \"chargeCurrSet\": 0.0,\n" +
         "  \"monomerTmp_High\": 0.0\n" +
         "}",value="弹出框的确定操作 TODO 待测")
   public ServiceModel update(@RequestBody Fbs9100_setparam fbs) {
      ServiceModel model = service.update(fbs);
      {   String msg="";
         if(fbs.getNum()==FBS9100_ComBase.CMD_SetDischargeParm){
              msg="修改"+fbs.getDev_id()+"的设备放电参数";
         }else if(fbs.getNum()==FBS9100_ComBase.CMD_Start){
             msg="启动"+fbs.getDev_id()+"的设备放电";
         }else if(fbs.getNum()==FBS9100_ComBase.CMD_Stop){
             msg="停止"+fbs.getDev_id()+"的设备放电";
      ServiceModel model = new ServiceModel();
      try {
         model = service.update(fbs);
         {   String msg="";
            if(fbs.getNum()==FBS9100_ComBase.CMD_SetDischargeParm){
                msg="修改"+fbs.getDev_id()+"的设备放电参数";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_Start){
                msg="启动"+fbs.getDev_id()+"的设备放电";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_Stop){
                msg="停止"+fbs.getDev_id()+"的设备放电";
            }
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
            uservice.add(ulog);//将用户的操作记录下来
         }
         User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
         uservice.add(ulog);//将用户的操作记录下来
      } catch (Exception e) {
         e.printStackTrace();
         model.setCode(0);
         model.setMsg("修改异常!");
         return model;
      }
      return model;
   }
   //离线养护功能
   @PutMapping("maintain")
   @ApiOperation(notes = "",value="离线养护功能")
   @ApiOperation(notes = "{\n" +
         "  \"dev_id\": 0,\n" +
         "  \"op_cmd\": 81,\n" +
         "  \"monomerTmp_High\": 0.0,\n" +
         "  \"offLineYH_Cycle\": 0,\n" +
         "  \"offLineYHstarttime\": \"2021-01-25 08:19:35\",\n" +
         "  \"offLineYHTimes\": 0,\n" +
         "  \"offLineYHOnceCycle\": 0,\n" +
         "  \"onLineVol_Low\": 0.0\n" +
         "}",value="离线养护功能 TODO 待测")
   public ServiceModel updateMaintain(@RequestBody Fbs9100_setparam fbs) {
      ServiceModel model = service.updateMaintain(fbs);
      {   String msg="";
      if(fbs.getOp_cmd()==FBS9100_ComBase.CMD_SetOffLineYHParam){
           msg="设置"+fbs.getDev_id()+"的设备离线养护功能";
      }else if(fbs.getOp_cmd()==FBS9100_ComBase.CMD_StartOffLine){
          msg="启动"+fbs.getDev_id()+"的设备离线养护功能";
      }else if(fbs.getOp_cmd()==FBS9100_ComBase.CMD_StopOffLine){
          msg="停止"+fbs.getDev_id()+"的设备离线养护功能";
      }else if(fbs.getOp_cmd()==FBS9100_ComBase.CMD_GetOffLineYHParam){
          msg="读取"+fbs.getDev_id()+"的设备离线养护功能";
      }else if(fbs.getOp_cmd()==FBS9100_ComBase.CMD_ResetSystem){
          msg="重启"+fbs.getDev_id()+"的设备";
      }
         User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
         uservice.add(ulog);//将用户的操作记录下来
      ServiceModel model = new ServiceModel();
      try {
         model = service.updateMaintain(fbs);
         {   String msg="";
         if(fbs.getOp_cmd()==FBS9100_ComBase.CMD_SetOffLineYHParam){
             msg="设置"+fbs.getDev_id()+"的设备离线养护功能";
         }else if(fbs.getOp_cmd()==FBS9100_ComBase.CMD_StartOffLine){
             msg="启动"+fbs.getDev_id()+"的设备离线养护功能";
         }else if(fbs.getOp_cmd()==FBS9100_ComBase.CMD_StopOffLine){
             msg="停止"+fbs.getDev_id()+"的设备离线养护功能";
         }else if(fbs.getOp_cmd()==FBS9100_ComBase.CMD_GetOffLineYHParam){
             msg="读取"+fbs.getDev_id()+"的设备离线养护功能";
         }else if(fbs.getOp_cmd()==FBS9100_ComBase.CMD_ResetSystem){
             msg="重启"+fbs.getDev_id()+"的设备";
         }
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
            uservice.add(ulog);//将用户的操作记录下来
         }
      } catch (Exception e) {
         e.printStackTrace();
         model.setCode(0);
         model.setMsg("修改失败!");
         return model;
      }
      return model;
@@ -88,19 +136,38 @@
   //点击弹出框的设定按钮,修改ld6测试参数
   @PutMapping("ld6Param")
   @ApiOperation(notes = "",value="点击弹出框的设定按钮,修改ld6测试参数")
   @ApiOperation(notes = "{\n" +
         "  \"num\": -,\n" +
         "  \"testCmd\": -,\n" +
         "  \"groupVol_LOW\": -,\n" +
         "  \"monomerVol_LOW\": -,\n" +
         "  \"monomerLowCount\": -,\n" +
         "  \"monomerTmp_High\": -,\n" +
         "  \"disTime\": -,\n" +
         "  \"disCap\": -,\n" +
         "  \"autoTestStartVol\": -,\n" +
         "  \"dev_id\": -\n" +
         "}",value="点击弹出框的设定按钮,修改ld6测试参数 TODO 待测")
   public ServiceModel updateld6Param(@RequestBody Fbs9100_setparam fbs){
      ServiceModel model = service.updateld6Param(fbs);
      {   String msg="";
         if(fbs.getNum()==FBS9100_ComBase.CMD_SetDischargeParm){
              msg="修改"+fbs.getDev_id()+"的设备放电参数";
         }else if(fbs.getNum()==FBS9100_ComBase.CMD_Start){
             msg="启动"+fbs.getDev_id()+"的设备放电";
         }else if(fbs.getNum()==FBS9100_ComBase.CMD_Stop){
             msg="停止"+fbs.getDev_id()+"的设备放电";
      ServiceModel model = null;
      try {
         model = service.updateld6Param(fbs);
         {   String msg="";
            if(fbs.getNum()==FBS9100_ComBase.CMD_SetDischargeParm){
                msg="修改"+fbs.getDev_id()+"的设备放电参数";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_Start){
                msg="启动"+fbs.getDev_id()+"的设备放电";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_Stop){
                msg="停止"+fbs.getDev_id()+"的设备放电";
            }
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
            uservice.add(ulog);//将用户的操作记录下来
         }
         User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
         uservice.add(ulog);//将用户的操作记录下来
      } catch (Exception e) {
         e.printStackTrace();
         model.setCode(0);
         model.setMsg("修改失败!");
         return model;
      }
      return model;
@@ -108,35 +175,66 @@
   //点击弹出框的设定按钮,修改61850测试参数
   @PutMapping("61850Param")
   @ApiOperation(notes = "",value="点击弹出框的设定按钮,修改61850测试参数")
   @ApiOperation(notes = "{\n" +
         "  \"chargeCurrSet\": 0,\n" +
         "  \"dCVolHighLimit\": 0,\n" +
         "  \"dev_id\": 0,\n" +
         "  \"disCap\": 0,\n" +
         "  \"disCurr\": 0,\n" +
         "  \"disTime\": 0,\n" +
         "  \"groupVol_Low\": 0,\n" +
         "  \"hourRate\": 0,\n" +
         "  \"monomerLowCount\": 0,\n" +
         "  \"monomerTmp_High\": 0,\n" +
         "  \"monomerVol_Low\": 0\n" +
         "}",value="点击弹出框的设定按钮,修改61850测试参数 TODO 待测")
   public ServiceModel update61850Param(@RequestBody Fbs9100_setparam fbs){
      ServiceModel model = service.update61850Param(fbs);
      {   String msg="";
         if(fbs.getNum()==FBS9100_ComBase.CMD_SetDischargeParm){
              msg="修改"+fbs.getDev_id()+"的设备放电参数";
         }else if(fbs.getNum()==FBS9100_ComBase.CMD_Start){
             msg="启动"+fbs.getDev_id()+"的设备放电";
         }else if(fbs.getNum()==FBS9100_ComBase.CMD_Stop){
             msg="停止"+fbs.getDev_id()+"的设备放电";
      ServiceModel model = new ServiceModel();
      try {
         model = service.update61850Param(fbs);
         {   String msg="";
            if(fbs.getNum()==FBS9100_ComBase.CMD_SetDischargeParm){
                msg="修改"+fbs.getDev_id()+"的设备放电参数";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_Start){
                msg="启动"+fbs.getDev_id()+"的设备放电";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_Stop){
                msg="停止"+fbs.getDev_id()+"的设备放电";
            }
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
            uservice.add(ulog);//将用户的操作记录下来
         }
         User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
         uservice.add(ulog);//将用户的操作记录下来
      } catch (Exception e) {
         e.printStackTrace();
         model.setCode(0);
         model.setMsg("修改失败!");
         return model;
      }
      return model;
   }
   
   //右键查看参数和弹出框的刷新按钮
   @GetMapping("byDevId")
   @ApiOperation(notes = "",value="右键查看参数和弹出框的刷新按钮")
   public ServiceModel serchbyDev_id(@RequestBody Fbs9100_setparam fsparam) {
   @PostMapping("byDevId")
   @ApiOperation(notes = "{\n" +
         "\"num\":\"-\",\n" +
            "\"dev_id\":618500002,\n" +
         "\"testCmd\":\"-\"\n" +
         "}",value="右键查看参数和弹出框的刷新按钮 TODO 待测")
   public ServiceModel serchbyDev_id(@RequestParam Integer num,@RequestParam Integer dev_id,@RequestParam Integer testCmd) {
      Fbs9100_setparam fsparam = new Fbs9100_setparam();
      fsparam.setNum(num);
      fsparam.setDev_id(dev_id);
      fsparam.setTestCmd(testCmd);
      ServiceModel model = service.serchbyDev_id(fsparam);
      return model;
   }
   
   //实时刷新放电表格的电池组状态(集合)
   @GetMapping("byInfo")
   @ApiOperation(notes = "",value="实时刷新放电表格的电池组状态(集合)")
   @PostMapping("byInfo")
   @ApiOperation(notes = "[{\n" +
         "    \"fbsDeviceId\":618500001,\n" +
         "    \"battGroupId\":1000007\n" +
         "}]",value="实时刷新放电表格的电池组状态(集合)")
   public ServiceModel serchByInfo(@RequestBody List<BattInf> binf){
      // List<BattInf> binf = getGson().fromJson(json, new TypeToken<List<BattInf>>(){}.getType());
      ServiceModel model = service.serchByInfo(binf);
@@ -144,38 +242,70 @@
   }
   
   //根据电池组id查询电池组内前五的内阻数据(修改为前10)
   @GetMapping("byThirdBatt")
   @PostMapping("byThirdBatt")
   @ApiOperation(notes = "",value="电池组id查询电池组内前五的内阻数据(修改为前10)")
   public ServiceModel serchByThirdBatt(@RequestBody BattInf binf){
   public ServiceModel serchByThirdBatt(@RequestParam Integer groupIndexInFBSDevice,@RequestParam Integer fbsDeviceId){
      BattInf binf = new BattInf();
      binf.setGroupIndexInFBSDevice(groupIndexInFBSDevice);
      binf.setFbsDeviceId(fbsDeviceId);                  //910000001
      ServiceModel model = service.serchByThirdBatt(binf);
      return model;
   }
   //-----------跨域实现(启动,停止)设备放电
   @PutMapping("update_ky")
   @ApiOperation(tags = "跨域", notes = "",value="跨域实现(启动,停止)设备放电")
   @ApiOperation(tags = "跨域", notes = "{\n" +
         "\t\"testCmd\":\"-\",\n" +
         "    \"hourRate\":\"-\",\n" +
         "    \"disCurr\":\"-\",\n" +
         "    \"disCap\":\"-\",\n" +
         "    \"disTime\":\"-\",\n" +
         "    \"groupVol_Low\":\"-\",\n" +
         "    \"monomerVol_Low\":\"-\",\n" +
         "    \"monomerLowCount\":\"-\",\n" +
         "    \"battGroupNum\":\"-\",\n" +
         "    \"onlineLowAction\":\"-\",\n" +
         "    \"dCVolHighLimit\":\"-\",\n" +
         "    \"chargeCurrSet\":\"-\",\n" +
         "    \"monomerTmp_High\":\"-\",\n" +
         "    \"dev_id\":\"-\"\n" +
         "}",value="跨域实现(启动,停止)设备放电")
   public ServiceModel update_ky(@RequestBody Fbs9100_setparam fbs) {
      {   String msg="";
         if(fbs.getNum()==FBS9100_ComBase.CMD_SetDischargeParm){
              msg="修改"+fbs.getDev_id()+"的设备放电参数";
         }else if(fbs.getNum()==FBS9100_ComBase.CMD_Start){
             msg="启动"+fbs.getDev_id()+"的设备放电";
         }else if(fbs.getNum()==FBS9100_ComBase.CMD_Stop){
             msg="停止"+fbs.getDev_id()+"的设备放电";
         }else if(fbs.getNum()==FBS9100_ComBase.CMD_GetDischargeParm){
             msg="获取"+fbs.getDev_id()+"的设备放电参数";
      ServiceModel model = null;
      try {
         {   String msg="";
            if(fbs.getNum()==FBS9100_ComBase.CMD_SetDischargeParm){
                msg="修改"+fbs.getDev_id()+"的设备放电参数";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_Start){
                msg="启动"+fbs.getDev_id()+"的设备放电";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_Stop){
                msg="停止"+fbs.getDev_id()+"的设备放电";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_GetDischargeParm){
                msg="获取"+fbs.getDev_id()+"的设备放电参数";
            }
         }
         model = service.update(fbs);
      } catch (Exception e) {
         e.printStackTrace();
         model.setCode(0);
         model.setMsg("修改失败!");
         return model;
      }
      ServiceModel model = service.update(fbs);
      return model;
   }
   //-----------跨域根据机房编号和维护区查询放电机房的信息和放电参数
   @GetMapping("byCondition_ky")
   @ApiOperation(tags = "跨域", notes = "",value="跨域根据机房编号和维护区查询放电机房的信息和放电参数")
   public ServiceModel serchByCondition_ky(@RequestBody BattInf binf){
   @PostMapping("byCondition_ky")
   @ApiOperation(tags = "跨域", notes = "",value="跨域根据机房编号和维护区查询放电机房的信息和放电参数 TODO")
   public ServiceModel serchByCondition_ky(@RequestParam Integer num,@RequestParam String stationName1,
                                 @RequestParam String stationName,@RequestParam Integer battGroupId){
      BattInf binf = new BattInf();
      binf.setNum(num);                     //41
      binf.setStationName1(stationName1);
      binf.setStationName(stationName);
      binf.setBattGroupId(battGroupId);         //1000003
      ServiceModel model = service.serchByCondition(binf);
      return model;
   }