Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bme-access-upload
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李洪明
bme-access-upload
Commits
818b3b36
Commit
818b3b36
authored
Jul 12, 2025
by
曹军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传定时任务,优化代码
parent
c6f65f1e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
0 deletions
+75
-0
PlateColorEnums.java
...a/com/bme/access/upload/module/enums/PlateColorEnums.java
+62
-0
NoneRoadMovementInfoService.java
...ss/upload/module/service/NoneRoadMovementInfoService.java
+2
-0
TestController.java
...java/com/bme/access/upload/module/web/TestController.java
+11
-0
No files found.
src/main/java/com/bme/access/upload/module/enums/PlateColorEnums.java
0 → 100644
View file @
818b3b36
package
com
.
bme
.
access
.
upload
.
module
.
enums
;
import
lombok.Getter
;
import
org.springframework.util.StringUtils
;
import
java.util.Objects
;
/**
* description:
* <p></p>
*
* @author huanghao
* @since 2021/8/22 16:03
* Copyright: 2021, BME (Shanghai) Co., Ltd. All Rights Reserved.
*/
@Getter
public
enum
PlateColorEnums
{
BLUE
(
1
,
"蓝牌"
),
YELLOW
(
2
,
"黄牌"
),
WHITE
(
3
,
"白牌"
),
BLACK
(
4
,
"黑牌"
),
GREEN
(
5
,
"绿牌"
),
YELLOW_AND_GREEN
(
6
,
"黄绿牌"
),
DEFAULT
(
0
,
"未知"
);
private
Integer
type
;
private
String
color
;
PlateColorEnums
(
int
type
,
String
color
)
{
this
.
type
=
type
;
this
.
color
=
color
;
}
public
static
String
getColor
(
Integer
type
,
String
numberPlate
)
{
if
(!
StringUtils
.
isEmpty
(
numberPlate
)){
if
(
numberPlate
.
length
()
==
8
&&
(!
Objects
.
equals
(
type
,
PlateColorEnums
.
GREEN
.
type
)
&&
!
Objects
.
equals
(
type
,
PlateColorEnums
.
YELLOW_AND_GREEN
.
type
))){
return
PlateColorEnums
.
YELLOW_AND_GREEN
.
color
;
}
}
PlateColorEnums
[]
plateColorEnums
=
values
();
for
(
PlateColorEnums
plateColorEnum
:
plateColorEnums
){
if
(
plateColorEnum
.
type
.
equals
(
type
)){
return
plateColorEnum
.
color
;
}
}
return
PlateColorEnums
.
DEFAULT
.
color
;
}
public
static
Integer
getType
(
String
color
)
{
PlateColorEnums
[]
plateColorEnums
=
values
();
for
(
PlateColorEnums
plateColorEnum
:
plateColorEnums
){
if
(
plateColorEnum
.
color
.
equals
(
color
)){
return
plateColorEnum
.
type
;
}
}
return
PlateColorEnums
.
DEFAULT
.
type
;
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
getColor
(
1
,
"晋L02690D"
));
}
}
src/main/java/com/bme/access/upload/module/service/NoneRoadMovementInfoService.java
View file @
818b3b36
...
...
@@ -39,8 +39,10 @@ public class NoneRoadMovementInfoService {
}
}
for
(
NoneRoadMovementInfo
noneRoadMovementInfo
:
noneRoadMovementInfos
)
{
log
.
info
(
"上传非道路数据编号={}"
,
noneRoadMovementInfo
.
getHbCarNo
());
String
bodyJson
=
JSONObject
.
toJSONString
(
noneRoadMovementInfo
);
HttpUtils
.
sendPost
(
NON_WAY_URL
,
null
,
null
,
bodyJson
);
Thread
.
sleep
(
1000
);
}
log
.
info
(
"上传非道路电子台账共: {}条"
,
noneRoadMovementInfoUrls
.
size
());
}
...
...
src/main/java/com/bme/access/upload/module/web/TestController.java
View file @
818b3b36
...
...
@@ -9,6 +9,7 @@ import com.bme.access.upload.model.InAndOutDateUrl;
import
com.bme.access.upload.model.MaterialInfo
;
import
com.bme.access.upload.model.TransportDate
;
import
com.bme.access.upload.module.service.InFactoryTransportVehicleInfoService
;
import
com.bme.access.upload.module.service.NoneRoadMovementInfoService
;
import
com.bme.access.upload.module.service.TransportVehicleInfoService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -37,6 +38,8 @@ public class TestController {
private
InFactoryTransportVehicleInfoService
inFactoryTransportVehicleInfoService
;
@Resource
private
TransportVehicleInfoService
transportVehicleInfoService
;
@Resource
private
NoneRoadMovementInfoService
noneRoadMovementInfoService
;
@GetMapping
(
"/uploadInAndOutDate"
)
public
CommonResult
uploadInAndOutDate
()
throws
Exception
{
...
...
@@ -140,5 +143,13 @@ public class TestController {
transportVehicleInfoService
.
updateVehicle
(
numberPlate
);
}
/**
* 上传非道路
*/
@GetMapping
(
"/uploadNoWay"
)
public
void
uploadNoWay
()
throws
Exception
{
noneRoadMovementInfoService
.
getNoWayDate
();
}
}
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