From 53024ef844835199ab74dbb27bfa10a290c96443 Mon Sep 17 00:00:00 2001
From: sgj <1442489573@qq.com>
Date: 星期一, 30 三月 2026 15:43:13 +0800
Subject: [PATCH] 质押还款提醒,库区错误提醒修复
---
fzzy-igdss-web/src/main/java/com/fzzy/group/manager/GroupManager.java | 484 ++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 454 insertions(+), 30 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..27c0461 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,24 +1,24 @@
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;
import java.text.DecimalFormat;
import java.util.*;
+import java.util.stream.Collectors;
/**
* @Description
@@ -30,6 +30,8 @@
public class GroupManager {
@Resource
+ private CommonManager commonManager;
+ @Resource
private DicAreaService dicAreaService;
@Resource
private CoreDeptService deptService;
@@ -39,6 +41,20 @@
private CoreCompanyService coreCompanyService;
@Resource
private InoutRecordService inoutRecordService;
+ @Resource
+ private EventInfoService eventInfoService;
+ @Resource
+ private SnapRecordService snapRecordService;
+ @Resource
+ private SecCameraService cameraService;
+ @Resource
+ private BankService bankService;
+ @Resource
+ private PledgeContractService pledgeContractService;
+ @Resource
+ private PledgeContractDepotService pledgeContractDepotService;
+ @Resource
+ private GatewaySerService gatewaySerService;
/**
* 鑾峰彇鐪佸強涓嬪睘甯傚窞闆嗗悎
@@ -110,16 +126,248 @@
return list;
}
+
+ public List<DicArea> getBankAndChildDept(String areaCode) {
+
+ DicArea area = dicAreaService.listDicAreaByCode(areaCode);
+ if (null == area) {
+ return null;
+ }
+ List<DicArea> areaChildren = new ArrayList<>();
+
+ List<DicArea> list = new ArrayList<>();
+ if (Constant.AREA_TYPE_1.equals(area.getType())) {
+ //鏌ヨ鎵�鏈夌殑璐ㄦ娂鍚堝悓
+ List<PledgeContract> pledgeContractList = pledgeContractService.listAll(null);
+ //鏌ヨ鎵�鏈夌殑搴撳尯
+ List<Dept> depotList = deptService.listDept(null, ContextUtil.getCompanyId(), null);
+ //鏌ヨ鎵�鏈夌殑閾惰
+ List<Bank> bankList = bankService.listAll(null);
+ DicArea defaultBank = new DicArea();
+ defaultBank.setCode("-1");
+ defaultBank.setName("鏃犺川鎶奸摱琛�");
+ defaultBank.setChildren(new ArrayList<>());
+
+ for (Dept dept : depotList) {
+ Boolean isPledge = false;
+ for (PledgeContract pledgeContract : pledgeContractList) {
+ IgdsBaseParam param = new IgdsBaseParam();
+ param.setParentId(pledgeContract.getId());
+ List<PledgeContractDepot> pledgeContractDepots = pledgeContractDepotService.listAll(param);
+ if (null == pledgeContractDepots || pledgeContractDepots.isEmpty()) {
+ continue;
+ }
+ //鎵惧埌pledgeContractDepots涓殑deptId闆嗗悎锛屽苟鍘婚噸
+ List<String> deptIdList = pledgeContractDepots.stream().map(PledgeContractDepot::getPledgeDept).distinct().collect(Collectors.toList());
+ if (deptIdList.contains(dept.getId())) {
+ //浠巐ist涓壘鍒板綋鍓嶈川鎶奸摱琛岀殑鏁版嵁
+ DicArea pledgeBank = null;
+ int indexBank = -1;
+ for (DicArea item : areaChildren) {
+ if (pledgeContract.getPledgeBank().equals(item.getCode())) {
+ pledgeBank = item;
+ indexBank = areaChildren.indexOf(pledgeBank);
+ break;
+ }
+ }
+ if (null == pledgeBank) {
+ //鏈壘鍒拌川鎶奸摱琛屾暟鎹垯鏂板缓
+ pledgeBank = new DicArea();
+ pledgeBank.setCode(pledgeContract.getPledgeBank());
+ pledgeBank.setName("璐ㄦ娂閾惰_" + pledgeContract.getPledgeBank());
+ //浠庨摱琛屾暟鎹腑鎵惧埌璐ㄦ娂閾惰鐨勪俊鎭�
+ for (Bank bank : bankList) {
+ if (pledgeContract.getPledgeBank().equals(bank.getId())) {
+ pledgeBank.setName(bank.getName());
+ }
+ }
+ //娣诲姞璐ㄦ娂閾惰涓嬬殑搴撳尯鏁版嵁
+ DicArea deptDic = new DicArea();
+ deptDic.setCode(dept.getId());
+ deptDic.setName(dept.getKqmc());
+
+ List<DicArea> children = pledgeBank.getChildren();
+ if (null == children) {
+ pledgeBank.setChildren(new ArrayList<>());
+ }
+ pledgeBank.getChildren().add(deptDic);
+ //鏂板璐ㄦ娂閾惰鏁版嵁鍒發ist涓�
+ areaChildren.add(pledgeBank);
+ isPledge = true;
+ break;
+ } else {
+ //娣诲姞璐ㄦ娂閾惰涓嬬殑搴撳尯鏁版嵁
+ DicArea deptDic = new DicArea();
+ deptDic.setCode(dept.getId());
+ deptDic.setName(dept.getKqmc());
+
+ List<DicArea> children = pledgeBank.getChildren();
+ if (null == children) {
+ pledgeBank.setChildren(new ArrayList<>());
+ }
+ pledgeBank.getChildren().add(deptDic);
+ //鏇存柊list涓殑璐ㄦ娂閾惰鏁版嵁
+ areaChildren.set(indexBank, pledgeBank);
+ isPledge = true;
+ break;
+ }
+ }
+
+ }
+ if (!isPledge) {
+ DicArea deptDic = new DicArea();
+ deptDic.setCode(dept.getId());
+ deptDic.setName(dept.getKqmc());
+
+ List<DicArea> children = defaultBank.getChildren();
+ if (null == children) {
+ defaultBank.setChildren(new ArrayList<>());
+ }
+ defaultBank.getChildren().add(deptDic);
+ }
+ }
+ List<DicArea> defaultBankChildren = defaultBank.getChildren();
+ if (defaultBankChildren.size() > 0) {
+ areaChildren.add(defaultBank);
+ }
+ area.setChildren(areaChildren);
+ }
+ list.add(area);
+ return list;
+ }
+
/**
- * 鑾峰彇缁勭粐涓嬫墍鏈夊簱鍖轰俊鎭�
+ * 鑾峰彇鐢ㄦ埛涓嬫墍鏈夊簱鍖轰俊鎭�
+ *
+ * @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 companyId
+ * @return
+ */
+ public List<GroupDepotData> getDepotData(String companyId) {
+
+ List<GroupDepotData> list = new ArrayList<>();
+ GroupDepotData depotData;
+ List<Dept> deptList = deptService.getDeptByUserType(null);
+ if (null != deptList && !deptList.isEmpty()) {
+ List<Depot> depotList;
+ for (Dept dept : deptList) {
+ //缁熻浠撳簱鏁�
+ depotList = depotService.getCacheDepotList(dept.getCompanyId(), dept.getId());
+ if (null != depotList && !depotList.isEmpty()) {
+ for (Depot depot : depotList) {
+ depotData = new GroupDepotData();
+ depotData.setDeptId(dept.getId());
+ depotData.setDeptName(dept.getKqmc());
+ depotData.setCode(dept.getXzqhdm());
+ depotData.setCounty(dept.getXzqhmc());
+ depotData.setDepotId(depot.getId());
+ depotData.setDepotName(depot.getName());
+ if (null == depot.getStorageReal()) {
+ depot.setStorageReal(0.0);
+ }
+ depotData.setStorageNum(depot.getStorageReal() / 1000);
+ list.add(depotData);
+ }
+ }
+ }
+ }
+ 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 +384,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());
}
@@ -151,26 +399,26 @@
//鐢ㄤ簬缁熻鍒嗗搧绉嶅簱瀛�
LinkedHashMap<String, Double> varietyMap = new LinkedHashMap<>();
for (Depot depot : depotList) {
- if(StringUtils.isNotBlank(depot.getPledgeBank())){
+ if (StringUtils.isNotBlank(depot.getPledgeBank())) {
indexData.setDepotBankNum(indexData.getDepotBankNum() + 1);
}
- if(null == depot.getStorageReal()){
+ if (null == depot.getStorageReal()) {
depot.setStorageReal(0.0);
}
- if(StringUtils.isNotBlank(depot.getStoreType()) && "2".equals(depot.getStoreType())){
- packFoodSum += depot.getStorageReal()/1000;
- }else {
- foodSum += depot.getStorageReal()/1000;
+ if (StringUtils.isNotBlank(depot.getStoreType()) && "2".equals(depot.getStoreType())) {
+ packFoodSum += depot.getStorageReal() / 1000;
+ } else {
+ foodSum += depot.getStorageReal() / 1000;
}
- if(depot.getStorageReal() > 0){
- if(StringUtils.isBlank(depot.getFoodVariety())){
+ if (depot.getStorageReal() > 0) {
+ if (StringUtils.isBlank(depot.getFoodVariety())) {
//璁剧疆涓哄叾浠栧搧绫�
depot.setFoodVariety("9999000");
}
varietyMap.putIfAbsent(depot.getFoodVariety(), 0.000);
- varietyMap.put(depot.getFoodVariety(), varietyMap.get(depot.getFoodVariety()) + NumberUtil.keepPrecision(depot.getStorageReal()/1000, 3));
+ varietyMap.put(depot.getFoodVariety(), varietyMap.get(depot.getFoodVariety()) + NumberUtil.keepPrecision(depot.getStorageReal() / 1000, 3));
}
}
@@ -190,6 +438,7 @@
/**
* 澶у睆棣栭〉-搴撳尯淇℃伅缁熻
+ *
* @param param
* @return
*/
@@ -197,11 +446,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());
@@ -214,14 +464,14 @@
for (Depot depot : depotList) {
deptData.setDepotNumber(deptData.getDepotNumber() + 1);
- if(StringUtils.isNotBlank(depot.getPledgeBank())){
+ if (StringUtils.isNotBlank(depot.getPledgeBank())) {
deptData.setDepotBankNumber(deptData.getDepotBankNumber() + 1);
}
- if(null == depot.getStorageReal()){
+ if (null == depot.getStorageReal()) {
depot.setStorageReal(0.0);
}
- deptData.setStorageNum(deptData.getStorageNum() + depot.getStorageReal()/1000);
+ deptData.setStorageNum(deptData.getStorageNum() + depot.getStorageReal() / 1000);
}
}
@@ -237,11 +487,41 @@
if (Constant.TYPE_IN.equals(inoutRecord.getType())) {
deptData.setInNum(deptData.getInNum() + 1);
}
- if (Constant.TYPE_OUT.equals(inoutRecord.getType())){
+ if (Constant.TYPE_OUT.equals(inoutRecord.getType())) {
deptData.setOutNum(deptData.getOutNum() + 1);
}
}
+ }
+
+ //缁熻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);
+ List<EventInfo> resultEnevtList = new ArrayList<>();
+ for (EventInfo info : enevtList) {
+ //褰撴爣绛惧寘鍚� 鍗¤溅锛� 鎴栬�呭寘鍚ぇ鍐欑殑鑻辨枃瀛楁瘝锛堜唬琛ㄦ湁杞︾墝锛夋椂锛屾坊鍔犺繘result
+ if (StringUtils.isNotBlank(info.getTags())) {
+ if (info.getTags().contains("鍗¤溅") || info.getTags().matches(".*[A-Z].*")) {
+ resultEnevtList.add(info);
+ }
+ }
+ }
+ if (null != resultEnevtList && !resultEnevtList.isEmpty()) {
+ deptData.setWarnNum7(resultEnevtList.size());
+ for (EventInfo eventInfo : resultEnevtList) {
+ if (DateFormatUtils.format(new Date(), "yyyyMMdd").equals(DateFormatUtils.format(eventInfo.getTime(), "yyyyMMdd"))) {
+ deptData.setDailyTotal(deptData.getDailyTotal() + 1);
+ }
+ }
+ }
+ //鍒ゆ柇缃戝叧鏄惁鍦ㄧ嚎
+ GatewaySer cacheSerByDeptId = gatewaySerService.getCacheSerByDeptId(dept.getId());
+ if (null == cacheSerByDeptId || (null != cacheSerByDeptId && StringUtils.isNotBlank(cacheSerByDeptId.getStatus()) && cacheSerByDeptId.getStatus().equals(Constant.YN_N))) {
+ deptData.setDailyTotal(-1);
}
list.add(deptData);
}
@@ -272,13 +552,13 @@
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());
for (Dept dept : deptList) {
if (StringUtils.isBlank(dept.getXzqhdm()) || null == valuePieChart.get(dept.getXzqhdm())) {
- if(null == valuePieChart.get("999999")){
+ if (null == valuePieChart.get("999999")) {
valuePieChart.put("999999", 0);
namePieChart.put("999999", "鍏朵粬鍖哄幙");
}
@@ -288,9 +568,9 @@
}
}
- if(groupGisData.getDeptNum() > 0){
+ if (groupGisData.getDeptNum() > 0) {
for (String mapKey : valuePieChart.keySet()) {
- groupGisData.getDeptList().add(new ChartPie(valuePieChart.get(mapKey) + "", namePieChart.get(mapKey), new DecimalFormat("0.0").format((double)valuePieChart.get(mapKey) / groupGisData.getDeptNum() * 100)));
+ groupGisData.getDeptList().add(new ChartPie(valuePieChart.get(mapKey) + "", namePieChart.get(mapKey), new DecimalFormat("0.0").format((double) valuePieChart.get(mapKey) / groupGisData.getDeptNum() * 100)));
}
}
@@ -298,18 +578,18 @@
List<Depot> depotList = depotService.getData(ContextUtil.getCompanyId(), ContextUtil.subDeptId(null), false);
if (null != depotList && !depotList.isEmpty()) {
for (Depot depot : depotList) {
- if(null == depot.getStorageReal()){
+ if (null == depot.getStorageReal()) {
depot.setStorageReal(0.0);
}
groupGisData.setSum(groupGisData.getSum() + depot.getStorageReal());
- if(StringUtils.isNotBlank(depot.getPledgeBank())){
+ if (StringUtils.isNotBlank(depot.getPledgeBank())) {
groupGisData.setBankSum(groupGisData.getBankSum() + depot.getStorageReal());
- }else{
+ } else {
groupGisData.setNormalSum(groupGisData.getNormalSum() + depot.getStorageReal());
}
}
}
- if(groupGisData.getSum() > 0){
+ if (groupGisData.getSum() > 0) {
groupGisData.setSumPer(new DecimalFormat("0.00").format(groupGisData.getSum() / groupGisData.getSum() * 100L));
groupGisData.setBankSumPer(new DecimalFormat("0.00").format(groupGisData.getBankSum() / groupGisData.getSum() * 100L));
groupGisData.setNormalSumPer(new DecimalFormat("0.00").format(groupGisData.getNormalSum() / groupGisData.getSum() * 100L));
@@ -317,4 +597,148 @@
return groupGisData;
}
+
+
+ public GroupGisData getGisDataByCompanyId() {
+
+ GroupGisData groupGisData = new GroupGisData();
+
+ //鏌ヨ浼婄妬涓嬪睘鍖哄幙
+ //鍖哄幙
+ List<DicArea> dicAreaList = dicAreaService.listData("654000", null, null);
+
+ //缁熻鍖哄幙涓嬪簱鍖烘暟
+ LinkedHashMap<String, Integer> valuePieChart = new LinkedHashMap<>();
+ LinkedHashMap<String, String> namePieChart = new LinkedHashMap<>();
+ if (null != dicAreaList && !dicAreaList.isEmpty()) {
+ for (DicArea dicArea : dicAreaList) {
+ valuePieChart.put(dicArea.getCode(), 0);
+ namePieChart.put(dicArea.getCode(), dicArea.getName());
+ }
+ }
+ List<Dept> deptList = deptService.getDeptByUserType(null);
+ if (null != deptList && !deptList.isEmpty()) {
+ //搴撳尯鎬绘暟
+ groupGisData.setDeptNum(deptList.size());
+ for (Dept dept : deptList) {
+ if (StringUtils.isBlank(dept.getXzqhdm()) || null == valuePieChart.get(dept.getXzqhdm())) {
+ if (null == valuePieChart.get("999999")) {
+ valuePieChart.put("999999", 0);
+ namePieChart.put("999999", "鍏朵粬鍖哄幙");
+ }
+ dept.setXzqhdm("999999");
+ }
+ valuePieChart.put(dept.getXzqhdm(), valuePieChart.get(dept.getXzqhdm()) + 1);
+ }
+ }
+
+ if (groupGisData.getDeptNum() > 0) {
+ for (String mapKey : valuePieChart.keySet()) {
+ groupGisData.getDeptList().add(new ChartPie(valuePieChart.get(mapKey) + "", namePieChart.get(mapKey), new DecimalFormat("0.0").format((double) valuePieChart.get(mapKey) / groupGisData.getDeptNum() * 100)));
+ }
+ }
+
+ //缁熻閲嶉噺
+ List<Depot> depotList = depotService.getCacheDepotList(ContextUtil.getCompanyId());
+ if (null != depotList && !depotList.isEmpty()) {
+ for (Depot depot : depotList) {
+ if (null == depot.getStorageReal()) {
+ depot.setStorageReal(0.0);
+ }
+ groupGisData.setSum(groupGisData.getSum() + depot.getStorageReal());
+ if (StringUtils.isNotBlank(depot.getPledgeBank())) {
+ groupGisData.setBankSum(groupGisData.getBankSum() + depot.getStorageReal());
+ } else {
+ groupGisData.setNormalSum(groupGisData.getNormalSum() + depot.getStorageReal());
+ }
+ }
+ }
+ if (groupGisData.getSum() > 0) {
+ groupGisData.setSumPer(new DecimalFormat("0.00").format(groupGisData.getSum() / groupGisData.getSum() * 100L));
+ groupGisData.setBankSumPer(new DecimalFormat("0.00").format(groupGisData.getBankSum() / groupGisData.getSum() * 100L));
+ groupGisData.setNormalSumPer(new DecimalFormat("0.00").format(groupGisData.getNormalSum() / groupGisData.getSum() * 100L));
+ }
+
+ 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);
+
+ List<SnapRecord> resultListSnap = new ArrayList<>();
+ for (SnapRecord info : listSnap) {
+ //褰撴爣绛惧寘鍚� 鍗¤溅锛� 鎴栬�呭寘鍚ぇ鍐欑殑鑻辨枃瀛楁瘝锛堜唬琛ㄦ湁杞︾墝锛夋椂锛屾坊鍔犺繘result
+ if (StringUtils.isNotBlank(info.getTags())) {
+ if (info.getTags().contains("鍗¤溅") || info.getTags().matches(".*[A-Z].*")) {
+ resultListSnap.add(info);
+ }
+ }
+ }
+ if (null != resultListSnap && !resultListSnap.isEmpty()) {
+ //鍒ゆ柇鏂囦欢鏄惁瀛樺湪
+ for (SnapRecord record : resultListSnap) {
+ record.setImgName(commonManager.isImgExit(record.getImgName(), null));
+ }
+ }
+
+ return new PageResponse<>(RespCodeEnum.CODE_0000, resultListSnap);
+ }
+
+
+ /**
+ * 澶у睆棣栭〉-鎶撴媿璺熻釜淇℃伅-灞曠ずAI鏃堕棿鍥剧墖
+ * 灞曠ず鍥剧墖鐨勪笟鍔¢�昏緫锛氭瘡涓簱鍖哄睍绀轰竴寮狅紝鍥剧墖涓哄綋澶╁崄鐐逛互鍚庢渶鏂扮殑涓�寮�
+ *
+ * @param param
+ * @return
+ */
+ public PageResponse<List<EventInfo>> indexEventInfoList(IgdsBaseParam param) {
+// Date start =DateUtils.setHours(DateUtil.getNewByDay(new Date(), -3), 10);
+ //param.setStart(start);
+// param.setEnd(DateUtil.getNewByDay(new Date(), -3));
+ Date start =DateUtil.getNewByDay(new Date(), -10);
+ param.setStart(start);
+ param.setEnd(new Date());
+
+ //鑾峰彇褰撴棩鐨勬姄鎷嶄俊鎭�
+ List<EventInfo> listByParam = eventInfoService.getListByParam(param);
+ if (null == listByParam || listByParam.isEmpty()) {
+ return new PageResponse<>(RespCodeEnum.CODE_0000, new ArrayList<>());
+ }
+
+ //鑾峰彇鎵�鏈夌殑搴撳尯淇℃伅
+ List<Dept> deptList = deptService.getDeptByUserType(null);
+ //鏍规嵁搴撳尯浠巐istByParam鏉ヨ幏鍙栨瘡涓�涓簱鍖轰笅锛屾渶鏂扮殑涓�寮犳姄鎷嶅浘鐗�
+ List<EventInfo> resultList = new ArrayList<>();
+
+ for (Dept dept : deptList) {
+ EventInfo latestEvent = null;
+ //浠巐istByParam涓瓫閫夊嚭涓庡綋鍓峣d鍖归厤鐨勬暟鎹�
+ List<EventInfo> collect = listByParam.stream().filter(info -> info.getDeptId().equals(dept.getId())).sorted(Comparator.comparing(EventInfo::getTime).reversed()).collect(Collectors.toList());
+ //姣忎釜搴撳尯鑾峰彇鏈�鏂扮殑3寮犲浘鐗�
+ int i = 0;
+ for (EventInfo info : collect) {
+ if (i > 2) break;
+ resultList.add(info);
+ i++;
+ }
+ }
+ if (null != resultList && !resultList.isEmpty()) {
+ //鍒ゆ柇鏂囦欢鏄惁瀛樺湪
+ for (EventInfo record : resultList) {
+ record.setImgName(commonManager.isImgExit(record.getImgName(), null));
+ }
+ }
+
+ return new PageResponse<>(RespCodeEnum.CODE_0000, resultList);
+ }
}
--
Gitblit v1.9.3