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
7359c8da
Commit
7359c8da
authored
Jan 15, 2025
by
huyuchen
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/MVP1.7.5' into MVP1.7.5
parents
78057d56
4ae8fd06
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
178 additions
and
90 deletions
+178
-90
CorsConfig.java
...m/yifu/cloud/plus/v1/yifu/archives/config/CorsConfig.java
+32
-20
CorsConfig.java
...a/com/yifu/cloud/plus/v1/yifu/auth/config/CorsConfig.java
+32
-20
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+1
-1
TInsuranceDetailMapper.xml
...in/resources/mapper/insurances/TInsuranceDetailMapper.xml
+1
-1
CorsConfig.java
...com/yifu/cloud/plus/v1/yifu/salary/config/CorsConfig.java
+32
-20
TSalaryStandardController.java
.../v1/yifu/salary/controller/TSalaryStandardController.java
+1
-1
TSalaryStandardService.java
...d/plus/v1/yifu/salary/service/TSalaryStandardService.java
+1
-1
TSalaryStandardServiceImpl.java
.../yifu/salary/service/impl/TSalaryStandardServiceImpl.java
+5
-6
CorsConfig.java
...com/yifu/cloud/plus/v1/yifu/social/config/CorsConfig.java
+41
-0
CorsConfig.java
.../com/yifu/cloud/plus/v1/yifu/admin/config/CorsConfig.java
+32
-20
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/config/CorsConfig.java
View file @
7359c8da
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.web.servlet.FilterRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
org.springframework.web.cors.CorsConfiguration
;
import
org.springframework.web.cors.UrlBasedCorsConfigurationSource
;
import
org.springframework.web.filter.CorsFilter
;
import
java.util.Collections
;
/**
*
Description: 允许跨域以
*
CORS资源共享配置
*
* @author fxju
* @since JDK 1.8
*/
@Slf4j
@Configuration
public
class
CorsConfig
implements
WebMvcConfigurer
{
@Override
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
registry
.
addMapping
(
"/**"
)
//是否发送Cookie
.
allowCredentials
(
true
)
//放行哪些原始域
.
allowedOriginPatterns
(
"*"
)
.
allowedMethods
(
new
String
[]{
"GET"
,
"POST"
,
"PUT"
,
"DELETE"
})
.
allowedHeaders
(
"*"
)
.
exposedHeaders
(
"*"
);
}
public
class
CorsConfig
{
@Bean
public
FilterRegistrationBean
filterRegistrationBean
()
{
CorsConfiguration
corsConfiguration
=
new
CorsConfiguration
();
//1.允许任何来源
corsConfiguration
.
setAllowedOriginPatterns
(
Collections
.
singletonList
(
"*"
));
//2.允许任何请求头
corsConfiguration
.
addAllowedHeader
(
CorsConfiguration
.
ALL
);
//3.允许任何方法
corsConfiguration
.
addAllowedMethod
(
CorsConfiguration
.
ALL
);
//4.允许凭证
corsConfiguration
.
setAllowCredentials
(
true
);
UrlBasedCorsConfigurationSource
source
=
new
UrlBasedCorsConfigurationSource
();
source
.
registerCorsConfiguration
(
"/**"
,
corsConfiguration
);
CorsFilter
corsFilter
=
new
CorsFilter
(
source
);
FilterRegistrationBean
<
CorsFilter
>
filterRegistrationBean
=
new
FilterRegistrationBean
<>(
corsFilter
);
// order 需要再 securityFilter 前
filterRegistrationBean
.
setOrder
(-
101
);
// 小于 SpringSecurity Filter的 Order(-100) 即可
return
filterRegistrationBean
;
}
}
yifu-auth/src/main/java/com/yifu/cloud/plus/v1/yifu/auth/config/CorsConfig.java
View file @
7359c8da
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
auth
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.web.servlet.FilterRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
org.springframework.web.cors.CorsConfiguration
;
import
org.springframework.web.cors.UrlBasedCorsConfigurationSource
;
import
org.springframework.web.filter.CorsFilter
;
import
java.util.Collections
;
/**
*
Description: 允许跨域以
*
CORS资源共享配置
*
* @author fxju
* @since JDK 1.8
*/
@Slf4j
@Configuration
public
class
CorsConfig
implements
WebMvcConfigurer
{
@Override
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
registry
.
addMapping
(
"/**"
)
//是否发送Cookie
.
allowCredentials
(
true
)
//放行哪些原始域
.
allowedOriginPatterns
(
"*"
)
.
allowedMethods
(
new
String
[]{
"GET"
,
"POST"
,
"PUT"
,
"DELETE"
})
.
allowedHeaders
(
"*"
)
.
exposedHeaders
(
"*"
);
}
public
class
CorsConfig
{
@Bean
public
FilterRegistrationBean
filterRegistrationBean
()
{
CorsConfiguration
corsConfiguration
=
new
CorsConfiguration
();
//1.允许任何来源
corsConfiguration
.
setAllowedOriginPatterns
(
Collections
.
singletonList
(
"*"
));
//2.允许任何请求头
corsConfiguration
.
addAllowedHeader
(
CorsConfiguration
.
ALL
);
//3.允许任何方法
corsConfiguration
.
addAllowedMethod
(
CorsConfiguration
.
ALL
);
//4.允许凭证
corsConfiguration
.
setAllowCredentials
(
true
);
UrlBasedCorsConfigurationSource
source
=
new
UrlBasedCorsConfigurationSource
();
source
.
registerCorsConfiguration
(
"/**"
,
corsConfiguration
);
CorsFilter
corsFilter
=
new
CorsFilter
(
source
);
FilterRegistrationBean
<
CorsFilter
>
filterRegistrationBean
=
new
FilterRegistrationBean
<>(
corsFilter
);
// order 需要再 securityFilter 前
filterRegistrationBean
.
setOrder
(-
101
);
// 小于 SpringSecurity Filter的 Order(-100) 即可
return
filterRegistrationBean
;
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceDetailServiceImpl.java
View file @
7359c8da
...
...
@@ -8218,7 +8218,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List
<
SalaryRiskVo
>
list
=
new
ArrayList
<>();
SalaryRiskVo
riskVo
;
Map
<
String
,
String
>
idMap
=
new
HashMap
<>();
if
(
detailList
!=
null
)
{
if
(
detailList
!=
null
&&
!
detailList
.
isEmpty
()
)
{
for
(
TInsuranceDetail
d
:
detailList
)
{
idMap
.
put
(
d
.
getEmpIdcardNo
(),
d
.
getEmpName
());
}
...
...
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/insurances/TInsuranceDetailMapper.xml
View file @
7359c8da
...
...
@@ -1475,7 +1475,7 @@
ID,
EMP_NAME,
EMP_IDCARD_NO
FROM t_insurance_detail
FROM t_insurance_detail
d
where DELETE_FLAG = 0
and (d.BUY_HANDLE_STATUS in (1,2) or (d.BUY_HANDLE_STATUS = 3 and d.IS_EFFECT = 0))
and d.POLICY_EFFECT
<![CDATA[ <= ]]>
NOW() and d.POLICY_END >= NOW()
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/config/CorsConfig.java
View file @
7359c8da
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.web.servlet.FilterRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
org.springframework.web.cors.CorsConfiguration
;
import
org.springframework.web.cors.UrlBasedCorsConfigurationSource
;
import
org.springframework.web.filter.CorsFilter
;
import
java.util.Collections
;
/**
*
Description: 允许跨域以
*
CORS资源共享配置
*
* @author fxju
* @since JDK 1.8
*/
@Slf4j
@Configuration
public
class
CorsConfig
implements
WebMvcConfigurer
{
@Override
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
registry
.
addMapping
(
"/**"
)
//是否发送Cookie
.
allowCredentials
(
true
)
//放行哪些原始域
.
allowedOriginPatterns
(
"*"
)
.
allowedMethods
(
new
String
[]{
"GET"
,
"POST"
,
"PUT"
,
"DELETE"
})
.
allowedHeaders
(
"*"
)
.
exposedHeaders
(
"*"
);
}
public
class
CorsConfig
{
@Bean
public
FilterRegistrationBean
filterRegistrationBean
()
{
CorsConfiguration
corsConfiguration
=
new
CorsConfiguration
();
//1.允许任何来源
corsConfiguration
.
setAllowedOriginPatterns
(
Collections
.
singletonList
(
"*"
));
//2.允许任何请求头
corsConfiguration
.
addAllowedHeader
(
CorsConfiguration
.
ALL
);
//3.允许任何方法
corsConfiguration
.
addAllowedMethod
(
CorsConfiguration
.
ALL
);
//4.允许凭证
corsConfiguration
.
setAllowCredentials
(
true
);
UrlBasedCorsConfigurationSource
source
=
new
UrlBasedCorsConfigurationSource
();
source
.
registerCorsConfiguration
(
"/**"
,
corsConfiguration
);
CorsFilter
corsFilter
=
new
CorsFilter
(
source
);
FilterRegistrationBean
<
CorsFilter
>
filterRegistrationBean
=
new
FilterRegistrationBean
<>(
corsFilter
);
// order 需要再 securityFilter 前
filterRegistrationBean
.
setOrder
(-
101
);
// 小于 SpringSecurity Filter的 Order(-100) 即可
return
filterRegistrationBean
;
}
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/controller/TSalaryStandardController.java
View file @
7359c8da
...
...
@@ -198,7 +198,7 @@ public class TSalaryStandardController {
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
user
!=
null
)
{
// 2025-1-14 10:59:37 提交前拦截:
return
tSalaryStandardService
.
jud
eg
Risk
(
s
,
user
);
return
tSalaryStandardService
.
jud
ge
Risk
(
s
,
user
);
}
else
{
return
R
.
failed
(
"请登录!"
);
}
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/TSalaryStandardService.java
View file @
7359c8da
...
...
@@ -152,6 +152,6 @@ public interface TSalaryStandardService extends IService<TSalaryStandard> {
* @Date: 2025/1/14 11:01
* @return: java.lang.String
**/
R
<
List
<
SalaryRiskVo
>>
jud
eg
Risk
(
TSalaryStandard
s
,
YifuUser
user
);
R
<
List
<
SalaryRiskVo
>>
jud
ge
Risk
(
TSalaryStandard
s
,
YifuUser
user
);
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryStandardServiceImpl.java
View file @
7359c8da
...
...
@@ -1099,7 +1099,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryRiskVo>>
**/
@Override
public
R
<
List
<
SalaryRiskVo
>>
jud
eg
Risk
(
TSalaryStandard
s
,
YifuUser
user
)
{
public
R
<
List
<
SalaryRiskVo
>>
jud
ge
Risk
(
TSalaryStandard
s
,
YifuUser
user
)
{
// 1 判断项目信息:是否含风险、含商险服务项
R
<
TSettleDomainSelectVo
>
sdr
=
HttpDaprUtil
.
invokeMethodPost
(
archivesProperties
.
getAppUrl
(),
archivesProperties
.
getAppId
()
...
...
@@ -1119,7 +1119,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
,
"/insuranceDetail/inner/getRiskByIdCard"
,
accountList
,
SalaryRiskListVo
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
riskListVoR
==
null
||
riskListVoR
.
getCode
()
==
CommonConstants
.
FAIL
)
{
return
R
.
failed
(
"校验商险返回
未空,
请联系管理员"
);
return
R
.
failed
(
"校验商险返回
为空,请稍后重试,多次失败
请联系管理员"
);
}
else
{
SalaryRiskListVo
vo
=
riskListVoR
.
getData
();
// 未购买商险列表
...
...
@@ -1184,15 +1184,14 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
return
new
R
<>(
CommonConstants
.
TWO_INT
,
"校验商险不通过!"
,
returnList
);
}
}
else
{
return
R
.
ok
();
return
R
.
ok
(
null
,
"均已购买商险"
);
}
}
}
else
{
return
R
.
ok
();
return
R
.
ok
(
null
,
"没有报账明细,无需拦截"
);
}
}
else
{
return
R
.
ok
();
return
R
.
ok
(
null
,
"项目不含风险 或 无商险"
);
}
}
else
{
return
R
.
failed
(
"获取项目信息失败,请联管理员!"
);
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/config/CorsConfig.java
0 → 100644
View file @
7359c8da
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
social
.
config
;
import
org.springframework.boot.web.servlet.FilterRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.cors.CorsConfiguration
;
import
org.springframework.web.cors.UrlBasedCorsConfigurationSource
;
import
org.springframework.web.filter.CorsFilter
;
import
java.util.Collections
;
/**
* CORS资源共享配置
*
*/
@Configuration
public
class
CorsConfig
{
@Bean
public
FilterRegistrationBean
filterRegistrationBean
()
{
CorsConfiguration
corsConfiguration
=
new
CorsConfiguration
();
//1.允许任何来源
corsConfiguration
.
setAllowedOriginPatterns
(
Collections
.
singletonList
(
"*"
));
//2.允许任何请求头
corsConfiguration
.
addAllowedHeader
(
CorsConfiguration
.
ALL
);
//3.允许任何方法
corsConfiguration
.
addAllowedMethod
(
CorsConfiguration
.
ALL
);
//4.允许凭证
corsConfiguration
.
setAllowCredentials
(
true
);
UrlBasedCorsConfigurationSource
source
=
new
UrlBasedCorsConfigurationSource
();
source
.
registerCorsConfiguration
(
"/**"
,
corsConfiguration
);
CorsFilter
corsFilter
=
new
CorsFilter
(
source
);
FilterRegistrationBean
<
CorsFilter
>
filterRegistrationBean
=
new
FilterRegistrationBean
<>(
corsFilter
);
// order 需要再 securityFilter 前
filterRegistrationBean
.
setOrder
(-
101
);
// 小于 SpringSecurity Filter的 Order(-100) 即可
return
filterRegistrationBean
;
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/config/CorsConfig.java
View file @
7359c8da
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.web.servlet.FilterRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
org.springframework.web.cors.CorsConfiguration
;
import
org.springframework.web.cors.UrlBasedCorsConfigurationSource
;
import
org.springframework.web.filter.CorsFilter
;
import
java.util.Collections
;
/**
*
Description: 允许跨域以
*
CORS资源共享配置
*
* @author fxju
* @since JDK 1.8
*/
@Slf4j
@Configuration
public
class
CorsConfig
implements
WebMvcConfigurer
{
@Override
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
registry
.
addMapping
(
"/**"
)
//是否发送Cookie
.
allowCredentials
(
true
)
//放行哪些原始域
.
allowedOriginPatterns
(
"*"
)
.
allowedMethods
(
new
String
[]{
"GET"
,
"POST"
,
"PUT"
,
"DELETE"
})
.
allowedHeaders
(
"*"
)
.
exposedHeaders
(
"*"
);
}
public
class
CorsConfig
{
@Bean
public
FilterRegistrationBean
filterRegistrationBean
()
{
CorsConfiguration
corsConfiguration
=
new
CorsConfiguration
();
//1.允许任何来源
corsConfiguration
.
setAllowedOriginPatterns
(
Collections
.
singletonList
(
"*"
));
//2.允许任何请求头
corsConfiguration
.
addAllowedHeader
(
CorsConfiguration
.
ALL
);
//3.允许任何方法
corsConfiguration
.
addAllowedMethod
(
CorsConfiguration
.
ALL
);
//4.允许凭证
corsConfiguration
.
setAllowCredentials
(
true
);
UrlBasedCorsConfigurationSource
source
=
new
UrlBasedCorsConfigurationSource
();
source
.
registerCorsConfiguration
(
"/**"
,
corsConfiguration
);
CorsFilter
corsFilter
=
new
CorsFilter
(
source
);
FilterRegistrationBean
<
CorsFilter
>
filterRegistrationBean
=
new
FilterRegistrationBean
<>(
corsFilter
);
// order 需要再 securityFilter 前
filterRegistrationBean
.
setOrder
(-
101
);
// 小于 SpringSecurity Filter的 Order(-100) 即可
return
filterRegistrationBean
;
}
}
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