| | |
| | | a.setRatio(1.0 - ((double) efficiencyDto.getErrorNumber() / (double) efficiencyDto.getNumber())); |
| | | return a; |
| | | }).collect(Collectors.toList()); |
| | | efficiencyVOS.add(new EfficiencyVO("店外经营", 0, 0.0)); |
| | | efficiencyVOS.add(new EfficiencyVO("沿街晾晒", 0, 0.0)); |
| | | efficiencyVOS.add(new EfficiencyVO("无照经营游商", 0, 0.0)); |
| | | efficiencyVOS.add(new EfficiencyVO("违规撑伞", 0, 0.0)); |
| | | return CommonResult.success(efficiencyVOS); |
| | | } |
| | | |
| | |
| | | |
| | | import com.ycl.mapper.apidata.ApiDataMapper; |
| | | import com.ycl.service.apidata.IApiDataService; |
| | | import com.ycl.vo.cockpit.aiIot.EfficiencyVO; |
| | | import com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | @Override |
| | | public List<StatisticsEventsVO.ArithmeticVO> arithmeticEvent(Integer streetId, String beginTime, String endTime) { |
| | | List<StatisticsEventsVO.ArithmeticVO> list = apiDataMapper.arithmeticEvent(streetId, beginTime, endTime); |
| | | list.add(new StatisticsEventsVO.ArithmeticVO("店外经营", 0, 0.0)); |
| | | list.add(new StatisticsEventsVO.ArithmeticVO("沿街晾晒", 0, 0.0)); |
| | | list.add(new StatisticsEventsVO.ArithmeticVO("无照经营游商", 0, 0.0)); |
| | | list.add(new StatisticsEventsVO.ArithmeticVO("违规撑伞", 0, 0.0)); |
| | | Integer all = list.stream().flatMapToInt(o -> IntStream.of(o.getCount())).sum(); |
| | | list.stream().forEach(o -> { |
| | | o.setRatio(new BigDecimal(((double) o.getCount() / (double) all)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); |
| | |
| | | package com.ycl.vo.cockpit.aiIot; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.ToString; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ToString |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class EfficiencyVO { |
| | | @ApiModelProperty(value = "物联网设备类型") |
| | | private String type; |