whycrzg
2021-02-19 0c84b647de0069cb3bb513025b8880e73037bba9
update ld9SetParam
2个文件已修改
72 ■■■■■ 已修改文件
src/main/java/com/fgkj/controller/Ld9/LD9_setparamController.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/services/Ld9/LD9_setparamService.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/controller/Ld9/LD9_setparamController.java
@@ -10,6 +10,7 @@
import com.fgkj.services.User_logService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -27,10 +28,17 @@
    //根据电池组id和单体编号查询参数
    //根据设备id和单体编号查询参数
    @GetMapping("byCondition")
    @PostMapping("byCondition")
    @ApiOperation(notes = "",value="电池组id/设备id 和单体编号查询参数")
    public ServiceModel serchByCondition(@RequestBody  BattInf binf) {
        // BattInf binf=ActionUtil.getGson().fromJson(json, BattInf.class);
    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;
    }
@@ -59,8 +67,11 @@
    //右键查看参数和弹出框的刷新按钮
    @PostMapping("byDevId")
    @ApiOperation(notes = "",value="右键查看参数和弹出框的刷新按钮")
    public ServiceModel serchbyDev_id(@RequestBody LD9_setparam ld9) {
        // LD9_setparam ld9=ActionUtil.getGson().fromJson(json, LD9_setparam.class);
    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;
    }
@@ -69,12 +80,15 @@
    /**
     * 根据电池组id查询电池组内前五的内阻数据
     * 备注:根据数据层代码表明,显示的是前十组数据
     * @param binf
     * @return
     */
    @PostMapping("byThirdBatt")
    @ApiOperation(notes = "根据数据层代码表明,显示的是前十组数据",value="池组id查询电池组内前五的内阻数据")
    public ServiceModel serchByThirdBatt(@RequestBody BattInf binf){
    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;
    }
src/main/java/com/fgkj/services/Ld9/LD9_setparamService.java
@@ -44,27 +44,28 @@
        return model;    
    }
     //根据机房编号和维护区查询放电机房的信息和放电参数
    public ServiceModel serchByCondition(BattInf binf){
        ServiceModel model = new ServiceModel();
        //根据电池组id查询对应的设备id
        int dev_id=battInfMapper.serchDev_id(binf);
        //机房命令操作设备时的cmd和ack校验
        int cmd = binf.getNum();
        boolean bl=sendCmdToLd9Dev(cmd, dev_id);
     public ServiceModel serchByCondition(BattInf binf) {
         ServiceModel model = new ServiceModel();
         //根据电池组id查询对应的设备id
         Integer dev_id = battInfMapper.serchDev_id(binf);
         //机房命令操作设备时的cmd和ack校验
         int cmd = binf.getNum();
         boolean bl = false;
         if (dev_id != null) {
             bl = sendCmdToLd9Dev(cmd, dev_id);
         }
        List list=mapper.findByCondition(binf);
        if(bl){
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setData(list);
            model.setMsg("查询失败!");
        }
        return model;
    }
         if (bl) {
             List list = mapper.findByCondition(binf);
             model.setCode(1);
             model.setData(list);
             model.setMsg("查询成功!");
         } else {
             model.setCode(0);
             model.setMsg("查询失败!");
         }
         return model;
     }
    private boolean sendCmdToLd9Dev(int cmd, int dev_id) {
        int m_cmd = cmd;
@@ -97,15 +98,14 @@
    public ServiceModel serchbyDev_id(LD9_setparam ld9) {
        ServiceModel model = new ServiceModel();
        boolean bl=sendCmdToLd9Dev(ld9.getNum(), ld9.getDev_id());
        List list=mapper.serchbyDev_id(ld9);
        if(bl){
        List list=mapper.serchbyDev_id(ld9);
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setData(list);
            model.setMsg("设置9100参数失败,请检查网络!");
        }
        //System.out.println(model.getData());