From e3bdcdf9123bb69d77ce42dfcd255047c09edafc Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期日, 11 一月 2026 16:53:04 +0800
Subject: [PATCH] 出入库视频及车牌识别

---
 fzzy-igdss-web/src/main/java/com/fzzy/common/manager/CommonManager.java |   85 +++++++++++++++++++++++++++++++-----------
 1 files changed, 62 insertions(+), 23 deletions(-)

diff --git a/fzzy-igdss-web/src/main/java/com/fzzy/common/manager/CommonManager.java b/fzzy-igdss-web/src/main/java/com/fzzy/common/manager/CommonManager.java
index bc322ab..cc00fcc 100644
--- a/fzzy-igdss-web/src/main/java/com/fzzy/common/manager/CommonManager.java
+++ b/fzzy-igdss-web/src/main/java/com/fzzy/common/manager/CommonManager.java
@@ -3,8 +3,8 @@
 import com.fzzy.igds.constant.Constant;
 import com.fzzy.igds.constant.DepotType;
 import com.fzzy.igds.data.IgdsBaseParam;
-import com.fzzy.igds.data.MainData;
 import com.fzzy.igds.data.InoutParam;
+import com.fzzy.igds.data.MainData;
 import com.fzzy.igds.domain.*;
 import com.fzzy.igds.service.*;
 import com.fzzy.igds.utils.ContextUtil;
@@ -18,11 +18,13 @@
 import com.ruoyi.system.service.ISysDeptService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.time.DateFormatUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.LinkedHashMap;
