From 58d7b0e12ccd92cf3934f6582b51b5fbcecaa39a Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期四, 09 五月 2024 09:42:41 +0800
Subject: [PATCH] 修改注入方式
---
springboot-vue3/src/main/java/com/example/springboot/service/North_Glass_Buffer1Service.java | 37 ++++++++++++++++++++++++++++++++++++-
1 files changed, 36 insertions(+), 1 deletions(-)
diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/North_Glass_Buffer1Service.java b/springboot-vue3/src/main/java/com/example/springboot/service/North_Glass_Buffer1Service.java
index af4492d..fcb0582 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/North_Glass_Buffer1Service.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/service/North_Glass_Buffer1Service.java
@@ -1,13 +1,17 @@
package com.example.springboot.service;
import java.sql.SQLException;
+import java.util.Collection;
+import java.util.Comparator;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import com.example.springboot.entity.StorageCage;
import com.example.springboot.entity.north_glass_buffer1;
import com.example.springboot.mapper.HomeMapper;
+import java.util.Collections;
@Service
public class North_Glass_Buffer1Service {
@@ -17,6 +21,33 @@
@Autowired
private JdbcConnections jdbcConnections;
+ class north_glass_buffer1Comparator implements Comparator<north_glass_buffer1> {
+ @Override
+ public int compare(north_glass_buffer1 n1, north_glass_buffer1 n2) {//瀵规煡璇㈠埌鐨勯摑妗嗗搴旂殑鐜荤拑鏁版嵁杩涜鎺掑簭锛屽皢绂诲嚭鐗囦綅缃繎鐨勶紝闈犺繎绗煎瓙鍑虹墖渚х殑鐜荤拑鎺掑湪鍓嶉潰
+ if (n1.getstorageCage() != null) {
+ if (n2.getstorageCage() != null) {
+ int cageComparison = n2.getstorageCage().getCage().compareTo(n1.getstorageCage().getCage());//闈犲嚭鐗囧彛杩戠殑绗煎瓙浼樺厛
+ if (cageComparison != 0) {
+ return cageComparison;
+ } else {
+ int cellComparison = n2.getstorageCage().getCell().compareTo(n1.getstorageCage().getCell());//闈犲嚭鐗囧彛杩戠殑鏍煎瓙浼樺厛
+ if (cellComparison != 0) {
+ return cellComparison;
+ } else {
+ return n2.getstorageCage().getTier().compareTo(n1.getstorageCage().getTier());//闈犲嚭鐗囧彛杩戠殑鏍煎瓙澶栧眰浼樺厛
+ }
+ }
+ } else {
+ return -1;
+ }
+
+ } else {
+ return 1;
+ }
+
+ }
+ }
+
// 鑾峰彇鐜荤拑鏄惁鍦ㄧ瀛愶紝鏄惁鍦ㄥ嚭鐗囬槦鍒�
public List<north_glass_buffer1> SelectAluminumFrameInfoById(String FrameBarcode) throws SQLException {
List<north_glass_buffer1> listAluminumFrame = jdbcConnections
@@ -25,6 +56,8 @@
north_glass_buffer1.setstorageCage(homeMapper.SelectStorageGlassById(north_glass_buffer1.getbarcode()));
north_glass_buffer1.setOut_slice(homeMapper.SelectQueueByglassid(north_glass_buffer1.getbarcode()));
}
+ // 瀵瑰祵濂楃被杩涜鎺掑簭
+ Collections.sort(listAluminumFrame, new north_glass_buffer1Comparator());
return listAluminumFrame;
}
@@ -33,6 +66,8 @@
List<north_glass_buffer1> north_glass_buffer1s = SelectAluminumFrameInfoById(FrameBarcode);
String flip = jdbcConnections.SelectFlipByFrameBarcode(FrameBarcode);
String position = jdbcConnections.SelectPositionByFrameBarcode(FrameBarcode);
+ String framelength=jdbcConnections.SelectFrameLengthByFrameBarcode(FrameBarcode);
+ String frameheight=jdbcConnections.SelectFrameHeightByFrameBarcode(FrameBarcode);
int sequence = homeMapper.SelectMaxSquence();
for (north_glass_buffer1 north_glass_buffer1 : north_glass_buffer1s) {
Short state = 0;
@@ -45,7 +80,7 @@
north_glass_buffer1.getglassheightmm().toString(), sequence, position, state,
north_glass_buffer1.getordernumber(), north_glass_buffer1.getlistnumber(),
north_glass_buffer1.getboxnumber(), north_glass_buffer1.getglasslength().toString(),
- north_glass_buffer1.getglassheight().toString());
+ north_glass_buffer1.getglassheight().toString(),framelength,frameheight);
sequence += 1;
}
}
--
Gitblit v1.8.0