From 6cbeec5fa8e11547b1baec937575376b780aeb2e Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期二, 09 四月 2024 13:38:54 +0800
Subject: [PATCH] manboot能启动了

---
 smart-man-boot/src/main/java/com/qianwen/smartman/modules/system/controller/BasCoderuleController.java |  162 +++++++++++++-----------------------------------------
 1 files changed, 39 insertions(+), 123 deletions(-)

diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/system/controller/BasCoderuleController.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/system/controller/BasCoderuleController.java
index 001d1b3..a02aa8d 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/system/controller/BasCoderuleController.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/system/controller/BasCoderuleController.java
@@ -8,6 +8,29 @@
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.qianwen.core.boot.ctrl.BladeController;
+import com.qianwen.core.mp.support.Condition;
+import com.qianwen.core.mp.support.Query;
+import com.qianwen.core.scanner.modular.annotation.GetResource;
+import com.qianwen.core.scanner.modular.stereotype.ApiResource;
+import com.qianwen.core.tool.api.R;
+import com.qianwen.core.tool.utils.Func;
+import com.qianwen.smartman.common.constant.ExtCacheConstant;
+import com.qianwen.smartman.common.utils.Lambda;
+import com.qianwen.smartman.modules.system.convert.BasCoderuleConvert;
+import com.qianwen.smartman.modules.system.dto.BasCoderuleDTO;
+import com.qianwen.smartman.common.cache.CodeRuleCache;
+import com.qianwen.smartman.modules.system.dto.BaseCodeRuleQueryDTO;
+import com.qianwen.smartman.modules.system.entity.BasCodeRule;
+import com.qianwen.smartman.modules.system.entity.MetaObjectType;
+import com.qianwen.smartman.modules.system.service.IBasCoderuleService;
+import com.qianwen.smartman.modules.system.service.ICodeGeneratorService;
+import com.qianwen.smartman.modules.system.service.IMetaObjectTypeService;
+import com.qianwen.smartman.modules.system.vo.UserVO;
+import com.qianwen.core.log.exception.ServiceException;
+import com.qianwen.core.secure.annotation.PreAuth;
+import com.qianwen.core.tool.api.ResultCode;
+import com.qianwen.core.scanner.modular.annotation.PostResource;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -17,30 +40,7 @@
 import java.util.Map;
 import java.util.stream.Collectors;
 import javax.validation.Valid;
-import com.qianwen.smartman.common.cache.CodeRuleCache;
-import com.qianwen.smartman.common.constant.ExtCacheConstant;
-import com.qianwen.smartman.common.utils.Lambda;
-import com.qianwen.core.boot.ctrl.BladeController;
 import com.qianwen.core.cache.utils.CacheUtil;
-import com.qianwen.core.log.exception.ServiceException;
-import com.qianwen.core.mp.support.Condition;
-import com.qianwen.core.mp.support.Query;
-import com.qianwen.core.scanner.modular.annotation.GetResource;
-import com.qianwen.core.scanner.modular.annotation.PostResource;
-import com.qianwen.core.scanner.modular.stereotype.ApiResource;
-import com.qianwen.core.secure.annotation.PreAuth;
-import com.qianwen.core.tool.api.R;
-import com.qianwen.core.tool.api.ResultCode;
-import com.qianwen.core.tool.utils.Func;
-import com.qianwen.smartman.modules.system.convert.BasCoderuleConvert;
-import com.qianwen.smartman.modules.system.dto.BasCoderuleDTO;
-import com.qianwen.smartman.modules.system.dto.BaseCodeRuleQueryDTO;
-import com.qianwen.smartman.modules.system.entity.BasCodeRule;
-import com.qianwen.smartman.modules.system.entity.MetaObjectType;
-import com.qianwen.smartman.modules.system.service.IBasCoderuleService;
-import com.qianwen.smartman.modules.system.service.ICodeGeneratorService;
-import com.qianwen.smartman.modules.system.service.IMetaObjectTypeService;
-import com.qianwen.smartman.modules.system.vo.UserVO;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -55,101 +55,6 @@
     private IBasCoderuleService basCoderuleService;
     private IMetaObjectTypeService metaObjectTypeService;
     private ICodeGeneratorService codeGeneratorService;
