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
e27ca47f
Commit
e27ca47f
authored
Feb 15, 2023
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商险优化修改
parent
6222b37d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
79 deletions
+82
-79
TInsuranceOperateMapper.java
...insurances/mapper/insurances/TInsuranceOperateMapper.java
+0
-5
TInsuranceOperateService.java
...nsurances/service/insurance/TInsuranceOperateService.java
+0
-4
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+82
-45
TInsuranceOperateServiceImpl.java
.../service/insurance/impl/TInsuranceOperateServiceImpl.java
+0
-7
TInsuranceOperateMapper.xml
...n/resources/mapper/insurances/TInsuranceOperateMapper.xml
+0
-18
No files found.
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/mapper/insurances/TInsuranceOperateMapper.java
View file @
e27ca47f
...
...
@@ -4,9 +4,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @author licancan
...
...
@@ -15,6 +12,4 @@ import java.util.List;
*/
@Mapper
public
interface
TInsuranceOperateMapper
extends
BaseMapper
<
TInsuranceOperate
>
{
int
saveOperateInfo
(
@Param
(
"list"
)
List
<
TInsuranceOperate
>
list
);
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/TInsuranceOperateService.java
View file @
e27ca47f
...
...
@@ -4,14 +4,10 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate
;
import
java.util.List
;
/**
* @author licancan
* @description 针对表【t_insurance_operate(商险操作表)】的数据库操作Service
* @date 2022-07-25 14:20:16
*/
public
interface
TInsuranceOperateService
extends
IService
<
TInsuranceOperate
>
{
int
saveOperateInfo
(
List
<
TInsuranceOperate
>
list
);
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceDetailServiceImpl.java
View file @
e27ca47f
...
...
@@ -1736,18 +1736,26 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List
<
InsuranceRegisterParam
>
operatList
=
registeredPolicyPremiumCheck
(
paramList
,
insuranceAreaResList
);
//保存到数据库中的结果
List
<
InsuranceRegisterParam
>
listSuccess
=
operatList
.
stream
().
filter
(
e
->
e
.
getErrorMessage
().
equals
(
CommonConstants
.
RESULT_DATA_SUCESS
)).
collect
(
Collectors
.
toList
());
List
<
TInsuranceDetail
>
detailList
=
new
ArrayList
<>();
BigDecimal
actualMoney
;
if
(
CollectionUtils
.
isNotEmpty
(
listSuccess
)){
//商险明细更新list
List
<
TInsuranceDetail
>
detailList
=
new
ArrayList
<>();
//项目信息
Map
<
String
,
TSettleDomainSelectVo
>
mapSelectVo
=
this
.
getSelectVoMap
();
//保单号list
List
<
TInsurancePolicy
>
policyList
=
new
ArrayList
<>();
//业务操作记录表list
List
<
TBusinessOperate
>
operateList
=
new
ArrayList
<>();
//结算信息list
List
<
TInsuranceSettle
>
settleList
=
new
ArrayList
<>();
BigDecimal
actualMoney
;
TSettleDomain
settleDomain
;
if
(
CollectionUtils
.
isNotEmpty
(
listSuccess
)){
TInsuranceDetail
detail
;
List
<
TInsuranceReplace
>
list
;
List
<
TInsuranceReplace
>
replaceList
;
TInsuranceSettle
settle
;
TInsurancePolicy
one
;
BigDecimal
bigDecimalAct
;
for
(
InsuranceRegisterParam
success
:
listSuccess
)
{
long
d1
=
System
.
currentTimeMillis
();
//登记保单保费
...
...
@@ -1782,13 +1790,25 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
StringUtils
.
isNotBlank
(
success
.
getPolicyNo
())){
detail
.
setPolicyNo
(
success
.
getPolicyNo
());
//保单号不为空,维护到保单表中
one
=
tInsurancePolicyService
.
getOne
(
Wrappers
.<
TInsurancePolicy
>
query
().
lambda
()
.
eq
(
TInsurancePolicy:
:
getPolicyNo
,
success
.
getPolicyNo
())
.
eq
(
TInsurancePolicy:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(!
Optional
.
ofNullable
(
one
).
isPresent
()){
TInsurancePolicy
policy
=
new
TInsurancePolicy
();
policy
.
setPolicyNo
(
success
.
getPolicyNo
());
policy
.
setPolicyStart
(
detail
.
getPolicyStart
());
policy
.
setPolicyEnd
(
detail
.
getPolicyEnd
());
policy
.
setInsuranceCompanyName
(
detail
.
getInsuranceCompanyName
());
policy
.
setInsuranceTypeName
(
detail
.
getInsuranceTypeName
());
tInsurancePolicyService
.
saveTInsurancePolicy
(
policy
);
policyList
.
add
(
policy
);
//第一次新增插入变更记录表为insert,前端会将insert渲染为批量导入
TBusinessOperate
operate
=
new
TBusinessOperate
();
operate
.
setBusinessId
(
policy
.
getId
());
operate
.
setDifferenceInfo
(
"insert"
);
operateList
.
add
(
operate
);
}
//如果保单号不为空,将替换类型的保单号也全部更新
replaceList
=
tInsuranceReplaceService
.
list
(
Wrappers
.<
TInsuranceReplace
>
query
().
lambda
()
...
...
@@ -1805,20 +1825,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//如果保费不为空
if
(
StringUtils
.
isNotBlank
(
success
.
getActualPremium
())){
BigDecimal
bigDecimalAct
=
new
BigDecimal
(
success
.
getActualPremium
());
bigDecimalAct
=
new
BigDecimal
(
success
.
getActualPremium
());
//如果当前保单为合并结算
if
(
detail
.
getSettleType
()
==
CommonConstants
.
ZERO_INT
&&
StringUtils
.
isNotBlank
(
detail
.
getDefaultSettleId
()))
{
settle
=
tInsuranceSettleService
.
getById
(
detail
.
getDefaultSettleId
());
if
(
Optional
.
ofNullable
(
settle
).
isPresent
())
{
Integer
isActualPush
=
settle
.
getIsActualPush
();
//如果当前实缴信息未推送,则新增实缴单推送
if
(
CommonConstants
.
ZERO_INT
==
isActualPush
)
{
if
(
CommonConstants
.
ZERO_INT
==
settle
.
getIsActualPush
()
)
{
//保费存储
settle
.
setActualPremium
(
bigDecimalAct
);
settle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
settle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateByI
d
(
settle
);
settleList
.
ad
d
(
settle
);
//调EKP新增实际保费
detail
.
setActualPremium
(
bigDecimalAct
);
doJointInsuranceTask
.
asynchronousEkpInfo
(
detail
,
settle
,
CommonConstants
.
TWO_INT
);
...
...
@@ -1829,7 +1848,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settle
.
setActualPremium
(
bigDecimalAct
);
settle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
settle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateByI
d
(
settle
);
settleList
.
ad
d
(
settle
);
//调EKP更新实际保费
detail
.
setActualPremium
(
bigDecimalAct
);
doJointInsuranceTask
.
asynchronousEkpInfo
(
detail
,
settle
,
CommonConstants
.
FOUR_INT
);
...
...
@@ -1838,34 +1857,34 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//如果当前保单为单独结算
}
else
if
(
detail
.
getSettleType
()
==
CommonConstants
.
ONE_INT
){
//推送过实缴信息且金额与本次不一致,则推送更新
boolean
c
=
!
Common
.
isNotNull
(
detail
.
getActualPremium
())
||
bigDecimalAct
.
compareTo
(
detail
.
getActualPremium
())
!=
0
;
if
(
StringUtils
.
isNotBlank
(
detail
.
getDefaultSettleId
())
&&
c
){
if
(
StringUtils
.
isNotBlank
(
detail
.
getDefaultSettleId
())
&&
(!
Common
.
isNotNull
(
detail
.
getActualPremium
())
||
bigDecimalAct
.
compareTo
(
detail
.
getActualPremium
())
!=
0
)
){
//推送保费更新
settle
=
tInsuranceSettleService
.
getById
(
detail
.
getDefaultSettleId
());
settle
.
setActualPremium
(
bigDecimalAct
);
settle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
settle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateByI
d
(
settle
);
settleList
.
ad
d
(
settle
);
//调EKP更新实际保费
detail
.
setActualPremium
(
bigDecimalAct
);
doJointInsuranceTask
.
asynchronousEkpInfo
(
detail
,
settle
,
CommonConstants
.
FOUR_INT
);
//未推送过实缴信息,则推送新增
}
else
if
(
StringUtils
.
isBlank
(
detail
.
getDefaultSettleId
())){
//保费存储
settle
=
new
TInsuranceSettle
();
settle
.
setInsDetailId
(
detail
.
getId
());
settle
.
setSettleType
(
detail
.
getSettleType
());
settle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
settle
.
setActualPremium
(
bigDecimalAct
);
settle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
TInsuranceSettle
settleNew
=
new
TInsuranceSettle
();
settle
New
.
setInsDetailId
(
detail
.
getId
());
settle
New
.
setSettleType
(
detail
.
getSettleType
());
settle
New
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
settle
New
.
setActualPremium
(
bigDecimalAct
);
settle
New
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
//调完ekp接口才会是1
settle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
settle
);
detail
.
setDefaultSettleId
(
settle
.
getId
());
settle
New
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
settle
New
);
detail
.
setDefaultSettleId
(
settle
New
.
getId
());
//调EKP新增实际保费
detail
.
setActualPremium
(
bigDecimalAct
);
doJointInsuranceTask
.
asynchronousEkpInfo
(
detail
,
settle
,
CommonConstants
.
TWO_INT
);
doJointInsuranceTask
.
asynchronousEkpInfo
(
detail
,
settle
New
,
CommonConstants
.
TWO_INT
);
}
}
}
...
...
@@ -1979,16 +1998,29 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
long
d2
=
System
.
currentTimeMillis
();
log
.
info
(
"登记保单保费一条耗时:"
+
(
d2
-
d1
));
}
}
mapSelectVo
.
clear
();
//操作记录
//批量更新和插入数据
if
(!
detailList
.
isEmpty
())
{
this
.
updateBatchById
(
detailList
);
}
if
(!
settleList
.
isEmpty
())
{
tInsuranceSettleService
.
updateBatchById
(
settleList
);
settleList
.
clear
();
}
if
(!
policyList
.
isEmpty
())
{
tInsurancePolicyService
.
saveBatch
(
policyList
);
policyList
.
clear
();
}
if
(!
operateList
.
isEmpty
())
{
tBusinessOperateService
.
saveBatch
(
operateList
);
operateList
.
clear
();
}
//操作记录
addOperate
(
detailList
,
user
,
InsurancesConstants
.
REGISTERED
,
null
,
CommonConstants
.
ONE_INT
);
if
(
operatList
.
stream
().
allMatch
(
e
->
e
.
getErrorMessage
().
equals
(
CommonConstants
.
RESULT_DATA_SUCESS
)))
{
operatList
=
null
;
}
}
return
R
.
ok
(
operatList
,
InsurancesConstants
.
OPERATE_SUCCESS
);
}
...
...
@@ -3449,11 +3481,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//表内数据重复 员工姓名、员工身份证号码、保险公司、险种、起止时间、购买标准
StringBuilder
errorTemp
=
new
StringBuilder
();
errorTemp
.
append
(
param
.
getEmpName
());
errorTemp
.
append
(
"_"
);
errorTemp
.
append
(
param
.
getEmpIdcardNo
());
errorTemp
.
append
(
"_"
);
errorTemp
.
append
(
param
.
getInsuranceCompanyName
());
errorTemp
.
append
(
"_"
);
errorTemp
.
append
(
param
.
getInsuranceTypeName
());
errorTemp
.
append
(
"_"
);
errorTemp
.
append
(
param
.
getPolicyStart
());
errorTemp
.
append
(
"_"
);
errorTemp
.
append
(
param
.
getPolicyEnd
());
errorTemp
.
append
(
"_"
);
errorTemp
.
append
(
param
.
getBuyStandard
());
if
(
null
==
map
.
get
(
errorTemp
.
toString
()))
{
map
.
put
(
errorTemp
.
toString
(),
"1"
);
...
...
@@ -3501,7 +3539,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue
;
}
// 如果保费不存在,保单号、保费必填
if
(
detail
.
getActualPremium
()
==
null
){
if
(
null
==
detail
.
getActualPremium
()
){
if
(
StringUtils
.
isBlank
(
param
.
getPolicyNo
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_NO_EMPTY
);
continue
;
...
...
@@ -3595,7 +3633,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue
;
}
}
//
//
保单号,发票号更新时
if
(!
booleanPolicyNo
||
!
booleanInvoiceNo
){
if
(
InsurancesConstants
.
SETTLE_TWO
.
equals
(
settleVo
.
getEstimateStatus
())
||
InsurancesConstants
.
SETTLE_TWO
.
equals
(
settleVo
.
getActualStatus
())){
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_HANDLE_THREE_NOT_REGISTERED
);
...
...
@@ -3894,7 +3932,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List
<
TInsuranceOperate
>
operateList
=
new
ArrayList
<>();
for
(
TInsuranceDetail
detail
:
detailList
)
{
TInsuranceOperate
operate
=
new
TInsuranceOperate
();
operate
.
setId
(
String
.
valueOf
(
UUID
.
randomUUID
()).
replaceAll
(
"-"
,
""
));
operate
.
setRemark
(
remark
);
operate
.
setDisplayFlag
(
displayFlag
);
operate
.
setInsuranceDetailId
(
detail
.
getId
());
...
...
@@ -3904,7 +3941,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
operate
.
setCreateTime
(
LocalDateTime
.
now
());
operateList
.
add
(
operate
);
}
tInsuranceOperateService
.
save
OperateInfo
(
operateList
);
tInsuranceOperateService
.
save
Batch
(
operateList
);
}
}
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceOperateServiceImpl.java
View file @
e27ca47f
...
...
@@ -6,8 +6,6 @@ import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceOperat
import
com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceOperateService
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @author licancan
...
...
@@ -16,9 +14,4 @@ import java.util.List;
*/
@Service
public
class
TInsuranceOperateServiceImpl
extends
ServiceImpl
<
TInsuranceOperateMapper
,
TInsuranceOperate
>
implements
TInsuranceOperateService
{
@Override
public
int
saveOperateInfo
(
List
<
TInsuranceOperate
>
list
)
{
return
baseMapper
.
saveOperateInfo
(
list
);
}
}
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/insurances/TInsuranceOperateMapper.xml
View file @
e27ca47f
...
...
@@ -19,22 +19,4 @@
ID,INSURANCE_DETAIL_ID,OPERATE_DESC,REMARK,
CREATE_BY,CREATE_NAME,CREATE_TIME
</sql>
<insert
id=
"saveOperateInfo"
parameterType=
"java.util.List"
>
insert into t_insurance_operate
(ID,REMARK,DISPLAY_FLAG,CREATE_BY,CREATE_TIME,CREATE_NAME,OPERATE_DESC,INSURANCE_DETAIL_ID)
VALUES
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.id},
#{item.remark},
#{item.displayFlag},
#{item.createBy},
#{item.createTime},
#{item.createName},
#{item.operateDesc},
#{item.insuranceDetailId}
)
</foreach>
</insert>
</mapper>
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