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
ec3cb061
Commit
ec3cb061
authored
Aug 08, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
8a692712
cdf9d75e
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
297 additions
and
77 deletions
+297
-77
CommonConstants.java
...ud.plus.v1/yifu/common/core/constant/CommonConstants.java
+6
-0
InsurancesConstants.java
...lus/v1/yifu/insurances/constants/InsurancesConstants.java
+19
-5
TInsuranceDetail.java
...loud/plus/v1/yifu/insurances/entity/TInsuranceDetail.java
+2
-0
InsuranceExportListParam.java
.../plus/v1/yifu/insurances/vo/InsuranceExportListParam.java
+6
-0
InsuranceListParam.java
.../cloud/plus/v1/yifu/insurances/vo/InsuranceListParam.java
+12
-0
TInsuranceDetailController.java
...ifu/insurances/controller/TInsuranceDetailController.java
+14
-12
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+225
-54
TInsuranceDetailMapper.xml
...-biz/src/main/resources/mapper/TInsuranceDetailMapper.xml
+12
-2
package-info.java
...java/com/yifu/cloud/plus/v1/yifu/salary/package-info.java
+0
-1
package-info.java
...fu/cloud/plus/v1/yifu/salary/controller/package-info.java
+0
-1
package-info.java
.../yifu/cloud/plus/v1/yifu/salary/service/package-info.java
+0
-1
ServiceImpl.java.vm
...u-codegen/src/main/resources/template/ServiceImpl.java.vm
+1
-1
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/constant/CommonConstants.java
View file @
ec3cb061
...
...
@@ -130,6 +130,12 @@ public interface CommonConstants {
String
THIRTEEN_STRING
=
"13"
;
String
FOURTEEN_STRING
=
"14"
;
String
FIFTEEN_STRING
=
"15"
;
String
SIXTEEN_STRING
=
"16"
;
/**
* number 0
*/
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/constants/InsurancesConstants.java
View file @
ec3cb061
...
...
@@ -11,6 +11,10 @@ public class InsurancesConstants {
* 新增
*/
public
static
final
String
ADD
=
"新增"
;
/**
* 离职
*/
public
static
final
String
QUIT
=
"离职"
;
/**
* 批增
*/
...
...
@@ -69,13 +73,13 @@ public class InsurancesConstants {
*/
public
static
final
String
EDIT_NOT_ALLOW
=
"不允许编辑"
;
/**
* 投保
信息
已存在
* 投保
记录
已存在
*/
public
static
final
String
DATA_IS_EXIST
=
"投保
信息
已存在"
;
public
static
final
String
DATA_IS_EXIST
=
"投保
记录
已存在"
;
/**
* 投保
信息
不存在
* 投保
记录
不存在
*/
public
static
final
String
DATA_IS_NOT_EXIST
=
"投保
信息
不存在"
;
public
static
final
String
DATA_IS_NOT_EXIST
=
"投保
记录
不存在"
;
/**
* 结算信息不存在
*/
...
...
@@ -560,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
=
"被替换的项目不存在"
;
/**
...
...
@@ -771,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/entity/TInsuranceDetail.java
View file @
ec3cb061
...
...
@@ -121,6 +121,7 @@ public class TInsuranceDetail extends BaseEntity {
* 保单生效日期
*/
@Schema
(
description
=
"保单生效日期"
)
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
LocalDate
policyEffect
;
/**
...
...
@@ -255,6 +256,7 @@ public class TInsuranceDetail extends BaseEntity {
* 是否过期 0未过期 1已过期
*/
@Schema
(
description
=
"是否过期 0未过期 1已过期"
)
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
Integer
isOverdue
;
/**
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceExportListParam.java
View file @
ec3cb061
...
...
@@ -45,4 +45,10 @@ public class InsuranceExportListParam implements Serializable {
*/
@Schema
(
description
=
"商险id集合"
)
private
List
<
String
>
idList
;
/**
* 办理地分流sql
*/
@Schema
(
description
=
"办理地分流sql"
)
private
String
regionSql
;
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceListParam.java
View file @
ec3cb061
...
...
@@ -63,4 +63,16 @@ public class InsuranceListParam implements Serializable {
*/
@Schema
(
description
=
"项目编码列表"
)
private
List
<
String
>
deptNoList
;
/**
* 办理地分流sql
*/
@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/controller/TInsuranceDetailController.java
View file @
ec3cb061
...
...
@@ -76,6 +76,19 @@ public class TInsuranceDetailController {
return
R
.
ok
(
tInsuranceDetailService
.
getInsuranceHandleListPage
(
page
,
param
));
}
/**
* 投保办理不分页查询
*
* @author licancan
* @param param
* @return {@link R<List<InsuranceListVO>>}
*/
@Operation
(
summary
=
"投保办理不分页查询"
,
description
=
"投保办理不分页查询"
)
@PostMapping
(
"/getInsuranceHandleList"
)
public
R
<
List
<
InsuranceListVO
>>
getInsuranceHandleList
(
@RequestBody
InsuranceListParam
param
)
{
return
R
.
ok
(
tInsuranceDetailService
.
getInsuranceHandleList
(
param
));
}
/**
* 投保分页查询
*
...
...
@@ -103,18 +116,7 @@ public class TInsuranceDetailController {
return
R
.
ok
(
tInsuranceDetailService
.
getInsuranceList
(
param
));
}
/**
* 投保办理不分页查询
*
* @author licancan
* @param param
* @return {@link R<List<InsuranceListVO>>}
*/
@Operation
(
summary
=
"投保办理不分页查询"
,
description
=
"投保办理不分页查询"
)
@PostMapping
(
"/getInsuranceHandleList"
)
public
R
<
List
<
InsuranceListVO
>>
getInsuranceHandleList
(
@RequestBody
InsuranceListParam
param
)
{
return
R
.
ok
(
tInsuranceDetailService
.
getInsuranceHandleList
(
param
));
}
/**
* 商险新增
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
ec3cb061
...
...
@@ -228,6 +228,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override
public
IPage
<
InsuranceListVO
>
getInsuranceHandleListPage
(
Page
<
InsuranceListVO
>
page
,
InsuranceListParam
param
)
{
//todo 根据登录人获取数据权限
IPage
<
InsuranceListVO
>
iPage
=
new
Page
<>();
YifuUser
user
=
SecurityUtils
.
getUser
();
String
regionSQL
=
getRegionSQL
(
user
);
if
(
StringUtils
.
isBlank
(
regionSQL
)){
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
());
...
...
@@ -249,6 +260,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
public
List
<
InsuranceListVO
>
getInsuranceHandleList
(
InsuranceListParam
param
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
String
regionSQL
=
getRegionSQL
(
user
);
param
.
setRegionSql
(
regionSQL
);
//todo 根据登录人获取数据权限
List
<
InsuranceListVO
>
insuranceList
=
baseMapper
.
getInsuranceHandleList
(
param
);
//根据项目编码获取项目名称
...
...
@@ -391,6 +405,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
success
.
getPolicyStart
()))
.
eq
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
success
.
getPolicyEnd
()))
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
BeanCopyUtils
.
copyProperties
(
detail
,
newDetail
);
...
...
@@ -411,6 +426,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newDetail
.
setIsUse
(
null
);
newDetail
.
setIsEffect
(
null
);
newDetail
.
setReduceHandleStatus
(
null
);
newDetail
.
setSignFlag
(
CommonConstants
.
ZERO_INT
);
//创建时间是新数据插入时间
newDetail
.
setCreateTime
(
LocalDateTime
.
now
());
newDetail
.
setCreateBy
(
user
.
getId
());
...
...
@@ -428,6 +444,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
replace
.
setToInsuranceDetailId
(
newDetail
.
getId
());
TInsuranceReplace
one
=
tInsuranceReplaceService
.
getOne
(
Wrappers
.<
TInsuranceReplace
>
query
().
lambda
()
.
eq
(
TInsuranceReplace:
:
getToInsuranceDetailId
,
detail
.
getId
())
.
orderByDesc
(
TInsuranceReplace:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
Optional
.
ofNullable
(
one
).
isPresent
()){
...
...
@@ -539,6 +556,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceCompany
insuranceCompany
=
tInsuranceCompanyService
.
getOne
(
Wrappers
.<
TInsuranceCompany
>
query
().
lambda
()
.
eq
(
TInsuranceCompany:
:
getCompanyName
,
param
.
getInsuranceCompanyName
())
.
eq
(
TInsuranceCompany:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceCompany:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
insuranceCompany
).
isPresent
()){
return
R
.
failed
(
InsurancesConstants
.
INSURANCE_COMPANY_NAME_NOT_EXIST
);
...
...
@@ -550,6 +569,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceType:
:
getName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
.
eq
(
TInsuranceType:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceType:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
insuranceType
).
isPresent
()){
return
R
.
failed
(
InsurancesConstants
.
INSURANCE_TYPE_NAME_NOT_EXIST
);
...
...
@@ -559,6 +580,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandard
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeStandard:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceTypeStandard:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeStandard
).
isPresent
()){
return
R
.
failed
(
InsurancesConstants
.
BUY_STANDARD_NOT_EXIST
);
...
...
@@ -578,6 +601,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceTypeRate:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeRate:
:
getMonth
,
month
)
.
eq
(
TInsuranceTypeRate:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceTypeRate:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeRate
).
isPresent
()){
...
...
@@ -613,6 +637,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsOverdue
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsOverdue
)
)
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
Optional
.
ofNullable
(
insuranceDetail
).
isPresent
()
&&
!
insuranceDetail
.
getId
().
equals
(
param
.
getId
())){
...
...
@@ -644,6 +669,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsOverdue
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsOverdue
)
)
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
...
...
@@ -655,6 +681,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
byId
.
setBuyHandleStatus
(
CommonConstants
.
ONE_INT
);
byId
.
setPolicyStart
(
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()));
byId
.
setPolicyEnd
(
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
()));
//如果不是补单的,需要更新创建时间
if
(
byId
.
getSignFlag
()
==
CommonConstants
.
ZERO_INT
){
byId
.
setCreateTime
(
LocalDateTime
.
now
());
}
byId
.
setUpdateBy
(
user
.
getId
());
byId
.
setUpdateTime
(
LocalDateTime
.
now
());
this
.
updateById
(
byId
);
...
...
@@ -679,6 +709,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceReplace
one
=
tInsuranceReplaceService
.
getOne
(
Wrappers
.<
TInsuranceReplace
>
query
().
lambda
()
.
eq
(
TInsuranceReplace:
:
getToInsuranceDetailId
,
byId
.
getId
())
.
orderByDesc
(
TInsuranceReplace:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Optional
.
ofNullable
(
one
).
isPresent
()){
TInsuranceDetail
insuranceDetail
=
this
.
getById
(
one
.
getFromInsuranceDetailId
());
...
...
@@ -691,6 +722,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//被替换者无效
insuranceDetail
.
setIsEffect
(
CommonConstants
.
ONE_INT
);
insuranceDetail
.
setUpdateTime
(
LocalDateTime
.
now
());
this
.
updateById
(
insuranceDetail
);
//替换记录成功
one
.
setReplaceStatus
(
CommonConstants
.
ONE_INT
);
...
...
@@ -702,6 +734,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
byId
.
setEmpName
(
param
.
getEmpName
());
byId
.
setEmpIdcardNo
(
param
.
getEmpIdcardNo
());
byId
.
setPost
(
param
.
getPost
());
if
(
byId
.
getSignFlag
()
==
CommonConstants
.
ZERO_INT
){
byId
.
setCreateTime
(
LocalDateTime
.
now
());
}
byId
.
setUpdateBy
(
user
.
getId
());
byId
.
setUpdateTime
(
LocalDateTime
.
now
());
this
.
updateById
(
byId
);
...
...
@@ -748,9 +783,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override
public
List
<
InsuranceExportListVO
>
getInsuranceExportList
(
InsuranceExportListParam
param
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
List
<
InsuranceExportListVO
>
insuranceExportList
;
List
<
InsuranceExportListVO
>
insuranceExportList
=
new
ArrayList
<>()
;
//todo 根据登录人获取数据权限
String
regionSQL
=
getRegionSQL
(
user
);
param
.
setRegionSql
(
regionSQL
);
if
(
StringUtils
.
isBlank
(
regionSQL
)){
return
insuranceExportList
;
}
//如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待投保」的结果集
if
(
CollectionUtils
.
isNotEmpty
(
param
.
getIdList
())){
insuranceExportList
=
baseMapper
.
getInsuranceExportListBySelect
(
param
.
getIdList
());
...
...
@@ -792,6 +831,49 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//操作记录
addOperate
(
detailList
,
user
,
InsurancesConstants
.
EXPORT
);
//针对是替换类型的做处理,每一条替换数据对应一条被替换数据
List
<
InsuranceExportListVO
>
listVOS
=
insuranceExportList
.
stream
().
filter
(
e
->
e
.
getBuyType
()
==
CommonConstants
.
FOUR_INT
).
collect
(
Collectors
.
toList
());
List
<
InsuranceExportListVO
>
list
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
listVOS
)){
for
(
InsuranceExportListVO
listVO
:
listVOS
)
{
listVO
.
setRemark
(
InsurancesConstants
.
ADD
);
TInsuranceReplace
one
=
tInsuranceReplaceService
.
getOne
(
Wrappers
.<
TInsuranceReplace
>
query
().
lambda
()
.
eq
(
TInsuranceReplace:
:
getToInsuranceDetailId
,
listVO
.
getId
())
.
orderByDesc
(
TInsuranceReplace:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Optional
.
ofNullable
(
one
).
isPresent
()){
TInsuranceDetail
byId
=
this
.
getById
(
one
.
getFromInsuranceDetailId
());
if
(
Optional
.
ofNullable
(
byId
).
isPresent
()){
InsuranceExportListVO
vo
=
new
InsuranceExportListVO
();
BeanCopyUtils
.
copyProperties
(
byId
,
vo
);
//购买月数
vo
.
setBuyMonth
(
LocalDateUtil
.
betweenMonth
(
vo
.
getPolicyStart
().
toString
(),
vo
.
getPolicyEnd
().
toString
()));
//购买天数
vo
.
setBuyDay
(
LocalDateUtil
.
betweenDay
(
vo
.
getPolicyStart
().
toString
(),
vo
.
getPolicyEnd
().
toString
()));
vo
.
setRemark
(
InsurancesConstants
.
QUIT
);
vo
.
setBuyType
(
CommonConstants
.
FOUR_INT
);
list
.
add
(
vo
);
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
//根据项目编码获取项目名称
List
<
String
>
collectList
=
list
.
stream
().
map
(
e
->
e
.
getDeptNo
()).
distinct
().
collect
(
Collectors
.
toList
());
R
<
SetInfoVo
>
setInfoByCodesList
=
archivesDaprUtil
.
getSetInfoByCodes
(
collectList
);
if
(
null
!=
setInfoByCodesList
&&
setInfoByCodesList
.
getCode
()
==
CommonConstants
.
SUCCESS
&&
Common
.
isNotNull
(
setInfoByCodesList
.
getData
()))
{
Map
<
String
,
ProjectSetInfoVo
>
data
=
setInfoByCodesList
.
getData
().
getProjectSetInfoVoMap
();
for
(
InsuranceExportListVO
record
:
list
)
{
ProjectSetInfoVo
jsonObject
=
data
.
get
(
record
.
getDeptNo
());
if
(
null
!=
jsonObject
){
record
.
setProjectName
(
Optional
.
ofNullable
(
jsonObject
.
getDepartName
()).
orElse
(
""
));
}
}
}
insuranceExportList
.
addAll
(
list
);
}
}
}
return
insuranceExportList
;
}
...
...
@@ -840,6 +922,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceReplace
one
=
tInsuranceReplaceService
.
getOne
(
Wrappers
.<
TInsuranceReplace
>
query
().
lambda
()
.
eq
(
TInsuranceReplace:
:
getToInsuranceDetailId
,
detail
.
getId
())
.
orderByDesc
(
TInsuranceReplace:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Optional
.
ofNullable
(
one
).
isPresent
()){
//替换记录变为失败
...
...
@@ -856,6 +939,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// 记录状态置为「退回」
detail
.
setBuyHandleStatus
(
CommonConstants
.
FOUR_INT
);
//投保成功后再次投保退回,需要将保单生效日期、是否有效、是否过期置为空
if
(
detail
.
getSignFlag
()
==
CommonConstants
.
ONE_INT
){
detail
.
setPolicyEffect
(
null
);
detail
.
setIsEffect
(
null
);
detail
.
setIsOverdue
(
null
);
}
detail
.
setUpdateBy
(
user
.
getId
());
detail
.
setUpdateTime
(
LocalDateTime
.
now
());
successList
.
add
(
detail
);
...
...
@@ -1059,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"
);
//保存到数据库中的结果
...
...
@@ -1077,6 +1166,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
success
.
getPolicyStart
()))
.
eq
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
success
.
getPolicyEnd
()))
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
StringUtils
.
isNotBlank
(
success
.
getInvoiceNo
())){
...
...
@@ -1270,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
);
...
...
@@ -1332,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
)){
...
...
@@ -1371,6 +1461,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceCompany
insuranceCompany
=
tInsuranceCompanyService
.
getOne
(
Wrappers
.<
TInsuranceCompany
>
query
().
lambda
()
.
eq
(
TInsuranceCompany:
:
getCompanyName
,
param
.
getInsuranceCompanyName
())
.
eq
(
TInsuranceCompany:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceCompany:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
insuranceCompany
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_COMPANY_NAME_NOT_EXIST
);
...
...
@@ -1384,6 +1476,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceType:
:
getName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
.
eq
(
TInsuranceType:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceType:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
insuranceType
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_TYPE_NAME_NOT_EXIST
);
...
...
@@ -1395,6 +1489,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandard
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeStandard:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceTypeStandard:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeStandard
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
BUY_STANDARD_NOT_EXIST
);
...
...
@@ -1416,6 +1512,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceTypeRate:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeRate:
:
getMonth
,
month
)
.
eq
(
TInsuranceTypeRate:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceTypeRate:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeRate
).
isPresent
()){
...
...
@@ -1465,6 +1562,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsOverdue
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsOverdue
)
)
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
Optional
.
ofNullable
(
insuranceDetail
).
isPresent
()){
...
...
@@ -1499,6 +1597,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsOverdue
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsOverdue
)
)
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
...
...
@@ -1621,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
);
...
...
@@ -1682,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
)){
...
...
@@ -1732,6 +1830,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
or
().
isNull
(
TInsuranceDetail:
:
getIsOverdue
)
)
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
limitOne
).
isPresent
()){
...
...
@@ -1747,6 +1846,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceCompany
insuranceCompany
=
tInsuranceCompanyService
.
getOne
(
Wrappers
.<
TInsuranceCompany
>
query
().
lambda
()
.
eq
(
TInsuranceCompany:
:
getCompanyName
,
param
.
getInsuranceCompanyName
())
.
eq
(
TInsuranceCompany:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceCompany:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
insuranceCompany
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_COMPANY_NAME_NOT_EXIST
);
...
...
@@ -1760,6 +1861,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceType:
:
getName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
.
eq
(
TInsuranceType:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceType:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
insuranceType
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_TYPE_NAME_NOT_EXIST
);
...
...
@@ -1771,6 +1874,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandard
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeStandard:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceTypeStandard:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeStandard
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
BUY_STANDARD_NOT_EXIST
);
...
...
@@ -1792,6 +1897,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceTypeRate:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeRate:
:
getMonth
,
month
)
.
eq
(
TInsuranceTypeRate:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceTypeRate:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeRate
).
isPresent
()){
...
...
@@ -1852,6 +1958,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsOverdue
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsOverdue
)
)
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
Optional
.
ofNullable
(
insuranceDetail
).
isPresent
()){
...
...
@@ -1974,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
);
...
...
@@ -2020,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
)
{
...
...
@@ -2048,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
())
...
...
@@ -2059,6 +2164,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()))
.
eq
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
()))
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
detail
).
isPresent
()){
...
...
@@ -2144,6 +2250,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsOverdue
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsOverdue
)
)
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
Optional
.
ofNullable
(
replace
).
isPresent
()){
...
...
@@ -2177,6 +2284,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsOverdue
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsOverdue
)
)
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
...
...
@@ -2200,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
())){
...
...
@@ -2277,6 +2386,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()))
.
eq
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
()))
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
detail
).
isPresent
()){
...
...
@@ -2284,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
())){
...
...
@@ -2304,6 +2430,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceDetail
batchPolicyNo
=
this
.
baseMapper
.
selectOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
.
eq
(
TInsuranceDetail:
:
getPolicyNo
,
param
.
getPolicyNo
())
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
batchPolicyNo
).
isPresent
()){
...
...
@@ -2327,6 +2454,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceDetail
addPolicyNo
=
this
.
baseMapper
.
selectOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
.
eq
(
TInsuranceDetail:
:
getPolicyNo
,
param
.
getPolicyNo
())
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
Optional
.
ofNullable
(
addPolicyNo
).
isPresent
()){
...
...
@@ -2626,6 +2754,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
public
List
<
InsuranceRefundListVo
>
getInsuranceRefundList
(
InsuranceRefundParam
param
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
List
<
String
>
deptNoList
=
getDeptNoList
(
user
);
param
.
setDeptNoList
(
deptNoList
);
List
<
InsuranceRefundListVo
>
insuranceRefundList
=
this
.
baseMapper
.
getInsuranceRefundList
(
param
);
if
(
CollectionUtils
.
isNotEmpty
(
insuranceRefundList
)){
//根据项目编码获取项目名称
...
...
@@ -2794,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
);
...
...
@@ -3438,11 +3570,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue
;
}
LambdaQueryWrapper
<
TInsuranceDetail
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
TInsuranceDetail
::
getDeleteFlag
,
CommonConstants
.
ZERO_INT
).
eq
(
TInsuranceDetail
::
getEmpName
,
empName
)
.
eq
(
TInsuranceDetail
::
getEmpIdcardNo
,
empIdCardNo
).
eq
(
TInsuranceDetail
::
getInsuranceCompanyName
,
insuranceCompanyName
)
queryWrapper
.
eq
(
TInsuranceDetail
::
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TInsuranceDetail
::
getEmpName
,
empName
)
.
eq
(
TInsuranceDetail
::
getEmpIdcardNo
,
empIdCardNo
)
.
eq
(
TInsuranceDetail
::
getInsuranceCompanyName
,
insuranceCompanyName
)
.
eq
(
TInsuranceDetail
::
getInsuranceTypeName
,
insuranceTypeName
)
.
eq
(
TInsuranceDetail
::
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
policyStart
))
.
eq
(
TInsuranceDetail
::
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
policyEnd
)).
last
(
CommonConstants
.
LAST_ONE_SQL
);
.
eq
(
TInsuranceDetail
::
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
policyEnd
))
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
);
List
<
TInsuranceDetail
>
list
=
list
(
queryWrapper
);
if
(
list
.
size
()>
1
){
param
.
setErrorMessage
(
InsurancesConstants
.
MULTIPLE_RECORDS_UNDER_WARRANTY
);
...
...
@@ -3706,12 +3842,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//必填格式校通过后查询对应的保单信息
LambdaQueryWrapper
<
TInsuranceDetail
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
TInsuranceDetail
::
getDeleteFlag
,
CommonConstants
.
ZERO_INT
).
eq
(
TInsuranceDetail
::
getEmpName
,
empName
)
.
eq
(
TInsuranceDetail
::
getEmpIdcardNo
,
empIdCardNo
).
eq
(
TInsuranceDetail
::
getInsuranceCompanyName
,
insuranceCompanyName
)
queryWrapper
.
eq
(
TInsuranceDetail
::
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TInsuranceDetail
::
getEmpName
,
empName
)
.
eq
(
TInsuranceDetail
::
getEmpIdcardNo
,
empIdCardNo
)
.
eq
(
TInsuranceDetail
::
getInsuranceCompanyName
,
insuranceCompanyName
)
.
eq
(
TInsuranceDetail
::
getDeptNo
,
deptNo
).
eq
(
TInsuranceDetail
::
getBuyStandard
,
buyStandard
)
.
eq
(
TInsuranceDetail
::
getInsuranceTypeName
,
insuranceTypeName
)
.
eq
(
TInsuranceDetail
::
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
policyStart
)
)
.
eq
(
TInsuranceDetail
::
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
policyEnd
)).
last
(
CommonConstants
.
LAST_ONE_SQL
);
.
eq
(
TInsuranceDetail
::
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
policyEnd
))
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
);
List
<
TInsuranceDetail
>
list
=
list
(
queryWrapper
);
if
(
list
.
size
()>
1
){
param
.
setErrorMessage
(
InsurancesConstants
.
MULTIPLE_RECORDS_UNDER_WARRANTY
);
...
...
@@ -3827,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
)){
...
...
@@ -3853,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
)){
...
...
@@ -3916,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
();
...
...
@@ -3935,14 +4076,31 @@ 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
).
eq
(
TInsuranceDetail
::
getEmpName
,
empName
)
.
eq
(
TInsuranceDetail
::
getEmpIdcardNo
,
empIdCardNo
).
eq
(
TInsuranceDetail
::
getInsuranceTypeName
,
insuranceTypeName
)
.
eq
(
TInsuranceDetail
::
getBuyStandard
,
buyStandard
).
eq
(
TInsuranceDetail:
:
getDeptNo
,
oldDeptNo
)
queryWrapper
.
eq
(
TInsuranceDetail
::
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TInsuranceDetail
::
getEmpName
,
empName
)
.
eq
(
TInsuranceDetail
::
getEmpIdcardNo
,
empIdCardNo
)
.
eq
(
TInsuranceDetail
::
getInsuranceTypeName
,
insuranceTypeName
)
.
eq
(
TInsuranceDetail
::
getBuyStandard
,
buyStandard
)
.
eq
(
TInsuranceDetail:
:
getDeptNo
,
oldDeptNo
)
.
eq
(
TInsuranceDetail
::
getInsuranceCompanyName
,
insuranceCompanyName
)
.
eq
(
TInsuranceDetail
::
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
policyStart
))
.
eq
(
TInsuranceDetail
::
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
policyEnd
)).
last
(
CommonConstants
.
LAST_ONE_SQL
);
.
eq
(
TInsuranceDetail
::
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
policyEnd
))
.
orderByDesc
(
TInsuranceDetail:
:
getCreateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
);
List
<
TInsuranceDetail
>
list
=
list
(
queryWrapper
);
if
(
list
.
size
()>
1
){
param
.
setErrorMessage
(
InsurancesConstants
.
MULTIPLE_RECORDS_UNDER_WARRANTY
);
...
...
@@ -4198,7 +4356,20 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
public
String
getRegionSQL
(
YifuUser
user
){
String
sql
=
"detail.INSURANCE_HANDLE_PROVINCE in (12) and detail.INSURANCE_HANDLE_CITY in (135)"
;
String
id
=
user
.
getId
();
String
sql
;
//user_id=14, 合肥办理1
//user_id=15,合肥办理2
//user_id=16,上海办理
if
(
CommonConstants
.
FOURTEEN_STRING
.
equals
(
id
)){
sql
=
"detail.INSURANCE_HANDLE_PROVINCE in (12) and detail.INSURANCE_HANDLE_CITY in (135)"
;
}
else
if
(
CommonConstants
.
FIFTEEN_STRING
.
equals
(
id
)){
sql
=
"detail.INSURANCE_HANDLE_PROVINCE in (12) and detail.INSURANCE_HANDLE_CITY in (135)"
;
}
else
if
(
CommonConstants
.
SIXTEEN_STRING
.
equals
(
id
)){
sql
=
"detail.INSURANCE_HANDLE_PROVINCE in (9) and detail.INSURANCE_HANDLE_CITY in (109)"
;
}
else
{
sql
=
"detail.INSURANCE_HANDLE_PROVINCE in (12,9) and detail.INSURANCE_HANDLE_CITY in (135,109)"
;
}
return
sql
;
}
...
...
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/TInsuranceDetailMapper.xml
View file @
ec3cb061
...
...
@@ -168,6 +168,12 @@
#{item}
</foreach>
</if>
<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>
...
...
@@ -272,6 +278,7 @@
#{item}
</foreach>
</if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select>
<select
id=
"getInsuranceDetailById"
resultType=
"com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceDetailVO"
>
...
...
@@ -342,13 +349,13 @@
detail.CREATE_NAME as createName,
detail.REMARK as remark
from t_insurance_detail detail
where detail.id in
where detail.
DELETE_FLAG = 0 and detail.BUY_HANDLE_STATUS = 1 and detail.
id in
<foreach
collection=
"idList"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
ORDER BY detail.CREATE_TIME DESC
</select>
<!--出办理非勾选查询结果-->
<select
id=
"getInsuranceExportList"
resultType=
"com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceExportListVO"
>
select detail.id as id,
detail.DEPT_NO as deptNo,
...
...
@@ -385,6 +392,9 @@
<if
test=
"param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''"
>
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if>
<if
test=
"param.regionSql != null and param.regionSql.trim() != ''"
>
and ${param.regionSql}
</if>
ORDER BY detail.CREATE_TIME DESC
</select>
...
...
yifu-salary/yifu-salary-api/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/package-info.java
deleted
100644 → 0
View file @
8a692712
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
;
\ No newline at end of file
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/controller/package-info.java
deleted
100644 → 0
View file @
8a692712
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
controller
;
\ No newline at end of file
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/package-info.java
deleted
100644 → 0
View file @
8a692712
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
service
;
\ No newline at end of file
yifu-visual/yifu-codegen/src/main/resources/template/ServiceImpl.java.vm
View file @
ec3cb061
...
...
@@ -79,7 +79,7 @@ public class ${className}ServiceImpl extends ServiceImpl<${className}Mapper, ${c
*/
@
Override
public
void
listExport
(
HttpServletResponse
response
,
${
className
}
SearchVo
searchVo
){
String
fileName
=
"
不良记录
批量导出"
+
DateUtil
.
getThisTime
()
+
".xlsx"
;
String
fileName
=
"
${comments}
批量导出"
+
DateUtil
.
getThisTime
()
+
".xlsx"
;
//
获取要导出的列表
List
<${
className
}>
list
=
new
ArrayList
<>();
long
count
=
noPageCountDiy
(
searchVo
);
...
...
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