From 6fbd63022d55e31cffd60b4e390d608e474e99c0 Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期六, 21 十月 2023 16:15:36 +0800
Subject: [PATCH] 账面库存
---
igds-basic/src/main/java/com/ld/igds/grain/manager/GrainManager.java | 28 +++++++++++++++++-----------
1 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/igds-basic/src/main/java/com/ld/igds/grain/manager/GrainManager.java b/igds-basic/src/main/java/com/ld/igds/grain/manager/GrainManager.java
index fffbd03..9a4c37a 100644
--- a/igds-basic/src/main/java/com/ld/igds/grain/manager/GrainManager.java
+++ b/igds-basic/src/main/java/com/ld/igds/grain/manager/GrainManager.java
@@ -22,18 +22,13 @@
import com.ld.igds.util.ContextUtil;
import com.ld.igds.util.DateUtil;
import com.ld.igds.util.DecimalUtil;
-import com.ld.igds.util.FilesUtil;
import com.ld.igds.view.service.BuildingService;
-
import lombok.extern.slf4j.Slf4j;
-
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-
-import javax.annotation.Resource;
import java.text.Collator;
import java.util.*;
import java.util.concurrent.ExecutorService;
@@ -67,8 +62,6 @@
private BuildingService buildingService;
@Autowired
private GrainExportBuilder grainExportBuilder;
- @Resource
- private FilesUtil filesUtil;
/**
* 鏍规嵁鍙傛暟鑾峰彇绮儏鏁版嵁淇℃伅
@@ -810,15 +803,19 @@
GrainData grainData;
Building building;
String height;
- Double length;
+ //鐩村緞
+ Double diameter;
Double bulkWeight;
Double storage = 0.0;
+ Double volume = 0.0;
+ Double deVolume;
for (Depot depot : depotList) {
//鑾峰彇浠撴埧淇℃伅锛岃缃缓绛戦珮搴�
height = null;
//鑾峰彇浠撴埧鐩村緞
- length = 0.0;
+ diameter = 0.0;
+ deVolume = 0.0;
//瀹归噸
bulkWeight = depot.getBulkWeight();
grainData = coreGrainService.listLiquidHeight(companyId, depot.getId());
@@ -833,7 +830,10 @@
height = building.getHeight() + "";
}
if (null != building.getLength()) {
- length = building.getLength();
+ diameter = building.getLength();
+ }
+ if (null != building.getDeVolume()) {
+ deVolume = building.getDeVolume();
}
}
}
@@ -842,7 +842,13 @@
grainData.setDepotHeight(height);
if (null != bulkWeight && StringUtils.isNotEmpty(grainData.getOilHeight())) {
Double oilHeight = Double.valueOf(grainData.getOilHeight());
- storage = 3.14 * Math.pow(length / 2, 2) * oilHeight * bulkWeight;
+ //璁$畻浣撶Н
+ volume = 3.14159 * Math.pow(diameter / 2, 2) * oilHeight;
+ if(volume > 0){
+ volume = volume - deVolume;
+ }
+
+ storage = volume * bulkWeight;
}
grainData.setStorage(storage);
--
Gitblit v1.9.3