From 51603d9354ddef5d8960fe0e6b3e21059da5ff66 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期四, 08 一月 2026 15:53:00 +0800
Subject: [PATCH] 数量检测提交1-页面数据交互
---
fzzy-igdss-web/src/main/java/com/fzzy/security/manager/SecManager.java | 140 +++++++++++++++++++++++++++++++++++++---------
1 files changed, 113 insertions(+), 27 deletions(-)
diff --git a/fzzy-igdss-web/src/main/java/com/fzzy/security/manager/SecManager.java b/fzzy-igdss-web/src/main/java/com/fzzy/security/manager/SecManager.java
index 5b8e9b8..3833576 100644
--- a/fzzy-igdss-web/src/main/java/com/fzzy/security/manager/SecManager.java
+++ b/fzzy-igdss-web/src/main/java/com/fzzy/security/manager/SecManager.java
@@ -5,20 +5,16 @@
import com.fzzy.igds.camera.data.ApiCameraData;
import com.fzzy.igds.camera.data.ApiCameraResp;
import com.fzzy.igds.constant.RespCodeEnum;
-import com.fzzy.igds.data.PageResponse;
-import com.fzzy.igds.data.PatrolSuperData;
-import com.fzzy.igds.domain.Camera;
-import com.fzzy.igds.domain.Dept;
-import com.fzzy.igds.domain.Patrol;
-import com.fzzy.igds.domain.PatrolRecord;
-import com.fzzy.igds.service.CoreDeptService;
-import com.fzzy.igds.service.PatrolService;
-import com.fzzy.igds.service.SecCameraService;
+import com.fzzy.igds.data.*;
+import com.fzzy.igds.domain.*;
+import com.fzzy.igds.service.*;
import com.fzzy.igds.utils.ContextUtil;
import com.fzzy.igds.utils.DateUtil;
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;
import java.util.Date;
import java.util.HashMap;
@@ -35,6 +31,8 @@
public class SecManager {
@Resource
+ private CommonManager commonManager;
+ @Resource
private SecCameraService secCameraService;
@Resource
private ApiCameraManager apiCameraManager;
@@ -43,22 +41,23 @@
@Resource
private CoreDeptService coreDeptService;
@Resource
- private CommonManager commonManager;
+ private QuantityService quantityService;
+ @Resource
+ private FileService fileService;
/**
- *
* @param deptId
* @param companyId
* @return
*/
public List<Camera> listCamera(String deptId, String companyId) {
- if (null == deptId){
+ if (null == deptId) {
return null;
}
List<Camera> list = secCameraService.getCameraByDeptId(companyId, deptId);
- if (null == list || list.isEmpty()){
+ if (null == list || list.isEmpty()) {
return null;
}
@@ -67,6 +66,7 @@
/**
* 鏍规嵁鐩戞帶ID鑾峰彇鐩戞帶淇℃伅
+ *
* @param companyId
* @param cameraId
* @return
@@ -75,7 +75,7 @@
if (StringUtils.isEmpty(companyId)) {
companyId = ContextUtil.getCompanyId();
}
- if (StringUtils.isEmpty(cameraId)){
+ if (StringUtils.isEmpty(cameraId)) {
return null;
}
return secCameraService.getCameraById(companyId, cameraId);
@@ -83,6 +83,7 @@
/**
* 鑾峰彇鎾斁淇℃伅
+ *
* @param param
* @return
*/
@@ -95,8 +96,8 @@
// 鏍规嵁id鑾峰彇璁惧淇℃伅
Camera camera = secCameraService.getCameraById(ContextUtil.getCompanyId(), param.getId());
- if(null == camera){
- log.error("缂撳瓨涓病鏈夎幏鍙栧埌鎽勫儚澶翠俊鎭�"+ param.toString());
+ if (null == camera) {
+ log.error("缂撳瓨涓病鏈夎幏鍙栧埌鎽勫儚澶翠俊鎭�" + param.toString());
return new ApiCameraResp("ERROR", "缂撳瓨涓病鏈夎幏鍙栧埌鎽勫儚澶翠俊鎭紒");
}
@@ -125,12 +126,13 @@
/**
* 浜戝彴鎺у埗
+ *
* @param param
* @return
*/
public ApiCameraResp ptzMedia(ApiCameraData param) {
- if(StringUtils.isEmpty(param.getCompanyId())){
+ if (StringUtils.isEmpty(param.getCompanyId())) {
param.setCompanyId(ContextUtil.getCompanyId());
}
return apiCameraManager.getApiCameraService(param.getPtzType()).ptzMedia(param);
@@ -138,6 +140,7 @@
/**
* 棰勭疆浣嶈缃�
+ *
* @param param
* @return
*/
@@ -146,7 +149,6 @@
}
/**
- *
* @param params
* @return
*/
@@ -162,19 +164,20 @@
}
secCameraService.refreshCache(ContextUtil.getCompanyId());
- return new PageResponse<>(RespCodeEnum.CODE_0000, "鎵ц鎴愬姛锛侊紒");
+ return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "鎵ц鎴愬姛锛侊紒");
}
/**
* 宸℃缁熻
+ *
* @return
*/
public PatrolSuperData patrolTrack() {
PatrolSuperData patrolSuperData = new PatrolSuperData();
List<Dept> deptList = coreDeptService.getDeptData();
- if(null == deptList || deptList.isEmpty()){
- return patrolSuperData;
+ if (null == deptList || deptList.isEmpty()) {
+ return patrolSuperData;
}
//搴撳尯杞崲
@@ -185,7 +188,7 @@
List<Patrol> weekList = patrolService.getWeekList();
- if(null != weekList && weekList.size() > 0){
+ if (null != weekList && weekList.size() > 0) {
Date start = DateUtil.getCurZero(DateUtil.getNewByDay(new Date(), -1)); //鏄ㄥぉ闆剁偣闆跺垎
Date end = DateUtil.getCurZero(new Date()); //浠婂ぉ闆剁偣闆跺垎
for (Patrol patrol : weekList) {
@@ -193,13 +196,13 @@
patrolSuperData.setWeekSum(patrolSuperData.getWeekSum() + 1);
//鏄ㄥぉ浜烘
- if(patrol.getCreateTime().after(start) && patrol.getCreateTime().before(end)){
+ if (patrol.getCreateTime().after(start) && patrol.getCreateTime().before(end)) {
patrolSuperData.setYesterdaySum(patrolSuperData.getYesterdaySum() + 1);
}
//褰撳ぉ缁熻
- if(patrol.getCreateTime().after(end)){
- if(map.get(patrol.getDeptId()) == 0){
+ if (patrol.getCreateTime().after(end)) {
+ if (map.get(patrol.getDeptId()) == 0) {
patrolSuperData.setIsDeptNum(patrolSuperData.getIsDeptNum() + 1);
map.put(patrol.getDeptId(), map.get(patrol.getDeptId()) + 1);
}
@@ -221,13 +224,96 @@
List<PatrolRecord> patrolRecords = patrolService.getRecordByPatrolId(patrolId);
- if(null != patrolRecords && !patrolRecords.isEmpty()){
+ if (null != patrolRecords && !patrolRecords.isEmpty()) {
//鍒ゆ柇鏂囦欢鏄惁瀛樺湪
for (PatrolRecord record : patrolRecords) {
- record.setImgName(commonManager.isImgExit( record.getImgName(), null));
+ record.setImgName(commonManager.isImgExit(record.getImgName(), null));
}
}
return patrolRecords;
}
+
+ /**
+ * 鑾峰彇鏁伴噺妫�娴嬮厤缃俊鎭�
+ *
+ * @param deptId
+ * @return
+ */
+ public List<QuantityConf> getQuantityConfByDeptId(String deptId) {
+
+ return quantityService.getConfList(ContextUtil.getCompanyId(), deptId);
+ }
+
+ /**
+ * 鏌ヨ鏁伴噺妫�娴嬭褰曪紝榛樿鏌ヨ4鏉�
+ *
+ * @param param
+ * @return
+ */
+ public PageResponse<List<Quantity>> quantityList(IgdsBaseParam param) {
+
+ if (StringUtils.isEmpty(param.getDepotId())) {
+ return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), "鍙傛暟涓虹┖锛侊紒");
+ }
+
+ List<Quantity> quantityList = quantityService.getQuantityList(param.getDepotId(), 4);
+ if (null == quantityList || quantityList.isEmpty()) {
+ return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), "鏁版嵁涓虹┖锛侊紒");
+ }
+
+ return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "鎵ц鎴愬姛锛侊紒", quantityList);
+ }
+
+ /**
+ * 鏌ヨ鏁伴噺妫�娴嬭褰曪紝榛樿鏌ヨ7鏉★紝灏佽鎴愬浘琛ㄤ俊鎭�
+ *
+ * @param param
+ * @return
+ */
+ public PageResponse<GroupIndexData> getQuantityChart(IgdsBaseParam param) {
+
+ if (StringUtils.isEmpty(param.getDepotId())) {
+ return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), "鍙傛暟涓虹┖锛侊紒");
+ }
+
+
+ List<Quantity> quantityList = quantityService.getQuantityList(param.getDepotId(), 7);
+ if (null == quantityList || quantityList.isEmpty()) {
+ return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), "鏁版嵁涓虹┖锛侊紒");
+ }
+
+ GroupIndexData data = new GroupIndexData();
+
+ for (int i = (quantityList.size() - 1); i >= 0; i--) {
+ data.getXaxis().add(DateFormatUtils.format(quantityList.get(i).getReceiveDate(), "MM-dd HH:mm"));
+ data.getSeriesData().add(quantityList.get(i).getWeight() + "");
+ }
+
+ return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "鎵ц鎴愬姛锛侊紒", data);
+ }
+
+ /**
+ * 鏌ヨ妫�娴嬫暟鎹搴旀姄鍥�
+ * @param param
+ * @return
+ */
+ public PageResponse<List<FileInfo>> getQuantityFiles(IgdsBaseParam param) {
+
+ if (StringUtils.isEmpty(param.getKey())) {
+ return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), "鍙傛暟涓虹┖锛侊紒");
+ }
+
+ List<FileInfo> fileList = fileService.listFile(null, param.getKey());
+ if (null == fileList || fileList.isEmpty()) {
+ return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), "鏁版嵁涓虹┖锛侊紒");
+ }
+
+ //鍒ゆ柇鏂囦欢鏄惁瀛樺湪
+ for (FileInfo fileInfo : fileList) {
+ fileInfo.setFilePath(commonManager.isImgExit(fileInfo.getFilePath(), null));
+ }
+
+ return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "鎵ц鎴愬姛锛侊紒", fileList);
+ }
}
--
Gitblit v1.9.3