xuhy
2025-01-10 d1632e46b772d691e55b4013585bfe61164b8bde
applet/src/main/java/com/jilongda/applet/controller/TLineUpController.java
@@ -52,6 +52,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());
@@ -67,20 +68,28 @@
        TLineUp lineUp = tLineUpService.getOne(Wrappers.lambdaQuery(TLineUp.class)
                .eq(TLineUp::getUserId, userId)
                .eq(TLineUp::getStoreId, storeId)
                .likeRight(TLineUp::getCreateTime, LocalDate.now())
                .eq(TLineUp::getStatus, 1)
                .orderByDesc(TLineUp::getCreateTime)
                .last("LIMIT 1"));
        TLineUpVO tLineUpVO = new TLineUpVO();
        BeanUtils.copyProperties(lineUp, 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);
        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);
        }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);
        }
        return ApiResult.success(tLineUpVO);
    }
    @ApiOperation(value = "取消排号")
    @GetMapping(value = "/cancelLineUp")
    public ApiResult cancelLineUp(@RequestParam Integer id) {