From 63ebfa1f84071ced4066e0d88f5983490518c649 Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Fri, 24 May 2024 20:19:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=97=A8=E6=9E=B6=E7=89=8C?= =?UTF-8?q?=E8=AF=86=E6=B5=81=E6=B0=B4=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/OdsTollViuDataController.java | 38 +++++++++++++++++++ .../service/IOdsTollViuDataService.java | 5 +++ .../impl/OdsTollViuDataServiceImpl.java | 18 +++++++++ 3 files changed, 61 insertions(+) create mode 100644 zc-business/src/main/java/com/zc/business/controller/OdsTollViuDataController.java diff --git a/zc-business/src/main/java/com/zc/business/controller/OdsTollViuDataController.java b/zc-business/src/main/java/com/zc/business/controller/OdsTollViuDataController.java new file mode 100644 index 00000000..0ca07452 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/OdsTollViuDataController.java @@ -0,0 +1,38 @@ +package com.zc.business.controller; + + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.zc.business.service.IOdsTollViuDataService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * 门架牌识流水数据接口 + */ +@Api(tags = {"门架牌识流水数据接口"}) +@RestController +@RequestMapping("/business/odsTollViuData") +public class OdsTollViuDataController extends BaseController { + + @Resource + private IOdsTollViuDataService iOdsTollViuDataService; + + + /** + * 当天门架牌识流水数据统计 + * + * @return 查询结果 + */ + @ApiOperation("门架牌识流水数据统计") + @GetMapping("/countNumber") + public AjaxResult odsTollViuDataCountNumber() { + return AjaxResult.success(iOdsTollViuDataService.odsTollViuDataCountNumber()); + } + +} diff --git a/zc-business/src/main/java/com/zc/business/service/IOdsTollViuDataService.java b/zc-business/src/main/java/com/zc/business/service/IOdsTollViuDataService.java index 83952a80..d349f42c 100644 --- a/zc-business/src/main/java/com/zc/business/service/IOdsTollViuDataService.java +++ b/zc-business/src/main/java/com/zc/business/service/IOdsTollViuDataService.java @@ -8,4 +8,9 @@ import com.zc.business.domain.OdsTollViuData; * @author xiepufeng */ public interface IOdsTollViuDataService extends IService { + + /** + * 当天门架牌识流水数据统计 + */ + int odsTollViuDataCountNumber(); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/OdsTollViuDataServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/OdsTollViuDataServiceImpl.java index 4135cf79..d836ba1e 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/OdsTollViuDataServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/OdsTollViuDataServiceImpl.java @@ -1,5 +1,6 @@ package com.zc.business.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.annotation.DataSource; import com.ruoyi.common.enums.DataSourceType; @@ -8,6 +9,9 @@ import com.zc.business.mapper.OdsTollViuDataMapper; import com.zc.business.service.IOdsTollViuDataService; import org.springframework.stereotype.Service; +import java.time.LocalDate; +import java.time.LocalDateTime; + /** * 门架牌识流水数据 */ @@ -15,4 +19,18 @@ import org.springframework.stereotype.Service; @DataSource(value = DataSourceType.SLAVE)//切换数据源 public class OdsTollViuDataServiceImpl extends ServiceImpl implements IOdsTollViuDataService { + + /** + * 当天门架牌识流水数据统计 + * @return + */ + @Override + public int odsTollViuDataCountNumber() { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + LocalDateTime startOfDay = LocalDate.now().atStartOfDay(); + LocalDateTime endOfDay = LocalDate.now().atTime(23, 59, 59); + // 查询当天 门架牌识流水数据 + queryWrapper.between(OdsTollViuData::getPictime, startOfDay, endOfDay); + return count(queryWrapper); + } }