| | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.BattCapFactory; |
| | | import com.whyc.dto.ReportBattDTO; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.AlarmParamMapper; |
| | | import com.whyc.mapper.BattAlarmMapper; |
| | | import com.whyc.mapper.BattInfMapper; |
| | | import com.whyc.mapper.BattTestInfMapper; |
| | | import com.whyc.pojo.*; |
| | | import com.whyc.pojo.db_batt.BattInf; |
| | | import com.whyc.pojo.db_dis_batt.BattTestInf; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.PageInfoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.*; |
| | | |
| | |
| | | return new Response().set(1, pageInfo); |
| | | } |
| | | |
| | | public Response getDischargePage(int pageNum, int pageSize) { |
| | | public Response getDischargePage(int pageNum, int pageSize, Integer battGroupId) { |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | List<BattTestInf> list =mapper.getDischargeList(); |
| | | List<BattTestInf> list =mapper.getDischargeList(battGroupId); |
| | | list.forEach(item->{ |
| | | //小时率 |
| | | int hourRate = BattCapFactory.GetHourRate(item.getMonCap(), item.getTestCurr()); |
| | | //容量计算 |
| | | Double realCap = BattCapFactory.GetMonomerCap(item.getMonCap(), hourRate, item.getTestCap(), item.getMaxMonvol(), item.getMinMonvol(), item.getMonVol(), BattCapFactory.CapType_Real); |
| | | item.setRealCap(realCap.floatValue()); |
| | | }); |
| | | |
| | | PageInfo pageInfo = new PageInfo(list); |
| | | return new Response().set(1, pageInfo); |
| | | } |
| | | |
| | | public BattTestInf getDischargeLast(int battGroupId) { |
| | | QueryWrapper<BattTestInf> query = Wrappers.query(); |
| | | //测试时长大于30分钟 |
| | | query.eq("binf_id", battGroupId); |
| | | query.eq("test_type",3); |
| | | query.ge("test_timelong",1800); |
| | | query.orderByDesc("record_time"); |
| | | query.last(" limit 1"); |
| | | return mapper.selectOne(query); |
| | | } |
| | | |
| | | public BattTestInf getDischargeRecord(int battGroupId, int testRecordCount) { |
| | | QueryWrapper<BattTestInf> query = Wrappers.query(); |
| | | query.eq("binf_id", battGroupId); |
| | | query.eq("test_record_count", testRecordCount); |
| | | //query.eq("test_type",3); |
| | | //query.ge("test_timelong",1800); |
| | | |
| | | query.last(" limit 1"); |
| | | return mapper.selectOne(query); |
| | | } |
| | | |
| | | /* |
| | | //1.4电池性能评估 |
| | | public Response searchGroupAssess(int pageNum, int pageSize, ReportBattDTO tinf, int userId){ |