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
323c891f
Commit
323c891f
authored
Jul 09, 2025
by
李洪明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加上传进出厂记录
parent
8a7baf31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
3 deletions
+39
-3
TestController.java
...java/com/bme/access/upload/module/web/TestController.java
+39
-3
No files found.
src/main/java/com/bme/access/upload/module/web/TestController.java
View file @
323c891f
...
...
@@ -6,6 +6,8 @@ import com.bme.access.upload.common.DateUtils;
import
com.bme.access.upload.common.HttpUtils
;
import
com.bme.access.upload.model.InAndOutDate
;
import
com.bme.access.upload.model.InAndOutDateUrl
;
import
com.bme.access.upload.model.MaterialInfo
;
import
com.bme.access.upload.model.TransportDate
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.http.HttpEntity
;
...
...
@@ -22,11 +24,11 @@ import java.util.Objects;
public
class
TestController
{
private
final
static
String
IN_AND_OUT_DATE_URL
=
"https://dctapi.soszyzg.com/dct/new/addInAndOut"
;
private
final
static
String
CARGO_URL
=
"https://dctapi.soszyzg.com/dct/addCargo"
;
private
final
static
String
COMPANY_CODE
=
"1302847854"
;
@GetMapping
(
"/uploadInAndDate"
)
public
CommonResult
uploadInAndDate
()
throws
Exception
{
@GetMapping
(
"/uploadInAnd
Out
Date"
)
public
CommonResult
uploadInAnd
Out
Date
()
throws
Exception
{
// 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
);
...
...
@@ -46,6 +48,28 @@ public class TestController {
return
CommonResult
.
success
(
"成功"
);
}
@GetMapping
(
"/uploadTransportDate"
)
public
CommonResult
uploadTransportDate
()
throws
Exception
{
// 川LD8228 废钢 34.03 2024-04-30 19:38:17.000 1 1 202405010001 欧冶链金再生资源有限公司西部分公司 1 2024-04-30 19:38:17.000 1
TransportDate
transportDate
=
new
TransportDate
();
transportDate
.
setTransportName
(
"废钢"
);
transportDate
.
setTransportVolume
(
34.03
);
transportDate
.
setInOut
(
1
);
transportDate
.
setInoutTime
(
"2024-04-30 19:38:17.000"
);
MaterialInfo
materialInfo
=
this
.
convertMaterialInfo
(
transportDate
);
try
{
String
bodyJson
=
JSONObject
.
toJSONString
(
materialInfo
);
HttpResponse
response
=
HttpUtils
.
sendPost
(
CARGO_URL
,
null
,
null
,
bodyJson
);
HttpEntity
entity
=
response
.
getEntity
();
String
a
=
""
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
}
return
CommonResult
.
success
(
"成功"
);
}
private
InAndOutDate
convertInAndOutDate
(
InAndOutDateUrl
inAndOutDateUrl
)
{
InAndOutDate
inAndOutDate
=
new
InAndOutDate
();
inAndOutDate
.
setInOutAttribute
(
"1"
);
...
...
@@ -74,4 +98,16 @@ public class TestController {
inAndOutDate
.
setEntryexitflownumber
(
rsn
);
return
inAndOutDate
;
}
public
MaterialInfo
convertMaterialInfo
(
TransportDate
transportDate
)
{
MaterialInfo
materialInfo
=
new
MaterialInfo
();
materialInfo
.
setCargoname
(
transportDate
.
getTransportName
());
materialInfo
.
setUnit
(
"T"
);
materialInfo
.
setCargoquantity
(
transportDate
.
getTransportVolume
().
toString
());
// 进出厂流水号
String
timeStr
=
Objects
.
requireNonNull
(
DateUtils
.
format
(
DateUtils
.
toDate
(
transportDate
.
getInoutTime
()),
DateUtils
.
DATE_FORMAT_MIN
)).
substring
(
0
,
DateUtils
.
DATE_FORMAT_MIN
.
length
());
String
rsn
=
COMPANY_CODE
+
timeStr
+
transportDate
.
getInOut
();
materialInfo
.
setEntryexitflownumber
(
rsn
);
return
materialInfo
;
}
}
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