| | |
| | | package com.ycl.calculate; |
| | | |
| | | import com.fasterxml.jackson.databind.ser.Serializers; |
| | | import com.ycl.platform.domain.entity.CheckIndexVideo; |
| | | import com.ycl.platform.domain.result.BaseResult; |
| | | import com.ycl.platform.domain.result.UY.QueryVqdResult; |
| | | import com.ycl.platform.domain.result.UY.VideoOnlineResult; |
| | | import com.ycl.platform.domain.vo.PlatformOnlineVO; |
| | | import com.ycl.platform.mapper.CheckIndexVideoMapper; |
| | | import com.ycl.platform.service.ICheckIndexVideoService; |
| | |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class PlatformOnlineCalculation extends IndexCalculationServe implements CalculationStrategy<PlatformOnlineVO> { |
| | | public class PlatformOnlineCalculation extends IndexCalculationUtils implements CalculationStrategy<PlatformOnlineVO> { |
| | | @Autowired |
| | | private SysDeptMapper deptMapper; |
| | | @Autowired |
| | |
| | | |
| | | @Override |
| | | public void calculate(List<PlatformOnlineVO> list) { |
| | | //list 对象是查询 t_platform_online 昨天时段的集合对象 |
| | | Map<String,Double> map = new HashMap<>(); |
| | | if (!CollectionUtils.isEmpty(list)) { |
| | | for (PlatformOnlineVO platformOnlineVO : list) { |
| | |
| | | Integer deptId = AreaDeptEnum.fromCode(area).getDeptId(); |
| | | //离线时长 |
| | | Integer time = platformOnlineVO.getTodayOutlineSed(); |
| | | //离线时长转换位分钟 |
| | | //离线时长转换为分钟 |
| | | int num = (time / 60) / 30; |
| | | double score = Math.max(1 - num * 0.1, 0); |
| | | map.put(deptId+"",score); |
| | | map.put(ApiConstants.Province + deptId,score); |
| | | map.put(ApiConstants.Dept + deptId,score); |
| | | } |
| | | } |
| | | |
| | |
| | | log.info("数据为空"); |
| | | } |
| | | } |
| | | |
| | | } |