yangys
2024-04-01 86cdd920b68274185233383f69ddb974052b6b6f
smart-man-boot/src/main/java/com/qianwen/smartman/modules/system/controller/CustomTemplateFieldController.java
@@ -1,18 +1,17 @@
package com.qianwen.smartman.modules.system.controller;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import java.util.List;
import javax.validation.Valid;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import java.lang.invoke.SerializedLambda;
import java.util.List;
import javax.validation.Valid;
import com.qianwen.smartman.common.cache.RegionCache;
import com.qianwen.smartman.common.constant.CommonConstant;
import com.qianwen.core.boot.ctrl.BladeController;
import com.qianwen.core.mp.support.Condition;
import com.qianwen.core.mp.support.Query;
@@ -23,6 +22,8 @@
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.smartman.common.cache.RegionCache;
import com.qianwen.smartman.common.constant.CommonConstant;
import com.qianwen.smartman.modules.system.convert.CustomTemplateFieldConvert;
import com.qianwen.smartman.modules.system.entity.CustomTemplateField;
import com.qianwen.smartman.modules.system.service.ICustomTemplateFieldService;
@@ -32,10 +33,10 @@
import com.qianwen.smartman.modules.system.vo.CustomTemplateFieldSubmitVO;
import com.qianwen.smartman.modules.system.vo.CustomTemplateFieldUpdateVO;
import com.qianwen.smartman.modules.system.vo.CustomTemplateFieldVO;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@Api(value = "自定义字段表管理", tags = {"自定义字段表管理"})
@ApiResource({"blade-system/custom-template-field"})
@@ -44,116 +45,6 @@
public class CustomTemplateFieldController extends BladeController {
    private final ICustomTemplateFieldService customTemplateFieldService;
    private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
        String implMethodName = lambda.getImplMethodName();
        boolean z = true;
        switch (implMethodName.hashCode()) {
            case -1021252424:
                if (implMethodName.equals("getViewShow")) {
                    z = true;
                    break;
                }
                break;
            case -593710244:
                if (implMethodName.equals("getUpdateShow")) {
                    z = false;
                    break;
                }
                break;
            case -111752440:
                if (implMethodName.equals("getAddShow")) {
                    z = true;
                    break;
                }
                break;
            case 98245393:
                if (implMethodName.equals("getId")) {
                    z = true;
                    break;
                }
                break;
            case 953775504:
                if (implMethodName.equals("getBusinessType")) {
                    z = true;
                    break;
                }
                break;
            case 1071464927:
                if (implMethodName.equals("getCreateTime")) {
                    z = true;
                    break;
                }
                break;
            case 2096138965:
                if (implMethodName.equals("getSystemField")) {
                    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/CustomTemplateField") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
                    return (v0) -> {
                        return v0.getUpdateShow();
                    };
                }
                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/util/Date;")) {
                    return (v0) -> {
                        return v0.getCreateTime();
                    };
                }
                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/CustomTemplateField") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
                    return (v0) -> {
                        return v0.getSystemField();
                    };
                }
                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/CustomTemplateField") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
                    return (v0) -> {
                        return v0.getSystemField();
                    };
                }
                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/CustomTemplateField") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
                    return (v0) -> {
                        return v0.getViewShow();
                    };
                }
                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/CustomTemplateField") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
                    return (v0) -> {
                        return v0.getBusinessType();
                    };
                }
                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/CustomTemplateField") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
                    return (v0) -> {
                        return v0.getBusinessType();
                    };
                }
                break;
            case RegionCache.VILLAGE_LEVEL /* 5 */:
                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/system/entity/CustomTemplateField") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
                    return (v0) -> {
                        return v0.getAddShow();
                    };
                }
                break;
        }
        throw new IllegalArgumentException("Invalid lambda deserialization");
    }
    public CustomTemplateFieldController(final ICustomTemplateFieldService customTemplateFieldService) {
        this.customTemplateFieldService = customTemplateFieldService;
@@ -173,6 +64,13 @@
    @ApiOperation(value = "自定义字段表列表", notes = "传入业务类型")
    @PreAuth
    public R<List<CustomTemplateFieldVO>> list(@RequestParam @ApiParam("业务类型") Integer businessType) {
       List<CustomTemplateField> list = this.customTemplateFieldService.list(Wrappers.<CustomTemplateField>lambdaQuery()
               .eq(CustomTemplateField::getBusinessType, businessType)
               .and(i -> i.ne(CustomTemplateField::getAddShow, CommonConstant.DISABLE).or().ne(CustomTemplateField::getUpdateShow, CommonConstant.DISABLE).or().ne(CustomTemplateField::getViewShow, CommonConstant.DISABLE))
               .orderByDesc(CustomTemplateField::getSystemField).orderByDesc(CustomTemplateField::getId));
       /*
        List<CustomTemplateField> list = this.customTemplateFieldService.list((Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
            return v0.getBusinessType();
        }, businessType)).and(i -> {
@@ -187,7 +85,7 @@
            return v0.getSystemField();
        })).orderByDesc((v0) -> {
            return v0.getId();
        }));
        }));*/
        return R.data(CustomTemplateFieldConvert.INSTANCE.convert(list));
    }
@@ -203,13 +101,17 @@
    @GetResource({"/page"})
    @ApiOperation(value = "自定义字段表分页", notes = "传入map")
    public R<IPage<CustomTemplateFieldVO>> page(@RequestParam @ApiParam("业务类型") Integer businessType, Query query) {
       IPage<CustomTemplateField> pages = this.customTemplateFieldService.page(Condition.getPage(query), Wrappers.<CustomTemplateField>lambdaQuery()
             .eq(CustomTemplateField::getBusinessType, businessType)
               .orderByDesc(CustomTemplateField::getSystemField).orderByDesc(CustomTemplateField::getCreateTime));
       /*
        IPage<CustomTemplateField> pages = this.customTemplateFieldService.page(Condition.getPage(query), (Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
            return v0.getBusinessType();
        }, businessType)).orderByDesc((v0) -> {
            return v0.getSystemField();
        })).orderByDesc((v0) -> {
            return v0.getCreateTime();
        }));
        }));*/
        return R.data(CustomTemplateFieldConvert.INSTANCE.convert(pages));
    }