bug
luoyisheng
2025-02-24 ccd758bcd9b357b365c28f62efde203faa83fb93
medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppMwCollectRecordController.java
@@ -219,7 +219,9 @@
    public R<List<HospitalCollectTotalUpDto>> tanscollecttotal2(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) {
        SysUser  sysUser = SecurityUtils.getLoginUser().getUser();
        //先获取医院ids
        List<MwCollectRecord> list = collectRecordService.lambdaQuery().eq(date!=null,MwCollectRecord::getCheckoutTime,date).eq(MwCollectRecord::getCheckoutUserId, sysUser.getUserId()).groupBy(MwCollectRecord::getDepartmentId).list();
        List<MwCollectRecord> list = collectRecordService.lambdaQuery().ge(MwCollectRecord::getCheckoutTime, date.atStartOfDay())
                .le(MwCollectRecord::getCheckoutTime, date.atTime(23,59,59))
                .eq(MwCollectRecord::getCheckoutUserId, sysUser.getUserId()).groupBy(MwCollectRecord::getDepartmentId).list();
        //循环医院,然后放入
        List<HospitalCollectTotalUpDto> list1 = new ArrayList<>();
        for (MwCollectRecord mwCollectRecord : list) {
@@ -263,7 +265,7 @@
            return R.ok();
        }
        MwTransitCar byId = carService.getById(one.getCarId());
        SysUser one1 = userService.lambdaQuery().eq(SysUser::getCarId, byId.getId()).one();
        SysUser one1 = userService.lambdaQuery().eq(SysUser::getCarId, byId.getId()).last("limit 1").one();
        CarDto carDto = new CarDto();
        carDto.setLicensePlateNumber(byId.getLicensePlateNumber());
        carDto.setUserName(one1.getUserName());
@@ -465,6 +467,9 @@
    public R<List<CollectTotalUpDto>> collecttotal1(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) {
        SysUser  sysUser = SecurityUtils.getLoginUser().getUser();
        SysUser byId = userService.getById(sysUser.getUserId());
        if (date==null){
            date = LocalDate.now();
        }
        return R.ok(collectRecordService.collectTotal(date,byId.getDepartmentId()));
    }
    @ApiOperation("收集统计下")
@@ -472,8 +477,12 @@
    public R<Page<MwCollectRecord>> collecttotal2(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date,@RequestParam Integer pageNum, @RequestParam Integer pageSize) {
        SysUser  sysUser = SecurityUtils.getLoginUser().getUser();
        SysUser byId = userService.getById(sysUser.getUserId());
        Page<MwCollectRecord> page = collectRecordService.lambdaQuery().eq(date!=null,MwCollectRecord::getCollectTime,date).eq(MwCollectRecord::getDepartmentId, byId.getDepartmentId()).orderByDesc(MwCollectRecord::getCollectTime).page(Page.of(pageNum, pageSize));
        Page<MwCollectRecord> page = collectRecordService.lambdaQuery()
                .ge(MwCollectRecord::getCreateTime, date.atStartOfDay())
                .le(MwCollectRecord::getCreateTime, date.atTime(23,59,59))
            .eq(MwCollectRecord::getDepartmentId, byId.getDepartmentId())
            .orderByDesc(MwCollectRecord::getCollectTime)
            .page(Page.of(pageNum, pageSize));
        return R.ok(page);
    }