From d89a42213b4a32535e93185dedf41fe7a7fc1940 Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期五, 04 四月 2025 01:57:13 +0800
Subject: [PATCH] bug修改

---
 medicalWaste-admin/src/main/java/com/sinata/web/controller/applet/AppMwCollectRecordController.java |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 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 3e16a89..5163bef 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
@@ -243,10 +243,10 @@
 
     @ApiOperation(value = "运输统计上(医院数量)",tags = "运输人员")
     @PostMapping("/trans/collect/hospital/count")
-    public R<Long> tanscollecttotal12(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) {
+    public R<Integer> tanscollecttotal12(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) {
         SysUser  sysUser = SecurityUtils.getLoginUser().getUser();
-        Long count = collectRecordService.lambdaQuery().eq(date!=null,MwCollectRecord::getCheckoutTime,date).eq(MwCollectRecord::getCheckoutUserId, sysUser.getUserId()).groupBy(MwCollectRecord::getDepartmentId).count();
-        return R.ok(count);
+        List<MwCollectRecord> list = collectRecordService.lambdaQuery().ge(date != null, MwCollectRecord::getCheckoutTime, date.atStartOfDay()).le(date != null, MwCollectRecord::getCheckoutTime, date.atTime(23, 59, 59)).eq(MwCollectRecord::getCheckoutUserId, sysUser.getUserId()).groupBy(MwCollectRecord::getDepartmentId).list();
+        return R.ok(list.size());
     }
 
     @ApiOperation(value = "运输统计下",tags = "运输人员")
@@ -272,7 +272,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();
@@ -294,7 +293,6 @@
     @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();
@@ -303,7 +301,7 @@
         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);
     }
 
@@ -311,7 +309,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();
@@ -503,6 +500,14 @@
         return R.ok(list);
     }
 
+    @ApiOperation("库存详情")
+    @PostMapping("/record1")
+    public R<List<MwCollectRecord>> record1(@RequestParam String boxNumber) {
+        List<MwCollectRecord> list = collectRecordService.lambdaQuery().isNull(MwCollectRecord::getCheckoutTime).eq(MwCollectRecord::getBoxNumber, boxNumber).orderByDesc(MwCollectRecord::getCollectTime).list();
+        return R.ok(list);
+    }
+
+
     @ApiOperation("收集统计上")
     @PostMapping("/collect/total")
     public R<List<CollectTotalUpDto>> collecttotal1(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) {
@@ -519,8 +524,8 @@
         SysUser  sysUser = SecurityUtils.getLoginUser().getUser();
         SysUser byId = userService.getById(sysUser.getUserId());
         Page<MwCollectRecord> page = collectRecordService.lambdaQuery()
-                .ge(MwCollectRecord::getCreateTime, date.atStartOfDay())
-                .le(MwCollectRecord::getCreateTime, date.atTime(23,59,59))
+                .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));

--
Gitblit v1.7.1