-
-    private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
-        String implMethodName = lambda.getImplMethodName();
-        boolean z = true;
-        switch (implMethodName.hashCode()) {
-            case -464233508:
-                if (implMethodName.equals("getBillFormId")) {
-                    z = true;
-                    break;
-                }
-                break;
-            case -75308287:
-                if (implMethodName.equals("getName")) {
-                    z = true;
-                    break;
-                }
-                break;
-            case 16953342:
-                if (implMethodName.equals("getSubsysId")) {
-                    z = true;
-                    break;
-                }
-                break;
-            case 58947841:
-                if (implMethodName.equals("getRuleFieldDictKey")) {
-                    z = false;
-                    break;
-                }
-                break;
-            case 761390710:
-                if (implMethodName.equals("getRemark")) {
-                    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/system/entity/BasCodeRule") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
-                    return (v0) -> {
-                        return v0.getRuleFieldDictKey();
-                    };
-                }
-                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/system/entity/BasCodeRule") && 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/modules/system/entity/BasCodeRule") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
-                    return (v0) -> {
-                        return v0.getRemark();
-                    };
-                }
-                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/system/entity/BasCodeRule") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
-                    return (v0) -> {
-                        return v0.getBillFormId();
-                    };
-                }
-                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/system/entity/BasCodeRule") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
-                    return (v0) -> {
-                        return v0.getBillFormId();
-                    };
-                }
-                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/system/entity/BasCodeRule") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
-                    return (v0) -> {
-                        return v0.getBillFormId();
-                    };
-                }
-                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/system/entity/BasCodeRule") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
-                    return (v0) -> {
-                        return v0.getBillFormId();
-                    };
-                }
-                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/system/entity/BasCodeRule") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
-                    return (v0) -> {
-                        return v0.getBillFormId();
-                    };
-                }
-                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/system/entity/MetaObjectType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
-                    return (v0) -> {
-                        return v0.getSubsysId();
-                    };
-                }
-                break;
-        }
-        throw new IllegalArgumentException("Invalid lambda deserialization");
-    }
 
     public BasCoderuleController(final IBasCoderuleService basCoderuleService, final IMetaObjectTypeService metaObjectTypeService, final ICodeGeneratorService codeGeneratorService) {
         this.basCoderuleService = basCoderuleService;
@@ -172,16 +77,25 @@
     public R<IPage<BasCodeRule>> list(BaseCodeRuleQueryDTO baseCodeRuleQueryDTO, Query query) {
         List<String> list = new ArrayList<>();
         if (Func.isNotEmpty(baseCodeRuleQueryDTO.getSubsysId())) {
+        	List<MetaObjectType> metaObjectTypes = this.metaObjectTypeService.list(Wrappers.<MetaObjectType>lambdaQuery()
+        			.eq(MetaObjectType::getSubsysId, baseCodeRuleQueryDTO.getSubsysId()));
+        	/*
             List<MetaObjectType> metaObjectTypes = this.metaObjectTypeService.list((Wrapper) Wrappers.lambdaQuery().eq((v0) -> {
                 return v0.getSubsysId();
-            }, baseCodeRuleQueryDTO.getSubsysId()));
+            }, baseCodeRuleQueryDTO.getSubsysId()));*/
             if (metaObjectTypes.isEmpty()) {
-                return R.data(new Page());
+                return R.data(new Page<>());
             }
-            list = (List) metaObjectTypes.stream().map((v0) -> {
+            list = metaObjectTypes.stream().map((v0) -> {
                 return v0.getFId();
             }).collect(Collectors.toList());
         }
+        IPage<BasCodeRule> pages = this.basCoderuleService.page(Condition.getPage(query), Wrappers.<BasCodeRule>lambdaQuery()
+                .eq(Func.isNotEmpty(baseCodeRuleQueryDTO.getDictKey()), BasCodeRule::getRuleFieldDictKey, baseCodeRuleQueryDTO.getDictKey())
+                .eq(Func.isNotEmpty(baseCodeRuleQueryDTO.getObjectId()), BasCodeRule::getBillFormId, baseCodeRuleQueryDTO.getObjectId())
+                .in(Func.isNotEmpty(list), BasCodeRule::getBillFormId, list)
+                .and(Func.isNotEmpty(baseCodeRuleQueryDTO.getCondition()), wrapper -> wrapper.like(BasCodeRule::getName, baseCodeRuleQueryDTO.getCondition()).or().like(BasCodeRule::getRemark, baseCodeRuleQueryDTO.getCondition())));
+        /*
         IPage<BasCodeRule> pages = this.basCoderuleService.page(Condition.getPage(query), Wrappers.lambdaQuery().eq(Func.isNotEmpty(baseCodeRuleQueryDTO.getDictKey()), (v0) -> {
             return v0.getRuleFieldDictKey();
         }, baseCodeRuleQueryDTO.getDictKey()).eq(Func.isNotEmpty(baseCodeRuleQueryDTO.getObjectId()), (v0) -> {
@@ -194,7 +108,7 @@
             }, baseCodeRuleQueryDTO.getCondition())).or()).like((v0) -> {
                 return v0.getRemark();
             }, baseCodeRuleQueryDTO.getCondition());
-        }));
+        }));*/
         return R.data(pages);
     }
 
@@ -210,11 +124,13 @@
     @GetResource({"/count-all"})
     @ApiOperation(value = "count-all", notes = "鏌ヨ鎵�鏈変笟鍔″璞$紪鐮佽鍒欐暟閲�")
     public R countAll() {
+    	Wrapper<BasCodeRule> w = (new QueryWrapper<BasCodeRule>()).select(new String[] { "count(1) as \"count\"", Lambda.getName(BasCodeRule::getBillFormId) }).lambda().groupBy(BasCodeRule::getBillFormId);
+    	/*
         Wrapper w = (Wrapper) new QueryWrapper().select(new String[]{"count(1) as \"count\"", Lambda.getName((v0) -> {
             return v0.getBillFormId();
         })}).lambda().groupBy((v0) -> {
             return v0.getBillFormId();
-        });
+        });*/
         return R.data(BasCoderuleConvert.INSTANCE.convert(this.basCoderuleService.listMaps(w)));
     }
 

--
Gitblit v1.9.3