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
30101930
Commit
30101930
authored
Dec 17, 2019
by
tank.li@mushiny.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
盘点任务回复
parent
6b966008
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
199 additions
and
15 deletions
+199
-15
HeliWMSController.java
...va/com/mushiny/heli/xnr/controller/HeliWMSController.java
+10
-1
IcqaOrderDTO.java
src/main/java/com/mushiny/heli/xnr/dto/IcqaOrderDTO.java
+63
-0
IcqaOrderPosition.java
...main/java/com/mushiny/heli/xnr/dto/IcqaOrderPosition.java
+64
-0
Sql_Table.java
src/main/java/com/mushiny/heli/xnr/service/Sql_Table.java
+6
-0
WMSRespService.java
...ain/java/com/mushiny/heli/xnr/service/WMSRespService.java
+56
-14
No files found.
src/main/java/com/mushiny/heli/xnr/controller/HeliWMSController.java
View file @
30101930
...
...
@@ -26,9 +26,18 @@ public class HeliWMSController {
private
MqSender
mqSender
;
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
HeliWMSController
.
class
);
//inboundResp
@PostMapping
(
value
=
"/inboundResp"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
MessageDTO
>
inboundResp
(
@RequestBody
String
json
){
logger
.
debug
(
"inboundResp: "
+
json
);
MessageDTO
dto
=
MessageDTO
.
success
();
return
ResponseEntity
.
ok
(
dto
);
}
@PostMapping
(
value
=
"/icqaResp"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
MessageDTO
>
syncItem
(
public
ResponseEntity
<
MessageDTO
>
icqaResp
(
@RequestBody
String
json
){
logger
.
debug
(
"icqaResp: "
+
json
);
MessageDTO
dto
=
MessageDTO
.
success
();
...
...
src/main/java/com/mushiny/heli/xnr/dto/IcqaOrderDTO.java
0 → 100644
View file @
30101930
package
com
.
mushiny
.
heli
.
xnr
.
dto
;
import
org.codehaus.jackson.annotate.JsonIgnore
;
import
org.codehaus.jackson.annotate.JsonProperty
;
import
java.util.List
;
/**
* Created by Lisi on 2019-12-17.
*/
public
class
IcqaOrderDTO
implements
java
.
io
.
Serializable
{
@JsonProperty
(
"ICQAID"
)
private
String
TASKID
;
@JsonProperty
(
"TIMES"
)
private
Integer
TIMES
;
@JsonProperty
(
"FACTORY"
)
private
String
FACTORY
;
@JsonProperty
(
"SECTION"
)
private
String
SECTION
;
@JsonProperty
(
"DATA"
)
List
<
IcqaOrderPosition
>
DATA
;
@JsonIgnore
public
String
getTASKID
()
{
return
TASKID
;
}
@JsonIgnore
public
void
setTASKID
(
String
TASKID
)
{
this
.
TASKID
=
TASKID
;
}
@JsonIgnore
public
Integer
getTIMES
()
{
return
TIMES
;
}
@JsonIgnore
public
void
setTIMES
(
Integer
TIMES
)
{
this
.
TIMES
=
TIMES
;
}
@JsonIgnore
public
String
getFACTORY
()
{
return
FACTORY
;
}
@JsonIgnore
public
void
setFACTORY
(
String
FACTORY
)
{
this
.
FACTORY
=
FACTORY
;
}
@JsonIgnore
public
String
getSECTION
()
{
return
SECTION
;
}
@JsonIgnore
public
void
setSECTION
(
String
SECTION
)
{
this
.
SECTION
=
SECTION
;
}
@JsonIgnore
public
List
<
IcqaOrderPosition
>
getDATA
()
{
return
DATA
;
}
public
void
setDATA
(
List
<
IcqaOrderPosition
>
DATA
)
{
this
.
DATA
=
DATA
;
}
}
src/main/java/com/mushiny/heli/xnr/dto/IcqaOrderPosition.java
0 → 100644
View file @
30101930
package
com
.
mushiny
.
heli
.
xnr
.
dto
;
import
org.codehaus.jackson.annotate.JsonIgnore
;
import
org.codehaus.jackson.annotate.JsonProperty
;
import
java.io.Serializable
;
/**
* 电梯配置
*/
public
class
IcqaOrderPosition
implements
Serializable
{
@JsonProperty
(
"SKUID"
)
private
String
SKUID
;
@JsonProperty
(
"AMOUNT"
)
private
Integer
AMOUNT
;
@JsonProperty
(
"COUNT"
)
private
Integer
COUNT
;
@JsonProperty
(
"STATE"
)
private
String
STATE
;
@JsonProperty
(
"MSG"
)
private
String
MSG
;
@JsonIgnore
public
Integer
getCOUNT
()
{
return
COUNT
;
}
@JsonIgnore
public
void
setCOUNT
(
Integer
COUNT
)
{
this
.
COUNT
=
COUNT
;
}
@JsonIgnore
public
String
getSTATE
()
{
return
STATE
;
}
@JsonIgnore
public
void
setSTATE
(
String
STATE
)
{
this
.
STATE
=
STATE
;
}
@JsonIgnore
public
String
getMSG
()
{
return
MSG
;
}
@JsonIgnore
public
void
setMSG
(
String
MSG
)
{
this
.
MSG
=
MSG
;
}
@JsonIgnore
public
String
getSKUID
()
{
return
SKUID
;
}
@JsonIgnore
public
void
setSKUID
(
String
SKUID
)
{
this
.
SKUID
=
SKUID
;
}
@JsonIgnore
public
Integer
getAMOUNT
()
{
return
AMOUNT
;
}
@JsonIgnore
public
void
setAMOUNT
(
Integer
AMOUNT
)
{
this
.
AMOUNT
=
AMOUNT
;
}
}
src/main/java/com/mushiny/heli/xnr/service/Sql_Table.java
View file @
30101930
...
...
@@ -215,4 +215,10 @@ public interface Sql_Table {
"WHERE STATE='Available' AND POD_FACE=? "
+
"AND POD_ID=? AND WORKSTATION_ID=? limit 1"
;
String
SQL_QUERY_INBOUND_PODORDER_BYENTRYID
=
"SELECT * FROM WMS_INBOUND_PODORDER WHERE ENTRYID=?"
;
String
SQL_QUERY_INBOUND_POSFINISH
=
"SELECT * FROM WMS_INBOUND_ORDER \n"
+
"WHERE WMS_INBOUND_ORDER.NEED_RESP=0 \n"
+
"AND WMS_INBOUND_ORDER.STATE<>'Finish'\n"
+
"AND NOT EXISTS (SELECT 1 FROM WMS_INBOUND_ORDERPOSITION \n"
+
"WHERE WMS_INBOUND_ORDERPOSITION.STATE<>'Finish' \n"
+
"AND WMS_INBOUND_ORDERPOSITION.ENTRYID=WMS_INBOUND_ORDER.ENTRYID)"
;
}
src/main/java/com/mushiny/heli/xnr/service/WMSRespService.java
View file @
30101930
...
...
@@ -3,10 +3,7 @@ package com.mushiny.heli.xnr.service;
import
com.mushiny.heli.xnr.beans.BaseBpo
;
import
com.mushiny.heli.xnr.comm.CommonUtils
;
import
com.mushiny.heli.xnr.comm.JsonUtils
;
import
com.mushiny.heli.xnr.dto.InboundOrderDTO
;
import
com.mushiny.heli.xnr.dto.InboundOrderPosition
;
import
com.mushiny.heli.xnr.dto.OutboundOrderDTO
;
import
com.mushiny.heli.xnr.dto.OutboundOrderPosition
;
import
com.mushiny.heli.xnr.dto.*
;
import
com.mushiny.heli.xnr.jdbc.repositories.JdbcRepository
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -45,6 +42,7 @@ public class WMSRespService {
public
static
final
String
TABLE_OBORDER
=
"WMS_OUTBOUND_ORDER"
;
public
static
final
String
TABLE_IBORDER
=
"WMS_INBOUND_ORDER"
;
public
static
final
String
TABLE_ICQAORDER
=
"WMS_INBOUND_ORDER"
;
public
static
final
String
SQL_QUERYALL_ICQAORDER
=
"SELECT * FROM WMS_ICQA_ORDER,WMS_ICQA_ORDERPOSITION "
+
"WHERE WMS_ICQA_ORDER.TASKID = WMS_ICQA_ORDERPOSITION.TASKID "
+
...
...
@@ -85,22 +83,22 @@ public class WMSRespService {
HttpHeaders
headers
=
this
.
getHttpHeaders
();
List
<
Map
>
data
=
this
.
jdbcRepository
.
queryBySql
(
SQL_QUERYALL_ICQAORDER
,
FINISH
);
List
<
I
nbound
OrderDTO
>
data2
=
this
.
transfer2IcqaDTO
(
data
);
//合并主表记录
List
<
I
cqa
OrderDTO
>
data2
=
this
.
transfer2IcqaDTO
(
data
);
//合并主表记录
for
(
int
i
=
0
;
i
<
data2
.
size
();
i
++)
{
I
nboundOrderDTO
inbound
OrderDTO
=
data2
.
get
(
i
);
String
json
=
JsonUtils
.
bean2Json
(
i
nbound
OrderDTO
);
I
cqaOrderDTO
icqa
OrderDTO
=
data2
.
get
(
i
);
String
json
=
JsonUtils
.
bean2Json
(
i
cqa
OrderDTO
);
logger
.
debug
(
"post data: "
+
json
);
HttpEntity
<
String
>
httpEntity
=
new
HttpEntity
<
String
>(
json
,
headers
);
ResponseEntity
<
String
>
res
=
restTemplate
.
postForEntity
(
this
.
icqaResp_url
,
httpEntity
,
String
.
class
);
Map
result
=
JsonUtils
.
json2Map
(
res
.
getBody
());
logger
.
debug
(
"result: "
+
result
);
if
(
CommonUtils
.
parseInteger
(
"CODE"
,
result
)
==
0
){
logger
.
debug
(
"成功回调"
+
i
nboundOrderDTO
.
getENTRY
ID
());
logger
.
debug
(
"成功回调"
+
i
cqaOrderDTO
.
getTASK
ID
());
Map
newValue
=
new
HashMap
();
newValue
.
put
(
"NEED_RESP"
,
2
);
Map
con
=
new
HashMap
();
con
.
put
(
"TASKID"
,
i
nboundOrderDTO
.
getENTRY
ID
());
this
.
jdbcRepository
.
updateRecords
(
TABLE_I
B
ORDER
,
newValue
,
con
);
con
.
put
(
"TASKID"
,
i
cqaOrderDTO
.
getTASK
ID
());
this
.
jdbcRepository
.
updateRecords
(
TABLE_I
CQA
ORDER
,
newValue
,
con
);
}
}
//检查是否有明细已完成 需要将主表记录更新为完成Finish 本来是一条语句完成的
...
...
@@ -119,8 +117,35 @@ public class WMSRespService {
}
}
private
List
<
InboundOrderDTO
>
transfer2IcqaDTO
(
List
<
Map
>
data
)
{
return
new
ArrayList
<>();
private
List
<
IcqaOrderDTO
>
transfer2IcqaDTO
(
List
<
Map
>
data
)
{
//return new ArrayList<>();
Map
<
String
,
IcqaOrderDTO
>
temp
=
new
HashMap
();
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++)
{
Map
map
=
data
.
get
(
i
);
String
taskid
=
(
String
)
map
.
get
(
"TASKID"
);
if
(
temp
.
get
(
taskid
)
==
null
){
IcqaOrderDTO
inboundOrderDTO
=
new
IcqaOrderDTO
();
inboundOrderDTO
.
setTASKID
(
taskid
);
inboundOrderDTO
.
setSECTION
((
String
)
map
.
get
(
"SECTION_ID"
));
inboundOrderDTO
.
setFACTORY
((
String
)
map
.
get
(
"WAREHOUSE_ID"
));
inboundOrderDTO
.
setTIMES
(
CommonUtils
.
parseInteger
(
"TIMES"
,
map
));
inboundOrderDTO
.
setDATA
(
new
ArrayList
<>());
temp
.
put
(
taskid
,
inboundOrderDTO
);
}
IcqaOrderDTO
icqaOrderDTO
=
temp
.
get
(
taskid
);
//每行一条明细记录
IcqaOrderPosition
icqaOrderPosition
=
new
IcqaOrderPosition
();
icqaOrderPosition
.
setSKUID
((
String
)
map
.
get
(
"SKUID"
));
icqaOrderPosition
.
setAMOUNT
(
CommonUtils
.
parseInteger
(
"AMOUNT"
,
map
));
icqaOrderPosition
.
setMSG
(
CommonUtils
.
parseString
(
"MSG"
,
map
));
icqaOrderPosition
.
setSTATE
(
CommonUtils
.
parseString
(
"STATE"
,
map
));
icqaOrderPosition
.
setCOUNT
(
CommonUtils
.
parseInteger
(
"COUNT"
,
map
));
icqaOrderDTO
.
getDATA
().
add
(
icqaOrderPosition
);
}
//返回所有
return
new
ArrayList
<>(
temp
.
values
());
}
@Scheduled
(
fixedDelay
=
50
*
1000L
)
...
...
@@ -150,6 +175,23 @@ public class WMSRespService {
this
.
jdbcRepository
.
updateRecords
(
TABLE_IBORDER
,
newValue
,
con
);
}
}
//检查是否有任务完成的 将 NEED_RESP 修改成1
//检查是否有明细已完成 需要将主表记录更新为完成Finish 本来是一条语句完成的
List
<
Map
>
allFinishedInbound
=
this
.
jdbcRepository
.
queryBySql
(
Sql_Table
.
SQL_QUERY_INBOUND_POSFINISH
);
for
(
int
i
=
0
;
i
<
allFinishedInbound
.
size
();
i
++)
{
Map
icqaOrder
=
allFinishedInbound
.
get
(
i
);
BaseBpo
baseBpo
=
new
BaseBpo
();
baseBpo
.
setTable
(
Sql_Table
.
WMS_INBOUND_ORDER
);
baseBpo
.
setId
(
CommonUtils
.
parseString
(
"ENTRYID"
,
icqaOrder
));
baseBpo
.
setIdName
(
"ENTRYID"
);
baseBpo
.
addKV
(
"STATE"
,
Sql_Table
.
FINISH
);
baseBpo
.
addKV
(
"NEED_RESP"
,
1
);
CommonUtils
.
modifyUselessInfo
(
baseBpo
.
getKv
());
this
.
jdbcRepository
.
updateBusinessObject
(
baseBpo
);
}
}
private
HttpHeaders
getHttpHeaders
()
{
...
...
@@ -244,8 +286,8 @@ public class WMSRespService {
if
(
temp
.
get
(
entryId
)
==
null
){
InboundOrderDTO
inboundOrderDTO
=
new
InboundOrderDTO
();
inboundOrderDTO
.
setENTRYID
(
entryId
);
inboundOrderDTO
.
setSECTION
((
String
)
map
.
get
(
"SECTION"
));
inboundOrderDTO
.
setFACTORY
((
String
)
map
.
get
(
"
FACTORY
"
));
inboundOrderDTO
.
setSECTION
((
String
)
map
.
get
(
"SECTION
_ID
"
));
inboundOrderDTO
.
setFACTORY
((
String
)
map
.
get
(
"
WAREHOUSE_ID
"
));
inboundOrderDTO
.
setTIMES
(
CommonUtils
.
parseInteger
(
"TIMES"
,
map
));
inboundOrderDTO
.
setDATA
(
new
ArrayList
<>());
temp
.
put
(
entryId
,
inboundOrderDTO
);
...
...
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