From b92caa380bb6242ae11a3606ea908c7029aaeeb6 Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期一, 06 一月 2025 09:57:53 +0800
Subject: [PATCH] Handler

---
 pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java
index 35e7675..67cfb88 100644
--- a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java
+++ b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java
@@ -76,9 +76,9 @@
 
     @Transactional
     public int save(PltProduct p) {
-        //鍒ゆ柇浜у搧涓嶈兘閲嶅悕
-        if (dao.exists(p.name, p.id)) {
-            throw new RuntimeException("浜у搧鍚嶇О閲嶅");
+        //鍒ゆ柇浜у搧 鍚嶇О鍜屽瀷鍙� 涓嶈兘閲嶅悕
+        if (dao.exists(p.name.trim(), p.type.trim() ,p.id)) {
+            throw new RuntimeException("宸茬粡瀛樺湪鐩稿悓鐨勪骇鍝佸悕绉�&鍨嬪彿");
         }
         int flag=0;
         do {
@@ -114,8 +114,8 @@
 
     @Transactional
     public int update(PltProduct p) {
-        if (dao.exists(p.name, p.id)) {
-            throw new RuntimeException("浜у搧鍚嶇О閲嶅");
+        if (dao.exists(p.name.trim(), p.type.trim(),p.id)) {
+            throw new RuntimeException("宸茬粡瀛樺湪鐩稿悓鐨勪骇鍝佸悕绉�&鍨嬪彿");
         }
         int count = dao.updateByPrimaryKeySelective(p);
         //鍒犻櫎鏃ф暟鎹�,閲嶆柊鎻掑叆
@@ -248,7 +248,9 @@
         Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
         return dao.selectAll(params);
     }
-
+    public List<PltProduct> getProduct(Long orderId) {
+        return dao.selectByOrderId(orderId);
+    }
 
 //    public void downloadDoc(HttpServletResponse response) {
 //        PltProduct pro=dao.selectByPrimaryKey(Long.valueOf(1));

--
Gitblit v1.8.0