重构单点-2

This commit is contained in:
zjf committed 2024-12-09 14:36:59 +08:00
1 parent 4251d4960b
commit 887512c5fe
15 files changed
+204 -75

No files matched your search

+4
View File
@@ -28,6 +28,10 @@
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-extension</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring</artifactId>
</dependency>
<!--feign 工具类-->
<dependency>
<groupId>com.bsd</groupId>
@@ -21,6 +21,7 @@ package com.bsd.pjcloud.thirdparty.api.feign;
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
import com.bsd.pjcloud.common.core.util.R;
import com.bsd.pjcloud.common.feign.annotation.NoToken;
import com.bsd.pjcloud.thirdparty.entity.ThirdPartyUserEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
@@ -43,5 +44,15 @@ public interface RemoterThirdPartyAuthService {
R zzdsso(@RequestParam("token") String token);
/**
* 根据钉钉号查询第三方表里面是否有这个人,也就是浙政钉总体系人员表
* @param employeeCode
* @return
*/
@NoToken
@GetMapping("/thirdPartyUser/getUserByEmployeeCode")
R<List<ThirdPartyUserEntity>> getUserByEmployeeCode(@RequestParam("employeeCode") String employeeCode);
}
@@ -1,19 +1,13 @@
package com.bsd.pjcloud.thirdparty.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bsd.pjcloud.common.core.util.R;
import com.bsd.pjcloud.thirdparty.entity.ThirdPartyDeptEntity;
import com.bsd.pjcloud.thirdparty.service.ThirdPartyOAuth2Service;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bsd.pjcloud.common.core.util.R;
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
import com.bsd.pjcloud.common.log.annotation.SysLog;
import com.bsd.pjcloud.common.security.annotation.Inner;
import com.bsd.pjcloud.thirdparty.entity.ThirdPartyUserEntity;
import com.bsd.pjcloud.thirdparty.service.ThirdPartyUserService;
import io.swagger.v3.oas.annotations.Operation;
@@ -115,4 +116,15 @@ public class ThirdPartyUserController {
public List<ThirdPartyUserEntity> export(ThirdPartyUserEntity thirdPartyUser,Long[] ids) {
return thirdPartyUserService.list(Wrappers.lambdaQuery(thirdPartyUser).in(ArrayUtil.isNotEmpty(ids), ThirdPartyUserEntity::getId, ids));
}
@Operation(summary = "根据钉钉号查找某个人" )
@GetMapping("/getUserByEmployeeCode" )
@Inner
public R<List<ThirdPartyUserEntity>> getUserByEmployeeCode(@RequestParam("employeeCode")String employeeCode) {
LambdaQueryWrapper<ThirdPartyUserEntity> wrapper = Wrappers.lambdaQuery();
wrapper.eq(ThirdPartyUserEntity::getDingtalkEmployeeCode, employeeCode);
List<ThirdPartyUserEntity> list = thirdPartyUserService.list(wrapper);
return R.ok(list);
}
}