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
7e57865d
Commit
7e57865d
authored
Sep 01, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
af1d7e1c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
51 deletions
+33
-51
TIncomeServiceImpl.java
.../plus/v1/yifu/social/service/impl/TIncomeServiceImpl.java
+33
-51
No files found.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TIncomeServiceImpl.java
View file @
7e57865d
...
...
@@ -17,7 +17,6 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
social
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.ArrayUtil
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.ExcelWriter
;
import
com.alibaba.excel.context.AnalysisContext
;
...
...
@@ -25,16 +24,11 @@ import com.alibaba.excel.read.listener.ReadListener;
import
com.alibaba.excel.read.metadata.holder.ReadRowHolder
;
import
com.alibaba.excel.util.ListUtils
;
import
com.alibaba.excel.write.metadata.WriteSheet
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
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.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.*
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.SysMessageSalaryExportVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.SysMessageSalarySearchVo
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TIncome
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail
;
import
com.yifu.cloud.plus.v1.yifu.social.mapper.TIncomeMapper
;
...
...
@@ -44,7 +38,6 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.IncomeExportVo;
import
com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeVo
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -89,7 +82,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
String
fileName
=
"收入明细批量导出"
+
DateUtil
.
getThisTime
()
+
".xlsx"
;
//获取要导出的列表
List
<
IncomeExportVo
>
list
=
new
ArrayList
<>();
long
count
=
noPageCountDiy
(
searchVo
,
null
,
Common
.
getList
(
searchVo
.
getIds
()),
""
);
long
count
=
noPageCountDiy
(
searchVo
,
null
,
Common
.
getList
(
searchVo
.
getIds
()),
""
);
ServletOutputStream
out
=
null
;
try
{
out
=
response
.
getOutputStream
();
...
...
@@ -104,7 +97,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
// 获取实际记录
searchVo
.
setLimitStart
(
i
);
searchVo
.
setLimitEnd
(
CommonConstants
.
EXCEL_EXPORT_LIMIT
);
list
=
noPageDiy
(
searchVo
,
null
,
Common
.
getList
(
searchVo
.
getIds
()),
""
);
list
=
noPageDiy
(
searchVo
,
null
,
Common
.
getList
(
searchVo
.
getIds
()),
""
);
if
(
Common
.
isNotNull
(
list
))
{
ExcelUtil
<
IncomeExportVo
>
util
=
new
ExcelUtil
<>(
IncomeExportVo
.
class
);
for
(
IncomeExportVo
vo
:
list
)
{
...
...
@@ -147,14 +140,14 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
List
<
String
>
settleDomainIds
,
List
<
String
>
ids
,
String
sql
)
{
return
baseMapper
.
noPageDiy
(
searchVo
,
settleDomainIds
,
ids
,
sql
);
return
baseMapper
.
noPageDiy
(
searchVo
,
settleDomainIds
,
ids
,
sql
);
}
private
int
noPageCountDiy
(
TIncomeSearchVo
searchVo
,
List
<
String
>
settleDomainIds
,
List
<
String
>
ids
,
String
sql
)
{
return
baseMapper
.
noPageCountDiy
(
searchVo
,
settleDomainIds
,
ids
,
sql
);
return
baseMapper
.
noPageCountDiy
(
searchVo
,
settleDomainIds
,
ids
,
sql
);
}
@Override
...
...
@@ -253,12 +246,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
tIncomeDetail
.
setCreateTime
(
new
Date
());
tIncomeDetail
.
setDataCreateMonth
(
DateUtil
.
addMonth
(
0
));
tIncomeDetailService
.
save
(
tIncomeDetail
);
// TODO-获取对应信息的统计表,根据项目配置,判断是否可以加一条统计:
// 获取对应信息的统计表,根据项目配置,判断是否可以加一条统计:
TIncome
income
=
new
TIncome
();
income
.
setEmpIdcard
(
tIncomeDetail
.
getEmpIdcard
());
income
.
setDeptId
(
tIncomeDetail
.
getDeptId
());
List
<
TIncome
>
incomeList
=
baseMapper
.
getTIncomeList
(
income
);
TIncomeDetail
detail
=
new
TIncomeDetail
();
detail
.
setEmpIdcard
(
tIncomeDetail
.
getEmpIdcard
());
detail
.
setDeptId
(
tIncomeDetail
.
getDeptId
());
...
...
@@ -290,7 +284,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
// 商险Map
Map
<
String
,
Integer
>
insureMap
=
new
HashMap
<>();
Integer
nums
;
Integer
maxNum
;
for
(
TIncomeDetail
detail
:
detailList
)
{
nums
=
numMap
.
get
(
detail
.
getPayMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
detail
.
getSourceType
()
+
CommonConstants
.
DOWN_LINE_STRING
+
detail
.
getFeeType
()
...
...
@@ -318,46 +311,37 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
+
CommonConstants
.
DOWN_LINE_STRING
+
income
.
getRedData
(),
CommonConstants
.
ZERO_INT
);
}
// 金额人数、人次,需要判重
// 1:预估模式(管理费风险金的结算方式:1预估2实缴)
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tIncomeDetail
.
getMrSettleType
()))
{
// 社保、公积金(收入来源:1社保2公积金3商险4薪资)
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tIncomeDetail
.
getSourceType
())
||
CommonConstants
.
TWO_STRING
.
equals
(
tIncomeDetail
.
getSourceType
()))
{
if
(
incomeMap
.
get
(
tIncomeDetail
.
getPayMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getFeeType
()
// 社保、公积金(收入来源:1社保2公积金3商险4薪资)
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tIncomeDetail
.
getSourceType
())
||
CommonConstants
.
TWO_STRING
.
equals
(
tIncomeDetail
.
getSourceType
()))
{
if
(
incomeMap
.
get
(
tIncomeDetail
.
getPayMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getFeeType
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getRedData
())
==
null
)
{
return
this
.
saveIncome
(
tIncomeDetail
);
}
}
else
if
(
CommonConstants
.
THREE_STRING
.
equals
(
tIncomeDetail
.
getSourceType
()))
{
// 商险。收费方式:2金额-人数
if
(
CommonConstants
.
TWO_STRING
.
equals
(
tIncomeDetail
.
getFeeMode
()))
{
if
(
insureMap
.
get
(
tIncomeDetail
.
getDataCreateMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getFeeType
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getRedData
())
==
null
)
{
return
this
.
saveIncome
(
tIncomeDetail
);
}
}
else
if
(
CommonConstants
.
THREE_STRING
.
equals
(
tIncomeDetail
.
getSourceType
()))
{
// 商险。收费方式:2金额-人数
if
(
CommonConstants
.
TWO_STRING
.
equals
(
tIncomeDetail
.
getFeeMode
()))
{
if
(
insureMap
.
get
(
tIncomeDetail
.
getDataCreateMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getFeeType
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getRedData
())
==
null
)
{
return
this
.
saveIncome
(
tIncomeDetail
);
}
}
else
{
// 各个模式累加逻辑:
return
this
.
judgeMixModel
(
tIncomeDetail
,
numMap
,
incomeMap
);
}
}
else
{
// 薪资。收费方式:2金额-人数
if
(
CommonConstants
.
TWO_STRING
.
equals
(
tIncomeDetail
.
getFeeMode
()))
{
if
(
incomeMap
.
get
(
tIncomeDetail
.
getPayMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getFeeType
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getRedData
())
==
null
)
{
return
this
.
saveIncome
(
tIncomeDetail
);
}
}
else
{
// 3金额-人次
// 各个模式累加逻辑:
return
this
.
judgeMixModel
(
tIncomeDetail
,
numMap
,
incomeMap
);
}
// 各个模式累加逻辑:
return
this
.
judgeMixModel
(
tIncomeDetail
,
numMap
,
incomeMap
);
}
}
else
{
// 实缴
// TODO
// 薪资。收费方式:2金额-人数
if
(
CommonConstants
.
TWO_STRING
.
equals
(
tIncomeDetail
.
getFeeMode
()))
{
if
(
incomeMap
.
get
(
tIncomeDetail
.
getPayMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getFeeType
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getRedData
())
==
null
)
{
return
this
.
saveIncome
(
tIncomeDetail
);
}
}
else
{
// 3金额-人次
// 各个模式累加逻辑:
return
this
.
judgeMixModel
(
tIncomeDetail
,
numMap
,
incomeMap
);
}
}
}
return
true
;
}
...
...
@@ -369,15 +353,13 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
* @return: boolean
**/
private
boolean
judgeMixModel
(
TIncomeDetail
tIncomeDetail
,
Map
<
String
,
Integer
>
numMap
,
Map
<
String
,
Integer
>
incomeMap
)
{
Integer
nums
;
Integer
maxNum
;
nums
=
numMap
.
get
(
tIncomeDetail
.
getPayMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getSourceType
()
Integer
nums
=
numMap
.
get
(
tIncomeDetail
.
getPayMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getSourceType
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getFeeType
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getRedData
());
maxNum
=
incomeMap
.
get
(
tIncomeDetail
.
getPayMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getFeeType
()
Integer
maxNum
=
incomeMap
.
get
(
tIncomeDetail
.
getPayMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getFeeType
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tIncomeDetail
.
getRedData
());
// 当明细的次数大于总次数,才可以新增统计
if
(
nums
>
maxNum
)
{
if
(
Common
.
isEmpty
(
maxNum
)
||
nums
>
maxNum
)
{
return
this
.
saveIncome
(
tIncomeDetail
);
}
return
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