| | |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | | * 蓄电池组后评估 |
| | | */ |
| | | |
| | | @PostMapping("searchGroupAssess") |
| | | @ApiOperation(notes = "searchByCondition ", value = "蓄电池组后评估") |
| | | @ApiOperation(value = "蓄电池组后评估") |
| | | public Response searchByCondition(@RequestParam int pageNum,@RequestParam int pageSize, @RequestBody ReportBattDTO tinf) { |
| | | //UserInf userInf = ActionUtil.getUser(); |
| | | return service.searchGroupAssess(pageNum,pageSize,tinf,1001); |
| | | } |
| | | |
| | | |
| | | @PostMapping("searchMonNumAssess") |
| | | @ApiOperation(value = "电池单体性能评估") |
| | | public Response searchMonNumAssess(@RequestParam int binfId,@RequestParam int monNum){ |
| | | return service.searchMonNumAssess(binfId,monNum); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | //查往年的放电记录 |
| | | List<BattTestInf> searchDischargeTest_WJ(Integer battGroupId, Date recordStartTime); |
| | | |
| | | |
| | | //获取有效的放电记录 |
| | | List<BattTestInf> searchDischarge(int battGroupId); |
| | | } |
| | |
| | | import com.whyc.mapper.BattAlarmMapper; |
| | | import com.whyc.mapper.BattInfMapper; |
| | | import com.whyc.mapper.BattTestInfMapper; |
| | | import com.whyc.pojo.AlarmParam; |
| | | import com.whyc.pojo.BattAlarm; |
| | | import com.whyc.pojo.BattInf; |
| | | import com.whyc.pojo.BattTestInf; |
| | | import com.whyc.pojo.*; |
| | | 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.*; |
| | | |
| | |
| | | |
| | | @Autowired(required = false) |
| | | private BattAlarmMapper alarmMapper; |
| | | |
| | | @Autowired(required = false) |
| | | private SubTableService subTableService; |
| | | |
| | | |
| | | //查询充放电记录 |
| | | public Response getTinfHis(int binfId, int pageNum, int pageSize) { |
| | |
| | | return map; |
| | | } |
| | | |
| | | //电池单体性能评估 |
| | | public Response searchMonNumAssess( int binfId, int monNum) { |
| | | //获取指定电池组信息 |
| | | QueryWrapper wrapper=Wrappers.query(); |
| | | wrapper.eq("binf_id",binfId); |
| | | wrapper.last("limit 1"); |
| | | BattInf binf=binfMapper.selectOne(wrapper); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //获取有效的放电记录 |
| | | List<BattTestInf> list=mapper.searchDischarge(binfId); |
| | | float cap = 0f;//实际容量 |
| | | //取最近一笔数据 |
| | | BattTestInf tinf=list.stream().findFirst().orElse((BattTestInf) ActionUtil.objeNull); |
| | | if(tinf!=null){ |
| | | int hourRate = BattCapFactory.GetHourRate(binf.getMonCap(), tinf.getTestCurr()); |
| | | //取该单体最后一笔放电记录 |
| | | BattTestInfData tData=subTableService.getMonNumData(binfId,tinf.getTestRecordCount(),tinf.getRecordNum(),monNum); |
| | | if(tData!=null){ |
| | | cap = (float) BattCapFactory.GetMonomerCap(binf.getMonCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tData.getMonVol(), binf.getMonVol(), BattCapFactory.CapType_Real); |
| | | |
| | | } |
| | | } |
| | | map.put("cap",cap); |
| | | //评估单体 |
| | | return new Response().set(1, map, "查询成功"); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.whyc.mapper.CallBack; |
| | | import com.whyc.pojo.BattAlarmHis; |
| | | import com.whyc.pojo.BattTestInfData; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.ThreadLocalUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | }); |
| | | return list; |
| | | } |
| | | //取该单体最后一笔放电记录 |
| | | public BattTestInfData getMonNumData(int binfId, Integer testRecordCount, Integer recordNum, int monNum) { |
| | | String sql="select * from db_dis_batt.batt_test_inf_"+binfId+" " + |
| | | " where binf_id="+binfId+" " + |
| | | " and test_record_count="+testRecordCount+ |
| | | " and record_num="+recordNum+ |
| | | " and mon_num="+monNum; |
| | | List<BattTestInfData> list=sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List list=new ArrayList(); |
| | | while (rs.next()){ |
| | | BattTestInfData data=new BattTestInfData(); |
| | | data.setNum(rs.getInt("num")); |
| | | data.setBinfId(rs.getInt("binf_id")); |
| | | data.setTestRecordCount(rs.getInt("test_record_count")); |
| | | data.setTestStarttime(rs.getTimestamp("test_starttime")); |
| | | data.setRecordTime(rs.getTimestamp("record_time")); |
| | | data.setTestType(rs.getInt("test_type")); |
| | | data.setRecordNum(rs.getInt("record_num")); |
| | | data.setTestTimelong(rs.getInt("test_timelong")); |
| | | data.setOnlineVol(rs.getFloat("online_vol")); |
| | | data.setGroupVol(rs.getFloat("group_vol")); |
| | | data.setTestCurr(rs.getFloat("test_curr")); |
| | | data.setTestCap(rs.getFloat("test_cap")); |
| | | data.setMonNum(rs.getInt("mon_num")); |
| | | data.setMonVol(rs.getFloat("mon_vol")); |
| | | data.setMonTmp(rs.getFloat("mon_tmp")); |
| | | list.add(data); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list.stream().findFirst().orElse((BattTestInfData) ActionUtil.objeNull); |
| | | } |
| | | } |
| | |
| | | <select id="searchDischargeTest" resultType="com.whyc.pojo.BattTestInf"> |
| | | select |
| | | battgroupid,test_curr,max_monvol,min_monvol,test_cap,test_starttime,record_time,test_timelong,test_stoptype |
| | | from db_batt_testdata.tb_batttestdata_inf |
| | | from db_dis_batt.batt_test_inf |
| | | <where> |
| | | db_batt_testdata.tb_batttestdata_inf.data_available=1 |
| | | and test_starttype=3 and test_type=3 |
| | |
| | | and record_time>=#{recordStartTime} and record_time<=#{recordEndTime} |
| | | </if> |
| | | </where> |
| | | ORDER BY tb_batttestdata_inf.BattGroupId asc, test_starttime desc |
| | | ORDER BY db_dis_batt.batt_test_inf.BattGroupId asc, test_starttime desc |
| | | </select> |
| | | <select id="searchDischargeTest_WJ" resultType="com.whyc.pojo.BattTestInf"> |
| | | select |
| | | battgroupid,test_curr,max_monvol,min_monvol,test_cap,test_starttime,record_time,test_timelong,test_stoptype |
| | | from db_batt_testdata.tb_batttestdata_inf |
| | | from db_dis_batt.batt_test_inf |
| | | <where> |
| | | db_batt_testdata.tb_batttestdata_inf.data_available=1 |
| | | and test_starttype=3 and test_type=3 |
| | |
| | | and record_time<#{recordStartTime} |
| | | </if> |
| | | </where> |
| | | ORDER BY tb_batttestdata_inf.BattGroupId asc, test_starttime desc |
| | | ORDER BY db_dis_batt.batt_test_inf.BattGroupId asc, test_starttime desc |
| | | </select> |
| | | <select id="searchDischarge" resultType="com.whyc.pojo.BattTestInf"> |
| | | select |
| | | battgroupid,test_curr,max_monvol,min_monvol,test_cap,test_starttime,record_time,test_timelong,test_stoptype |
| | | from db_dis_batt.batt_test_inf |
| | | <where> |
| | | db_batt_testdata.tb_batttestdata_inf.data_available=1 |
| | | and test_starttype=3 and test_type=3 |
| | | and (test_stoptype in (3, 4, 6) |
| | | or (test_stoptype=2 and test_timelong>=7200)) |
| | | <if test="battGroupId!=null"> |
| | | and battgroupid=#{battGroupId} |
| | | </if> |
| | | </where> |
| | | ORDER BY db_dis_batt.batt_test_inf.BattGroupId asc, test_starttime desc |
| | | </select> |
| | | </mapper> |