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
570ac0af
Commit
570ac0af
authored
Dec 12, 2019
by
tank.li@mushiny.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拣货任务完善,出库单与系统绑定 完成后反馈
parent
5082c6fd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
4 deletions
+59
-4
HeliWMSController.java
...va/com/mushiny/heli/xnr/controller/HeliWMSController.java
+33
-0
Sql_Table.java
src/main/java/com/mushiny/heli/xnr/service/Sql_Table.java
+5
-0
WMSRespService.java
...ain/java/com/mushiny/heli/xnr/service/WMSRespService.java
+21
-4
No files found.
src/main/java/com/mushiny/heli/xnr/controller/HeliWMSController.java
0 → 100644
View file @
570ac0af
package
com
.
mushiny
.
heli
.
xnr
.
controller
;
import
com.mushiny.heli.xnr.comm.JsonUtils
;
import
com.mushiny.heli.xnr.dto.ItemDTO
;
import
com.mushiny.heli.xnr.dto.MessageDTO
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 用于模拟合力WMS接收
*/
@RestController
@RequestMapping
(
"/heli"
)
public
class
HeliWMSController
{
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
HeliWMSController
.
class
);
@PostMapping
(
value
=
"/icqaResp"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
MessageDTO
>
syncItem
(
@RequestBody
String
json
){
logger
.
debug
(
"icqaResp: "
+
json
);
MessageDTO
dto
=
MessageDTO
.
success
();
return
ResponseEntity
.
ok
(
dto
);
}
}
src/main/java/com/mushiny/heli/xnr/service/Sql_Table.java
View file @
570ac0af
...
@@ -203,4 +203,9 @@ public interface Sql_Table {
...
@@ -203,4 +203,9 @@ public interface Sql_Table {
" AND MD_ITEMDATA.ITEM_NO=MD_ITEMDATA_SKUNO.ITEM_NO \n"
+
" AND MD_ITEMDATA.ITEM_NO=MD_ITEMDATA_SKUNO.ITEM_NO \n"
+
" AND MD_ITEMDATA_SKUNO.SKU_NO = ? \n"
+
" AND MD_ITEMDATA_SKUNO.SKU_NO = ? \n"
+
" AND MD_STORAGELOCATION.NAME = ? LIMIT 1"
;
" AND MD_STORAGELOCATION.NAME = ? LIMIT 1"
;
String
SQL_QUERY_ICQA_POSFINISH
=
"SELECT * FROM WMS_ICQA_ORDER WHERE NOT EXISTS \n"
+
" (SELECT 1 FROM WMS_ICQA_ORDERPOSITION \n"
+
" WHERE WMS_ICQA_ORDERPOSITION.TASKID=WMS_ICQA_ORDER.TASKID\n"
+
" AND WMS_ICQA_ORDERPOSITION.STATE<>'Finish') \n"
+
" AND WMS_ICQA_ORDER.STATE<>'Finish'"
;
}
}
src/main/java/com/mushiny/heli/xnr/service/WMSRespService.java
View file @
570ac0af
package
com
.
mushiny
.
heli
.
xnr
.
service
;
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.CommonUtils
;
import
com.mushiny.heli.xnr.comm.JsonUtils
;
import
com.mushiny.heli.xnr.comm.JsonUtils
;
import
com.mushiny.heli.xnr.dto.InboundOrderDTO
;
import
com.mushiny.heli.xnr.dto.InboundOrderDTO
;
...
@@ -84,13 +85,13 @@ public class WMSRespService {
...
@@ -84,13 +85,13 @@ public class WMSRespService {
HttpHeaders
headers
=
this
.
getHttpHeaders
();
HttpHeaders
headers
=
this
.
getHttpHeaders
();
List
<
Map
>
data
=
this
.
jdbcRepository
.
queryBySql
(
SQL_QUERYALL_ICQAORDER
,
FINISH
);
List
<
Map
>
data
=
this
.
jdbcRepository
.
queryBySql
(
SQL_QUERYALL_ICQAORDER
,
FINISH
);
List
<
InboundOrderDTO
>
data2
=
this
.
transfer2I
n
DTO
(
data
);
//合并主表记录
List
<
InboundOrderDTO
>
data2
=
this
.
transfer2I
cqa
DTO
(
data
);
//合并主表记录
for
(
int
i
=
0
;
i
<
data2
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
data2
.
size
();
i
++)
{
InboundOrderDTO
inboundOrderDTO
=
data2
.
get
(
i
);
InboundOrderDTO
inboundOrderDTO
=
data2
.
get
(
i
);
String
json
=
JsonUtils
.
bean2Json
(
inboundOrderDTO
);
String
json
=
JsonUtils
.
bean2Json
(
inboundOrderDTO
);
logger
.
debug
(
"post data: "
+
json
);
logger
.
debug
(
"post data: "
+
json
);
HttpEntity
<
String
>
httpEntity
=
new
HttpEntity
<
String
>(
json
,
headers
);
HttpEntity
<
String
>
httpEntity
=
new
HttpEntity
<
String
>(
json
,
headers
);
ResponseEntity
<
String
>
res
=
restTemplate
.
postForEntity
(
this
.
i
nbound
Resp_url
,
httpEntity
,
String
.
class
);
ResponseEntity
<
String
>
res
=
restTemplate
.
postForEntity
(
this
.
i
cqa
Resp_url
,
httpEntity
,
String
.
class
);
Map
result
=
JsonUtils
.
json2Map
(
res
.
getBody
());
Map
result
=
JsonUtils
.
json2Map
(
res
.
getBody
());
logger
.
debug
(
"result: "
+
result
);
logger
.
debug
(
"result: "
+
result
);
if
(
CommonUtils
.
parseInteger
(
"CODE"
,
result
)
==
0
){
if
(
CommonUtils
.
parseInteger
(
"CODE"
,
result
)
==
0
){
...
@@ -98,11 +99,27 @@ public class WMSRespService {
...
@@ -98,11 +99,27 @@ public class WMSRespService {
Map
newValue
=
new
HashMap
();
Map
newValue
=
new
HashMap
();
newValue
.
put
(
"NEED_RESP"
,
2
);
newValue
.
put
(
"NEED_RESP"
,
2
);
Map
con
=
new
HashMap
();
Map
con
=
new
HashMap
();
con
.
put
(
"
ENTRY
ID"
,
inboundOrderDTO
.
getENTRYID
());
con
.
put
(
"
TASK
ID"
,
inboundOrderDTO
.
getENTRYID
());
this
.
jdbcRepository
.
updateRecords
(
TABLE_IBORDER
,
newValue
,
con
);
this
.
jdbcRepository
.
updateRecords
(
TABLE_IBORDER
,
newValue
,
con
);
}
}
}
}
//检查是否有明细已完成 需要将主表记录更新为完成Finish
//检查是否有明细已完成 需要将主表记录更新为完成Finish 本来是一条语句完成的
List
<
Map
>
allTasks
=
this
.
jdbcRepository
.
queryBySql
(
Sql_Table
.
SQL_QUERY_ICQA_POSFINISH
);
for
(
int
i
=
0
;
i
<
allTasks
.
size
();
i
++)
{
Map
icqaOrder
=
allTasks
.
get
(
i
);
BaseBpo
baseBpo
=
new
BaseBpo
();
baseBpo
.
setTable
(
Sql_Table
.
WMS_ICQA_ORDER
);
baseBpo
.
setId
(
CommonUtils
.
parseString
(
"TASKID"
,
icqaOrder
));
baseBpo
.
setIdName
(
"TASKID"
);
baseBpo
.
addKV
(
"STATE"
,
Sql_Table
.
FINISH
);
baseBpo
.
addKV
(
"NEED_RESP"
,
1
);
CommonUtils
.
modifyUselessInfo
(
baseBpo
.
getKv
());
this
.
jdbcRepository
.
updateBusinessObject
(
baseBpo
);
}
}
private
List
<
InboundOrderDTO
>
transfer2IcqaDTO
(
List
<
Map
>
data
)
{
}
}
...
...
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