Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf
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
xingmin
yd-csf
Commits
7295d046
Commit
7295d046
authored
Jul 02, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/test' into test_zxm_user
parents
4c3848ee
de226113
Show whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
967 additions
and
35 deletions
+967
-35
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiSalaryController.java
+30
-3
yd-csf-api/src/main/java/com/yd/csf/api/dto/AlgorithmDto.java
+5
-0
yd-csf-api/src/main/java/com/yd/csf/api/service/ApiSalaryService.java
+8
-3
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiBasicLawCalculateServiceImpl.java
+11
-0
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
+3
-1
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiSalaryServiceImpl.java
+453
-16
yd-csf-feign/src/main/java/com/yd/csf/feign/client/salary/ApiSalaryFeignClient.java
+27
-0
yd-csf-feign/src/main/java/com/yd/csf/feign/dto/salary/ApiSalaryBatchAddDTO.java
+12
-2
yd-csf-feign/src/main/java/com/yd/csf/feign/dto/salaryremittance/ApiSalaryRemittanceDTO.java
+6
-1
yd-csf-feign/src/main/java/com/yd/csf/feign/fallback/salary/ApiSalaryFeignFallbackFactory.java
+19
-0
yd-csf-feign/src/main/java/com/yd/csf/feign/request/salary/ApiSalaryAddRequest.java
+5
-0
yd-csf-feign/src/main/java/com/yd/csf/feign/request/salary/ApiSalaryConditionListRequest.java
+21
-0
yd-csf-feign/src/main/java/com/yd/csf/feign/request/salary/ApiSalaryEditRequest.java
+5
-0
yd-csf-feign/src/main/java/com/yd/csf/feign/request/salary/ApiSalaryExportRequest.java
+23
-0
yd-csf-feign/src/main/java/com/yd/csf/feign/request/salary/ApiSalaryPageRequest.java
+10
-0
yd-csf-feign/src/main/java/com/yd/csf/feign/request/salary/ApiSalaryPushPageRequest.java
+5
-0
yd-csf-feign/src/main/java/com/yd/csf/feign/response/salary/ApiSalaryBrokerListResponse.java
+28
-0
yd-csf-feign/src/main/java/com/yd/csf/feign/response/salary/ApiSalaryConditionListResponse.java
+19
-0
yd-csf-feign/src/main/java/com/yd/csf/feign/response/salary/ApiSalaryConditionResponse.java
+29
-0
yd-csf-feign/src/main/java/com/yd/csf/feign/response/salary/ApiSalaryDetailResponse.java
+20
-0
yd-csf-feign/src/main/java/com/yd/csf/feign/response/salary/ApiSalaryExportResponse.java
+9
-0
yd-csf-feign/src/main/java/com/yd/csf/feign/response/salary/ApiSalaryPageResponse.java
+12
-0
yd-csf-feign/src/main/java/com/yd/csf/feign/response/salary/ApiSalaryPushPageResponse.java
+17
-0
yd-csf-service/src/main/java/com/yd/csf/service/dto/FortuneQueryRequest.java
+12
-0
yd-csf-service/src/main/java/com/yd/csf/service/enums/CommissionRuleConfigEnum.java
+45
-0
yd-csf-service/src/main/java/com/yd/csf/service/enums/RuleItemConfigEnum.java
+56
-0
yd-csf-service/src/main/java/com/yd/csf/service/model/Salary.java
+3
-5
yd-csf-service/src/main/java/com/yd/csf/service/model/SalaryRemittance.java
+7
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/FortuneAccountService.java
+1
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/ISalaryRemittanceService.java
+8
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
+21
-2
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/SalaryRemittanceServiceImpl.java
+19
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/SalaryServiceImpl.java
+2
-0
yd-csf-service/src/main/resources/mappers/SalaryMapper.xml
+16
-1
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiSalaryController.java
View file @
7295d046
...
...
@@ -5,9 +5,7 @@ import com.yd.common.result.Result;
import
com.yd.csf.api.service.ApiSalaryService
;
import
com.yd.csf.feign.client.salary.ApiSalaryFeignClient
;
import
com.yd.csf.feign.request.salary.*
;
import
com.yd.csf.feign.response.salary.ApiSalaryDetailResponse
;
import
com.yd.csf.feign.response.salary.ApiSalaryPageResponse
;
import
com.yd.csf.feign.response.salary.ApiSalaryPushPageResponse
;
import
com.yd.csf.feign.response.salary.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -15,6 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.validation.constraints.NotBlank
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* 薪资单信息
...
...
@@ -180,5 +179,33 @@ public class ApiSalaryController implements ApiSalaryFeignClient {
return
apiSalaryService
.
calculateTotalAmount
(
request
);
}
/**
* 查询薪资单转介人列表信息
* @return
*/
@Override
public
Result
<
List
<
ApiSalaryBrokerListResponse
>>
brokerList
(
String
name
)
{
return
apiSalaryService
.
brokerList
(
name
);
}
/**
* 电子薪资单-导出
* @param request
* @return
*/
@Override
public
Result
<
ApiSalaryExportResponse
>
export
(
ApiSalaryExportRequest
request
)
{
return
apiSalaryService
.
export
(
request
);
}
/**
* 条件查询-电子薪资单列表信息(查询已推送薪资单信息)
* @param request
* @return
*/
@Override
public
Result
<
ApiSalaryConditionListResponse
>
conditionList
(
ApiSalaryConditionListRequest
request
)
{
return
apiSalaryService
.
conditionList
(
request
);
}
}
yd-csf-api/src/main/java/com/yd/csf/api/dto/AlgorithmDto.java
View file @
7295d046
...
...
@@ -16,6 +16,11 @@ import java.util.List;
public
class
AlgorithmDto
{
/**
* 期数(数字代表第几年)
*/
private
Integer
issueNumber
;
/**
* 保单发佣批次ID
*/
private
String
batchBizId
;
...
...
yd-csf-api/src/main/java/com/yd/csf/api/service/ApiSalaryService.java
View file @
7295d046
...
...
@@ -3,11 +3,10 @@ package com.yd.csf.api.service;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yd.common.result.Result
;
import
com.yd.csf.feign.request.salary.*
;
import
com.yd.csf.feign.response.salary.ApiSalaryDetailResponse
;
import
com.yd.csf.feign.response.salary.ApiSalaryPageResponse
;
import
com.yd.csf.feign.response.salary.ApiSalaryPushPageResponse
;
import
com.yd.csf.feign.response.salary.*
;
import
java.math.BigDecimal
;
import
java.util.List
;
public
interface
ApiSalaryService
{
Result
<
IPage
<
ApiSalaryPageResponse
>>
page
(
ApiSalaryPageRequest
request
);
...
...
@@ -39,4 +38,10 @@ public interface ApiSalaryService {
Result
<
BigDecimal
>
calculatePaidAmount
(
ApiSalaryCalculatePaidAmountRequest
request
);
Result
<
BigDecimal
>
calculateTotalAmount
(
ApiSalaryCalculateTotalAmountRequest
request
);
Result
<
ApiSalaryConditionListResponse
>
conditionList
(
ApiSalaryConditionListRequest
request
);
Result
<
ApiSalaryExportResponse
>
export
(
ApiSalaryExportRequest
request
);
Result
<
List
<
ApiSalaryBrokerListResponse
>>
brokerList
(
String
name
);
}
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiBasicLawCalculateServiceImpl.java
View file @
7295d046
...
...
@@ -17,6 +17,7 @@ import com.yd.csf.feign.request.basiclawcalculate.ApiGenerateBillingRequest;
import
com.yd.csf.feign.response.basiclawcalculate.ApiGenerateBillingResponse
;
import
com.yd.csf.service.dto.*
;
import
com.yd.csf.service.enums.FortuneStatusEnum
;
import
com.yd.csf.service.enums.RuleItemConfigEnum
;
import
com.yd.csf.service.model.*
;
import
com.yd.csf.service.service.*
;
import
com.yd.insurance.base.feign.client.ApiRelProductAnnouncementFeignClient
;
...
...
@@ -407,6 +408,16 @@ public class ApiBasicLawCalculateServiceImpl implements ApiBasicLawCalculateServ
if
(
CollectionUtils
.
isEmpty
(
ruleItemConfigList
))
{
throw
new
BusinessException
(
"基本法项目列表不存在"
);
}
//根据期数字段,判断是否是续期(续年)来过滤对应的销售佣金项目,续期期数保留续期销售项目剔除首期的销售佣金项目,首期期数保留首期的销售佣金项目剔除续期销售佣金项目
if
(
algorithmDto
.
getIssueNumber
()
!=
null
)
{
if
(
algorithmDto
.
getIssueNumber
()
==
1
)
{
//首期->剔除非首期(续期)的销售佣金项目
ruleItemConfigList
.
removeIf
(
item
->
RuleItemConfigEnum
.
XQ_XS_YJ
.
getItemCode
().
equals
(
item
.
getItemCode
()));
}
else
{
//续期->剔除首期销售佣金项目
ruleItemConfigList
.
removeIf
(
item
->
RuleItemConfigEnum
.
XS_YJ
.
getItemCode
().
equals
(
item
.
getItemCode
()));
}
}
log
.
info
(
"查询基本法类型绑定的基本法项目列表 - 执行顺序,数值越小越先执行,用于控制佣金项目的计算顺序->出参:{}"
,
JSON
.
toJSONString
(
algorithmDto
));
List
<
AlgorithmResDto
>
algorithmResDtoList
=
new
ArrayList
<>();
//遍历基本法项目 - 计算对应值
...
...
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
View file @
7295d046
...
...
@@ -546,7 +546,8 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
resDto
.
setAlgorithmResDtoList
(
result
.
getData
());
collectResDtos
.
add
(
resDto
);
if
(!
CollectionUtils
.
isEmpty
(
commissionRuleBindingList
))
{
//续年度只发销售佣金,其他奖项均不发放
if
(!
CollectionUtils
.
isEmpty
(
commissionRuleBindingList
)
&&
i
==
1
)
{
for
(
CommissionRuleBinding
binding
:
commissionRuleBindingList
)
{
Result
<
List
<
AlgorithmResDto
>>
result1
=
executeReward
(
ExecuteBillingDto
.
builder
()
.
clientUserBizId
(
binding
.
getTargetId
())
...
...
@@ -793,6 +794,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
//保单出账先执行销售佣金基本法项目,入完到积分明细表里后,再执行保单绑定人的其他基本法项目
Result
<
List
<
AlgorithmResDto
>>
result
=
apiBasicLawCalculateService
.
policyBrokerAlgorithm
(
AlgorithmDto
.
builder
()
.
issueNumber
(
dto
.
getIssueNumber
())
.
brokerBizId
(
brokerDto
.
getBrokerBizId
())
.
clientUserBizId
(
brokerDto
.
getBrokerBizId
())
.
sqlTemplateParamDto
(
SqlTemplateParamDto
.
builder
()
...
...
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiSalaryServiceImpl.java
View file @
7295d046
package
com
.
yd
.
csf
.
api
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yd.base.feign.client.exchangerate.ApiExchangeRateFeignClient
;
...
...
@@ -17,16 +18,22 @@ import com.yd.csf.feign.dto.salaryremittance.ApiSalaryRemittanceDTO;
import
com.yd.csf.feign.dto.salaryremittance.ApiSalaryRemittanceFzDTO
;
import
com.yd.csf.feign.enums.SalaryStatusEnum
;
import
com.yd.csf.feign.request.salary.*
;
import
com.yd.csf.feign.response.salary.ApiSalaryDetailResponse
;
import
com.yd.csf.feign.response.salary.ApiSalaryPageResponse
;
import
com.yd.csf.feign.response.salary.ApiSalaryPushPageResponse
;
import
com.yd.csf.feign.response.salary.*
;
import
com.yd.csf.service.enums.FortuneAccountStatusEnum
;
import
com.yd.csf.service.model.FortuneAccount
;
import
com.yd.csf.service.model.PolicyFollow
;
import
com.yd.csf.service.model.Salary
;
import
com.yd.csf.service.model.SalaryRemittance
;
import
com.yd.csf.service.service.FortuneAccountService
;
import
com.yd.csf.service.service.ISalaryRemittanceService
;
import
com.yd.csf.service.service.ISalaryService
;
import
com.yd.insurance.base.feign.client.usersaleexpand.ApiUserSaleExpandFeignClient
;
import
com.yd.insurance.base.feign.request.usersaleexpand.ApiUserSaleExpandListRequest
;
import
com.yd.insurance.base.feign.response.usersaleexpand.ApiUserSaleExpandDetailResponse
;
import
com.yd.oss.feign.client.ApiExcelFeignClient
;
import
com.yd.oss.feign.dto.ExportResult
;
import
com.yd.oss.feign.dto.SheetExportConfig
;
import
com.yd.oss.feign.request.MultiSheetExportRequest
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
...
...
@@ -37,11 +44,14 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.YearMonth
;
import
java.time.ZoneId
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
@Slf4j
...
...
@@ -63,6 +73,12 @@ public class ApiSalaryServiceImpl implements ApiSalaryService {
@Autowired
private
ApiExchangeRateFeignClient
apiExchangeRateFeignClient
;
@Resource
private
ApiUserSaleExpandFeignClient
apiUserSaleExpandFeignClient
;
@Autowired
private
ApiExcelFeignClient
apiExcelFeignClient
;
/**
* 分页查询-制作薪资单列表信息
* @param request
...
...
@@ -72,10 +88,46 @@ public class ApiSalaryServiceImpl implements ApiSalaryService {
public
Result
<
IPage
<
ApiSalaryPageResponse
>>
page
(
ApiSalaryPageRequest
request
)
{
Page
<
ApiSalaryPageResponse
>
page
=
new
Page
<>(
request
.
getPageNo
(),
request
.
getPageSize
());
IPage
<
ApiSalaryPageResponse
>
iPage
=
iSalaryService
.
page
(
page
,
request
);
iPage
=
setPage
(
iPage
);
return
Result
.
success
(
iPage
);
}
/**
* 设置分页结果返参
* @param iPage
* @return
*/
public
IPage
<
ApiSalaryPageResponse
>
setPage
(
IPage
<
ApiSalaryPageResponse
>
iPage
)
{
if
(
CollectionUtils
.
isEmpty
(
iPage
.
getRecords
()))
{
return
iPage
;
}
List
<
String
>
clientUserBizIdList
=
iPage
.
getRecords
()
.
stream
()
.
map
(
ApiSalaryPageResponse:
:
getBrokerBizId
)
.
distinct
()
.
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
clientUserBizIdList
))
{
return
iPage
;
}
ApiUserSaleExpandListRequest
request
=
new
ApiUserSaleExpandListRequest
();
request
.
setClientUserBizIdList
(
clientUserBizIdList
);
Result
<
List
<
ApiUserSaleExpandDetailResponse
>>
result
=
apiUserSaleExpandFeignClient
.
list
(
request
);
if
(
CollectionUtils
.
isEmpty
(
result
.
getData
()))
{
return
iPage
;
}
Map
<
String
,
ApiUserSaleExpandDetailResponse
>
policyFollowMap
=
result
.
getData
().
stream
()
.
collect
(
Collectors
.
toMap
(
ApiUserSaleExpandDetailResponse:
:
getClientUserBizId
,
Function
.
identity
()));
iPage
.
getRecords
().
forEach
(
d
->
{
ApiUserSaleExpandDetailResponse
response
=
policyFollowMap
.
get
(
d
.
getBrokerBizId
());
if
(
response
!=
null
)
{
d
.
setTeamName
(
response
.
getTeamName
());
d
.
setInternalNumber
(
response
.
getInternalNumber
());
}
});
return
iPage
;
}
/**
* 分页查询-电子薪资单列表信息(推送列表信息)
* @param request
* @return
...
...
@@ -112,6 +164,18 @@ public class ApiSalaryServiceImpl implements ApiSalaryService {
}
fzDTO
.
setSalaryRemittanceDTOList
(
salaryRemittanceDTOList
);
response
.
setApiSalaryRemittanceFzDTO
(
fzDTO
);
//查询转介人信息
List
<
String
>
clientUserBizIdList
=
new
ArrayList
<>();
clientUserBizIdList
.
add
(
salary
.
getBrokerBizId
());
ApiUserSaleExpandListRequest
request
=
new
ApiUserSaleExpandListRequest
();
request
.
setClientUserBizIdList
(
clientUserBizIdList
);
Result
<
List
<
ApiUserSaleExpandDetailResponse
>>
result
=
apiUserSaleExpandFeignClient
.
list
(
request
);
if
(
CollectionUtils
.
isNotEmpty
(
result
.
getData
()))
{
List
<
ApiUserSaleExpandDetailResponse
>
responses
=
result
.
getData
();
ApiUserSaleExpandDetailResponse
detailResponse
=
responses
.
get
(
0
);
response
.
setInternalNumber
(
detailResponse
.
getInternalNumber
());
}
return
Result
.
success
(
response
);
}
...
...
@@ -188,9 +252,9 @@ public class ApiSalaryServiceImpl implements ApiSalaryService {
if
(
salary
==
null
)
{
throw
new
BusinessException
(
"薪资单信息不存在"
);
}
if
(
SalaryStatusEnum
.
DTJ
.
getItemValue
().
equals
(
salary
.
getStatus
())
||
SalaryStatusEnum
.
TH
.
getItemValue
().
equals
(
salary
.
getStatus
()))
{
throw
new
BusinessException
(
"
非待提交或者退回状态不
能提交核对"
);
if
(
!(
SalaryStatusEnum
.
DTJ
.
getItemValue
().
equals
(
salary
.
getStatus
())
||
SalaryStatusEnum
.
TH
.
getItemValue
().
equals
(
salary
.
getStatus
()))
)
{
throw
new
BusinessException
(
"
只有待提交或者退回状态,才
能提交核对"
);
}
//重新提交->待核对状态
salary
.
setStatus
(
SalaryStatusEnum
.
DHD
.
getItemValue
());
...
...
@@ -210,7 +274,7 @@ public class ApiSalaryServiceImpl implements ApiSalaryService {
throw
new
BusinessException
(
"薪资单信息不存在"
);
}
if
(!
SalaryStatusEnum
.
DHD
.
getItemValue
().
equals
(
salary
.
getStatus
()))
{
throw
new
BusinessException
(
"
非待核对状态不
能核对"
);
throw
new
BusinessException
(
"
必须待核对状态下,才
能核对"
);
}
salary
.
setStatus
(
request
.
getStatus
()
==
1
?
SalaryStatusEnum
.
YHD
.
getItemValue
()
:
SalaryStatusEnum
.
TH
.
getItemValue
());
salary
.
setReturnRemark
(
request
.
getReturnRemark
());
...
...
@@ -230,7 +294,7 @@ public class ApiSalaryServiceImpl implements ApiSalaryService {
throw
new
BusinessException
(
"薪资单信息不存在"
);
}
if
(!
SalaryStatusEnum
.
YHD
.
getItemValue
().
equals
(
salary
.
getStatus
()))
{
throw
new
BusinessException
(
"
非已核对状态不
能推送"
);
throw
new
BusinessException
(
"
必须已核对状态下,才
能推送"
);
}
salary
.
setStatus
(
SalaryStatusEnum
.
YTS
.
getItemValue
());
iSalaryService
.
saveOrUpdate
(
salary
);
...
...
@@ -285,6 +349,7 @@ public class ApiSalaryServiceImpl implements ApiSalaryService {
remittance1
.
setSalaryBizId
(
salary
.
getSalaryBizId
());
remittance1
.
setSalaryRemittanceBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_SALARY_REMITTANCE
.
getCode
()));
remittance1
.
setBank
(
dto
.
getBank1
());
remittance1
.
setBankName
(
dto
.
getBank1Name
());
remittance1
.
setAccountEndNo
(
dto
.
getAccountEndNo1
());
remittance1
.
setCurrency
(
dto
.
getCurrency1
());
remittance1
.
setAmount
(
dto
.
getAmount1
());
...
...
@@ -295,6 +360,7 @@ public class ApiSalaryServiceImpl implements ApiSalaryService {
remittance2
.
setSalaryBizId
(
salary
.
getSalaryBizId
());
remittance2
.
setSalaryRemittanceBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_SALARY_REMITTANCE
.
getCode
()));
remittance2
.
setBank
(
dto
.
getBank2
());
remittance2
.
setBankName
(
dto
.
getBank2Name
());
remittance2
.
setAccountEndNo
(
dto
.
getAccountEndNo2
());
remittance2
.
setCurrency
(
dto
.
getCurrency2
());
remittance2
.
setAmount
(
dto
.
getAmount2
());
...
...
@@ -405,6 +471,375 @@ public class ApiSalaryServiceImpl implements ApiSalaryService {
}
/**
* 条件查询-电子薪资单列表信息
* @param request
* @return
*/
@Override
public
Result
<
ApiSalaryConditionListResponse
>
conditionList
(
ApiSalaryConditionListRequest
request
)
{
// 1. 根据手机号查询转介人信息
ApiUserSaleExpandListRequest
listRequest
=
new
ApiUserSaleExpandListRequest
();
listRequest
.
setPhone
(
request
.
getMobile
());
Result
<
List
<
ApiUserSaleExpandDetailResponse
>>
result
=
apiUserSaleExpandFeignClient
.
list
(
listRequest
);
if
(
CollectionUtils
.
isEmpty
(
result
.
getData
()))
{
// 无转介人信息,返回空列表
ApiSalaryConditionListResponse
response
=
new
ApiSalaryConditionListResponse
();
response
.
setCount
(
0
);
response
.
setConditionResponseList
(
Collections
.
emptyList
());
return
Result
.
success
(
response
);
}
// 取第一个转介人(通常一个手机号对应一个转介人)
ApiUserSaleExpandDetailResponse
userDetail
=
result
.
getData
().
get
(
0
);
String
brokerBizId
=
userDetail
.
getClientUserBizId
();
if
(
StringUtils
.
isBlank
(
brokerBizId
))
{
// 转介人业务ID为空,返回空列表
ApiSalaryConditionListResponse
response
=
new
ApiSalaryConditionListResponse
();
response
.
setCount
(
0
);
response
.
setConditionResponseList
(
Collections
.
emptyList
());
return
Result
.
success
(
response
);
}
// 2. 根据转介人业务ID和年份查询薪资单
String
year
=
request
.
getYear
();
LambdaQueryWrapper
<
Salary
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Salary:
:
getBrokerBizId
,
brokerBizId
)
.
likeRight
(
Salary:
:
getMonth
,
year
)
// month 为 yyyyMM,匹配前四位年份
.
eq
(
Salary:
:
getIsDeleted
,
0
)
.
eq
(
Salary:
:
getStatus
,
SalaryStatusEnum
.
YTS
.
getItemValue
())
//已推送状态
.
orderByDesc
(
Salary:
:
getMonth
);
// 按月份降序排列(最近的在前面)
List
<
Salary
>
salaryList
=
iSalaryService
.
list
(
wrapper
);
if
(
CollectionUtils
.
isEmpty
(
salaryList
))
{
ApiSalaryConditionListResponse
response
=
new
ApiSalaryConditionListResponse
();
response
.
setCount
(
0
);
response
.
setConditionResponseList
(
Collections
.
emptyList
());
return
Result
.
success
(
response
);
}
// 3. 转换为响应对象
List
<
ApiSalaryConditionResponse
>
conditionResponseList
=
salaryList
.
stream
()
.
map
(
salary
->
{
ApiSalaryConditionResponse
resp
=
new
ApiSalaryConditionResponse
();
resp
.
setSalaryBizId
(
salary
.
getSalaryBizId
());
// 格式化月份为 "xxxx年MM月"
String
month
=
salary
.
getMonth
();
String
yearMonth
=
formatYearMonth
(
month
);
resp
.
setYearMonth
(
yearMonth
);
resp
.
setPaidAmount
(
salary
.
getPaidAmount
());
// 状态名称转换
// resp.setStatusName(getStatusDesc(salary.getStatus()));
resp
.
setStatusName
(
"已发放"
);
return
resp
;
})
.
collect
(
Collectors
.
toList
());
// 4. 组装最终响应
ApiSalaryConditionListResponse
response
=
new
ApiSalaryConditionListResponse
();
response
.
setCount
(
conditionResponseList
.
size
());
response
.
setConditionResponseList
(
conditionResponseList
);
return
Result
.
success
(
response
);
}
/**
* 将 yyyyMM 格式的月份转为 xxxx年MM月
*/
private
String
formatYearMonth
(
String
month
)
{
if
(
StringUtils
.
isBlank
(
month
)
||
month
.
length
()
!=
6
)
{
return
month
;
}
try
{
String
year
=
month
.
substring
(
0
,
4
);
String
mm
=
month
.
substring
(
4
,
6
);
return
year
+
"年"
+
mm
+
"月"
;
}
catch
(
Exception
e
)
{
return
month
;
}
}
/**
* 电子薪资单-导出
* @param request
* @return
*/
@Override
public
Result
<
ApiSalaryExportResponse
>
export
(
ApiSalaryExportRequest
request
)
{
// 1. 构建查询条件
LambdaQueryWrapper
<
Salary
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Salary:
:
getIsDeleted
,
0
);
if
(
StringUtils
.
isNotBlank
(
request
.
getBrokerName
()))
{
wrapper
.
like
(
Salary:
:
getBrokerName
,
request
.
getBrokerName
());
}
if
(
StringUtils
.
isNotBlank
(
request
.
getMonth
()))
{
wrapper
.
eq
(
Salary:
:
getMonth
,
request
.
getMonth
());
}
if
(
StringUtils
.
isNotBlank
(
request
.
getStatus
()))
{
wrapper
.
eq
(
Salary:
:
getStatus
,
request
.
getStatus
());
}
// 按创建时间排序(可选)
wrapper
.
orderByAsc
(
Salary:
:
getCreateTime
);
// 2. 查询薪资单列表
List
<
Salary
>
salaryList
=
iSalaryService
.
list
(
wrapper
);
if
(
CollectionUtils
.
isEmpty
(
salaryList
))
{
throw
new
BusinessException
(
"未查询到符合条件的薪资单数据"
);
}
// 3. 收集所有转介人业务ID,批量查询团队和内部编号(避免循环调用Feign)
List
<
String
>
brokerBizIds
=
salaryList
.
stream
()
.
map
(
Salary:
:
getBrokerBizId
)
.
filter
(
StringUtils:
:
isNotBlank
)
.
distinct
()
.
collect
(
Collectors
.
toList
());
Map
<
String
,
ApiUserSaleExpandDetailResponse
>
expandMap
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
brokerBizIds
))
{
ApiUserSaleExpandListRequest
expandRequest
=
new
ApiUserSaleExpandListRequest
();
expandRequest
.
setClientUserBizIdList
(
brokerBizIds
);
Result
<
List
<
ApiUserSaleExpandDetailResponse
>>
expandResult
=
apiUserSaleExpandFeignClient
.
list
(
expandRequest
);
if
(
expandResult
!=
null
&&
CollectionUtils
.
isNotEmpty
(
expandResult
.
getData
()))
{
expandMap
=
expandResult
.
getData
().
stream
()
.
collect
(
Collectors
.
toMap
(
ApiUserSaleExpandDetailResponse:
:
getClientUserBizId
,
Function
.
identity
(),
(
v1
,
v2
)
->
v1
));
}
}
// 4. 批量查询所有汇款明细(按 salaryBizId 分组)
List
<
String
>
salaryBizIds
=
salaryList
.
stream
()
.
map
(
Salary:
:
getSalaryBizId
)
.
collect
(
Collectors
.
toList
());
Map
<
String
,
List
<
SalaryRemittance
>>
remittanceMap
=
iSalaryRemittanceService
.
queryListBySalaryBizIds
(
salaryBizIds
);
// 5. 构建汇总总表数据(每个Salary一行)
List
<
Map
<
String
,
Object
>>
summaryList
=
new
ArrayList
<>();
// 6. 构建打款明细数据(每个Remittance一行)
List
<
Map
<
String
,
Object
>>
detailList
=
new
ArrayList
<>();
for
(
Salary
salary
:
salaryList
)
{
// 获取团队和内部编号
String
brokerBizId
=
salary
.
getBrokerBizId
();
String
teamName
=
""
;
String
internalNumber
=
salary
.
getInternalNumber
()
!=
null
?
salary
.
getInternalNumber
()
:
""
;
if
(
StringUtils
.
isNotBlank
(
brokerBizId
)
&&
expandMap
.
containsKey
(
brokerBizId
))
{
ApiUserSaleExpandDetailResponse
detail
=
expandMap
.
get
(
brokerBizId
);
teamName
=
detail
.
getTeamName
()
!=
null
?
detail
.
getTeamName
()
:
""
;
if
(
StringUtils
.
isBlank
(
internalNumber
))
{
internalNumber
=
detail
.
getInternalNumber
()
!=
null
?
detail
.
getInternalNumber
()
:
""
;
}
}
// --- 汇总行 ---
Map
<
String
,
Object
>
summaryRow
=
new
LinkedHashMap
<>();
summaryRow
.
put
(
"发放编号"
,
salary
.
getSalaryNo
());
summaryRow
.
put
(
"所属团队"
,
teamName
);
summaryRow
.
put
(
"姓名"
,
salary
.
getBrokerName
());
summaryRow
.
put
(
"内部编号"
,
internalNumber
);
summaryRow
.
put
(
"薪资月份"
,
formatMonth
(
salary
.
getMonth
()));
summaryRow
.
put
(
"应发金额(HKD)"
,
nullToZero
(
salary
.
getGrossAmount
()));
summaryRow
.
put
(
"MPF(HK)"
,
nullToZero
(
salary
.
getMpfAmount
()));
summaryRow
.
put
(
"其他调整(HKD)"
,
nullToZero
(
salary
.
getOtherAmount
()));
summaryRow
.
put
(
"实发金额(HKD)"
,
nullToZero
(
salary
.
getPaidAmount
()));
summaryRow
.
put
(
"扣款合计"
,
nullToZero
(
salary
.
getGrossAmount
()).
subtract
(
nullToZero
(
salary
.
getPaidAmount
())));
//扣款合计 = 应发-实发
summaryRow
.
put
(
"备注"
,
salary
.
getRemark
()
!=
null
?
salary
.
getRemark
()
:
""
);
List
<
SalaryRemittance
>
rems
=
remittanceMap
.
getOrDefault
(
salary
.
getSalaryBizId
(),
Collections
.
emptyList
());
summaryRow
.
put
(
"打款账户数"
,
rems
.
size
());
summaryRow
.
put
(
"发放状态"
,
getStatusDesc
(
salary
.
getStatus
()));
summaryRow
.
put
(
"备注"
,
salary
.
getRemark
()
!=
null
?
salary
.
getRemark
()
:
""
);
// 第二个备注
summaryRow
.
put
(
"制作人"
,
salary
.
getCreatorName
()
!=
null
?
salary
.
getCreatorName
()
:
""
);
summaryRow
.
put
(
"制作时间"
,
salary
.
getCreateTime
()
!=
null
?
salary
.
getCreateTime
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
))
:
""
);
summaryList
.
add
(
summaryRow
);
// --- 明细行 ---
for
(
SalaryRemittance
rem
:
rems
)
{
Map
<
String
,
Object
>
detailRow
=
new
LinkedHashMap
<>();
detailRow
.
put
(
"发放编号"
,
salary
.
getSalaryNo
());
detailRow
.
put
(
"所属团队"
,
teamName
);
detailRow
.
put
(
"姓名"
,
salary
.
getBrokerName
());
detailRow
.
put
(
"内部编号"
,
internalNumber
);
detailRow
.
put
(
"薪资月份"
,
formatMonth
(
salary
.
getMonth
()));
detailRow
.
put
(
"收款银行"
,
rem
.
getBankName
());
detailRow
.
put
(
"账户尾号"
,
rem
.
getAccountEndNo
()
!=
null
?
rem
.
getAccountEndNo
()
:
""
);
detailRow
.
put
(
"币种"
,
rem
.
getCurrency
()
!=
null
?
rem
.
getCurrency
()
:
""
);
detailRow
.
put
(
"发放金额"
,
nullToZero
(
rem
.
getAmount
()));
detailRow
.
put
(
"汇率"
,
nullToZero
(
rem
.
getExchangeRate
()));
detailRow
.
put
(
"备注"
,
rem
.
getRemark
()
!=
null
?
rem
.
getRemark
()
:
""
);
detailList
.
add
(
detailRow
);
}
}
// 7. 组装多 Sheet 导出请求
MultiSheetExportRequest
exportRequest
=
new
MultiSheetExportRequest
();
// Sheet1: 汇总总表
SheetExportConfig
sheet1
=
new
SheetExportConfig
();
sheet1
.
setSheetName
(
"汇总总表"
);
sheet1
.
setFieldNames
(
Arrays
.
asList
(
"发放编号"
,
"所属团队"
,
"姓名"
,
"内部编号"
,
"薪资月份"
,
"应发金额(HKD)"
,
"MPF(HK)"
,
"其他调整(HKD)"
,
"实发金额(HKD)"
,
"扣款合计"
,
"备注"
,
"打款账户数"
,
"发放状态"
,
"备注"
,
"制作人"
,
"制作时间"
));
sheet1
.
setDataList
(
summaryList
);
// Sheet2: 打款明细
SheetExportConfig
sheet2
=
new
SheetExportConfig
();
sheet2
.
setSheetName
(
"打款明细"
);
sheet2
.
setFieldNames
(
Arrays
.
asList
(
"发放编号"
,
"所属团队"
,
"姓名"
,
"内部编号"
,
"薪资月份"
,
"收款银行"
,
"账户尾号"
,
"币种"
,
"发放金额"
,
"汇率"
,
"备注"
));
sheet2
.
setDataList
(
detailList
);
exportRequest
.
setSheets
(
Arrays
.
asList
(
sheet1
,
sheet2
));
exportRequest
.
setFileName
(
"电子薪资单_"
+
LocalDateTime
.
now
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyyMMddHHmmss"
)));
exportRequest
.
setUploadToOss
(
true
);
// 8. 调用 Feign 导出
Result
<
ExportResult
>
feignResult
=
apiExcelFeignClient
.
exportMultiSheet
(
exportRequest
);
if
(
feignResult
==
null
||
feignResult
.
getCode
()
!=
200
)
{
String
errMsg
=
feignResult
!=
null
?
feignResult
.
getMsg
()
:
"Feign调用失败"
;
throw
new
BusinessException
(
"导出失败: "
+
errMsg
);
}
// 9. 返回 URL
ApiSalaryExportResponse
response
=
new
ApiSalaryExportResponse
();
response
.
setUrl
(
feignResult
.
getData
().
getOssUrl
());
return
Result
.
success
(
response
);
}
/**
* 将 yyyyMM 格式转为 yyyy-MM(便于阅读)
*/
private
String
formatMonth
(
String
month
)
{
if
(
StringUtils
.
isBlank
(
month
)
||
month
.
length
()
!=
6
)
{
return
month
;
}
try
{
return
month
.
substring
(
0
,
4
)
+
"-"
+
month
.
substring
(
4
,
6
);
}
catch
(
Exception
e
)
{
return
month
;
}
}
private
BigDecimal
nullToZero
(
BigDecimal
value
)
{
return
value
!=
null
?
value
:
BigDecimal
.
ZERO
;
}
/**
* 状态码转中文描述
* @param status 状态值(如 "1")
* @return 中文描述
*/
private
String
getStatusDesc
(
String
status
)
{
if
(
status
==
null
)
{
return
""
;
}
// 根据数据库注释:1-待提交 2-待核对 3-已核对 4-退回 5-已推送 6-已取消
switch
(
status
)
{
case
"1"
:
return
"待提交"
;
case
"2"
:
return
"待核对"
;
case
"3"
:
return
"已核对"
;
case
"4"
:
return
"退回"
;
case
"5"
:
return
"已推送"
;
case
"6"
:
return
"已取消"
;
default
:
return
status
;
}
}
/**
* 查询薪资单转介人列表信息
* @return
*/
@Override
public
Result
<
List
<
ApiSalaryBrokerListResponse
>>
brokerList
(
String
name
)
{
// 构造查询条件:状态为“完成出账”(2) 且 未删除
QueryWrapper
<
FortuneAccount
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"status"
,
FortuneAccountStatusEnum
.
SENT
.
getItemValue
())
.
like
(
StringUtils
.
isNotBlank
(
name
),
"broker"
,
name
)
.
eq
(
"is_deleted"
,
0
);
// 查询所有符合条件的出账记录
List
<
FortuneAccount
>
accountList
=
fortuneAccountService
.
list
(
wrapper
);
if
(
CollectionUtils
.
isEmpty
(
accountList
))
{
return
Result
.
success
(
Collections
.
emptyList
());
}
// 按 brokerBizId 分组,收集月份(去重)
Map
<
String
,
Set
<
String
>>
brokerMonthMap
=
new
LinkedHashMap
<>();
Map
<
String
,
String
>
brokerNameMap
=
new
HashMap
<>();
Set
<
String
>
bizIdSet
=
new
HashSet
<>();
DateTimeFormatter
monthFormatter
=
DateTimeFormatter
.
ofPattern
(
"yyyyMM"
);
for
(
FortuneAccount
account
:
accountList
)
{
String
bizId
=
account
.
getBrokerBizId
();
String
brokerName
=
account
.
getBroker
();
Date
date
=
account
.
getFortuneAccountDate
();
if
(
StringUtils
.
isBlank
(
bizId
)
||
StringUtils
.
isBlank
(
brokerName
)
||
date
==
null
)
{
continue
;
// 跳过无效数据
}
// 转换为 yyyyMM 格式
LocalDate
localDate
=
date
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
();
String
month
=
localDate
.
format
(
monthFormatter
);
// 存储转介人名称(首次出现)
brokerNameMap
.
putIfAbsent
(
bizId
,
brokerName
);
bizIdSet
.
add
(
bizId
);
// 收集月份(自动去重)
brokerMonthMap
.
computeIfAbsent
(
bizId
,
k
->
new
LinkedHashSet
<>()).
add
(
month
);
}
//获取转介人详细详细列表
List
<
String
>
bizIdList
=
bizIdSet
.
stream
().
collect
(
Collectors
.
toList
());
Map
<
String
,
ApiUserSaleExpandDetailResponse
>
policyFollowMap
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
bizIdList
))
{
ApiUserSaleExpandListRequest
request
=
new
ApiUserSaleExpandListRequest
();
request
.
setClientUserBizIdList
(
bizIdList
);
Result
<
List
<
ApiUserSaleExpandDetailResponse
>>
result
=
apiUserSaleExpandFeignClient
.
list
(
request
);
if
(
CollectionUtils
.
isNotEmpty
(
result
.
getData
()))
{
policyFollowMap
=
result
.
getData
().
stream
()
.
collect
(
Collectors
.
toMap
(
ApiUserSaleExpandDetailResponse:
:
getClientUserBizId
,
Function
.
identity
()));
}
}
// 组装响应对象
List
<
ApiSalaryBrokerListResponse
>
resultList
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
Set
<
String
>>
entry
:
brokerMonthMap
.
entrySet
())
{
String
bizId
=
entry
.
getKey
();
Set
<
String
>
monthSet
=
entry
.
getValue
();
ApiSalaryBrokerListResponse
response
=
new
ApiSalaryBrokerListResponse
();
if
(
policyFollowMap
!=
null
)
{
ApiUserSaleExpandDetailResponse
detailResponse
=
policyFollowMap
.
get
(
bizId
);
if
(
detailResponse
!=
null
)
{
//内部编号
response
.
setInternalNumber
(
detailResponse
.
getInternalNumber
());
}
}
response
.
setBrokerBizId
(
bizId
);
response
.
setBroker
(
brokerNameMap
.
getOrDefault
(
bizId
,
""
));
// 月份列表按时间升序排序
List
<
String
>
sortedMonths
=
new
ArrayList
<>(
monthSet
);
Collections
.
sort
(
sortedMonths
);
response
.
setMonthList
(
sortedMonths
);
resultList
.
add
(
response
);
}
// 最终按转介人名称排序
resultList
.
sort
(
Comparator
.
comparing
(
ApiSalaryBrokerListResponse:
:
getBroker
,
Comparator
.
nullsLast
(
String:
:
compareTo
)));
return
Result
.
success
(
resultList
);
}
/**
* 批量校验同一转介人同一年月只能有一条薪资单记录
* @param apiSalaryBatchAddDTOList 批量新增DTO列表
*/
...
...
@@ -502,12 +937,12 @@ public class ApiSalaryServiceImpl implements ApiSalaryService {
//创建需要校验的key值
List
<
String
>
checkKeys
=
new
ArrayList
<>();
for
(
ApiSalaryBatchAddDTO
addDTO
:
apiSalaryBatchAddDTOList
)
{
//获取2条汇款明细的发放金额总和
BigDecimal
totalAmount
=
statisticsAmountByBatchAdd
(
addDTO
);
//校验totalAmount和实发金额是否相等
BigDecimal
paidAmount
=
ObjectUtils
.
defaultIfNull
(
addDTO
.
getPaidAmount
(),
BigDecimal
.
ZERO
);
if
(
paidAmount
.
compareTo
(
totalAmount
)
!=
0
){
//汇款明细合计总金额和实发总金额必须相等,记录key值
// 四舍五入保留两位小数后再比较
BigDecimal
paidScaled
=
paidAmount
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
totalScaled
=
totalAmount
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
if
(
paidScaled
.
compareTo
(
totalScaled
)
!=
0
)
{
String
key
=
addDTO
.
getBrokerBizId
()
+
"|"
+
addDTO
.
getMonth
();
checkKeys
.
add
(
key
);
}
...
...
@@ -633,12 +1068,14 @@ public class ApiSalaryServiceImpl implements ApiSalaryService {
* @param totalAmount
* @return
*/
public
void
checkAmount
(
BigDecimal
paidAmount
,
BigDecimal
totalAmount
)
{
public
void
checkAmount
(
BigDecimal
paidAmount
,
BigDecimal
totalAmount
)
{
paidAmount
=
ObjectUtils
.
defaultIfNull
(
paidAmount
,
BigDecimal
.
ZERO
);
totalAmount
=
ObjectUtils
.
defaultIfNull
(
totalAmount
,
BigDecimal
.
ZERO
);
if
(
paidAmount
.
compareTo
(
totalAmount
)
!=
0
)
{
//汇款明细合计总金额和实发总金额必须相等
throw
new
BusinessException
(
"汇款明细合计总金额和实发总金额必须相等"
);
// 统一保留两位小数后比较
BigDecimal
paidScaled
=
paidAmount
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
totalScaled
=
totalAmount
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
if
(
paidScaled
.
compareTo
(
totalScaled
)
!=
0
)
{
throw
new
BusinessException
(
"汇款明细合计总金额和实发总金额必须相等(精确到分)"
);
}
}
...
...
yd-csf-feign/src/main/java/com/yd/csf/feign/client/salary/ApiSalaryFeignClient.java
View file @
7295d046
...
...
@@ -3,13 +3,17 @@ package com.yd.csf.feign.client.salary;
import
com.yd.common.result.Result
;
import
com.yd.csf.feign.fallback.salary.ApiSalaryFeignFallbackFactory
;
import
com.yd.csf.feign.request.salary.*
;
import
com.yd.csf.feign.response.salary.ApiSalaryBrokerListResponse
;
import
com.yd.csf.feign.response.salary.ApiSalaryConditionListResponse
;
import
com.yd.csf.feign.response.salary.ApiSalaryDetailResponse
;
import
com.yd.csf.feign.response.salary.ApiSalaryExportResponse
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.constraints.NotBlank
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* 香港保险服务-薪资单信息Feign客户端
...
...
@@ -136,4 +140,27 @@ public interface ApiSalaryFeignClient {
*/
@PostMapping
(
"/calculate/totalAmount"
)
Result
<
BigDecimal
>
calculateTotalAmount
(
@Validated
@RequestBody
ApiSalaryCalculateTotalAmountRequest
request
);
/**
* 查询薪资单转介人列表信息
* @return
*/
@GetMapping
(
"/broker/list"
)
Result
<
List
<
ApiSalaryBrokerListResponse
>>
brokerList
(
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
);
/**
* 电子薪资单-导出
* @param request
* @return
*/
@PostMapping
(
"/salary/export"
)
Result
<
ApiSalaryExportResponse
>
export
(
@Validated
@RequestBody
ApiSalaryExportRequest
request
);
/**
* 条件查询-电子薪资单列表信息
* @param request
* @return
*/
@PostMapping
(
"/condition/list"
)
Result
<
ApiSalaryConditionListResponse
>
conditionList
(
@Validated
@RequestBody
ApiSalaryConditionListRequest
request
);
}
yd-csf-feign/src/main/java/com/yd/csf/feign/dto/salary/ApiSalaryBatchAddDTO.java
View file @
7295d046
...
...
@@ -49,11 +49,16 @@ public class ApiSalaryBatchAddDTO {
//========以下是薪资汇款明细字段,两个汇款明细对象
/**
* 收款银行1
* 收款银行1
ID
*/
private
String
bank1
;
/**
* 收款银行1名称
*/
private
String
bank1Name
;
/**
* 账户尾号1
*/
private
String
accountEndNo1
;
...
...
@@ -79,11 +84,16 @@ public class ApiSalaryBatchAddDTO {
private
String
remark1
;
/**
* 收款银行
1
* 收款银行
2ID
*/
private
String
bank2
;
/**
* 收款银行2名称
*/
private
String
bank2Name
;
/**
* 账户尾号1
*/
private
String
accountEndNo2
;
...
...
yd-csf-feign/src/main/java/com/yd/csf/feign/dto/salaryremittance/ApiSalaryRemittanceDTO.java
View file @
7295d046
...
...
@@ -13,11 +13,16 @@ public class ApiSalaryRemittanceDTO {
private
String
salaryRemittanceBizId
;
/**
* 收款银行
* 收款银行
ID
*/
private
String
bank
;
/**
* 收款银行名称
*/
private
String
bankName
;
/**
* 账户尾号
*/
private
String
accountEndNo
;
...
...
yd-csf-feign/src/main/java/com/yd/csf/feign/fallback/salary/ApiSalaryFeignFallbackFactory.java
View file @
7295d046
...
...
@@ -3,13 +3,17 @@ package com.yd.csf.feign.fallback.salary;
import
com.yd.common.result.Result
;
import
com.yd.csf.feign.client.salary.ApiSalaryFeignClient
;
import
com.yd.csf.feign.request.salary.*
;
import
com.yd.csf.feign.response.salary.ApiSalaryBrokerListResponse
;
import
com.yd.csf.feign.response.salary.ApiSalaryConditionListResponse
;
import
com.yd.csf.feign.response.salary.ApiSalaryDetailResponse
;
import
com.yd.csf.feign.response.salary.ApiSalaryExportResponse
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.cloud.openfeign.FallbackFactory
;
import
org.springframework.stereotype.Component
;
import
javax.validation.constraints.NotBlank
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* 香港保险服务-薪资单信息Feign降级处理
...
...
@@ -94,6 +98,21 @@ public class ApiSalaryFeignFallbackFactory implements FallbackFactory<ApiSalaryF
public
Result
<
BigDecimal
>
calculateTotalAmount
(
ApiSalaryCalculateTotalAmountRequest
request
)
{
return
null
;
}
@Override
public
Result
<
List
<
ApiSalaryBrokerListResponse
>>
brokerList
(
String
name
)
{
return
null
;
}
@Override
public
Result
<
ApiSalaryExportResponse
>
export
(
ApiSalaryExportRequest
request
)
{
return
null
;
}
@Override
public
Result
<
ApiSalaryConditionListResponse
>
conditionList
(
ApiSalaryConditionListRequest
request
)
{
return
null
;
}
};
}
}
yd-csf-feign/src/main/java/com/yd/csf/feign/request/salary/ApiSalaryAddRequest.java
View file @
7295d046
...
...
@@ -43,6 +43,11 @@ public class ApiSalaryAddRequest {
private
BigDecimal
otherAmount
;
/**
* 通用备注
*/
private
String
remark
;
/**
* 其他调整的备注
*/
private
String
otherRemark
;
...
...
yd-csf-feign/src/main/java/com/yd/csf/feign/request/salary/ApiSalaryConditionListRequest.java
0 → 100644
View file @
7295d046
package
com
.
yd
.
csf
.
feign
.
request
.
salary
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
@Data
public
class
ApiSalaryConditionListRequest
{
/**
* 手机号(用于和CSF系统人员信息匹配)
*/
@NotBlank
(
message
=
"手机号不能为空"
)
private
String
mobile
;
/**
* 薪资年份(格式:yyyy)
*/
@NotBlank
(
message
=
"薪资年份不能为空"
)
private
String
year
;
}
yd-csf-feign/src/main/java/com/yd/csf/feign/request/salary/ApiSalaryEditRequest.java
View file @
7295d046
...
...
@@ -53,6 +53,11 @@ public class ApiSalaryEditRequest {
private
String
otherRemark
;
/**
* 通用备注
*/
private
String
remark
;
/**
* 实发总金额(单位:HKD)
*/
private
BigDecimal
paidAmount
;
...
...
yd-csf-feign/src/main/java/com/yd/csf/feign/request/salary/ApiSalaryExportRequest.java
0 → 100644
View file @
7295d046
package
com
.
yd
.
csf
.
feign
.
request
.
salary
;
import
lombok.Data
;
@Data
public
class
ApiSalaryExportRequest
{
/**
* 转介人名称
*/
private
String
brokerName
;
/**
* 薪资月份(同出账月,如:202605)
*/
private
String
month
;
/**
* 薪资单状态:1-待提交 2-待核对 3-已核对 4-退回 5-已推送 6-已取消
*/
private
String
status
;
}
yd-csf-feign/src/main/java/com/yd/csf/feign/request/salary/ApiSalaryPageRequest.java
View file @
7295d046
...
...
@@ -15,4 +15,14 @@ public class ApiSalaryPageRequest extends PageDto {
* 薪资月份(同出账月,如:202605)
*/
private
String
month
;
/**
* 薪资单状态:1-待提交 2-待核对 3-已核对 4-退回 5-已推送 6-已取消
*/
private
String
status
;
/**
* 发放编号
*/
private
String
salaryNo
;
}
yd-csf-feign/src/main/java/com/yd/csf/feign/request/salary/ApiSalaryPushPageRequest.java
View file @
7295d046
...
...
@@ -20,4 +20,9 @@ public class ApiSalaryPushPageRequest extends PageDto {
* 薪资单状态:1-待提交 2-待核对 3-已核对 4-退回 5-已推送 6-已取消
*/
private
String
status
;
/**
* 发放编号
*/
private
String
salaryNo
;
}
yd-csf-feign/src/main/java/com/yd/csf/feign/response/salary/ApiSalaryBrokerListResponse.java
0 → 100644
View file @
7295d046
package
com
.
yd
.
csf
.
feign
.
response
.
salary
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
ApiSalaryBrokerListResponse
{
/**
* 转介人
*/
private
String
broker
;
/**
* 转介人业务id
*/
private
String
brokerBizId
;
/**
* 内部编号
*/
private
String
internalNumber
;
/**
* 月份列表(格式: 202606)
*/
private
List
<
String
>
monthList
;
}
yd-csf-feign/src/main/java/com/yd/csf/feign/response/salary/ApiSalaryConditionListResponse.java
0 → 100644
View file @
7295d046
package
com
.
yd
.
csf
.
feign
.
response
.
salary
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
ApiSalaryConditionListResponse
{
/**
* 列表数量
*/
private
Integer
count
;
/**
* 薪资列表信息
*/
private
List
<
ApiSalaryConditionResponse
>
conditionResponseList
;
}
yd-csf-feign/src/main/java/com/yd/csf/feign/response/salary/ApiSalaryConditionResponse.java
0 → 100644
View file @
7295d046
package
com
.
yd
.
csf
.
feign
.
response
.
salary
;
import
lombok.Data
;
import
java.math.BigDecimal
;
@Data
public
class
ApiSalaryConditionResponse
{
/**
* 薪资单表唯一业务ID
*/
private
String
salaryBizId
;
/**
* 薪资年月(同出账月,如:xxxx年MM月)
*/
private
String
yearMonth
;
/**
* 实发总金额(单位:HKD)
*/
private
BigDecimal
paidAmount
;
/**
* 状态名称
*/
private
String
statusName
;
}
yd-csf-feign/src/main/java/com/yd/csf/feign/response/salary/ApiSalaryDetailResponse.java
View file @
7295d046
...
...
@@ -53,11 +53,31 @@ public class ApiSalaryDetailResponse {
private
String
otherRemark
;
/**
* 通用备注
*/
private
String
remark
;
/**
* 实发总金额(单位:HKD)
*/
private
BigDecimal
paidAmount
;
/**
* 薪资单状态:1-待提交 2-待核对 3-已核对 4-退回 5-已推送 6-已取消
*/
private
String
status
;
/**
* 取消薪资备注
*/
private
String
cancelRemark
;
/**
* 转介人内部编号
*/
private
String
internalNumber
;
/**
* 薪资汇款明细封装的DTO
*/
private
ApiSalaryRemittanceFzDTO
apiSalaryRemittanceFzDTO
;
...
...
yd-csf-feign/src/main/java/com/yd/csf/feign/response/salary/ApiSalaryExportResponse.java
0 → 100644
View file @
7295d046
package
com
.
yd
.
csf
.
feign
.
response
.
salary
;
import
lombok.Data
;
@Data
public
class
ApiSalaryExportResponse
{
private
String
url
;
}
yd-csf-feign/src/main/java/com/yd/csf/feign/response/salary/ApiSalaryPageResponse.java
View file @
7295d046
package
com
.
yd
.
csf
.
feign
.
response
.
salary
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
...
...
@@ -18,6 +19,11 @@ public class ApiSalaryPageResponse {
private
String
salaryBizId
;
/**
* 转介人业务id
*/
private
String
brokerBizId
;
/**
* 转介人名称
*/
private
String
brokerName
;
...
...
@@ -60,5 +66,11 @@ public class ApiSalaryPageResponse {
/**
* 制作时间(创建时间)
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
LocalDateTime
createTime
;
/**
* 通用备注
*/
private
String
remark
;
}
yd-csf-feign/src/main/java/com/yd/csf/feign/response/salary/ApiSalaryPushPageResponse.java
View file @
7295d046
package
com
.
yd
.
csf
.
feign
.
response
.
salary
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
java.math.BigDecimal
;
...
...
@@ -9,6 +10,16 @@ import java.time.LocalDateTime;
public
class
ApiSalaryPushPageResponse
{
/**
* 薪资单表唯一业务ID
*/
private
String
salaryBizId
;
/**
* 发放编号
*/
private
String
salaryNo
;
/**
* 转介人名称
*/
private
String
brokerName
;
...
...
@@ -51,5 +62,11 @@ public class ApiSalaryPushPageResponse {
/**
* 制作时间(创建时间)
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
LocalDateTime
createTime
;
/**
* 通用备注
*/
private
String
remark
;
}
yd-csf-service/src/main/java/com/yd/csf/service/dto/FortuneQueryRequest.java
View file @
7295d046
...
...
@@ -72,6 +72,18 @@ public class FortuneQueryRequest extends PageDto implements Serializable {
private
String
payoutDateEnd
;
/**
* 出账年月(实)开始
*/
@Schema
(
description
=
"出账年月(实)开始 格式:yyyy-MM"
)
private
String
actualPayoutDateStart
;
/**
* 出账年月(实)结束
*/
@Schema
(
description
=
"出账年月(实)结束 格式:yyyy-MM"
)
private
String
actualPayoutDateEnd
;
/**
* 检核年月
*/
@Schema
(
description
=
"检核年月,格式:yyyy-MM"
)
...
...
yd-csf-service/src/main/java/com/yd/csf/service/enums/CommissionRuleConfigEnum.java
0 → 100644
View file @
7295d046
package
com
.
yd
.
csf
.
service
.
enums
;
/**
* 基本法类型枚举
*/
public
enum
CommissionRuleConfigEnum
{
BZ_JBF
(
"commission_rule_config_dJea6a7rM8j38zK5"
,
"RULE6623256596"
,
"标准基本法"
),
;
/**
* 基本法配置表唯一业务ID
*/
private
String
ruleBizId
;
/**
* 基本法编码
*/
private
String
ruleCode
;
/**
* 基本法名称
*/
private
String
ruleName
;
//构造函数
CommissionRuleConfigEnum
(
String
ruleBizId
,
String
ruleCode
,
String
ruleName
)
{
this
.
ruleBizId
=
ruleBizId
;
this
.
ruleCode
=
ruleCode
;
this
.
ruleName
=
ruleName
;
}
public
String
getRuleBizId
()
{
return
ruleBizId
;
}
public
String
getRuleCode
()
{
return
ruleCode
;
}
public
String
getRuleName
()
{
return
ruleName
;
}
}
yd-csf-service/src/main/java/com/yd/csf/service/enums/RuleItemConfigEnum.java
0 → 100644
View file @
7295d046
package
com
.
yd
.
csf
.
service
.
enums
;
/**
* 基本法项目枚举
*/
public
enum
RuleItemConfigEnum
{
XS_YJ
(
"rule_item_config_FePX0vpJQ9bU1vEo"
,
"commission_rule_config_dJea6a7rM8j38zK5"
,
"ITEM4736190590"
,
"销售佣金"
),
XQ_XS_YJ
(
"rule_item_config_Gxw21FGdwg29RFz"
,
"commission_rule_config_dJea6a7rM8j38zK5"
,
"ITEM4570368732"
,
"续期销售佣金"
),
;
/**
* 基本法项目配置表唯一业务ID
*/
private
String
ruleItemBizId
;
/**
* 基本法配置表唯一业务ID
*/
private
String
ruleBizId
;
/**
* 基本法项目编码
*/
private
String
itemCode
;
/**
* 基本法项目名称
*/
private
String
itemName
;
//构造函数
RuleItemConfigEnum
(
String
ruleItemBizId
,
String
ruleBizId
,
String
itemCode
,
String
itemName
)
{
this
.
ruleItemBizId
=
ruleItemBizId
;
this
.
ruleBizId
=
ruleBizId
;
this
.
itemCode
=
itemCode
;
this
.
itemName
=
itemName
;
}
public
String
getRuleItemBizId
()
{
return
ruleItemBizId
;
}
public
String
getRuleBizId
()
{
return
ruleBizId
;
}
public
String
getItemCode
()
{
return
itemCode
;
}
public
String
getItemName
()
{
return
itemName
;
}
}
yd-csf-service/src/main/java/com/yd/csf/service/model/Salary.java
View file @
7295d046
package
com
.
yd
.
csf
.
service
.
model
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.*
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
...
...
@@ -148,7 +146,7 @@ public class Salary implements Serializable {
/**
* 创建人名称
*/
@TableField
(
"creator_name"
)
@TableField
(
value
=
"creator_name"
,
fill
=
FieldFill
.
INSERT
)
private
String
creatorName
;
/**
...
...
yd-csf-service/src/main/java/com/yd/csf/service/model/SalaryRemittance.java
View file @
7295d046
...
...
@@ -44,12 +44,18 @@ public class SalaryRemittance implements Serializable {
private
String
salaryBizId
;
/**
* 收款银行
* 收款银行
ID
*/
@TableField
(
"bank"
)
private
String
bank
;
/**
* 收款银行名称
*/
@TableField
(
"bank_name"
)
private
String
bankName
;
/**
* 账户尾号
*/
@TableField
(
"account_end_no"
)
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/FortuneAccountService.java
View file @
7295d046
...
...
@@ -45,4 +45,5 @@ public interface FortuneAccountService extends IService<FortuneAccount> {
List
<
FortuneAccount
>
queryList
(
String
brokerBizId
,
String
month
,
String
status
);
List
<
FortuneAccount
>
queryList
(
List
<
Map
.
Entry
<
String
,
String
>>
pairs
,
String
status
);
}
yd-csf-service/src/main/java/com/yd/csf/service/service/ISalaryRemittanceService.java
View file @
7295d046
...
...
@@ -4,6 +4,7 @@ import com.yd.csf.service.model.SalaryRemittance;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -20,4 +21,11 @@ public interface ISalaryRemittanceService extends IService<SalaryRemittance> {
List
<
SalaryRemittance
>
queryList
(
String
salaryBizId
);
SalaryRemittance
queryOne
(
String
salaryRemittanceBizId
);
/**
* 批量根据薪资单业务ID列表查询汇款明细,并按 salaryBizId 分组返回 Map
* @param salaryBizIds 薪资单业务ID列表
* @return Map<salaryBizId, List<SalaryRemittance>>
*/
Map
<
String
,
List
<
SalaryRemittance
>>
queryListBySalaryBizIds
(
List
<
String
>
salaryBizIds
);
}
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
View file @
7295d046
...
...
@@ -105,6 +105,21 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
// 2. 获取该月的最后一天
payoutDateEnd
=
yearMonth
.
atEndOfMonth
();
}
// 出账年月(实)开始
LocalDate
actualPayoutDateStart
=
null
;
if
(
StringUtils
.
isNotBlank
(
fortuneQueryRequest
.
getActualPayoutDateStart
()))
{
actualPayoutDateStart
=
LocalDate
.
parse
(
fortuneQueryRequest
.
getActualPayoutDateStart
()
+
"-01"
);
}
// 出账年月(实)结束 月最后一天
LocalDate
actualPayoutDateEnd
=
null
;
if
(
StringUtils
.
isNotBlank
(
fortuneQueryRequest
.
getActualPayoutDateEnd
()))
{
// 1. 先解析为 YearMonth (专门处理年月)
YearMonth
yearMonth
=
YearMonth
.
parse
(
fortuneQueryRequest
.
getActualPayoutDateEnd
(),
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
));
// 2. 获取该月的最后一天
actualPayoutDateEnd
=
yearMonth
.
atEndOfMonth
();
}
String
brokerName
=
fortuneQueryRequest
.
getBrokerName
();
// 入账状态
...
...
@@ -116,8 +131,12 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
queryWrapper
.
in
(
CollUtil
.
isNotEmpty
(
insuranceCompanyBizIdList
),
"insurance_company_biz_id"
,
insuranceCompanyBizIdList
);
queryWrapper
.
in
(
CollUtil
.
isNotEmpty
(
productLaunchBizIdList
),
"product_launch_biz_id"
,
productLaunchBizIdList
);
queryWrapper
.
gt
(
ObjectUtils
.
isNotEmpty
(
payoutDateStart
),
"payout_date"
,
payoutDateStart
);
queryWrapper
.
lt
(
ObjectUtils
.
isNotEmpty
(
payoutDateEnd
),
"payout_date"
,
payoutDateEnd
);
queryWrapper
.
ge
(
ObjectUtils
.
isNotEmpty
(
payoutDateStart
),
"payout_date"
,
payoutDateStart
);
queryWrapper
.
le
(
ObjectUtils
.
isNotEmpty
(
payoutDateEnd
),
"payout_date"
,
payoutDateEnd
);
queryWrapper
.
ge
(
ObjectUtils
.
isNotEmpty
(
actualPayoutDateStart
),
"actual_payout_date"
,
actualPayoutDateStart
);
queryWrapper
.
le
(
ObjectUtils
.
isNotEmpty
(
actualPayoutDateEnd
),
"actual_payout_date"
,
actualPayoutDateEnd
);
queryWrapper
.
like
(
StringUtils
.
isNotBlank
(
brokerName
),
"broker"
,
"%"
+
brokerName
+
"%"
);
// 入账状态, 关联查询 commission_expected 表
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/SalaryRemittanceServiceImpl.java
View file @
7295d046
...
...
@@ -5,9 +5,12 @@ import com.yd.csf.service.model.SalaryRemittance;
import
com.yd.csf.service.dao.SalaryRemittanceMapper
;
import
com.yd.csf.service.service.ISalaryRemittanceService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* <p>
...
...
@@ -38,4 +41,20 @@ public class SalaryRemittanceServiceImpl extends ServiceImpl<SalaryRemittanceMap
.
eq
(
SalaryRemittance:
:
getSalaryRemittanceBizId
,
salaryRemittanceBizId
)
.
last
(
" limit 1 "
));
}
@Override
public
Map
<
String
,
List
<
SalaryRemittance
>>
queryListBySalaryBizIds
(
List
<
String
>
salaryBizIds
)
{
if
(
CollectionUtils
.
isEmpty
(
salaryBizIds
))
{
return
java
.
util
.
Collections
.
emptyMap
();
}
// 批量查询
List
<
SalaryRemittance
>
list
=
this
.
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
SalaryRemittance
>()
.
in
(
SalaryRemittance:
:
getSalaryBizId
,
salaryBizIds
)
.
orderByAsc
(
SalaryRemittance:
:
getCreateTime
)
// 按需排序
);
// 按 salaryBizId 分组
return
list
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
SalaryRemittance:
:
getSalaryBizId
));
}
}
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/SalaryServiceImpl.java
View file @
7295d046
...
...
@@ -3,6 +3,7 @@ package com.yd.csf.service.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yd.csf.feign.enums.SalaryStatusEnum
;
import
com.yd.csf.feign.request.salary.ApiSalaryPageRequest
;
import
com.yd.csf.feign.request.salary.ApiSalaryPushPageRequest
;
import
com.yd.csf.feign.response.salary.ApiSalaryPageResponse
;
...
...
@@ -42,6 +43,7 @@ public class SalaryServiceImpl extends ServiceImpl<SalaryMapper, Salary> impleme
return
this
.
baseMapper
.
selectOne
(
new
LambdaQueryWrapper
<
Salary
>()
.
eq
(
Salary:
:
getBrokerBizId
,
brokerBizId
)
.
eq
(
Salary:
:
getMonth
,
month
)
.
ne
(
Salary:
:
getStatus
,
SalaryStatusEnum
.
YQX
.
getItemValue
())
.
ne
(
isExcludeMy
,
Salary:
:
getSalaryBizId
,
salaryBizId
)
.
last
(
" limit 1 "
)
);
...
...
yd-csf-service/src/main/resources/mappers/SalaryMapper.xml
View file @
7295d046
...
...
@@ -6,6 +6,7 @@
SELECT
s.salary_no,
s.salary_biz_id,
s.broker_biz_id,
s.broker_name,
s.internal_number,
s.paid_amount,
...
...
@@ -13,9 +14,11 @@
s.status,
s.creator_name,
s.create_time,
s.remark,
GROUP_CONCAT(DISTINCT sr.currency ORDER BY sr.currency SEPARATOR ';') AS currencyList
FROM salary s
LEFT JOIN salary_remittance sr ON s.salary_biz_id = sr.salary_biz_id AND sr.is_deleted = 0
<where>
<if
test=
"request.brokerName != null and request.brokerName != ''"
>
AND s.broker_name LIKE CONCAT('%', #{request.brokerName}, '%')
...
...
@@ -23,6 +26,12 @@
<if
test=
"request.month != null and request.month != ''"
>
AND s.month = #{request.month}
</if>
<if
test=
"request.status != null and request.status != ''"
>
AND s.status = #{request.status}
</if>
<if
test=
"request.salaryNo != null and request.salaryNo != ''"
>
AND s.salary_no LIKE CONCAT('%', #{request.salaryNo}, '%')
</if>
AND s.is_deleted = 0
</where>
GROUP BY s.salary_biz_id
...
...
@@ -31,6 +40,7 @@
<select
id=
"pushPage"
resultType=
"com.yd.csf.feign.response.salary.ApiSalaryPushPageResponse"
>
select
s.salary_biz_id,
s.broker_name,
s.month,
s.paid_amount,
...
...
@@ -39,7 +49,9 @@
s.other_remark,
s.status,
s.creator_name,
s.create_time
s.create_time,
s.salary_no,
s.remark
from salary s
<where>
<if
test=
"request.brokerName != null and request.brokerName != ''"
>
...
...
@@ -51,6 +63,9 @@
<if
test=
"request.status != null and request.status != ''"
>
AND s.status = #{request.status}
</if>
<if
test=
"request.salaryNo != null and request.salaryNo != ''"
>
AND s.salary_no LIKE CONCAT('%', #{request.salaryNo}, '%')
</if>
AND s.is_deleted = 0
</where>
</select>
...
...
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