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
eda86978
Commit
eda86978
authored
Aug 08, 2022
by
查济
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-zhaji' into 'develop'
Feature zhaji See merge request fangxinjiang/yifu!144
parents
97d94711
b01f0170
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
42 deletions
+93
-42
InsurancesConstants.java
...lus/v1/yifu/insurances/constants/InsurancesConstants.java
+11
-1
InsuranceListParam.java
.../cloud/plus/v1/yifu/insurances/vo/InsuranceListParam.java
+6
-0
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+73
-41
TInsuranceDetailMapper.xml
...-biz/src/main/resources/mapper/TInsuranceDetailMapper.xml
+3
-0
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/constants/InsurancesConstants.java
View file @
eda86978
...
...
@@ -564,7 +564,12 @@ public class InsurancesConstants {
/**
* 替换项目不存在
*/
public
static
final
String
DEPT_NO_CHANGE_IS_NOT_EXIST
=
"替换项目不存在"
;
public
static
final
String
DEPT_NO_CHANGE_NEW_IS_NOT_EXIST
=
"替换项目不存在"
;
/**
* 被替换的项目不存在
*/
public
static
final
String
DEPT_NO_CHANGE_OLD_IS_NOT_EXIST
=
"被替换的项目不存在"
;
/**
...
...
@@ -775,5 +780,10 @@ public class InsurancesConstants {
*/
public
static
final
String
NOT_CREATE_USER_DELETE_ERROR
=
"非创建人无法删除保单信息"
;
/**
* 无更新当前保单信息的权限
*/
public
static
final
String
NO_UPDATE_DETAIL_JURISDICTION
=
"无更新当前保单信息的权限"
;
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceListParam.java
View file @
eda86978
...
...
@@ -69,4 +69,10 @@ public class InsuranceListParam implements Serializable {
*/
@Schema
(
description
=
"办理地分流sql"
)
private
String
regionSql
;
/**
* 保单办理人
*/
@Schema
(
description
=
"保单办理人"
)
private
String
updateBy
;
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
eda86978
...
...
@@ -235,6 +235,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return
iPage
;
}
param
.
setRegionSql
(
regionSQL
);
Integer
buyHandleStatus
=
param
.
getBuyHandleStatus
();
if
(
buyHandleStatus
==
CommonConstants
.
TWO_INT
||
buyHandleStatus
==
CommonConstants
.
THREE_INT
){
param
.
setUpdateBy
(
user
.
getId
());
}
IPage
<
InsuranceListVO
>
insuranceList
=
baseMapper
.
getInsuranceHandleListPage
(
page
,
param
);
//根据项目编码获取项目名称
setProjectNameByDeptNo
(
insuranceList
.
getRecords
());
...
...
@@ -1144,7 +1148,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
return
R
.
failed
(
CommonConstants
.
PLEASE_LOG_IN
);
}
Map
<
String
,
List
<
InsuranceRegisterParam
>>
map
=
registeredPolicyPremiumCheck
(
paramList
);
Map
<
String
,
List
<
InsuranceRegisterParam
>>
map
=
registeredPolicyPremiumCheck
(
paramList
,
user
);
//返回给前端的结果
List
<
InsuranceRegisterParam
>
listResult
=
map
.
get
(
"listResult"
);
//保存到数据库中的结果
...
...
@@ -1356,12 +1360,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
//校验当前项目是否在权限范围内
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
param
.
getDeptNo
()))){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_NOT_IN_USER_DEPT_LIST
);
listResult
.
add
(
param
);
continue
;
}
//表内数据重复 员工姓名、员工身份证号码、保险公司、险种、起止时间(有交叉)
for
(
int
j
=
0
;
j
<
distinctList
.
size
();
j
++)
{
InsuranceAddParam
repeat
=
distinctList
.
get
(
j
);
...
...
@@ -1418,7 +1417,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
//校验当前项目是否在权限范围内
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
param
.
getDeptNo
()))){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_NOT_IN_USER_DEPT_LIST
);
listResult
.
add
(
param
);
continue
;
}
//省市区域校验是否正确并设置对应id
String
redisProvinceName
=
getRedisAreaValue
(
param
.
getInsuranceProvinceName
());
if
(
Common
.
isEmpty
(
redisProvinceName
)){
...
...
@@ -1716,12 +1720,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
//校验当前项目是否在权限范围内
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
param
.
getDeptNo
()))){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_NOT_IN_USER_DEPT_LIST
);
listResult
.
add
(
param
);
continue
;
}
//表内数据重复 员工姓名、员工身份证号码、保险公司、险种
for
(
int
j
=
0
;
j
<
distinctList
.
size
();
j
++)
{
InsuranceBatchParam
repeat
=
distinctList
.
get
(
j
);
...
...
@@ -1777,7 +1775,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
//校验当前项目是否在权限范围内
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
param
.
getDeptNo
()))){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_NOT_IN_USER_DEPT_LIST
);
listResult
.
add
(
param
);
continue
;
}
//省市区域校验是否正确并设置对应id
String
redisProvinceName
=
getRedisAreaValue
(
param
.
getInsuranceProvinceName
());
if
(
Common
.
isEmpty
(
redisProvinceName
)){
...
...
@@ -2078,18 +2081,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
//校验当前项目是否在权限范围内
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
param
.
getDeptNo
()))){
param
.
setErrorMessage
(
InsurancesConstants
.
OLD_DEPT_NO_NOT_IN_DEPT_LIST
);
listResult
.
add
(
param
);
continue
;
}
//校验当前项目是否在权限范围内
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
param
.
getReplaceDeptNo
()))){
param
.
setErrorMessage
(
InsurancesConstants
.
NEW_DEPT_NO_NOT_IN_DEPT_LIST
);
listResult
.
add
(
param
);
continue
;
}
//表内数据重复 员工姓名、员工身份证号码、保险公司、险种、起止时间(有交叉)
for
(
int
j
=
0
;
j
<
distinctList
.
size
();
j
++)
{
InsuranceReplaceParam
repeat
=
distinctList
.
get
(
j
);
...
...
@@ -2124,7 +2115,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
//根据项目编码查询项目是否存在
R
<
SetInfoVo
>
setInfoByCodes
=
archivesDaprUtil
.
getSetInfoByCodes
(
Arrays
.
asList
(
param
.
getReplaceDeptNo
()));
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
==
CommonConstants
.
SUCCESS
)
{
...
...
@@ -2152,7 +2142,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
//校验当前项目是否在权限范围内
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
param
.
getDeptNo
()))){
param
.
setErrorMessage
(
InsurancesConstants
.
OLD_DEPT_NO_NOT_IN_DEPT_LIST
);
listResult
.
add
(
param
);
continue
;
}
//校验当前项目是否在权限范围内
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
param
.
getReplaceDeptNo
()))){
param
.
setErrorMessage
(
InsurancesConstants
.
NEW_DEPT_NO_NOT_IN_DEPT_LIST
);
listResult
.
add
(
param
);
continue
;
}
//原数据查重校验:姓名 + 身份证号 + 项目编码 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间
TInsuranceDetail
detail
=
this
.
baseMapper
.
selectOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
.
eq
(
TInsuranceDetail:
:
getEmpName
,
param
.
getEmpName
())
...
...
@@ -2307,10 +2308,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param paramList
* @return {@link Map<String, List<InsuranceRegisterParam>>}
*/
private
Map
<
String
,
List
<
InsuranceRegisterParam
>>
registeredPolicyPremiumCheck
(
List
<
InsuranceRegisterParam
>
paramList
){
private
Map
<
String
,
List
<
InsuranceRegisterParam
>>
registeredPolicyPremiumCheck
(
List
<
InsuranceRegisterParam
>
paramList
,
YifuUser
user
){
Map
<
String
,
List
<
InsuranceRegisterParam
>>
map
=
new
HashMap
<>();
List
<
InsuranceRegisterParam
>
listResult
=
new
ArrayList
<>();
List
<
InsuranceRegisterParam
>
listSuccess
=
new
ArrayList
<>();
String
regionSQL
=
getRegionSQL
(
user
);
for
(
InsuranceRegisterParam
param
:
paramList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
()))
{
// 必填校验
if
(
StringUtils
.
isBlank
(
param
.
getEmpName
())){
...
...
@@ -2392,6 +2394,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
else
{
//查数据是否存在:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间
TInsuranceDetail
detailByRegionSQL
=
this
.
baseMapper
.
selectOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
.
eq
(
TInsuranceDetail:
:
getEmpName
,
param
.
getEmpName
())
.
eq
(
TInsuranceDetail:
:
getEmpIdcardNo
,
param
.
getEmpIdcardNo
())
.
eq
(
TInsuranceDetail:
:
getInsuranceCompanyName
,
param
.
getInsuranceCompanyName
())
.
eq
(
TInsuranceDetail:
:
getInsuranceTypeName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()))
.
eq
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
()))
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
regionSQL
+
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
detailByRegionSQL
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
NO_UPDATE_DETAIL_JURISDICTION
);
listResult
.
add
(
param
);
continue
;
}
// 如果保费不存在,保单号、保费必填
if
(
detail
.
getActualPremium
()
==
null
){
if
(
StringUtils
.
isBlank
(
param
.
getPolicyNo
())){
...
...
@@ -2907,6 +2925,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceDetail
.
setUpdateBy
(
user
.
getId
());
tInsuranceDetail
.
setReduceHandleStatus
(
refundType
);
if
(
CommonConstants
.
FOUR_INT
==
refundType
){
tInsuranceDetail
.
setIsOverdue
(
null
);
tInsuranceDetail
.
setBuyHandleStatus
(
CommonConstants
.
FIVE_INT
);
}
else
{
tInsuranceDetail
.
setBuyHandleStatus
(
CommonConstants
.
THREE_INT
);
...
...
@@ -3948,11 +3967,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList
.
add
(
param
);
continue
;
}
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
newDeptNo
))){
param
.
setErrorMessage
(
InsurancesConstants
.
NEW_DEPT_NO_NOT_IN_DEPT_LIST
);
errorList
.
add
(
param
);
continue
;
}
//员工姓名
String
empName
=
param
.
getEmpName
();
if
(
StringUtils
.
isBlank
(
empName
)){
...
...
@@ -3974,11 +3988,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList
.
add
(
param
);
continue
;
}
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
oldDeptNo
))){
param
.
setErrorMessage
(
InsurancesConstants
.
OLD_DEPT_NO_NOT_IN_DEPT_LIST
);
errorList
.
add
(
param
);
continue
;
}
//保险公司名称
String
insuranceCompanyName
=
param
.
getInsuranceCompanyName
();
if
(
StringUtils
.
isBlank
(
insuranceCompanyName
)){
...
...
@@ -4037,13 +4047,23 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
==
CommonConstants
.
SUCCESS
)
{
Map
<
String
,
ProjectSetInfoVo
>
data
=
setInfoByCodes
.
getData
().
getProjectSetInfoVoMap
();
if
(
MapUtils
.
isEmpty
(
data
)){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_CHANGE_IS_NOT_EXIST
);
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_CHANGE_
NEW_
IS_NOT_EXIST
);
errorList
.
add
(
param
);
continue
;
}
else
{
//结算类型,根据项目编码获取,并冗余到明细记录中
ProjectSetInfoVo
jsonObject
=
data
.
get
(
newDeptNo
);
if
(
Common
.
isEmpty
(
jsonObject
)){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_CHANGE_NEW_IS_NOT_EXIST
);
errorList
.
add
(
param
);
continue
;
}
ProjectSetInfoVo
oldJsonObject
=
data
.
get
(
oldDeptNo
);
if
(
Common
.
isEmpty
(
oldJsonObject
)){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_CHANGE_OLD_IS_NOT_EXIST
);
errorList
.
add
(
param
);
continue
;
}
param
.
setOldDeptName
(
oldJsonObject
.
getDepartName
());
param
.
setNewDeptName
(
jsonObject
.
getDepartName
());
String
settleType
=
jsonObject
.
getInsuranceSettleType
();
...
...
@@ -4056,6 +4076,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
//旧项目ID不在当前权限范围内
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
oldDeptNo
))){
param
.
setErrorMessage
(
InsurancesConstants
.
OLD_DEPT_NO_NOT_IN_DEPT_LIST
);
errorList
.
add
(
param
);
continue
;
}
//新项目ID不在当前权限范围内
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
newDeptNo
))){
param
.
setErrorMessage
(
InsurancesConstants
.
NEW_DEPT_NO_NOT_IN_DEPT_LIST
);
errorList
.
add
(
param
);
continue
;
}
//必填格式校通过后查询对应的保单信息
LambdaQueryWrapper
<
TInsuranceDetail
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
TInsuranceDetail
::
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
...
...
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/TInsuranceDetailMapper.xml
View file @
eda86978
...
...
@@ -171,6 +171,9 @@
<if
test=
"param.regionSql != null and param.regionSql.trim() != ''"
>
and ${param.regionSql}
</if>
<if
test=
"param.updateBy != null and param.updateBy.trim() != ''"
>
and detail.UPDATE_BY = #{param.updateBy}
</if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</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