From d0c4758b378e46b35429e2a2ca7d6d3ecf284143 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期四, 28 三月 2024 20:36:36 +0800
Subject: [PATCH] 编译错误修改

---
 smart-man-boot/src/main/java/com/qianwen/smartman/modules/cps/service/impl/ProductTypeServiceImpl.java |   58 ++++++++--------------------------------------------------
 1 files changed, 8 insertions(+), 50 deletions(-)

diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/cps/service/impl/ProductTypeServiceImpl.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/cps/service/impl/ProductTypeServiceImpl.java
index 514c952..48e35b0 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/cps/service/impl/ProductTypeServiceImpl.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/cps/service/impl/ProductTypeServiceImpl.java
@@ -8,6 +8,7 @@
 import com.qianwen.core.log.exception.ServiceException;
 import com.qianwen.core.mp.base.BaseServiceImpl;
 import com.qianwen.core.tool.utils.Func;
+import com.qianwen.smartman.modules.cps.entity.Product;
 import com.qianwen.smartman.modules.cps.entity.ProductType;
 import com.qianwen.smartman.modules.cps.mapper.ProductMapper;
 import com.qianwen.smartman.modules.cps.mapper.ProductTypeMapper;
@@ -21,54 +22,6 @@
 public class ProductTypeServiceImpl extends BaseServiceImpl<ProductTypeMapper, ProductType> implements IProductTypeService {
     private final ProductMapper productMapper;
 
-    private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
-        String implMethodName = lambda.getImplMethodName();
-        boolean z = true;
-        switch (implMethodName.hashCode()) {
-            case -75308287:
-                if (implMethodName.equals("getName")) {
-                    z = false;
-                    break;
-                }
-                break;
-            case 98245393:
-                if (implMethodName.equals("getId")) {
-                    z = true;
-                    break;
-                }
-                break;
-            case 837211371:
-                if (implMethodName.equals("getTypeId")) {
-                    z = true;
-                    break;
-                }
-                break;
-        }
-        switch (z) {
-            case false:
-                if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
-                    return (v0) -> {
-                        return v0.getName();
-                    };
-                }
-                break;
-            case true:
-                if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
-                    return (v0) -> {
-                        return v0.getId();
-                    };
-                }
-                break;
-            case true:
-                if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/Product") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
-                    return (v0) -> {
-                        return v0.getTypeId();
-                    };
-                }
-                break;
-        }
-        throw new IllegalArgumentException("Invalid lambda deserialization");
-    }
 
     public ProductTypeServiceImpl(final ProductMapper productMapper) {
         this.productMapper = productMapper;
@@ -77,9 +30,11 @@
     @Override // org.springblade.modules.cps.service.IProductTypeService
     public Boolean removeIds(List<Long> ids) {
         ids.forEach(id -> {
+        	Long count = this.productMapper.selectCount(Wrappers.<Product>lambdaQuery().eq(Product::getTypeId, id));
+        	/*
             Long count = this.productMapper.selectCount((Wrapper) Wrappers.lambdaQuery().eq((v0) -> {
                 return v0.getTypeId();
-            }, id));
+            }, id));*/
             if (count.longValue() > 0) {
                 throw new ServiceException(MessageUtils.message("cps.product.type.not.delete", new Object[0]));
             }
@@ -94,11 +49,14 @@
     }
 
     private void checkProductTypeName(ProductType productType) {
+    	long count = count(Wrappers.<ProductType>lambdaQuery().ne(Func.isNotEmpty(productType.getId()), ProductType::getId, productType.getId())
+    			.eq(ProductType::getName, productType.getName()));
+    	/*
         long count = count((Wrapper) Wrappers.lambdaQuery().ne(Func.isNotEmpty(productType.getId()), (v0) -> {
             return v0.getId();
         }, productType.getId()).eq((v0) -> {
             return v0.getName();
-        }, productType.getName()));
+        }, productType.getName()));*/
         if (count > 0) {
             throw new ServiceException(MessageUtils.message("cps.product.type.name.exists", new Object[0]));
         }

--
Gitblit v1.9.3