| | |
| | | import org.springblade.jfpt.animalheat.util.ImageUtil; |
| | | import org.springblade.jfpt.animalheat.vo.AnimalHeatVo; |
| | | import org.springblade.jfpt.animalheat.vo.StatisVo; |
| | | import org.springblade.jfpt.parcel.vo.ConditionVo; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import static org.springblade.core.tool.utils.DateUtil.now; |
| | |
| | | float v1 = Float.parseFloat(temRedArr[1]); |
| | | int compare = Float.compare(v, v1); |
| | | bladeAnimalHeat.setTempRed(compare>=0 ? v:v1); |
| | | //和标志温度比较,大于37度为高温,标记为1,小于则为正常0 |
| | | int compare1 = Float.compare(37, compare >= 0 ? v : v1); |
| | | //和标志温度比较,大于37.2度为高温,标记为1,小于则为正常0 |
| | | int compare1 = Float.compare(37.2f, compare >= 0 ? v : v1); |
| | | bladeAnimalHeat.setStatus(compare1>0 ?0:1); |
| | | }else { |
| | | bladeAnimalHeat.setTempRed(Float.parseFloat(temRedArr[0])); |
| | | int compare1 = Float.compare(37, Float.parseFloat(temRedArr[0])); |
| | | int compare1 = Float.compare(37.2f, Float.parseFloat(temRedArr[0])); |
| | | bladeAnimalHeat.setStatus(compare1>0 ?0:1); |
| | | } |
| | | String person_rects = data.get("person_rect").toString(); |
| | | bladeAnimalHeat.setPersonRect(person_rects.substring(2,person_rects.length()-2)); |
| | | bladeAnimalHeat.setPersonRect(person_rects.substring(1,person_rects.length()-1)); |
| | | bladeAnimalHeat.setCreateTime(now()); |
| | | //7.插入数据 |
| | | int idata = baseMapper.insert(bladeAnimalHeat); |
| | |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> getAnimalStatis(AnimalHeatVo animalHeatVo) { |
| | | if(null!= animalHeatVo.getStatus()){ |
| | | if(null!= animalHeatVo.getType()){ |
| | | //查询当天的统计数据 |
| | | if (animalHeatVo.getStatus()==0){ |
| | | if (animalHeatVo.getType()==0){ |
| | | return baseMapper.getAnimalStatis(); |
| | | } |
| | | //查询本周的统计数据 |
| | | if (animalHeatVo.getStatus()==1){ |
| | | if (animalHeatVo.getType()==1){ |
| | | return baseMapper.getAnimalStatisWeek(); |
| | | } |
| | | //查询本月的统计数据 |
| | | if (animalHeatVo.getType()==2){ |
| | | return baseMapper.getAnimalStatisMonth(); |
| | | } |
| | | } |
| | | return null; |
| | |
| | | */ |
| | | @Override |
| | | public List<Map<String, Integer>> selWeekDayAnimalStatis() { |
| | | List<Map<String,Integer>> selWeekDayAnimalStatis; |
| | | return baseMapper.selWeekDayAnimalStatis(); |
| | | } |
| | | |
| | | /** |
| | | * 统计7天内每天体温异常的的总人数 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Map<String, Object> selectAnimalData() { |
| | | //创建map对象 |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //查询统计数据 |
| | | List<Integer> list = baseMapper.selectAnimalHeatDataStatis(); |
| | | //封装数据 |
| | | map.put("animalData",list); |
| | | //返回数据 |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 查询当前时间段体温异常总次数 |
| | | * @param conditionVo |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer selAnimalTimeCount(ConditionVo conditionVo) { |
| | | return baseMapper.selAnimalTimeCount(conditionVo); |
| | | } |
| | | } |