Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
4594c10e
Commit
4594c10e
authored
May 10, 2022
by
翁国栋
Committed by
284718418@qq.com
Mar 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8小时后台,投保人改为当前企业
parent
a67b2894
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
10 deletions
+48
-10
src/main/java/cn/timer/api/controller/insure/InsureApplicantController.java
+36
-8
src/main/java/cn/timer/api/controller/insure/InsureUserController.java
+1
-1
src/main/java/cn/timer/api/dao/insure/InsurePolicyMapper.java
+1
-0
src/main/resources/mapping/insure/InsurePolicyMapper.xml
+10
-1
No files found.
src/main/java/cn/timer/api/controller/insure/InsureApplicantController.java
View file @
4594c10e
...
...
@@ -6,6 +6,7 @@ import java.util.Optional;
import
java.util.Random
;
import
cn.timer.api.bean.insure.InsureApplicant
;
import
cn.timer.api.bean.qyzx.QyzxEntInfoM
;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.dao.insure.InsureApplicantMapper
;
...
...
@@ -48,22 +49,49 @@ public class InsureApplicantController {
@PostMapping
(
"/insureApplicationSetting"
)
@ApiOperation
(
value
=
"设置投保人"
,
httpMethod
=
"POST"
,
notes
=
"投保申请"
)
private
Result
<
Object
>
insureApplicationSetting
(
@RequestBody
InsureApplicant
params
)
{
InsureApplicant
insureApplicant
=
InsureApplicant
.
builder
().
id
(
1
).
build
().
selectById
();
if
(
insureApplicant
==
null
){
params
.
insert
();
return
ResultUtil
.
data
(
params
);
}
InsureApplicant
insureApplicant
=
InsureApplicant
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
InsureApplicant
>().
lambda
().
eq
(
InsureApplicant:
:
getOrgCode
,
params
.
getOrgCode
()));
params
.
setId
(
insureApplicant
.
getId
());
params
.
updateById
();
return
ResultUtil
.
data
(
params
);
}
@GetMapping
(
"/getApplicantAdmin"
)
@ApiOperation
(
value
=
"获取投保人--运营后台"
,
httpMethod
=
"GET"
,
notes
=
"获取投保人"
)
private
Result
<
Object
>
getApplicant
(
@RequestParam
(
"orgCode"
)
Integer
orgCode
)
{
InsureApplicant
insureApplicant
=
InsureApplicant
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
InsureApplicant
>().
lambda
().
eq
(
InsureApplicant:
:
getOrgCode
,
orgCode
));
if
(
insureApplicant
==
null
){
QyzxEntInfoM
qyzxEntInfoM
=
QyzxEntInfoM
.
builder
().
id
(
orgCode
).
build
().
selectById
();
insureApplicant
=
getInsureApplicant
(
qyzxEntInfoM
);
insureApplicant
.
setOrgCode
(
orgCode
);
insureApplicant
.
insert
();
}
return
ResultUtil
.
data
(
insureApplicant
);
}
private
InsureApplicant
getInsureApplicant
(
QyzxEntInfoM
qyzxEntInfoM
)
{
InsureApplicant
insureApplicant
;
insureApplicant
=
new
InsureApplicant
();
insureApplicant
.
setApplicantEName
(
qyzxEntInfoM
.
getName
());
insureApplicant
.
setApplicantEAddress
(
qyzxEntInfoM
.
getWorkAddress
());
insureApplicant
.
setApplicantEContacts
(
qyzxEntInfoM
.
getOperName
());
/*这里为避免联系人为空,默认使用法人*/
insureApplicant
.
setApplicantEPhone
(
qyzxEntInfoM
.
getPhone
());
/*这里为避免联系人为空,默认使用法人*/
insureApplicant
.
setApplicantType
(
"2"
);
insureApplicant
.
setApplicantENoType
(
"3646"
);
insureApplicant
.
setApplicantENo
(
qyzxEntInfoM
.
getCreditCode
());
insureApplicant
.
setApplicantProvinceCity
(
"21721"
);
return
insureApplicant
;
}
@GetMapping
(
"/getApplicant"
)
@ApiOperation
(
value
=
"获取投保人"
,
httpMethod
=
"GET"
,
notes
=
"获取投保人"
)
private
Result
<
Object
>
getApplicant
()
{
InsureApplicant
insureApplicant
=
InsureApplicant
.
builder
().
id
(
1
).
build
().
selectById
(
);
@ApiOperation
(
value
=
"获取投保人
--8小时
"
,
httpMethod
=
"GET"
,
notes
=
"获取投保人"
)
private
Result
<
Object
>
getApplicant
(
@CurrentUser
UserBean
userBean
)
{
InsureApplicant
insureApplicant
=
InsureApplicant
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
InsureApplicant
>().
lambda
().
eq
(
InsureApplicant:
:
getOrgCode
,
userBean
.
getOrgCode
())
);
if
(
insureApplicant
==
null
){
return
ResultUtil
.
data
(
null
);
QyzxEntInfoM
qyzxEntInfoM
=
QyzxEntInfoM
.
builder
().
id
(
userBean
.
getOrgCode
()).
build
().
selectById
();
insureApplicant
=
getInsureApplicant
(
qyzxEntInfoM
);
insureApplicant
.
setOrgCode
(
userBean
.
getOrgCode
());
insureApplicant
.
insert
();
}
return
ResultUtil
.
data
(
insureApplicant
);
}
...
...
src/main/java/cn/timer/api/controller/insure/InsureUserController.java
View file @
4594c10e
...
...
@@ -64,7 +64,7 @@ public class InsureUserController{
@ApiOperation
(
value
=
"3.保单列表--8小时端"
,
httpMethod
=
"POST"
,
notes
=
"保单列表"
)
public
Result
<
Object
>
userPolicyList
(
@CurrentUser
UserBean
userBean
,
@RequestBody
PolicyDto
policyDto
)
{
Map
map
=
Maps
.
newHashMap
();
InsurePolicy
insurePolicy
=
InsurePolicy
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
InsurePolicy
>().
lambda
().
eq
(
InsurePolicy:
:
get
OrgCode
,
userBean
.
getOrgCode
()).
eq
(
InsurePolicy:
:
getStatus
,
1
));
InsurePolicy
insurePolicy
=
InsurePolicy
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
InsurePolicy
>().
lambda
().
eq
(
InsurePolicy:
:
get
Id
,
policyDto
.
getId
()
));
if
(
insurePolicy
==
null
){
return
ResultUtil
.
error
(
"保单号不存在"
);
}
...
...
src/main/java/cn/timer/api/dao/insure/InsurePolicyMapper.java
View file @
4594c10e
...
...
@@ -28,5 +28,6 @@ public interface InsurePolicyMapper extends BaseMapper<InsurePolicy> {
List
<
InsureUserDto
>
selectPlansListByorgCode
(
@Param
(
"orgCode"
)
Integer
id
);
List
<
InsurePolicy
>
selectPolicyListByStatus
(
@Param
(
"date"
)
Date
date
);
Integer
selectPlansTotalByorgCode
(
@Param
(
"orgCode"
)
Integer
id
);
}
src/main/resources/mapping/insure/InsurePolicyMapper.xml
View file @
4594c10e
...
...
@@ -243,7 +243,8 @@
ip.policy_date_end as policyDateEnd,
sum(iu.price) AS totalPremium,
ip.update_time AS updateTime,
ip.`status` as `status`
ip.`status` as `status`,
ip.org_code as orgCode
FROM
insure_policy ip
LEFT JOIN insure_user iu ON iu.policy_id = ip.id
...
...
@@ -347,6 +348,14 @@
iu.benefit_basic_plan,
iu.benefit_occupation_category
</select>
<select
id=
"selectPlansTotalByorgCode"
resultType=
"java.lang.Integer"
>
SELECT
count(ip.id)
FROM
insure_policy ip
LEFT JOIN insure_user iu ON iu.policy_id = ip.id
WHERE ip.org_code=#{orgCode}
</select>
<select
id=
"selectPolicyListByStatus"
resultType=
"cn.timer.api.bean.insure.InsurePolicy"
>
select * from insure_policy
...
...
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