| | |
| | | package com.qianwen.smartman.modules.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import java.util.List; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | 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.smartman.common.constant.ExtCacheConstant; |
| | | import com.qianwen.smartman.common.validator.ValidatorGroup; |
| | | import com.qianwen.core.boot.ctrl.BladeController; |
| | | import com.qianwen.core.cache.utils.CacheUtil; |
| | | import com.qianwen.core.excel.util.ExcelUtil; |
| | |
| | | import com.qianwen.core.tool.api.R; |
| | | import com.qianwen.core.tool.utils.DateUtil; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.cache.RegionCache; |
| | | import com.qianwen.smartman.common.constant.CommonConstant; |
| | | import com.qianwen.smartman.common.constant.ExtCacheConstant; |
| | | import com.qianwen.smartman.common.validator.ValidatorGroup; |
| | | import com.qianwen.smartman.modules.resource.builder.oss.OssBuilder; |
| | | import com.qianwen.smartman.modules.resource.enums.TemplateEnum; |
| | | import com.qianwen.smartman.modules.resource.service.ISystemResourceService; |
| | |
| | | import com.qianwen.smartman.modules.system.vo.PostSelectVO; |
| | | import com.qianwen.smartman.modules.system.vo.PostVO; |
| | | import com.qianwen.smartman.modules.system.wrapper.PostWrapper; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | @Api(value = "岗位", tags = {"岗位"}) |
| | | @RestController |
| | |
| | | private final IPostService postService; |
| | | private final OssBuilder ossBuilder; |
| | | private final ISystemResourceService systemResourceService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -75145708: |
| | | if (implMethodName.equals("getSort")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case 771206363: |
| | | if (implMethodName.equals("getTenantId")) { |
| | | 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/Post") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getSort(); |
| | | }; |
| | | } |
| | | 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/tenant/mp/TenantEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getTenantId(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public PostController(final IPostService postService, final OssBuilder ossBuilder, final ISystemResourceService systemResourceService) { |
| | | this.postService = postService; |
| | |
| | | @GetResource({"/list"}) |
| | | @ApiOperation(value = "分页", notes = "传入post") |
| | | public R<IPage<PostVO>> list(Post post, Query query) { |
| | | IPage<Post> pages = this.postService.page(Condition.getPage(query), Condition.getQueryWrapper(post).lambda().orderByAsc(Post::getSort)); |
| | | /* |
| | | IPage<Post> pages = this.postService.page(Condition.getPage(query), (Wrapper) Condition.getQueryWrapper(post).lambda().orderByAsc((v0) -> { |
| | | return v0.getSort(); |
| | | })); |
| | | }));*/ |
| | | return R.data(PostWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | |
| | | @GetResource({"/select"}) |
| | | @ApiOperation(value = "下拉数据源", notes = "传入post") |
| | | public R<List<Post>> select(String tenantId, BladeUser bladeUser) { |
| | | List<Post> list = this.postService.list(Wrappers.<Post>query().lambda().eq(Post::getTenantId, Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()))); |
| | | /* |
| | | List<Post> list = this.postService.list((Wrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getTenantId(); |
| | | }, Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()))); |
| | | }, Func.toStrWithEmpty(tenantId, bladeUser.getTenantId())));*/ |
| | | return R.data(list); |
| | | } |
| | | |