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
d9da776d
Commit
d9da776d
authored
Sep 06, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
缴费库收入生成修改
parent
a1e5379a
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
425 additions
and
74 deletions
+425
-74
TPaymentVo.java
...ava/com/yifu/cloud/plus/v1/yifu/salary/vo/TPaymentVo.java
+3
-0
TPaymentInfoController.java
...lus/v1/yifu/social/controller/TPaymentInfoController.java
+13
-0
TPaymentInfoService.java
...loud/plus/v1/yifu/social/service/TPaymentInfoService.java
+3
-0
TDispatchInfoServiceImpl.java
...v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
+109
-0
TForecastLibraryServiceImpl.java
...yifu/social/service/impl/TForecastLibraryServiceImpl.java
+203
-36
TPaymentInfoServiceImpl.java
.../v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
+94
-38
No files found.
yifu-salary/yifu-salary-api/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/vo/TPaymentVo.java
View file @
d9da776d
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
vo
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo
;
import
lombok.Data
;
import
java.util.List
;
...
...
@@ -12,4 +13,6 @@ import java.util.List;
@Data
public
class
TPaymentVo
{
List
<
TPaymentBySalaryVo
>
paymentList
;
List
<
TPaymentInfo
>
paymentInfoList
;
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/TPaymentInfoController.java
View file @
d9da776d
...
...
@@ -368,4 +368,17 @@ public class TPaymentInfoController {
public
void
createPaymentFundIncome
()
{
tPaymentInfoService
.
createPaymentFundIncome
();
}
/**
* @param info
* @Description: 查询缴费库
* @Author: huyc
* @Date: 2022/8/25
* @return: int
**/
@Inner
@PostMapping
(
"/inner/getPaymentSocialAndFound"
)
public
TPaymentVo
getPaymentSocialAndFound
(
@RequestBody
TPaymentInfo
info
)
{
return
tPaymentInfoService
.
getPaymentSocialAndFound
(
info
);
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/TPaymentInfoService.java
View file @
d9da776d
...
...
@@ -137,4 +137,7 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
void
createPaymentInfoIncome
();
void
createPaymentFundIncome
();
TPaymentVo
getPaymentSocialAndFound
(
TPaymentInfo
info
);
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
View file @
d9da776d
...
...
@@ -33,6 +33,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.constants.ArchivesConstants;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
...
...
@@ -54,6 +55,7 @@ import lombok.RequiredArgsConstructor;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.shardingsphere.transaction.annotation.ShardingTransactionType
;
import
org.apache.shardingsphere.transaction.core.TransactionType
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.Cache
;
import
org.springframework.cache.CacheManager
;
...
...
@@ -102,6 +104,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private
final
TForecastLibraryService
forecastLibraryService
;
private
final
TIncomeDetailMapper
detailMapper
;
/**
* 派单信息记录表简单分页查询
*
...
...
@@ -3313,6 +3317,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
||
CommonConstants
.
THREE_STRING
.
equals
(
sf
.
getSocialStatus
())){
forecastLibraryService
.
updateForecastLibaryByDispatch
(
sf
);
}
//公积金办理成功增加收入
if
(
Common
.
isNotNull
(
dis
.
getFundId
())
&&
CommonConstants
.
THREE_STRING
.
equals
(
sf
.
getFundStatus
())){
int
monthDiff
;
// 获取最小的起缴月
Date
minStartDate
=
this
.
getMinDate
(
sf
);
// 再计算月份
monthDiff
=
DateUtil
.
getMonthDiff
(
minStartDate
,
new
Date
())
+
2
;
for
(
int
i
=
0
;
i
<
monthDiff
;
i
++)
{
//生成收入
createIncomeInfo
(
sf
,
DateUtil
.
addMonth
(
1
-
i
));
}
}
}
// 2.派减办理成功 处理预估 (不管社保还是公积金办理失败)
...
...
@@ -3944,4 +3961,96 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return
baseMapper
.
getFundRecordCount
(
searchVo
,
settleDomains
,
Common
.
getList
(
idStr
),
sql
);
}
/**
* @param socialFundInfo
* @Description: 获取最小起缴日
* @Author: hgw
* @Date: 2022/7/29 11:06
* @return: java.util.Date
**/
private
Date
getMinDate
(
TSocialFundInfo
socialFundInfo
)
{
Date
minStartDate
=
null
;
if
(
socialFundInfo
.
getSocialStartDate
()
!=
null
)
{
minStartDate
=
socialFundInfo
.
getSocialStartDate
();
if
(
socialFundInfo
.
getUnitPersionMoney
()
!=
null
&&
socialFundInfo
.
getPensionStart
()
!=
null
&&
socialFundInfo
.
getPensionStart
().
before
(
minStartDate
))
{
minStartDate
=
socialFundInfo
.
getPensionStart
();
}
if
(
socialFundInfo
.
getUnitMedicalMoney
()
!=
null
&&
socialFundInfo
.
getMedicalStart
()
!=
null
&&
socialFundInfo
.
getMedicalStart
().
before
(
minStartDate
))
{
minStartDate
=
socialFundInfo
.
getMedicalStart
();
}
if
(
socialFundInfo
.
getUnitUnemploymentMoney
()
!=
null
&&
socialFundInfo
.
getUnemployStart
()
!=
null
&&
socialFundInfo
.
getUnemployStart
().
before
(
minStartDate
))
{
minStartDate
=
socialFundInfo
.
getUnemployStart
();
}
if
(
socialFundInfo
.
getUnitInjuryMoney
()
!=
null
&&
socialFundInfo
.
getWorkInjuryStart
()
!=
null
&&
socialFundInfo
.
getWorkInjuryStart
().
before
(
minStartDate
))
{
minStartDate
=
socialFundInfo
.
getWorkInjuryStart
();
}
if
(
socialFundInfo
.
getUnitBirthMoney
()
!=
null
&&
socialFundInfo
.
getBirthStart
()
!=
null
&&
socialFundInfo
.
getBirthStart
().
before
(
minStartDate
))
{
minStartDate
=
socialFundInfo
.
getBirthStart
();
}
}
if
(
socialFundInfo
.
getProvidentStart
()
!=
null
&&
(
null
==
minStartDate
||
socialFundInfo
.
getProvidentStart
().
before
(
minStartDate
)))
{
minStartDate
=
socialFundInfo
.
getProvidentStart
();
}
if
(
null
==
minStartDate
)
{
minStartDate
=
new
Date
();
}
return
minStartDate
;
}
public
void
createIncomeInfo
(
TSocialFundInfo
library
,
String
createMonth
)
{
//获取项目信息
TSettleDomain
settleDomain
=
new
TSettleDomain
();
List
<
TSettleDomainSelectVo
>
settleDomainR
=
null
;
R
<
TSettleDomainListVo
>
listVo
=
null
;
listVo
=
archivesDaprUtil
.
selectSettleDomainSelectVoById
(
library
.
getSettleDomain
());
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
);
}
}
}
//生成收入数据
TIncomeDetail
detail
=
new
TIncomeDetail
();
detail
.
setCreateTime
(
DateUtil
.
getCurrentDateTime
());
detail
.
setDeptName
(
library
.
getSettleDomainName
());
detail
.
setDeptNo
(
library
.
getSettleDomainCode
());
detail
.
setDeptId
(
library
.
getSettleDomain
());
detail
.
setEmpIdcard
(
library
.
getEmpIdcard
());
detail
.
setEmpName
(
library
.
getEmpName
());
detail
.
setUnitNo
(
settleDomain
.
getCustomerNo
());
detail
.
setUnitId
(
library
.
getUnitId
());
detail
.
setUnitName
(
library
.
getUnitName
());
detail
.
setDataCreateMonth
(
DateUtil
.
addMonth
(
0
));
detail
.
setSourceId
(
library
.
getId
());
detail
.
setSourceType
(
CommonConstants
.
TWO_STRING
);
detail
.
setCreateMonth
(
createMonth
);
detail
.
setPayMonth
(
createMonth
);
detail
.
setMrSettleType
(
settleDomain
.
getMrSettleType
());
detail
.
setMoney
(
BigDecimalUtils
.
safeAdd
(
library
.
getUnitFundSum
(),
library
.
getPersonalFundSum
()));
//管理费和风险金收取
managemeRisk
(
settleDomain
,
detail
);
}
public
void
managemeRisk
(
TSettleDomain
settleDomain
,
TIncomeDetail
detail
)
{
//管理费和风险金是否收取
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getManagementTag
()))
{
detail
.
setFeeType
(
CommonConstants
.
ONE_STRING
);
detail
.
setFeeMode
(
settleDomain
.
getManagementType
());
detail
.
setCharges
(
settleDomain
.
getManagementFee
().
toString
());
detail
.
setId
(
CommonConstants
.
NULL
);
detailMapper
.
insert
(
detail
);
}
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getRiskFundTag
()))
{
detail
.
setFeeType
(
CommonConstants
.
TWO_STRING
);
detail
.
setFeeMode
(
settleDomain
.
getRiskFundType
());
detail
.
setCharges
(
settleDomain
.
getRiskFundFee
().
toString
());
detail
.
setId
(
CommonConstants
.
NULL
);
detailMapper
.
insert
(
detail
);
}
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TForecastLibraryServiceImpl.java
View file @
d9da776d
...
...
@@ -25,9 +25,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
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.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.ekp.util.EkpFundUtil
;
import
com.yifu.cloud.plus.v1.yifu.ekp.util.EkpSocialUtil
;
...
...
@@ -37,19 +41,16 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo
;
import
com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TAgentConfig
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TForecastLibrary
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.mapper.SysBaseSetInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.social.mapper.TAgentConfigMapper
;
import
com.yifu.cloud.plus.v1.yifu.social.mapper.TForecastLibraryMapper
;
import
com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFundInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.social.mapper.*
;
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
com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.TForecastLibraryExportVo
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.ServletOutputStream
;
...
...
@@ -81,6 +82,12 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
private
final
EkpSocialUtil
ekpSocialUtil
;
private
final
TIncomeDetailService
detailService
;
private
final
TIncomeService
incomeService
;
private
final
ArchivesDaprUtil
archivesDaprUtil
;
/**
* 预估费用简单分页查询
*
...
...
@@ -476,6 +483,26 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
/**
* @Description: 获取可补缴的最大月份
* @Author: hgw
* @Date: 2020/10/10 15:26
* @return: java.lang.Integer
**/
private
Integer
getOverpayMonth
(
TSocialFundInfo
tSocialInfo
)
{
Integer
overpayMonth
=
null
;
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
tSocialInfo
.
getCanOverpay
()))
{
//补缴是否含当月: 含当月
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
tSocialInfo
.
getHaveThisMonth
()))
{
overpayMonth
=
Integer
.
parseInt
(
DateUtil
.
getYearAndMonth
(
tSocialInfo
.
getCreateTime
(),
0
));
//补缴是否含当月: 不含含当月
}
else
{
overpayMonth
=
Integer
.
parseInt
(
DateUtil
.
getYearAndMonth
(
tSocialInfo
.
getCreateTime
(),
CommonConstants
.
ONE_INT_NEGATE
));
}
}
return
overpayMonth
;
}
private
void
initSocialLibary
(
String
diffType
,
String
payMonth
,
Map
<
String
,
TForecastLibrary
>
saveLibraryMap
,
TSocialFundInfo
tSocialInfo
,
boolean
isReduceFund
,
HashMap
<
String
,
TAgentConfig
>
agentConfigMap
,
String
sfMapKey
,
TForecastLibrary
historyLibrary
,
boolean
isOnly
)
{
...
...
@@ -520,26 +547,6 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
saveLibraryMap
.
put
(
sfMapKey
,
lib
);
}
/**
* @Description: 获取可补缴的最大月份
* @Author: hgw
* @Date: 2020/10/10 15:26
* @return: java.lang.Integer
**/
private
Integer
getOverpayMonth
(
TSocialFundInfo
tSocialInfo
)
{
Integer
overpayMonth
=
null
;
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
tSocialInfo
.
getCanOverpay
()))
{
//补缴是否含当月: 含当月
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
tSocialInfo
.
getHaveThisMonth
()))
{
overpayMonth
=
Integer
.
parseInt
(
DateUtil
.
getYearAndMonth
(
tSocialInfo
.
getCreateTime
(),
0
));
//补缴是否含当月: 不含含当月
}
else
{
overpayMonth
=
Integer
.
parseInt
(
DateUtil
.
getYearAndMonth
(
tSocialInfo
.
getCreateTime
(),
CommonConstants
.
ONE_INT_NEGATE
));
}
}
return
overpayMonth
;
}
// historyLibrary_历史比例(暂时未用到)
private
TForecastLibrary
initForecastLibrary
(
TForecastLibrary
library
,
TSocialFundInfo
socialInfo
,
TSocialFundInfo
fund
,
Integer
month
,
boolean
isReduceFund
...
...
@@ -1545,6 +1552,12 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
// 删除
baseMapper
.
deleteById
(
library
.
getId
());
}
//删除停缴月以后的收入数据
detailService
.
remove
(
Wrappers
.<
TIncomeDetail
>
query
().
lambda
().
eq
(
TIncomeDetail:
:
getEmpIdcard
,
library
.
getEmpIdcard
())
.
eq
(
TIncomeDetail:
:
getDeptId
,
library
.
getSettleDomainId
())
.
eq
(
TIncomeDetail:
:
getSourceType
,
CommonConstants
.
ONE_STRING
)
.
eq
(
TIncomeDetail:
:
getPayMonth
,
library
.
getSocialPayMonth
()));
}
private
void
calculateFundType
(
BigDecimal
zero
,
TForecastLibrary
library
)
{
...
...
@@ -1566,6 +1579,12 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
// 删除
baseMapper
.
deleteById
(
library
.
getId
());
}
//删除停缴月以后的收入数据
detailService
.
remove
(
Wrappers
.<
TIncomeDetail
>
query
().
lambda
().
eq
(
TIncomeDetail:
:
getEmpIdcard
,
library
.
getEmpIdcard
())
.
eq
(
TIncomeDetail:
:
getDeptId
,
library
.
getSettleDomainId
())
.
eq
(
TIncomeDetail:
:
getSourceType
,
CommonConstants
.
TWO_STRING
)
.
eq
(
TIncomeDetail:
:
getPayMonth
,
library
.
getSocialPayMonth
()));
}
/**
...
...
@@ -1771,6 +1790,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
library
.
setCreateTime
(
LocalDateTime
.
now
());
baseMapper
.
insert
(
library
);
isSaveAndUpdate
=
true
;
//办理成功生成收入
createIncomeInfo
(
library
);
}
}
}
...
...
@@ -2092,6 +2114,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
library
.
setCreateName
(
"定时生成"
);
library
.
setCreateTime
(
LocalDateTime
.
now
());
baseMapper
.
insert
(
library
);
//办理成功生成收入
createIncomeInfo
(
library
);
}
isSaveAndUpdate
=
true
;
}
...
...
@@ -2102,14 +2127,6 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
@Override
public
TPaymentVo
selectTForecastBySalaryVo
(
TPaymentBySalaryVo
tPaymentBySalaryVo
)
{
List
<
TPaymentBySalaryVo
>
list
=
baseMapper
.
selectTForecastBySalaryVo
(
tPaymentBySalaryVo
);
TPaymentVo
vo
=
new
TPaymentVo
();
vo
.
setPaymentList
(
list
);
return
vo
;
}
@Override
public
int
updateForecastSocialStatusToSettle
(
List
<
String
>
idList
)
{
if
(
idList
!=
null
&&
!
idList
.
isEmpty
())
{
...
...
@@ -2118,6 +2135,14 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
return
0
;
}
@Override
public
TPaymentVo
selectTForecastBySalaryVo
(
TPaymentBySalaryVo
tPaymentBySalaryVo
)
{
List
<
TPaymentBySalaryVo
>
list
=
baseMapper
.
selectTForecastBySalaryVo
(
tPaymentBySalaryVo
);
TPaymentVo
vo
=
new
TPaymentVo
();
vo
.
setPaymentList
(
list
);
return
vo
;
}
@Override
public
int
updateForecastSocialStatusToNoSettle
(
List
<
String
>
idList
)
{
if
(
idList
!=
null
&&
!
idList
.
isEmpty
())
{
...
...
@@ -2497,4 +2522,146 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
return
pushList
;
}
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
;
String
sourceType
=
""
;
if
(
Common
.
isNotNull
(
library
.
getProvidentId
()))
{
sourceType
=
CommonConstants
.
TWO_STRING
;
}
else
{
sourceType
=
CommonConstants
.
ONE_STRING
;
}
TIncomeDetail
incomeDetail
=
new
TIncomeDetail
();
incomeDetail
.
setEmpIdcard
(
library
.
getEmpIdcard
());
if
(
CommonConstants
.
ONE_STRING
.
equals
(
sourceType
))
{
incomeDetail
.
setPayMonth
(
library
.
getSocialPayMonth
());
}
else
{
incomeDetail
.
setPayMonth
(
library
.
getProvidentPayMonth
());
}
incomeDetail
.
setDeptNo
(
library
.
getDeptNo
());
incomeDetail
.
setSourceType
(
sourceType
);
List
<
TIncomeDetail
>
detailList
=
detailService
.
getTIncomeDetailList
(
incomeDetail
);
if
(
Common
.
isNotNull
(
detailList
))
{
isExist
=
true
;
}
//判断是否为按人次收费
int
isSum
=
0
;
if
(
Common
.
isNotNull
(
settleDomain
))
{
// 含有社保,则计算收入
if
(
Common
.
isNotNull
(
settleDomain
.
getManageServerItem
())
&&
(
settleDomain
.
getManageServerItem
().
contains
(
CommonConstants
.
ONE_STRING
)
||
settleDomain
.
getManageServerItem
().
contains
(
CommonConstants
.
TWO_STRING
)))
{
//预估模式
if
(
CommonConstants
.
ONE_STRING
.
equals
(
settleDomain
.
getMrSettleType
()))
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getManagementTag
()))
{
//预估模式只有按人次和人数收费
if
(
CommonConstants
.
THREE_STRING
.
equals
(
settleDomain
.
getManagementType
()))
{
isSum
=
1
;
}
if
(!
isExist
||
isSum
==
1
)
{
createIncomeInsurance
(
library
,
settleDomain
,
CommonConstants
.
ONE_STRING
,
settleDomain
.
getManagementFee
().
toString
(),
settleDomain
.
getManagementType
(),
settleDomain
.
getManagementFee
(),
sourceType
);
}
}
}
else
{
BigDecimal
gMoney
=
BigDecimal
.
ZERO
;
if
(
CommonConstants
.
TWO_STRING
.
equals
(
settleDomain
.
getManagementType
()))
{
gMoney
=
settleDomain
.
getManagementFee
();
}
else
if
(
CommonConstants
.
THREE_STRING
.
equals
(
settleDomain
.
getManagementType
()))
{
gMoney
=
settleDomain
.
getManagementFee
();
isSum
=
2
;
}
else
{
gMoney
=
BigDecimalUtils
.
safeMultiply
(
library
.
getSumAll
(),
settleDomain
.
getManagementFee
());
}
if
(!
isExist
||
isSum
==
2
)
{
createIncomeInsurance
(
library
,
settleDomain
,
CommonConstants
.
ONE_STRING
,
settleDomain
.
getManagementFee
().
toString
(),
settleDomain
.
getManagementType
(),
gMoney
,
sourceType
);
}
}
}
if
(
Common
.
isNotNull
(
settleDomain
.
getRiskServerItem
())
&&
(
settleDomain
.
getRiskServerItem
().
contains
(
CommonConstants
.
ONE_STRING
)
||
settleDomain
.
getRiskServerItem
().
contains
(
CommonConstants
.
TWO_STRING
)))
{
//预估模式
if
(
CommonConstants
.
ONE_STRING
.
equals
(
settleDomain
.
getMrSettleType
())
&&
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getRiskFundTag
()))
{
if
(
CommonConstants
.
THREE_STRING
.
equals
(
settleDomain
.
getRiskFundType
()))
{
isSum
=
3
;
}
if
(!
isExist
||
isSum
==
3
)
{
createIncomeInsurance
(
library
,
settleDomain
,
CommonConstants
.
TWO_STRING
,
settleDomain
.
getRiskFundFee
().
toString
(),
settleDomain
.
getRiskFundType
(),
settleDomain
.
getRiskFundFee
(),
sourceType
);
}
}
else
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getRiskFundTag
()))
{
BigDecimal
money
=
BigDecimal
.
ZERO
;
if
(
CommonConstants
.
TWO_STRING
.
equals
(
settleDomain
.
getRiskFundType
()))
{
money
=
settleDomain
.
getRiskFundFee
();
}
else
if
(
CommonConstants
.
THREE_STRING
.
equals
(
settleDomain
.
getManagementType
()))
{
money
=
settleDomain
.
getRiskFundFee
();
isSum
=
4
;
}
else
{
money
=
BigDecimalUtils
.
safeMultiply
(
library
.
getSumAll
(),
settleDomain
.
getRiskFundFee
());
}
if
(!
isExist
||
isSum
==
4
)
{
createIncomeInsurance
(
library
,
settleDomain
,
CommonConstants
.
TWO_STRING
,
settleDomain
.
getRiskFundFee
().
toString
(),
settleDomain
.
getRiskFundType
(),
money
,
sourceType
);
}
}
}
}
}
}
public
void
createIncomeInsurance
(
TForecastLibrary
library
,
TSettleDomain
settleDomain
,
String
feeType
,
String
charges
,
String
feeMode
,
BigDecimal
money
,
String
sourceType
)
{
//生成收入数据
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
(
sourceType
);
if
(
CommonConstants
.
ONE_STRING
.
equals
(
sourceType
))
{
detail
.
setCreateMonth
(
library
.
getSocialCreateMonth
());
detail
.
setPayMonth
(
library
.
getSocialPayMonth
());
}
else
{
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
.
setId
(
CommonConstants
.
NULL
);
incomeService
.
saveDetail
(
detail
);
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
View file @
d9da776d
...
...
@@ -58,6 +58,7 @@ import com.yifu.cloud.plus.v1.yifu.social.constants.PaymentConstants;
import
com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.social.mapper.*
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TPaymentInfoService
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentHeFeiVo
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoSearchVo
;
...
...
@@ -123,6 +124,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Autowired
private
TIncomeDetailMapper
detailMapper
;
@Autowired
private
TIncomeService
incomeService
;
@Autowired
private
ArchivesDaprUtil
archivesDaprUtil
;
...
...
@@ -2293,6 +2297,17 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
@Override
public
TPaymentVo
getPaymentSocialAndFound
(
TPaymentInfo
info
)
{
List
<
TPaymentInfo
>
sumList
=
baseMapper
.
selectList
(
Wrappers
.<
TPaymentInfo
>
query
().
lambda
()
.
eq
(
TPaymentInfo:
:
getEmpIdcard
,
info
.
getEmpIdcard
())
.
eq
(
TPaymentInfo:
:
getSettleDomainId
,
info
.
getSettleDomainId
())
.
eq
(
TPaymentInfo:
:
getSocialCreateMonth
,
"202212"
));
TPaymentVo
paymentVo
=
new
TPaymentVo
();
paymentVo
.
setPaymentInfoList
(
sumList
);
return
paymentVo
;
}
public
List
<
String
>
initEkpPushSocialParam
(
List
<
TPaymentInfo
>
unPushInfo
)
{
List
<
String
>
pushList
=
new
ArrayList
<>();
for
(
TPaymentInfo
library:
unPushInfo
)
{
...
...
@@ -2646,73 +2661,114 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
exitFlag
=
true
;
}
//判断是否为按人次收费
int
isSum
=
0
;
if
(
Common
.
isNotNull
(
settleDomain
))
{
// 含有社保,则计算收入
if
(
Common
.
isNotNull
(
settleDomain
.
getManageServerItem
())
&&
(
settleDomain
.
getManageServerItem
().
contains
(
CommonConstants
.
ONE_STRING
)
||
settleDomain
.
getManageServerItem
().
contains
(
CommonConstants
.
TWO_STRING
)))
{
//预估模式
if
(
CommonConstants
.
ONE_STRING
.
equals
(
settleDomain
.
getMrSettleType
()))
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getManagementTag
()))
{
//按金额计算的话要看缴纳月有没有收入数据
if
(!
exitFlag
)
{
//预估模式只有按人次和人数收费
if
(
CommonConstants
.
THREE_STRING
.
equals
(
settleDomain
.
getManagementType
()))
{
isSum
=
1
;
}
if
(!
exitFlag
||
isSum
==
1
)
{
createIncomeInsurance
(
paymentInfo
,
settleDomain
,
CommonConstants
.
ONE_STRING
,
settleDomain
.
getManagementFee
().
toString
(),
settleDomain
.
getManagementType
(),
settleDomain
.
getManagementFee
(),
socialFundFlag
);
}
}
}
else
{
BigDecimal
gMoney
=
BigDecimal
.
ZERO
;
if
(
CommonConstants
.
ONE_STRING
.
equals
(
settleDomain
.
getManagementType
()))
{
if
(
CommonConstants
.
TWO_STRING
.
equals
(
settleDomain
.
getManagementType
()))
{
gMoney
=
settleDomain
.
getManagementFee
();
}
else
if
(
CommonConstants
.
THREE_STRING
.
equals
(
settleDomain
.
getManagementType
()))
{
gMoney
=
settleDomain
.
getManagementFee
();
isSum
=
2
;
}
else
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
socialFundFlag
))
{
gMoney
=
BigDecimalUtils
.
safeMultiply
(
paymentInfo
.
getSocialSum
(),
settleDomain
.
getManagementFee
());
}
else
{
gMoney
=
BigDecimalUtils
.
safeMultiply
(
paymentInfo
.
getProvidentSum
(),
settleDomain
.
getManagementFee
());
}
}
else
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
socialFundFlag
))
{
gMoney
=
paymentInfo
.
getSocialSum
();
}
else
{
gMoney
=
paymentInfo
.
getProvidentSum
();
}
createIncomeRiskInfo
(
paymentInfo
,
settleDomain
,
CommonConstants
.
ONE_STRING
,
settleDomain
.
getManagementFee
().
toString
(),
settleDomain
.
getManagementType
(),
gMoney
,
socialFundFlag
);
if
(!
exitFlag
||
isSum
==
2
)
{
createIncomeInsurance
(
paymentInfo
,
settleDomain
,
CommonConstants
.
ONE_STRING
,
settleDomain
.
getManagementFee
().
toString
(),
settleDomain
.
getManagementType
(),
gMoney
,
socialFundFlag
);
}
}
}
if
(
Common
.
isNotNull
(
settleDomain
.
getRiskServerItem
())
&&
(
settleDomain
.
getRiskServerItem
().
contains
(
CommonConstants
.
ONE_STRING
)
||
settleDomain
.
getRiskServerItem
().
contains
(
CommonConstants
.
TWO_STRING
)))
{
//预估模式
if
(
CommonConstants
.
ONE_STRING
.
equals
(
settleDomain
.
getMrSettleType
())
&&
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getRiskFundTag
()))
{
if
(
CommonConstants
.
THREE_STRING
.
equals
(
settleDomain
.
getRiskFundType
()))
{
isSum
=
3
;
}
if
(!
exitFlag
||
isSum
==
3
)
{
createIncomeInsurance
(
paymentInfo
,
settleDomain
,
CommonConstants
.
TWO_STRING
,
settleDomain
.
getRiskFundFee
().
toString
(),
settleDomain
.
getRiskFundType
(),
settleDomain
.
getRiskFundFee
(),
socialFundFlag
);
}
}
else
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getRiskFundTag
()))
{
BigDecimal
money
=
BigDecimal
.
ZERO
;
if
(
CommonConstants
.
ONE_STRING
.
equals
(
settleDomain
.
getRiskFundType
()))
{
if
(
CommonConstants
.
TWO_STRING
.
equals
(
settleDomain
.
getRiskFundType
()))
{
money
=
settleDomain
.
getRiskFundFee
();
}
else
if
(
CommonConstants
.
THREE_STRING
.
equals
(
settleDomain
.
getManagementType
()))
{
money
=
settleDomain
.
getRiskFundFee
();
isSum
=
4
;
}
else
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
socialFundFlag
))
{
money
=
BigDecimalUtils
.
safeMultiply
(
paymentInfo
.
getSocialSum
(),
settleDomain
.
getRiskFundFee
());
}
else
{
money
=
BigDecimalUtils
.
safeMultiply
(
paymentInfo
.
getProvidentSum
(),
settleDomain
.
getRiskFundFee
());
}
}
else
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
socialFundFlag
)
)
{
money
=
paymentInfo
.
getSocialSum
();
}
else
{
money
=
paymentInfo
.
getProvidentSum
(
);
}
if
(
!
exitFlag
||
isSum
==
4
)
{
createIncomeInsurance
(
paymentInfo
,
settleDomain
,
CommonConstants
.
TWO_STRING
,
settleDomain
.
getRiskFundFee
().
toString
(),
settleDomain
.
getRiskFundType
(),
money
,
socialFundFlag
);
}
}
createIncomeRiskInfo
(
paymentInfo
,
settleDomain
,
CommonConstants
.
TWO_STRING
,
settleDomain
.
getRiskFundFee
().
toString
(),
settleDomain
.
getRiskFundType
(),
money
,
socialFundFlag
);
}
}
}
}
public
void
createIncome
RiskInfo
(
TPaymentInfo
paymentInfo
,
TSettleDomain
settleDomain
,
String
feeType
,
String
charges
,
String
feeMode
,
BigDecimal
money
,
String
sourceType
)
{
public
void
createIncome
Insurance
(
TPaymentInfo
library
,
TSettleDomain
settleDomain
,
String
feeType
,
String
charges
,
String
feeMode
,
BigDecimal
money
,
String
sourceType
)
{
//生成收入数据
TIncomeDetail
detail
=
new
TIncomeDetail
();
detail
.
setCreateTime
(
DateUtil
.
getCurrentDateTime
());
detail
.
setDeptName
(
paymentInfo
.
getSettleDomain
Name
());
detail
.
setDeptNo
(
paymentInfo
.
getSettleDomainCode
());
detail
.
setDeptId
(
paymentInfo
.
getSettleDomain
Id
());
detail
.
setEmpIdcard
(
paymentInfo
.
getEmpIdcard
());
detail
.
setEmpName
(
paymentInfo
.
getEmpName
());
detail
.
setDeptName
(
settleDomain
.
getDepart
Name
());
detail
.
setDeptNo
(
settleDomain
.
getDepartNo
());
detail
.
setDeptId
(
settleDomain
.
get
Id
());
detail
.
setEmpIdcard
(
library
.
getEmpIdcard
());
detail
.
setEmpName
(
library
.
getEmpName
());
detail
.
setUnitNo
(
settleDomain
.
getCustomerNo
());
detail
.
setUnitId
(
paymentInfo
.
getUnit
Id
());
detail
.
setUnitName
(
paymentInfo
.
getUnit
Name
());
detail
.
setUnitId
(
settleDomain
.
getCustomer
Id
());
detail
.
setUnitName
(
settleDomain
.
getCustomer
Name
());
detail
.
setDataCreateMonth
(
DateUtil
.
addMonth
(
0
));
detail
.
setSourceId
(
paymentInfo
.
getId
());
detail
.
setSourceId
(
library
.
getId
());
detail
.
setSourceType
(
sourceType
);
detail
.
setCreateMonth
(
paymentInfo
.
getSocialCreateMonth
());
detail
.
setPayMonth
(
paymentInfo
.
getSocialPayMonth
());
if
(
CommonConstants
.
ONE_STRING
.
equals
(
sourceType
))
{
detail
.
setCreateMonth
(
library
.
getSocialCreateMonth
());
detail
.
setPayMonth
(
library
.
getSocialPayMonth
());
}
else
{
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
.
setId
(
CommonConstants
.
NULL
);
detailMapper
.
insert
(
detail
);
incomeService
.
saveDetail
(
detail
);
}
}
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