From 97dfab42d2736e2e91035aad58ed01fc27ad3a7d Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期二, 06 一月 2026 11:30:30 +0800
Subject: [PATCH] 大屏视频逻辑调整

---
 fzzy-igdss-web/src/main/java/com/fzzy/group/manager/GroupManager.java |  142 +++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 135 insertions(+), 7 deletions(-)

diff --git a/fzzy-igdss-web/src/main/java/com/fzzy/group/manager/GroupManager.java b/fzzy-igdss-web/src/main/java/com/fzzy/group/manager/GroupManager.java
index 5247da8..d5cf8b1 100644
--- a/fzzy-igdss-web/src/main/java/com/fzzy/group/manager/GroupManager.java
+++ b/fzzy-igdss-web/src/main/java/com/fzzy/group/manager/GroupManager.java
@@ -1,19 +1,18 @@
 package com.fzzy.group.manager;
 
+import com.fzzy.common.manager.CommonManager;
 import com.fzzy.igds.constant.Constant;
 import com.fzzy.igds.constant.FoodVariety;
 import com.fzzy.igds.constant.RespCodeEnum;
 import com.fzzy.igds.data.*;
-import com.fzzy.igds.domain.Depot;
-import com.fzzy.igds.domain.Dept;
-import com.fzzy.igds.domain.DicArea;
-import com.fzzy.igds.domain.InoutRecord;
+import com.fzzy.igds.domain.*;
 import com.fzzy.igds.service.*;
 import com.fzzy.igds.utils.ContextUtil;
 import com.fzzy.igds.utils.DateUtil;
 import com.fzzy.igds.utils.NumberUtil;
 import com.ruoyi.common.utils.StringUtils;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.time.DateFormatUtils;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
