From a8a841000119370ec34a59a7f4f51dc2f8ee0976 Mon Sep 17 00:00:00 2001
From: liuxm <liuxm_a@163.com>
Date: 星期四, 13 六月 2024 14:22:02 +0800
Subject: [PATCH] 去掉原controller 中的try catch 和BindingResult

---
 pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java |   17 +++++------------
 1 files changed, 5 insertions(+), 12 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 34bddf4..f3c52cd 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
@@ -30,9 +30,9 @@
     }
 
     @Transactional
-    public int save(PltStation station) throws Exception {
+    public int save(PltStation station) throws RuntimeException {
         if(dao.selectByCodeId(station.id,station.code)>0){
-            throw new Exception("宸ョ珯缂栧彿宸插瓨鍦�");
+            throw new RuntimeException("宸ョ珯缂栧彿宸插瓨鍦�");
         }
         int count = dao.insertSelective(station);
         return count;
@@ -51,9 +51,9 @@
 
 
     @Transactional
-    public int update(PltStation station) throws Exception {
+    public int update(PltStation station) throws RuntimeException {
         if(dao.selectByCodeId(station.id,station.code)>0){
-            throw new Exception("宸ョ珯缂栧彿宸插瓨鍦�");
+            throw new RuntimeException("宸ョ珯缂栧彿宸插瓨鍦�");
         }
         int count = dao.updateByPrimaryKeySelective(station);
         return count;
@@ -80,14 +80,7 @@
         //鏌ヨ绗﹀悎鏉′欢鐨勮褰�
         rsVo.obj = this.dao.selectSome(params) ;
         rsVo.obj.parallelStream().forEach(item->{
-            try {
-                byte[] codes = QrCodeUtil.genQrCode(stationPrefix+item.id);
-                item.qrCode = "data:image/jpeg;base64," + Base64.encode(codes);
-            } catch (IOException e) {
-                e.printStackTrace();
-            } catch (WriterException e) {
-                e.printStackTrace();
-            }
+            item.qrCode = QrCodeUtil.genQrCodeString(stationPrefix+item.id);
         });
         return rsVo ;
     }

--
Gitblit v1.8.0