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
e1bd2a64
Commit
e1bd2a64
authored
Dec 05, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码回退&线程池调整
parent
131c29ed
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
355 additions
and
732 deletions
+355
-732
AsyncConfig.java
...fu/cloud/plus/v1/yifu/common/core/config/AsyncConfig.java
+2
-2
CommonConstants.java
...ud/plus/v1/yifu/common/core/constant/CommonConstants.java
+1
-1
TSalaryStandard.java
...ifu/cloud/plus/v1/yifu/salary/entity/TSalaryStandard.java
+4
-20
TSalaryStandardExportVo.java
...cloud/plus/v1/yifu/salary/vo/TSalaryStandardExportVo.java
+1
-1
TSalaryStandardController.java
.../v1/yifu/salary/controller/TSalaryStandardController.java
+0
-10
TSalaryStandardService.java
...d/plus/v1/yifu/salary/service/TSalaryStandardService.java
+0
-9
TSalaryStandardServiceImpl.java
.../yifu/salary/service/impl/TSalaryStandardServiceImpl.java
+197
-89
DoJointSalaryAsyncTask.java
...loud/plus/v1/yifu/salary/util/DoJointSalaryAsyncTask.java
+0
-212
TSalaryStandardMapper.xml
...y-biz/src/main/resources/mapper/TSalaryStandardMapper.xml
+1
-5
TIncomeController.java
...oud/plus/v1/yifu/social/controller/TIncomeController.java
+1
-13
TForecastLibraryService.java
.../plus/v1/yifu/social/service/TForecastLibraryService.java
+2
-2
TIncomeService.java
...ifu/cloud/plus/v1/yifu/social/service/TIncomeService.java
+1
-1
TDispatchInfoServiceImpl.java
...v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
+93
-13
TForecastLibraryServiceImpl.java
...yifu/social/service/impl/TForecastLibraryServiceImpl.java
+33
-46
TIncomeServiceImpl.java
.../plus/v1/yifu/social/service/impl/TIncomeServiceImpl.java
+19
-33
DoJointSocialTask.java
...ifu/cloud/plus/v1/yifu/social/util/DoJointSocialTask.java
+0
-54
DoSocialTask.java
...com/yifu/cloud/plus/v1/yifu/social/util/DoSocialTask.java
+0
-221
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/config/AsyncConfig.java
View file @
e1bd2a64
...
@@ -36,7 +36,7 @@ public class AsyncConfig implements AsyncConfigurer {
...
@@ -36,7 +36,7 @@ public class AsyncConfig implements AsyncConfigurer {
* 1)<!-- 线程池维护线程的最少数量,即使没有任务需要执行,也会一直存活 -->
* 1)<!-- 线程池维护线程的最少数量,即使没有任务需要执行,也会一直存活 -->
* 2)<!-- 设置allowCoreThreadTimeout=true(默认false)时,核心线程会超时关闭 -->
* 2)<!-- 设置allowCoreThreadTimeout=true(默认false)时,核心线程会超时关闭 -->
*/
*/
taskExecutor
.
setCorePoolSize
(
10
);
taskExecutor
.
setCorePoolSize
(
2
);
/**
/**
* <!-- 允许的空闲时间,当线程空闲时间达到keepAliveTime时,线程会退出,直到线程数量=corePoolSize -->
* <!-- 允许的空闲时间,当线程空闲时间达到keepAliveTime时,线程会退出,直到线程数量=corePoolSize -->
* <!-- 如果allowCoreThreadTimeout=true,则会直到线程数量=0 -->
* <!-- 如果allowCoreThreadTimeout=true,则会直到线程数量=0 -->
...
@@ -47,7 +47,7 @@ public class AsyncConfig implements AsyncConfigurer {
...
@@ -47,7 +47,7 @@ public class AsyncConfig implements AsyncConfigurer {
* <!-- 当线程数>=corePoolSize,且任务队列已满时。线程池会创建新线程来处理任务 -->
* <!-- 当线程数>=corePoolSize,且任务队列已满时。线程池会创建新线程来处理任务 -->
* <!-- 当线程数=maxPoolSize,且任务队列已满时,线程池会拒绝处理任务而抛出异常,异常见下
* <!-- 当线程数=maxPoolSize,且任务队列已满时,线程池会拒绝处理任务而抛出异常,异常见下
*/
*/
taskExecutor
.
setMaxPoolSize
(
2
5
);
taskExecutor
.
setMaxPoolSize
(
5
);
/**
/**
* <!-- 缓存队列(阻塞队列)当核心线程数达到最大时,新任务会放在队列中排队等待执行 -->
* <!-- 缓存队列(阻塞队列)当核心线程数达到最大时,新任务会放在队列中排队等待执行 -->
*/
*/
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CommonConstants.java
View file @
e1bd2a64
...
@@ -200,7 +200,7 @@ public interface CommonConstants {
...
@@ -200,7 +200,7 @@ public interface CommonConstants {
* @Author pwang
* @Author pwang
* @Date 2019-08-02 16:39
* @Date 2019-08-02 16:39
**/
**/
int
[]
dingleDigitIntArray
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
};
int
[]
dingleDigitIntArray
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
};
/**
/**
* 个位数字串(阿里编码规约不允许直接使用‘魔法值’)
* 个位数字串(阿里编码规约不允许直接使用‘魔法值’)
* @Author pwang
* @Author pwang
...
...
yifu-salary/yifu-salary-api/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/entity/TSalaryStandard.java
View file @
e1bd2a64
...
@@ -148,12 +148,12 @@ public class TSalaryStandard extends BaseEntity {
...
@@ -148,12 +148,12 @@ public class TSalaryStandard extends BaseEntity {
@ExcelProperty
(
"款项来源(0客户到款/1垫付)"
)
@ExcelProperty
(
"款项来源(0客户到款/1垫付)"
)
private
Integer
moneyFrom
;
private
Integer
moneyFrom
;
/**
/**
* 状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印
10 推送失败 11 推送收入中12推送收入失败
)
* 状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印)
*/
*/
@ExcelAttribute
(
name
=
"状态(0待提交1待审核2:待推送
明细3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印10 推送失败 11 已审核生成收入中12已审核生成收入
失败)"
,
isNotEmpty
=
true
,
errorInfo
=
"状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印)不能为空"
)
@ExcelAttribute
(
name
=
"状态(0待提交1待审核2:待推送
3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印10 推送
失败)"
,
isNotEmpty
=
true
,
errorInfo
=
"状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印)不能为空"
)
@NotBlank
(
message
=
"状态(0待提交1待审核2:待推送
明细3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印10 推送失败 11 已审核生成收入中12已审核生成收入
失败)不能为空"
)
@NotBlank
(
message
=
"状态(0待提交1待审核2:待推送
3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印10 推送
失败)不能为空"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"状态(0待提交1待审核2:待推送
明细3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印 10 推送失败 11 已审核生成收入中12已审核生成收入
失败)"
)
@ExcelProperty
(
"状态(0待提交1待审核2:待推送
3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印 10 推送
失败)"
)
private
Integer
status
;
private
Integer
status
;
/**
/**
* 提交时间
* 提交时间
...
@@ -415,22 +415,6 @@ public class TSalaryStandard extends BaseEntity {
...
@@ -415,22 +415,6 @@ public class TSalaryStandard extends BaseEntity {
@ExcelIgnore
@ExcelIgnore
private
String
bpoFlag
;
private
String
bpoFlag
;
/**
* 生成、推送收入的开始时间
*/
@ExcelAttribute
(
name
=
"生成、推送收入的开始时间"
,
isDate
=
true
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"生成、推送收入的开始时间"
)
private
Date
incomeStartTime
;
/**
* 生成、推送收入的完成时间
*/
@ExcelAttribute
(
name
=
"生成、推送收入的完成时间"
,
isDate
=
true
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"生成、推送收入的完成时间"
)
private
Date
incomeEndTime
;
/**
/**
* 工资月份-起
* 工资月份-起
*/
*/
...
...
yifu-salary/yifu-salary-api/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/vo/TSalaryStandardExportVo.java
View file @
e1bd2a64
...
@@ -26,7 +26,7 @@ public class TSalaryStandardExportVo implements Serializable {
...
@@ -26,7 +26,7 @@ public class TSalaryStandardExportVo implements Serializable {
/**
/**
* 状态0待提交 1待审核 2审核通过 3发送成功 5审核不通过 10 发送失败
* 状态0待提交 1待审核 2审核通过 3发送成功 5审核不通过 10 发送失败
*/
*/
@ExcelAttribute
(
name
=
"状态"
,
isDataId
=
true
,
readConverterExp
=
"0=待提交,1=待审核,2=
待推送明细,3=发送成功,5=审核不通过,6=确认不通过,10=发送失败,11=已审核生成收入中,12=已审核生成收入
失败"
)
@ExcelAttribute
(
name
=
"状态"
,
isDataId
=
true
,
readConverterExp
=
"0=待提交,1=待审核,2=
审核通过,3=发送成功,5=审核不通过,6=确认不通过,10=发送
失败"
)
@NotBlank
(
message
=
"状态(0待提交 1待审核 2审核通过 3发送成功 5审核不通过 10 发送失败)不能为空"
)
@NotBlank
(
message
=
"状态(0待提交 1待审核 2审核通过 3发送成功 5审核不通过 10 发送失败)不能为空"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"薪酬状态"
)
@ExcelProperty
(
"薪酬状态"
)
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/controller/TSalaryStandardController.java
View file @
e1bd2a64
...
@@ -229,14 +229,4 @@ public class TSalaryStandardController {
...
@@ -229,14 +229,4 @@ public class TSalaryStandardController {
public
R
<
String
>
backSalaryByApplyNo
(
@RequestParam
String
applyNo
)
{
public
R
<
String
>
backSalaryByApplyNo
(
@RequestParam
String
applyNo
)
{
return
tSalaryStandardService
.
backSalaryByApplyNo
(
applyNo
);
return
tSalaryStandardService
.
backSalaryByApplyNo
(
applyNo
);
}
}
/**
* @param id
* @return
*/
@Operation
(
description
=
"重新生成收入"
)
@GetMapping
(
"/salaryDoIncome"
)
public
R
<
String
>
salaryDoIncome
(
@RequestParam
String
id
)
{
return
tSalaryStandardService
.
salaryDoIncome
(
id
);
}
}
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/TSalaryStandardService.java
View file @
e1bd2a64
...
@@ -63,15 +63,6 @@ public interface TSalaryStandardService extends IService<TSalaryStandard> {
...
@@ -63,15 +63,6 @@ public interface TSalaryStandardService extends IService<TSalaryStandard> {
*/
*/
R
<
String
>
salaryStandardAudit
(
String
auditFlag
,
String
auditRemark
,
String
id
);
R
<
String
>
salaryStandardAudit
(
String
auditFlag
,
String
auditRemark
,
String
id
);
/**
* @param id 工资表id
* @Description: 重新生成收入
* @Author: hgw
* @Date: 2022/11/29 17:49
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R
<
String
>
salaryDoIncome
(
String
id
);
/**
/**
* @Description: 删除工资表
* @Description: 删除工资表
* @Author: hgw
* @Author: hgw
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryStandardServiceImpl.java
View file @
e1bd2a64
This diff is collapsed.
Click to expand it.
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/util/DoJointSalaryAsyncTask.java
deleted
100644 → 0
View file @
131c29ed
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
util
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo
;
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.BigDecimalUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard
;
import
com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryStandardMapper
;
import
com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardService
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeDetailReturnVo
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.util.*
;
/**
* @author hgw
* @Date 2022-11-29 16:31:09
* @Description 异步执行薪资
*/
@Slf4j
@Component
@AllArgsConstructor
@EnableConfigurationProperties
({
DaprSocialProperties
.
class
})
public
class
DoJointSalaryAsyncTask
{
private
final
DaprSocialProperties
socialProperties
;
private
final
TSalaryStandardMapper
salaryStandardMapper
;
/**
* @Description: 收入
* @Author: hgw
* @Date: 2022-11-29 17:28:494
**/
@Async
public
void
doIncomeDetail
(
TSettleDomainSelectVo
dept
,
List
<
TSalaryAccount
>
salaryAccountList
,
String
id
,
TSalaryStandard
tSalaryStandard
)
{
log
.
info
(
"推送收入到EKP-线程开始"
);
if
(
salaryAccountList
!=
null
&&
!
salaryAccountList
.
isEmpty
())
{
List
<
String
>
idCardList
=
new
ArrayList
<>();
for
(
TSalaryAccount
account
:
salaryAccountList
)
{
idCardList
.
add
(
account
.
getEmpIdcard
());
}
Map
<
String
,
Integer
>
detailMap
=
new
HashMap
<>();
boolean
isTrue
=
true
;
TSalaryStandard
s
=
salaryStandardMapper
.
selectById
(
id
);
try
{
// 收入相关
R
<
String
>
failed1
=
getIncomeDetailMap
(
tSalaryStandard
,
dept
,
idCardList
,
detailMap
);
if
(
failed1
!=
null
)
{
isTrue
=
false
;
}
else
{
// 含有薪资,则计算收入
// 管理费
if
(
Common
.
isNotNull
(
dept
.
getManageServerItem
())
&&
dept
.
getManageServerItem
().
contains
(
CommonConstants
.
FOUR_STRING
)
&&
CommonConstants
.
ZERO_STRING
.
equals
(
dept
.
getManagementTag
()))
{
// 金额-人数
if
(
CommonConstants
.
TWO_STRING
.
equals
(
dept
.
getManagementType
()))
{
// 保存明细
isTrue
=
saveIncomeDetail
(
salaryAccountList
,
tSalaryStandard
,
dept
,
detailMap
,
dept
.
getManagementType
(),
CommonConstants
.
ONE_STRING
);
}
else
{
// 保存明细
isTrue
=
saveIncomeDetail
(
salaryAccountList
,
tSalaryStandard
,
dept
,
new
HashMap
<>(),
dept
.
getManagementType
(),
CommonConstants
.
ONE_STRING
);
}
}
// 风险金
if
(
isTrue
&&
Common
.
isNotNull
(
dept
.
getRiskServerItem
())
&&
dept
.
getRiskServerItem
().
contains
(
CommonConstants
.
FOUR_STRING
)
&&
CommonConstants
.
ZERO_STRING
.
equals
(
dept
.
getRiskFundTag
()))
{
// 金额-人数
if
(
CommonConstants
.
TWO_STRING
.
equals
(
dept
.
getRiskFundType
()))
{
// 保存明细
isTrue
=
saveIncomeDetail
(
salaryAccountList
,
tSalaryStandard
,
dept
,
detailMap
,
dept
.
getRiskFundType
(),
CommonConstants
.
TWO_STRING
);
}
else
{
// 保存明细
isTrue
=
saveIncomeDetail
(
salaryAccountList
,
tSalaryStandard
,
dept
,
new
HashMap
<>(),
dept
.
getRiskFundType
(),
CommonConstants
.
TWO_STRING
);
}
}
}
}
catch
(
Exception
e
)
{
isTrue
=
false
;
log
.
error
(
e
.
getMessage
());
}
if
(
s
!=
null
&&
(
s
.
getStatus
()
==
CommonConstants
.
dingleDigitIntArray
[
11
]
||
s
.
getStatus
()
==
CommonConstants
.
dingleDigitIntArray
[
12
]))
{
tSalaryStandard
.
setIncomeEndTime
(
new
Date
());
if
(
isTrue
)
{
s
.
setStatus
(
CommonConstants
.
TWO_INT
);
salaryStandardMapper
.
updateById
(
s
);
}
else
{
s
.
setStatus
(
CommonConstants
.
dingleDigitIntArray
[
12
]);
salaryStandardMapper
.
updateById
(
s
);
}
}
}
log
.
info
(
"推送收入到EKP结束"
);
}
/**
* @Description: 获取收入信息
* @Author: hgw
* @Date: 2022/9/6 10:39
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
private
R
<
String
>
getIncomeDetailMap
(
TSalaryStandard
tSalaryStandard
,
TSettleDomainSelectVo
dept
,
List
<
String
>
idCardList
,
Map
<
String
,
Integer
>
detailMap
)
{
TIncomeDetail
detail
=
new
TIncomeDetail
();
detail
.
setApplyNo
(
tSalaryStandard
.
getApplyNo
());
detail
.
setPayMonth
(
tSalaryStandard
.
getSalaryMonth
());
detail
.
setIdCardList
(
idCardList
);
detail
.
setDeptId
(
dept
.
getId
());
R
<
TIncomeDetailReturnVo
>
detailR
=
HttpDaprUtil
.
invokeMethodPost
(
socialProperties
.
getAppUrl
(),
socialProperties
.
getAppId
()
,
"/tincomedetail/inner/getTIncomeDetailList"
,
detail
,
TIncomeDetailReturnVo
.
class
,
SecurityConstants
.
FROM_IN
);
Integer
value
;
if
(
detailR
!=
null
)
{
if
(
detailR
.
getData
()
!=
null
&&
detailR
.
getData
().
getDetailList
()
!=
null
&&
!
detailR
.
getData
().
getDetailList
().
isEmpty
())
{
TIncomeDetailReturnVo
vo
=
detailR
.
getData
();
List
<
TIncomeDetail
>
detailList
=
vo
.
getDetailList
();
for
(
TIncomeDetail
incomeDetail
:
detailList
)
{
value
=
detailMap
.
get
(
incomeDetail
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
incomeDetail
.
getDeptId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
incomeDetail
.
getFeeType
()
+
CommonConstants
.
DOWN_LINE_STRING
+
incomeDetail
.
getSourceType
());
if
(
Common
.
isEmpty
(
value
))
{
value
=
CommonConstants
.
ZERO_INT
;
}
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
incomeDetail
.
getRedData
()))
{
value
++;
}
else
{
value
--;
}
detailMap
.
put
(
incomeDetail
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
incomeDetail
.
getDeptId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
incomeDetail
.
getFeeType
()
+
CommonConstants
.
DOWN_LINE_STRING
+
incomeDetail
.
getSourceType
(),
value
);
}
}
}
else
{
return
R
.
failed
(
"获取收入明细的详情出错,请联系管理员!"
);
}
return
null
;
}
/**
* @param feeType 1按比例2金额-人数3金额-人次
* @param isManage 1 管理费2 风险金
* @Description: 保存明细
* @Author: hgw
* @Date: 2022/9/2 17:25
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
private
boolean
saveIncomeDetail
(
List
<
TSalaryAccount
>
salaryAccountList
,
TSalaryStandard
tSalaryStandard
,
TSettleDomainSelectVo
dept
,
Map
<
String
,
Integer
>
detailMap
,
String
feeType
,
String
isManage
)
{
TIncomeDetail
detail
;
Integer
value
;
BigDecimal
money
;
for
(
TSalaryAccount
account
:
salaryAccountList
)
{
value
=
detailMap
.
get
(
account
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
account
.
getDeptId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
isManage
+
CommonConstants
.
DOWN_LINE_STRING
+
CommonConstants
.
FOUR_STRING
);
if
(
Common
.
isEmpty
(
value
)
||
value
==
0
)
{
detail
=
new
TIncomeDetail
();
detail
.
setPayMonth
(
account
.
getSalaryMonth
());
detail
.
setDeptId
(
account
.
getDeptId
());
detail
.
setDeptName
(
account
.
getDeptName
());
detail
.
setDeptNo
(
account
.
getDeptNo
());
detail
.
setUnitId
(
tSalaryStandard
.
getUnitId
());
detail
.
setUnitName
(
tSalaryStandard
.
getUnitName
());
detail
.
setUnitNo
(
tSalaryStandard
.
getUnitNo
());
detail
.
setCreateMonth
(
account
.
getSalaryMonth
());
detail
.
setEmpIdcard
(
account
.
getEmpIdcard
());
detail
.
setEmpName
(
account
.
getEmpName
());
detail
.
setFeeMode
(
dept
.
getManagementType
());
detail
.
setFeeType
(
isManage
);
detail
.
setCharges
(
String
.
valueOf
(
dept
.
getManagementFee
()));
money
=
dept
.
getManagementFee
();
if
(
CommonConstants
.
TWO_STRING
.
equals
(
isManage
))
{
money
=
dept
.
getRiskFundFee
();
detail
.
setCharges
(
String
.
valueOf
(
dept
.
getRiskFundFee
()));
detail
.
setFeeMode
(
dept
.
getRiskFundType
());
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
feeType
))
{
money
=
BigDecimalUtils
.
safeMultiply
(
account
.
getRelaySalary
(),
money
,
CommonConstants
.
ONE_OF_PERCENT
);
}
detail
.
setMoney
(
money
);
detail
.
setMrSettleType
(
dept
.
getMrSettleType
());
detail
.
setRedData
(
CommonConstants
.
ZERO_STRING
);
detail
.
setSourceId
(
account
.
getId
());
detail
.
setSourceType
(
CommonConstants
.
FOUR_STRING
);
detail
.
setApplyNo
(
tSalaryStandard
.
getApplyNo
());
R
<
Boolean
>
saveR
=
HttpDaprUtil
.
invokeMethodPost
(
socialProperties
.
getAppUrl
(),
socialProperties
.
getAppId
()
,
"/tincome/inner/saveSalaryDetail"
,
detail
,
Boolean
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
saveR
==
null
||
saveR
.
getCode
()
==
CommonConstants
.
ONE_INT
||
Boolean
.
FALSE
.
equals
(
saveR
.
getData
()))
{
return
false
;
}
}
}
return
true
;
}
}
yifu-salary/yifu-salary-biz/src/main/resources/mapper/TSalaryStandardMapper.xml
View file @
e1bd2a64
...
@@ -75,8 +75,6 @@
...
@@ -75,8 +75,6 @@
<result
property=
"orderId"
column=
"ORDER_ID"
/>
<result
property=
"orderId"
column=
"ORDER_ID"
/>
<result
property=
"bpoFlag"
column=
"BPO_FLAG"
/>
<result
property=
"bpoFlag"
column=
"BPO_FLAG"
/>
<result
property=
"applyNo"
column=
"APPLY_NO"
/>
<result
property=
"applyNo"
column=
"APPLY_NO"
/>
<result
property=
"incomeStartTime"
column=
"INCOME_START_TIME"
/>
<result
property=
"incomeEndTime"
column=
"INCOME_END_TIME"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
a.ID,
a.ID,
...
@@ -130,9 +128,7 @@
...
@@ -130,9 +128,7 @@
a.INVOICE_TITLE,
a.INVOICE_TITLE,
a.ORDER_ID,
a.ORDER_ID,
a.BPO_FLAG,
a.BPO_FLAG,
a.APPLY_NO,
a.APPLY_NO
a.INCOME_START_TIME,
a.INCOME_END_TIME
</sql>
</sql>
<sql
id=
"tSalaryStandard_where"
>
<sql
id=
"tSalaryStandard_where"
>
<if
test=
"tSalaryStandard != null"
>
<if
test=
"tSalaryStandard != null"
>
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/TIncomeController.java
View file @
e1bd2a64
...
@@ -168,19 +168,7 @@ public class TIncomeController {
...
@@ -168,19 +168,7 @@ public class TIncomeController {
@Inner
@Inner
@PostMapping
(
"/inner/saveDetail"
)
@PostMapping
(
"/inner/saveDetail"
)
public
Boolean
saveDetail
(
@RequestBody
TIncomeDetail
tIncomeDetail
)
{
public
Boolean
saveDetail
(
@RequestBody
TIncomeDetail
tIncomeDetail
)
{
return
tIncomeService
.
saveDetail
(
tIncomeDetail
,
true
);
return
tIncomeService
.
saveDetail
(
tIncomeDetail
);
}
/**
* @Description: 薪资新增收入明细-详情表,同时统计;采用同步操作,因为薪资本身就是异步
* @Author: hgw
* @Date: 2022-11-29 17:29:29
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
@Inner
@PostMapping
(
"/inner/saveSalaryDetail"
)
public
Boolean
saveSalaryDetail
(
@RequestBody
TIncomeDetail
tIncomeDetail
)
{
return
tIncomeService
.
saveDetail
(
tIncomeDetail
,
false
);
}
}
/**
/**
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/TForecastLibraryService.java
View file @
e1bd2a64
...
@@ -128,8 +128,8 @@ public interface TForecastLibraryService extends IService<TForecastLibrary> {
...
@@ -128,8 +128,8 @@ public interface TForecastLibraryService extends IService<TForecastLibrary> {
void
createForecastInfo
();
void
createForecastInfo
();
void
createForecastFundInfo
();
void
createForecastFundInfo
();
void
pushForecastInfo
(
List
<
TForecastLibrary
>
library
,
boolean
synFlag
);
void
pushForecastInfo
(
List
<
TForecastLibrary
>
library
);
void
pushForecastFundInfo
(
List
<
TForecastLibrary
>
library
,
boolean
synFlag
);
void
pushForecastFundInfo
(
List
<
TForecastLibrary
>
library
);
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/TIncomeService.java
View file @
e1bd2a64
...
@@ -58,7 +58,7 @@ public interface TIncomeService extends IService<TIncome> {
...
@@ -58,7 +58,7 @@ public interface TIncomeService extends IService<TIncome> {
* @Date: 2022/8/31 16:31
* @Date: 2022/8/31 16:31
* @return: boolean
* @return: boolean
**/
**/
boolean
saveDetail
(
TIncomeDetail
tIncomeDetail
,
boolean
synFlag
);
boolean
saveDetail
(
TIncomeDetail
tIncomeDetail
);
/**
/**
* @Description: 新增收入明细-详情表,同时统计;
* @Description: 新增收入明细-详情表,同时统计;
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
View file @
e1bd2a64
...
@@ -53,7 +53,6 @@ import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService;
...
@@ -53,7 +53,6 @@ import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService;
import
com.yifu.cloud.plus.v1.yifu.social.service.TForecastLibraryService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TForecastLibraryService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TIncomeDetailService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TIncomeDetailService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService
;
import
com.yifu.cloud.plus.v1.yifu.social.util.DoSocialTask
;
import
com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil
;
import
com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.*
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
...
@@ -65,7 +64,6 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -65,7 +64,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.cache.Cache
;
import
org.springframework.cache.Cache
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.cache.support.SimpleValueWrapper
;
import
org.springframework.cache.support.SimpleValueWrapper
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -119,10 +117,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -119,10 +117,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
ExcelUtil
<
Object
>
excelUtil
=
new
ExcelUtil
<>(
Object
.
class
);
ExcelUtil
<
Object
>
excelUtil
=
new
ExcelUtil
<>(
Object
.
class
);
@Autowired
private
DoSocialTask
socialTask
;
/**
/**
* 派单信息记录表简单分页查询
* 派单信息记录表简单分页查询
*
*
...
@@ -685,7 +679,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -685,7 +679,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
// 生成预付数据
// 生成预付数据
if
(
Common
.
isNotNull
(
socialFund
)
&&
Common
.
isNotNull
(
socialFund
.
getId
())){
if
(
Common
.
isNotNull
(
socialFund
)
&&
Common
.
isNotNull
(
socialFund
.
getId
())){
socialTask
.
asynchronousDisPatchHandle
(
socialFund
,
0
,
null
,
null
,
CommonConstants
.
ONE_INT
);
forecastLibraryService
.
updateForecastLibaryByDispatch
(
socialFund
);
}
}
// 同步更新人员档案和项目档案的社保公积金状态
// 同步更新人员档案和项目档案的社保公积金状态
updateDocSocialFund
(
social
,
fund
,
socialFund
,
excel
);
updateDocSocialFund
(
social
,
fund
,
socialFund
,
excel
);
...
@@ -3132,7 +3126,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -3132,7 +3126,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
&&
CommonConstants
.
ONE_INT
==
flag
){
&&
CommonConstants
.
ONE_INT
==
flag
){
// 更新预估数据 -- 失败项重新派单审核不通过不处理预估
// 更新预估数据 -- 失败项重新派单审核不通过不处理预估
if
(!
flagTemp
){
if
(!
flagTemp
){
socialTask
.
asynchronousDisPatchHandle
(
sf
,
forecastFlag
,
null
,
null
,
CommonConstants
.
ZERO_INT
);
forecastLibraryService
.
updateForecastLibaryByDispatchReduce
(
sf
,
forecastFlag
);
}
}
// 更新人员档案和项目档案的社保公积金状态
// 更新人员档案和项目档案的社保公积金状态
UpProjectSocialFundVo
vo
=
new
UpProjectSocialFundVo
();
UpProjectSocialFundVo
vo
=
new
UpProjectSocialFundVo
();
...
@@ -3392,13 +3386,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -3392,13 +3386,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if
(
Common
.
isNotNull
(
libraryFundInfoList
))
{
if
(
Common
.
isNotNull
(
libraryFundInfoList
))
{
for
(
TForecastLibrary
library
:
libraryFundInfoList
)
{
for
(
TForecastLibrary
library
:
libraryFundInfoList
)
{
//办理成功生成收入
//办理成功生成收入
socialTask
.
asynchronousDisPatchHandle
(
null
,
0
,
null
,
library
,
CommonConstants
.
THREE_INT
);
createIncomeInfo
(
library
);
if
(
CommonConstants
.
ZERO_INT
==
library
.
getDataPush
())
{
if
(
CommonConstants
.
ZERO_INT
==
library
.
getDataPush
())
{
libraryFundInfoList1
.
add
(
library
);
libraryFundInfoList1
.
add
(
library
);
}
}
}
}
if
(
Common
.
isNotNull
(
libraryFundInfoList1
))
{
if
(
Common
.
isNotNull
(
libraryFundInfoList1
))
{
socialTask
.
asynchronousDisPatchHandle
(
null
,
0
,
libraryFundInfoList1
,
null
,
CommonConstants
.
TWO_INT
);
forecastLibraryService
.
pushForecastFundInfo
(
libraryFundInfoList1
);
}
}
}
}
}
}
...
@@ -3577,21 +3571,21 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -3577,21 +3571,21 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
&&
(
CommonConstants
.
FIVE_STRING
.
equals
(
sf
.
getSocialStatus
())
&&
(
CommonConstants
.
FIVE_STRING
.
equals
(
sf
.
getSocialStatus
())
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getFundStatus
()))){
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getFundStatus
()))){
// 派增办理,全部失败 同步预估库数据
// 派增办理,全部失败 同步预估库数据
socialTask
.
asynchronousDisPatchHandle
(
sf
,
forecastFlag
,
null
,
null
,
CommonConstants
.
ZERO_INT
);
forecastLibraryService
.
updateForecastLibaryByDispatchReduce
(
sf
,
forecastFlag
);
}
}
// 社保办理只要办理成功就刷新预估数据 公积金办理不用处理
// 社保办理只要办理成功就刷新预估数据 公积金办理不用处理
if
(
Common
.
isNotNull
(
dis
.
getSocialId
())
if
(
Common
.
isNotNull
(
dis
.
getSocialId
())
&&
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getSocialStatus
())
&&
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getSocialStatus
())
||
CommonConstants
.
TWO_STRING
.
equals
(
sf
.
getSocialStatus
())
||
CommonConstants
.
TWO_STRING
.
equals
(
sf
.
getSocialStatus
())
||
CommonConstants
.
THREE_STRING
.
equals
(
sf
.
getSocialStatus
())){
||
CommonConstants
.
THREE_STRING
.
equals
(
sf
.
getSocialStatus
())){
socialTask
.
asynchronousDisPatchHandle
(
sf
,
0
,
null
,
null
,
CommonConstants
.
ONE_INT
);
forecastLibraryService
.
updateForecastLibaryByDispatch
(
sf
);
}
}
}
}
// 2.派减办理成功 处理预估 (不管社保还是公积金办理失败)
// 2.派减办理成功 处理预估 (不管社保还是公积金办理失败)
if
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getType
())
if
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getType
())
&&
CommonConstants
.
ZERO_INT
==
flag
){
&&
CommonConstants
.
ZERO_INT
==
flag
){
// 同步预估库数据
// 同步预估库数据
socialTask
.
asynchronousDisPatchHandle
(
sf
,
forecastFlag
,
null
,
null
,
CommonConstants
.
ZERO_INT
);
forecastLibraryService
.
updateForecastLibaryByDispatchReduce
(
sf
,
forecastFlag
);
}
}
// 派减办理失败不同步档案的相关字段信息
// 派减办理失败不同步档案的相关字段信息
if
(!(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getType
())
&&
CommonConstants
.
ONE_INT
==
flag
)){
if
(!(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getType
())
&&
CommonConstants
.
ONE_INT
==
flag
)){
...
@@ -4257,4 +4251,90 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -4257,4 +4251,90 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
return
minStartDate
;
return
minStartDate
;
}
}
public
void
createIncomeInfo
(
TForecastLibrary
library
)
{
//获取项目信息
TSettleDomain
settleDomain
=
new
TSettleDomain
();
List
<
TSettleDomainSelectVo
>
settleDomainR
=
null
;
R
<
TSettleDomainListVo
>
listVo
=
null
;
listVo
=
archivesDaprUtil
.
selectSettleDomainSelectVoById
(
library
.
getSettleDomainId
());
if
(
Common
.
isNotNull
(
listVo
))
{
TSettleDomainListVo
tSettleDomainListVo
=
listVo
.
getData
();
if
(
Common
.
isNotNull
(
tSettleDomainListVo
)
&&
Common
.
isNotEmpty
(
tSettleDomainListVo
.
getListSelectVO
()))
{
settleDomainR
=
tSettleDomainListVo
.
getListSelectVO
();
for
(
TSettleDomainSelectVo
vo
:
settleDomainR
)
{
BeanUtils
.
copyProperties
(
vo
,
settleDomain
);
}
}
}
//判断是否存在当月的公积金收入数据
boolean
isExist
=
false
;
TIncomeDetail
incomeDetail
=
new
TIncomeDetail
();
incomeDetail
.
setEmpIdcard
(
library
.
getEmpIdcard
());
incomeDetail
.
setPayMonth
(
library
.
getProvidentPayMonth
());
incomeDetail
.
setDeptNo
(
library
.
getDeptNo
());
incomeDetail
.
setSourceType
(
CommonConstants
.
TWO_STRING
);
List
<
TIncomeDetail
>
detailList
=
detailService
.
getTIncomeDetailList
(
incomeDetail
);
if
(
Common
.
isNotNull
(
detailList
))
{
BigDecimal
sumMoney
=
BigDecimal
.
ZERO
;
for
(
TIncomeDetail
income
:
detailList
)
{
sumMoney
=
BigDecimalUtils
.
safeAdd
(
income
.
getMoney
(),
sumMoney
);
}
if
(
sumMoney
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
isExist
=
true
;
}
}
if
(
Common
.
isNotNull
(
settleDomain
))
{
// 含有社保,则计算收入
if
(
Common
.
isNotNull
(
settleDomain
.
getManageServerItem
())
&&
settleDomain
.
getManageServerItem
()
.
contains
(
CommonConstants
.
TWO_STRING
)
&&
!
isExist
&&
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getManagementTag
())
&&
CommonConstants
.
ONE_STRING
.
equals
(
settleDomain
.
getMrSettleType
()))
{
//预估模式
//预估模式只有按人次和人数收费
createIncomeInsurance
(
library
,
settleDomain
,
CommonConstants
.
ONE_STRING
,
settleDomain
.
getManagementFee
().
toString
(),
settleDomain
.
getManagementType
(),
settleDomain
.
getManagementFee
());
}
if
(
Common
.
isNotNull
(
settleDomain
.
getRiskServerItem
())
&&
settleDomain
.
getRiskServerItem
()
.
contains
(
CommonConstants
.
TWO_STRING
)
&&
!
isExist
&&
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getRiskFundTag
())
&&
CommonConstants
.
ONE_STRING
.
equals
(
settleDomain
.
getMrSettleType
()))
{
//预估模式
createIncomeInsurance
(
library
,
settleDomain
,
CommonConstants
.
TWO_STRING
,
settleDomain
.
getRiskFundFee
().
toString
(),
settleDomain
.
getRiskFundType
(),
settleDomain
.
getRiskFundFee
());
}
}
}
public
void
createIncomeInsurance
(
TForecastLibrary
library
,
TSettleDomain
settleDomain
,
String
feeType
,
String
charges
,
String
feeMode
,
BigDecimal
money
)
{
//生成收入数据
TIncomeDetail
detail
=
new
TIncomeDetail
();
detail
.
setCreateTime
(
DateUtil
.
getCurrentDateTime
());
detail
.
setDeptName
(
settleDomain
.
getDepartName
());
detail
.
setDeptNo
(
settleDomain
.
getDepartNo
());
detail
.
setDeptId
(
settleDomain
.
getId
());
detail
.
setEmpIdcard
(
library
.
getEmpIdcard
());
detail
.
setEmpName
(
library
.
getEmpName
());
detail
.
setUnitNo
(
settleDomain
.
getCustomerNo
());
detail
.
setUnitId
(
settleDomain
.
getCustomerId
());
detail
.
setUnitName
(
settleDomain
.
getCustomerName
());
detail
.
setDataCreateMonth
(
DateUtil
.
addMonth
(
0
));
detail
.
setSourceId
(
library
.
getId
());
detail
.
setSourceType
(
CommonConstants
.
TWO_STRING
);
detail
.
setCreateMonth
(
library
.
getProvidentCreateMonth
());
detail
.
setPayMonth
(
library
.
getProvidentPayMonth
());
detail
.
setMoney
(
money
);
detail
.
setFeeType
(
feeType
);
detail
.
setFeeMode
(
feeMode
);
detail
.
setCharges
(
charges
);
detail
.
setMrSettleType
(
settleDomain
.
getMrSettleType
());
detail
.
setRedData
(
CommonConstants
.
ZERO_STRING
);
detail
.
setId
(
CommonConstants
.
NULL
);
incomeService
.
saveDetail
(
detail
);
}
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TForecastLibraryServiceImpl.java
View file @
e1bd2a64
This diff is collapsed.
Click to expand it.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TIncomeServiceImpl.java
View file @
e1bd2a64
...
@@ -251,7 +251,8 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
...
@@ -251,7 +251,8 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
* @Date: 2022/8/31 16:34
* @Date: 2022/8/31 16:34
* @return: boolean
* @return: boolean
**/
**/
public
boolean
saveDetail
(
TIncomeDetail
tIncomeDetail
,
boolean
synFlag
)
{
@Override
public
boolean
saveDetail
(
TIncomeDetail
tIncomeDetail
)
{
if
(
Common
.
isEmpty
(
tIncomeDetail
.
getEmpIdcard
())
if
(
Common
.
isEmpty
(
tIncomeDetail
.
getEmpIdcard
())
||
Common
.
isEmpty
(
tIncomeDetail
.
getDeptId
())
||
Common
.
isEmpty
(
tIncomeDetail
.
getDeptId
())
||
Common
.
isEmpty
(
tIncomeDetail
.
getPayMonth
()))
{
||
Common
.
isEmpty
(
tIncomeDetail
.
getPayMonth
()))
{
...
@@ -273,10 +274,10 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
...
@@ -273,10 +274,10 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
tIncomeDetailService
.
save
(
tIncomeDetail
);
tIncomeDetailService
.
save
(
tIncomeDetail
);
// 不存在,直接新增
// 不存在,直接新增
if
(
incomeList
==
null
||
incomeList
.
isEmpty
())
{
if
(
incomeList
==
null
||
incomeList
.
isEmpty
())
{
return
this
.
saveIncome
(
tIncomeDetail
,
synFlag
);
return
this
.
saveIncome
(
tIncomeDetail
);
}
else
{
}
else
{
// 核心判断
// 核心判断
return
this
.
copyCore
(
tIncomeDetail
,
incomeList
,
detailList
,
null
,
synFlag
);
return
this
.
copyCore
(
tIncomeDetail
,
incomeList
,
detailList
,
null
);
}
}
}
}
...
@@ -312,7 +313,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
...
@@ -312,7 +313,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
return
this
.
savePaymentIncome
(
tIncomeDetail
,
paymentInfo
);
return
this
.
savePaymentIncome
(
tIncomeDetail
,
paymentInfo
);
}
else
{
}
else
{
// 核心判断
// 核心判断
return
this
.
copyCore
(
tIncomeDetail
,
incomeList
,
detailList
,
paymentInfo
,
true
);
return
this
.
copyCore
(
tIncomeDetail
,
incomeList
,
detailList
,
paymentInfo
);
}
}
}
}
...
@@ -400,18 +401,14 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
...
@@ -400,18 +401,14 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
}
}
// 复制并保存
// 复制并保存
private
boolean
saveIncome
(
TIncomeDetail
tIncomeDetail
,
boolean
synFlag
)
{
private
boolean
saveIncome
(
TIncomeDetail
tIncomeDetail
)
{
TIncome
income
=
new
TIncome
();
TIncome
income
=
new
TIncome
();
BeanUtil
.
copyProperties
(
tIncomeDetail
,
income
);
BeanUtil
.
copyProperties
(
tIncomeDetail
,
income
);
income
.
setSendStatus
(
CommonConstants
.
ZERO_STRING
);
income
.
setSendStatus
(
CommonConstants
.
ZERO_STRING
);
income
.
setApplyNo
(
tIncomeDetail
.
getApplyNo
());
income
.
setApplyNo
(
tIncomeDetail
.
getApplyNo
());
this
.
save
(
income
);
this
.
save
(
income
);
long
start
=
System
.
currentTimeMillis
();
long
start
=
System
.
currentTimeMillis
();
if
(
synFlag
){
doJointSocialTask
.
asynchronousEkpIncome
(
income
);
doJointSocialTask
.
asynchronousEkpIncome
(
income
);
}
else
{
doJointSocialTask
.
asynchronousEkpIncomeAsso
(
income
);
}
log
.
error
(
"线程执行耗时:"
+
(
System
.
currentTimeMillis
()-
start
));
log
.
error
(
"线程执行耗时:"
+
(
System
.
currentTimeMillis
()-
start
));
return
true
;
return
true
;
}
}
...
@@ -574,24 +571,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
...
@@ -574,24 +571,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
* @return: boolean
* @return: boolean
**/
**/
private
boolean
copyCore
(
TIncomeDetail
tIncomeDetail
,
List
<
TIncome
>
incomeList
,
List
<
TIncomeDetail
>
detailList
,
private
boolean
copyCore
(
TIncomeDetail
tIncomeDetail
,
List
<
TIncome
>
incomeList
,
List
<
TIncomeDetail
>
detailList
,
TPaymentInfo
paymentInfo
,
boolean
synFlag
)
{
TPaymentInfo
paymentInfo
)
{
if
(
Common
.
isNotNull
(
tIncomeDetail
.
getSourceId
()))
{
// 如果该id、该类型的金额已存在,则不允许重复生成推送
TIncomeDetail
a
=
new
TIncomeDetail
();
a
.
setSourceId
(
tIncomeDetail
.
getSourceId
());
a
.
setMoney
(
tIncomeDetail
.
getMoney
());
a
.
setRedData
(
tIncomeDetail
.
getRedData
());
List
<
TIncomeDetail
>
aList
=
tIncomeDetailService
.
getTIncomeDetailList
(
a
);
if
(
aList
!=
null
&&
!
aList
.
isEmpty
())
{
return
true
;
}
}
// 判断,比例,直接加
// 判断,比例,直接加
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tIncomeDetail
.
getFeeMode
()))
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tIncomeDetail
.
getFeeMode
()))
{
if
(
Common
.
isNotNull
(
paymentInfo
))
{
if
(
Common
.
isNotNull
(
paymentInfo
))
{
return
this
.
savePaymentIncome
(
tIncomeDetail
,
paymentInfo
);
return
this
.
savePaymentIncome
(
tIncomeDetail
,
paymentInfo
);
}
else
{
}
else
{
return
this
.
saveIncome
(
tIncomeDetail
,
synFlag
);
return
this
.
saveIncome
(
tIncomeDetail
);
}
}
}
else
{
}
else
{
Map
<
String
,
Integer
>
numMap
=
new
HashMap
<>();
Map
<
String
,
Integer
>
numMap
=
new
HashMap
<>();
...
@@ -647,7 +633,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
...
@@ -647,7 +633,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
if
(
Common
.
isNotNull
(
paymentInfo
))
{
if
(
Common
.
isNotNull
(
paymentInfo
))
{
return
this
.
savePaymentIncome
(
tIncomeDetail
,
paymentInfo
);
return
this
.
savePaymentIncome
(
tIncomeDetail
,
paymentInfo
);
}
else
{
}
else
{
return
this
.
saveIncome
(
tIncomeDetail
,
synFlag
);
return
this
.
saveIncome
(
tIncomeDetail
);
}
}
}
}
}
else
{
}
else
{
...
@@ -656,7 +642,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
...
@@ -656,7 +642,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
if
(
Common
.
isNotNull
(
paymentInfo
))
{
if
(
Common
.
isNotNull
(
paymentInfo
))
{
return
this
.
savePaymentIncome
(
tIncomeDetail
,
paymentInfo
);
return
this
.
savePaymentIncome
(
tIncomeDetail
,
paymentInfo
);
}
else
{
}
else
{
return
this
.
saveIncome
(
tIncomeDetail
,
synFlag
);
return
this
.
saveIncome
(
tIncomeDetail
);
}
}
}
}
}
}
...
@@ -669,7 +655,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
...
@@ -669,7 +655,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
if
(
Common
.
isNotNull
(
paymentInfo
))
{
if
(
Common
.
isNotNull
(
paymentInfo
))
{
return
this
.
savePaymentIncome
(
tIncomeDetail
,
paymentInfo
);
return
this
.
savePaymentIncome
(
tIncomeDetail
,
paymentInfo
);
}
else
{
}
else
{
return
this
.
saveIncome
(
tIncomeDetail
,
synFlag
);
return
this
.
saveIncome
(
tIncomeDetail
);
}
}
}
}
}
else
{
}
else
{
...
@@ -677,13 +663,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
...
@@ -677,13 +663,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
if
(
Common
.
isNotNull
(
paymentInfo
))
{
if
(
Common
.
isNotNull
(
paymentInfo
))
{
return
this
.
savePaymentIncome
(
tIncomeDetail
,
paymentInfo
);
return
this
.
savePaymentIncome
(
tIncomeDetail
,
paymentInfo
);
}
else
{
}
else
{
return
this
.
saveIncome
(
tIncomeDetail
,
synFlag
);
return
this
.
saveIncome
(
tIncomeDetail
);
}
}
}
}
}
}
}
else
{
}
else
{
// 各个模式累加逻辑:
// 各个模式累加逻辑:
return
this
.
judgeMixModel
(
tIncomeDetail
,
numMap
,
incomeMap
,
synFlag
);
return
this
.
judgeMixModel
(
tIncomeDetail
,
numMap
,
incomeMap
);
}
}
}
else
{
}
else
{
// 薪资。收费方式:2金额-人数
// 薪资。收费方式:2金额-人数
...
@@ -693,13 +679,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
...
@@ -693,13 +679,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
if
(
Common
.
isNotNull
(
paymentInfo
))
{
if
(
Common
.
isNotNull
(
paymentInfo
))
{
return
this
.
savePaymentIncome
(
tIncomeDetail
,
paymentInfo
);
return
this
.
savePaymentIncome
(
tIncomeDetail
,
paymentInfo
);
}
else
{
}
else
{
return
this
.
saveIncome
(
tIncomeDetail
,
synFlag
);
return
this
.
saveIncome
(
tIncomeDetail
);
}
}
}
}
}
else
{
}
else
{
// 3金额-人次
// 3金额-人次
// 各个模式累加逻辑:
// 各个模式累加逻辑:
return
this
.
judgeMixModel
(
tIncomeDetail
,
numMap
,
incomeMap
,
synFlag
);
return
this
.
judgeMixModel
(
tIncomeDetail
,
numMap
,
incomeMap
);
}
}
}
}
}
}
...
@@ -756,7 +742,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
...
@@ -756,7 +742,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
* @Date: 2022/9/1 18:17
* @Date: 2022/9/1 18:17
* @return: boolean
* @return: boolean
**/
**/
private
boolean
judgeMixModel
(
TIncomeDetail
tIncomeDetail
,
Map
<
String
,
Integer
>
numMap
,
Map
<
String
,
Integer
>
incomeMap
,
boolean
synFlag
)
{
private
boolean
judgeMixModel
(
TIncomeDetail
tIncomeDetail
,
Map
<
String
,
Integer
>
numMap
,
Map
<
String
,
Integer
>
incomeMap
)
{
String
month
=
tIncomeDetail
.
getPayMonth
();
String
month
=
tIncomeDetail
.
getPayMonth
();
if
(
CommonConstants
.
THREE_STRING
.
equals
(
tIncomeDetail
.
getSourceType
()))
{
if
(
CommonConstants
.
THREE_STRING
.
equals
(
tIncomeDetail
.
getSourceType
()))
{
month
=
tIncomeDetail
.
getDataCreateMonth
();
month
=
tIncomeDetail
.
getDataCreateMonth
();
...
@@ -767,11 +753,11 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
...
@@ -767,11 +753,11 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
Integer
maxNum
=
incomeMap
.
get
(
month
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getFeeType
());
Integer
maxNum
=
incomeMap
.
get
(
month
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getFeeType
());
// 当明细的次数大于总次数,才可以新增统计
// 当明细的次数大于总次数,才可以新增统计
if
(
Common
.
isEmpty
(
maxNum
)
||
ifNullToZero
(
nums
)
>=
maxNum
)
{
if
(
Common
.
isEmpty
(
maxNum
)
||
ifNullToZero
(
nums
)
>=
maxNum
)
{
return
this
.
saveIncome
(
tIncomeDetail
,
synFlag
);
return
this
.
saveIncome
(
tIncomeDetail
);
}
}
}
else
{
}
else
{
// 红冲判断:当本类型是最大值,才可以红冲
// 红冲判断:当本类型是最大值,才可以红冲
if
(
this
.
redDateJudge
(
tIncomeDetail
,
numMap
))
return
this
.
saveIncome
(
tIncomeDetail
,
synFlag
);
if
(
this
.
redDateJudge
(
tIncomeDetail
,
numMap
))
return
this
.
saveIncome
(
tIncomeDetail
);
}
}
return
true
;
return
true
;
}
}
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/util/DoJointSocialTask.java
View file @
e1bd2a64
...
@@ -102,44 +102,6 @@ public class DoJointSocialTask {
...
@@ -102,44 +102,6 @@ public class DoJointSocialTask {
}
}
log
.
info
(
"推送收入到EKP结束"
);
log
.
info
(
"推送收入到EKP结束"
);
}
}
public
void
asynchronousEkpIncomeAsso
(
TIncome
income
)
{
log
.
info
(
"推送收入到EKP-线程开始"
);
try
{
String
sendBack
=
this
.
getSendBack
(
income
);
if
(
Common
.
isEmpty
(
sendBack
)
||
sendBack
.
length
()
!=
32
)
{
sendBack
=
this
.
getSendBack
(
income
);
}
income
.
setSendTime
(
new
Date
());
if
(
Common
.
isNotNull
(
sendBack
)
&&
sendBack
.
length
()
==
32
)
{
income
.
setSendStatus
(
CommonConstants
.
ONE_STRING
);
income
.
setSendMonth
(
DateUtil
.
addMonth
(
0
));
income
.
setEkpId
(
sendBack
);
incomeMapper
.
updateById
(
income
);
}
else
{
TSendEkpError
error
=
new
TSendEkpError
();
error
.
setCreateTime
(
new
Date
());
error
.
setCreateDay
(
DateUtil
.
getThisDay
());
error
.
setType
(
CommonConstants
.
FOUR_STRING
);
error
.
setCreateUserName
(
"收入表推送"
);
error
.
setLinkId
(
income
.
getId
());
error
.
setTitle
(
sendBack
);
error
.
setNums
(
CommonConstants
.
ONE_INT
);
tSendEkpErrorService
.
saveError
(
error
);
}
}
catch
(
Exception
e
)
{
TSendEkpError
error
=
new
TSendEkpError
();
error
.
setCreateTime
(
new
Date
());
error
.
setCreateDay
(
DateUtil
.
getThisDay
());
error
.
setType
(
CommonConstants
.
FOUR_STRING
);
error
.
setCreateUserName
(
"收入表推送"
);
error
.
setLinkId
(
income
.
getId
());
error
.
setTitle
(
e
.
getMessage
());
error
.
setNums
(
CommonConstants
.
ONE_INT
);
tSendEkpErrorService
.
saveError
(
error
);
log
.
error
(
"推送收入到EKP错误"
,
e
);
}
log
.
info
(
"推送收入到EKP结束"
);
}
/**
/**
* @Description: 合同-批量更换负责人
* @Description: 合同-批量更换负责人
...
@@ -439,13 +401,6 @@ public class DoJointSocialTask {
...
@@ -439,13 +401,6 @@ public class DoJointSocialTask {
**/
**/
@Async
@Async
public
void
asynchronousEkpForecastSocial
(
EkpPushSocialParam
socialParam
,
TForecastLibrary
library
)
{
public
void
asynchronousEkpForecastSocial
(
EkpPushSocialParam
socialParam
,
TForecastLibrary
library
)
{
ekpForecastSocial
(
socialParam
,
library
);
}
public
void
asynchronousEkpForecastSocialAsso
(
EkpPushSocialParam
socialParam
,
TForecastLibrary
library
)
{
ekpForecastSocial
(
socialParam
,
library
);
}
private
void
ekpForecastSocial
(
EkpPushSocialParam
socialParam
,
TForecastLibrary
library
)
{
log
.
info
(
"推送社保预估费用到EKP-线程开始"
);
log
.
info
(
"推送社保预估费用到EKP-线程开始"
);
try
{
try
{
String
body
=
ekpSocialUtil
.
sendToEKP
(
socialParam
);
String
body
=
ekpSocialUtil
.
sendToEKP
(
socialParam
);
...
@@ -489,11 +444,6 @@ public class DoJointSocialTask {
...
@@ -489,11 +444,6 @@ public class DoJointSocialTask {
**/
**/
@Async
@Async
public
void
asynchronousEkpForecastFund
(
EkpPushFundParam
fundParam
,
TForecastLibrary
library
)
{
public
void
asynchronousEkpForecastFund
(
EkpPushFundParam
fundParam
,
TForecastLibrary
library
)
{
initEkpForecastFund
(
fundParam
,
library
);
}
private
void
initEkpForecastFund
(
EkpPushFundParam
fundParam
,
TForecastLibrary
library
)
{
initEkpForecastFund
(
fundParam
,
library
);
log
.
info
(
"推送公积金预估费用到EKP-线程开始"
);
log
.
info
(
"推送公积金预估费用到EKP-线程开始"
);
try
{
try
{
String
body
=
ekpFundUtil
.
sendToEKP
(
fundParam
);
String
body
=
ekpFundUtil
.
sendToEKP
(
fundParam
);
...
@@ -528,8 +478,4 @@ public class DoJointSocialTask {
...
@@ -528,8 +478,4 @@ public class DoJointSocialTask {
}
}
log
.
info
(
"推送公积金预估费用到EKP结束"
);
log
.
info
(
"推送公积金预估费用到EKP结束"
);
}
}
public
void
asynchronousEkpForecastFundAsso
(
EkpPushFundParam
fundParam
,
TForecastLibrary
library
)
{
initEkpForecastFund
(
fundParam
,
library
);
}
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/util/DoSocialTask.java
deleted
100644 → 0
View file @
131c29ed
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
social
.
util
;
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.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.BigDecimalUtils
;
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.dapr.util.ArchivesDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TForecastLibrary
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSendEkpError
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.mapper.TSendEkpErrorMapper
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TForecastLibraryService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TIncomeDetailService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
/**
* @Author fxj
* @Date 2022/11/28
* @Description 批量办理异步处理
* @Version 1.0
*/
@Slf4j
@Component
public
class
DoSocialTask
{
@Autowired
private
TForecastLibraryService
forecastLibraryService
;
@Autowired
private
TIncomeDetailService
detailService
;
@Autowired
private
ArchivesDaprUtil
archivesDaprUtil
;
@Autowired
private
TIncomeService
incomeService
;
@Autowired
private
TSendEkpErrorMapper
sendEkpErrorMapper
;
/**
* @Author fxj
* @Description 异步处理相关信息
* @Date 11:23 2022/11/28
* @param type=0 updateForecastLibaryByDispatchReduce type=1 updateForecastLibaryByDispatch type=2 pushForecastFundInfo createIncomeInfo(library);
**/
@Async
public
void
asynchronousDisPatchHandle
(
TSocialFundInfo
sf
,
int
forecastFlag
,
List
<
TForecastLibrary
>
libs
,
TForecastLibrary
library
,
int
type
)
{
synchronized
(
this
){
R
<
String
>
res
;
String
linkId
=
null
;
try
{
// 派单减少变更预估库-派减
if
(
type
==
CommonConstants
.
ZERO_INT
){
linkId
=
sf
.
getId
();
res
=
forecastLibraryService
.
updateForecastLibaryByDispatchReduce
(
sf
,
forecastFlag
);
if
(
Common
.
isEmpty
(
res
)
||
CommonConstants
.
SUCCESS
!=
res
.
getCode
()){
initSendError
(
library
.
getId
(),
res
.
getMsg
(),
"updateForecastLibaryByDispatchReduce:"
);
}
}
// 派单变更预估库
if
(
type
==
CommonConstants
.
ONE_INT
){
linkId
=
sf
.
getId
();
res
=
forecastLibraryService
.
updateForecastLibaryByDispatch
(
sf
);
if
(
Common
.
isEmpty
(
res
)
||
CommonConstants
.
SUCCESS
!=
res
.
getCode
()){
initSendError
(
sf
.
getId
(),
res
.
getMsg
(),
"updateForecastLibaryByDispatch:"
);
}
}
// 获取预估库数据并推送
if
(
type
==
CommonConstants
.
TWO_INT
){
if
(
Common
.
isNotNull
(
libs
)){
for
(
TForecastLibrary
lib:
libs
){
if
(
Common
.
isEmpty
(
linkId
)){
linkId
=
lib
.
getId
();
}
else
{
linkId
=
linkId
+
CommonConstants
.
COMMA_CHAR
+
lib
.
getId
();
}
}
}
forecastLibraryService
.
pushForecastFundInfo
(
libs
,
false
);
}
// 获取预估库数据并推送
if
(
type
==
CommonConstants
.
THREE_INT
){
linkId
=
library
.
getId
();
createIncomeInfo
(
library
);
}
}
catch
(
Exception
e
){
initSendError
(
linkId
,
e
.
getMessage
(),
"asynchronousDisPatchHandle:"
);
}
}
}
private
void
initSendError
(
String
linkId
,
String
msg
,
String
title
)
{
TSendEkpError
error
=
new
TSendEkpError
();
error
.
setCreateTime
(
new
Date
());
error
.
setCreateDay
(
DateUtil
.
getThisDay
());
error
.
setType
(
CommonConstants
.
TWO_STRING
);
error
.
setCreateUserName
(
"社保预估费用推送"
);
error
.
setLinkId
(
linkId
);
error
.
setTitle
(
title
+
msg
);
error
.
setNums
(
CommonConstants
.
ONE_INT
);
this
.
saveError
(
error
);
log
.
error
(
"推送社保预估费用到EKP错误"
,
msg
);
}
private
boolean
saveError
(
TSendEkpError
tSendEkpError
)
{
// 类型、创建日不可为空
if
(
Common
.
isEmpty
(
tSendEkpError
.
getType
())
||
Common
.
isEmpty
(
tSendEkpError
.
getCreateDay
()))
{
return
false
;
}
TSendEkpError
error
=
sendEkpErrorMapper
.
getByTitleTypeDay
(
tSendEkpError
);
if
(
error
==
null
)
{
return
sendEkpErrorMapper
.
insert
(
tSendEkpError
)
>
0
;
}
else
{
if
(
Common
.
isEmpty
(
tSendEkpError
.
getNums
()))
{
tSendEkpError
.
setNums
(
CommonConstants
.
ONE_INT
);
}
error
.
setNums
(
error
.
getNums
()
+
tSendEkpError
.
getNums
());
return
sendEkpErrorMapper
.
updateById
(
error
)
>=
0
;
}
}
public
void
createIncomeInfo
(
TForecastLibrary
library
)
{
//获取项目信息
TSettleDomain
settleDomain
=
new
TSettleDomain
();
List
<
TSettleDomainSelectVo
>
settleDomainR
=
null
;
R
<
TSettleDomainListVo
>
listVo
=
null
;
listVo
=
archivesDaprUtil
.
selectSettleDomainSelectVoById
(
library
.
getSettleDomainId
());
if
(
Common
.
isNotNull
(
listVo
))
{
TSettleDomainListVo
tSettleDomainListVo
=
listVo
.
getData
();
if
(
Common
.
isNotNull
(
tSettleDomainListVo
)
&&
Common
.
isNotEmpty
(
tSettleDomainListVo
.
getListSelectVO
()))
{
settleDomainR
=
tSettleDomainListVo
.
getListSelectVO
();
for
(
TSettleDomainSelectVo
vo
:
settleDomainR
)
{
BeanUtils
.
copyProperties
(
vo
,
settleDomain
);
}
}
}
//判断是否存在当月的公积金收入数据
boolean
isExist
=
false
;
TIncomeDetail
incomeDetail
=
new
TIncomeDetail
();
incomeDetail
.
setEmpIdcard
(
library
.
getEmpIdcard
());
incomeDetail
.
setPayMonth
(
library
.
getProvidentPayMonth
());
incomeDetail
.
setDeptNo
(
library
.
getDeptNo
());
incomeDetail
.
setSourceType
(
CommonConstants
.
TWO_STRING
);
List
<
TIncomeDetail
>
detailList
=
detailService
.
getTIncomeDetailList
(
incomeDetail
);
if
(
Common
.
isNotNull
(
detailList
))
{
BigDecimal
sumMoney
=
BigDecimal
.
ZERO
;
for
(
TIncomeDetail
income
:
detailList
)
{
sumMoney
=
BigDecimalUtils
.
safeAdd
(
income
.
getMoney
(),
sumMoney
);
}
if
(
sumMoney
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
isExist
=
true
;
}
}
if
(
Common
.
isNotNull
(
settleDomain
))
{
// 含有社保,则计算收入
if
(
Common
.
isNotNull
(
settleDomain
.
getManageServerItem
())
&&
settleDomain
.
getManageServerItem
()
.
contains
(
CommonConstants
.
TWO_STRING
)
&&
!
isExist
&&
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getManagementTag
())
&&
CommonConstants
.
ONE_STRING
.
equals
(
settleDomain
.
getMrSettleType
()))
{
//预估模式
//预估模式只有按人次和人数收费
createIncomeInsurance
(
library
,
settleDomain
,
CommonConstants
.
ONE_STRING
,
settleDomain
.
getManagementFee
().
toString
(),
settleDomain
.
getManagementType
(),
settleDomain
.
getManagementFee
());
}
if
(
Common
.
isNotNull
(
settleDomain
.
getRiskServerItem
())
&&
settleDomain
.
getRiskServerItem
()
.
contains
(
CommonConstants
.
TWO_STRING
)
&&
!
isExist
&&
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getRiskFundTag
())
&&
CommonConstants
.
ONE_STRING
.
equals
(
settleDomain
.
getMrSettleType
()))
{
//预估模式
createIncomeInsurance
(
library
,
settleDomain
,
CommonConstants
.
TWO_STRING
,
settleDomain
.
getRiskFundFee
().
toString
(),
settleDomain
.
getRiskFundType
(),
settleDomain
.
getRiskFundFee
());
}
}
}
public
void
createIncomeInsurance
(
TForecastLibrary
library
,
TSettleDomain
settleDomain
,
String
feeType
,
String
charges
,
String
feeMode
,
BigDecimal
money
)
{
//生成收入数据
TIncomeDetail
detail
=
new
TIncomeDetail
();
detail
.
setCreateTime
(
DateUtil
.
getCurrentDateTime
());
detail
.
setDeptName
(
settleDomain
.
getDepartName
());
detail
.
setDeptNo
(
settleDomain
.
getDepartNo
());
detail
.
setDeptId
(
settleDomain
.
getId
());
detail
.
setEmpIdcard
(
library
.
getEmpIdcard
());
detail
.
setEmpName
(
library
.
getEmpName
());
detail
.
setUnitNo
(
settleDomain
.
getCustomerNo
());
detail
.
setUnitId
(
settleDomain
.
getCustomerId
());
detail
.
setUnitName
(
settleDomain
.
getCustomerName
());
detail
.
setDataCreateMonth
(
DateUtil
.
addMonth
(
0
));
detail
.
setSourceId
(
library
.
getId
());
detail
.
setSourceType
(
CommonConstants
.
TWO_STRING
);
detail
.
setCreateMonth
(
library
.
getProvidentCreateMonth
());
detail
.
setPayMonth
(
library
.
getProvidentPayMonth
());
detail
.
setMoney
(
money
);
detail
.
setFeeType
(
feeType
);
detail
.
setFeeMode
(
feeMode
);
detail
.
setCharges
(
charges
);
detail
.
setMrSettleType
(
settleDomain
.
getMrSettleType
());
detail
.
setRedData
(
CommonConstants
.
ZERO_STRING
);
detail
.
setId
(
CommonConstants
.
NULL
);
// 批量办理成功 收入不异步推送
incomeService
.
saveDetail
(
detail
,
false
);
}
}
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