Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xnr-interface
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
heli_wms
xnr-interface
Commits
0af51f91
Commit
0af51f91
authored
Dec 13, 2019
by
tank.li@mushiny.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新版的WCS需要从队列取当前工作站消息,我们存在WMS_POD_STATION表里
parent
56a06cb1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
11 deletions
+39
-11
MqListener.java
src/main/java/com/mushiny/heli/xnr/mq/MqListener.java
+35
-8
Sql_Table.java
src/main/java/com/mushiny/heli/xnr/service/Sql_Table.java
+4
-3
No files found.
src/main/java/com/mushiny/heli/xnr/mq/MqListener.java
View file @
0af51f91
...
...
@@ -61,6 +61,8 @@ public class MqListener {
int
stopCellId
=
CommonUtils
.
parseInteger
(
"stopCellId"
,
data
);
String
sectionId
=
this
.
getSectionIdBySid
(
CommonUtils
.
parseInteger
(
"sectionId"
,
data
));
String
workstationId
=
this
.
getWorkstationIdByStopPoint
(
stopCellId
,
sectionId
);
int
podIndex
=
CommonUtils
.
parseInteger
(
"podId"
,
data
);
String
podId
=
this
.
getPodIdByIndex
(
sectionId
,
podIndex
);
/*Integer sectionId;
Integer stopCellId; //停止点
Integer direction;//工作站相对停止点方向
...
...
@@ -68,31 +70,56 @@ public class MqListener {
Integer podDirection;
String taskId;*/
List
<
Map
>
rows
=
this
.
jdbcRepository
.
queryBySql
(
Sql_Table
.
SQL_QUERY_POD_STATION
,
stopCellId
,
workstationId
);
/* `STATION_ID` varchar(255) NOT NULL,
`POD_INDEX` int(11) NOT NULL,
`TOWARD` varchar(255) DEFAULT NULL COMMENT 'ABCD',
`PLACEMARK` int(11) DEFAULT NULL COMMENT '*/
Integer
podDirection
=
CommonUtils
.
parseInteger
(
"podDirection"
,
data
);
int
toward
=
0
;
switch
(
podDirection
){
case
1
:
toward
=
90
;
break
;
case
2
:
toward
=
180
;
break
;
case
3
:
toward
=
270
;
break
;
}
if
(
rows
.
isEmpty
()){
Map
record
=
new
HashMap
();
record
.
putAll
(
data
);
//
record.putAll(data);
//替换掉 便于查询
record
.
put
(
"stopCellId"
,
workstationId
);
record
.
put
(
"sectionId"
,
sectionId
);
record
.
put
(
"PLACEMARK"
,
CommonUtils
.
parseInteger
(
"stopCellId"
,
data
));
record
.
put
(
"SECTION_ID"
,
sectionId
);
record
.
put
(
"STATION_ID"
,
workstationId
);
record
.
put
(
"POD_INDEX"
,
podIndex
);
record
.
put
(
"POD_ID"
,
podId
);
record
.
put
(
"TOWARD"
,
toward
);
CommonUtils
.
genUselessInfo
(
record
);
this
.
jdbcRepository
.
insertRecord
(
Sql_Table
.
TABLE_WMS_POD_STATION
,
record
);
logger
.
debug
(
"新增记录成功"
);
}
else
{
Map
newValue
=
new
HashMap
();
newValue
.
putAll
(
data
);
newValue
.
put
(
"stopCellId"
,
workstationId
);
newValue
.
put
(
"sectionId"
,
sectionId
);
newValue
.
put
(
"PLACEMARK"
,
CommonUtils
.
parseInteger
(
"stopCellId"
,
data
));
newValue
.
put
(
"SECTION_ID"
,
sectionId
);
newValue
.
put
(
"STATION_ID"
,
workstationId
);
newValue
.
put
(
"POD_ID"
,
podId
);
newValue
.
put
(
"POD_INDEX"
,
CommonUtils
.
parseInteger
(
"podId"
,
data
));
newValue
.
put
(
"TOWARD"
,
toward
);
CommonUtils
.
modifyUselessInfo
(
newValue
);
Map
con
=
new
HashMap
();
con
.
put
(
"
stopCellId
"
,
workstationId
);
con
.
put
(
"
sectionId
"
,
sectionId
);
con
.
put
(
"
STATION_ID
"
,
workstationId
);
con
.
put
(
"
SECTION_ID
"
,
sectionId
);
int
ret
=
this
.
jdbcRepository
.
updateRecords
(
Sql_Table
.
TABLE_WMS_POD_STATION
,
newValue
,
con
);
logger
.
debug
(
"更新记录:"
+
data
+
" 结果为:"
+
ret
);
}
}
private
String
getPodIdByIndex
(
String
sectionId
,
int
podIndex
)
{
Map
pod
=
this
.
jdbcRepository
.
queryOneBySql
(
Sql_Table
.
SQL_QUERYPODBYINDEX
,
sectionId
,
podIndex
);
return
CommonUtils
.
parseString
(
"ID"
,
pod
);
}
private
String
getWorkstationIdByStopPoint
(
int
stopCellId
,
String
sectionId
)
{
Map
row
=
this
.
jdbcRepository
.
queryOneBySql
(
Sql_Table
.
SQL_QUERYWDBYSTOP
,
stopCellId
,
sectionId
);
return
CommonUtils
.
parseString
(
"ID"
,
row
);
...
...
src/main/java/com/mushiny/heli/xnr/service/Sql_Table.java
View file @
0af51f91
...
...
@@ -94,10 +94,10 @@ public interface Sql_Table {
"AND RCS_TRIP.TRIP_TYPE=? "
+
"AND RCS_TRIP.POD_ID=? limit 1"
;
String
SQL_QUERY_CURRENTPOD
=
"SELECT
MD_POD.ID, MD_POD.POD_INDEX, MD_POD
.TOWARD, \n"
+
String
SQL_QUERY_CURRENTPOD
=
"SELECT
WMS_POD_STATION.POD_ID, WMS_POD_STATION.POD_INDEX, WMS_POD_STATION
.TOWARD, \n"
+
" MD_WORKSTATION.WORKING_FACE_ORIENTATION, \n"
+
"
MD_POD.PLACEMARK FROM MD_POD
, MD_WORKSTATION \n"
+
" WHERE
MD_POD
.PLACEMARK = MD_WORKSTATION.STOPPOINT \n"
+
"
WMS_POD_STATION.PLACEMARK FROM WMS_POD_STATION
, MD_WORKSTATION \n"
+
" WHERE
WMS_POD_STATION
.PLACEMARK = MD_WORKSTATION.STOPPOINT \n"
+
" AND MD_WORKSTATION.ID = ?"
;
...
...
@@ -192,4 +192,5 @@ public interface Sql_Table {
String
TABLE_WMS_POD_STATION
=
"WMS_POD_STATION"
;
String
SQL_QUERYSECTIONBYSID
=
"SELECT * FROM WD_SECTION WHERE RCS_SECTIONID=?"
;
String
SQL_QUERYWDBYSTOP
=
"SELECT * FROM MD_WORKSTATION WHERE STOPPOINT = ? AND SECTION_ID=?"
;
String
SQL_QUERYPODBYINDEX
=
"SELECT * FROM MD_POD WHERE SECTION_ID=? AND POD_INDEX=?"
;
}
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