From af8b0ddeeb5fc71f5099e6be44dc9d3064a3b243 Mon Sep 17 00:00:00 2001
From: 刘小明 <liuxm_a@163.com>
Date: 星期四, 29 八月 2024 16:49:59 +0800
Subject: [PATCH] 优化查询全部工站(id以string格式传给前端)

---
 pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java
index 783a93c..c0858da 100644
--- a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java
+++ b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java
@@ -1,11 +1,14 @@
 package com.dy.pmsPlatform.station;
 
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
 import com.alibaba.excel.util.StringUtils;
 import com.dy.common.webUtil.QueryResultVo;
 import com.dy.pmsGlobal.daoPlt.PltProductionLineMapper;
 import com.dy.pmsGlobal.daoPlt.PltStationMapper;
 import com.dy.pmsGlobal.pojoPlt.PltProductionLine;
 import com.dy.pmsGlobal.pojoPlt.PltStation;
+import com.dy.pmsGlobal.util.QrCodeConstant;
 import com.dy.pmsGlobal.util.QrCodeUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.common.utils.PojoUtils;
@@ -23,7 +26,7 @@
 
     private PltStationMapper dao;
     private PltProductionLineMapper lineDao;
-    private static final String stationPrefix = "103" ;
+//    private static final String stationPrefix = "103" ;
     private static final String DEFAULT_CODE = "0001";
     private static final String CODE_FORMAT = "%04d";
 
@@ -125,7 +128,7 @@
         //鏌ヨ绗﹀悎鏉′欢鐨勮褰�
         rsVo.obj = this.dao.selectSome(params) ;
         rsVo.obj.parallelStream().forEach(item->{
-            item.qrCode = QrCodeUtil.genQrCodeString(stationPrefix+item.id);
+            item.qrCode = QrCodeUtil.genQrCodeString(QrCodeConstant.TypeStation+item.id);
         });
         return rsVo ;
     }
@@ -148,5 +151,14 @@
     public List<PltStation> selectAll() {
         return dao.selectAll();
     }
+
+    public JSONArray selectAllIdAndName() {
+        List<PltStation> list = dao.selectAll();
+        JSONArray child = new JSONArray();
+        list.forEach(item->{
+            child.add(new JSONObject().set("id", String.valueOf(item.getId())).set("name", item.getName()));
+        });
+        return child;
+    }
 }
 

--
Gitblit v1.8.0