From ebae0c1137ba96d38e5b2323577129d2c9ff2e6e Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 22 五月 2025 09:45:59 +0800
Subject: [PATCH] 1、优化配置文件; 2、优化ID生成器代码; 3、修改注释; 4、修改权限初始化时算法; 5、导出Excel文件功能归为一个新类; 6、工站数据库存入验空修改;

---
 pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationCtrl.java |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationCtrl.java b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationCtrl.java
index ece32c2..00c1890 100644
--- a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationCtrl.java
+++ b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationCtrl.java
@@ -9,6 +9,7 @@
 import com.dy.common.webUtil.QueryResultVo;
 import com.dy.pmsGlobal.aop.Log;
 import com.dy.pmsGlobal.pojoPlt.PltStation;
+import com.dy.pmsGlobal.util.ExportExcelUtil;
 import com.dy.pmsGlobal.util.QrCodeConstant;
 import com.dy.pmsGlobal.util.QrCodeUtil;
 import com.google.zxing.WriterException;
@@ -17,7 +18,6 @@
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
-import io.netty.channel.EventLoopGroup ;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -150,11 +150,28 @@
         List<Converter> list = new ArrayList<>() ;
 
         List<PltStation> stations = sv.selectAll();
-        // 浣跨敤骞惰娴佹彁楂樻�ц兘
+        if(stations != null){
+            for(PltStation station : stations){
+                ExcelVo vo = new ExcelVo();
+                vo.name = station.name;
+                //vo.code = "103"+station.id;
+                vo.lineName = station.lineName;
+                try {
+                    vo.qrCode = QrCodeUtil.genQrCode(QrCodeConstant.TypeStation+station.id);
+                } catch (IOException e) {
+                    e.printStackTrace();
+                } catch (WriterException e) {
+                    e.printStackTrace();
+                }
+                list.add(vo);
+            }
+        }
+        // 浣跨敤骞惰娴佹彁楂樻�ц兘锛屼絾鐢熸垚鐨勭粨鏋滃彉鎴愭棤搴忕殑浜�
+        /*
         stations.parallelStream().forEach(station -> {
             ExcelVo vo = new ExcelVo();
             vo.name = station.name;
-//                vo.code = "103"+station.id;
+            //vo.code = "103"+station.id;
             vo.lineName = station.lineName;
             try {
                 vo.qrCode = QrCodeUtil.genQrCode(QrCodeConstant.TypeStation+station.id);
@@ -165,7 +182,8 @@
             }
             list.add(vo);
         });
-        QrCodeUtil.downloadExcel(response, fileName,sheetName,list);
+         */
+        ExportExcelUtil.downloadExcel(response, fileName, sheetName, list);
     }
 }
 

--
Gitblit v1.8.0