From cda9decfde8c6b518639c5da506aa293c07f88ff Mon Sep 17 00:00:00 2001
From: p-honggang.li <p-honggang.li@pcitc.com>
Date: 星期一, 08 九月 2025 16:43:04 +0800
Subject: [PATCH] 修改附件上传用户id类型为string,及审核页面不显示带文件上传状态

---
 src/main/java/com/webmanage/service/impl/ProductPricingServiceImpl.java |   40 ++++++++++++++++++++++++++++++----------
 1 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/src/main/java/com/webmanage/service/impl/ProductPricingServiceImpl.java b/src/main/java/com/webmanage/service/impl/ProductPricingServiceImpl.java
index f14987b..77e20b3 100644
--- a/src/main/java/com/webmanage/service/impl/ProductPricingServiceImpl.java
+++ b/src/main/java/com/webmanage/service/impl/ProductPricingServiceImpl.java
@@ -5,6 +5,7 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.webmanage.common.BusinessException;
+import com.webmanage.emun.PriceTypeEnum;
 import com.webmanage.entity.ProductPricing;
 import com.webmanage.mapper.ProductPricingMapper;
 import com.webmanage.service.ProductPricingService;
@@ -47,8 +48,17 @@
             if (!StringUtils.hasText(productPricing.getPriceType())) {
                 throw new BusinessException("浠锋牸璁剧疆涓嶈兘涓虹┖");
             }
-            if (productPricing.getPrice() == null || productPricing.getPrice().doubleValue() < 0) {
-                throw new BusinessException("浠锋牸鍊间笉鑳戒负绌轰笖涓嶈兘涓鸿礋鏁�");
+            if (productPricing.getPriceType().indexOf(PriceTypeEnum.POINTS.getName()) > -1
+                    && productPricing.getPointsPrice() == null ||
+                    productPricing.getPriceType().indexOf(PriceTypeEnum.POINTS.getName()) > -1
+                            &&productPricing.getPointsPrice().doubleValue() < 0) {
+                throw new BusinessException("绉垎浠锋牸鍊间笉鑳戒负绌轰笖涓嶈兘涓鸿礋鏁�");
+            }
+            if (productPricing.getPriceType().indexOf(PriceTypeEnum.CURRENCY.getName()) > -1
+                    && productPricing.getCurrencyPrice()== null ||
+                    productPricing.getPriceType().indexOf(PriceTypeEnum.CURRENCY.getName()) > -1
+                            && productPricing.getCurrencyPrice().doubleValue() < 0){
+                throw new BusinessException("璐у竵浠锋牸鍊间笉鑳戒负绌轰笖涓嶈兘涓鸿礋鏁�");
             }
             if (productPricing.getProductId() == null) {
                 throw new BusinessException("浜у搧ID涓嶈兘涓虹┖");
@@ -96,8 +106,17 @@
             if (!StringUtils.hasText(productPricing.getPriceType())) {
                 throw new BusinessException("浠锋牸璁剧疆涓嶈兘涓虹┖");
             }
-            if (productPricing.getPrice() == null || productPricing.getPrice().doubleValue() < 0) {
-                throw new BusinessException("浠锋牸鍊间笉鑳戒负绌轰笖涓嶈兘涓鸿礋鏁�");
+            if (productPricing.getPriceType().indexOf(PriceTypeEnum.POINTS.getName()) > -1
+                    && productPricing.getPointsPrice() == null ||
+                    productPricing.getPriceType().indexOf(PriceTypeEnum.POINTS.getName()) > -1
+                            &&productPricing.getPointsPrice().doubleValue() < 0) {
+                throw new BusinessException("绉垎浠锋牸鍊间笉鑳戒负绌轰笖涓嶈兘涓鸿礋鏁�");
+            }
+            if (productPricing.getPriceType().indexOf(PriceTypeEnum.CURRENCY.getName()) > -1
+                    && productPricing.getCurrencyPrice()== null ||
+                    productPricing.getPriceType().indexOf(PriceTypeEnum.CURRENCY.getName()) > -1
+                            && productPricing.getCurrencyPrice().doubleValue() < 0) {
+                throw new BusinessException("璐у竵浠锋牸鍊间笉鑳戒负绌轰笖涓嶈兘涓鸿礋鏁�");
             }
             
             boolean result = updateById(productPricing);
@@ -143,11 +162,8 @@
     }
 
     @Override
-    public List<ProductPricing> getPricingByProductId(Long productId) {
+    public List<ProductPricing> getPricingByProductId(String productId) {
         try {
-            if (productId == null) {
-                throw new BusinessException("浜у搧ID涓嶈兘涓虹┖");
-            }
             return baseMapper.selectByProductId(productId);
         } catch (Exception e) {
             log.error("鏍规嵁浜у搧ID鏌ヨ瀹氫环澶辫触: ", e);
@@ -156,11 +172,15 @@
     }
 
     @Override
-    public List<ProductPricing> getPricingByCondition(String suiteName, String salesForm, 
+    public List<ProductPricing> getPricingByCondition(String productId, String suiteName, String salesForm,
                                                     String customerType, String priceType, Boolean isActive) {
         try {
             QueryWrapper<ProductPricing> queryWrapper = new QueryWrapper<>();
-            
+
+            if (StringUtils.hasText(productId)) {
+                queryWrapper.like("product_id", productId);
+            }
+
             if (StringUtils.hasText(suiteName)) {
                 queryWrapper.like("suite_name", suiteName);
             }

--
Gitblit v1.8.0