From 1631a9cd06a9272dbc808551ce7f0682cde2ba71 Mon Sep 17 00:00:00 2001 From: luoyisheng <yangdongji@argo-ai.cn> Date: 星期五, 21 三月 2025 17:01:07 +0800 Subject: [PATCH] bug --- medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppMwCollectRecordController.java | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppMwCollectRecordController.java b/medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppMwCollectRecordController.java index 6e4a5db..25d98eb 100644 --- a/medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppMwCollectRecordController.java +++ b/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) { @@ -235,7 +237,6 @@ @ApiOperation(value = "扫码接收列表",tags = "处置人员") @PostMapping("/end/down/collect/total") public R<List<HospitalCollectTotalUp1Dto>> tanscollecttotal3(String boxNum) { - SysUser sysUser = SecurityUtils.getLoginUser().getUser(); MwCollectRecord one = collectRecordService.lambdaQuery().eq(MwCollectRecord::getBoxNumber, boxNum).eq(MwCollectRecord::getStatus, 2).last("limit 1").one(); if (one==null){ return R.ok(); @@ -257,16 +258,15 @@ @ApiOperation(value = "获取车辆",tags = "处置人员") @PostMapping("/end/down/collect/car") public R<CarDto> tanscollecttotal7(String boxNum) { - SysUser sysUser = SecurityUtils.getLoginUser().getUser(); MwCollectRecord one = collectRecordService.lambdaQuery().eq(MwCollectRecord::getBoxNumber, boxNum).eq(MwCollectRecord::getStatus, 2).last("limit 1").one(); if (one == null) { 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()); + carDto.setUserName(one1.getNickName()); return R.ok(carDto); } @@ -274,7 +274,6 @@ @ApiOperation(value = "扫码接收列表上获取医院",tags = "处置人员") @PostMapping("/end/down/collect/up") public R<SysDepartment> tanscollecttotal4(String boxNum) { - SysUser sysUser = SecurityUtils.getLoginUser().getUser(); MwCollectRecord one = collectRecordService.lambdaQuery().eq(MwCollectRecord::getBoxNumber, boxNum).eq(MwCollectRecord::getStatus, 2).last("limit 1").one(); if (one == null) { return R.ok(); @@ -475,7 +474,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::getCollectTime, date.atStartOfDay()) + .le(MwCollectRecord::getCollectTime, date.atTime(23,59,59)) + .eq(MwCollectRecord::getDepartmentId, byId.getDepartmentId()) + .orderByDesc(MwCollectRecord::getCollectTime) + .page(Page.of(pageNum, pageSize)); return R.ok(page); } -- Gitblit v1.7.1