Commit c33c5a9f authored by fangxinjiang's avatar fangxinjiang

社保公积金调整

parent f595cafb
......@@ -27,12 +27,14 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SettleDomainUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
......@@ -57,7 +59,6 @@ import java.util.List;
public class TEmpFamilyController {
private final DaprCheckProperties daprCheckProperties;
private final TEmpFamilyService tEmpFamilyService;
/**
* 分页查询
* @param page 分页对象
......
......@@ -34,6 +34,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
......
......@@ -4,10 +4,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.extern.log4j.Log4j2;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.http.*;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.client.RestTemplate;
......@@ -55,6 +52,45 @@ public class HttpDaprUtil {
return R.failed("获取信息失败!");
}
}
/**
* @param appUrl
* @param appId
* @param method
* @param param
* @param cs
* @return com.yifu.cloud.plus.v1.yifu.common.core.util.R<T>
* @author fxj
* @date 2022-05-23 17:56
* @description get请求获取指定对象信息
**/
public static <T> R<T> invokeMethodGet(String appUrl,
String appId,
String method,
String param,
Class cs,
@RequestHeader(SecurityConstants.FROM) String from) {
// 实例化 RestTemplate
initResTemplate();
// 初始化请求URL
initUrl(appUrl, appId, method, param);
ResponseEntity<T> res;
HttpHeaders headers = new HttpHeaders();
headers.add(SecurityConstants.FROM, from);
headers.setContentType(MediaType.APPLICATION_JSON);
headers.add("Authorization", null);
HttpEntity<String> entity = new HttpEntity(param, headers);
try {
res = restTemplate.exchange(stringBuffer.toString(), HttpMethod.GET,entity,cs);
} catch (Exception e) {
return R.failed("获取信息失败:" + e.getMessage());
}
if (null != res && CommonConstants.SUCCESS == res.getStatusCodeValue()) {
return R.ok(res.getBody());
} else {
return R.failed("获取信息失败!");
}
}
public static <T> R<T> invokeMethodPost(String appUrl,
String appId,
......
......@@ -18,13 +18,12 @@ import java.util.List;
* @Version 1.0
*/
@Log4j2
@Component
@EnableConfigurationProperties(DaprArchivesProperties.class)
public class SettleDomainUtil {
@Autowired
private DaprArchivesProperties daprArchivesProperties;
public R<List<String>> getSettleDomainIdsByUserId(){
R<List<String>> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/getSettleDomainIdsByUserId","", Object.class, SecurityConstants.FROM_IN);
R<List<String>> res = HttpDaprUtil.invokeMethodGet(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/getSettleDomainIdsByUserId","", Object.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("获取用户项目权限失败!");
}
......
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yifu.cloud.plus.v1.yifu.common.dapr.util.SettleDomainUtil
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment