From 56bcea62b0f4c9a2fc737502c35bd44b847c20a4 Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期四, 28 九月 2023 11:58:55 +0800
Subject: [PATCH] 贝博粮情解析3
---
igds-core/src/main/java/com/ld/igds/grain/GrainUtil.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 53 insertions(+), 0 deletions(-)
diff --git a/igds-core/src/main/java/com/ld/igds/grain/GrainUtil.java b/igds-core/src/main/java/com/ld/igds/grain/GrainUtil.java
index 762ce32..04e47b0 100644
--- a/igds-core/src/main/java/com/ld/igds/grain/GrainUtil.java
+++ b/igds-core/src/main/java/com/ld/igds/grain/GrainUtil.java
@@ -293,4 +293,57 @@
return list;
}
+ /**
+ * 灞傝杞崲--椤烘椂閽�
+ *
+ * @param temps
+ * @param cable
+ * @return
+ */
+ public List<Double> convertRight(List<Double> temps, String cable) {
+ String[] attCable = cable.split("-");
+ int cableZ = Integer.valueOf(attCable[0]);
+ int cableY = Integer.valueOf(attCable[1]);
+ int cableX = Integer.valueOf(attCable[2]);
+ List<Double> list = new ArrayList<>();
+
+ int index;
+ for (int x = 1; x <= cableX; x++) {
+ for(int z = cableZ; z >= 1; z--){
+ for (int y = 1; y <= cableY; y++) {
+ index = z*y*x -1;
+ list.add(temps.get(index));
+ }
+ }
+ }
+
+ return list;
+ }
+
+ /**
+ * 灞傝杞崲--閫嗘椂閽�
+ *
+ * @param temps
+ * @param cable
+ * @return
+ */
+ public List<Double> convertLeft(List<Double> temps, String cable) {
+ String[] attCable = cable.split("-");
+ int cableZ = Integer.valueOf(attCable[0]);
+ int cableY = Integer.valueOf(attCable[1]);
+ int cableX = Integer.valueOf(attCable[2]);
+ List<Double> list = new ArrayList<>();
+
+ int index;
+ for (int x = 1; x <= cableX; x++) {
+ for (int z = 1; z <= cableZ; z++) {
+ for (int y = cableY; y >= cableY; y--) {
+ index = z*y*x -1;
+ list.add(temps.get(index));
+ }
+ }
+ }
+
+ return list;
+ }
}
\ No newline at end of file
--
Gitblit v1.9.3