+import java.util.List;
 
 /**
  * @Description
@@ -39,7 +41,7 @@
     private DicService dicService;
     @Resource
     private CoreDeptService coreDeptService;
-    @Autowired
+    @Resource
     private SecCameraService secCameraService;
     @Resource
     private ISysDeptService iSysDeptService;
@@ -57,6 +59,21 @@
     private EventInfoService eventInfoService;
     @Resource
     private SnapRecordService snapRecordService;
+    @Resource
+    private GatewaySerService gatewaySerService;
+
+    /**
+     * 鏍规嵁搴撳尯缂栫爜鑾峰彇搴撳尯缃戝叧淇℃伅
+     * @param deptId
+     * @return
+     */
+    public GatewaySer getGatewaySerByDeptId(String deptId) {
+        if(StringUtils.isBlank(deptId)){
+            deptId = ContextUtil.subDeptId(null);
+        }
+
+        return gatewaySerService.getCacheSerByDeptId(deptId);
+    }
 
     /**
      * 鏍规嵁搴撳尯缂栫爜鑾峰彇搴撳尯涓嬫墍鏈変粨搴撳垪琛�
@@ -112,16 +129,38 @@
      * @return
      */
     public List<Depot> listDepotByDeptId(String deptId) {
-        try{
+        try {
             if (StringUtils.isEmpty(deptId)) {
                 deptId = ContextUtil.subDeptId(null);
             }
 
             return depotService.getCacheDepotList(ContextUtil.getCompanyId(), deptId);
 
-        }catch (Exception e){
+        } catch (Exception e) {
             return null;
         }
+    }
+
+    /**
+     * 鏍规嵁浠撳簱绫诲瀷鑾峰彇搴撳尯涓嬩粨搴撳垪琛�
+     * @param deptId
+     * @param depotTypes  绫诲瀷澶氫釜锛岀敤閫楀彿闅斿紑
+     * @return
+     */
+    public List<Depot> listAllDepot(String deptId, String depotTypes) {
+
+        List<Depot> depots = this.listDepotByDeptId(deptId);
+        if(null == depots || depots.isEmpty()){
+            return null;
+        }
+
+        List<Depot> result = new ArrayList<>();
+        for (Depot depot : depots) {
+            if (depotTypes.contains(depot.getDepotType())) {
+                result.add(depot);
+            }
+        }
+        return result;
     }
 
     /**
@@ -133,13 +172,13 @@
 
 
     /**
-     * 鑾峰彇鍒嗗簱鍒楄〃
+     * 鏍规嵁鍏徃ID鑾峰彇鍏徃涓嬬殑鍒嗗簱鍒楄〃
      *
      * @author sgj
      * @date 2025/12/12
      */
-    public List<Dept> listDeptData() {
-        return coreDeptService.getDeptData();
+    public List<Dept> listDeptData(String parentId) {
+        return coreDeptService.getDeptByUserType(parentId);
     }
 
     /**
@@ -221,7 +260,7 @@
         for (int i = -29; i <= 0; i++) {
             mapMonthInNum.put(DateFormatUtils.format(DateUtil.getNewByDay(new Date(), i), "MM-dd"), 0);
             mapMonthOutNum.put(DateFormatUtils.format(DateUtil.getNewByDay(new Date(), i), "MM-dd"), 0);
-            if(i >=-6){
+            if (i >= -6) {
                 mapWeekInNum.put(DateFormatUtils.format(DateUtil.getNewByDay(new Date(), i), "MM-dd"), 0);
                 mapWeekOutNum.put(DateFormatUtils.format(DateUtil.getNewByDay(new Date(), i), "MM-dd"), 0);
                 mapWeekAiNum.put(DateFormatUtils.format(DateUtil.getNewByDay(new Date(), i), "MM-dd"), 0);
@@ -238,8 +277,8 @@
         if (null != listEvent && !listEvent.isEmpty()) {
             mainData.setAiNum(listEvent.size());
             for (EventInfo event : listEvent) {
-                key = DateFormatUtils.format(event.getTime(),"MM-dd");
-                if(null != mapWeekAiNum.get(key)){
+                key = DateFormatUtils.format(event.getTime(), "MM-dd");
+                if (null != mapWeekAiNum.get(key)) {
                     mapWeekAiNum.put(key, mapWeekAiNum.get(key) + 1);
                 }
             }
@@ -253,8 +292,8 @@
         List<SnapRecord> listSnap = snapRecordService.getListByParam(param);
         if (null != listSnap && !listSnap.isEmpty()) {
             for (SnapRecord snap : listSnap) {
-                key = DateFormatUtils.format(snap.getSnapTime(),"MM-dd");
-                if(null != mapWeekSnapNum.get(key)){
+                key = DateFormatUtils.format(snap.getSnapTime(), "MM-dd");
+                if (null != mapWeekSnapNum.get(key)) {
                     mapWeekSnapNum.put(key, mapWeekSnapNum.get(key) + 1);
                 }
             }
@@ -272,27 +311,27 @@
         List<InoutRecord> inoutRecords = inoutRecordService.listInout(inoutParam);
         if (null != inoutRecords && !inoutRecords.isEmpty()) {
             for (InoutRecord record : inoutRecords) {
-                key = DateFormatUtils.format(record.getRegisterTime(),"MM-dd");
-                if(Constant.TYPE_IN.equals(record.getType())){
-                    if(null != mapWeekInNum.get(key)){
+                key = DateFormatUtils.format(record.getRegisterTime(), "MM-dd");
+                if (Constant.TYPE_IN.equals(record.getType())) {
+                    if (null != mapWeekInNum.get(key)) {
                         mapWeekInNum.put(key, mapWeekInNum.get(key) + 1);
                     }
-                    if(null != mapMonthInNum.get(key)){
+                    if (null != mapMonthInNum.get(key)) {
                         mapMonthInNum.put(key, mapMonthInNum.get(key) + 1);
                     }
-                    if(key.equals(DateFormatUtils.format(new Date(),"MM-dd"))){
+                    if (key.equals(DateFormatUtils.format(new Date(), "MM-dd"))) {
                         mainData.setInNumDay(mainData.getInNumDay() + 1);
                         inSum += record.getRecordWeight();
                     }
                 }
-                if(Constant.TYPE_OUT.equals(record.getType())){
-                    if(null != mapWeekOutNum.get(key)){
+                if (Constant.TYPE_OUT.equals(record.getType())) {
+                    if (null != mapWeekOutNum.get(key)) {
                         mapWeekOutNum.put(key, mapWeekOutNum.get(key) + 1);
                     }
-                    if(null != mapMonthOutNum.get(key)){
+                    if (null != mapMonthOutNum.get(key)) {
                         mapMonthOutNum.put(key, mapMonthOutNum.get(key) + 1);
                     }
-                    if(key.equals(DateFormatUtils.format(new Date(),"MM-dd"))){
+                    if (key.equals(DateFormatUtils.format(new Date(), "MM-dd"))) {
                         mainData.setOutNumDay(mainData.getOutNumDay() + 1);
                         outSum += record.getRecordWeight();
                     }

--
Gitblit v1.9.3