whycrzg
2021-02-23 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4
src/main/java/com/fgkj/controller/Ld9/LD9_setparamController.java
@@ -1,39 +1,50 @@
package com.fgkj.controller.Ld9;
import com.fgkj.controller.ActionUtil;
import com.fgkj.mapper.FBS9100_ComBase;
import com.fgkj.mapper.UinfDaoFactory;
import com.fgkj.dto.BattInf;
import com.fgkj.dto.LD9_setparam;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_log;
import com.fgkj.services.User_logService;
import com.fgkj.mapper.FBS9100_ComBase;
import com.fgkj.mapper.UinfDaoFactory;
import com.fgkj.services.Ld9.LD9_setparamService;
import com.fgkj.services.User_logService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RequestMapping("ld9SetParam")
@RestController
@Api
@Api(tags = "ld9SetParam接口")
public class LD9_setparamController{
   @Autowired
   @Resource
   private LD9_setparamService service;
   @Autowired
   @Resource
   private User_logService uservice;
   ///根据设备id和单体编号查询参数
   @GetMapping("byCondition")
   public ServiceModel serchByCondition(@RequestBody  BattInf binf) {
      // BattInf binf=ActionUtil.getGson().fromJson(json, BattInf.class);
   //根据电池组id和单体编号查询参数
   //根据设备id和单体编号查询参数
   @PostMapping("byCondition")
   @ApiOperation(notes = "",value="电池组id/设备id 和单体编号查询参数")
   public ServiceModel serchByCondition(@ApiParam(value = "站点", required = true) @RequestParam String stationName,
                               @ApiParam(value = "省", required = true) @RequestParam String stationName1,
                               @ApiParam(value = "单体编号", required = true) @RequestParam Integer num,
                               @ApiParam(value = "电池组id", required = true) @RequestParam Integer battGroupId) {
      BattInf binf = new BattInf();
      binf.setStationName(stationName);
      binf.setStationName1(stationName1);
      binf.setNum(num);
      binf.setBattGroupId(battGroupId);
      ServiceModel model=service.serchByCondition(binf);
      return model;
   }
   //根据设备id修改参数
   @PutMapping("dev_id")
   @PutMapping("byDevId")
   @ApiOperation(notes = "",value="设备id修改参数")
   public ServiceModel update(@RequestBody LD9_setparam ld9) {
      // LD9_setparam ld9=ActionUtil.getGson().fromJson(json, LD9_setparam.class);
      ServiceModel model=service.update(ld9);
@@ -54,18 +65,30 @@
   }
   //右键查看参数和弹出框的刷新按钮
   @GetMapping("devId")
   public ServiceModel serchbyDev_id(@RequestBody LD9_setparam ld9) {
      // LD9_setparam ld9=ActionUtil.getGson().fromJson(json, LD9_setparam.class);
   @PostMapping("byDevId")
   @ApiOperation(notes = "",value="右键查看参数和弹出框的刷新按钮")
   public ServiceModel serchbyDev_id(@ApiParam(value = "dev_id", required = true) @RequestParam Integer dev_id,
                             @ApiParam(value = "cmd参数", required = true) @RequestParam Integer num) {
      LD9_setparam ld9 = new LD9_setparam();
      ld9.setNum(num);
      ld9.setDev_id(dev_id);
      ServiceModel model = service.serchbyDev_id(ld9);
      return model;
   }
   //根据电池组id查询电池组内前五的内阻数据
   @GetMapping("byThirdBatt")
   public ServiceModel serchByThirdBatt(@RequestBody BattInf binf){
      // BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
   /**
    * 根据电池组id查询电池组内前五的内阻数据
    * 备注:根据数据层代码表明,显示的是前十组数据
    * @return
    */
   @PostMapping("byThirdBatt")
   @ApiOperation(notes = "根据数据层代码表明,显示的是前十组数据",value="池组id查询电池组内前五的内阻数据")
   public ServiceModel serchByThirdBatt(@ApiParam(value = "groupIndexInFBSDevice", required = true) @RequestParam Integer groupIndexInFBSDevice,
                                @ApiParam(value = "fbsDeviceId", required = true) @RequestParam Integer fbsDeviceId) {
      BattInf binf = new BattInf();
      binf.setGroupIndexInFBSDevice(groupIndexInFBSDevice);
      binf.setFbsDeviceId(fbsDeviceId);
      ServiceModel model = service.serchByThirdBatt(binf);
      return model;
   }