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
4f452ff9
Commit
4f452ff9
authored
Jun 01, 2022
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8小时后台--
异常输出记录到日志
parent
902d8608
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
127 additions
and
42 deletions
+127
-42
sql/insure_policy.sql
+1
-0
src/main/java/cn/timer/api/bean/kqgl/AttendanceAssistant.java
+1
-1
src/main/java/cn/timer/api/controller/insure/CallBackContorll.java
+5
-5
src/main/java/cn/timer/api/controller/insure/InsureApplicantController.java
+4
-3
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
+39
-29
src/main/java/cn/timer/api/utils/ExcelUtils.java
+1
-1
src/main/java/cn/timer/api/utils/aliyun/OSSUtil.java
+75
-2
src/main/java/cn/timer/api/utils/schedule/RemindUtil.java
+0
-0
src/main/resources/application.yml
+1
-1
No files found.
sql/insure_policy.sql
View file @
4f452ff9
...
...
@@ -197,3 +197,4 @@ ALTER TABLE `insure_product`
ALTER
TABLE
`insure_policy`
ADD
COLUMN
`policy_pay_type`
int
(
11
)
NOT
NULL
DEFAULT
1
COMMENT
'1在线支付 2预付款 3线下支付'
AFTER
`create_time`
,
ADD
COLUMN
`pay_id`
int
(
11
)
NULL
DEFAULT
NULL
COMMENT
'insure_pay表的id'
AFTER
`policy_pay_type`
;
src/main/java/cn/timer/api/bean/kqgl/AttendanceAssistant.java
View file @
4f452ff9
...
...
@@ -58,5 +58,5 @@ public class AttendanceAssistant implements Serializable{
int
restdayclock
;
//休息日打卡
String
Page
transferDate
;
//页面传输修改日期
String
transferDate
;
//页面传输修改日期
}
src/main/java/cn/timer/api/controller/insure/CallBackContorll.java
View file @
4f452ff9
...
...
@@ -160,7 +160,7 @@ public class CallBackContorll {
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"增员核保回调异常:"
,
e
);
throw
new
CustomException
(
"增员核保回调异常"
);
}
finally
{
Map
trueMap
=
Maps
.
newHashMap
();
...
...
@@ -256,7 +256,7 @@ public class CallBackContorll {
insurePolicy
.
updateById
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"保全增员申请回调异常:"
,
e
);
throw
new
CustomException
(
"保全增员申请回调异常"
);
}
finally
{
Map
trueMap
=
Maps
.
newHashMap
();
...
...
@@ -328,7 +328,7 @@ public class CallBackContorll {
.
returnCode
(
dataMap
.
get
(
"errcode"
).
toString
()).
policyId
(
insurePay
.
getPolicyId
()).
returnMsg
(
dataMap
.
get
(
"errmsg"
).
toString
()).
build
().
insert
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"投保支付收银台回调异常:"
,
e
);
throw
new
CustomException
(
"投保支付收银台回调异常"
);
}
finally
{
Map
map
=
Maps
.
newHashMap
();
...
...
@@ -383,7 +383,7 @@ public class CallBackContorll {
InsureLog
.
builder
().
type
(
7
).
createTime
(
new
Date
()).
requestType
(
1
).
returnBody
(
sb
.
toString
()).
requestPath
(
getPolicyUrl
)
.
returnCode
(
callBack
.
getStatus
()).
policyId
(
insurePay
.
getPolicyId
()).
returnMsg
(
callBack
.
getErr_msg
()).
build
().
insert
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"保单出单回调:"
,
e
);
throw
new
CustomException
(
"保单出单回调"
);
}
finally
{
Map
map
=
Maps
.
newHashMap
();
...
...
@@ -415,7 +415,7 @@ public class CallBackContorll {
InsureLog
.
builder
().
type
(
7
).
createTime
(
new
Date
()).
requestType
(
1
).
returnBody
(
sb
.
toString
()).
requestPath
(
base_api_url
+
"/callBack/policy/batchPayCallback"
)
.
returnCode
(
callBack
.
getPay_status
()).
policyId
(
insurePay
.
getPolicyId
()).
returnMsg
(
"确认支付成功,支付方式:"
+
insurePay
.
getPayType
()
+
",支付金额:"
+
insurePay
.
getAmount
()).
build
().
insert
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"增员支付回调异常:"
,
e
);
throw
new
CustomException
(
"增员支付回调异常"
);
}
finally
{
Map
map
=
Maps
.
newHashMap
();
...
...
src/main/java/cn/timer/api/controller/insure/InsureApplicantController.java
View file @
4f452ff9
...
...
@@ -46,6 +46,7 @@ import org.springframework.web.multipart.MultipartFile;
@Transactional
@RequestMapping
(
value
=
"/insureApplicant"
,
produces
=
{
"application/json"
})
public
class
InsureApplicantController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
InsureApplicantController
.
class
);
@PostMapping
(
"/insureApplicationSetting"
)
@ApiOperation
(
value
=
"设置投保人"
,
httpMethod
=
"POST"
,
notes
=
"投保申请"
)
...
...
@@ -56,7 +57,7 @@ public class InsureApplicantController {
params
.
updateById
();
return
ResultUtil
.
data
(
params
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"设置投保人异常:"
,
e
);
throw
new
CustomException
(
"设置投保人异常"
);
}
}
...
...
@@ -75,7 +76,7 @@ public class InsureApplicantController {
}
return
ResultUtil
.
data
(
insureApplicant
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"获取投保人异常:"
,
e
);
throw
new
CustomException
(
"获取投保人异常"
);
}
}
...
...
@@ -107,7 +108,7 @@ public class InsureApplicantController {
}
return
ResultUtil
.
data
(
insureApplicant
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"获取投保人异常:"
,
e
);
throw
new
CustomException
(
"获取投保人异常"
);
}
}
...
...
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
View file @
4f452ff9
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/utils/ExcelUtils.java
View file @
4f452ff9
...
...
@@ -504,7 +504,7 @@ public class ExcelUtils {
}
else
if
(
xssfCell
.
getCellTypeEnum
()
==
CellType
.
BOOLEAN
)
{
return
String
.
valueOf
(
xssfCell
.
getBooleanCellValue
());
}
else
{
return
xssfCell
.
getStringCellValue
();
return
xssfCell
.
getStringCellValue
()
.
trim
()
;
}
}
}
...
...
src/main/java/cn/timer/api/utils/aliyun/OSSUtil.java
View file @
4f452ff9
...
...
@@ -8,11 +8,15 @@ import java.util.*;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipOutputStream
;
import
cn.timer.api.config.sftp.SftpConfiguration
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.jcraft.jsch.ChannelSftp
;
import
io.swagger.models.auth.In
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.bouncycastle.jce.exception.ExtIOException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -77,6 +81,11 @@ public class OSSUtil {
@Value
(
"${zip.path}"
)
private
String
zipPath
;
@Autowired
private
SftpConfiguration
config
;
/**
* 1.创建储存空间 sout控制台輸出 储存空间名
*
...
...
@@ -594,10 +603,10 @@ public class OSSUtil {
String
Suffix
;
try
{
File
folder
=
new
File
(
zipPath
);
if
(!
folder
.
exists
()&&
!
folder
.
isDirectory
())
{
if
(!
folder
.
exists
()
&&
!
folder
.
isDirectory
())
{
folder
.
mkdirs
();
}
fos
=
new
FileOutputStream
(
zipPath
+
fileName
);
fos
=
new
FileOutputStream
(
zipPath
+
fileName
);
zos
=
new
ZipOutputStream
(
fos
);
OSS
ossClient
=
new
OSSClientBuilder
().
build
(
endpoint
,
accessKeyId
,
accessKeySecret
);
for
(
String
m
:
urlMap
.
keySet
())
{
...
...
@@ -641,4 +650,68 @@ public class OSSUtil {
}
return
fileName
;
}
/**
* @Author wgd
* @Description 获取OSS文件字符流
* @Date 2021/12/2 18:06
**/
private
Map
getOssFileList
(
Map
<
String
,
String
>
urlMap
)
throws
IOException
{
Map
<
String
,
InputStream
>
map
=
Maps
.
newHashMap
();
BufferedInputStream
inputStream
;
OSSObject
ossObject
;
OSS
ossClient
=
new
OSSClientBuilder
().
build
(
endpoint
,
accessKeyId
,
accessKeySecret
);
for
(
String
m
:
urlMap
.
keySet
())
{
ossObject
=
ossClient
.
getObject
(
bucketName
,
urlMap
.
get
(
m
));
inputStream
=
new
BufferedInputStream
(
ossObject
.
getObjectContent
());
String
suffix
=
urlMap
.
get
(
m
).
substring
(
urlMap
.
get
(
m
).
lastIndexOf
(
"."
));
map
.
put
(
m
+
urlMap
.
get
(
m
),
inputStream
);
}
ossClient
.
shutdown
();
return
map
;
}
private
Map
getFtpFileList
(
Map
<
String
,
String
>
urlMap
)
throws
IOException
{
Map
<
String
,
InputStream
>
map
=
Maps
.
newHashMap
();
InputStream
inputStream
;
for
(
String
m
:
urlMap
.
keySet
())
{
File
file
=
new
File
(
urlMap
.
get
(
m
));
inputStream
=
new
FileInputStream
(
file
);
map
.
put
(
m
,
inputStream
);
}
return
map
;
}
public
String
newZip
(
Map
<
String
,
String
>
ossMap
,
Map
<
String
,
String
>
ftpMap
)
throws
IOException
{
Map
<
String
,
InputStream
>
ossNewMap
=
getOssFileList
(
ossMap
);
Map
<
String
,
InputStream
>
ftpNewMap
=
getFtpFileList
(
ftpMap
);
ossNewMap
.
putAll
(
ftpNewMap
);
DateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
);
String
fileName
=
dateFormat
.
format
(
new
Date
())
+
".zip"
;
FileOutputStream
fos
=
null
;
ZipOutputStream
zos
=
null
;
InputStream
inputStream
=
null
;
for
(
String
m
:
ossNewMap
.
keySet
())
{
ZipEntry
entry
=
new
ZipEntry
(
m
);
try
{
zos
.
putNextEntry
(
entry
);
int
nNumber
;
byte
[]
buffer
=
new
byte
[
4096
];
while
((
nNumber
=
ossNewMap
.
get
(
m
).
read
(
buffer
))
>
0
)
{
zos
.
write
(
buffer
,
0
,
nNumber
);
}
}
catch
(
IOException
e
)
{
throw
new
IOException
(
"写入失败"
);
//TODO 应作为自定义异常
}
finally
{
try
{
inputStream
.
close
();
}
catch
(
IOException
e
)
{
throw
new
IOException
(
"关闭失败"
);
//TODO 应作为自定义异常
}
}
}
return
fileName
;
}
}
src/main/java/cn/timer/api/utils/schedule/RemindUtil.java
View file @
4f452ff9
src/main/resources/application.yml
View file @
4f452ff9
spring
:
profiles
:
active
:
test
active
:
dev
#active: '@environment@'
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