whyclxw
2022-01-18 f43a0a59d5f44ce0a5a486e16bca5f6adccdcb59
在线监测-实时监控-获取绝缘装置的实时信息
10个文件已添加
4个文件已修改
265 ■■■■■ 已修改文件
src/main/java/com/whyc/controller/FGCDFileDownloadController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/Ld9testdataController.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/Ld9testdataInfController.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/Ld9testdataInfMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/Ld9testdataMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/Ld9testdata.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/Ld9testdataInf.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/Ld9testdatastop.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/Fbs9100InsulatstateService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/Ld9testdataInfService.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/Ld9testdataService.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/Ld9testdatastopService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/Ld9testdataInfMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/Ld9testdataMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/FGCDFileDownloadController.java
@@ -60,7 +60,7 @@
    }
    @GetMapping("readA059Pictrue")
    @ApiOperation(value = "读取A059内窥镜图片")
    @ApiOperation(tags = "在线监测-实时监控",value = "读取A059内窥镜图片")
    public Response readA059Pictrue(HttpServletRequest request,@RequestParam String devId){
        /*=========图片保存===========*/
        ApplicationHome applicationHome = new ApplicationHome(getClass());
src/main/java/com/whyc/controller/Ld9testdataController.java
New file
@@ -0,0 +1,26 @@
package com.whyc.controller;
import com.whyc.dto.Response;
import com.whyc.service.Ld9testdataService;
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;
@Api(tags = "在线监测-实时监控")
@RestController
@RequestMapping("Ld9testdataAction")
public class Ld9testdataController {
    @Autowired
    private Ld9testdataService service;
    @ApiOperation(value = "查询LD9单体测试数据",notes = "Ld9testdataAction_ld9action_serchByCondition")
    @GetMapping("serchByCondition")
    public Response serchByCondition(@RequestParam int recordNum,@RequestParam int testRecordCount,@RequestParam int battGroupId,@RequestParam int testMonNum){
        return  service.serchByCondition(recordNum,testRecordCount,battGroupId,testMonNum);
    }
}
src/main/java/com/whyc/controller/Ld9testdataInfController.java
New file
@@ -0,0 +1,25 @@
package com.whyc.controller;
import com.whyc.dto.Response;
import com.whyc.service.Ld9testdataInfService;
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;
@RestController
@RequestMapping("Ld9testdata_infAction")
@Api(tags = "在线监测-实时监控")
public class Ld9testdataInfController {
    @Autowired
    private Ld9testdataInfService service;
    @ApiOperation(value = "查询LD9测试数据列表",notes = "Ld9testdata_infAction_ld9action_searchInfList")
    @GetMapping("searchInfList")
    public Response searchInfList(@RequestParam int battGroupId){
        return  service.searchInfList(battGroupId);
    }
}
src/main/java/com/whyc/mapper/Ld9testdataInfMapper.java
New file
@@ -0,0 +1,7 @@
package com.whyc.mapper;
import com.whyc.pojo.Ld9testdataInf;
public interface Ld9testdataInfMapper extends CustomMapper<Ld9testdataInf>{
}
src/main/java/com/whyc/mapper/Ld9testdataMapper.java
New file
@@ -0,0 +1,12 @@
package com.whyc.mapper;
import com.whyc.pojo.Ld9testdata;
import java.util.List;
public interface Ld9testdataMapper extends CustomMapper<Ld9testdata>{
    //查询某次测试下电池组节数放电情况
    List<Ld9testdata>  serchByInfo(Ld9testdata ld9testdata);
    //查询LD9单体测试数据
    List<Ld9testdata> serchByCondition(int roteN, int testRecordCount, int battGroupId, int testMonNum);
}
src/main/java/com/whyc/pojo/Ld9testdata.java
@@ -23,8 +23,8 @@
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(schema = "db_ld9_testdata",value = "tb_ld9testdata_1000062")
@ApiModel(value="Ld9testdata1000062对象", description="")
@TableName(schema = "db_ld9_testdata",value = "tb_ld9testdata")
@ApiModel(value="Ld9testdata对象", description="")
public class Ld9testdata implements Serializable {
    private static final long serialVersionUID = 1L;
@@ -41,6 +41,9 @@
    private Integer recordNum;
    @TableField(exist = false)
    private Integer recordNums;
    private Date testStarttime;
    private Date recordTime;
src/main/java/com/whyc/pojo/Ld9testdataInf.java
@@ -11,6 +11,7 @@
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Scanner;
/**
@@ -76,5 +77,7 @@
    private Float minMonvol;
    @TableField(exist = false)
    private List Ld9testdata;
}
src/main/java/com/whyc/pojo/Ld9testdatastop.java
New file
@@ -0,0 +1,73 @@
package com.whyc.pojo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
 * <p>
 *
 * </p>
 *
 * @author lxw
 * @since 2022-01-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(schema = "db_ld9_testdata",value = "tb_ld9testdatastop")
@ApiModel(value="Ld9testdatastop对象", description="")
public class Ld9testdatastop implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "num", type = IdType.AUTO)
    private Long num;
    @TableField("BattGroupId")
    private Integer BattGroupId;
    private Integer testRecordCount;
    private Integer testType;
    private Integer recordNum;
    private Date testStarttime;
    private Date recordTime;
    private Integer testTimelong;
    private Float onlineVol;
    private Float groupVol;
    private Float testCurr;
    private Float testCap;
    private Integer monNum;
    private Float monVol;
    private Float monTmp;
    private Integer testMonnum;
    private Float maxMonvol;
    private Float minMonvol;
    private Integer testStopreason;
}
src/main/java/com/whyc/service/Fbs9100InsulatstateService.java
@@ -18,6 +18,7 @@
    public Response getDataByDevId(int powerDeviceId) {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("PowerDeviceId",powerDeviceId);
        wrapper.last("limit 1");
        List list=mapper.selectList(wrapper);
        PageInfo pageInfo=new PageInfo(list);
        return  new Response().set(1,pageInfo);
src/main/java/com/whyc/service/Ld9testdataInfService.java
New file
@@ -0,0 +1,42 @@
package com.whyc.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Response;
import com.whyc.mapper.Ld9testdataInfMapper;
import com.whyc.mapper.Ld9testdataMapper;
import com.whyc.pojo.Ld9testdata;
import com.whyc.pojo.Ld9testdataInf;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class Ld9testdataInfService {
    @Resource
    private Ld9testdataInfMapper mapper;
    @Resource
    private Ld9testdataMapper datamapper;
    //查询LD9测试数据列表
    public Response searchInfList(int battGroupId) {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("BattGroupId",battGroupId);
        wrapper.orderByDesc("test_starttime");
        List<Ld9testdataInf> list=mapper.selectList(wrapper);//查询所有的放电记录
        if(list!=null&&list.size()>0){
            for (int i = 0; i < list.size(); i++) {
                Ld9testdataInf ld9inf= (Ld9testdataInf) list.get(i);
                Ld9testdata ld9testdata = new Ld9testdata();
                ld9testdata.setTestRecordCount(ld9inf.getTestRecordCount());
                ld9testdata.setBattGroupId(ld9inf.getBattGroupId());
                List<Ld9testdata> testList = datamapper.serchByInfo(ld9testdata);//查询某次测试下电池组节数放电情况
                ld9inf.setLd9testdata(testList);
            }
        }
        PageInfo pageInfo=new PageInfo(list);
        return new Response().set(1,pageInfo);
    }
}
src/main/java/com/whyc/service/Ld9testdataService.java
New file
@@ -0,0 +1,37 @@
package com.whyc.service;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.BattTestData;
import com.whyc.dto.Response;
import com.whyc.mapper.Ld9testdataMapper;
import com.whyc.pojo.Ld9testdata;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.Resource;
import java.util.List;
@Service
public class Ld9testdataService {
    @Resource
    private Ld9testdataMapper mapper;
    //查询LD9单体测试数据
    public Response serchByCondition(int recordNum,  int testRecordCount, int battGroupId,int testMonNum) {
        int number=recordNum;//总数
        int roteN=0;
        int endN= BattTestData.RC_NUM_PARAM;//总笔数
        if(number<=endN){
            roteN=1;
        }else{
            if(number%endN==0){
                roteN=number/endN;
            }else{
                roteN=number/endN+1;
            }
        }
        List<Ld9testdata> list=mapper.serchByCondition(roteN,testRecordCount,battGroupId,testMonNum);
        PageInfo pageInfo=new PageInfo(list);
        return new Response().set(1,pageInfo);
    }
}
src/main/java/com/whyc/service/Ld9testdatastopService.java
New file
@@ -0,0 +1,7 @@
package com.whyc.service;
import org.springframework.stereotype.Service;
@Service
public class Ld9testdatastopService {
}
src/main/resources/mapper/Ld9testdataInfMapper.xml
New file
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.whyc.mapper.Ld9testdataInfMapper">
</mapper>
src/main/resources/mapper/Ld9testdataMapper.xml
New file
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.whyc.mapper.Ld9testdataMapper">
    <select id="serchByInfo" resultType="com.whyc.pojo.Ld9testdata">
        select test_monnum,max(record_num) as record_nums,BattGroupId,test_record_count
        from db_ld9_testdata.tb_ld9testdata_${BattGroupId}
        where test_record_count=#{testRecordCount}
        GROUP BY test_monnum  order by test_monnum asc
    </select>
    <select id="serchByCondition" resultType="com.whyc.pojo.Ld9testdata">
        select num,BattGroupId,test_record_count,test_type,record_num,test_starttime,record_time,test_timelong,online_vol,group_vol,test_curr,test_cap,mon_num,mon_vol,mon_tmp,test_monnum
        from db_ld9_testdata.tb_ld9testdata_${battGroupId}
        where test_record_count=#{testRecordCount}  and (record_num%#{roteN}=0 ) and test_monnum=#{testMonNum}
    </select>
</mapper>