From 86e5b30bdc5505fdd446c0158867032c08f4f58e Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期三, 07 一月 2026 09:34:35 +0800
Subject: [PATCH] 监管大屏库区查询调整
---
fzzy-igdss-web/src/main/java/com/fzzy/group/manager/GroupManager.java | 148 ++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 138 insertions(+), 10 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..bd051f9 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.getDeptByUserType(null);
+ 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);
+ }
/**
* 澶у睆棣栭〉缁熻淇℃伅锛氫紒涓氭暟銆佸簱鍖烘暟銆佷粨搴撴暟銆佽川鎶间粨鏁般�佹暎绮強鎴愬搧绮暟銆佸垎鍝佺搴撳瓨鏁�
@@ -136,7 +225,7 @@
indexData.setCompanyNum(companyNum);
//搴撳尯鏁�
- List<Dept> deptList = deptService.listDept(null, param.getCompanyId(), null);
+ List<Dept> deptList = deptService.getDeptByUserType(null);
if (null != deptList) {
indexData.setDeptNum(deptList.size());
}
@@ -197,11 +286,12 @@
List<GroupDeptData> list = new ArrayList<>();
GroupDeptData deptData;
- List<Dept> deptList = deptService.getDeptData();
+ List<Dept> deptList = deptService.getDeptByUserType(null);
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());
@@ -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);
}
}
@@ -272,7 +379,7 @@
namePieChart.put(dicArea.getCode(), dicArea.getName());
}
}
- List<Dept> deptList = deptService.getDeptData();
+ List<Dept> deptList = deptService.getDeptByUserType(null);
if (null != deptList && !deptList.isEmpty()) {
//搴撳尯鎬绘暟
groupGisData.setDeptNum(deptList.size());
@@ -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