| | |
| | | } |
| | | |
| | | @GetMapping("readA059Pictrue") |
| | | @ApiOperation(value = "读取A059内窥镜图片") |
| | | @ApiOperation(tags = "在线监测-实时监控",value = "读取A059内窥镜图片") |
| | | public Response readA059Pictrue(HttpServletRequest request,@RequestParam String devId){ |
| | | /*=========图片保存===========*/ |
| | | ApplicationHome applicationHome = new ApplicationHome(getClass()); |
New file |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | 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); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.Ld9testdataInf; |
| | | |
| | | public interface Ld9testdataInfMapper extends CustomMapper<Ld9testdataInf>{ |
| | | |
| | | } |
New file |
| | |
| | | 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); |
| | | } |
| | |
| | | @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; |
| | |
| | | |
| | | private Integer recordNum; |
| | | |
| | | @TableField(exist = false) |
| | | private Integer recordNums; |
| | | |
| | | private Date testStarttime; |
| | | |
| | | private Date recordTime; |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Scanner; |
| | | |
| | | /** |
| | |
| | | |
| | | private Float minMonvol; |
| | | |
| | | @TableField(exist = false) |
| | | private List Ld9testdata; |
| | | |
| | | } |
New file |
| | |
| | | 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; |
| | | |
| | | |
| | | } |
| | |
| | | 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); |
New file |
| | |
| | | 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); |
| | | } |
| | | } |
New file |
| | |
| | | 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); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class Ld9testdatastopService { |
| | | } |
New file |
| | |
| | | <?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> |
New file |
| | |
| | | <?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> |