From d6cfbecac57cf88eb8f63bd9c260e41f49e1e381 Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期三, 11 十二月 2024 14:10:31 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

---
 pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientSv.java |   69 ++++++++++++++++++++++++++++++++++
 1 files changed, 68 insertions(+), 1 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientSv.java
index 1e5b1ad..5a61fcf 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientSv.java
@@ -4,8 +4,10 @@
 import com.dy.pipIrrGlobal.daoRm.RmClientAmountDayLastMapper;
 import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveHistoryMapper;
 import com.dy.pipIrrGlobal.daoSe.SeCardOperateMapper;
+import com.dy.pipIrrGlobal.daoSe.SeClientMapper;
 import com.dy.pipIrrGlobal.voSt.*;
 import com.dy.pipIrrStatistics.card.IcCardqo.CommonQO;
+import com.dy.pipIrrStatistics.card.qo.CardUsageQO;
 import com.dy.pipIrrStatistics.client.qo.*;
 import com.dy.pipIrrStatistics.intake.qo.ClientAmountQO;
 import lombok.extern.slf4j.Slf4j;
@@ -36,9 +38,10 @@
     private RmOpenCloseValveHistoryMapper rmOpenCloseValveHistoryMapper;
     @Autowired
     private SeCardOperateMapper seCardOperateMapper;
-
     @Autowired
     private RmClientAmountDayLastMapper rmClientAmountDayLastMapper;
+    @Autowired
+    private SeClientMapper seClientMapper;
 
     /**
      * 鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟瓒呰繃鎸囧畾鍊肩殑鍐滄埛
@@ -493,4 +496,68 @@
         rsVo.obj = rmClientAmountDayLastMapper.getMonthAmountAndMoney(params);
         return rsVo ;
     }
+
+    /**
+     * 鏈�杩戞湭鍏呭�肩殑鍐滄埛
+     * @param qo
+     * @return
+     */
+    public QueryResultVo<List<VoClient>> getNotRechargeLastClients(CommonQO qo) {
+        String timeStart = qo.getTimeStart();
+        if (timeStart != null && timeStart != ""){
+            timeStart = timeStart + " 00:00:00";
+            qo.setTimeStart(timeStart);
+        }
+        // 鐢熸垚鏌ヨ鍙傛暟
+        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ;
+
+        // 鑾峰彇绗﹀悎鏉′欢鐨勮褰曟暟
+        Long itemTotal = Optional.ofNullable(rmClientAmountDayLastMapper.getNotRechargeLastClientsCount(params)).orElse(0L);
+
+        QueryResultVo<List<VoClient>> rsVo = new QueryResultVo<>() ;
+
+        rsVo.pageSize = qo.pageSize ;
+        rsVo.pageCurr = qo.pageCurr ;
+
+        rsVo.calculateAndSet(itemTotal, params);
+        rsVo.obj = rmClientAmountDayLastMapper.getNotRechargeLastClients(params);
+        return rsVo ;
+    }
+
+    /**
+     * 鑾峰彇鎸囧畾鏃堕棿娈靛啘鎴凤細鍏呭�煎悎璁°�佹秷璐瑰悎璁°�佷綑棰�
+     * @param qo
+     * @return
+     */
+    public QueryResultVo<List<VoCardUsage>> getClientUsages(CardUsageQO qo) {
+
+        String timeStart = qo.getTimeStart();
+        String timeStop = qo.getTimeStop();
+
+        if (timeStart != null && timeStart != ""){
+            timeStart = timeStart + " 00:00:00";
+        }else {
+            timeStart = LocalDateTime.now().minusYears(1).toString();
+        }
+        if (timeStop != null && timeStop != ""){
+            timeStop = timeStop + " 23:59:59";
+        }else {
+            timeStop = LocalDateTime.now().toString();
+        }
+        qo.setTimeStart(timeStart);
+        qo.setTimeStop(timeStop);
+
+        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo);
+        // 鑾峰彇绗﹀悎鏉′欢鐨勮褰曟暟
+        Long itemTotal = Optional.ofNullable(seClientMapper.getClientUsagesCount(params)).orElse(0L);
+
+        QueryResultVo<List<VoCardUsage>> rsVo = new QueryResultVo<>() ;
+
+        rsVo.pageSize = qo.pageSize ;
+        rsVo.pageCurr = qo.pageCurr ;
+
+        rsVo.calculateAndSet(itemTotal, params);
+        rsVo.obj = seClientMapper.getClientUsages(params);
+        return rsVo ;
+    }
 }

--
Gitblit v1.8.0