From d581ec143d4ef57b6264b6286a583e2956ea91cd Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 22 五月 2025 15:29:15 +0800
Subject: [PATCH] 产品品质检查项查询排序
---
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationCtrl.java | 42 +++++++++++++++++++++++++++++++++++++-----
1 files changed, 37 insertions(+), 5 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 4646f65..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
@@ -1,5 +1,6 @@
package com.dy.pmsPlatform.station;
+import cn.hutool.json.JSONArray;
import com.alibaba.excel.converters.Converter;
import com.alibaba.fastjson2.JSON;
import com.dy.common.aop.SsoPowerAop;
@@ -8,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;
@@ -117,8 +119,20 @@
return BaseResponseUtils.buildSuccess(list);
}
+ /**
+ * 鏌ヨ鎵�鏈夊伐绔�
+ * @return
+ */
+ @GetMapping(path="all")
+ @SsoPowerAop(power = "10300006")
+ @Log("鏌ヨ鎵�鏈夊伐绔�")
+ public BaseResponse<JSONArray> all(){
+ JSONArray array = sv.selectAllIdAndName() ;
+ return BaseResponseUtils.buildSuccess(array);
+ }
+
@PostMapping(path="disabled")
- @SsoPowerAop(power = "10100011")
+ @SsoPowerAop(power = "10300007")
@Log("绂佺敤鎴栧惎鐢ㄥ伐绔�")
public BaseResponse<Boolean> disabled(@RequestBody PltStation station){
int count = sv.disabled(station.id,station.disabled);
@@ -130,17 +144,34 @@
}
}
@PostMapping(path="export")
- @SsoPowerAop(power = "10300000")
+ @SsoPowerAop(power = "10300007")
@Log("瀵煎嚭宸ョ珯淇℃伅")
public void export(HttpServletResponse response){
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);
@@ -151,7 +182,8 @@
}
list.add(vo);
});
- QrCodeUtil.downloadExcel(response, fileName,sheetName,list);
+ */
+ ExportExcelUtil.downloadExcel(response, fileName, sheetName, list);
}
}
--
Gitblit v1.8.0