From e67b38c4ed42d78a0ab8235f1adcb7eefc011631 Mon Sep 17 00:00:00 2001 From: wuyouming666 <2265557248@qq.com> Date: 星期五, 05 一月 2024 14:26: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 | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 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..bcd8410 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; } -- Gitblit v1.8.0