fuliqi
2023-11-30 e5bf0d08d05f5c58224fe28cdf743a1bae88e3f0
ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java
@@ -51,7 +51,7 @@
    private IApiDataService iApiDataService;
    @Autowired
    public void setIApiDataService(IApiDataService apiDataService){
    public void setIApiDataService(IApiDataService apiDataService) {
        this.iApiDataService = apiDataService;
    }
@@ -91,16 +91,8 @@
    @GetMapping("/lot")
    public CommonResult<List<StatisticsEventsVO.LotVO>> lot(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        List<StatisticsEventsVO.LotVO> lotVOS = new ArrayList<>();
        StatisticsEventsVO.LotVO a = null;
        for (int i = 0; i < 4; i++) {
            a = new StatisticsEventsVO.LotVO();
            a.setName("团结屯");
            a.setType("摄像头");
            a.setCount(10);
            a.setRatio(new BigDecimal("-0.3").setScale(2, RoundingMode.HALF_UP));
            lotVOS.add(a);
        }
        List<StatisticsEventsVO.LotVO> lotVOS = iApiDataService.listLot(params.getStreetId(), params.getBeginTime(), params.getEndTime());
        return CommonResult.success(lotVOS);
    }
@@ -126,7 +118,7 @@
        StatisticsEventsVO.GridMemberVO a = null;
        for (int i = 0; i < 4; i++) {
            a = new StatisticsEventsVO.GridMemberVO();
            a.setRatio(new BigDecimal("0.20").setScale(2, RoundingMode.HALF_UP));
            a.setRatio(new BigDecimal("0.20").setScale(4, RoundingMode.HALF_UP));
            a.setName("团结屯");
            a.setCount(10);
            gridMemberVOS.add(a);
@@ -141,9 +133,9 @@
        StatisticsEventsVO.IndexSignsVO indexSignsVO = new StatisticsEventsVO.IndexSignsVO();
        indexSignsVO.setEvent(1);
        indexSignsVO.setGridMember(20);
        indexSignsVO.setCompletePercentage(new BigDecimal("0.60").setScale(2, RoundingMode.HALF_UP));
        indexSignsVO.setCompletePercentage(new BigDecimal("0.60").setScale(4, RoundingMode.HALF_UP));
        indexSignsVO.setEquipment(30);
        indexSignsVO.setAccuracy(new BigDecimal("0.80").setScale(2, RoundingMode.HALF_UP));
        indexSignsVO.setAccuracy(new BigDecimal("0.80").setScale(4, RoundingMode.HALF_UP));
        indexSignsVO.setTrigger(10);
        indexSignsVO.setLot(30);
        indexSignsVO.setLotOnline(10);
@@ -174,11 +166,8 @@
    @GetMapping("/arithmetic_event")
    public CommonResult<List<StatisticsEventsVO.ArithmeticVO>> arithmeticEvent(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        List<StatisticsEventsVO.ArithmeticVO> ls = new ArrayList<>();
        ls.add(new StatisticsEventsVO.ArithmeticVO("xx中队", 10, 0.1));
        ls.add(new StatisticsEventsVO.ArithmeticVO("xx中队", 20, 0.2));
        ls.add(new StatisticsEventsVO.ArithmeticVO("xx中队", 30, 0.3));
        ls.add(new StatisticsEventsVO.ArithmeticVO("xx中队", 40, 0.4));
        List<StatisticsEventsVO.ArithmeticVO> ls = iApiDataService.arithmeticEvent(params.getStreetId(), params.getBeginTime(), params.getEndTime());
        return CommonResult.success(ls);
    }
@@ -227,18 +216,35 @@
    @GetMapping("/team_index")
    public CommonResult<List<TeamIndex>> teamIndex(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        LambdaQueryWrapper<TeamConstruction> queryWrapper = new LambdaQueryWrapper<TeamConstruction>().eq(TeamConstruction::getStatus, 1).eq(TeamConstruction::getIsDelete, 0);
        List<TeamConstruction> list = teamConstructionService.list(queryWrapper);
        List<TeamIndex> teamIndexList = BeanUtil.copyToList(list, TeamIndex.class);
        // LambdaQueryWrapper<TeamConstruction> queryWrapper = new LambdaQueryWrapper<TeamConstruction>().eq(TeamConstruction::getStatus, 1).eq(TeamConstruction::getIsDelete, 0);
        // List<TeamConstruction> list = teamConstructionService.list(queryWrapper);
        // List<TeamIndex> teamIndexList = BeanUtil.copyToList(list, TeamIndex.class);
        // teamIndexList.forEach(o -> {
        //     o.setStepTimely(0.0);
        //     o.setStepDelayed(0.0);
        //     o.setStepOvertime(0.0);
        //     o.setHandleTimely(0.0);
        //     o.setHandleDelayed(0.0);
        //     o.setHandleOvertime(0.0);
        //     o.setNoHandle(0.0);
        // });
        List<TeamIndex> teamIndexList = teamConstructionService.teamIndex(params.getBeginTime(), params.getEndTime());
        teamIndexList.forEach(o -> {
            o.setStepTimely(0.6);
            o.setStepDelayed(0.3);
            o.setStepOvertime(0.1);
            o.setHandleTimely(0.6);
            o.setHandleDelayed(0.2);
            o.setHandleOvertime(0.1);
            o.setNoHandle(0.1);
            o.setAllocation(20 * ((double) o.getPunctualityCount() / (double) o.getAllCount())
                    + 18 * ((double) o.getOverCount() / (double) o.getAllCount())
                    + 15 * ((double) o.getNoHandleCount() / (double) o.getAllCount()));
            o.setHandle(20 * ((double) o.getPunctualityCount() / (double) o.getAllCount())
                    + 5 * ((double) o.getOverCount() / (double) o.getAllCount())
                    - 2 * ((double) o.getNoHandleCount() / (double) o.getAllCount()));
            o.setOnline(0.0);
            o.setDuration(0.0);
            o.setDistance(0.0);
        });
        return CommonResult.success(teamIndexList);
    }
}