@@ -30,6 +29,8 @@
 public class GroupManager {
 
     @Resource
+    private CommonManager commonManager;
+    @Resource
     private DicAreaService dicAreaService;
     @Resource
     private CoreDeptService deptService;
@@ -39,6 +40,12 @@
     private CoreCompanyService coreCompanyService;
     @Resource
     private InoutRecordService inoutRecordService;
+    @Resource
+    private EventInfoService eventInfoService;
+    @Resource
+    private SnapRecordService snapRecordService;
+    @Resource
+    private SecCameraService cameraService;
 
     /**
      * 鑾峰彇鐪佸強涓嬪睘甯傚窞闆嗗悎
@@ -111,15 +118,97 @@
     }
 
     /**
-     * 鑾峰彇缁勭粐涓嬫墍鏈夊簱鍖轰俊鎭�
+     * 鑾峰彇鐢ㄦ埛涓嬫墍鏈夊簱鍖轰俊鎭�
      *
+     * @return
+     */
+    public List<Dept> getDeptList() {
+        return deptService.getDeptByUserType(null);
+    }
+
+    /**
+     * 鑾峰彇搴撳尯灏佽淇℃伅
      * @param companyId
      * @return
      */
-    public List<Dept> getAllDept(String companyId) {
-        return deptService.listDept(null, companyId, null);
+    public List<GroupDeptData> getDeptData(String companyId) {
+
+        List<GroupDeptData> list = new ArrayList<>();
+        GroupDeptData deptData;
+        List<Dept> deptList = deptService.getDeptData();
+        if (null != deptList && !deptList.isEmpty()) {
+            List<Depot> depotList;
+            for (Dept dept : deptList) {
+                deptData = new GroupDeptData();
+                deptData.setDeptId(dept.getId());
+                deptData.setDeptName(dept.getKqmc());
+                deptData.setCode(dept.getXzqhdm());
+                deptData.setCounty(dept.getXzqhmc());
+                deptData.setJd(dept.getJd());
+                deptData.setWd(dept.getWd());
+
+                //缁熻浠撳簱鏁�
+                depotList = depotService.getCacheDepotList(dept.getCompanyId(), dept.getId());
+                if (null != depotList && !depotList.isEmpty()) {
+                    for (Depot depot : depotList) {
+                        deptData.setDepotNumber(deptData.getDepotNumber() + 1);
+
+                        if(StringUtils.isNotBlank(depot.getPledgeBank())){
+                            deptData.setDepotBankNumber(deptData.getDepotBankNumber() + 1);
+                        }
+
+                        if(null == depot.getStorageReal()){
+                            depot.setStorageReal(0.0);
+                        }
+                        deptData.setStorageNum(deptData.getStorageNum() + depot.getStorageReal()/1000);
+                    }
+                }
+
+                //缁熻鍑哄叆搴撴暟閲�
+                InoutParam inoutParam = new InoutParam();
+                inoutParam.setDeptId(dept.getId());
+                inoutParam.setCompanyId(companyId);
+                inoutParam.setStart(DateUtil.getCurZero(new Date()));
+                inoutParam.setEnd(DateUtil.getNextZero(new Date()));
+                List<InoutRecord> inoutRecords = inoutRecordService.listInout(inoutParam);
+                if (null != inoutRecords && !inoutRecords.isEmpty()) {
+                    for (InoutRecord inoutRecord : inoutRecords) {
+                        if (Constant.TYPE_IN.equals(inoutRecord.getType())) {
+                            deptData.setInNum(deptData.getInNum() + 1);
+                        }
+                        if (Constant.TYPE_OUT.equals(inoutRecord.getType())){
+                            deptData.setOutNum(deptData.getOutNum() + 1);
+
+                        }
+                    }
+                }
+
+                list.add(deptData);
+            }
+        }
+
+        return list;
     }
 
+    /**
+     * 鑾峰彇搴撳尯涓嬬洃鎺т俊鎭�
+     * @param param
+     * @return
+     */
+    public PageResponse<List<Camera>> cameraList(IgdsBaseParam param) {
+
+        if(StringUtils.isBlank(param.getDeptId())){
+            return new PageResponse<>(RespCodeEnum.CODE_2000, null);
+        }
+
+        if (StringUtils.isBlank(param.getCompanyId())){
+            param.setCompanyId(ContextUtil.getCompanyId());
+        }
+
+        List<Camera> listCamera = cameraService.getCameraByDeptId(param.getCompanyId(), param.getDeptId());
+
+        return new PageResponse<>(RespCodeEnum.CODE_0000, listCamera);
+    }
 
     /**
      * 澶у睆棣栭〉缁熻淇℃伅锛氫紒涓氭暟銆佸簱鍖烘暟銆佷粨搴撴暟銆佽川鎶间粨鏁般�佹暎绮強鎴愬搧绮暟銆佸垎鍝佺搴撳瓨鏁�
@@ -202,6 +291,7 @@
             List<Depot> depotList;
             for (Dept dept : deptList) {
                 deptData = new GroupDeptData();
+                deptData.setDeptId(dept.getId());
                 deptData.setDeptName(dept.getKqmc());
                 deptData.setCode(dept.getXzqhdm());
                 deptData.setCounty(dept.getXzqhmc());
@@ -243,6 +333,23 @@
                         }
                     }
                 }
+
+                //缁熻AI浜嬩欢鏁伴噺
+                IgdsBaseParam igdsParam = new IgdsBaseParam();
+                igdsParam.setDeptId(dept.getId());
+                igdsParam.setCompanyId(param.getCompanyId());
+                igdsParam.setStart(DateUtil.getNewByDay(new Date(), -6));
+                igdsParam.setEnd(DateUtil.getNextZero(new Date()));
+                List<EventInfo> enevtList = eventInfoService.getListByParam(igdsParam);
+                if (null != enevtList && !enevtList.isEmpty()) {
+                    deptData.setWarnNum7(enevtList.size());
+                    for (EventInfo eventInfo : enevtList) {
+                        if(DateFormatUtils.format(new Date(), "yyyyMMdd").equals(DateFormatUtils.format(eventInfo.getTime(), "yyyyMMdd"))){
+                            deptData.setDailyTotal(deptData.getDailyTotal() + 1);
+                        }
+                    }
+                }
+
                 list.add(deptData);
             }
         }
@@ -317,4 +424,25 @@
 
         return groupGisData;
     }
+
+    /**
+     * 澶у睆棣栭〉-鎶撴媿璺熻釜淇℃伅
+     * @param param
+     * @return
+     */
+    public PageResponse<List<SnapRecord>> indexSnapList(IgdsBaseParam param) {
+
+        param.setStart(DateUtil.getNewByDay(new Date(), -10));
+        param.setEnd(new Date());
+        List<SnapRecord> listSnap = snapRecordService.getListByParam(param);
+
+        if (null != listSnap && !listSnap.isEmpty()) {
+            //鍒ゆ柇鏂囦欢鏄惁瀛樺湪
+            for (SnapRecord record : listSnap) {
+                record.setImgName(commonManager.isImgExit( record.getImgName(), null));
+            }
+        }
+
+        return new PageResponse<>(RespCodeEnum.CODE_0000, listSnap);
+    }
 }

--
Gitblit v1.9.3