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
80441277
Commit
80441277
authored
Jul 10, 2025
by
李洪明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加日志
parent
cfcc68e1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
9 deletions
+24
-9
InAndOutDateService.java
...bme/access/upload/module/service/InAndOutDateService.java
+8
-2
TransportDateService.java
...me/access/upload/module/service/TransportDateService.java
+8
-2
TestController.java
...java/com/bme/access/upload/module/web/TestController.java
+8
-5
No files found.
src/main/java/com/bme/access/upload/module/service/InAndOutDateService.java
View file @
80441277
...
...
@@ -10,6 +10,8 @@ import com.bme.access.upload.module.dao.InAndOutDateUploadFailMapper;
import
com.bme.access.upload.module.dao.InAndOutDateUrlMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -64,13 +66,17 @@ public class InAndOutDateService {
InAndOutDate
inAndOutDate
=
this
.
convertInAndOutDate
(
inAndOutDateUrl
);
try
{
String
bodyJson
=
JSONObject
.
toJSONString
(
inAndOutDate
);
HttpUtils
.
sendPost
(
IN_AND_OUT_DATE_URL
,
null
,
null
,
bodyJson
);
HttpResponse
response
=
HttpUtils
.
sendPost
(
IN_AND_OUT_DATE_URL
,
null
,
null
,
bodyJson
);
String
b
=
EntityUtils
.
toString
(
response
.
getEntity
());
log
.
info
(
"添加进出厂记录结果:{}"
,
b
);
dataUploadTimeMapper
.
updateUploadTimeByType
(
inAndOutDateUrl
.
getInOutTime
(),
103
);
}
catch
(
Exception
e
)
{
log
.
info
(
"过车记录上传失败,重新上传一次{}"
,
e
.
getMessage
());
try
{
String
bodyJson
=
JSONObject
.
toJSONString
(
inAndOutDate
);
HttpUtils
.
sendPost
(
IN_AND_OUT_DATE_URL
,
null
,
null
,
bodyJson
);
HttpResponse
response
=
HttpUtils
.
sendPost
(
IN_AND_OUT_DATE_URL
,
null
,
null
,
bodyJson
);
String
b
=
EntityUtils
.
toString
(
response
.
getEntity
());
log
.
info
(
"添加进出厂记录结果:{}"
,
b
);
}
catch
(
Exception
ex
)
{
log
.
info
(
"再次失败,此条数据存于失败表里{}"
,
ex
.
getMessage
());
inAndOutDateUrl
.
setMsg
(
ex
.
getMessage
());
...
...
src/main/java/com/bme/access/upload/module/service/TransportDateService.java
View file @
80441277
...
...
@@ -9,6 +9,8 @@ import com.bme.access.upload.module.dao.DataUploadTimeMapper;
import
com.bme.access.upload.module.dao.TransportDateMapper
;
import
com.bme.access.upload.module.dao.TransportDateUploadFailMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -62,13 +64,17 @@ public class TransportDateService {
MaterialInfo
materialInfo
=
this
.
convertMaterialInfo
(
transportDate
);
try
{
String
bodyJson
=
JSONObject
.
toJSONString
(
materialInfo
);
HttpUtils
.
sendPost
(
CARGO_URL
,
null
,
null
,
bodyJson
);
HttpResponse
response
=
HttpUtils
.
sendPost
(
CARGO_URL
,
null
,
null
,
bodyJson
);
String
b
=
EntityUtils
.
toString
(
response
.
getEntity
());
log
.
info
(
"添加物料信息结果:{}"
,
b
);
dataUploadTimeMapper
.
updateUploadTimeByType
(
transportDate
.
getInoutTime
(),
104
);
}
catch
(
Exception
e
)
{
log
.
info
(
"货物上传失败,重新上传一次{}"
,
e
.
getMessage
());
try
{
String
bodyJson
=
JSONObject
.
toJSONString
(
materialInfo
);
HttpUtils
.
sendPost
(
CARGO_URL
,
null
,
null
,
bodyJson
);
HttpResponse
response
=
HttpUtils
.
sendPost
(
CARGO_URL
,
null
,
null
,
bodyJson
);
String
b
=
EntityUtils
.
toString
(
response
.
getEntity
());
log
.
info
(
"添加物料信息结果:{}"
,
b
);
}
catch
(
Exception
ex
)
{
log
.
info
(
"再次失败,此条数据存于失败表里{}"
,
ex
.
getMessage
());
transportDate
.
setMsg
(
ex
.
getMessage
());
...
...
src/main/java/com/bme/access/upload/module/web/TestController.java
View file @
80441277
...
...
@@ -12,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -32,8 +33,8 @@ public class TestController {
// 313683 川L99718 2025-07-09 16:07:36.210 http://192.168.2.80:8080/250709/Vehicle_Plate/16_7_36_140.jpg 2 GC_1MEN http://192.168.2.80:8080/250709/ALL_Vehicle_SmallPlate/16_7_36_207.jpg 2 1 1 1752048456
InAndOutDateUrl
inAndOutDateUrl
=
new
InAndOutDateUrl
();
inAndOutDateUrl
.
setId
(
313683
);
inAndOutDateUrl
.
setNumberPlate
(
"
川L99718
"
);
inAndOutDateUrl
.
setInOutTime
(
"2025-07-09 16:07:36
.210
"
);
inAndOutDateUrl
.
setNumberPlate
(
"
冀E2585Z
"
);
inAndOutDateUrl
.
setInOutTime
(
"2025-07-09 16:07:36"
);
inAndOutDateUrl
.
setInOutImage
(
"http://192.168.2.80:8080/250709/Vehicle_Plate/16_7_36_140.jpg"
);
inAndOutDateUrl
.
setInOrOut
(
2
);
inAndOutDateUrl
.
setGatePostCode
(
"GC_1MEN"
);
...
...
@@ -42,6 +43,8 @@ public class TestController {
try
{
String
bodyJson
=
JSONObject
.
toJSONString
(
inAndOutDate
);
HttpResponse
response
=
HttpUtils
.
sendPost
(
IN_AND_OUT_DATE_URL
,
null
,
null
,
bodyJson
);
String
b
=
EntityUtils
.
toString
(
response
.
getEntity
());
String
a
=
""
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
}
...
...
@@ -87,11 +90,11 @@ public class TestController {
inAndOutDate
.
setBarriernumber
(
""
);
}
// 货物信息
inAndOutDate
.
setCargoname
(
""
);
inAndOutDate
.
setCargoquantity
(
""
);
inAndOutDate
.
setCargoname
(
"
生石灰块
"
);
inAndOutDate
.
setCargoquantity
(
"
33.52
"
);
inAndOutDate
.
setUnit
(
"T"
);
// 车队信息
inAndOutDate
.
setFleetname
(
""
);
inAndOutDate
.
setFleetname
(
"
111
"
);
// 进出厂流水号
String
timeStr
=
Objects
.
requireNonNull
(
DateUtils
.
format
(
DateUtils
.
toDate
(
inAndOutDateUrl
.
getInOutTime
()),
DateUtils
.
DATE_FORMAT_MIN
)).
substring
(
0
,
DateUtils
.
DATE_FORMAT_MIN
.
length
());
String
rsn
=
COMPANY_CODE
+
timeStr
+
inAndOutDateUrl
.
getInOrOut
();
...
...
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