Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
谢明辉
/
vion-label
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 51bc347f
authored
Aug 19, 2021
by
xmh
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
匹配bug修复,代码优化
1 parent
6e44e6cb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
9 deletions
label-platform/src/main/java/com/viontech/label/platform/service/main/ReidService.java
label-tool-keliu/src/main/java/com/viontech/label/tool/keliu/config/WebConfig.java
label-tool-keliu/src/main/java/com/viontech/label/tool/keliu/service/LocalFileServiceImpl.java
label-tool-keliu/src/main/java/com/viontech/label/tool/keliu/service/OnlineFileServiceImpl.java
label-platform/src/main/java/com/viontech/label/platform/service/main/ReidService.java
View file @
51bc347
...
...
@@ -325,7 +325,7 @@ public class ReidService {
Date
max
=
DateUtil
.
addMinutes
(
pic
.
getCreateTime
(),
timeInterval
);
Date
min
=
DateUtil
.
addMinutes
(
pic
.
getCreateTime
(),
-
timeInterval
);
countTimeLTE
=
countTimeLTE
==
null
?
max
:
max
.
compareTo
(
countTimeLTE
)
>
0
?
max
:
countTimeLTE
;
countTimeGTE
=
countTimeGTE
==
null
?
min
:
min
.
compareTo
(
countTimeGTE
)
<
0
?
min
:
countTime
L
TE
;
countTimeGTE
=
countTimeGTE
==
null
?
min
:
min
.
compareTo
(
countTimeGTE
)
<
0
?
min
:
countTime
G
TE
;
}
BodyFeature
feature
=
storageUtils
.
getBodyFeature
(
picId
);
...
...
label-tool-keliu/src/main/java/com/viontech/label/tool/keliu/config/WebConfig.java
View file @
51bc347
...
...
@@ -5,6 +5,10 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import
com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter
;
import
com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider
;
import
com.viontech.label.core.base.DateConverter
;
import
com.viontech.label.tool.keliu.service.FileService
;
import
com.viontech.label.tool.keliu.service.LocalFileServiceImpl
;
import
com.viontech.label.tool.keliu.service.OnlineFileServiceImpl
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.web.client.RestTemplateBuilder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -48,6 +52,19 @@ public class WebConfig implements WebMvcConfigurer {
return
restTemplateBuilder
.
build
();
}
@Bean
(
"fileService"
)
@ConditionalOnProperty
(
"vion.keliu-image-path"
)
public
FileService
localFileService
()
{
return
new
LocalFileServiceImpl
();
}
@Bean
(
"fileService"
)
@ConditionalOnProperty
(
"vion.keliu-image-url"
)
public
FileService
onlineFileService
()
{
return
new
OnlineFileServiceImpl
();
}
@Configuration
public
static
class
CorsConfig
{
@Bean
...
...
label-tool-keliu/src/main/java/com/viontech/label/tool/keliu/service/LocalFileServiceImpl.java
View file @
51bc347
package
com
.
viontech
.
label
.
tool
.
keliu
.
service
;
import
com.viontech.label.tool.keliu.config.VionConfig
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.io.FileUtils
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.io.File
;
...
...
@@ -14,12 +13,15 @@ import java.io.File;
* @author 谢明辉
* @date 2021/7/9
*/
@Service
(
"fileService"
)
@ConditionalOnProperty
(
"vion.keliu-image-path"
)
@Slf4j
public
class
LocalFileServiceImpl
implements
FileService
{
@Resource
private
VionConfig
vionConfig
;
public
LocalFileServiceImpl
()
{
log
.
info
(
"======================= LocalFileServiceImpl ======================="
);
}
@Override
public
byte
[]
getFile
(
String
filePath
)
{
try
{
...
...
label-tool-keliu/src/main/java/com/viontech/label/tool/keliu/service/OnlineFileServiceImpl.java
View file @
51bc347
package
com
.
viontech
.
label
.
tool
.
keliu
.
service
;
import
com.viontech.label.tool.keliu.config.VionConfig
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.stereotype.Service
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.client.RestTemplate
;
import
javax.annotation.Resource
;
...
...
@@ -13,8 +12,7 @@ import javax.annotation.Resource;
* @author 谢明辉
* @date 2021/7/9
*/
@Service
(
"fileService"
)
@ConditionalOnProperty
(
"vion.keliu-image-url"
)
@Slf4j
public
class
OnlineFileServiceImpl
implements
FileService
{
@Resource
...
...
@@ -22,6 +20,10 @@ public class OnlineFileServiceImpl implements FileService {
@Resource
private
RestTemplate
restTemplate
;
public
OnlineFileServiceImpl
()
{
log
.
info
(
"======================= OnlineFileServiceImpl ======================="
);
}
@Override
public
byte
[]
getFile
(
String
filePath
)
{
return
restTemplate
.
getForObject
(
vionConfig
.
getKeliuImageUrl
()
+
filePath
,
byte
[].
class
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment