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
be3def01
Commit
be3def01
authored
Apr 22, 2022
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改为可选择产品
parent
84a4067a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
+6
-2
src/main/java/cn/timer/api/dto/insure/PolicyDto.java
+1
-0
src/main/resources/mapping/insure/InsurePolicyMapper.xml
+7
-3
No files found.
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
View file @
be3def01
...
@@ -962,13 +962,16 @@ public class InsureContorll {
...
@@ -962,13 +962,16 @@ public class InsureContorll {
@PostMapping
(
value
=
"/importPolicy"
)
@PostMapping
(
value
=
"/importPolicy"
)
@ApiOperation
(
value
=
"导入保单--运营后台"
,
httpMethod
=
"POST"
,
notes
=
"导入用户"
)
@ApiOperation
(
value
=
"导入保单--运营后台"
,
httpMethod
=
"POST"
,
notes
=
"导入用户"
)
public
Result
<
Object
>
importPolicy
(
@RequestParam
(
"file"
)
MultipartFile
file
)
{
public
Result
<
Object
>
importPolicy
(
@RequestParam
(
"file"
)
MultipartFile
file
,
@RequestParam
(
"productId"
)
String
productId
)
{
SimpleDateFormat
dtf
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
SimpleDateFormat
dtf
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
if
(
file
.
getSize
()
<=
0
)
{
if
(
file
.
getSize
()
<=
0
)
{
return
ResultUtil
.
error
(
"请上传文件"
);
return
ResultUtil
.
error
(
"请上传文件"
);
}
}
InsureProduct
insureProduct
=
InsureProduct
.
builder
().
id
(
Integer
.
parseInt
(
productId
)).
build
().
selectById
();
if
(
insureProduct
==
null
){
return
ResultUtil
.
error
(
"产品不存在"
);
}
try
{
try
{
XSSFWorkbook
xw
=
new
XSSFWorkbook
(
file
.
getInputStream
());
XSSFWorkbook
xw
=
new
XSSFWorkbook
(
file
.
getInputStream
());
XSSFSheet
sheetAt
=
xw
.
getSheetAt
(
0
);
XSSFSheet
sheetAt
=
xw
.
getSheetAt
(
0
);
...
@@ -1082,6 +1085,7 @@ public class InsureContorll {
...
@@ -1082,6 +1085,7 @@ public class InsureContorll {
Map
returnMap
=
JSONObject
.
parseObject
(
data
,
Map
.
class
);
Map
returnMap
=
JSONObject
.
parseObject
(
data
,
Map
.
class
);
if
(
returnMap
.
get
(
"errcode"
).
toString
().
equals
(
"suc"
)){
if
(
returnMap
.
get
(
"errcode"
).
toString
().
equals
(
"suc"
)){
Map
dataMap
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
returnMap
.
get
(
"data"
)),
Map
.
class
);
Map
dataMap
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
returnMap
.
get
(
"data"
)),
Map
.
class
);
policy
.
setProductId
(
insureProduct
.
getId
());
policy
.
setPolicyFile
(
dataMap
.
get
(
"policy_file"
).
toString
());
policy
.
setPolicyFile
(
dataMap
.
get
(
"policy_file"
).
toString
());
policy
.
setStatus
(
"1"
);
policy
.
setStatus
(
"1"
);
}
else
{
}
else
{
...
...
src/main/java/cn/timer/api/dto/insure/PolicyDto.java
View file @
be3def01
...
@@ -39,5 +39,6 @@ public class PolicyDto {
...
@@ -39,5 +39,6 @@ public class PolicyDto {
private
Integer
insureStatus
;
private
Integer
insureStatus
;
private
String
planId
;
private
String
planId
;
private
String
categoryId
;
private
String
categoryId
;
private
String
productId
;
}
}
src/main/resources/mapping/insure/InsurePolicyMapper.xml
View file @
be3def01
...
@@ -249,6 +249,9 @@
...
@@ -249,6 +249,9 @@
LEFT JOIN insure_user iu ON iu.policy_id = ip.id
LEFT JOIN insure_user iu ON iu.policy_id = ip.id
LEFT JOIN qyzx_ent_info_m qy on qy.id=ip.org_code
LEFT JOIN qyzx_ent_info_m qy on qy.id=ip.org_code
<where>
<where>
<if
test=
"policy.productId!=null and policy.productId!=''"
>
and ip.product_id = #{policy.productId}
</if>
<if
test=
"policy.status!=null and policy.status!=''"
>
<if
test=
"policy.status!=null and policy.status!=''"
>
and ip.status = #{policy.status}
and ip.status = #{policy.status}
</if>
</if>
...
@@ -307,12 +310,13 @@
...
@@ -307,12 +310,13 @@
<select
id=
"policyTotalList"
resultType=
"cn.timer.api.dto.insure.PolicyDto"
>
<select
id=
"policyTotalList"
resultType=
"cn.timer.api.dto.insure.PolicyDto"
>
SELECT
SELECT
ip.id as id,
ip.name AS schemeName,
ip.name AS schemeName,
ip.type AS type,
ip.type AS type,
(select count(id) from insure_policy
) AS totaPolicy,
count(ipp.id
) AS totaPolicy,
(select count(org_code) from insure_policy
) AS totalCompany,
count(ipp.org_code
) AS totalCompany,
count( iu.id ) AS totalUser,
count( iu.id ) AS totalUser,
IFNULL((select sum(price) from insure_user),0)
as totalPremium,
sum(iu.price)
as totalPremium,
ipp.update_time AS updateTime
ipp.update_time AS updateTime
FROM
FROM
insure_product ip
insure_product ip
...
...
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