Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-backend
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AutogeneralShanghai
yd-backend
Commits
008d0c05
Commit
008d0c05
authored
May 21, 2021
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
N22薪资单列表接口
parent
8055cf22
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
131 additions
and
18 deletions
+131
-18
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerBasicInfoServiceImpl.java
+106
-15
yd-api/src/main/java/com/yd/api/practitioner/vo/payscale/PayScaleInfo.java
+12
-3
yd-api/src/main/java/com/yd/api/practitioner/vo/payscale/PayScaleQueryRequestVO.java
+13
-0
No files found.
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerBasicInfoServiceImpl.java
View file @
008d0c05
...
...
@@ -362,9 +362,106 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
@Override
public
PayScaleQueryResponseVO
payScaleListQuery
(
PayScaleQueryRequestVO
requestVO
)
{
PayScaleQueryResponseVO
responseVO
=
new
PayScaleQueryResponseVO
();
String
isHistory
=
requestVO
.
getIsHistory
();
List
<
PayScaleInfo
>
resultList
=
new
ArrayList
<>();
List
<
PayScaleInfo
>
listFromN22
=
null
;
List
<
PayScaleInfo
>
historyEG
=
null
;
try
{
listFromN22
=
this
.
queryPayScaleListFromN22
(
requestVO
);
// 查询全部才需要执行
if
(
"1"
.
equals
(
isHistory
))
{
historyEG
=
this
.
historyEG
(
requestVO
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
if
(
CollectionUtils
.
isNotEmpty
(
listFromN22
))
{
resultList
.
addAll
(
listFromN22
);
}
if
(
CollectionUtils
.
isNotEmpty
(
historyEG
))
{
resultList
.
addAll
(
historyEG
);
}
// 排序
resultList
.
sort
(
Comparator
.
comparing
(
PayScaleInfo
::
getMonDtlPeriod
).
reversed
());
responseVO
.
setPayScaleInfos
(
resultList
);
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
return
responseVO
;
}
private
List
<
PayScaleInfo
>
queryPayScaleListFromN22
(
PayScaleQueryRequestVO
requestVO
)
throws
Exception
{
Long
practitionerId
=
requestVO
.
getPractitionerId
();
String
isHistory
=
requestVO
.
getIsHistory
();
String
mobileNo
=
aclPractitionerDALService
.
findMobileNoByPractitionerId
(
practitionerId
);
Staff
staff
=
n22StaffService
.
queryN22StaffByMobileNo
(
mobileNo
);
if
(
staff
==
null
&&
StringUtils
.
isBlank
(
staff
.
getAgent_id
()))
{
throw
new
Exception
(
"未查询到N22LoginName"
);
}
// 1.根据Agent_id当前经纪人的佣金明细
SalaryDetailsSearchRequestBody
salaryDetailsSearchRequestBody
=
new
SalaryDetailsSearchRequestBody
();
salaryDetailsSearchRequestBody
.
setLoginName
(
staff
.
getAgent_id
());
salaryDetailsSearchRequestBody
.
setSearchType
(
"1"
);
if
(
"0"
.
equals
(
isHistory
))
{
salaryDetailsSearchRequestBody
.
setStartDate
(
CommonUtil
.
getBeginDayOfYear
());
salaryDetailsSearchRequestBody
.
setEndDate
(
CommonUtil
.
getEndDayOfYear
());
}
SalaryDetailsSearchResponseVO
salaryDetailsSearchResponseVO
=
n22SalaryService
.
salaryDetailsSearch
(
salaryDetailsSearchRequestBody
);
if
(!
"查询成功"
.
equals
(
salaryDetailsSearchResponseVO
.
getResponseHead
().
getMessage
())){
throw
new
Exception
(
salaryDetailsSearchResponseVO
.
getResponseHead
().
getMessage
());
}
List
<
SalaryDetails
>
salaryDetailsList
=
salaryDetailsSearchResponseVO
.
getResponseBody
().
getSalaryDetailsLIST
();
// list分组
Map
<
String
,
List
<
SalaryDetails
>>
group
=
this
.
groupByCheckDate
(
salaryDetailsList
);
// 组装返回参数
List
<
PayScaleInfo
>
resultList
=
new
ArrayList
<>();
// 应发佣金
Double
monDtlAmount
=
0
D
;
// 应发佣金
Double
monDtlRAmount
=
0
D
;
// loginName
String
loginName
=
""
;
for
(
String
key
:
group
.
keySet
())
{
System
.
out
.
println
(
"Key = "
+
key
);
List
<
SalaryDetails
>
list
=
group
.
get
(
key
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
monDtlAmount
=
list
.
get
(
0
).
getSumcommission
();
monDtlRAmount
=
list
.
get
(
0
).
getTax_free_comis
();
loginName
=
list
.
get
(
0
).
getLoginName
();
}
PayScaleInfo
payScaleInfo
=
new
PayScaleInfo
();
payScaleInfo
.
setMonDtlAmount
(
monDtlAmount
);
payScaleInfo
.
setMonDtlItem
(
"实发薪水"
);
payScaleInfo
.
setMonDtlRAmount
(
monDtlRAmount
);
payScaleInfo
.
setDrpTitleCode
(
list
.
get
(
0
).
getGrade
());
payScaleInfo
.
setMonDtlPeriod
(
key
);
payScaleInfo
.
setLoginName
(
loginName
);
resultList
.
add
(
payScaleInfo
);
}
resultList
.
sort
(
Comparator
.
comparing
(
PayScaleInfo
::
getMonDtlPeriod
).
reversed
());
return
resultList
;
}
private
List
<
PayScaleInfo
>
historyEG
(
PayScaleQueryRequestVO
requestVO
)
{
String
practitionerIdEG
=
requestVO
.
getPractitionerIdEG
();
Long
practitionerId
=
requestVO
.
getPractitionerId
();
Map
<
Long
,
PayScaleInfo
>
payScaleInfoMap
=
new
HashMap
<>();
Map
<
String
,
PayScaleInfo
>
payScaleInfoMap
=
new
HashMap
<>();
if
(!
Strings
.
isNullOrEmpty
(
practitionerIdEG
)){
List
<
PayScaleInfo
>
payScaleInfoListAll
=
aclPractitionerDALService
.
findPayScaleByPractitionerEG
(
practitionerIdEG
);
...
...
@@ -377,7 +474,7 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
titleList
.
forEach
(
i
->
titleMap
.
put
(
i
.
getTitleCode
(),
i
.
getTitleName
()));
PayScaleInfo
payScaleInfo
;
Lo
ng
time
;
Stri
ng
time
;
for
(
PayScaleInfo
item
:
payScaleInfoListAll
){
time
=
item
.
getMonDtlPeriod
();
if
(
payScaleInfoMap
.
containsKey
(
time
)){
...
...
@@ -406,11 +503,9 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
translateObj
(
list
,
resultList
);
// 排序
resultList
.
sort
(
Comparator
.
comparingLong
(
PayScaleInfo
::
getMonDtlPeriod
).
reversed
());
responseVO
.
setPayScaleInfos
(
resultList
);
resultList
.
sort
(
Comparator
.
comparing
(
PayScaleInfo
::
getMonDtlPeriod
).
reversed
());
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
return
responseVO
;
return
resultList
;
}
/**
...
...
@@ -418,18 +513,14 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
*/
private
Map
<
String
,
List
<
SalaryDetails
>>
groupByCheckDate
(
List
<
SalaryDetails
>
salaryDetailsList
)
{
Map
<
String
,
List
<
SalaryDetails
>>
result
=
new
HashMap
<
String
,
List
<
SalaryDetails
>>();
int
year
=
0
;
String
month
=
""
;
String
key
=
""
;
String
checkDate
=
""
;
for
(
SalaryDetails
SalaryDetails
:
salaryDetailsList
)
{
year
=
SalaryDetails
.
getYear
();
month
=
SalaryDetails
.
getMonth
();
key
=
year
+
month
;
checkDate
=
SalaryDetails
.
getCheckDate
();
List
<
SalaryDetails
>
childList
=
result
.
get
(
key
);
List
<
SalaryDetails
>
childList
=
result
.
get
(
checkDate
);
if
(
childList
==
null
)
{
childList
=
new
ArrayList
<
SalaryDetails
>();
result
.
put
(
key
,
childList
);
result
.
put
(
checkDate
,
childList
);
}
childList
.
add
(
SalaryDetails
);
...
...
@@ -444,7 +535,7 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
payScaleInfo
=
new
PayScaleInfo
();
payScaleInfo
.
setMonShId
(
salary
.
getId
());
payScaleInfo
.
setPdfOssPath
(
salary
.
getPdfOssPath
());
payScaleInfo
.
setMonDtlPeriod
(
Long
.
valueOf
(
salary
.
getYearMonth
()
));
payScaleInfo
.
setMonDtlPeriod
(
salary
.
getYearMonth
(
));
payScaleInfo
.
setMonDtlAmount
(
salary
.
getPayableAmount
().
doubleValue
());
payScaleInfo
.
setMonDtlRAmount
(
salary
.
getNetAmount
().
doubleValue
());
...
...
yd-api/src/main/java/com/yd/api/practitioner/vo/payscale/PayScaleInfo.java
View file @
008d0c05
...
...
@@ -6,12 +6,13 @@ public class PayScaleInfo {
private
String
drpTitleCode
;
private
String
monDtlType
;
private
String
monDtlItem
;
private
Lo
ng
monDtlPeriod
;
private
Stri
ng
monDtlPeriod
;
private
Double
monDtlAmount
;
private
Double
monDtlRAmount
;
private
String
createDate
;
private
String
createUser
;
private
String
pdfOssPath
;
private
String
loginName
;
public
Long
getMonShId
()
{
return
monShId
;
...
...
@@ -85,11 +86,11 @@ public class PayScaleInfo {
this
.
createUser
=
createUser
;
}
public
Lo
ng
getMonDtlPeriod
()
{
public
Stri
ng
getMonDtlPeriod
()
{
return
monDtlPeriod
;
}
public
void
setMonDtlPeriod
(
Lo
ng
monDtlPeriod
)
{
public
void
setMonDtlPeriod
(
Stri
ng
monDtlPeriod
)
{
this
.
monDtlPeriod
=
monDtlPeriod
;
}
...
...
@@ -100,4 +101,12 @@ public class PayScaleInfo {
public
void
setPdfOssPath
(
String
pdfOssPath
)
{
this
.
pdfOssPath
=
pdfOssPath
;
}
public
String
getLoginName
()
{
return
loginName
;
}
public
void
setLoginName
(
String
loginName
)
{
this
.
loginName
=
loginName
;
}
}
yd-api/src/main/java/com/yd/api/practitioner/vo/payscale/PayScaleQueryRequestVO.java
View file @
008d0c05
...
...
@@ -5,6 +5,11 @@ public class PayScaleQueryRequestVO {
private
Long
practitionerId
;
/**
* 0-查本年 1-查全部
*/
private
String
isHistory
;
public
String
getPractitionerIdEG
()
{
return
practitionerIdEG
;
}
...
...
@@ -20,4 +25,12 @@ public class PayScaleQueryRequestVO {
public
void
setPractitionerId
(
Long
practitionerId
)
{
this
.
practitionerId
=
practitionerId
;
}
public
String
getIsHistory
()
{
return
isHistory
;
}
public
void
setIsHistory
(
String
isHistory
)
{
this
.
isHistory
=
isHistory
;
}
}
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