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
a970dbb3
Commit
a970dbb3
authored
2 years ago
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8小时后台--
存储导入保单的execl
parent
1bcf28a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
+8
-1
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
+8
-1
No files found.
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
View file @
a970dbb3
...
@@ -20,6 +20,7 @@ import cn.timer.api.dto.insure.InsureUserDto;
...
@@ -20,6 +20,7 @@ import cn.timer.api.dto.insure.InsureUserDto;
import
cn.timer.api.dto.insure.PlansDto
;
import
cn.timer.api.dto.insure.PlansDto
;
import
cn.timer.api.dto.insure.PolicyDto
;
import
cn.timer.api.dto.insure.PolicyDto
;
import
cn.timer.api.dto.spmk.User
;
import
cn.timer.api.dto.spmk.User
;
import
cn.timer.api.service.OSSService
;
import
cn.timer.api.utils.*
;
import
cn.timer.api.utils.*
;
import
com.alibaba.druid.util.Base64
;
import
com.alibaba.druid.util.Base64
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
@@ -119,6 +120,9 @@ public class InsureContorll {
...
@@ -119,6 +120,9 @@ public class InsureContorll {
@Value
(
value
=
"${config-8timer.init-password}"
)
@Value
(
value
=
"${config-8timer.init-password}"
)
private
String
pwd
;
private
String
pwd
;
@Autowired
private
OSSService
ossService
;
private
static
SimpleDateFormat
dtf3
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
private
static
SimpleDateFormat
dtf3
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
...
@@ -1159,6 +1163,7 @@ public class InsureContorll {
...
@@ -1159,6 +1163,7 @@ public class InsureContorll {
}
else
{
}
else
{
return
ResultUtil
.
error
(
"保单不存在,请检查保单号是否正确"
);
return
ResultUtil
.
error
(
"保单不存在,请检查保单号是否正确"
);
}
}
InsurePolicy
oldPolicy
=
InsurePolicy
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
InsurePolicy
>().
lambda
().
eq
(
InsurePolicy:
:
getPolicyNo
,
policy
.
getPolicyNo
()));
InsurePolicy
oldPolicy
=
InsurePolicy
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
InsurePolicy
>().
lambda
().
eq
(
InsurePolicy:
:
getPolicyNo
,
policy
.
getPolicyNo
()));
if
(
oldPolicy
==
null
)
{
if
(
oldPolicy
==
null
)
{
...
@@ -1171,6 +1176,7 @@ public class InsureContorll {
...
@@ -1171,6 +1176,7 @@ public class InsureContorll {
policy
=
oldPolicy
;
policy
=
oldPolicy
;
policy
.
updateById
();
policy
.
updateById
();
}
}
Result
<
String
>
ossUrl
=
ossService
.
upload
(
policy
.
getId
(),
"policy"
,
file
);
if
(
userList
.
size
()
<=
0
)
{
if
(
userList
.
size
()
<=
0
)
{
throw
new
CustomException
(
"导入错误,人员为空"
);
throw
new
CustomException
(
"导入错误,人员为空"
);
}
}
...
@@ -1232,7 +1238,8 @@ public class InsureContorll {
...
@@ -1232,7 +1238,8 @@ public class InsureContorll {
}
}
InsureLog
.
builder
().
requestParam
(
JSONObject
.
toJSONString
(
map
)).
type
(
9
).
createTime
(
new
Date
()).
requestType
(
2
).
returnBody
(
data
).
requestPath
(
policyDetailUrl
)
InsureLog
.
builder
().
requestParam
(
JSONObject
.
toJSONString
(
map
)).
type
(
9
).
createTime
(
new
Date
()).
requestType
(
2
).
returnBody
(
data
).
requestPath
(
policyDetailUrl
)
.
returnCode
(
returnMap
.
get
(
"errcode"
).
toString
()).
returnMsg
(
returnMap
.
get
(
"errmsg"
).
toString
()).
policyId
(
policy
.
getId
()).
build
().
insert
();
.
returnCode
(
returnMap
.
get
(
"errcode"
).
toString
()).
returnMsg
(
returnMap
.
get
(
"errmsg"
).
toString
())
.
fileUrl
(
ossUrl
.
getData
().
substring
(
5
)).
policyId
(
policy
.
getId
()).
build
().
insert
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"导入保单:"
,
e
);
log
.
error
(
"导入保单:"
,
e
);
throw
new
CustomException
(
"导入保单"
);
throw
new
CustomException
(
"导入保单"
);
...
...
This diff is collapsed.
Click to expand it.
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