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
353a4e12
Commit
353a4e12
authored
Jul 25, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-licancan' into 'develop'
区域id校验 See merge request fangxinjiang/yifu!29
parents
c8f291dd
4bffd160
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
19 deletions
+111
-19
ProjectSetInfoVo.java
...yifu/cloud/plus/v1/yifu/archives/vo/ProjectSetInfoVo.java
+2
-1
InsurancesConstants.java
...lus/v1/yifu/insurances/constants/InsurancesConstants.java
+16
-0
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+93
-18
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/ProjectSetInfoVo.java
View file @
353a4e12
...
...
@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
...
...
@@ -57,7 +58,7 @@ public class ProjectSetInfoVo implements Serializable {
* 商险结算类型:0预估 1 实缴
*/
@Schema
(
description
=
"商险结算类型"
)
private
String
insuranceSettleType
;
private
String
insuranceSettleType
=
CommonConstants
.
ONE_STRING
;
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/constants/InsurancesConstants.java
View file @
353a4e12
...
...
@@ -144,18 +144,34 @@ public class InsurancesConstants {
* 商险购买地省名称不能为空
*/
public
static
final
String
INSURANCE_PROVINCE_NAME_NOT_EMPTY
=
"商险购买地省名称不能为空"
;
/**
* 商险购买地省名称不存在
*/
public
static
final
String
INSURANCE_PROVINCE_NAME_NOT_EXIST
=
"商险购买地省名称不存在"
;
/**
* 商险购买地市名称
*/
public
static
final
String
INSURANCE_CITY_NAME_NOT_EMPTY
=
"商险购买地市名称不能为空"
;
/**
* 商险购买地市名称不存在
*/
public
static
final
String
INSURANCE_CITY_NAME_NOT_EXIST
=
"商险购买地市名称不存在"
;
/**
* 商险办理省名称不能为空
*/
public
static
final
String
INSURANCE_HANDLE_PROVINCE_NAME_NOT_EMPTY
=
"商险办理省名称不能为空"
;
/**
* 商险办理省名称不存在
*/
public
static
final
String
INSURANCE_HANDLE_PROVINCE_NAME_NOT_EXIST
=
"商险办理省名称不存在"
;
/**
* 商险办理城市名称不能为空
*/
public
static
final
String
INSURANCE_HANDLE_CITY_NAME_NOT_EMPTY
=
"商险办理城市名称不能为空"
;
/**
* 商险办理城市名称不存在
*/
public
static
final
String
INSURANCE_HANDLE_CITY_NAME_NOT_EXIST
=
"商险办理城市名称不存在"
;
/**
* 结算月不能为空
*/
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
353a4e12
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -10,9 +9,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.google.common.collect.Sets
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ProjectSetInfoVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.SetInfoVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil
;
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
;
...
...
@@ -32,7 +33,6 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.validation.constraints.NotBlank
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.*
;
...
...
@@ -85,7 +85,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//根据项目编码获取项目名称
List
<
String
>
collect
=
insuranceList
.
getRecords
().
stream
().
map
(
e
->
e
.
getDeptNo
()).
distinct
().
collect
(
Collectors
.
toList
());
R
<
SetInfoVo
>
setInfoByCodes
=
archivesDaprUtil
.
getSetInfoByCodes
(
collect
);
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
!
=
CommonConstants
.
SUCCESS
&&
Common
.
isNotNull
(
setInfoByCodes
.
getData
()))
{
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
=
=
CommonConstants
.
SUCCESS
&&
Common
.
isNotNull
(
setInfoByCodes
.
getData
()))
{
Map
<
String
,
ProjectSetInfoVo
>
data
=
setInfoByCodes
.
getData
().
getProjectSetInfoVoMap
();
for
(
InsuranceListVO
record
:
insuranceList
.
getRecords
())
{
ProjectSetInfoVo
jsonObject
=
data
.
get
(
record
.
getDeptNo
());
...
...
@@ -113,7 +113,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//根据项目编码获取项目名称
List
<
String
>
collect
=
insuranceList
.
stream
().
map
(
e
->
e
.
getDeptNo
()).
distinct
().
collect
(
Collectors
.
toList
());
R
<
SetInfoVo
>
setInfoByCodes
=
archivesDaprUtil
.
getSetInfoByCodes
(
collect
);
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
!
=
CommonConstants
.
SUCCESS
&&
Common
.
isNotNull
(
setInfoByCodes
.
getData
()))
{
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
=
=
CommonConstants
.
SUCCESS
&&
Common
.
isNotNull
(
setInfoByCodes
.
getData
()))
{
Map
<
String
,
ProjectSetInfoVo
>
data
=
setInfoByCodes
.
getData
().
getProjectSetInfoVoMap
();
for
(
InsuranceListVO
record
:
insuranceList
)
{
ProjectSetInfoVo
jsonObject
=
data
.
get
(
record
.
getDeptNo
());
...
...
@@ -441,7 +441,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//根据项目编码获取项目名称
List
<
String
>
collect
=
insuranceExportList
.
stream
().
map
(
e
->
e
.
getDeptNo
()).
distinct
().
collect
(
Collectors
.
toList
());
R
<
SetInfoVo
>
setInfoByCodes
=
archivesDaprUtil
.
getSetInfoByCodes
(
collect
);
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
!
=
CommonConstants
.
SUCCESS
&&
Common
.
isNotNull
(
setInfoByCodes
.
getData
()))
{
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
=
=
CommonConstants
.
SUCCESS
&&
Common
.
isNotNull
(
setInfoByCodes
.
getData
()))
{
Map
<
String
,
ProjectSetInfoVo
>
data
=
setInfoByCodes
.
getData
().
getProjectSetInfoVoMap
();
for
(
InsuranceExportListVO
record
:
insuranceExportList
)
{
ProjectSetInfoVo
jsonObject
=
data
.
get
(
record
.
getDeptNo
());
...
...
@@ -673,14 +673,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue
;
}
// 身份证号位数校验(18 位合法)
if
(
ValidityUtil
.
validateIDCard
(
param
.
getEmpIdcardNo
())){
if
(
!
ValidityUtil
.
validateIDCard
(
param
.
getEmpIdcardNo
())){
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_IDCARD_NO_NOT_LEGITIMATE
);
listResult
.
add
(
param
);
continue
;
}
// todo 校验身份合法
//根据项目编码查询项目是否存在
R
<
SetInfoVo
>
setInfoByCodes
=
archivesDaprUtil
.
getSetInfoByCodes
(
Arrays
.
asList
(
param
.
getDeptNo
()));
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
!
=
CommonConstants
.
SUCCESS
)
{
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
=
=
CommonConstants
.
SUCCESS
)
{
Map
<
String
,
ProjectSetInfoVo
>
data
=
setInfoByCodes
.
getData
().
getProjectSetInfoVoMap
();
if
(
MapUtils
.
isEmpty
(
data
)){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_IS_NOT_EXIST
);
...
...
@@ -705,11 +707,40 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
//todo 省市校验是否正确并设置对应code
//param.setInsuranceProvince();
//param.setInsuranceCity();
//param.setInsuranceHandleProvince();
//param.setInsuranceHandleCity();
//省市区域校验是否正确并设置对应id
String
redisProvinceName
=
getRedisAreaValue
(
param
.
getInsuranceProvinceName
());
if
(
Common
.
isEmpty
(
redisProvinceName
)){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_PROVINCE_NAME_NOT_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
param
.
setInsuranceProvince
(
Integer
.
parseInt
(
redisProvinceName
));
}
String
redisCityName
=
getRedisAreaValue
(
param
.
getInsuranceCityName
()
+
"_"
+
param
.
getInsuranceProvinceName
());
if
(
Common
.
isEmpty
(
redisCityName
)){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_CITY_NAME_NOT_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
param
.
setInsuranceCity
(
Integer
.
parseInt
(
redisCityName
));
}
String
redisHandleProvinceName
=
getRedisAreaValue
(
param
.
getInsuranceHandleProvinceName
());
if
(
Common
.
isEmpty
(
redisHandleProvinceName
)){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_HANDLE_PROVINCE_NAME_NOT_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
param
.
setInsuranceHandleProvince
(
Integer
.
parseInt
(
redisHandleProvinceName
));
}
String
redisHandleCityName
=
getRedisAreaValue
(
param
.
getInsuranceHandleCityName
()
+
"_"
+
param
.
getInsuranceHandleProvinceName
());
if
(
Common
.
isEmpty
(
redisHandleCityName
)){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_HANDLE_CITY_NAME_NOT_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
param
.
setInsuranceHandleCity
(
Integer
.
parseInt
(
redisHandleCityName
));
}
// 保单开始日期 > 当前派单日期
if
(!
LocalDateUtil
.
isDate
(
param
.
getPolicyStart
(),
LocalDateUtil
.
NORM_DATE_PATTERN
)){
...
...
@@ -892,9 +923,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
//todo 检验身份合法
//根据项目编码查询项目是否存在
R
<
SetInfoVo
>
setInfoByCodes
=
archivesDaprUtil
.
getSetInfoByCodes
(
Arrays
.
asList
(
param
.
getDeptNo
()));
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
!
=
CommonConstants
.
SUCCESS
)
{
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
=
=
CommonConstants
.
SUCCESS
)
{
Map
<
String
,
ProjectSetInfoVo
>
data
=
setInfoByCodes
.
getData
().
getProjectSetInfoVoMap
();
if
(
MapUtils
.
isEmpty
(
data
)){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_IS_NOT_EXIST
);
...
...
@@ -919,11 +953,40 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
//todo 省市校验是否正确并设置对应code
//param.setInsuranceProvince();
//param.setInsuranceCity();
//param.setInsuranceHandleProvince();
//param.setInsuranceHandleCity();
//省市区域校验是否正确并设置对应id
String
redisProvinceName
=
getRedisAreaValue
(
param
.
getInsuranceProvinceName
());
if
(
Common
.
isEmpty
(
redisProvinceName
)){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_PROVINCE_NAME_NOT_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
param
.
setInsuranceProvince
(
Integer
.
parseInt
(
redisProvinceName
));
}
String
redisCityName
=
getRedisAreaValue
(
param
.
getInsuranceCityName
()
+
"_"
+
param
.
getInsuranceProvinceName
());
if
(
Common
.
isEmpty
(
redisCityName
)){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_CITY_NAME_NOT_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
param
.
setInsuranceCity
(
Integer
.
parseInt
(
redisCityName
));
}
String
redisHandleProvinceName
=
getRedisAreaValue
(
param
.
getInsuranceHandleProvinceName
());
if
(
Common
.
isEmpty
(
redisHandleProvinceName
)){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_HANDLE_PROVINCE_NAME_NOT_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
param
.
setInsuranceHandleProvince
(
Integer
.
parseInt
(
redisHandleProvinceName
));
}
String
redisHandleCityName
=
getRedisAreaValue
(
param
.
getInsuranceHandleCityName
()
+
"_"
+
param
.
getInsuranceHandleProvinceName
());
if
(
Common
.
isEmpty
(
redisHandleCityName
)){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_HANDLE_CITY_NAME_NOT_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
param
.
setInsuranceHandleCity
(
Integer
.
parseInt
(
redisHandleCityName
));
}
// 保险公司-险种-购买标准 是否存在
TInsuranceCompany
insuranceCompany
=
tInsuranceCompanyService
.
getOne
(
Wrappers
.<
TInsuranceCompany
>
query
().
lambda
()
...
...
@@ -1095,6 +1158,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
// todo校验身份合法
if
(!
LocalDateUtil
.
isDate
(
param
.
getPolicyStart
(),
LocalDateUtil
.
NORM_DATE_PATTERN
)){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_START_PARSE_ERROR
);
listResult
.
add
(
param
);
...
...
@@ -1249,6 +1313,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return
map
;
}
/**
* 根据区域名称获取区域id
*
* @author licancan
* @param areaString
* @return {@link String}
*/
private
String
getRedisAreaValue
(
String
areaString
)
{
return
String
.
valueOf
(
RedisUtil
.
redis
.
opsForValue
().
get
(
CacheConstants
.
AREA_VALUE
+
areaString
));
}
/***********************减员办理********************************/
/**
* 减员导入校验
...
...
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