From 3614b4f694d9d40708df6477d56a40b9311ad48a Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期三, 31 一月 2024 14:50:17 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes
---
springboot-vue3/src/main/java/com/example/springboot/service/North_Glass_Buffer1Service.java | 61 ++++++++++++++++++++++++++----
1 files changed, 53 insertions(+), 8 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 d2a518a..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,34 @@
@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
.SelectGlassByGlassIdOrderIdFrameIdss(FrameBarcode);
@@ -24,21 +56,34 @@
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;
}
- public void AddOutSliceS(String FrameBarcode) throws SQLException{
- List<north_glass_buffer1> north_glass_buffer1s=SelectAluminumFrameInfoById(FrameBarcode);
+ // 鏍规嵁閾濇id娣诲姞鐜荤拑鍒板嚭鐗囬槦鍒�
+ public void AddOutSliceS(String FrameBarcode) throws SQLException {
+ List<north_glass_buffer1> north_glass_buffer1s = SelectAluminumFrameInfoById(FrameBarcode);
String flip = jdbcConnections.SelectFlipByFrameBarcode(FrameBarcode);
- String position =jdbcConnections.SelectPositionByFrameBarcode(FrameBarcode);
- int sequence=homeMapper.SelectMaxSquence();
+ 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) {
- if(north_glass_buffer1.getstorageCage()!=null&&north_glass_buffer1.getOut_slice()==null){
- homeMapper.AddOutSliceS(north_glass_buffer1.getbarcode(), flip, FrameBarcode, north_glass_buffer1.getglasslengthmm().toString(), north_glass_buffer1.getglassheightmm().toString(), sequence, position);
- sequence+=1;
+ Short state = 0;
+ if (north_glass_buffer1.getOut_slice() == null) {
+ if (north_glass_buffer1.getstorageCage() == null) {
+ state = 3;
+ }
+ homeMapper.AddOutSliceS(north_glass_buffer1.getbarcode(), flip, FrameBarcode,
+ north_glass_buffer1.getglasslengthmm().toString(),
+ 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(),framelength,frameheight);
+ sequence += 1;
}
}
}
-
}
--
Gitblit v1.8.0