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
a1947598
Commit
a1947598
authored
Mar 08, 2023
by
hongguangwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/MVP1.5.2' into MVP1.5.2
parents
16e091b0
a57b9a73
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
239 additions
and
27 deletions
+239
-27
yifu-social-deployment.yaml
k8s-bash-test/yifu-social-deployment.yaml
+1
-1
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+21
-6
TSettleDomainServiceImpl.java
.../yifu/archives/service/impl/TSettleDomainServiceImpl.java
+3
-0
CacheConstants.java
...oud/plus/v1/yifu/common/core/constant/CacheConstants.java
+15
-0
CommonConstants.java
...ud/plus/v1/yifu/common/core/constant/CommonConstants.java
+0
-2
lock.lua
yifu-common/yifu-common-core/src/main/resources/lock.lua
+16
-0
lua.note
yifu-common/yifu-common-core/src/main/resources/lua.note
+29
-0
unlock.lua
yifu-common/yifu-common-core/src/main/resources/unlock.lua
+12
-0
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+1
-3
TDispatchInfoController.java
...us/v1/yifu/social/controller/TDispatchInfoController.java
+39
-2
TPaymentInfoController.java
...lus/v1/yifu/social/controller/TPaymentInfoController.java
+62
-5
TPreDispatchInfoController.java
...v1/yifu/social/controller/TPreDispatchInfoController.java
+13
-0
TPaymentInfoService.java
...loud/plus/v1/yifu/social/service/TPaymentInfoService.java
+1
-1
TDispatchInfoServiceImpl.java
...v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
+13
-1
TPaymentInfoServiceImpl.java
.../v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
+12
-6
TPaymentInfoMapper.xml
...cial-biz/src/main/resources/mapper/TPaymentInfoMapper.xml
+1
-0
No files found.
k8s-bash-test/yifu-social-deployment.yaml
View file @
a1947598
...
...
@@ -7,7 +7,7 @@ spec: # 资源规范字段
selector
:
# 选择器
matchLabels
:
# 匹配标签
app
:
yifu-social
replicas
:
1
# 声明副本数目
replicas
:
2
# 声明副本数目
#revisionHistoryLimit: 3 # 保留历史版本
#strategy: # 策略
# rollingUpdate: # 滚动更新
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
a1947598
...
...
@@ -264,13 +264,28 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//对比对象
TEmployeeProject
compareProject
=
this
.
getById
(
id
);
if
(
tEmployeeProject
.
getInsuranceStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
if
(
tEmployeeProject
.
getContractStatus
()
==
CommonConstants
.
dingleDigitIntArray
[
1
]
||
tEmployeeProject
.
getInsuranceStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getSocialStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getFundStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
])
{
return
R
.
failed
(
"人员在该项目下存在进行中/未完结的服务,禁止删除"
);
}
// 未作废,在用 或 审核中
long
contractCount
=
contractInfoMapper
.
selectCount
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeContractInfo:
:
getIsObsolete
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getDeptNo
,
tEmployeeProject
.
getDeptNo
())
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_STRING
)
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ZERO_INT
)
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_INT
))
);
if
(
contractCount
>
CommonConstants
.
ZERO_INT
){
return
R
.
failed
(
"人员在该项目下存在合同可用或在途,禁止删除"
);
}
//逻辑删除项目档案
tEmployeeProject
.
setDeleteFlag
(
CommonConstants
.
ONE_STRING
);
baseMapper
.
updateById
(
tEmployeeProject
);
...
...
@@ -416,9 +431,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.
eq
(
TEmployeeContractInfo:
:
getDeptNo
,
tEmployeeProject
.
getDeptNo
())
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_STRING
)
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ZERO_
STRING
)
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ZERO_
INT
)
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_
STRING
))
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_
INT
))
);
if
(
contractCount
>
CommonConstants
.
ZERO_INT
){
errorTemp
.
append
(
"合同可用或在途、"
);
...
...
@@ -612,9 +627,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.
eq
(
TEmployeeContractInfo:
:
getDeptNo
,
tEmployeeProject
.
getDeptNo
())
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_STRING
)
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ZERO_
STRING
)
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ZERO_
INT
)
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_
STRING
))
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_
INT
))
);
if
(
contractCount
>
CommonConstants
.
ZERO_INT
){
errorTemp
.
append
(
"合同可用或在途、"
);
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TSettleDomainServiceImpl.java
View file @
a1947598
...
...
@@ -42,6 +42,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.Cache
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -95,6 +96,8 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
for
(
String
userId
:
userIdList
){
redisUtil
.
remove
(
CacheConstants
.
WXHR_SETTLE_DOMAIN_VOS_BY_USERID
+
"_"
+
userId
);
redisUtil
.
remove
(
CacheConstants
.
WXHR_SETTLE_DOMAIN_NOS_BY_USERID
+
"_"
+
userId
);
redisUtil
.
remove
(
CacheConstants
.
DATA_AUTH_DETAILS
+
"_0"
);
redisUtil
.
remove
(
CacheConstants
.
DATA_AUTH_DETAILS
+
"_1"
);
// 清空userinfo
Objects
.
requireNonNull
(
cacheManager
.
getCache
(
CacheConstants
.
USER_DETAILS
)).
clear
();
redisUtil
.
remove
(
CacheConstants
.
USER_DETAILS
+
"::"
+
user
.
getUsername
());
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CacheConstants.java
View file @
a1947598
...
...
@@ -136,4 +136,19 @@ public interface CacheConstants {
*/
public
static
final
String
WXHR_SETTLE_DOMAIN_NOS_BY_USERID
=
ServiceNameConstants
.
ARCHIVES_SERVICE
+
"_SettleDomainNosByUserId"
;
String
PUSH_PAYMENT_SOCIAL_FUND_CACHE
=
"push_payment_social_fund_cache"
;
String
PAYMENT_SOCIAL_THREE_IMPORT
=
"payment_social_three_import"
;
String
PAYMENT_SOCIAL_IMPORT
=
"payment_social_import"
;
String
PAYMENT_FUND_IMPORT
=
"payment_fund_import"
;
String
PAYMENT_SOCIAL_PUSH
=
"payment_social_push"
;
String
PAYMENT_DISPATCH_BATCH_ADD_IMPORT
=
"payment_dispatch_batch_add_import"
;
String
PAYMENT_DISPATCH_BATCH_REDUCE_IMPORT
=
"payment_dispatch_batch_reduce_import"
;
String
PAYMENT_PRE_DISPATCH_BATCH_ADD_IMPORT
=
"payment_pre_dispatch_batch_add_import"
;
}
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CommonConstants.java
View file @
a1947598
...
...
@@ -474,8 +474,6 @@ public interface CommonConstants {
public
static
final
String
PAYMENT_SOCIAL_WAIT_EXPORT
=
"payment_social_wait_export"
;
public
static
final
String
PAYMENT_SOCIAL_PUSH
=
"payment_social_push"
;
//百分之一 1/100
public
static
final
BigDecimal
ONE_OF_PERCENT
=
new
BigDecimal
(
"0.01"
);
...
...
yifu-common/yifu-common-core/src/main/resources/lock.lua
0 → 100644
View file @
a1947598
local
key
=
KEYS
[
1
];
local
threadId
=
ARGV
[
1
];
local
releaseTime
=
ARGV
[
2
];
if
(
redis
.
call
(
'exists'
,
key
)
==
0
)
then
redis
.
call
(
'hset'
,
key
,
threadId
,
'1'
);
redis
.
call
(
'expire'
,
key
,
releaseTime
);
return
1
;
end
;
if
(
redis
.
call
(
'hexists'
,
key
,
threadId
)
==
1
)
then
redis
.
call
(
'hincrby'
,
key
,
threadId
,
'1'
);
redis
.
call
(
'expire'
,
key
,
releaseTime
);
return
1
;
end
;
return
0
;
yifu-common/yifu-common-core/src/main/resources/lua.note
0 → 100644
View file @
a1947598
local key = KEYS[1]; -- 第1个参数,锁的key
local threadId = ARGV[1]; -- 第2个参数,线程唯一标识
local releaseTime = ARGV[2]; -- 第3个参数,锁的自动释放时间
if(redis.call('exists', key) == 0) then -- 判断锁是否已存在
redis.call('hset', key, threadId, '1'); -- 不存在, 则获取锁
redis.call('expire', key, releaseTime); -- 设置有效期
return 1; -- 返回结果
end;
if(redis.call('hexists', key, threadId) == 1) then -- 锁已经存在,判断threadId是否是自己
redis.call('hincrby', key, threadId, '1'); -- 如果是自己,则重入次数+1
redis.call('expire', key, releaseTime); -- 设置有效期
return 1; -- 返回结果
end;
return 0; -- 代码走到这里,说明获取锁的不是自己,获取锁失败
local key = KEYS[1]; -- 第1个参数,锁的key
local threadId = ARGV[1]; -- 第2个参数,线程唯一标识
if (redis.call('HEXISTS', key, threadId) == 0) then -- 判断当前锁是否还是被自己持有
return nil; -- 如果已经不是自己,则直接返回
end;
local count = redis.call('HINCRBY', key, threadId, -1); -- 是自己的锁,则重入次数-1
if (count == 0) then -- 判断是否重入次数是否已经为0
redis.call('DEL', key); -- 等于0说明可以释放锁,直接删除
return nil;
end;
yifu-common/yifu-common-core/src/main/resources/unlock.lua
0 → 100644
View file @
a1947598
local
key
=
KEYS
[
1
];
local
threadId
=
ARGV
[
1
];
if
(
redis
.
call
(
'HEXISTS'
,
key
,
threadId
)
==
0
)
then
return
nil
;
end
;
local
count
=
redis
.
call
(
'HINCRBY'
,
key
,
threadId
,
-
1
);
if
(
count
==
0
)
then
redis
.
call
(
'DEL'
,
key
);
return
nil
;
end
;
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceDetailServiceImpl.java
View file @
a1947598
...
...
@@ -1950,6 +1950,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
detailList
.
add
(
detail
);
this
.
updateById
(
detail
);
try
{
//获取项目信息
if
(
null
!=
mapSelectVo
)
{
...
...
@@ -2042,9 +2043,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
log
.
info
(
"登记保单保费一条耗时:"
+
(
d2
-
d1
));
}
//批量更新和插入数据
if
(!
detailList
.
isEmpty
())
{
this
.
updateBatchById
(
detailList
);
}
if
(!
settleList
.
isEmpty
())
{
tInsuranceSettleService
.
updateBatchById
(
settleList
);
settleList
.
clear
();
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/TDispatchInfoController.java
View file @
a1947598
...
...
@@ -21,8 +21,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.SocialAndFundReduceVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock
;
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
;
...
...
@@ -312,7 +315,24 @@ public class TDispatchInfoController {
@PostMapping
(
"/importListAdd"
)
//@PreAuthorize("@pms.hasPermission('demo_tdispatchinfo-batch-import')")
public
R
<
List
<
ErrorMessage
>>
importListAdd
(
@RequestBody
MultipartFile
file
,
@RequestParam
(
required
=
false
)
String
orderId
){
return
tDispatchInfoService
.
importDiy
(
file
.
getInputStream
(),
orderId
);
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
Common
.
isEmpty
(
user
)){
return
R
.
failed
(
CommonConstants
.
USER_FAIL
);
}
// 获取redis分布式事务锁
String
key
=
CacheConstants
.
PAYMENT_DISPATCH_BATCH_ADD_IMPORT
+
CommonConstants
.
DOWN_LINE_STRING
+
user
.
getId
();
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
key
,
"10"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
ResultConstants
.
NO_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
try
{
return
tDispatchInfoService
.
importDiy
(
file
.
getInputStream
(),
orderId
);
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
}
/**
...
...
@@ -377,7 +397,24 @@ public class TDispatchInfoController {
@PostMapping
(
"/importListReduce"
)
//@PreAuthorize("@pms.hasPermission('demo_tdispatchinfo-batch-reduce')")
public
R
<
List
<
ErrorMessage
>>
importListReduce
(
@RequestBody
MultipartFile
file
,
@RequestParam
(
required
=
false
)
String
orderId
){
return
tDispatchInfoService
.
importReduceDiy
(
file
.
getInputStream
(),
orderId
);
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
Common
.
isEmpty
(
user
)){
return
R
.
failed
(
CommonConstants
.
USER_FAIL
);
}
// 获取redis分布式事务锁
String
key
=
CacheConstants
.
PAYMENT_DISPATCH_BATCH_REDUCE_IMPORT
+
CommonConstants
.
DOWN_LINE_STRING
+
user
.
getId
();
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
key
,
"10"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
ResultConstants
.
NO_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
try
{
return
tDispatchInfoService
.
importReduceDiy
(
file
.
getInputStream
(),
orderId
);
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
}
/**
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/TPaymentInfoController.java
View file @
a1947598
...
...
@@ -18,11 +18,18 @@ package com.yifu.cloud.plus.v1.yifu.social.controller;/*
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.ErrorDetailVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.HaveSalaryNoSocialSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo
;
...
...
@@ -148,7 +155,24 @@ public class TPaymentInfoController {
@PostMapping
(
"/importListAdd"
)
@PreAuthorize
(
"@pms.hasPermission('social_tpaymentinfo_batchImport')"
)
public
R
<
List
<
ErrorDetailVO
>>
importListAdd
(
@RequestBody
MultipartFile
file
,
@RequestParam
String
random
)
{
return
tPaymentInfoService
.
importSocialDiy
(
file
.
getInputStream
());
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
Common
.
isEmpty
(
user
)){
return
R
.
failed
(
CommonConstants
.
USER_FAIL
);
}
// 获取redis分布式事务锁
String
key
=
CacheConstants
.
PAYMENT_SOCIAL_IMPORT
+
CommonConstants
.
DOWN_LINE_STRING
+
user
.
getId
();
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
key
,
"10"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
ResultConstants
.
NO_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
try
{
return
tPaymentInfoService
.
importSocialDiy
(
file
.
getInputStream
());
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
}
/**
...
...
@@ -163,7 +187,24 @@ public class TPaymentInfoController {
@PostMapping
(
"/importListSocialHeFei"
)
public
R
<
List
<
ErrorDetailVO
>>
importListSocialHeFei
(
@RequestBody
MultipartFile
file
,
@RequestParam
String
random
,
@RequestParam
(
value
=
"type"
)
String
type
)
{
return
tPaymentInfoService
.
importSocialHeFeiDiy
(
file
.
getInputStream
(),
random
,
type
);
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
Common
.
isEmpty
(
user
)){
return
R
.
failed
(
CommonConstants
.
USER_FAIL
);
}
// 获取redis分布式事务锁
String
key
=
CacheConstants
.
PAYMENT_SOCIAL_THREE_IMPORT
+
CommonConstants
.
DOWN_LINE_STRING
+
user
.
getId
();
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
key
,
"10"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
ResultConstants
.
NO_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
try
{
return
tPaymentInfoService
.
importSocialHeFeiDiy
(
file
.
getInputStream
(),
random
,
type
);
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
}
/**
...
...
@@ -178,7 +219,24 @@ public class TPaymentInfoController {
@PostMapping
(
"/batchImportPaymentFundInfo"
)
@PreAuthorize
(
"@pms.hasPermission('social_tpaymentinfo_batchImport')"
)
public
R
<
List
<
ErrorDetailVO
>>
importListFund
(
@RequestBody
MultipartFile
file
)
{
return
tPaymentInfoService
.
batchImportPaymentFundInfo
(
file
.
getInputStream
());
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
Common
.
isEmpty
(
user
)){
return
R
.
failed
(
CommonConstants
.
USER_FAIL
);
}
// 获取redis分布式事务锁
String
key
=
CacheConstants
.
PAYMENT_FUND_IMPORT
+
CommonConstants
.
DOWN_LINE_STRING
+
user
.
getId
();
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
key
,
"10"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
ResultConstants
.
NO_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
try
{
return
tPaymentInfoService
.
batchImportPaymentFundInfo
(
file
.
getInputStream
());
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
}
/**
...
...
@@ -418,8 +476,7 @@ public class TPaymentInfoController {
@SysLog
(
"手动推送社保缴费库明细的数据"
)
@PostMapping
(
"/pushPaymentSocialFundInfo"
)
public
R
<
Boolean
>
pushPaymentSocialFundInfo
(
@RequestBody
TPaymentInfoSearchVo
searchVo
)
{
tPaymentInfoService
.
pushPaymentSocialFundInfo
(
searchVo
);
return
R
.
ok
();
return
tPaymentInfoService
.
pushPaymentSocialFundInfo
(
searchVo
);
}
/**
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/TPreDispatchInfoController.java
View file @
a1947598
...
...
@@ -23,6 +23,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil
;
...
...
@@ -240,6 +242,14 @@ public class TPreDispatchInfoController {
if
(
null
==
user
||
null
==
user
.
getId
())
{
return
R
.
failed
(
CommonConstants
.
USER_FAIL
);
}
// 获取redis分布式事务锁
String
key
=
CacheConstants
.
PAYMENT_PRE_DISPATCH_BATCH_ADD_IMPORT
+
CommonConstants
.
DOWN_LINE_STRING
+
user
.
getId
();
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
key
,
"10"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
ResultConstants
.
NO_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
ExcelUtil
<
TPreDispatchInfo
>
util1
=
null
;
try
{
jsonString
=
URLDecoder
.
decode
(
jsonString
,
CommonConstants
.
UTF8
).
replace
(
"="
,
""
);
...
...
@@ -265,6 +275,9 @@ public class TPreDispatchInfoController {
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
R
.
failed
(
PreDispatchConstants
.
DATA_IMPORT_ANALYSIS_ERROR
);
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
}
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/TPaymentInfoService.java
View file @
a1947598
...
...
@@ -149,7 +149,7 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
TPaymentVo
getPaymentSocialAndFound
(
TPaymentInfo
info
);
void
pushPaymentSocialFundInfo
(
TPaymentInfoSearchVo
searchVo
);
R
<
Boolean
>
pushPaymentSocialFundInfo
(
TPaymentInfoSearchVo
searchVo
);
/**
* 批量标识可以推送的数据
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
View file @
a1947598
...
...
@@ -24,6 +24,7 @@ import com.alibaba.excel.read.listener.ReadListener;
import
com.alibaba.excel.read.metadata.holder.ReadRowHolder
;
import
com.alibaba.excel.util.ListUtils
;
import
com.alibaba.excel.write.metadata.WriteSheet
;
import
com.baomidou.lock.annotation.Lock4j
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
...
...
@@ -1132,6 +1133,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @Date: 2022-08-01 15:01
* @return: java.lang.String
**/
@Lock4j
(
keys
=
"getDispatchApplyCode"
,
expire
=
60000
,
acquireTimeout
=
1000
)
private
synchronized
String
getApplyCode
()
{
String
nowDay
=
DateUtil
.
getThisDay
();
Cache
cache
=
cacheManager
.
getCache
(
CacheConstants
.
EVERYDAY_DISPATCH_CODE
);
...
...
@@ -2844,6 +2846,16 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch
.
setContractName
(
empVo
.
getContractName
());
dispatch
.
setContractSubName
(
empVo
.
getContractSubName
());
}
// 社保公积金派减派单兼容 划转逻辑
if
(
Common
.
isNotNull
(
dispatch
.
getSocialId
())){
dispatch
.
setSettleDomain
(
socialFund
.
getSettleDomain
());
dispatch
.
setSettleDomainCode
(
socialFund
.
getSettleDomainCode
());
dispatch
.
setSettleDomainName
(
socialFund
.
getSettleDomainName
());
}
else
if
(
Common
.
isNotNull
(
dispatch
.
getFundId
())
&&
Common
.
isEmpty
(
dispatch
.
getSocialId
())){
dispatch
.
setSettleDomain
(
socialFund
.
getSettleDomainFund
());
dispatch
.
setSettleDomainCode
(
socialFund
.
getSettleDomainCodeFund
());
dispatch
.
setSettleDomainName
(
socialFund
.
getSettleDomainNameFund
());
}
return
dispatch
;
}
...
...
@@ -3800,7 +3812,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
UpProjectSocialFundVo
vo
=
new
UpProjectSocialFundVo
();
// 社保状态 社保状态(字典): 0 无社保 1 处理中 2.部分购买 3.正常 4.已派减
initSocialFundStatus
(
socialInfo
,
providentFund
,
vo
,
sf
);
if
(
Common
.
isNotNull
(
vo
.
getSocialStatus
())){
if
(
Common
.
isNotNull
(
vo
.
getSocialStatus
())
||
Common
.
isNotNull
(
vo
.
getFundStatus
())
){
vo
.
setEmpIdCard
(
dis
.
getEmpIdcard
());
vo
.
setDepartNo
(
dis
.
getSettleDomainCode
());
R
<
Boolean
>
resUp
=
archivesDaprUtil
.
updateProjectSocialFund
(
vo
);
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
View file @
a1947598
...
...
@@ -35,6 +35,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes
;
...
...
@@ -269,7 +270,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Override
public
R
<
Boolean
>
removeInFoById
(
String
id
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
String
key
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
C
ommon
Constants
.
PAYMENT_SOCIAL_PUSH
;
String
key
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
C
ache
Constants
.
PAYMENT_SOCIAL_PUSH
;
if
(
Common
.
isNotNull
(
redisUtil
.
get
(
key
)))
{
return
R
.
failed
(
"用户正在推送实缴数据中禁止删除!"
);
}
...
...
@@ -297,7 +298,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return
R
.
failed
(
CommonConstants
.
NO_DATA_TO_HANDLE
);
}
String
key
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
C
ommon
Constants
.
PAYMENT_SOCIAL_PUSH
;
String
key
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
C
ache
Constants
.
PAYMENT_SOCIAL_PUSH
;
if
(
Common
.
isNotNull
(
redisUtil
.
get
(
key
)))
{
return
R
.
failed
(
"用户正在推送实缴数据中禁止删除!"
);
}
...
...
@@ -339,7 +340,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
String
socialCreateMonth
,
String
socialPayMonth
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
String
key
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
C
ommon
Constants
.
PAYMENT_SOCIAL_PUSH
;
String
key
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
C
ache
Constants
.
PAYMENT_SOCIAL_PUSH
;
if
(
Common
.
isNotNull
(
redisUtil
.
get
(
key
)))
{
return
R
.
failed
(
"用户正在推送实缴数据中禁止删除!"
);
}
...
...
@@ -2811,10 +2812,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
@Override
public
void
pushPaymentSocialFundInfo
(
TPaymentInfoSearchVo
searchVo
)
{
public
R
<
Boolean
>
pushPaymentSocialFundInfo
(
TPaymentInfoSearchVo
searchVo
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
String
key
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
CommonConstants
.
PAYMENT_SOCIAL_PUSH
;
redisUtil
.
set
(
key
,
user
.
getId
(),
36000L
);
String
key
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
CacheConstants
.
PAYMENT_SOCIAL_PUSH
;
if
(
Common
.
isNotNull
(
redisUtil
.
get
(
key
)))
{
return
R
.
failed
(
"用户正在推送实缴数据中,禁止重复推送!"
);
}
else
{
redisUtil
.
set
(
key
,
user
.
getId
(),
1200L
);
}
Map
<
String
,
TSettleDomainSelectVo
>
mapSelectVo
=
this
.
getSelectVoMap
();
//手动推送未推送的社保公积金明细数据
...
...
@@ -2833,6 +2838,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
redisUtil
.
remove
(
redisKey
);
}
redisUtil
.
remove
(
key
);
return
R
.
ok
();
}
@Override
...
...
yifu-social/yifu-social-biz/src/main/resources/mapper/TPaymentInfoMapper.xml
View file @
a1947598
...
...
@@ -326,6 +326,7 @@
a.UPDATE_TIME,
a.UPDATE_BY,
a.CREATE_NAME,
a.BPO_FLAG,
a.CREATE_TIME
</sql>
<sql
id=
"tPaymentInfo_where"
>
...
...
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