| | |
| | | package com.whyc.service; |
| | | |
| | | import com.whyc.dto.BatteryInfo; |
| | | import com.whyc.dto.DataAnalysisFloatDTO; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.BatteryDataMapper; |
| | | import com.whyc.mapper.BatteryResDataMapper; |
| | | import com.whyc.mapper.BatteryTestDataMapper; |
| | | import com.whyc.pojo.BatteryEndurance; |
| | | import com.whyc.pojo.BatteryRTState; |
| | | import com.whyc.util.MathUtil; |
| | |
| | | |
| | | @Resource |
| | | private BatteryDataMapper mapper; |
| | | |
| | | @Resource |
| | | private BatteryResDataMapper resMapper; |
| | | |
| | | @Resource |
| | | private BatteryTestDataMapper testDataMapper; |
| | | |
| | | public Response getEndurance(Integer userId) { |
| | | List<BatteryEndurance> enduranceList = mapper.endurance(userId); |
| | |
| | | return maps; |
| | | } |
| | | |
| | | public Response getMonVolAndTemp(Integer userId) { |
| | | List<DataAnalysisFloatDTO> dataList= mapper.getMonVolAndTemp(userId); |
| | | return new Response<>().set(1,dataList); |
| | | public Response getMonVol(Integer userId) { |
| | | HashMap<String, Object> resMap = new HashMap<>(); |
| | | List<BatteryInfo> batteryInfos = testDataMapper.getStationAndBatteryGroupIds(userId); |
| | | for (BatteryInfo temp:batteryInfos) { |
| | | //根据BattGroupIds查询到对应的数值 |
| | | String[] batteryGroupIds = temp.getBatteryGroupIds().split(","); |
| | | Integer[] ids = new Integer[batteryGroupIds.length]; |
| | | for (int i = 0; i < batteryGroupIds.length; i++) { |
| | | ids[i] = Integer.parseInt(batteryGroupIds[i]); |
| | | } |
| | | DataAnalysisFloatDTO dataStatistics = testDataMapper.getStatisticsByBattGroupIds(ids,"mon_vol"); |
| | | resMap.put(temp.getStationName(),dataStatistics); |
| | | } |
| | | return new Response<>().set(1,resMap); |
| | | } |
| | | |
| | | public Response getMonTemp(Integer userId) { |
| | | HashMap<String, Object> resMap = new HashMap<>(); |
| | | List<BatteryInfo> batteryInfos = testDataMapper.getStationAndBatteryGroupIds(userId); |
| | | for (BatteryInfo temp:batteryInfos) { |
| | | //根据BattGroupIds查询到对应的数值 |
| | | String[] batteryGroupIds = temp.getBatteryGroupIds().split(","); |
| | | Integer[] ids = new Integer[batteryGroupIds.length]; |
| | | for (int i = 0; i < batteryGroupIds.length; i++) { |
| | | ids[i] = Integer.parseInt(batteryGroupIds[i]); |
| | | } |
| | | DataAnalysisFloatDTO dataStatistics = testDataMapper.getStatisticsByBattGroupIds(ids,"mon_tmp"); |
| | | resMap.put(temp.getStationName(),dataStatistics); |
| | | } |
| | | return new Response<>().set(1,resMap); |
| | | } |
| | | |
| | | public Response getMonRes(Integer userId) { |
| | | DataAnalysisFloatDTO data= mapper.getMonRes(userId); |
| | | return new Response<>().set(1,data); |
| | | HashMap<String, Object> resMap = new HashMap<>(); |
| | | List<BatteryInfo> batteryInfos = resMapper.getResStationAndBatteryGroupIds(userId); |
| | | for (BatteryInfo temp:batteryInfos) { |
| | | //根据BattGroupIds查询到对应的数值 |
| | | String[] batteryGroupIds = temp.getBatteryGroupIds().split(","); |
| | | Integer[] ids = new Integer[batteryGroupIds.length]; |
| | | for (int i = 0; i < batteryGroupIds.length; i++) { |
| | | ids[i] = Integer.parseInt(batteryGroupIds[i]); |
| | | } |
| | | DataAnalysisFloatDTO dataStatistics = resMapper.getResStatisticsByBattGroupIds(ids); |
| | | resMap.put(temp.getStationName(),dataStatistics); |
| | | } |
| | | return new Response<>().set(1,resMap); |
| | | } |
| | | |
| | | public Response getMonCap(Integer userId) { |
| | | DataAnalysisFloatDTO data= mapper.getMonCap(userId); |
| | | return new Response<>().set(1,data); |
| | | HashMap<String, Object> resMap = new HashMap<>(); |
| | | List<BatteryInfo> batteryInfos = testDataMapper.getStationAndBatteryGroupIds(userId); |
| | | for (BatteryInfo temp:batteryInfos) { |
| | | String[] batteryGroupIds = temp.getBatteryGroupIds().split(","); |
| | | Integer[] ids = new Integer[batteryGroupIds.length]; |
| | | for (int i = 0; i < batteryGroupIds.length; i++) { |
| | | ids[i] = Integer.parseInt(batteryGroupIds[i]); |
| | | } |
| | | //查询标准 |
| | | List<BatteryInfo> batteryStdList = testDataMapper.getVolAndCapStd(ids); |
| | | //查询最值 |
| | | List<BatteryInfo> batteryStatisticList = testDataMapper.getCapStatisticsByBattGroupIds(ids); |
| | | |
| | | } |
| | | return new Response<>().set(1,resMap); |
| | | |
| | | } |
| | | |
| | | |