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
84c5b112
Commit
84c5b112
authored
Aug 01, 2022
by
查济
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-zhaji' into 'develop'
Feature zhaji See merge request fangxinjiang/yifu!77
parents
acf519f5
47d251fb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
189 additions
and
30 deletions
+189
-30
InsurancesConstants.java
...lus/v1/yifu/insurances/constants/InsurancesConstants.java
+8
-0
Dept.java
.../java/com/yifu/cloud/plus/v1/yifu/insurances/vo/Dept.java
+2
-2
TInsuranceDetailController.java
...ifu/insurances/controller/TInsuranceDetailController.java
+16
-1
TInsuranceDetailService.java
...s/v1/yifu/insurances/service/TInsuranceDetailService.java
+10
-0
TInsuranceCompanyServiceImpl.java
...insurances/service/impl/TInsuranceCompanyServiceImpl.java
+57
-8
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+49
-2
TInsuranceTypeServiceImpl.java
...fu/insurances/service/impl/TInsuranceTypeServiceImpl.java
+47
-17
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/constants/InsurancesConstants.java
View file @
84c5b112
...
@@ -573,6 +573,12 @@ public class InsurancesConstants {
...
@@ -573,6 +573,12 @@ public class InsurancesConstants {
* 修改保险公司
* 修改保险公司
*/
*/
public
static
final
String
UPDATE_INSURANCE_COMPANY
=
"修改保险公司"
;
public
static
final
String
UPDATE_INSURANCE_COMPANY
=
"修改保险公司"
;
/**
* 删除保险公司
*/
public
static
final
String
DELETE_INSURANCE_COMPANY
=
"删除保险公司"
;
/**
/**
* 新增险种
* 新增险种
*/
*/
...
@@ -631,4 +637,6 @@ public class InsurancesConstants {
...
@@ -631,4 +637,6 @@ public class InsurancesConstants {
public
static
final
String
MONTH_CHANGE
=
"变更结算月"
;
public
static
final
String
MONTH_CHANGE
=
"变更结算月"
;
}
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/
entity
/Dept.java
→
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/
vo
/Dept.java
View file @
84c5b112
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
entity
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
...
@@ -8,7 +8,7 @@ import java.io.Serializable;
...
@@ -8,7 +8,7 @@ import java.io.Serializable;
/**
/**
* @author zhaji
* @author zhaji
* @description 项目
* @description 项目
信息
* @date 2022-07-29 09:35:31
* @date 2022-07-29 09:35:31
*/
*/
@Data
@Data
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/controller/TInsuranceDetailController.java
View file @
84c5b112
...
@@ -3,7 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
...
@@ -3,7 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
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.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.insurances.
entity
.Dept
;
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.service.TInsuranceDetailService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.*
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Operation
;
...
@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement;
...
@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.security.core.userdetails.User
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -404,4 +405,18 @@ public class TInsuranceDetailController {
...
@@ -404,4 +405,18 @@ public class TInsuranceDetailController {
return
tInsuranceDetailService
.
getDeptList
();
return
tInsuranceDetailService
.
getDeptList
();
}
}
/**
* 出险
*
* @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
);
}
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/TInsuranceDetailService.java
View file @
84c5b112
...
@@ -276,4 +276,14 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
...
@@ -276,4 +276,14 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*/
*/
R
getDeptList
();
R
getDeptList
();
/**
* EKP紧急出险
*
* @author zhaji
* @param userName
* @param empIdcardNo
* @return {@link R}
*/
R
urgentUpdateIsUse
(
String
userName
,
String
empIdcardNo
);
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceCompanyServiceImpl.java
View file @
84c5b112
...
@@ -5,23 +5,24 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
...
@@ -5,23 +5,24 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
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.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
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.TInsuranceCompany
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail
;
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.mapper.TInsuranceCompanyMapper
;
import
com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceCompanyMapper
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceOperateService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil
;
import
com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.List
;
...
@@ -35,8 +36,19 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
...
@@ -35,8 +36,19 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
@Resource
@Resource
private
TInsuranceDetailService
i
nsuranceDetailService
;
private
TInsuranceDetailService
tI
nsuranceDetailService
;
@Resource
private
TInsuranceOperateService
tInsuranceOperateService
;
/**
* 分页查询保险公司
*
* @author zhaji
* @param page 分页参数
* @param insuranceCompany 查询类
* @return {@link IPage< TInsuranceCompany>}
*/
@Override
@Override
public
IPage
<
TInsuranceCompany
>
pageDiy
(
Page
page
,
TInsuranceCompany
insuranceCompany
)
{
public
IPage
<
TInsuranceCompany
>
pageDiy
(
Page
page
,
TInsuranceCompany
insuranceCompany
)
{
LambdaQueryWrapper
<
TInsuranceCompany
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
TInsuranceCompany
>
wrapper
=
new
LambdaQueryWrapper
<>();
...
@@ -45,6 +57,13 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
...
@@ -45,6 +57,13 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
return
list
;
return
list
;
}
}
/**
* 新增保险公司
*
* @author zhaji
* @param insuranceCompany 新增类
* @return {@link R}
*/
@Override
@Override
public
R
saveInsuranceCompany
(
TInsuranceCompany
insuranceCompany
)
{
public
R
saveInsuranceCompany
(
TInsuranceCompany
insuranceCompany
)
{
if
(
Common
.
isEmpty
(
insuranceCompany
)){
if
(
Common
.
isEmpty
(
insuranceCompany
)){
...
@@ -64,9 +83,11 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
...
@@ -64,9 +83,11 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
insuranceCompany
.
setCreateName
(
user
.
getNickname
());
insuranceCompany
.
setCreateName
(
user
.
getNickname
());
insuranceCompany
.
setCreateTime
(
LocalDateTime
.
now
());
insuranceCompany
.
setCreateTime
(
LocalDateTime
.
now
());
insuranceCompany
.
setDeleteFlag
(
CommonConstants
.
ZERO_INT
);
insuranceCompany
.
setDeleteFlag
(
CommonConstants
.
ZERO_INT
);
return
R
.
ok
(
save
(
insuranceCompany
),
"新增成功"
);
save
(
insuranceCompany
);
addOperate
(
insuranceCompany
,
user
,
InsurancesConstants
.
DELETE_INSURANCE_COMPANY
);
return
R
.
ok
(
"新增成功"
);
}
else
{
}
else
{
return
R
.
failed
(
"
当前保险公司已存在
"
);
return
R
.
failed
(
"
保险公司名称不能重复添加
"
);
}
}
}
}
...
@@ -105,7 +126,7 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
...
@@ -105,7 +126,7 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
LambdaQueryWrapper
<
TInsuranceDetail
>
detailQueryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
TInsuranceDetail
>
detailQueryWrapper
=
new
LambdaQueryWrapper
<>();
detailQueryWrapper
.
eq
(
TInsuranceDetail:
:
getInsuranceCompanyName
,
companyName
)
detailQueryWrapper
.
eq
(
TInsuranceDetail:
:
getInsuranceCompanyName
,
companyName
)
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
);
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
);
List
<
TInsuranceDetail
>
list
=
i
nsuranceDetailService
.
list
(
detailQueryWrapper
);
List
<
TInsuranceDetail
>
list
=
tI
nsuranceDetailService
.
list
(
detailQueryWrapper
);
if
(
Common
.
isNotEmpty
(
list
)){
if
(
Common
.
isNotEmpty
(
list
)){
return
R
.
failed
(
"当前保险公司的名称已存在对应的商险信息,不能进行修改"
);
return
R
.
failed
(
"当前保险公司的名称已存在对应的商险信息,不能进行修改"
);
}
else
{
}
else
{
...
@@ -120,7 +141,9 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
...
@@ -120,7 +141,9 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
}
else
{
}
else
{
insuranceCompany
.
setUpdateBy
(
user
.
getId
());
insuranceCompany
.
setUpdateBy
(
user
.
getId
());
insuranceCompany
.
setUpdateTime
(
LocalDateTime
.
now
());
insuranceCompany
.
setUpdateTime
(
LocalDateTime
.
now
());
return
R
.
ok
(
updateById
(
insuranceCompany
));
updateById
(
insuranceCompany
);
addOperate
(
one
,
user
,
InsurancesConstants
.
UPDATE_INSURANCE_COMPANY
);
return
R
.
ok
(
"修改保险信息公司成功"
);
}
}
}
}
/**
/**
...
@@ -144,10 +167,36 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
...
@@ -144,10 +167,36 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
.
set
(
TInsuranceCompany:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
set
(
TInsuranceCompany:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
set
(
TInsuranceCompany
::
getUpdateBy
,
user
.
getId
())
.
set
(
TInsuranceCompany
::
getUpdateBy
,
user
.
getId
())
.
set
(
TInsuranceCompany
::
getUpdateTime
,
LocalDateTime
.
now
());
.
set
(
TInsuranceCompany
::
getUpdateTime
,
LocalDateTime
.
now
());
return
R
.
ok
(
update
(
updateWrapper
));
update
(
updateWrapper
);
addOperate
(
one
,
user
,
InsurancesConstants
.
DELETE_INSURANCE_COMPANY
);
return
R
.
ok
(
"删除成功"
);
}
}
}
}
/**
* 操作记录
*
* @author zhaji
* @param insuranceCompany 保险公司
* @param user 登录用户
* @param operateDesc 操作描述
* @return void
*/
private
void
addOperate
(
TInsuranceCompany
insuranceCompany
,
YifuUser
user
,
String
operateDesc
){
try
{
TInsuranceOperate
operate
=
new
TInsuranceOperate
();
operate
.
setInsuranceDetailId
(
insuranceCompany
.
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/TInsuranceDetailServiceImpl.java
View file @
84c5b112
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
service
.
impl
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
...
@@ -2647,7 +2648,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -2647,7 +2648,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
CommonConstants
.
FIVE_INT
==
buyHandleStatus
){
if
(
CommonConstants
.
FIVE_INT
==
buyHandleStatus
){
return
R
.
failed
(
"当前员工已减员,不能进行出险操作"
);
return
R
.
failed
(
"当前员工已减员,不能进行出险操作"
);
}
}
if
(
null
!=
reduceHandleStatus
){
if
(
null
!=
reduceHandleStatus
&&
CommonConstants
.
THREE_INT
!=
reduceHandleStatus
){
return
R
.
failed
(
"当前员工在减员中,不能进行出险操作"
);
return
R
.
failed
(
"当前员工在减员中,不能进行出险操作"
);
}
}
Integer
isEffect
=
insuranceDetail
.
getIsEffect
();
Integer
isEffect
=
insuranceDetail
.
getIsEffect
();
...
@@ -3364,6 +3365,52 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -3364,6 +3365,52 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
return
R
.
ok
(
deptList
);
return
R
.
ok
(
deptList
);
};
}
/**
* EKP紧急出险
*
* @author zhaji
* @param userName
* @param empIdcardNo
* @return {@link R}
*/
@Override
public
R
urgentUpdateIsUse
(
String
userName
,
String
empIdcardNo
)
{
//员工姓名
if
(
StringUtils
.
isBlank
(
userName
)){
}
//员工身份证
if
(
StringUtils
.
isBlank
(
empIdcardNo
)){
return
R
.
failed
(
"身份证号为空"
);
}
//员工身份证
// 身份证号位数校验(18 位合法)
if
(!
ValidityUtil
.
validateIDCard
(
empIdcardNo
)){
return
R
.
failed
(
"身份证格式不正确"
);
}
LambdaQueryWrapper
<
TInsuranceDetail
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
//查询所有在保,未出险,未过期,未失效,未减员的保单信息
queryWrapper
.
eq
(
TInsuranceDetail
::
getEmpIdcardNo
,
empIdcardNo
).
eq
(
TInsuranceDetail
::
getBuyHandleStatus
,
CommonConstants
.
THREE_INT
)
.
eq
(
TInsuranceDetail
::
getIsEffect
,
CommonConstants
.
ZERO_INT
).
eq
(
TInsuranceDetail
::
getIsUse
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TInsuranceDetail
::
getIsOverdue
,
CommonConstants
.
ZERO_INT
)
.
ne
(
TInsuranceDetail
::
getReduceHandleStatus
,
CommonConstants
.
ONE_INT
)
.
ne
(
TInsuranceDetail
::
getReduceHandleStatus
,
CommonConstants
.
TWO_INT
);
List
<
TInsuranceDetail
>
list
=
list
(
queryWrapper
);
if
(
CollectionUtils
.
isEmpty
(
list
)){
return
R
.
failed
(
"无可出险的保单"
);
}
for
(
TInsuranceDetail
tInsuranceDetail
:
list
)
{
tInsuranceDetail
.
setIsUse
(
CommonConstants
.
ONE_INT
);
//tInsuranceDetail.setUpdateBy();
tInsuranceDetail
.
setUpdateTime
(
LocalDateTime
.
now
());
}
boolean
b
=
updateBatchById
(
list
);
if
(
b
){
return
R
.
ok
(
"EKP紧急出险成功"
);
}
else
{
return
R
.
ok
(
"EKP紧急出险失败"
);
}
}
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceTypeServiceImpl.java
View file @
84c5b112
...
@@ -2,7 +2,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
...
@@ -2,7 +2,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
@@ -11,19 +10,15 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
...
@@ -11,19 +10,15 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
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.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany
;
import
com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard
;
import
com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeMapper
;
import
com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeMapper
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsurance
Detail
Service
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsurance
Operate
Service
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.util.BeanCopyUtils
;
import
com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil
;
import
com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -39,7 +34,10 @@ import java.util.List;
...
@@ -39,7 +34,10 @@ import java.util.List;
public
class
TInsuranceTypeServiceImpl
extends
ServiceImpl
<
TInsuranceTypeMapper
,
TInsuranceType
>
implements
TInsuranceTypeService
{
public
class
TInsuranceTypeServiceImpl
extends
ServiceImpl
<
TInsuranceTypeMapper
,
TInsuranceType
>
implements
TInsuranceTypeService
{
@Resource
@Resource
private
TInsuranceCompanyService
insuranceCompanyService
;
private
TInsuranceCompanyService
tInsuranceCompanyService
;
@Resource
private
TInsuranceOperateService
tInsuranceOperateService
;
/**
/**
* 险种分页查询
* 险种分页查询
...
@@ -51,7 +49,6 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
...
@@ -51,7 +49,6 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
*/
*/
@Override
@Override
public
IPage
<
InsuranceTypeVo
>
pageDiy
(
Page
<
TInsuranceType
>
page
,
TInsuranceType
insuranceType
)
{
public
IPage
<
InsuranceTypeVo
>
pageDiy
(
Page
<
TInsuranceType
>
page
,
TInsuranceType
insuranceType
)
{
return
this
.
baseMapper
.
selectInsuranceTypePage
(
page
,
insuranceType
);
return
this
.
baseMapper
.
selectInsuranceTypePage
(
page
,
insuranceType
);
}
}
...
@@ -86,22 +83,23 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
...
@@ -86,22 +83,23 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
}
}
LambdaQueryWrapper
<
TInsuranceCompany
>
companyWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
TInsuranceCompany
>
companyWrapper
=
new
LambdaQueryWrapper
<>();
companyWrapper
.
eq
(
TInsuranceCompany:
:
getId
,
companyId
).
eq
(
TInsuranceCompany:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
);
companyWrapper
.
eq
(
TInsuranceCompany:
:
getId
,
companyId
).
eq
(
TInsuranceCompany:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
);
TInsuranceCompany
insuranceCompany
=
i
nsuranceCompanyService
.
getOne
(
companyWrapper
);
TInsuranceCompany
insuranceCompany
=
tI
nsuranceCompanyService
.
getOne
(
companyWrapper
);
if
(
Common
.
isEmpty
(
insuranceCompany
)){
if
(
Common
.
isEmpty
(
insuranceCompany
)){
return
R
.
failed
(
"所属保险公司不存在或已被删除"
);
return
R
.
failed
(
"所属保险公司不存在或已被删除"
);
}
}
LambdaQueryWrapper
<
TInsuranceType
>
typeWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
TInsuranceType
>
typeWrapper
=
new
LambdaQueryWrapper
<>();
typeWrapper
.
eq
(
TInsuranceType
::
getInsuranceCompanyId
,
companyId
).
eq
(
TInsuranceType:
:
getName
,
insuranceType
.
getName
()).
eq
(
TInsuranceType:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
);
typeWrapper
.
eq
(
TInsuranceType
::
getInsuranceCompanyId
,
companyId
).
eq
(
TInsuranceType:
:
getName
,
insuranceType
.
getName
()).
eq
(
TInsuranceType:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
);
TInsuranceType
type
=
getOne
(
typeWrapper
);
TInsuranceType
type
=
getOne
(
typeWrapper
);
if
(!
Common
.
isEmpty
(
type
)){
if
(!
Common
.
isEmpty
(
type
)){
return
R
.
failed
(
"当前
险种已存在
"
);
return
R
.
failed
(
"当前
保险公司已存在该险种
"
);
}
else
{
}
else
{
insuranceType
.
setDeleteFlag
(
CommonConstants
.
ZERO_INT
);
insuranceType
.
setDeleteFlag
(
CommonConstants
.
ZERO_INT
);
insuranceType
.
setCreateBy
(
user
.
getId
());
insuranceType
.
setCreateBy
(
user
.
getId
());
insuranceType
.
setCreateName
(
user
.
getNickname
());
insuranceType
.
setCreateName
(
user
.
getNickname
());
insuranceType
.
setCreateTime
(
LocalDateTime
.
now
());
insuranceType
.
setCreateTime
(
LocalDateTime
.
now
());
return
R
.
ok
(
save
(
insuranceType
));
save
(
insuranceType
);
addOperate
(
insuranceType
,
user
,
InsurancesConstants
.
NEW_INSURANCE_TYPE
);
return
R
.
ok
(
"新增险种信息成功"
);
}
}
}
}
...
@@ -137,6 +135,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
...
@@ -137,6 +135,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
*/
*/
@Override
@Override
public
R
updateInsuranceType
(
TInsuranceType
insuranceType
)
{
public
R
updateInsuranceType
(
TInsuranceType
insuranceType
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
Common
.
isEmpty
(
insuranceType
.
getId
())){
if
(
Common
.
isEmpty
(
insuranceType
.
getId
())){
return
R
.
failed
(
"险种ID不能为空"
);
return
R
.
failed
(
"险种ID不能为空"
);
}
}
...
@@ -145,7 +144,11 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
...
@@ -145,7 +144,11 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
return
R
.
failed
(
"当前险种信息不存在或已被删除"
);
return
R
.
failed
(
"当前险种信息不存在或已被删除"
);
}
}
if
(
byId
.
getName
().
equals
(
insuranceType
.
getName
())){
if
(
byId
.
getName
().
equals
(
insuranceType
.
getName
())){
return
R
.
ok
(
this
.
updateById
(
insuranceType
),
"修改险种信息成功"
);
insuranceType
.
setUpdateBy
(
user
.
getId
());
insuranceType
.
setUpdateTime
(
LocalDateTime
.
now
());
updateById
(
insuranceType
);
addOperate
(
insuranceType
,
user
,
InsurancesConstants
.
UPDATE_INSURANCE_TYPE
);
return
R
.
ok
(
"修改险种信息成功"
);
}
else
{
}
else
{
LambdaQueryWrapper
<
TInsuranceType
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
TInsuranceType
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
TInsuranceType:
:
getName
,
insuranceType
.
getName
())
queryWrapper
.
eq
(
TInsuranceType:
:
getName
,
insuranceType
.
getName
())
...
@@ -153,13 +156,40 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
...
@@ -153,13 +156,40 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
.
eq
(
TInsuranceType:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
);
.
eq
(
TInsuranceType:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
);
TInsuranceType
one
=
this
.
getOne
(
queryWrapper
);
TInsuranceType
one
=
this
.
getOne
(
queryWrapper
);
if
(
Common
.
isEmpty
(
one
)){
if
(
Common
.
isEmpty
(
one
)){
return
R
.
ok
(
this
.
updateById
(
insuranceType
),
"修改险种信息成功"
);
insuranceType
.
setUpdateBy
(
user
.
getId
());
insuranceType
.
setUpdateTime
(
LocalDateTime
.
now
());
updateById
(
insuranceType
);
addOperate
(
insuranceType
,
user
,
InsurancesConstants
.
UPDATE_INSURANCE_TYPE
);
return
R
.
ok
(
"修改险种信息成功"
);
}
else
{
}
else
{
return
R
.
failed
(
"当前险种名称已存在"
);
return
R
.
failed
(
"当前险种名称已存在"
);
}
}
}
}
}
}
/**
* 操作记录
*
* @author zhaji
* @param insuranceType 险种信息
* @param user 登录用户
* @param operateDesc 操作描述
* @return void
*/
private
void
addOperate
(
TInsuranceType
insuranceType
,
YifuUser
user
,
String
operateDesc
){
try
{
TInsuranceOperate
operate
=
new
TInsuranceOperate
();
operate
.
setInsuranceDetailId
(
insuranceType
.
getId
());
operate
.
setOperateDesc
(
operateDesc
);
operate
.
setCreateBy
(
user
.
getId
());
operate
.
setCreateName
(
user
.
getNickname
());
operate
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceOperateService
.
save
(
operate
);
}
catch
(
Exception
e
){
e
.
getStackTrace
();
}
}
/**
/**
* 查询险种列表
* 查询险种列表
*
*
...
@@ -179,7 +209,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
...
@@ -179,7 +209,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
}
else
{
}
else
{
LambdaQueryWrapper
<
TInsuranceCompany
>
companyWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
TInsuranceCompany
>
companyWrapper
=
new
LambdaQueryWrapper
<>();
companyWrapper
.
eq
(
TInsuranceCompany:
:
getId
,
companyId
).
eq
(
TInsuranceCompany:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
);
companyWrapper
.
eq
(
TInsuranceCompany:
:
getId
,
companyId
).
eq
(
TInsuranceCompany:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
);
TInsuranceCompany
insuranceCompany
=
i
nsuranceCompanyService
.
getOne
(
companyWrapper
);
TInsuranceCompany
insuranceCompany
=
tI
nsuranceCompanyService
.
getOne
(
companyWrapper
);
if
(
Common
.
isEmpty
(
insuranceCompany
)){
if
(
Common
.
isEmpty
(
insuranceCompany
)){
return
R
.
failed
(
"所属保险公司不存在或已被删除"
);
return
R
.
failed
(
"所属保险公司不存在或已被删除"
);
}
else
{
}
else
{
...
...
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