|
|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.biutag.supervision.controller.datav; |
|
|
|
package com.biutag.supervision.controller.datav; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateTime; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.biutag.supervision.mapper.NegativeMapper; |
|
|
|
import com.biutag.supervision.mapper.NegativeMapper; |
|
|
|
@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Comparator; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Optional; |
|
|
|
import java.util.Optional; |
|
|
|
@ -32,9 +34,10 @@ public class DataVJwpyController { |
|
|
|
@GetMapping |
|
|
|
@GetMapping |
|
|
|
public Result<JSONObject> selectDistribution(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, |
|
|
|
public Result<JSONObject> selectDistribution(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, |
|
|
|
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){ |
|
|
|
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){ |
|
|
|
|
|
|
|
|
|
|
|
List<DistributionVo> list = negativeMapper.getDistributionByTime(beginTime,endTime); |
|
|
|
List<DistributionVo> list = negativeMapper.getDistributionByTime(beginTime,endTime); |
|
|
|
List<SupDictData> supDictDataList = supDictDataService.list( new LambdaQueryWrapper<SupDictData>().eq(SupDictData::getDictType,"businessType")); |
|
|
|
List<SupDictData> supDictDataList = supDictDataService.list( new LambdaQueryWrapper<SupDictData>().eq(SupDictData::getDictType,"businessType")); |
|
|
|
list.forEach(s->{ |
|
|
|
list.stream().sorted(Comparator.comparingInt(DistributionVo::getTotalNum).reversed()).forEach(s->{ |
|
|
|
Optional<SupDictData> supDictData = supDictDataList.stream().filter(v->v.getDictValue().equals(s.getName())).findFirst(); |
|
|
|
Optional<SupDictData> supDictData = supDictDataList.stream().filter(v->v.getDictValue().equals(s.getName())).findFirst(); |
|
|
|
supDictData.ifPresent(dictData -> s.setName(dictData.getDictLabel())); |
|
|
|
supDictData.ifPresent(dictData -> s.setName(dictData.getDictLabel())); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|