From f2889bd1adbd3021f6ca0c596eb8633d41c79cfb Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期五, 29 五月 2026 11:36:02 +0800
Subject: [PATCH] 报表数据

---
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/InoutRecordServiceImpl.java |   61 +++++++++++++++++++++---------
 1 files changed, 42 insertions(+), 19 deletions(-)

diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/InoutRecordServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/InoutRecordServiceImpl.java
index cb579b2..a4d1e82 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/InoutRecordServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/InoutRecordServiceImpl.java
@@ -7,9 +7,11 @@
 import com.doumee.core.utils.DateUtil;
 import com.doumee.core.utils.Utils;
 import com.doumee.dao.business.CategoryMapper;
+import com.doumee.dao.business.InoutDayCountMapper;
 import com.doumee.dao.business.InoutRecordMapper;
 import com.doumee.dao.business.dto.InParkDataDTO;
 import com.doumee.dao.business.model.Category;
+import com.doumee.dao.business.model.InoutDayCount;
 import com.doumee.dao.business.model.InoutRecord;
 import com.doumee.dao.business.model.Member;
 import com.doumee.dao.business.vo.GeneralDataVO;
@@ -56,6 +58,9 @@
 
     @Autowired
     private CategoryMapper categoryMapper;
+
+    @Autowired
+    private InoutDayCountMapper inoutDayCountMapper;
 
     @Override
     public Integer create(InoutRecord inoutRecord) {
@@ -398,7 +403,7 @@
                 maxMonth =  DateUtil.getNowMonthNum();
             }
             for (int i = maxMonth; i >0 ; i--) {
-                dateList.add(DateUtil.getNowYearNum()+"-"+ StringUtils.leftPad(i+"",2,"0"));
+                dateList.add(inParkDataDTO.getDateStr()+"-"+ StringUtils.leftPad(i+"",2,"0"));
             }
         }else {
             //鏃ユ湡
@@ -554,25 +559,43 @@
     @Override
     public TelecomInParkDataVO getInParkDataForTelecom(){
         TelecomInParkDataVO telecomInParkDataVO = new TelecomInParkDataVO();
-        telecomInParkDataVO.setInCarNum(
-                inoutRecordMapper.selectCount(new MPJLambdaWrapper<InoutRecord>()
-                .selectAll(InoutRecord.class)
-                .eq(InoutRecord::getIsdeleted,Constants.ZERO)
-                .eq(InoutRecord::getInOrOut,Constants.ZERO)
-                .isNotNull(InoutRecord::getCarCode)
-                .apply(" ( DATE_FORMAT(CREATE_DATE, '%Y%m%d') = DATE_FORMAT(now(), '%Y%m%d') ) ")
-                .groupBy(InoutRecord::getCarCode)
-        ).intValue());
+        telecomInParkDataVO.setInCarNum(Constants.ZERO);
+        telecomInParkDataVO.setInUserNum(Constants.ZERO);
 
-        telecomInParkDataVO.setInUserNum(
-                inoutRecordMapper.selectCount(new MPJLambdaWrapper<InoutRecord>()
-                .selectAll(InoutRecord.class)
-                .eq(InoutRecord::getIsdeleted,Constants.ZERO)
-                .eq(InoutRecord::getInOrOut,Constants.ZERO)
-                .isNotNull(InoutRecord::getMemberPhone)
-                .apply(" ( DATE_FORMAT(CREATE_DATE, '%Y%m%d') = DATE_FORMAT(now(), '%Y%m%d') ) ")
-                 .groupBy(InoutRecord::getMemberPhone)
-        ).intValue());
+        InoutDayCount inoutDayCount = inoutDayCountMapper.selectOne(new QueryWrapper<InoutDayCount>()
+                .lambda()
+                .apply(" DATE(TIME_INFO) = CURDATE()  ")
+                .last(" limit 1 ")
+        );
+
+        if(Objects.nonNull(inoutDayCount)){
+            telecomInParkDataVO.setInUserNum(inoutDayCount.getInMemberNum());
+            telecomInParkDataVO.setInCarNum(inoutDayCount.getInCarNum());
+        }
+
+       /* List<InoutRecord> listCar = inoutRecordMapper.selectList(new MPJLambdaWrapper<InoutRecord>()
+                        .eq(InoutRecord::getIsdeleted,Constants.ZERO)
+                        .eq(InoutRecord::getInOrOut,Constants.ZERO)
+                        .isNotNull(InoutRecord::getCarCode)
+                        .apply(" ( DATE_FORMAT(CREATE_DATE, '%Y%m%d')  = DATE_FORMAT(now(), '%Y%m%d') ) "));
+        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(listCar)){
+            telecomInParkDataVO.setInCarNum(
+                    new HashSet<>(listCar.stream().map(i->i.getCarCode()).collect(Collectors.toList())).size()
+            );
+        }
+
+
+        List<InoutRecord> listUser = inoutRecordMapper.selectList(new MPJLambdaWrapper<InoutRecord>()
+                        .eq(InoutRecord::getIsdeleted,Constants.ZERO)
+                        .eq(InoutRecord::getInOrOut,Constants.ZERO)
+                        .isNotNull(InoutRecord::getMemberPhone)
+                        .apply(" ( DATE_FORMAT(CREATE_DATE, '%Y%m%d') = DATE_FORMAT(now(), '%Y%m%d') ) "));
+        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(listUser)){
+            telecomInParkDataVO.setInUserNum(
+                    new HashSet<>(listUser.stream().map(i->i.getMemberPhone()).collect(Collectors.toList())).size()
+            );
+        }*/
+
         return telecomInParkDataVO;
     }
 

--
Gitblit v1.9.3