Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
c33c5a9f
Commit
c33c5a9f
authored
Jul 18, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
社保公积金调整
parent
f595cafb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
7 deletions
+46
-7
TEmpFamilyController.java
...lus/v1/yifu/archives/controller/TEmpFamilyController.java
+2
-1
TSettleDomainController.java
.../v1/yifu/archives/controller/TSettleDomainController.java
+1
-0
HttpDaprUtil.java
...ifu/cloud/plus/v1/yifu/common/dapr/util/HttpDaprUtil.java
+40
-4
SettleDomainUtil.java
...cloud/plus/v1/yifu/common/dapr/util/SettleDomainUtil.java
+1
-2
spring.factories
...-common-dapr/src/main/resources/META-INF/spring.factories
+2
-0
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmpFamilyController.java
View file @
c33c5a9f
...
...
@@ -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 分页对象
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TSettleDomainController.java
View file @
c33c5a9f
...
...
@@ -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
;
...
...
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/HttpDaprUtil.java
View file @
c33c5a9f
...
...
@@ -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
,
...
...
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/SettleDomainUtil.java
View file @
c33c5a9f
...
...
@@ -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
.
invokeMethod
Pos
t
(
daprArchivesProperties
.
getAppUrl
(),
daprArchivesProperties
.
getAppId
(),
"/tsettledomain/getSettleDomainIdsByUserId"
,
""
,
Object
.
class
,
SecurityConstants
.
FROM_IN
);
R
<
List
<
String
>>
res
=
HttpDaprUtil
.
invokeMethod
Ge
t
(
daprArchivesProperties
.
getAppUrl
(),
daprArchivesProperties
.
getAppId
(),
"/tsettledomain/getSettleDomainIdsByUserId"
,
""
,
Object
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
Common
.
isEmpty
(
res
)){
return
R
.
failed
(
"获取用户项目权限失败!"
);
}
...
...
yifu-common/yifu-common-dapr/src/main/resources/META-INF/spring.factories
0 → 100644
View file @
c33c5a9f
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yifu.cloud.plus.v1.yifu.common.dapr.util.SettleDomainUtil
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment