From c3019597126f19e8508bd22e7da3a39058033510 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 23 一月 2025 11:41:24 +0800
Subject: [PATCH] bug修改

---
 applet/src/main/java/com/jilongda/applet/controller/TLineUpController.java |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/applet/src/main/java/com/jilongda/applet/controller/TLineUpController.java b/applet/src/main/java/com/jilongda/applet/controller/TLineUpController.java
index 1f63022..5ba76d3 100644
--- a/applet/src/main/java/com/jilongda/applet/controller/TLineUpController.java
+++ b/applet/src/main/java/com/jilongda/applet/controller/TLineUpController.java
@@ -19,6 +19,8 @@
 
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * <p>
@@ -52,6 +54,7 @@
     public ApiResult add(@Validated @RequestBody TLineUp dto) {
         // 获取当天该门店的排号
         long count = tLineUpService.count(Wrappers.lambdaQuery(TLineUp.class)
+                .likeRight(TLineUp::getCreateTime, LocalDate.now())
                 .eq(TLineUp::getStoreId, dto.getStoreId()));
         dto.setStatus(1);
         dto.setUserId(loginInfoUtil.getUserId());
@@ -64,25 +67,33 @@
     @GetMapping(value = "/getUserLineUpByStoreId")
     public ApiResult getUserLineUpByStoreId(@RequestParam Integer storeId) {
         long userId = loginInfoUtil.getUserId();
+        List<Integer> list = Arrays.asList(1, 2);
+
         TLineUp lineUp = tLineUpService.getOne(Wrappers.lambdaQuery(TLineUp.class)
                 .eq(TLineUp::getUserId, userId)
                 .eq(TLineUp::getStoreId, storeId)
-                .eq(TLineUp::getStatus, 1)
+                .in(TLineUp::getStatus, list)
                 .orderByDesc(TLineUp::getCreateTime)
                 .last("LIMIT 1"));
         TLineUpVO tLineUpVO = new TLineUpVO();
         if (lineUp!=null){
             BeanUtils.copyProperties(lineUp, tLineUpVO);
+            long count = tLineUpService.count(Wrappers.lambdaQuery(TLineUp.class)
+                    .eq(TLineUp::getStoreId, storeId)
+                    .eq(TLineUp::getStatus, 1)
+                    .lt(lineUp!=null,TLineUp::getCode, lineUp.getCode())
+                    .likeRight(TLineUp::getCreateTime, LocalDate.now()));
+            tLineUpVO.setLinUpCount(count);
+
+        }else{
+            long count = tLineUpService.count(Wrappers.lambdaQuery(TLineUp.class)
+                    .eq(TLineUp::getStoreId, storeId)
+                    .eq(TLineUp::getStatus, 1)
+                    .likeRight(TLineUp::getCreateTime, LocalDate.now()));
+            tLineUpVO.setLinUpCount(count);
         }
-        long count = tLineUpService.count(Wrappers.lambdaQuery(TLineUp.class)
-                .eq(TLineUp::getStoreId, storeId)
-                .eq(TLineUp::getStatus, 1)
-                .lt(TLineUp::getCode, lineUp.getCode())
-                .likeRight(TLineUp::getCreateTime, LocalDate.now()));
-        tLineUpVO.setLinUpCount(count);
         return ApiResult.success(tLineUpVO);
     }
-
     @ApiOperation(value = "取消排号")
     @GetMapping(value = "/cancelLineUp")
     public ApiResult cancelLineUp(@RequestParam Integer id) {

--
Gitblit v1.7.1