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
a26b75bb
Commit
a26b75bb
authored
Dec 08, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP8号版本
parent
3d821375
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
367 additions
and
127 deletions
+367
-127
TInsuranceDetailMapper.java
.../insurances/mapper/insurances/TInsuranceDetailMapper.java
+1
-0
TSalaryStandard.java
...ifu/cloud/plus/v1/yifu/salary/entity/TSalaryStandard.java
+20
-4
TSalaryStandardService.java
...d/plus/v1/yifu/salary/service/TSalaryStandardService.java
+9
-0
TIncomeController.java
...oud/plus/v1/yifu/social/controller/TIncomeController.java
+13
-1
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
+0
-86
TForecastLibraryServiceImpl.java
...yifu/social/service/impl/TForecastLibraryServiceImpl.java
+46
-33
DoJointSocialTask.java
...ifu/cloud/plus/v1/yifu/social/util/DoJointSocialTask.java
+54
-0
DoSocialTask.java
...com/yifu/cloud/plus/v1/yifu/social/util/DoSocialTask.java
+221
-0
No files found.
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/mapper/insurances/TInsuranceDetailMapper.java
View file @
a26b75bb
...
@@ -255,4 +255,5 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
...
@@ -255,4 +255,5 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
**/
**/
List
<
InsuranceUpdateVO
>
selectByIds
(
@Param
(
"ids"
)
List
<
String
>
ids
);
List
<
InsuranceUpdateVO
>
selectByIds
(
@Param
(
"ids"
)
List
<
String
>
ids
);
List
<
TInsuranceDetail
>
selectPushList
();
}
}
yifu-salary/yifu-salary-api/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/entity/TSalaryStandard.java
View file @
a26b75bb
...
@@ -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: 结算单调整待打印)
* 状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印
10 推送失败 11 推送收入中12推送收入失败
)
*/
*/
@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: 结算单调整待打印)不能为空"
)
@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: 结算单调整待打印)不能为空"
)
@NotBlank
(
message
=
"状态(0待提交1待审核2:待推送
3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印10 推送
失败)不能为空"
)
@NotBlank
(
message
=
"状态(0待提交1待审核2:待推送
明细3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印10 推送失败 11 已审核生成收入中12已审核生成收入
失败)不能为空"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"状态(0待提交1待审核2:待推送
3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印 10 推送
失败)"
)
@ExcelProperty
(
"状态(0待提交1待审核2:待推送
明细3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印 10 推送失败 11 已审核生成收入中12已审核生成收入
失败)"
)
private
Integer
status
;
private
Integer
status
;
/**
/**
* 提交时间
* 提交时间
...
@@ -415,6 +415,22 @@ public class TSalaryStandard extends BaseEntity {
...
@@ -415,6 +415,22 @@ 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-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/TSalaryStandardService.java
View file @
a26b75bb
...
@@ -63,6 +63,15 @@ public interface TSalaryStandardService extends IService<TSalaryStandard> {
...
@@ -63,6 +63,15 @@ 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-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/TIncomeController.java
View file @
a26b75bb
...
@@ -168,7 +168,19 @@ public class TIncomeController {
...
@@ -168,7 +168,19 @@ 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
);
return
tIncomeService
.
saveDetail
(
tIncomeDetail
,
true
);
}
/**
* @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 @
a26b75bb
...
@@ -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
);
void
pushForecastInfo
(
List
<
TForecastLibrary
>
library
,
boolean
synFlag
);
void
pushForecastFundInfo
(
List
<
TForecastLibrary
>
library
);
void
pushForecastFundInfo
(
List
<
TForecastLibrary
>
library
,
boolean
synFlag
);
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/TIncomeService.java
View file @
a26b75bb
...
@@ -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
saveDetail
(
TIncomeDetail
tIncomeDetail
,
boolean
synFlag
);
/**
/**
* @Description: 新增收入明细-详情表,同时统计;
* @Description: 新增收入明细-详情表,同时统计;
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
View file @
a26b75bb
...
@@ -4277,90 +4277,4 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -4277,90 +4277,4 @@ 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 @
a26b75bb
This diff is collapsed.
Click to expand it.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/util/DoJointSocialTask.java
View file @
a26b75bb
...
@@ -102,6 +102,44 @@ public class DoJointSocialTask {
...
@@ -102,6 +102,44 @@ 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: 合同-批量更换负责人
...
@@ -401,6 +439,13 @@ public class DoJointSocialTask {
...
@@ -401,6 +439,13 @@ 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
);
...
@@ -444,6 +489,11 @@ public class DoJointSocialTask {
...
@@ -444,6 +489,11 @@ 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
);
...
@@ -478,4 +528,8 @@ public class DoJointSocialTask {
...
@@ -478,4 +528,8 @@ 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
0 → 100644
View file @
a26b75bb
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