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
183a80ba
Commit
183a80ba
authored
Aug 01, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
77edca08
b314fcc9
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
759 additions
and
261 deletions
+759
-261
InsurancesConstants.java
...lus/v1/yifu/insurances/constants/InsurancesConstants.java
+15
-0
TInsuranceDetail.java
...loud/plus/v1/yifu/insurances/entity/TInsuranceDetail.java
+12
-0
TInsuranceSettleCancel.java
...lus/v1/yifu/insurances/entity/TInsuranceSettleCancel.java
+63
-0
LocalDateUtil.java
...ifu/cloud/plus/v1/yifu/insurances/util/LocalDateUtil.java
+31
-1
InsuranceAddParam.java
...u/cloud/plus/v1/yifu/insurances/vo/InsuranceAddParam.java
+13
-0
InsuranceBatchParam.java
...cloud/plus/v1/yifu/insurances/vo/InsuranceBatchParam.java
+13
-0
TInsuranceDetailController.java
...ifu/insurances/controller/TInsuranceDetailController.java
+32
-4
TInsuranceTypeController.java
.../yifu/insurances/controller/TInsuranceTypeController.java
+2
-2
TInsuranceDetailMapper.java
...lus/v1/yifu/insurances/mapper/TInsuranceDetailMapper.java
+9
-0
TInsuranceSettleCancelMapper.java
.../yifu/insurances/mapper/TInsuranceSettleCancelMapper.java
+17
-0
TInsuranceDetailService.java
...s/v1/yifu/insurances/service/TInsuranceDetailService.java
+19
-2
TInsuranceSettleCancelService.java
...ifu/insurances/service/TInsuranceSettleCancelService.java
+13
-0
TInsuranceCompanyServiceImpl.java
...insurances/service/impl/TInsuranceCompanyServiceImpl.java
+14
-6
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+366
-222
TInsuranceSettleCancelServiceImpl.java
...ances/service/impl/TInsuranceSettleCancelServiceImpl.java
+18
-0
TInsuranceTypeRateServiceImpl.java
...nsurances/service/impl/TInsuranceTypeRateServiceImpl.java
+41
-12
TInsuranceTypeServiceImpl.java
...fu/insurances/service/impl/TInsuranceTypeServiceImpl.java
+3
-0
TInsuranceTypeStandardServiceImpl.java
...ances/service/impl/TInsuranceTypeStandardServiceImpl.java
+31
-4
TInsuranceDetailMapper.xml
...-biz/src/main/resources/mapper/TInsuranceDetailMapper.xml
+15
-1
TInsuranceSettleCancelMapper.xml
...rc/main/resources/mapper/TInsuranceSettleCancelMapper.xml
+24
-0
TInsuranceTypeMapper.xml
...es-biz/src/main/resources/mapper/TInsuranceTypeMapper.xml
+3
-1
TPaymentInfoController.java
...lus/v1/yifu/social/controller/TPaymentInfoController.java
+1
-2
TSocialFundInfoServiceImpl.java
.../yifu/social/service/impl/TSocialFundInfoServiceImpl.java
+4
-4
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/constants/InsurancesConstants.java
View file @
183a80ba
...
...
@@ -436,6 +436,11 @@ public class InsurancesConstants {
*/
public
static
final
String
SETTLE_MONTH_CHANGE_BUY_STATUS_TWO_ERROR
=
"商险投保中,无法变更结算月"
;
/**
* 商险投保退回,无法变更结算月
*/
public
static
final
String
SETTLE_MONTH_CHANGE_BUY_STATUS_FOUR_ERROR
=
"商险投保退回,无法变更结算月"
;
/**
* 商险已减员,无法变更结算月
*/
...
...
@@ -493,11 +498,21 @@ public class InsurancesConstants {
*/
public
static
final
String
DEPT_NO_CHANGE_BUY_STATUS_TWO_ERROR
=
"商险投保中,无法变更项目"
;
/**
* 商险投保退回,无法变更项目
*/
public
static
final
String
DEPT_NO_CHANGE_BUY_STATUS_FOUR_ERROR
=
"商险投保退回,无法变更项目"
;
/**
* 商险已减员,无法变更项目
*/
public
static
final
String
DEPT_NO_CHANGE_REFUND_STATUS_FOUR_ERROR
=
"商险已减员,无法变更项目"
;
/**
* 商险已减员,无法变更项目
*/
public
static
final
String
DEPT_NO_CHANGE_REFUND_STATUS_ONE_ERROR
=
"商险减员中,无法变更项目"
;
/**
* 商险结算中,无法变更项目
*/
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/entity/TInsuranceDetail.java
View file @
183a80ba
...
...
@@ -75,6 +75,18 @@ public class TInsuranceDetail extends BaseEntity {
@Schema
(
description
=
"购买标准"
)
private
String
buyStandard
;
/**
* 费率
*/
@Schema
(
description
=
"费率"
)
private
BigDecimal
rate
;
/**
* 计费方式
*/
@Schema
(
description
=
"计费方式(0:按天,1:按月)"
)
private
Integer
billingType
;
/**
* 医疗额度
*/
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/entity/TInsuranceSettleCancel.java
0 → 100644
View file @
183a80ba
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
entity
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 结算信息作废记录表(用于记录项目变更导致推信息送至EKP)
* @TableName t_insurance_settle_cancel
*/
@Data
@Tag
(
name
=
"结算信息作废记录"
)
public
class
TInsuranceSettleCancel
implements
Serializable
{
/**
*
*/
private
String
id
;
/**
* 结算明细id
*/
private
String
insDetailId
;
/**
* 结算信息表id
*/
private
String
settleId
;
/**
* 项目编码
*/
private
String
deptNo
;
/**
* 项目名称
*/
private
String
deptName
;
/**
* 订单编号
*/
private
String
orderNo
;
/**
* 推送标识 1成功 0失败
*/
private
Integer
isCancelPush
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 操作人
*/
private
String
createUesr
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/util/LocalDateUtil.java
View file @
183a80ba
...
...
@@ -270,7 +270,37 @@ public class LocalDateUtil {
return
dif
;
}
/**
* 判断两个时间段是否有交集
*
* 思路:将有交集的情况列出,若不符合有交集的情况,则无交集
* 有交集的两种情况
* 1.第一个时间段的开始时间在第二个时间段的开始时间和结束时间当中
* 2.第二个时间段的开始时间在第一个时间段的开始时间和结束时间当中
*
* @author licancan
* @param leftStartDate 第一个时间段的开始时间
* @param leftEndDate 第一个时间段的结束时间
* @param rightStartDate 第二个时间段的开始时间
* @param rightEndDate 第二个时间段的结束时间
* @return {@link boolean} 若有交集, 返回true, 否则返回false
*/
public
static
boolean
hasOverlap
(
LocalDate
leftStartDate
,
LocalDate
leftEndDate
,
LocalDate
rightStartDate
,
LocalDate
rightEndDate
)
{
return
((
leftStartDate
.
equals
(
rightStartDate
)
||
leftStartDate
.
isAfter
(
rightStartDate
))
&&
leftStartDate
.
isBefore
(
rightEndDate
))
||
(
leftStartDate
.
isAfter
(
rightStartDate
)
&&
(
leftStartDate
.
equals
(
rightEndDate
)
||
leftStartDate
.
isBefore
(
rightEndDate
)))
||
((
rightStartDate
.
equals
(
leftStartDate
)
||
rightStartDate
.
isAfter
(
leftStartDate
))
&&
rightStartDate
.
isBefore
(
leftEndDate
))
||
(
rightStartDate
.
isAfter
(
leftStartDate
)
&&
(
rightStartDate
.
equals
(
leftEndDate
)
||
rightStartDate
.
isBefore
(
leftEndDate
)));
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
betweenMonth
(
"2022-10-03"
,
"2022-08-03"
));
boolean
hasOverlap
=
hasOverlap
(
parseLocalDate
(
"2022-08-03"
),
parseLocalDate
(
"2022-08-04"
),
parseLocalDate
(
"2022-08-03"
),
parseLocalDate
(
"2022-08-04"
));
System
.
out
.
println
(
hasOverlap
);
}
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceAddParam.java
View file @
183a80ba
...
...
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
* @author licancan
...
...
@@ -134,6 +135,18 @@ public class InsuranceAddParam implements Serializable {
@JsonIgnore
private
Long
insuranceTypeId
;
/**
* 费率
*/
@JsonIgnore
private
BigDecimal
rate
;
/**
* 计费方式
*/
@JsonIgnore
private
Integer
billingType
;
/**
* 商险购买地省code
*/
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceBatchParam.java
View file @
183a80ba
...
...
@@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
/**
...
...
@@ -130,6 +131,18 @@ public class InsuranceBatchParam implements Serializable {
@JsonIgnore
private
Long
insuranceTypeId
;
/**
* 费率
*/
@JsonIgnore
private
BigDecimal
rate
;
/**
* 计费方式
*/
@JsonIgnore
private
Integer
billingType
;
/**
* 商险购买地省code
*/
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/controller/TInsuranceDetailController.java
View file @
183a80ba
...
...
@@ -3,6 +3,9 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.Dept
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.*
;
...
...
@@ -11,7 +14,6 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.security.core.userdetails.User
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -37,6 +39,21 @@ public class TInsuranceDetailController {
/***********************商险办理********************************/
/**
* 每日定时刷新商险到期数据
*
* @author licancan
* @param
* @return void
*/
@Operation
(
summary
=
"每日定时刷新商险到期数据"
,
description
=
"每日定时刷新商险到期数据"
)
@SysLog
(
"每日定时刷新商险到期数据"
)
@Inner
@GetMapping
(
"/inner/updateOverdueByTask"
)
public
void
updateOverdueByTask
()
{
tInsuranceDetailService
.
updateOverdueByTask
();
}
/**
* EKP2INSURANCES 更新结算状态
*
...
...
@@ -409,14 +426,25 @@ public class TInsuranceDetailController {
* 出险
*
* @author zhaji
* @param userName 姓名
* @param empIdcardNo 身份证
* @return {@link R<List< RefundExportListVo >>}
*/
@Operation
(
summary
=
"紧急出险"
,
description
=
"紧急出险"
)
@GetMapping
(
"/urgentUpdateIsUse"
)
public
R
urgentUpdateIsUse
(
String
userName
,
String
empIdcardNo
)
{
return
tInsuranceDetailService
.
urgentUpdateIsUse
(
userName
,
empIdcardNo
);
public
R
urgentUpdateIsUse
(
String
empIdcardNo
)
{
return
tInsuranceDetailService
.
urgentUpdateIsUse
(
empIdcardNo
);
}
/**
* 根据身份证查询所有的商险列表
*
* @author huyc
* @return
*/
@Operation
(
summary
=
"根据身份证查询所有的商险列表"
,
description
=
"根据身份证查询所有的商险列表"
)
@PostMapping
(
"/getInsuranceListByIdCard"
)
public
R
<
IPage
<
TInsuranceDetail
>>
getInsuranceListByIdCard
(
Page
<
TInsuranceDetail
>
page
,
@RequestParam
String
idCard
)
{
return
new
R
<>(
tInsuranceDetailService
.
getInsuranceListByIdCard
(
page
,
idCard
));
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/controller/TInsuranceTypeController.java
View file @
183a80ba
...
...
@@ -41,8 +41,8 @@ public class TInsuranceTypeController {
* @return
*/
@Operation
(
summary
=
"分页查询"
,
description
=
"分页查询"
)
@
Pos
tMapping
(
"/page"
)
public
R
<
IPage
<
InsuranceTypeVo
>>
getInsuranceTypePage
(
Page
<
TInsuranceType
>
page
,
@RequestBody
TInsuranceType
insuranceType
)
{
@
Ge
tMapping
(
"/page"
)
public
R
<
IPage
<
InsuranceTypeVo
>>
getInsuranceTypePage
(
Page
<
TInsuranceType
>
page
,
TInsuranceType
insuranceType
)
{
return
R
.
ok
(
insuranceTypeService
.
pageDiy
(
page
,
insuranceType
));
}
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/mapper/TInsuranceDetailMapper.java
View file @
183a80ba
...
...
@@ -168,4 +168,13 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
* @return {@link List< RefundExportListVo>}
*/
List
<
RefundExportListVo
>
getRefundExportList
(
@Param
(
"param"
)
RefundExportListParam
param
);
/**
* 根据身份证查询商险信息
* @param idCard 身份证号
* @author huyc
* @date 2022-08-01
* @return
*/
IPage
<
TInsuranceDetail
>
getInsuranceListByIdCard
(
Page
<
TInsuranceDetail
>
page
,
@Param
(
"idCard"
)
String
idCard
);
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/mapper/TInsuranceSettleCancelMapper.java
0 → 100644
View file @
183a80ba
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettleCancel
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @author Administrator
* @description 针对表【t_insurance_settle_cancel(结算信息作废记录表(用于记录项目变更导致推信息送至EKP))】的数据库操作Mapper
* @createDate 2022-08-01 11:37:54
* @Entity generator.domain.TInsuranceSettleCancel
*/
@Mapper
public
interface
TInsuranceSettleCancelMapper
extends
BaseMapper
<
TInsuranceSettleCancel
>
{
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/TInsuranceDetailService.java
View file @
183a80ba
...
...
@@ -19,6 +19,15 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
/***********************商险办理********************************/
/**
* 每日定时刷新商险到期数据
*
* @author licancan
* @param
* @return void
*/
void
updateOverdueByTask
();
/**
* EKP2INSURANCES 更新结算状态
*
...
...
@@ -280,10 +289,18 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* EKP紧急出险
*
* @author zhaji
* @param userName
* @param empIdcardNo
* @return {@link R}
*/
R
urgentUpdateIsUse
(
String
userName
,
String
empIdcardNo
);
R
urgentUpdateIsUse
(
String
empIdcardNo
);
/**
* 根据身份证查询商险列表
*
* @author huyc
* @param
* @return {@link R}
*/
IPage
<
TInsuranceDetail
>
getInsuranceListByIdCard
(
Page
<
TInsuranceDetail
>
page
,
String
idCard
);
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/TInsuranceSettleCancelService.java
0 → 100644
View file @
183a80ba
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettleCancel
;
/**
* @author Administrator
* @description 针对表【t_insurance_settle_cancel(结算信息作废记录表(用于记录项目变更导致推信息送至EKP))】的数据库操作Service
* @createDate 2022-08-01 11:37:54
*/
public
interface
TInsuranceSettleCancelService
extends
IService
<
TInsuranceSettleCancel
>
{
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceCompanyServiceImpl.java
View file @
183a80ba
...
...
@@ -75,7 +75,10 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
return
R
.
failed
(
"计费方式格式不正确"
);
}
if
(!
ValidityUtil
.
validate60
(
insuranceCompany
.
getCompanyName
())){
return
R
.
failed
(
"保险公司名称过长"
);
return
R
.
failed
(
"保险公司名称格式不正确"
);
}
if
(!
ValidityUtil
.
validate50
(
insuranceCompany
.
getCompanyAddress
())){
return
R
.
failed
(
"保险公司地址格式不正确"
);
}
boolean
b
=
companyIsExists
(
insuranceCompany
.
getCompanyName
());
if
(!
b
){
...
...
@@ -84,7 +87,7 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
insuranceCompany
.
setCreateTime
(
LocalDateTime
.
now
());
insuranceCompany
.
setDeleteFlag
(
CommonConstants
.
ZERO_INT
);
save
(
insuranceCompany
);
addOperate
(
insuranceCompany
,
user
,
InsurancesConstants
.
DELETE
_INSURANCE_COMPANY
);
addOperate
(
insuranceCompany
,
user
,
InsurancesConstants
.
NEW
_INSURANCE_COMPANY
);
return
R
.
ok
(
"新增成功"
);
}
else
{
return
R
.
failed
(
"保险公司名称不能重复添加"
);
...
...
@@ -109,6 +112,9 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
if
(!
CommonConstants
.
ZERO_STRING
.
equals
(
billingType
)
&&
!
CommonConstants
.
ONE_STRING
.
equals
(
billingType
)){
return
R
.
failed
(
"计费方式格式不正确"
);
}
if
(!
ValidityUtil
.
validate50
(
insuranceCompany
.
getCompanyAddress
())){
return
R
.
failed
(
"保险公司地址格式不正确"
);
}
LambdaQueryWrapper
<
TInsuranceCompany
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
TInsuranceCompany:
:
getId
,
id
).
eq
(
TInsuranceCompany:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
);
TInsuranceCompany
one
=
this
.
getOne
(
queryWrapper
);
...
...
@@ -117,8 +123,8 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
}
String
companyName
=
one
.
getCompanyName
();
String
newCompanyName
=
insuranceCompany
.
getCompanyName
();
if
(
newCompanyName
.
length
()>
CommonConstants
.
SIXTY_INT
){
return
R
.
failed
(
"要修改的保险公司名称
过长
"
);
if
(
!
ValidityUtil
.
validate60
(
newCompanyName
)
){
return
R
.
failed
(
"要修改的保险公司名称
格式不正确
"
);
}
//如果当前保险公司名称和修改后的名称不同
if
(!
companyName
.
equals
(
insuranceCompany
.
getCompanyName
())){
...
...
@@ -133,9 +139,11 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
//校验新的保险公司名称在数据库中是否存在
boolean
b
=
companyIsExists
(
insuranceCompany
.
getCompanyName
());
if
(
b
){
return
R
.
failed
(
"
当前保险公司名称已存在
"
);
return
R
.
failed
(
"
保险公司名称不能重复
"
);
}
else
{
return
R
.
ok
(
updateById
(
insuranceCompany
));
updateById
(
insuranceCompany
);
addOperate
(
insuranceCompany
,
user
,
InsurancesConstants
.
NEW_INSURANCE_COMPANY
);
return
R
.
ok
(
"修改保险信息公司成功"
);
}
}
}
else
{
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
183a80ba
...
...
@@ -80,6 +80,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
/***********************商险办理********************************/
/**
* 每日定时刷新商险到期数据
*
* @return void
* @author licancan
*/
@Override
public
void
updateOverdueByTask
()
{
//todo
}
/**
* EKP2INSURANCES 更新结算状态
*
...
...
@@ -421,6 +432,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(!
Optional
.
ofNullable
(
insuranceCompany
).
isPresent
()){
return
R
.
failed
(
InsurancesConstants
.
INSURANCE_COMPANY_NAME_NOT_EXIST
);
}
else
{
//冗余保险公司计费方式
byId
.
setBillingType
(
Integer
.
valueOf
(
insuranceCompany
.
getBillingType
()));
TInsuranceType
insuranceType
=
tInsuranceTypeService
.
getOne
(
Wrappers
.<
TInsuranceType
>
query
().
lambda
()
.
eq
(
TInsuranceType:
:
getName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
...
...
@@ -429,6 +443,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(!
Optional
.
ofNullable
(
insuranceType
).
isPresent
()){
return
R
.
failed
(
InsurancesConstants
.
INSURANCE_TYPE_NAME_NOT_EXIST
);
}
else
{
//购买标准
TInsuranceTypeStandard
typeStandard
=
tInsuranceTypeStandardService
.
getOne
(
Wrappers
.<
TInsuranceTypeStandard
>
query
().
lambda
()
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandard
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
...
...
@@ -443,6 +458,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param
.
setDieDisableQuota
(
typeStandard
.
getDieDisableQuota
());
param
.
setInsuranceTypeId
(
Long
.
parseLong
(
typeStandard
.
getInsuranceTypeId
()));
}
//按月查费率
if
(
CommonConstants
.
ONE_STRING
.
equals
(
insuranceCompany
.
getBillingType
())){
//计算起止时间的月数
long
month
=
LocalDateUtil
.
betweenMonth
(
param
.
getPolicyStart
(),
param
.
getPolicyEnd
());
TInsuranceTypeRate
typeRate
=
tInsuranceTypeRateService
.
getOne
(
Wrappers
.<
TInsuranceTypeRate
>
query
().
lambda
()
.
eq
(
TInsuranceTypeRate:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeRate:
:
getMonth
,
month
)
.
eq
(
TInsuranceTypeRate:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeRate
).
isPresent
()){
return
R
.
failed
(
InsurancesConstants
.
INSURANCE_TYPE_RATE_NOT_EXIST
);
}
else
{
//冗余费率
byId
.
setRate
(
new
BigDecimal
(
typeRate
.
getRate
()));
}
}
}
}
//记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 + 保单开始日期~保单结束日期区间 是唯一(剔除退回、过期状态的记录)
...
...
@@ -718,102 +751,69 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//根据结算类型判断是否需要计算预估保费
//预估
if
(
detail
.
getSettleType
()
==
CommonConstants
.
ZERO_INT
){
//根据险种获取费率,没费率返回错误
TInsuranceType
insuranceType
=
tInsuranceTypeService
.
getById
(
detail
.
getInsuranceTypeId
());
//险种存不存在
if
(!
Optional
.
ofNullable
(
insuranceType
).
isPresent
()){
InsuranceListVO
listVO
=
new
InsuranceListVO
();
BeanCopyUtils
.
copyProperties
(
detail
,
listVO
);
listVO
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_TYPE_NAME_NOT_EXIST
);
errorList
.
add
(
listVO
);
if
(
CommonConstants
.
ONE_INT
==
detail
.
getBillingType
()){
// 按月查费率
// 预估保费 = 费率 * 购买标准
BigDecimal
estimatePremium
=
new
BigDecimal
(
detail
.
getBuyStandard
()).
multiply
(
detail
.
getRate
()).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
detail
.
setEstimatePremium
(
estimatePremium
);
if
(
detail
.
getBuyType
()
==
CommonConstants
.
THREE_INT
){
detail
.
setPolicyEffect
(
LocalDate
.
now
().
plusDays
(
CommonConstants
.
ONE_INT
));
}
//记录状态均置为「已投保」
detail
.
setBuyHandleStatus
(
CommonConstants
.
THREE_INT
);
detail
.
setSignFlag
(
CommonConstants
.
ONE_INT
);
//记录的有效状态,置为「有效」
detail
.
setIsEffect
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsOverdue
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsUse
(
CommonConstants
.
ZERO_INT
);
//保费存储
TInsuranceSettle
settle
=
new
TInsuranceSettle
();
settle
.
setInsDetailId
(
detail
.
getId
());
settle
.
setSettleType
(
detail
.
getSettleType
());
settle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
settle
.
setEstimatePremium
(
estimatePremium
);
//调完ekp接口才会是1
settle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
settle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
settle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
settle
);
detail
.
setDefaultSettleId
(
settle
.
getId
());
successList
.
add
(
detail
);
}
else
{
TInsuranceCompany
insuranceCompany
=
tInsuranceCompanyService
.
getById
(
insuranceType
.
getInsuranceCompanyId
());
//保险公司存不存在
if
(!
Optional
.
ofNullable
(
insuranceCompany
).
isPresent
()){
InsuranceListVO
listVO
=
new
InsuranceListVO
();
BeanCopyUtils
.
copyProperties
(
detail
,
listVO
);
listVO
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_COMPANY_NAME_NOT_EXIST
);
errorList
.
add
(
listVO
);
}
else
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
insuranceCompany
.
getBillingType
())){
//按月查费率
//计算起止时间的月数
long
month
=
LocalDateUtil
.
betweenMonth
(
detail
.
getPolicyStart
().
toString
(),
detail
.
getPolicyEnd
().
toString
());
TInsuranceTypeRate
typeRate
=
tInsuranceTypeRateService
.
getOne
(
Wrappers
.<
TInsuranceTypeRate
>
query
().
lambda
()
.
eq
(
TInsuranceTypeRate:
:
getInsuranceTypeId
,
detail
.
getInsuranceTypeId
())
.
eq
(
TInsuranceTypeRate:
:
getMonth
,
month
)
.
eq
(
TInsuranceTypeRate:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeRate
).
isPresent
()){
InsuranceListVO
listVO
=
new
InsuranceListVO
();
BeanCopyUtils
.
copyProperties
(
detail
,
listVO
);
listVO
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_TYPE_RATE_NOT_EXIST
);
errorList
.
add
(
listVO
);
}
else
{
// 预估保费 = 费率 * 购买标准
BigDecimal
estimatePremium
=
new
BigDecimal
(
detail
.
getBuyStandard
()).
multiply
(
new
BigDecimal
(
typeRate
.
getRate
())).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
detail
.
setEstimatePremium
(
estimatePremium
);
if
(
detail
.
getBuyType
()
==
CommonConstants
.
THREE_INT
){
detail
.
setPolicyEffect
(
LocalDate
.
now
().
plusDays
(
CommonConstants
.
ONE_INT
));
}
//记录状态均置为「已投保」
detail
.
setBuyHandleStatus
(
CommonConstants
.
THREE_INT
);
detail
.
setSignFlag
(
CommonConstants
.
ONE_INT
);
//记录的有效状态,置为「有效」
detail
.
setIsEffect
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsOverdue
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsUse
(
CommonConstants
.
ZERO_INT
);
//保费存储
TInsuranceSettle
settle
=
new
TInsuranceSettle
();
settle
.
setInsDetailId
(
detail
.
getId
());
settle
.
setSettleType
(
detail
.
getSettleType
());
settle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
settle
.
setEstimatePremium
(
estimatePremium
);
//调完ekp接口才会是1
settle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
settle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
settle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
settle
);
detail
.
setDefaultSettleId
(
settle
.
getId
());
successList
.
add
(
detail
);
}
}
else
{
//按天
//计算起止时间的天数
long
day
=
LocalDateUtil
.
betweenDay
(
detail
.
getPolicyStart
().
toString
(),
detail
.
getPolicyEnd
().
toString
());
//预估保费 = (购买标准 / 365) * 天数
BigDecimal
estimatePremium
=
new
BigDecimal
(
detail
.
getBuyStandard
()).
divide
(
new
BigDecimal
(
"365"
),
CommonConstants
.
TWO_INT
,
BigDecimal
.
ROUND_HALF_UP
).
multiply
(
new
BigDecimal
(
day
)).
setScale
(
CommonConstants
.
TWO_INT
,
BigDecimal
.
ROUND_HALF_UP
);
detail
.
setEstimatePremium
(
estimatePremium
);
if
(
detail
.
getBuyType
()
==
CommonConstants
.
THREE_INT
){
detail
.
setPolicyEffect
(
LocalDate
.
now
().
plusDays
(
CommonConstants
.
ONE_INT
));
}
//记录状态均置为「已投保」
detail
.
setBuyHandleStatus
(
CommonConstants
.
THREE_INT
);
detail
.
setSignFlag
(
CommonConstants
.
ONE_INT
);
//记录的有效状态,置为「有效」
detail
.
setIsEffect
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsOverdue
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsUse
(
CommonConstants
.
ZERO_INT
);
//保费存储
TInsuranceSettle
settle
=
new
TInsuranceSettle
();
settle
.
setInsDetailId
(
detail
.
getId
());
settle
.
setSettleType
(
detail
.
getSettleType
());
settle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
settle
.
setEstimatePremium
(
estimatePremium
);
//调完ekp接口才会是1
settle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
settle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
settle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
settle
);
detail
.
setDefaultSettleId
(
settle
.
getId
());
successList
.
add
(
detail
);
}
//按天
//计算起止时间的天数
long
day
=
LocalDateUtil
.
betweenDay
(
detail
.
getPolicyStart
().
toString
(),
detail
.
getPolicyEnd
().
toString
());
//预估保费 = (购买标准 / 365) * 天数
BigDecimal
estimatePremium
=
new
BigDecimal
(
detail
.
getBuyStandard
()).
divide
(
new
BigDecimal
(
"365"
),
CommonConstants
.
TWO_INT
,
BigDecimal
.
ROUND_HALF_UP
).
multiply
(
new
BigDecimal
(
day
)).
setScale
(
CommonConstants
.
TWO_INT
,
BigDecimal
.
ROUND_HALF_UP
);
detail
.
setEstimatePremium
(
estimatePremium
);
if
(
detail
.
getBuyType
()
==
CommonConstants
.
THREE_INT
){
detail
.
setPolicyEffect
(
LocalDate
.
now
().
plusDays
(
CommonConstants
.
ONE_INT
));
}
//记录状态均置为「已投保」
detail
.
setBuyHandleStatus
(
CommonConstants
.
THREE_INT
);
detail
.
setSignFlag
(
CommonConstants
.
ONE_INT
);
//记录的有效状态,置为「有效」
detail
.
setIsEffect
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsOverdue
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsUse
(
CommonConstants
.
ZERO_INT
);
//保费存储
TInsuranceSettle
settle
=
new
TInsuranceSettle
();
settle
.
setInsDetailId
(
detail
.
getId
());
settle
.
setSettleType
(
detail
.
getSettleType
());
settle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
settle
.
setEstimatePremium
(
estimatePremium
);
//调完ekp接口才会是1
settle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
settle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
settle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
settle
);
detail
.
setDefaultSettleId
(
settle
.
getId
());
successList
.
add
(
detail
);
}
}
//实缴
...
...
@@ -945,7 +945,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map
<
String
,
List
<
InsuranceAddParam
>>
map
=
new
HashMap
<>();
List
<
InsuranceAddParam
>
listResult
=
new
ArrayList
<>();
List
<
InsuranceAddParam
>
listSuccess
=
new
ArrayList
<>();
for
(
InsuranceAddParam
param
:
paramList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
()))
{
List
<
InsuranceAddParam
>
distinctList
=
paramList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
//定义外层循环标识,方便去重的时候跳出
outer:
for
(
int
i
=
0
;
i
<
distinctList
.
size
();
i
++)
{
InsuranceAddParam
param
=
distinctList
.
get
(
i
);
// 必填校验
if
(
StringUtils
.
isBlank
(
param
.
getEmpName
())){
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_NAME_NOT_EMPTY
);
...
...
@@ -1043,6 +1047,44 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
// 保单开始日期 > 当前派单日期
if
(!
LocalDateUtil
.
isDate
(
param
.
getPolicyStart
(),
LocalDateUtil
.
NORM_DATE_PATTERN
)){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_START_PARSE_ERROR
);
listResult
.
add
(
param
);
continue
;
}
if
(!
LocalDateUtil
.
isDate
(
param
.
getPolicyEnd
(),
LocalDateUtil
.
NORM_DATE_PATTERN
)){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_END_PARSE_ERROR
);
listResult
.
add
(
param
);
continue
;
}
if
(!
LocalDateUtil
.
isFutureDate
(
param
.
getPolicyStart
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_START_SHOULD_IS_FUTURE
);
listResult
.
add
(
param
);
continue
;
}
if
(!
LocalDateUtil
.
compareDate
(
param
.
getPolicyStart
(),
param
.
getPolicyEnd
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_START_SHOULD_LESS_THAN_POLICY_END
);
listResult
.
add
(
param
);
continue
;
}
//表内数据重复 员工姓名、员工身份证号码、保险公司、险种、起止时间(有交叉)
for
(
int
j
=
0
;
j
<
distinctList
.
size
();
j
++)
{
InsuranceAddParam
repeat
=
distinctList
.
get
(
j
);
if
(
param
.
getEmpName
().
equals
(
repeat
.
getEmpName
())
&&
param
.
getEmpIdcardNo
().
equals
(
repeat
.
getEmpIdcardNo
())
&&
param
.
getInsuranceCompanyName
().
equals
(
repeat
.
getInsuranceCompanyName
())
&&
param
.
getInsuranceTypeName
().
equals
(
repeat
.
getInsuranceTypeName
())
&&
LocalDateUtil
.
hasOverlap
(
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()),
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
()),
LocalDateUtil
.
parseLocalDate
(
repeat
.
getPolicyStart
()),
LocalDateUtil
.
parseLocalDate
(
repeat
.
getPolicyEnd
()))
&&
i
!=
j
){
param
.
setErrorMessage
(
InsurancesConstants
.
DUPLICATE_DATA_ERROR
);
listResult
.
add
(
param
);
continue
outer
;
}
}
//校验身份合法
/*TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
...
...
@@ -1119,28 +1161,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param
.
setInsuranceHandleCity
(
Integer
.
parseInt
(
redisHandleCityName
));
}
// 保单开始日期 > 当前派单日期
if
(!
LocalDateUtil
.
isDate
(
param
.
getPolicyStart
(),
LocalDateUtil
.
NORM_DATE_PATTERN
)){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_START_PARSE_ERROR
);
listResult
.
add
(
param
);
continue
;
}
if
(!
LocalDateUtil
.
isDate
(
param
.
getPolicyEnd
(),
LocalDateUtil
.
NORM_DATE_PATTERN
)){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_END_PARSE_ERROR
);
listResult
.
add
(
param
);
continue
;
}
if
(!
LocalDateUtil
.
isFutureDate
(
param
.
getPolicyStart
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_START_SHOULD_IS_FUTURE
);
listResult
.
add
(
param
);
continue
;
}
if
(!
LocalDateUtil
.
compareDate
(
param
.
getPolicyStart
(),
param
.
getPolicyEnd
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_START_SHOULD_LESS_THAN_POLICY_END
);
listResult
.
add
(
param
);
continue
;
}
// 保险公司-险种-购买标准 是否存在
TInsuranceCompany
insuranceCompany
=
tInsuranceCompanyService
.
getOne
(
Wrappers
.<
TInsuranceCompany
>
query
().
lambda
()
.
eq
(
TInsuranceCompany:
:
getCompanyName
,
param
.
getInsuranceCompanyName
())
...
...
@@ -1151,6 +1171,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
else
{
//冗余保险公司计费方式
param
.
setBillingType
(
Integer
.
valueOf
(
insuranceCompany
.
getBillingType
()));
TInsuranceType
insuranceType
=
tInsuranceTypeService
.
getOne
(
Wrappers
.<
TInsuranceType
>
query
().
lambda
()
.
eq
(
TInsuranceType:
:
getName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
...
...
@@ -1161,6 +1184,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
else
{
//购买标准
TInsuranceTypeStandard
typeStandard
=
tInsuranceTypeStandardService
.
getOne
(
Wrappers
.<
TInsuranceTypeStandard
>
query
().
lambda
()
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandard
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
...
...
@@ -1177,6 +1201,26 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param
.
setDieDisableQuota
(
typeStandard
.
getDieDisableQuota
());
param
.
setInsuranceTypeId
(
Long
.
parseLong
(
typeStandard
.
getInsuranceTypeId
()));
}
//按月查费率
if
(
CommonConstants
.
ONE_STRING
.
equals
(
insuranceCompany
.
getBillingType
())){
//计算起止时间的月数
long
month
=
LocalDateUtil
.
betweenMonth
(
param
.
getPolicyStart
(),
param
.
getPolicyEnd
());
TInsuranceTypeRate
typeRate
=
tInsuranceTypeRateService
.
getOne
(
Wrappers
.<
TInsuranceTypeRate
>
query
().
lambda
()
.
eq
(
TInsuranceTypeRate:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeRate:
:
getMonth
,
month
)
.
eq
(
TInsuranceTypeRate:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeRate
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_TYPE_RATE_NOT_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
//冗余费率
param
.
setRate
(
new
BigDecimal
(
typeRate
.
getRate
()));
}
}
}
}
...
...
@@ -1273,7 +1317,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map
<
String
,
List
<
InsuranceBatchParam
>>
map
=
new
HashMap
<>();
List
<
InsuranceBatchParam
>
listResult
=
new
ArrayList
<>();
List
<
InsuranceBatchParam
>
listSuccess
=
new
ArrayList
<>();
for
(
InsuranceBatchParam
param
:
paramList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
()))
{
List
<
InsuranceBatchParam
>
distinctList
=
paramList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
//定义外层循环标识,方便去重的时候跳出
outer:
for
(
int
i
=
0
;
i
<
distinctList
.
size
();
i
++)
{
InsuranceBatchParam
param
=
distinctList
.
get
(
i
);
// 必填校验
if
(
StringUtils
.
isBlank
(
param
.
getDeptNo
())){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_NOT_EMPTY
);
...
...
@@ -1364,6 +1412,20 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue
;
}
//表内数据重复 员工姓名、员工身份证号码、保险公司、险种
for
(
int
j
=
0
;
j
<
distinctList
.
size
();
j
++)
{
InsuranceBatchParam
repeat
=
distinctList
.
get
(
j
);
if
(
param
.
getEmpName
().
equals
(
repeat
.
getEmpName
())
&&
param
.
getEmpIdcardNo
().
equals
(
repeat
.
getEmpIdcardNo
())
&&
param
.
getInsuranceCompanyName
().
equals
(
repeat
.
getInsuranceCompanyName
())
&&
param
.
getInsuranceTypeName
().
equals
(
repeat
.
getInsuranceTypeName
())
&&
i
!=
j
){
param
.
setErrorMessage
(
InsurancesConstants
.
DUPLICATE_DATA_ERROR
);
listResult
.
add
(
param
);
continue
outer
;
}
}
//校验身份合法
/*TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
...
...
@@ -1440,6 +1502,32 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param
.
setInsuranceHandleCity
(
Integer
.
parseInt
(
redisHandleCityName
));
}
//保单开始日期、结束日期,由系统根据保单号关联查询投保状态为 "已投保" 的商险记录的任意一条
TInsuranceDetail
limitOne
=
this
.
baseMapper
.
selectOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
.
eq
(
TInsuranceDetail:
:
getPolicyNo
,
param
.
getPolicyNo
())
.
eq
(
TInsuranceDetail:
:
getBuyHandleStatus
,
CommonConstants
.
THREE_INT
)
//有效
.
and
(
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsEffect
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsEffect
)
)
//未过期
.
and
(
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsOverdue
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsOverdue
)
)
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
limitOne
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_NO_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
param
.
setPolicyStart
(
limitOne
.
getPolicyStart
());
param
.
setPolicyEnd
(
limitOne
.
getPolicyEnd
());
}
// 保险公司-险种-购买标准 是否存在
TInsuranceCompany
insuranceCompany
=
tInsuranceCompanyService
.
getOne
(
Wrappers
.<
TInsuranceCompany
>
query
().
lambda
()
.
eq
(
TInsuranceCompany:
:
getCompanyName
,
param
.
getInsuranceCompanyName
())
...
...
@@ -1450,6 +1538,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
else
{
//冗余保险公司计费方式
param
.
setBillingType
(
Integer
.
valueOf
(
insuranceCompany
.
getBillingType
()));
TInsuranceType
insuranceType
=
tInsuranceTypeService
.
getOne
(
Wrappers
.<
TInsuranceType
>
query
().
lambda
()
.
eq
(
TInsuranceType:
:
getName
,
param
.
getInsuranceTypeName
())
.
eq
(
TInsuranceType:
:
getInsuranceCompanyId
,
insuranceCompany
.
getId
())
...
...
@@ -1460,6 +1551,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
else
{
//购买标准
TInsuranceTypeStandard
typeStandard
=
tInsuranceTypeStandardService
.
getOne
(
Wrappers
.<
TInsuranceTypeStandard
>
query
().
lambda
()
.
eq
(
TInsuranceTypeStandard:
:
getBuyStandard
,
param
.
getBuyStandard
())
.
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
...
...
@@ -1476,9 +1568,41 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param
.
setDieDisableQuota
(
typeStandard
.
getDieDisableQuota
());
param
.
setInsuranceTypeId
(
Long
.
parseLong
(
typeStandard
.
getInsuranceTypeId
()));
}
//按月查费率
if
(
CommonConstants
.
ONE_STRING
.
equals
(
insuranceCompany
.
getBillingType
())){
//计算起止时间的月数
long
month
=
LocalDateUtil
.
betweenMonth
(
param
.
getPolicyStart
().
toString
(),
param
.
getPolicyEnd
().
toString
());
TInsuranceTypeRate
typeRate
=
tInsuranceTypeRateService
.
getOne
(
Wrappers
.<
TInsuranceTypeRate
>
query
().
lambda
()
.
eq
(
TInsuranceTypeRate:
:
getInsuranceTypeId
,
insuranceType
.
getId
())
.
eq
(
TInsuranceTypeRate:
:
getMonth
,
month
)
.
eq
(
TInsuranceTypeRate:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeRate
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_TYPE_RATE_NOT_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
//冗余费率
param
.
setRate
(
new
BigDecimal
(
typeRate
.
getRate
()));
}
}
}
}
if
(!
limitOne
.
getInsuranceCompanyName
().
equals
(
param
.
getInsuranceCompanyName
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_NO_COMPANY_NAME_NOT_SAME
);
listResult
.
add
(
param
);
continue
;
}
if
(!
limitOne
.
getInsuranceTypeName
().
equals
(
param
.
getInsuranceTypeName
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_NO_TYPE_NAME_NOT_SAME
);
listResult
.
add
(
param
);
continue
;
}
// 结算月份 >= 派单月份(结算月 < 派单月份的记录予以拦截,并提示)
if
(!
LocalDateUtil
.
isDate
(
param
.
getSettleMonth
(),
LocalDateUtil
.
NORM_MONTH_PATTERN
)){
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_PARSE_ERROR
);
...
...
@@ -1520,41 +1644,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
//保单开始日期、结束日期,由系统根据保单号关联查询投保状态为 "已投保" 的商险记录的任意一条
TInsuranceDetail
limitOne
=
this
.
baseMapper
.
selectOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
.
eq
(
TInsuranceDetail:
:
getPolicyNo
,
param
.
getPolicyNo
())
.
eq
(
TInsuranceDetail:
:
getBuyHandleStatus
,
CommonConstants
.
THREE_INT
)
//有效
.
and
(
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsEffect
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsEffect
)
)
//未过期
.
and
(
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsOverdue
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsOverdue
)
)
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
limitOne
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_NO_EXIST
);
listResult
.
add
(
param
);
continue
;
}
else
{
if
(!
limitOne
.
getInsuranceCompanyName
().
equals
(
param
.
getInsuranceCompanyName
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_NO_COMPANY_NAME_NOT_SAME
);
listResult
.
add
(
param
);
continue
;
}
else
if
(!
limitOne
.
getInsuranceTypeName
().
equals
(
param
.
getInsuranceTypeName
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_NO_TYPE_NAME_NOT_SAME
);
listResult
.
add
(
param
);
continue
;
}
else
{
param
.
setPolicyStart
(
limitOne
.
getPolicyStart
());
param
.
setPolicyEnd
(
limitOne
.
getPolicyEnd
());
}
}
listSuccess
.
add
(
param
);
}
map
.
put
(
"listResult"
,
listResult
);
...
...
@@ -1573,7 +1663,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map
<
String
,
List
<
InsuranceReplaceParam
>>
map
=
new
HashMap
<>();
List
<
InsuranceReplaceParam
>
listResult
=
new
ArrayList
<>();
List
<
InsuranceReplaceParam
>
listSuccess
=
new
ArrayList
<>();
for
(
InsuranceReplaceParam
param
:
paramList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
()))
{
List
<
InsuranceReplaceParam
>
distinctList
=
paramList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
//定义外层循环标识,方便去重的时候跳出
outer:
for
(
int
i
=
0
;
i
<
distinctList
.
size
();
i
++)
{
InsuranceReplaceParam
param
=
distinctList
.
get
(
i
);
// 必填校验
if
(
StringUtils
.
isBlank
(
param
.
getEmpName
())){
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_NAME_NOT_EMPTY
);
...
...
@@ -1648,6 +1742,38 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
if
(!
LocalDateUtil
.
isDate
(
param
.
getPolicyStart
(),
LocalDateUtil
.
NORM_DATE_PATTERN
)){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_START_PARSE_ERROR
);
listResult
.
add
(
param
);
continue
;
}
if
(!
LocalDateUtil
.
isDate
(
param
.
getPolicyEnd
(),
LocalDateUtil
.
NORM_DATE_PATTERN
)){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_END_PARSE_ERROR
);
listResult
.
add
(
param
);
continue
;
}
if
(!
LocalDateUtil
.
compareDate
(
param
.
getPolicyStart
(),
param
.
getPolicyEnd
())){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_START_SHOULD_LESS_THAN_POLICY_END
);
listResult
.
add
(
param
);
continue
;
}
//表内数据重复 员工姓名、员工身份证号码、保险公司、险种、起止时间(有交叉)
for
(
int
j
=
0
;
j
<
distinctList
.
size
();
j
++)
{
InsuranceReplaceParam
repeat
=
distinctList
.
get
(
j
);
if
(((
param
.
getEmpName
().
equals
(
repeat
.
getEmpName
())
&&
param
.
getEmpIdcardNo
().
equals
(
repeat
.
getEmpIdcardNo
()))
||(
param
.
getReplaceEmpName
().
equals
(
repeat
.
getReplaceEmpName
())
&&
param
.
getReplaceEmpIdcardNo
().
equals
(
repeat
.
getReplaceEmpIdcardNo
())))
&&
param
.
getInsuranceCompanyName
().
equals
(
repeat
.
getInsuranceCompanyName
())
&&
param
.
getInsuranceTypeName
().
equals
(
repeat
.
getInsuranceTypeName
())
&&
LocalDateUtil
.
hasOverlap
(
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()),
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
()),
LocalDateUtil
.
parseLocalDate
(
repeat
.
getPolicyStart
()),
LocalDateUtil
.
parseLocalDate
(
repeat
.
getPolicyEnd
()))
&&
i
!=
j
){
param
.
setErrorMessage
(
InsurancesConstants
.
DUPLICATE_DATA_ERROR
);
listResult
.
add
(
param
);
continue
outer
;
}
}
//校验身份合法
/*TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getReplaceEmpName());
...
...
@@ -1686,17 +1812,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
if
(!
LocalDateUtil
.
isDate
(
param
.
getPolicyStart
(),
LocalDateUtil
.
NORM_DATE_PATTERN
)){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_START_PARSE_ERROR
);
listResult
.
add
(
param
);
continue
;
}
if
(!
LocalDateUtil
.
isDate
(
param
.
getPolicyEnd
(),
LocalDateUtil
.
NORM_DATE_PATTERN
)){
param
.
setErrorMessage
(
InsurancesConstants
.
POLICY_END_PARSE_ERROR
);
listResult
.
add
(
param
);
continue
;
}
//原数据查重校验:姓名 + 身份证号 + 项目编码 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间
TInsuranceDetail
detail
=
this
.
baseMapper
.
selectOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
.
eq
(
TInsuranceDetail:
:
getEmpName
,
param
.
getEmpName
())
...
...
@@ -2529,6 +2644,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettle
.
setEstimatePremium
(
new
BigDecimal
(
"0"
));
tInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
tInsuranceSettle
);
//生成一条作废数据并推送至EKP
TInsuranceSettleCancel
tInsuranceSettleCancel
=
new
TInsuranceSettleCancel
();
tInsuranceSettleCancel
.
setInsDetailId
(
success
.
getId
());
tInsuranceSettleCancel
.
setSettleId
(
success
.
getDefaultSettleId
());
}
else
{
//更新预估保费
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
new
BigDecimal
(
"0"
));
...
...
@@ -2846,7 +2966,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
param
.
setId
(
one
.
getId
());
param
.
setReduceHandleStatus
(
one
.
getReduceHandleStatus
());
successList
.
add
(
param
);
boolean
b
=
successList
.
stream
().
anyMatch
(
u
->
u
.
getEmpName
().
equals
(
param
.
getEmpName
())
&&
u
.
getEmpIdcardNo
().
equals
(
param
.
getEmpIdcardNo
())
&&
u
.
getInsuranceCompanyName
().
equals
(
param
.
getInsuranceCompanyName
())
&&
u
.
getInsuranceTypeName
().
equals
(
param
.
getInsuranceTypeName
())
&&
u
.
getPolicyStart
().
equals
(
param
.
getPolicyStart
())
&&
u
.
getPolicyEnd
().
equals
(
param
.
getPolicyEnd
())
);
if
(!
b
){
successList
.
add
(
param
);
}
}
map
.
put
(
"successList"
,
successList
);
map
.
put
(
"errorList"
,
errorList
);
...
...
@@ -3037,22 +3167,31 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue
;
}
Integer
buyType
=
insuranceDetail
.
getBuyType
();
//替换类型无法变更结算月
if
(
CommonConstants
.
FOUR_INT
==
buyType
){
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_CHANGE_IS_EFFECT_ERROR
);
errorList
.
add
(
param
);
continue
;
}
Integer
buyHandleStatus
=
insuranceDetail
.
getBuyHandleStatus
();
//商险待投保,无法变更结算月
if
(
CommonConstants
.
ONE_INT
==
buyHandleStatus
){
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_CHANGE_BUY_STATUS_ONE_ERROR
);
errorList
.
add
(
param
);
continue
;
}
//商险投保中,无法变更结算月
if
(
CommonConstants
.
TWO_INT
==
buyHandleStatus
){
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_CHANGE_BUY_STATUS_TWO_ERROR
);
errorList
.
add
(
param
);
continue
;
}
//商险投保退回,无法变更结算月
if
(
CommonConstants
.
FOUR_INT
==
buyHandleStatus
){
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_CHANGE_BUY_STATUS_FOUR_ERROR
);
errorList
.
add
(
param
);
continue
;
}
//如果结算月份相同
if
(
settleMonth
.
equals
(
insuranceDetail
.
getSettleMonth
())){
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_IDENTICAL
);
...
...
@@ -3087,13 +3226,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
//当前保单信息的为已减员时不能变更结算月
if
(
null
!=
insuranceDetail
.
get
Buy
HandleStatus
()){
if
(
CommonConstants
.
F
IVE_INT
==
insuranceDetail
.
getBuy
HandleStatus
()
){
if
(
null
!=
insuranceDetail
.
get
Reduce
HandleStatus
()){
if
(
CommonConstants
.
F
OUR_INT
==
insuranceDetail
.
getReduce
HandleStatus
()
){
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_CHANGE_REFUND_STATUS_FOUR_ERROR
);
errorList
.
add
(
param
);
continue
;
}
if
(
CommonConstants
.
ONE_INT
==
insuranceDetail
.
getBuyHandleStatus
()
||
CommonConstants
.
TWO_INT
==
insuranceDetail
.
getBuyHandleStatus
()){
//减员流程中,无法变更结算月
if
(
CommonConstants
.
ONE_INT
==
insuranceDetail
.
getReduceHandleStatus
()
||
CommonConstants
.
TWO_INT
==
insuranceDetail
.
getReduceHandleStatus
()){
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_CHANGE_REFUND_STATUS_ONE_ERROR
);
errorList
.
add
(
param
);
continue
;
...
...
@@ -3117,7 +3258,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map
<
String
,
List
<
DeptChangeCheckParam
>>
map
=
new
HashMap
<>(
16
);
List
<
DeptChangeCheckParam
>
errorList
=
new
ArrayList
<>();
List
<
DeptChangeCheckParam
>
successList
=
new
ArrayList
<>();
for
(
DeptChangeCheckParam
param
:
deptChangeCheckList
)
{
for
(
int
i
=
0
;
i
<
deptChangeCheckList
.
size
();
i
++)
{
DeptChangeCheckParam
param
=
deptChangeCheckList
.
get
(
i
);
String
newDeptNo
=
param
.
getNewDeptNo
();
if
(
StringUtils
.
isBlank
(
newDeptNo
)){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_CHANGE_NOT_EMPTY
);
...
...
@@ -3159,7 +3301,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList
.
add
(
param
);
continue
;
}
//保单开始日期
String
policyStart
=
param
.
getPolicyStart
();
if
(
StringUtils
.
isBlank
(
policyStart
)){
...
...
@@ -3250,22 +3391,37 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue
;
}
Integer
buyHandleStatus
=
insuranceDetail
.
getBuyHandleStatus
();
//商险待投保,无法变更项目
if
(
CommonConstants
.
ONE_INT
==
buyHandleStatus
){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_CHANGE_BUY_STATUS_ONE_ERROR
);
errorList
.
add
(
param
);
continue
;
}
//商险投保中,无法变更项目
if
(
CommonConstants
.
TWO_INT
==
buyHandleStatus
){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_CHANGE_BUY_STATUS_TWO_ERROR
);
errorList
.
add
(
param
);
continue
;
}
//
当前保单信息的为已减员时,不能变更结算
项目
if
(
null
!=
insuranceDetail
.
getBuyHandleStatus
()
&&
CommonConstants
.
FIVE_INT
==
insuranceDetail
.
getBuyHandleStatus
()
){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_CHANGE_
REFUND
_STATUS_FOUR_ERROR
);
//
商险投保退回,无法变更
项目
if
(
CommonConstants
.
FOUR_INT
==
buyHandleStatus
){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_CHANGE_
BUY
_STATUS_FOUR_ERROR
);
errorList
.
add
(
param
);
continue
;
}
//当前保单信息的为已减员时,不能变更结算项目
if
(
null
!=
insuranceDetail
.
getReduceHandleStatus
()){
if
(
CommonConstants
.
FOUR_INT
==
insuranceDetail
.
getReduceHandleStatus
()){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_CHANGE_REFUND_STATUS_FOUR_ERROR
);
errorList
.
add
(
param
);
continue
;
}
if
(
CommonConstants
.
ONE_INT
==
insuranceDetail
.
getReduceHandleStatus
()
||
CommonConstants
.
TWO_INT
==
insuranceDetail
.
getReduceHandleStatus
()){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_CHANGE_REFUND_STATUS_ONE_ERROR
);
errorList
.
add
(
param
);
continue
;
}
}
String
defaultSettleId
=
insuranceDetail
.
getDefaultSettleId
();
if
(
StringUtils
.
isNotBlank
(
defaultSettleId
)){
//查询结算状态
...
...
@@ -3287,49 +3443,36 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//预估
if
(
param
.
getNewSettleType
()
==
CommonConstants
.
ZERO_INT
){
//根据险种获取费率,没费率返回错误
TInsuranceType
insuranceType
=
tInsuranceTypeService
.
getById
(
insuranceDetail
.
getInsuranceTypeId
());
//险种存不存在
if
(!
Optional
.
ofNullable
(
insuranceType
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_TYPE_NAME_NOT_EXIST
);
errorList
.
add
(
param
);
continue
;
//按月
if
(
CommonConstants
.
ONE_INT
==
insuranceDetail
.
getBillingType
()){
// 预估保费 = 费率 * 购买标准
BigDecimal
estimatePremium
=
new
BigDecimal
(
insuranceDetail
.
getBuyStandard
()).
multiply
(
insuranceDetail
.
getRate
()).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
param
.
setEstimatePremium
(
estimatePremium
);
}
else
{
TInsuranceCompany
insuranceCompany
=
tInsuranceCompanyService
.
getById
(
insuranceType
.
getInsuranceCompanyId
());
//保险公司存不存在
if
(!
Optional
.
ofNullable
(
insuranceCompany
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_COMPANY_NAME_NOT_EXIST
);
errorList
.
add
(
param
);
continue
;
}
else
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
insuranceCompany
.
getBillingType
())){
//按月查费率
//计算起止时间的月数
long
month
=
LocalDateUtil
.
betweenMonth
(
insuranceDetail
.
getPolicyStart
().
toString
(),
insuranceDetail
.
getPolicyEnd
().
toString
());
TInsuranceTypeRate
typeRate
=
tInsuranceTypeRateService
.
getOne
(
Wrappers
.<
TInsuranceTypeRate
>
query
().
lambda
()
.
eq
(
TInsuranceTypeRate:
:
getInsuranceTypeId
,
insuranceDetail
.
getInsuranceTypeId
())
.
eq
(
TInsuranceTypeRate:
:
getMonth
,
month
)
.
eq
(
TInsuranceTypeRate:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
typeRate
).
isPresent
()){
param
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_TYPE_RATE_NOT_EXIST
);
errorList
.
add
(
param
);
continue
;
}
else
{
// 预估保费 = 费率 * 购买标准
BigDecimal
estimatePremium
=
new
BigDecimal
(
insuranceDetail
.
getBuyStandard
()).
multiply
(
new
BigDecimal
(
typeRate
.
getRate
())).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
param
.
setEstimatePremium
(
estimatePremium
);
}
}
else
{
//按天
//计算起止时间的天数
long
day
=
LocalDateUtil
.
betweenDay
(
insuranceDetail
.
getPolicyStart
().
toString
(),
insuranceDetail
.
getPolicyEnd
().
toString
());
//预估保费 = (购买标准 / 365) * 天数
BigDecimal
estimatePremium
=
new
BigDecimal
(
insuranceDetail
.
getBuyStandard
()).
divide
(
new
BigDecimal
(
"365"
),
2
,
BigDecimal
.
ROUND_HALF_UP
).
multiply
(
new
BigDecimal
(
day
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
param
.
setEstimatePremium
(
estimatePremium
);
}
}
//按天
//计算起止时间的天数
long
day
=
LocalDateUtil
.
betweenDay
(
insuranceDetail
.
getPolicyStart
().
toString
(),
insuranceDetail
.
getPolicyEnd
().
toString
());
//预估保费 = (购买标准 / 365) * 天数
BigDecimal
estimatePremium
=
new
BigDecimal
(
insuranceDetail
.
getBuyStandard
()).
divide
(
new
BigDecimal
(
"365"
),
2
,
BigDecimal
.
ROUND_HALF_UP
).
multiply
(
new
BigDecimal
(
day
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
param
.
setEstimatePremium
(
estimatePremium
);
}
}
//如果
for
(
int
j
=
0
;
j
<
deptChangeCheckList
.
size
();
j
++)
{
DeptChangeCheckParam
CheckParam
=
deptChangeCheckList
.
get
(
j
);
if
(
CheckParam
.
getEmpName
().
equals
(
param
.
getEmpName
())
&&
CheckParam
.
getEmpIdCardNo
().
equals
(
param
.
getEmpIdCardNo
())
&&
CheckParam
.
getOldDeptNo
().
equals
(
param
.
getOldDeptNo
())
&&
CheckParam
.
getInsuranceTypeName
().
equals
(
param
.
getInsuranceTypeName
())
&&
CheckParam
.
getInsuranceCompanyName
().
equals
(
param
.
getInsuranceCompanyName
())
&&
CheckParam
.
getPolicyStart
().
equals
(
param
.
getPolicyStart
())
&&
CheckParam
.
getPolicyEnd
().
equals
(
param
.
getPolicyEnd
())
&&
i
!=
j
)
{
param
.
setErrorMessage
(
InsurancesConstants
.
DUPLICATE_DATA_ERROR
);
errorList
.
add
(
param
);
//确定为重复数据则跳出循环
break
;
}
}
param
.
setOldSettleType
(
insuranceDetail
.
getSettleType
());
...
...
@@ -3376,16 +3519,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link R}
*/
@Override
public
R
urgentUpdateIsUse
(
String
userName
,
String
empIdcardNo
)
{
//员工姓名
if
(
StringUtils
.
isBlank
(
userName
)){
}
public
R
urgentUpdateIsUse
(
String
empIdcardNo
)
{
//员工身份证
if
(
StringUtils
.
isBlank
(
empIdcardNo
)){
return
R
.
failed
(
"身份证号为空"
);
}
//员工身份证
// 身份证号位数校验(18 位合法)
//员工身份 // 身份证号位数校验(18 位合法)
if
(!
ValidityUtil
.
validateIDCard
(
empIdcardNo
)){
return
R
.
failed
(
"身份证格式不正确"
);
}
...
...
@@ -3413,4 +3552,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
@Override
public
IPage
<
TInsuranceDetail
>
getInsuranceListByIdCard
(
Page
<
TInsuranceDetail
>
page
,
String
idCard
)
{
return
baseMapper
.
getInsuranceListByIdCard
(
page
,
idCard
);
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceSettleCancelServiceImpl.java
0 → 100644
View file @
183a80ba
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettleCancel
;
import
com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceSettleCancelMapper
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceSettleCancelService
;
import
org.springframework.stereotype.Service
;
/**
* @author Administrator
* @description 针对表【t_insurance_settle_cancel(结算信息作废记录表(用于记录项目变更导致推信息送至EKP))】的数据库操作Service实现
* @createDate 2022-08-01 11:37:54
*/
@Service
public
class
TInsuranceSettleCancelServiceImpl
extends
ServiceImpl
<
TInsuranceSettleCancelMapper
,
TInsuranceSettleCancel
>
implements
TInsuranceSettleCancelService
{
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceTypeRateServiceImpl.java
View file @
183a80ba
...
...
@@ -9,10 +9,10 @@ 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.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate
;
import
com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeRateMapper
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceOperateService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeRateService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil
;
...
...
@@ -34,6 +34,9 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
@Resource
private
TInsuranceTypeService
insuranceTypeService
;
@Resource
private
TInsuranceOperateService
tInsuranceOperateService
;
/**
* 根据险种id查询费率列表
*
...
...
@@ -44,14 +47,15 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
@Override
public
R
getInsuranceTypeRateList
(
String
id
)
{
if
(
Common
.
isEmpty
(
id
)){
return
R
.
failed
(
"险种
id
为空"
);
return
R
.
failed
(
"险种为空"
);
}
TInsuranceType
byId
=
insuranceTypeService
.
getById
(
id
);
if
(
Common
.
isEmpty
(
byId
)
||
CommonConstants
.
ONE_INT
==
byId
.
getDeleteFlag
()){
return
R
.
failed
(
"
当前
险种信息不存在或已被删除"
);
return
R
.
failed
(
"
该
险种信息不存在或已被删除"
);
}
LambdaQueryWrapper
<
TInsuranceTypeRate
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
TInsuranceTypeRate:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
).
eq
(
TInsuranceTypeRate:
:
getInsuranceTypeId
,
id
);
queryWrapper
.
orderByDesc
(
TInsuranceTypeRate:
:
getCreateTime
);
return
R
.
ok
(
list
(
queryWrapper
));
}
...
...
@@ -78,7 +82,9 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
.
set
(
TInsuranceTypeRate:
:
getDeleteFlag
,
CommonConstants
.
ONE_INT
)
.
set
(
TInsuranceTypeRate
::
getUpdateBy
,
user
.
getId
())
.
set
(
TInsuranceTypeRate
::
getUpdateTime
,
LocalDateTime
.
now
());
return
R
.
ok
(
update
(
updateWrapper
),
"删除费率信息成功"
);
update
(
updateWrapper
);
addOperate
(
byId
,
user
,
InsurancesConstants
.
DELETE_INSURANCE_TYPE_RATE
);
return
R
.
ok
(
"删除费率信息成功"
);
}
/**
...
...
@@ -98,15 +104,15 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
String
insuranceTypeId
=
insuranceTypeRate
.
getInsuranceTypeId
();
TInsuranceType
byId
=
insuranceTypeService
.
getById
(
insuranceTypeId
);
if
(
Common
.
isEmpty
(
byId
)
||
CommonConstants
.
ONE_INT
==
byId
.
getDeleteFlag
()){
return
R
.
failed
(
"
当前
险种信息不存在或已被删除"
);
return
R
.
failed
(
"
该
险种信息不存在或已被删除"
);
}
String
month
=
insuranceTypeRate
.
getMonth
();
if
(!
ValidityUtil
.
validatePositiveInt
(
month
)){
return
R
.
failed
(
"
当前
月份格式不正确"
);
return
R
.
failed
(
"月份格式不正确"
);
}
String
rate
=
insuranceTypeRate
.
getRate
();
if
(!
ValidityUtil
.
validateMoney
(
rate
)){
return
R
.
failed
(
"
当前
费率格式不正确"
);
return
R
.
failed
(
"费率格式不正确"
);
}
LambdaQueryWrapper
<
TInsuranceTypeRate
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
TInsuranceTypeRate:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
).
eq
(
TInsuranceTypeRate:
:
getInsuranceTypeId
,
insuranceTypeId
)
...
...
@@ -117,11 +123,34 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
insuranceTypeRate
.
setCreateBy
(
user
.
getId
());
insuranceTypeRate
.
setCreateName
(
user
.
getNickname
());
insuranceTypeRate
.
setCreateTime
(
LocalDateTime
.
now
());
return
R
.
ok
(
this
.
baseMapper
.
insert
(
insuranceTypeRate
));
save
(
insuranceTypeRate
);
addOperate
(
insuranceTypeRate
,
user
,
InsurancesConstants
.
NEW_INSURANCE_TYPE_RATE
);
return
R
.
ok
(
"新增费率信息成功"
);
}
else
{
return
R
.
failed
(
"
当前险种已存在相同的费率
"
);
return
R
.
failed
(
"
该险种购买月份已存在
"
);
}
}
/**
* 操作记录
*
* @author zhaji
* @param insuranceTypeRate 费率信息
* @param user 登录用户
* @param operateDesc 操作描述
* @return void
*/
private
void
addOperate
(
TInsuranceTypeRate
insuranceTypeRate
,
YifuUser
user
,
String
operateDesc
){
try
{
TInsuranceOperate
operate
=
new
TInsuranceOperate
();
operate
.
setInsuranceDetailId
(
insuranceTypeRate
.
getId
());
operate
.
setOperateDesc
(
operateDesc
);
operate
.
setCreateBy
(
user
.
getId
());
operate
.
setCreateName
(
user
.
getNickname
());
operate
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceOperateService
.
save
(
operate
);
}
catch
(
Exception
e
){
e
.
getStackTrace
();
}
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceTypeServiceImpl.java
View file @
183a80ba
...
...
@@ -20,6 +20,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
...
...
@@ -60,6 +61,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
* @return {@link R}
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
R
saveInsuranceType
(
TInsuranceType
insuranceType
)
{
if
(
Common
.
isEmpty
(
insuranceType
)){
return
R
.
failed
(
"新增的险种信息为空"
);
...
...
@@ -134,6 +136,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
* @return {@link R}
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
R
updateInsuranceType
(
TInsuranceType
insuranceType
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
Common
.
isEmpty
(
insuranceType
.
getId
())){
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceTypeStandardServiceImpl.java
View file @
183a80ba
...
...
@@ -8,6 +8,7 @@ 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.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType
;
...
...
@@ -60,6 +61,7 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
}
LambdaQueryWrapper
<
TInsuranceTypeStandard
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
TInsuranceTypeStandard:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
).
eq
(
TInsuranceTypeStandard:
:
getInsuranceTypeId
,
id
);
queryWrapper
.
orderByDesc
(
TInsuranceTypeStandard
::
getCreateTime
);
return
R
.
ok
(
list
(
queryWrapper
));
}
...
...
@@ -94,7 +96,9 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
.
set
(
TInsuranceTypeStandard:
:
getDeleteFlag
,
CommonConstants
.
ONE_INT
)
.
set
(
TInsuranceTypeStandard
::
getUpdateBy
,
user
.
getId
())
.
set
(
TInsuranceTypeStandard
::
getUpdateTime
,
LocalDateTime
.
now
());
return
R
.
ok
(
update
(
updateWrapper
),
"删除购买标准成功"
);
update
(
updateWrapper
);
addOperate
(
byId
,
user
,
InsurancesConstants
.
DELETE_INSURANCE_TYPE_STANDARD
);
return
R
.
ok
(
"删除购买标准成功"
);
}
/**
* 新增购买标准
...
...
@@ -137,12 +141,35 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
insuranceTypeStandard
.
setCreateBy
(
user
.
getId
());
insuranceTypeStandard
.
setCreateName
(
user
.
getNickname
());
insuranceTypeStandard
.
setCreateTime
(
LocalDateTime
.
now
());
return
R
.
ok
(
this
.
baseMapper
.
insert
(
insuranceTypeStandard
),
"新增购买标准成功"
);
save
(
insuranceTypeStandard
);
addOperate
(
insuranceTypeStandard
,
user
,
InsurancesConstants
.
NEW_INSURANCE_TYPE_STANDARD
);
return
R
.
ok
(
"新增购买标准成功"
);
}
else
{
return
R
.
failed
(
"
当前险种下的
购买标准已存在"
);
return
R
.
failed
(
"
该险种下
购买标准已存在"
);
}
}
/**
* 操作记录
*
* @author zhaji
* @param insuranceTypeStandard 购买标准信息
* @param user 登录用户
* @param operateDesc 操作描述
* @return void
*/
private
void
addOperate
(
TInsuranceTypeStandard
insuranceTypeStandard
,
YifuUser
user
,
String
operateDesc
){
try
{
TInsuranceOperate
operate
=
new
TInsuranceOperate
();
operate
.
setInsuranceDetailId
(
insuranceTypeStandard
.
getId
());
operate
.
setOperateDesc
(
operateDesc
);
operate
.
setCreateBy
(
user
.
getId
());
operate
.
setCreateName
(
user
.
getNickname
());
operate
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceOperateService
.
save
(
operate
);
}
catch
(
Exception
e
){
e
.
getStackTrace
();
}
}
}
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/TInsuranceDetailMapper.xml
View file @
183a80ba
...
...
@@ -14,6 +14,8 @@
<result
property=
"insuranceTypeName"
column=
"INSURANCE_TYPE_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"insuranceTypeId"
column=
"INSURANCE_TYPE_ID"
jdbcType=
"BIGINT"
/>
<result
property=
"buyStandard"
column=
"BUY_STANDARD"
jdbcType=
"VARCHAR"
/>
<result
property=
"rate"
column=
"RATE"
jdbcType=
"DECIMAL"
/>
<result
property=
"billingType"
column=
"BILLING_TYPE"
jdbcType=
"TINYINT"
/>
<result
property=
"medicalQuota"
column=
"MEDICAL_QUOTA"
jdbcType=
"VARCHAR"
/>
<result
property=
"dieDisableQuota"
column=
"DIE_DISABLE_QUOTA"
jdbcType=
"VARCHAR"
/>
<result
property=
"policyNo"
column=
"POLICY_NO"
jdbcType=
"VARCHAR"
/>
...
...
@@ -54,7 +56,7 @@
<sql
id=
"Base_Column_List"
>
ID,EMP_NAME,
EMP_IDCARD_NO,DEPT_NO,POST,INSURANCE_COMPANY_NAME,INSURANCE_TYPE_NAME,
INSURANCE_TYPE_ID,BUY_STANDARD,MEDICAL_QUOTA,DIE_DISABLE_QUOTA,POLICY_NO,
INSURANCE_TYPE_ID,BUY_STANDARD,
RATE,BILLING_TYPE,
MEDICAL_QUOTA,DIE_DISABLE_QUOTA,POLICY_NO,
POLICY_START,POLICY_END,POLICY_EFFECT,
BATCH_DATE,SETTLE_MONTH,INVOICE_NO,
BUY_TYPE,INSURANCE_PROVINCE,INSURANCE_PROVINCE_NAME,INSURANCE_CITY,INSURANCE_CITY_NAME,
...
...
@@ -759,4 +761,16 @@
#{item}
</foreach>
</update>
<!--getInsuranceListByIdCard-->
<select
id=
"getInsuranceListByIdCard"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_insurance_detail
<where>
1=1
AND EMP_IDCARD_NO = #{idCard}
</where>
ORDER BY CREATE_TIME desc
</select>
</mapper>
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/TInsuranceSettleCancelMapper.xml
0 → 100644
View file @
183a80ba
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceSettleCancelMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettleCancel"
>
<id
property=
"id"
column=
"ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"insDetailId"
column=
"INS_DETAIL_ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"settleId"
column=
"SETTLE_ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"deptNo"
column=
"DEPT_NO"
jdbcType=
"VARCHAR"
/>
<result
property=
"deptName"
column=
"DEPT_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"orderNo"
column=
"ORDER_NO"
jdbcType=
"VARCHAR"
/>
<result
property=
"isCancelPush"
column=
"IS_CANCEL_PUSH"
jdbcType=
"TINYINT"
/>
<result
property=
"createTime"
column=
"CREATE_TIME"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"createUesr"
column=
"CREATE_UESR"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
ID,INS_DETAIL_ID,SETTLE_ID,
DEPT_NO,DEPT_NAME,ORDER_NO,
IS_CANCEL_PUSH,CREATE_TIME,CREATE_UESR
</sql>
</mapper>
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/TInsuranceTypeMapper.xml
View file @
183a80ba
...
...
@@ -37,6 +37,7 @@
INSURANCE_TYPE_ID = #{id}
and
DELETE_FLAG = 0
ORDER BY CREATE_TIME DESC
</select>
<select
id=
"selectInsuranceTypeStandardList"
resultType=
"com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard"
>
...
...
@@ -52,6 +53,7 @@
INSURANCE_TYPE_ID = #{id}
and
DELETE_FLAG = 0
ORDER BY CREATE_TIME DESC
</select>
<select
id=
"selectInsuranceTypePage"
resultType=
"com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo"
>
select
...
...
@@ -69,7 +71,7 @@
a.INSURANCE_COMPANY_ID = b.ID
and
a.DELETE_FLAG = 0
ORDER BY a.
create_time
DESC
ORDER BY a.
CREATE_TIME
DESC
</select>
<select
id=
"getInsuranceTypeDetailById"
resultType=
"com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo"
>
select
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/TPaymentInfoController.java
View file @
183a80ba
...
...
@@ -144,10 +144,9 @@ public class TPaymentInfoController {
* @date 2022-07-22
**/
@SneakyThrows
@Operation
(
description
=
"导入省市社保-合肥三险
hasPermission('social_tpaymentinfo_batchImport')
"
)
@Operation
(
description
=
"导入省市社保-合肥三险"
)
@SysLog
(
"批量新增缴费库-合肥三险"
)
@PostMapping
(
"/importListSocialHeFei"
)
@PreAuthorize
(
"@pms.hasPermission('social_tpaymentinfo_batchImport')"
)
public
R
<
List
<
ErrorMessage
>>
importListSocialHeFei
(
@RequestBody
MultipartFile
file
,
@RequestParam
String
random
,
@RequestParam
(
value
=
"type"
)
String
type
){
return
tPaymentInfoService
.
importSocialHeFeiDiy
(
file
.
getInputStream
(),
random
,
type
);
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TSocialFundInfoServiceImpl.java
View file @
183a80ba
...
...
@@ -363,9 +363,9 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
continue;
}*/
history
.
setUnitFundMoney
(
Common
.
formatMoneyForFund
(
BigDecimalUtils
.
safeMultiply
(
history
.
getUnitFundBase
()
,
history
.
getUnitFundProp
(),
CommonConstants
.
ONE_OF_PERCENT
),
fundSetInfo
.
getFundPayPoint
(
)));
,
history
.
getUnitFundProp
(),
CommonConstants
.
ONE_OF_PERCENT
),
Integer
.
parseInt
(
socialFundInfo
.
getFundPayPoint
()
)));
history
.
setPersonalFundMoney
(
Common
.
formatMoneyForFund
(
BigDecimalUtils
.
safeMultiply
(
history
.
getPersonalFundBase
()
,
history
.
getPersonalFundProp
(),
CommonConstants
.
ONE_OF_PERCENT
),
fundSetInfo
.
getFundPayPoint
(
)));
,
history
.
getPersonalFundProp
(),
CommonConstants
.
ONE_OF_PERCENT
),
Integer
.
parseInt
(
socialFundInfo
.
getFundPayPoint
()
)));
// 更新社保公积金表的公积金信息
this
.
setSocialFundInfoByFund
(
socialFundInfo
,
history
);
}
...
...
@@ -497,10 +497,10 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
socialFundInfo
.
setUnitFundSum
(
Common
.
formatMoneyForFund
(
BigDecimalUtils
.
safeMultiply
(
socialFundInfo
.
getUnitProvidengCardinal
(),
socialFundInfo
.
getUnitProvidentPer
(),
CommonConstants
.
ONE_OF_PERCENT
)
,
Integer
.
valueOf
(
socialFundInfo
.
getFundPayPoint
())));
,
Integer
.
parseInt
(
socialFundInfo
.
getFundPayPoint
())));
socialFundInfo
.
setPersonalFundSum
(
Common
.
formatMoneyForFund
(
BigDecimalUtils
.
safeMultiply
(
socialFundInfo
.
getPersonalProvidentCardinal
(),
socialFundInfo
.
getPersonalProvidentPer
(),
CommonConstants
.
ONE_OF_PERCENT
)
,
Integer
.
valueOf
(
socialFundInfo
.
getFundPayPoint
())));
,
Integer
.
parseInt
(
socialFundInfo
.
getFundPayPoint
())));
}
/**
...
...
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