Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
Gree
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 7c15fb15
由
sunke
编写于
2020-04-15 19:42:47 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
更新紧急料出库不会更新需求单发料数量问题
报警允许按条码查询
1 个父辈
29f2a776
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
299 行增加
和
546 行删除
myproject/src/main/java/com/myproject/bean/qisda/InquiryShelfBean.java
myproject/src/main/java/com/myproject/bean/qisda/ShelfInfo.java
myproject/src/main/java/com/myproject/bean/qisda/ShelfLoc.java
myproject/src/main/java/com/myproject/util/BarcodeRule.java
myproject/src/main/java/com/myproject/webapp/controller/cloud/AlarmInfoSearchController.java
myproject/src/main/java/com/myproject/webapp/controller/qisda/DifferentInventoryController.java
myproject/src/main/java/com/myproject/webapp/controller/qisda/QisdaController.java
myproject/src/main/java/com/myproject/webapp/controller/qisda/util/OutInfoCache.java
myproject/src/main/java/com/myproject/webapp/controller/storage/StorageUpdateController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/DataCache.java
myproject/src/main/java/com/myproject/webapp/controller/webService/ITaskService.java
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaApiController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaDeviceController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/TaskService.java
myproject/src/main/webapp/WEB-INF/pages/cloud/alarmInfoSearch.jsp
myproject/src/main/webapp/WEB-INF/pages/component/storagePosFind.jsp
myproject/src/main/java/com/myproject/bean/qisda/InquiryShelfBean.java
查看文件 @
7c15fb1
...
@@ -41,6 +41,24 @@ public class InquiryShelfBean {
...
@@ -41,6 +41,24 @@ public class InquiryShelfBean {
}
}
}
}
public
static
boolean
clearShelf
(
String
hSerial
,
String
rfid
){
boolean
clearResult
=
false
;
if
(
hSerial
!=
null
){
log
.
info
(
"清理["
+
hSerial
+
"]使用的过料架["
+
rfid
+
"]"
);
Map
<
String
,
ShelfInfo
>
shelfMap
=
hSerialShelfMap
.
get
(
hSerial
);
if
(
shelfMap
!=
null
){
ShelfInfo
shelfInfo
=
findSameShelf
(
hSerial
,
rfid
);
if
(
shelfInfo
!=
null
){
String
tempRfid
=
shelfInfo
.
tempRfid
();
shelfMap
.
remove
(
tempRfid
);
hSerialShelfMap
.
put
(
hSerial
,
shelfMap
);
clearResult
=
true
;
}
}
}
return
clearResult
;
}
private
static
List
<
ShelfInfo
>
getSortedCAndDShelfList
(
DataLog
task
){
private
static
List
<
ShelfInfo
>
getSortedCAndDShelfList
(
DataLog
task
){
...
@@ -322,7 +340,7 @@ public class InquiryShelfBean {
...
@@ -322,7 +340,7 @@ public class InquiryShelfBean {
if
(
shelfMap
!=
null
){
if
(
shelfMap
!=
null
){
for
(
ShelfInfo
shelf
:
shelfMap
.
values
())
{
for
(
ShelfInfo
shelf
:
shelfMap
.
values
())
{
String
shelfRFID
=
shelf
.
getRealRfid
();
String
shelfRFID
=
shelf
.
getRealRfid
();
log
.
info
(
shelf
.
tempRfid
()
+
"判断料架["
+
shelfRFID
+
"] = "
+
rfid
);
log
.
debug
(
shelf
.
tempRfid
()
+
"判断料架["
+
shelfRFID
+
"] = "
+
rfid
);
if
(
shelfRFID
!=
null
&&
rfid
!=
null
){
if
(
shelfRFID
!=
null
&&
rfid
!=
null
){
if
(
shelfRFID
.
equals
(
rfid
)){
if
(
shelfRFID
.
equals
(
rfid
)){
//已经绑定过该Temp料架
//已经绑定过该Temp料架
...
@@ -559,9 +577,8 @@ public class InquiryShelfBean {
...
@@ -559,9 +577,8 @@ public class InquiryShelfBean {
if
(
appendInfo
.
isFirstReelAction
()){
if
(
appendInfo
.
isFirstReelAction
()){
//首盘料,解除绑定的位置
//首盘料,解除绑定的位置
if
(
shelfMap
!=
null
){
if
(
shelfMap
!=
null
){
ShelfInfo
shelfInfo
=
shelfMap
.
get
(
task
.
getTempRfid
());
for
(
ShelfInfo
shelfInfo
:
shelfMap
.
values
())
{
if
(
shelfInfo
!=
null
){
boolean
result
=
shelfInfo
.
cancelLimitLoc
(
barcode
);
boolean
result
=
shelfInfo
.
cancelLimitLoc
(
taskShelfType
,
barcode
);
if
(
result
){
if
(
result
){
log
.
info
(
"首盘料["
+
task
.
getBarcode
()+
"]任务取消,解除料架"
+
shelfInfo
.
tempRfid
()
+
"锁定架位绑定"
);
log
.
info
(
"首盘料["
+
task
.
getBarcode
()+
"]任务取消,解除料架"
+
shelfInfo
.
tempRfid
()
+
"锁定架位绑定"
);
updateShelfInfo
(
shelfInfo
);
updateShelfInfo
(
shelfInfo
);
...
@@ -573,17 +590,20 @@ public class InquiryShelfBean {
...
@@ -573,17 +590,20 @@ public class InquiryShelfBean {
//补料盘,解除最后一个料架上的位置
//补料盘,解除最后一个料架上的位置
ShelfInfo
maxShelf
=
null
;
ShelfInfo
maxShelf
=
null
;
for
(
ShelfInfo
shelfInfo
:
shelfMap
.
values
())
{
for
(
ShelfInfo
shelfInfo
:
shelfMap
.
values
())
{
if
(
shelfInfo
.
getShelfType
().
equals
(
taskShelfType
)){
int
limitLoc
=
shelfInfo
.
getBarcodeLoc
(
barcode
,
taskShelfType
);
int
limitLoc
=
shelfInfo
.
getBarcodeLoc
(
barcode
,
taskShelfType
);
if
(
limitLoc
>
0
){
if
(
limitLoc
>
0
){
//已经锁定过
//已经锁定过
boolean
result
=
shelfInfo
.
cancelLimitLoc
(
barcode
);
boolean
result
=
shelfInfo
.
cancelLimitLoc
(
taskShelfType
,
barcode
);
if
(
result
){
if
(
result
){
log
.
info
(
"补料盘["
+
task
.
getBarcode
()+
"]任务取消,解除料架"
+
shelfInfo
.
tempRfid
()
+
"的锁定架位绑定"
);
log
.
info
(
"补料盘["
+
task
.
getBarcode
()+
"]任务取消,解除料架"
+
shelfInfo
.
tempRfid
()
+
"的锁定架位绑定"
);
updateShelfInfo
(
shelfInfo
);
updateShelfInfo
(
shelfInfo
);
}
}
if
(!
shelfInfo
.
isAShelf
()){
//非包装料,只取消一个料架, 包装料需要取消C料架和A料架
return
;
return
;
}
else
{
}
}
else
{
if
(
shelfInfo
.
getShelfType
().
equals
(
taskShelfType
)){
if
(
maxShelf
==
null
||
shelfInfo
.
getRfidIndex
()
>
maxShelf
.
getRfidIndex
()){
if
(
maxShelf
==
null
||
shelfInfo
.
getRfidIndex
()
>
maxShelf
.
getRfidIndex
()){
maxShelf
=
shelfInfo
;
maxShelf
=
shelfInfo
;
}
}
...
@@ -620,7 +640,7 @@ public class InquiryShelfBean {
...
@@ -620,7 +640,7 @@ public class InquiryShelfBean {
boolean
putInResult
=
bindedShelf
.
putInLimitLoc
(
rfid
,
loc
,
barcode
);
boolean
putInResult
=
bindedShelf
.
putInLimitLoc
(
rfid
,
loc
,
barcode
);
if
(
putInResult
){
if
(
putInResult
){
updateShelfInfo
(
bindedShelf
);
updateShelfInfo
(
bindedShelf
);
log
.
info
(
"
包装
料["
+
task
.
getBarcode
()+
"]放入料架"
+
rfid
+
"["
+
loc
+
"]缓存更新成功"
);
log
.
info
(
"
紧急/分盘
料["
+
task
.
getBarcode
()+
"]放入料架"
+
rfid
+
"["
+
loc
+
"]缓存更新成功"
);
return
new
ShelfLoc
(
rfid
,
loc
);
return
new
ShelfLoc
(
rfid
,
loc
);
}
}
}
else
{
}
else
{
...
@@ -630,7 +650,7 @@ public class InquiryShelfBean {
...
@@ -630,7 +650,7 @@ public class InquiryShelfBean {
boolean
putInResult
=
shelfInfo
.
putInLimitLoc
(
rfid
,
loc
,
barcode
);
boolean
putInResult
=
shelfInfo
.
putInLimitLoc
(
rfid
,
loc
,
barcode
);
if
(
putInResult
){
if
(
putInResult
){
updateShelfInfo
(
shelfInfo
);
updateShelfInfo
(
shelfInfo
);
log
.
info
(
"
包装物
料["
+
task
.
getBarcode
()+
"]使用新料架"
+
rfid
+
"["
+
loc
+
"]缓存更新成功"
);
log
.
info
(
"
紧急/分盘
料["
+
task
.
getBarcode
()+
"]使用新料架"
+
rfid
+
"["
+
loc
+
"]缓存更新成功"
);
return
new
ShelfLoc
(
rfid
,
loc
);
return
new
ShelfLoc
(
rfid
,
loc
);
}
}
}
}
...
@@ -641,10 +661,11 @@ public class InquiryShelfBean {
...
@@ -641,10 +661,11 @@ public class InquiryShelfBean {
newBShelf
.
setRfidIndex
(
rfidIndex
);
newBShelf
.
setRfidIndex
(
rfidIndex
);
newBShelf
.
sethSerial
(
shelfMapKey
);
newBShelf
.
sethSerial
(
shelfMapKey
);
log
.
info
(
"添加新料架["
+
newBShelf
.
tempRfid
()
+
"]"
);
log
.
info
(
"添加新料架["
+
newBShelf
.
tempRfid
()
+
"]"
);
loc
=
binded
Shelf
.
addLimitLoc
(
barcode
,
task
.
getReelType
());
loc
=
newB
Shelf
.
addLimitLoc
(
barcode
,
task
.
getReelType
());
boolean
putInResult
=
binded
Shelf
.
putInLimitLoc
(
rfid
,
loc
,
barcode
);
boolean
putInResult
=
newB
Shelf
.
putInLimitLoc
(
rfid
,
loc
,
barcode
);
if
(
putInResult
){
if
(
putInResult
){
log
.
info
(
"物料["
+
task
.
getBarcode
()+
"]放入料架"
+
rfid
+
"["
+
loc
+
"]缓存更新成功"
);
updateShelfInfo
(
newBShelf
);
log
.
info
(
"紧急/分盘料["
+
task
.
getBarcode
()+
"]放入料架"
+
rfid
+
"["
+
loc
+
"]缓存更新成功"
);
return
new
ShelfLoc
(
rfid
,
loc
);
return
new
ShelfLoc
(
rfid
,
loc
);
}
}
}
}
...
...
myproject/src/main/java/com/myproject/bean/qisda/ShelfInfo.java
查看文件 @
7c15fb1
...
@@ -232,17 +232,16 @@ public class ShelfInfo {
...
@@ -232,17 +232,16 @@ public class ShelfInfo {
/**
/**
* 为首盘料取消一个锁定的库位
* 为首盘料取消一个锁定的库位
*/
*/
public
boolean
cancelLimitLoc
(
String
rfidType
,
String
barcode
){
public
boolean
cancelLimitLoc
(
String
barcode
){
if
(
rfidType
.
equals
(
this
.
getShelfType
())){
for
(
ShelfLoc
shelfLoc
:
locMap
.
values
())
{
for
(
ShelfLoc
shelfLoc
:
locMap
.
values
())
{
if
(
shelfLoc
.
isInThisLoc
(
barcode
)){
if
(
shelfLoc
.
isInThisLoc
(
barcode
)){
if
(
shelfLoc
.
isEmpty
()){
if
(
shelfLoc
.
isEmpty
()){
shelfLoc
.
putIn
(
barcode
);
shelfLoc
.
putIn
(
barcode
);
locMap
.
put
(
shelfLoc
.
getLoc
(),
shelfLoc
);
locMap
.
put
(
shelfLoc
.
getLoc
(),
shelfLoc
);
return
true
;
return
true
;
}
else
{
}
else
{
log
.
error
(
"料盘["
+
barcode
+
"]解除绑定架位"
+
shelfLoc
.
getTempRfid
()+
"["
+
shelfLoc
.
getLoc
()+
"]失败,此位置料盘已放入"
);
log
.
error
(
"料盘["
+
barcode
+
"]解除绑定架位失败,此位置料盘已放入"
);
return
false
;
}
}
}
}
}
}
}
...
@@ -465,6 +464,10 @@ public class ShelfInfo {
...
@@ -465,6 +464,10 @@ public class ShelfInfo {
return
StorageConstants
.
SHEFL_TYPE
.
isDShelf
(
getShelfType
());
return
StorageConstants
.
SHEFL_TYPE
.
isDShelf
(
getShelfType
());
}
}
public
boolean
isAShelf
(){
return
StorageConstants
.
SHEFL_TYPE
.
isAShelf
(
getShelfType
());
}
public
void
setShelfType
(
String
shelfType
)
{
public
void
setShelfType
(
String
shelfType
)
{
this
.
shelfType
=
shelfType
;
this
.
shelfType
=
shelfType
;
}
}
...
@@ -472,4 +475,17 @@ public class ShelfInfo {
...
@@ -472,4 +475,17 @@ public class ShelfInfo {
public
String
tempRfid
(){
public
String
tempRfid
(){
return
gethSerial
()
+
"-"
+
rfidIndex
+
shelfType
;
return
gethSerial
()
+
"-"
+
rfidIndex
+
shelfType
;
}
}
@Override
public
String
toString
()
{
return
"ShelfInfo{"
+
"hSerial='"
+
hSerial
+
'\''
+
", log="
+
log
+
", rfidIndex="
+
rfidIndex
+
", realRfid='"
+
realRfid
+
'\''
+
", shelfType='"
+
shelfType
+
'\''
+
", maxLocCount="
+
maxLocCount
+
", locMap="
+
locMap
+
'}'
;
}
}
}
myproject/src/main/java/com/myproject/bean/qisda/ShelfLoc.java
查看文件 @
7c15fb1
...
@@ -150,4 +150,16 @@ public class ShelfLoc {
...
@@ -150,4 +150,16 @@ public class ShelfLoc {
public
void
setRealRfid
(
String
realRfid
)
{
public
void
setRealRfid
(
String
realRfid
)
{
this
.
realRfid
=
realRfid
;
this
.
realRfid
=
realRfid
;
}
}
@Override
public
String
toString
()
{
return
"ShelfLoc{"
+
"barcode='"
+
barcode
+
'\''
+
", realRfid='"
+
realRfid
+
'\''
+
", tempRfid='"
+
tempRfid
+
'\''
+
", loc="
+
loc
+
", reelType="
+
reelType
+
", empty="
+
empty
+
'}'
;
}
}
}
myproject/src/main/java/com/myproject/util/BarcodeRule.java
查看文件 @
7c15fb1
...
@@ -445,7 +445,7 @@ public class BarcodeRule {
...
@@ -445,7 +445,7 @@ public class BarcodeRule {
if
(
partNumber
.
startsWith
(
"QT"
)){
if
(
partNumber
.
startsWith
(
"QT"
)){
log
.
info
(
"料号["
+
partNumber
+
"]为移远料号,进行料号转换"
);
log
.
info
(
"料号["
+
partNumber
+
"]为移远料号,进行料号转换"
);
try
{
try
{
partNumber
=
QisdaApi
Controller
.
PartNoMapping
(
partNumber
);
partNumber
=
QisdaApi
.
PartNoMapping
(
partNumber
);
}
catch
(
ApiException
e
)
{
}
catch
(
ApiException
e
)
{
codeBean
.
setError
(
e
.
getMessage
());
codeBean
.
setError
(
e
.
getMessage
());
return
codeBean
;
return
codeBean
;
...
...
myproject/src/main/java/com/myproject/webapp/controller/cloud/AlarmInfoSearchController.java
查看文件 @
7c15fb1
...
@@ -50,7 +50,7 @@ public class AlarmInfoSearchController extends BaseSearchController {
...
@@ -50,7 +50,7 @@ public class AlarmInfoSearchController extends BaseSearchController {
}
}
}
}
super
.
addLikeParam
(
request
,
baseCriteria
,
"alarmMsg"
);
query
.
addCriteria
(
baseCriteria
);
query
.
addCriteria
(
baseCriteria
);
PageList
pageList
=
alarmInfoDao
.
findByQuery
(
query
,
searchCriteria
.
getPageList
());
PageList
pageList
=
alarmInfoDao
.
findByQuery
(
query
,
searchCriteria
.
getPageList
());
...
...
myproject/src/main/java/com/myproject/webapp/controller/qisda/DifferentInventoryController.java
查看文件 @
7c15fb1
...
@@ -24,6 +24,7 @@ import com.myproject.exception.ApiException;
...
@@ -24,6 +24,7 @@ import com.myproject.exception.ApiException;
import
com.myproject.exception.ValidateException
;
import
com.myproject.exception.ValidateException
;
import
com.myproject.manager.IBarcodeManager
;
import
com.myproject.manager.IBarcodeManager
;
import
com.myproject.manager.IStoragePosManager
;
import
com.myproject.manager.IStoragePosManager
;
import
com.myproject.util.QisdaApi
;
import
com.myproject.util.StorageConstants
;
import
com.myproject.util.StorageConstants
;
import
com.myproject.webapp.controller.storage.BaseController
;
import
com.myproject.webapp.controller.storage.BaseController
;
import
com.myproject.webapp.controller.webService.DataCache
;
import
com.myproject.webapp.controller.webService.DataCache
;
...
@@ -71,7 +72,7 @@ public class DifferentInventoryController extends BaseController {
...
@@ -71,7 +72,7 @@ public class DifferentInventoryController extends BaseController {
qisdaReelMap
=
readQisda
(
file
);
qisdaReelMap
=
readQisda
(
file
);
}
else
{
}
else
{
log
.
info
(
"开始与Qisda比对库存"
);
log
.
info
(
"开始与Qisda比对库存"
);
qisdaReelMap
=
QisdaApi
Controller
.
getInventory
();
qisdaReelMap
=
QisdaApi
.
getInventory
();
}
}
List
<
StoragePos
>
posList
=
storagePosManager
.
findNotEmpty
();
List
<
StoragePos
>
posList
=
storagePosManager
.
findNotEmpty
();
...
...
myproject/src/main/java/com/myproject/webapp/controller/qisda/QisdaController.java
查看文件 @
7c15fb1
...
@@ -28,6 +28,7 @@ import com.myproject.exception.ApiException;
...
@@ -28,6 +28,7 @@ import com.myproject.exception.ApiException;
import
com.myproject.exception.ValidateException
;
import
com.myproject.exception.ValidateException
;
import
com.myproject.manager.IBarcodeManager
;
import
com.myproject.manager.IBarcodeManager
;
import
com.myproject.manager.IStoragePosManager
;
import
com.myproject.manager.IStoragePosManager
;
import
com.myproject.util.QisdaApi
;
import
com.myproject.util.StorageConstants
;
import
com.myproject.util.StorageConstants
;
import
com.myproject.webapp.controller.qisda.util.OutInfoCache
;
import
com.myproject.webapp.controller.qisda.util.OutInfoCache
;
import
com.myproject.webapp.controller.storage.BaseController
;
import
com.myproject.webapp.controller.storage.BaseController
;
...
@@ -211,6 +212,9 @@ public class QisdaController extends BaseController {
...
@@ -211,6 +212,9 @@ public class QisdaController extends BaseController {
@RequestMapping
(
"/service/store/qisda/bindDn"
)
@RequestMapping
(
"/service/store/qisda/bindDn"
)
@ResponseBody
@ResponseBody
public
String
bindDn
(
HttpServletRequest
request
){
public
String
bindDn
(
HttpServletRequest
request
){
if
(
dataCache
.
getSettings
().
isStopOut
()){
return
"x系统更新中,暂停出入库,请稍后再试"
;
}
String
rfid
=
request
.
getParameter
(
"rfid"
);
String
rfid
=
request
.
getParameter
(
"rfid"
);
String
dnNo
=
request
.
getParameter
(
"dnNo"
);
String
dnNo
=
request
.
getParameter
(
"dnNo"
);
String
facility
=
request
.
getParameter
(
"facility"
);
String
facility
=
request
.
getParameter
(
"facility"
);
...
@@ -246,7 +250,7 @@ public class QisdaController extends BaseController {
...
@@ -246,7 +250,7 @@ public class QisdaController extends BaseController {
log
.
info
(
"未找到DN单["
+
dnNo
+
"],从佳世达获取"
);
log
.
info
(
"未找到DN单["
+
dnNo
+
"],从佳世达获取"
);
boolean
isCheck
=
false
;
boolean
isCheck
=
false
;
try
{
try
{
List
<
DNItem
>
dnItems
=
QisdaApi
Controller
.
GetDNDetails
(
dnNo
,
isCheck
);
List
<
DNItem
>
dnItems
=
QisdaApi
.
GetDNDetails
(
dnNo
,
isCheck
);
dNItemDao
.
insertAll
(
dnItems
);
dNItemDao
.
insertAll
(
dnItems
);
newDnInfo
=
dNInfoDao
.
save
(
newDnInfo
);
newDnInfo
=
dNInfoDao
.
save
(
newDnInfo
);
newDnInfo
.
addItems
(
dnItems
);
newDnInfo
.
addItems
(
dnItems
);
...
...
myproject/src/main/java/com/myproject/webapp/controller/qisda/util/OutInfoCache.java
查看文件 @
7c15fb1
...
@@ -109,7 +109,7 @@ public class OutInfoCache {
...
@@ -109,7 +109,7 @@ public class OutInfoCache {
/**
/**
* 更新需求单的发料状态
* 更新需求单的发料状态
*/
*/
p
rivate
void
updateStatus
(
String
hSerial
){
p
ublic
void
updateStatus
(
String
hSerial
){
OutInfo
outInfo
=
outInfoMap
.
get
(
hSerial
);
OutInfo
outInfo
=
outInfoMap
.
get
(
hSerial
);
if
(
outInfo
!=
null
){
if
(
outInfo
!=
null
){
log
.
info
(
"更新需求单["
+
hSerial
+
"]的发料状态 ["
+
outInfo
.
getSendStatus
()+
"]"
);
log
.
info
(
"更新需求单["
+
hSerial
+
"]的发料状态 ["
+
outInfo
.
getSendStatus
()+
"]"
);
...
...
myproject/src/main/java/com/myproject/webapp/controller/storage/StorageUpdateController.java
查看文件 @
7c15fb1
...
@@ -66,9 +66,11 @@ public class StorageUpdateController extends BaseUpdateController {
...
@@ -66,9 +66,11 @@ public class StorageUpdateController extends BaseUpdateController {
return
getSuccessView
();
return
getSuccessView
();
}
else
{
}
else
{
try
{
try
{
storage
=
storageManager
.
save
(
storage
);
dataCache
.
reloadStorage
(
storage
);
dataCache
.
reloadStorage
(
storage
);
//fileUpload.setParam(storage.getId());
//fileUpload.setParam(storage.getId());
saveMessage
(
request
,
getText
(
"storage.saveSuccess"
,
request
.
getLocale
()));
saveMessage
(
request
,
getText
(
"storage.saveSuccess"
,
request
.
getLocale
()));
//return "redirect:storageUpdate.html?id="+storage.getId();
//return "redirect:storageUpdate.html?id="+storage.getId();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
);
log
.
error
(
e
);
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/DataCache.java
查看文件 @
7c15fb1
...
@@ -228,8 +228,8 @@ public class DataCache{
...
@@ -228,8 +228,8 @@ public class DataCache{
codeBeanFromRule
.
setError
(
null
);
codeBeanFromRule
.
setError
(
null
);
codeBeanFromRule
.
setCodeStr
(
barcode
.
getBarcode
());
codeBeanFromRule
.
setCodeStr
(
barcode
.
getBarcode
());
codeBeanFromRule
.
setBarcode
(
barcode
);
codeBeanFromRule
.
setBarcode
(
barcode
);
Component
component
=
componentManager
.
findByPartNumber
(
barcode
.
getPartNumber
());
//
Component component = componentManager.findByPartNumber(barcode.getPartNumber());
codeBeanFromRule
.
setShowImg
(
component
.
getShowImg
());
//
codeBeanFromRule.setShowImg(component.getShowImg());
return
codeBeanFromRule
;
return
codeBeanFromRule
;
}
}
...
@@ -317,7 +317,7 @@ public class DataCache{
...
@@ -317,7 +317,7 @@ public class DataCache{
}
else
{
}
else
{
}
}
codeBeanFromRule
.
setShowImg
(
component
.
getShowImg
());
//
codeBeanFromRule.setShowImg(component.getShowImg());
}
}
}
}
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/ITaskService.java
查看文件 @
7c15fb1
...
@@ -65,6 +65,8 @@ public interface ITaskService {
...
@@ -65,6 +65,8 @@ public interface ITaskService {
*/
*/
String
checkout
(
StoragePos
pos
,
String
subSourceId
,
boolean
isSingleOut
);
String
checkout
(
StoragePos
pos
,
String
subSourceId
,
boolean
isSingleOut
);
List
<
DataLog
>
getAllTasks
();
DataLog
getFinishedTask
(
String
barcode
);
DataLog
getFinishedTask
(
String
barcode
);
void
updateFinishedTask
(
DataLog
task
);
void
updateFinishedTask
(
DataLog
task
);
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaApiController.java
查看文件 @
7c15fb1
package
com
.
myproject
.
webapp
.
controller
.
webService
;
package
com
.
myproject
.
webapp
.
controller
.
webService
;
import
com.google.common.base.Strings
;
import
com.google.common.base.Strings
;
import
com.google.common.collect.Lists
;
import
com.myproject.bean.qisda.*
;
import
com.myproject.bean.qisda.*
;
import
com.myproject.bean.update.*
;
import
com.myproject.bean.update.*
;
import
com.myproject.bean.update.qisda.DNInfo
;
import
com.myproject.bean.update.qisda.DNInfo
;
...
@@ -65,9 +64,6 @@ public class QisdaApiController extends BaseController {
...
@@ -65,9 +64,6 @@ public class QisdaApiController extends BaseController {
private
OutInfoCache
outInfoCache
;
private
OutInfoCache
outInfoCache
;
protected
final
static
Logger
log
=
LogManager
.
getLogger
(
QisdaApiController
.
class
);
protected
final
static
Logger
log
=
LogManager
.
getLogger
(
QisdaApiController
.
class
);
private
static
String
USER_NAME
=
"SMD-BOX"
;
/**
/**
* 基础数据同步
* 基础数据同步
*/
*/
...
@@ -135,9 +131,9 @@ public class QisdaApiController extends BaseController {
...
@@ -135,9 +131,9 @@ public class QisdaApiController extends BaseController {
public
static
Barcode
CISInCheck
(
DNInfo
dnInfo
,
Barcode
barcode
)
throws
ValidateException
{
public
static
Barcode
CISInCheck
(
DNInfo
dnInfo
,
Barcode
barcode
)
throws
ValidateException
{
//纯入库
//纯入库
if
(
barcode
.
getAppendInfo
().
isCISIn
()){
if
(
barcode
.
getAppendInfo
().
isCISIn
()){
return
VMILocationInCheck
(
barcode
);
return
QisdaApi
.
VMILocationInCheck
(
barcode
);
}
else
{
}
else
{
VMIMateriaReceiveJudge
(
dnInfo
,
barcode
);
QisdaApi
.
VMIMateriaReceiveJudge
(
dnInfo
,
barcode
);
}
}
return
null
;
return
null
;
}
}
...
@@ -150,11 +146,48 @@ public class QisdaApiController extends BaseController {
...
@@ -150,11 +146,48 @@ public class QisdaApiController extends BaseController {
public
static
void
PutInFinished
(
Barcode
barcode
,
DataLog
task
){
public
static
void
PutInFinished
(
Barcode
barcode
,
DataLog
task
){
//纯入库
//纯入库
if
(
barcode
.
getAppendInfo
().
isCISIn
()){
if
(
barcode
.
getAppendInfo
().
isCISIn
()){
VMILocationIn
(
barcode
.
getBarcode
(),
task
.
getPosName
());
QisdaApi
.
VMILocationIn
(
barcode
.
getBarcode
(),
task
.
getPosName
());
}
else
{
}
else
{
//DN单收料或Facility收料
//DN单收料或Facility收料
VMIMateriaReceive
(
barcode
,
task
);
QisdaApi
.
VMIMateriaReceive
(
barcode
,
task
);
}
}
/**
* 检测料盘是否绑定工单
*/
@RequestMapping
(
value
=
"/checkLockReel"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
ResultBean
checkLockSo
(
HttpServletRequest
request
)
{
List
<
Map
<
String
,
String
>>
bindReelInfos
=
new
ArrayList
<>();
try
{
String
paramInfo
=
receiveParamInfo
(
request
);
log
.
info
(
"收到检测锁定工单请求:"
+
paramInfo
);
if
(
paramInfo
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
"参数为空"
);
}
List
<
String
>
reelIds
=
JsonUtil
.
toList
(
paramInfo
,
String
.
class
);
for
(
String
reelId
:
reelIds
)
{
//指定出某盘料或单独出库,如果已经绑定,不允许出,如果未绑定直接进行绑定
StoragePos
pos
=
storagePosDao
.
findByBarcode
(
reelId
);
if
(
pos
!=
null
){
Barcode
barcode
=
pos
.
getBarcode
();
AppendInfo
appendInfo
=
barcode
.
getAppendInfo
();
int
bindSlot
=
Integer
.
valueOf
(
appendInfo
.
getBindSlot
());
if
(
bindSlot
>
0
||
barcode
.
hasCutInfo
())
{
//已经真实绑定过
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"reelId"
,
reelId
);
map
.
put
(
"so"
,
appendInfo
.
getSo
());
bindReelInfos
.
add
(
map
);
}
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"需求单请求处理出错"
,
e
);
return
ResultBean
.
newErrorResult
(
1001
,
"内部错误:"
+
e
.
getMessage
());
}
}
return
ResultBean
.
newOkResult
(
bindReelInfos
);
}
}
/**
/**
...
@@ -165,18 +198,14 @@ public class QisdaApiController extends BaseController {
...
@@ -165,18 +198,14 @@ public class QisdaApiController extends BaseController {
public
Object
out
(
HttpServletRequest
request
)
{
public
Object
out
(
HttpServletRequest
request
)
{
List
<
String
>
failedReelIdList
=
new
ArrayList
<>();
List
<
String
>
failedReelIdList
=
new
ArrayList
<>();
try
{
try
{
String
paramInfo
=
request
.
getParameter
(
"paramInfo"
);
String
paramInfo
=
receiveParamInfo
(
request
);
if
(
Strings
.
isNullOrEmpty
(
paramInfo
)){
//从body里面再获取一次
Map
<
String
,
String
>
bodyParamMap
=
getParamMapFromBody
(
request
);
paramInfo
=
bodyParamMap
.
get
(
"paramInfo"
);
}
log
.
info
(
"收到需求单请求:"
+
paramInfo
);
log
.
info
(
"收到需求单请求:"
+
paramInfo
);
if
(
paramInfo
==
null
){
if
(
paramInfo
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
"参数为空"
);
return
ResultBean
.
newErrorResult
(-
1
,
"参数为空"
);
}
}
List
<
RequestOutItemBean
>
items
=
JsonUtil
.
toList
(
paramInfo
,
RequestOutItemBean
.
class
);
List
<
RequestOutItemBean
>
items
=
JsonUtil
.
toList
(
paramInfo
,
RequestOutItemBean
.
class
);
//key为需求单号
//key为需求单号
Map
<
String
,
OutInfo
>
outInfoMap
=
new
HashMap
<>();
Map
<
String
,
OutInfo
>
outInfoMap
=
new
HashMap
<>();
...
@@ -299,7 +328,7 @@ public class QisdaApiController extends BaseController {
...
@@ -299,7 +328,7 @@ public class QisdaApiController extends BaseController {
//首盘和分盘进行缺料反馈
//首盘和分盘进行缺料反馈
List
<
OutItem
>
outItemList
=
outItemDao
.
findByHSerial
(
outInfo
.
gethSerial
());
List
<
OutItem
>
outItemList
=
outItemDao
.
findByHSerial
(
outInfo
.
gethSerial
());
boolean
lessBind
=
true
;
boolean
lessBind
=
true
;
VMILocationOutFeedback
(
outItemList
,
lessBind
);
QisdaApi
.
VMILocationOutFeedback
(
outItemList
,
lessBind
);
}
else
{
}
else
{
log
.
info
(
"需求单["
+
outInfo
+
"]不需要进行缺料反馈"
);
log
.
info
(
"需求单["
+
outInfo
+
"]不需要进行缺料反馈"
);
}
}
...
@@ -387,184 +416,6 @@ public class QisdaApiController extends BaseController {
...
@@ -387,184 +416,6 @@ public class QisdaApiController extends BaseController {
}
}
}
}
/**
* 移远料号转换
*/
public
static
String
PartNoMapping
(
String
vdPartNum
)
throws
ApiException
{
String
url
=
"http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/PartNoMapping"
;
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
paramMap
.
put
(
"vdPartNum"
,
vdPartNum
);
log
.
info
(
"从Qisda获取料号转换:vdPartNum="
+
vdPartNum
);
String
result
=
HttpHelper
.
postParam
(
url
,
paramMap
);
log
.
info
(
"从Qisda获取料号转换:(PartNoMapping)返回:"
+
result
);
Map
<
String
,
Object
>
resultMap
=
JsonUtil
.
toMap
(
result
);
String
msg
=
resultMap
.
get
(
"msg"
).
toString
();
if
(
msg
.
startsWith
(
"0"
)){
String
errorMsg
=
"从Qisda获取料号["
+
vdPartNum
+
"]转换出错:"
+
msg
;
log
.
info
(
errorMsg
);
throw
new
ApiException
(
errorMsg
);
}
return
msg
;
}
public
static
Map
<
String
,
DiffInfo
>
getInventory
()
throws
ApiException
{
String
url
=
"http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMIStcok"
;
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
paramMap
.
put
(
"area"
,
"4D"
);
log
.
info
(
"从Qisda获取库存信息进行比对"
);
Map
<
String
,
DiffInfo
>
diffInfoMap
=
new
HashMap
<>();
String
result
=
HttpHelper
.
postParam
(
url
,
paramMap
);
log
.
info
(
"Qisda获取库存信息进行比对返回:"
+
result
);
Map
<
String
,
Object
>
resultMap
=
JsonUtil
.
toMap
(
result
);
String
code
=
resultMap
.
get
(
"code"
).
toString
();
if
(
code
.
equals
(
"200"
)){
List
<
Map
<
String
,
Object
>>
data
=
(
List
<
Map
<
String
,
Object
>>)
resultMap
.
get
(
"data"
);
for
(
Map
<
String
,
Object
>
itemMap
:
data
)
{
DiffInfo
diffInfo
=
new
DiffInfo
();
String
partno
=
itemMap
.
get
(
"partno"
).
toString
();
String
facility
=
itemMap
.
get
(
"facility"
).
toString
();
String
location
=
itemMap
.
get
(
"location"
).
toString
();
String
reelid
=
itemMap
.
get
(
"reelid"
).
toString
();
String
qty
=
itemMap
.
get
(
"qty"
).
toString
();
diffInfo
.
setPn
(
partno
);
diffInfo
.
setReelId
(
reelid
);
diffInfo
.
setLocation
(
location
);
diffInfo
.
setQty
(
qty
);
diffInfo
.
setFacility
(
facility
);
diffInfoMap
.
put
(
reelid
,
diffInfo
);
}
}
else
{
String
errorMsg
=
" Qisda获取库存信息进行比对转换出错:"
+
resultMap
.
get
(
"msg"
);
log
.
info
(
errorMsg
);
throw
new
ApiException
(
errorMsg
);
}
return
diffInfoMap
;
}
/**
*
* 缺料反馈接口 (出完工单时调用),绑定首盘不管是否缺料都调用,其他类型的只在所有出库完成时调用一次
*
* 只有首盘会反馈多次缺料信息,若首盘反馈第一次缺料后,料自动匹配齐了,第二次反馈时料号传N/A
*
* @param outItemList
* @param lessBind 是否是绑定缺料反馈
*/
public
static
void
VMILocationOutFeedback
(
List
<
OutItem
>
outItemList
,
boolean
lessBind
){
String
url
=
"http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMILocationOutFeedback"
;
List
<
Map
<
String
,
Object
>>
materialInfoList
=
new
ArrayList
<>();
for
(
OutItem
outItem
:
outItemList
)
{
Map
<
String
,
Object
>
materialInfoMap
=
new
HashMap
<
String
,
Object
>();
materialInfoMap
.
put
(
"so"
,
outItem
.
getSo
());
//DN单号或者是厂别
materialInfoMap
.
put
(
"partNum"
,
outItem
.
getPn
());
//料号
int
lossqty
=
outItem
.
outLessQty
();
if
(
lessBind
){
//绑定缺料反馈
lossqty
=
outItem
.
preBindLessQty
();
}
materialInfoMap
.
put
(
"lossqty"
,
lossqty
+
""
);
//缺料数量
materialInfoMap
.
put
(
"slot"
,
outItem
.
getSlotStr
());
//料站
materialInfoMap
.
put
(
"serial"
,
outItem
.
gethSerial
());
//需求单号
materialInfoList
.
add
(
materialInfoMap
);
}
if
(
materialInfoList
.
isEmpty
()){
log
.
info
(
"需求单不缺料,不进行缺料反馈"
);
}
else
{
String
lackOfMaterial
=
JsonUtil
.
toJsonStr
(
materialInfoList
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
paramMap
.
put
(
"lackOfMaterial"
,
lackOfMaterial
);
log
.
info
(
"缺料反馈接口(VMILocationOutFeedback)参数lackOfMaterial="
+
lackOfMaterial
);
try
{
String
result
=
HttpHelper
.
postParam
(
url
,
paramMap
);
log
.
info
(
"收到缺料反馈接口(VMILocationOutFeedback)返回:"
+
result
);
}
catch
(
ApiException
e
)
{
log
.
error
(
"缺料反馈接口(VMILocationOutFeedback)接口出错"
,
e
);
}
}
}
/**
* 获取DN单详情
* @param dnNo
* @param isCheck
* @return
* @throws ApiException
*/
public
static
List
<
DNItem
>
GetDNDetails
(
String
dnNo
,
boolean
isCheck
)
throws
ApiException
{
String
url
=
"http://10.85.17.43:8080/WMSWeb.asmx/GetDNDetailsJson"
;
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
//paramMap.put("DHNO","DNMISW1911197845");
paramMap
.
put
(
"DHNO"
,
dnNo
);
String
isCheckStr
=
"N"
;
if
(
isCheck
){
isCheckStr
=
"Y"
;
}
paramMap
.
put
(
"ISCheck"
,
isCheckStr
);
paramMap
.
put
(
"isBack"
,
"Y"
);
String
errorMsg
=
""
;
Map
<
String
,
DNItem
>
itemMap
=
new
HashMap
<>();
try
{
String
returnResult
=
HttpHelper
.
postParam
(
url
,
paramMap
);
log
.
info
(
"获取DN单详情结果:"
+
returnResult
);
String
resultStr
=
XmlUtil
.
getNodeBody
(
"string"
,
returnResult
);
if
(
resultStr
.
startsWith
(
"["
)){
List
<
Map
<
String
,
Object
>>
items
=
JsonUtil
.
toObj
(
resultStr
,
List
.
class
);
for
(
Map
<
String
,
Object
>
map
:
items
)
{
DNItem
item
=
new
DNItem
();
String
no
=
map
.
get
(
"DLNO"
).
toString
();
item
.
setDnNo
(
no
);
String
dnDateStr
=
map
.
get
(
"DLCRDTE"
).
toString
()+
" "
+
map
.
get
(
"DLCRTIME"
).
toString
();
item
.
setDnDateStr
(
dnDateStr
);
int
dnQty
=
Float
.
valueOf
(
map
.
get
(
"WACTQTY"
).
toString
()).
intValue
();
item
.
setDnQty
(
dnQty
);
String
facility
=
map
.
get
(
"WPORD"
).
toString
();
item
.
setFacility
(
facility
);
String
company
=
map
.
get
(
"DSN"
).
toString
();
item
.
setCompany
(
company
);
String
pn
=
map
.
get
(
"WPROD"
).
toString
();
item
.
setPn
(
pn
);
DNItem
dnItem
=
itemMap
.
get
(
pn
);
if
(
dnItem
!=
null
){
int
totalDNQty
=
dnItem
.
getDnQty
()
+
item
.
getDnQty
();
log
.
info
(
"PN["
+
pn
+
"]有重复,合并数量["
+
dnItem
.
getDnQty
()
+
" + "
+
item
.
getDnQty
()
+
" = "
+
totalDNQty
);
dnItem
.
setDnQty
(
totalDNQty
);
}
else
{
dnItem
=
item
;
}
itemMap
.
put
(
pn
,
dnItem
);
}
}
else
{
//返回错训误了
errorMsg
=
resultStr
;
}
}
catch
(
Exception
e
)
{
errorMsg
=
e
.
getMessage
();
log
.
error
(
"获取DN单详情接口出错"
,
e
);
}
if
(!
Strings
.
isNullOrEmpty
(
errorMsg
)){
throw
new
ApiException
(
errorMsg
);
}
List
<
DNItem
>
dnItems
=
Lists
.
newArrayList
();
if
(!
itemMap
.
isEmpty
()){
dnItems
.
addAll
(
itemMap
.
values
());
}
return
dnItems
;
}
//-------------------------Private Method----------------------------------------
//-------------------------Private Method----------------------------------------
/**
/**
...
@@ -615,6 +466,25 @@ public class QisdaApiController extends BaseController {
...
@@ -615,6 +466,25 @@ public class QisdaApiController extends BaseController {
lockQty
=
realBindQty
;
lockQty
=
realBindQty
;
outItem
.
setLockQty
(
lockQty
);
outItem
.
setLockQty
(
lockQty
);
}
}
if
(
outItem
.
isCutMaterial
()){
//分盘料,需要将已绑定未出库的物料也计算进去
List
<
StoragePos
>
cutReels
=
storagePosDao
.
findCutList
(
outItem
.
getSo
(),
outItem
.
getSlotlocation
(),
outItem
.
getSoseq
());
for
(
StoragePos
cutReel
:
cutReels
)
{
List
<
Map
<
String
,
Object
>>
cutItems
=
cutReel
.
getBarcode
().
getCutItems
();
for
(
Map
<
String
,
Object
>
cutItem
:
cutItems
)
{
String
so
=
cutItem
.
get
(
"so"
).
toString
();
String
soseqStr
=
cutItem
.
get
(
"soseq"
).
toString
();
String
slotlocation
=
cutItem
.
get
(
"slotlocation"
).
toString
();
if
(
outItem
.
getSo
().
equals
(
so
)
&&
outItem
.
getSoseq
().
equals
(
soseqStr
)
&&
outItem
.
getSlotlocation
()
==
Integer
.
valueOf
(
slotlocation
)){
log
.
info
(
"查找到未出库的分盘料信息["
+
cutItem
+
"],更新预绑定数量"
);
String
qty
=
cutItem
.
get
(
"qty"
).
toString
();
lockQty
=
outItem
.
getLockQty
()
+
Integer
.
valueOf
(
qty
);
outItem
.
setLockQty
(
lockQty
);
}
}
}
}
outItem
=
outItemDao
.
save
(
outItem
);
outItem
=
outItemDao
.
save
(
outItem
);
log
.
info
(
"更新["
+
outItem
.
getSlotlocation
()+
"]"
+
outItem
.
getPn
()+
"真实绑定数量为["
+
realBindQty
+
"/"
+
outItem
.
getQty
()+
"]"
);
log
.
info
(
"更新["
+
outItem
.
getSlotlocation
()+
"]"
+
outItem
.
getPn
()+
"真实绑定数量为["
+
realBindQty
+
"/"
+
outItem
.
getQty
()+
"]"
);
return
outItem
;
return
outItem
;
...
@@ -863,208 +733,7 @@ public class QisdaApiController extends BaseController {
...
@@ -863,208 +733,7 @@ public class QisdaApiController extends BaseController {
}
}
/**
* 6. CIS收料判定接口(绑过料串的条码扫码入库时判断)
*/
private
static
void
VMIMateriaReceiveJudge
(
DNInfo
dnInfo
,
Barcode
barcode
)
throws
ValidateException
{
String
url
=
"http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMIMateriaReceiveJudge"
;
Map
<
String
,
Object
>
materialInfoMap
=
new
HashMap
<
String
,
Object
>();
String
dnOrFacility
=
dnInfo
.
getDnNo
();
if
(
dnInfo
.
isFacilityIn
()){
dnOrFacility
=
dnInfo
.
getFacility
();
}
materialInfoMap
.
put
(
"dnOrFacility"
,
dnOrFacility
);
//DN单号或者是厂别
materialInfoMap
.
put
(
"reelID"
,
barcode
.
getBarcode
());
//料卷ID
materialInfoMap
.
put
(
"partNum"
,
barcode
.
getPartNumber
());
//料号
materialInfoMap
.
put
(
"qty"
,
barcode
.
getAmount
());
//数量
materialInfoMap
.
put
(
"lifeCycle"
,
barcode
.
getLifeCycle
());
//生命周期
String
productCode
=
DateUtil
.
toDateString
(
barcode
.
getProduceDate
(),
"yyyyMMdd"
);
materialInfoMap
.
put
(
"productCode"
,
productCode
);
//生产日期
materialInfoMap
.
put
(
"lot"
,
barcode
.
getBatch
());
//生产批次(批次号)
materialInfoMap
.
put
(
"vendor"
,
barcode
.
getProvider
());
//供应商
materialInfoMap
.
put
(
"location"
,
""
);
//location
materialInfoMap
.
put
(
"qrCodeInfo"
,
barcode
.
getFullCodeStr
());
//完整的二维码信息
String
materialInfo
=
JsonUtil
.
toJsonStr
(
materialInfoMap
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
paramMap
.
put
(
"materialInfo"
,
materialInfo
);
log
.
info
(
"DN单Facility收料判断参数:materialInfo="
+
materialInfo
);
try
{
String
result
=
HttpHelper
.
postParam
(
url
,
paramMap
);
log
.
info
(
"DN单Facility收料判定接口返回:"
+
result
);
String
resultStr
=
XmlUtil
.
getNodeBody
(
"string"
,
result
);
//0+提示信息/1/-1 0为NG,1为OK,-1为系统内部异常
if
(
resultStr
.
startsWith
(
"1"
)){
log
.
info
(
barcode
.
getBarcode
()
+
" ["
+
dnOrFacility
+
"]收料判定: OK"
);
}
else
{
log
.
info
(
barcode
.
getBarcode
()
+
" ["
+
dnOrFacility
+
"]收料判定: NG"
+
resultStr
);
if
(
resultStr
.
startsWith
(
"0"
)){
throw
new
ValidateException
(
" ["
+
dnOrFacility
+
"]收料判定NG:"
+
resultStr
);
}
else
{
throw
new
ValidateException
(
" ["
+
dnOrFacility
+
"]收料判定NG:"
+
resultStr
);
}
}
}
catch
(
ApiException
e
)
{
log
.
error
(
" ["
+
dnOrFacility
+
"]收料判定接口"
,
e
);
throw
new
ValidateException
(
" ["
+
dnOrFacility
+
"]收料接口处理异常:"
+
e
.
getMessage
());
}
}
/**
* 3. CIS入库判定接口 (没绑过料串的条码调用此接口)
*/
public
static
Barcode
VMILocationInCheck
(
Barcode
barcode
)
throws
ValidateException
{
String
url
=
"http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMILocationInCheck"
;
String
reelid
=
barcode
.
getBarcode
();
String
partNum
=
barcode
.
getPartNumber
();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
paramMap
.
put
(
"reelid"
,
reelid
);
paramMap
.
put
(
"partNum"
,
partNum
);
log
.
info
(
"纯入库判断参数:reelid="
+
reelid
);
try
{
//0+提示信息/1+工单 0:为NG ;1:为OK 工单号码则表示该料卷被绑定在此工单上;-1为内部异常
String
result
=
HttpHelper
.
postParam
(
url
,
paramMap
);
//String result = "<?xml version=\"1.0\" encoding=\"utf-8\"?><string xmlns=\"http://tempuri.org/\">{\"state\":\"1\",\"msg\":\"入库判定OK\",\"info\":{\"so\":\"2388518\",\"facility\":\"ST\",\"company\":\"BACHS\",\"qty\":\"1\",\"soseq\":\"2092475\",\"slot\":\"5-4\"}}</string>";
log
.
info
(
"收到纯入库判定接口返回:"
+
result
);
String
resultStr
=
XmlUtil
.
getNodeBody
(
"string"
,
result
);
//0+提示信息/1/-1 0为NG,1为OK,-1为系统内部异常
Map
<
String
,
Object
>
resultMap
=
JsonUtil
.
toMap
(
resultStr
);
String
state
=
resultMap
.
get
(
"state"
).
toString
();
if
(
state
.
equals
(
"1"
)){
log
.
info
(
reelid
+
" CIS入库判定: OK"
);
AppendInfo
appendInfo
=
barcode
.
getAppendInfo
();
Object
infoObj
=
resultMap
.
get
(
"info"
);
if
(
infoObj
!=
null
){
log
.
info
(
"写入条码工单数量信息,并清空分盘数据"
);
Map
infoMap
=
(
Map
)
infoObj
;
String
so
=
infoMap
.
get
(
"so"
).
toString
();
//有工单信息,需要绑定工单
String
soseq
=
infoMap
.
get
(
"soseq"
).
toString
();
String
facility
=
infoMap
.
get
(
"facility"
).
toString
();
String
company
=
infoMap
.
get
(
"company"
).
toString
();
String
qty
=
infoMap
.
get
(
"qty"
).
toString
();
String
slot
=
infoMap
.
get
(
"slot"
).
toString
();
Object
slotlocation
=
infoMap
.
get
(
"slotserial"
);
if
(
so
.
equals
(
"0"
)){
so
=
null
;
slot
=
null
;
}
appendInfo
.
setCutMap
(
null
);
appendInfo
.
setSo
(
so
);
appendInfo
.
setSoseq
(
soseq
);
appendInfo
.
setSlotStr
(
slot
);
if
(
slotlocation
==
null
||
slotlocation
.
equals
(
"0"
)){
appendInfo
.
setBindSlot
(
null
);
appendInfo
.
setPreBindSlot
(
null
);
appendInfo
.
setSlotIndex
(-
1
);
}
else
{
String
location
=
slotlocation
.
toString
();
log
.
info
(
reelid
+
"数量:"
+
qty
+
"绑定工单"
+
so
+
"["
+
location
+
"]"
);
appendInfo
.
setBindSlot
(
location
);
appendInfo
.
setPreBindSlot
(
location
);
try
{
int
slotIndex
=
Integer
.
valueOf
(
location
);
appendInfo
.
setSlotIndex
(
slotIndex
);
//TODO:需要重新绑定
}
catch
(
Exception
e
){
}
}
appendInfo
.
setFacility
(
facility
);
appendInfo
.
setCompany
(
company
);
int
amount
=
Integer
.
valueOf
(
qty
);
barcode
.
setAmount
(
amount
);
barcode
.
setInitialAmount
(
amount
);
//绑定工单
// appendInfo.sethSerial(outItem.gethSerial());
// appendInfo.setRefno(outItem.getRefno());
// appendInfo.setSlotIndex(outItem.getSlotlocation());
// barcode.setAppendInfo(appendInfo);
// int realLockQty = outItem.getRealLockQty() + barcode.getAmount();
// outItem.setRealLockQty(realLockQty);
barcode
.
setAppendInfo
(
appendInfo
);
}
}
else
{
log
.
info
(
reelid
+
" 纯入库判定: NG"
+
resultStr
);
String
ngMsg
=
resultMap
.
get
(
"msg"
).
toString
();
throw
new
ValidateException
(
"纯入库判定NG:["
+
state
+
"]"
+
ngMsg
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"纯入库判定接口出错"
+
e
.
getMessage
());
throw
new
ValidateException
(
"纯入库判定接口处理异常:"
+
e
.
getMessage
());
}
return
barcode
;
}
/**
* 纯入库操作完成时通知Qisda
*/
private
static
void
VMILocationIn
(
String
reelID
,
String
location
){
String
url
=
"http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMILocationIn"
;
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
paramMap
.
put
(
"reelID"
,
reelID
);
paramMap
.
put
(
"location"
,
location
);
paramMap
.
put
(
"userName"
,
USER_NAME
);
log
.
info
(
"纯入库操作完成时通知Qisda接口(VMILocationIn):reelID="
+
reelID
+
"&location="
+
location
);
try
{
String
result
=
HttpHelper
.
postParam
(
url
,
paramMap
);
log
.
info
(
"纯入库操作完成时通知Qisda接口(VMILocationIn)返回:"
+
result
);
}
catch
(
ApiException
e
)
{
log
.
error
(
"纯入库操作完成时通知Qisda接口(VMILocationIn)出错"
,
e
);
}
}
/**
* CIS收料入库接口
*/
private
static
void
VMIMateriaReceive
(
Barcode
barcode
,
DataLog
task
){
String
url
=
"http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMIMateriaReceive"
;
Map
<
String
,
Object
>
materialInfoMap
=
new
HashMap
<
String
,
Object
>();
materialInfoMap
.
put
(
"dnOrFacility"
,
barcode
.
getAppendInfo
().
getDnOrFacility
());
//DN单号或者是厂别
materialInfoMap
.
put
(
"reelID"
,
barcode
.
getBarcode
());
//料卷ID
materialInfoMap
.
put
(
"partNum"
,
barcode
.
getPartNumber
());
//料号
materialInfoMap
.
put
(
"qty"
,
barcode
.
getAmount
()
+
""
);
//数量
materialInfoMap
.
put
(
"lifeCycle"
,
barcode
.
getLifeCycle
());
//生命周期
String
productCode
=
DateUtil
.
toDateString
(
barcode
.
getProduceDate
(),
"yyyyMMdd"
);
materialInfoMap
.
put
(
"productCode"
,
productCode
);
//生产日期
materialInfoMap
.
put
(
"lot"
,
barcode
.
getBatch
());
//生产批次(批次号)
materialInfoMap
.
put
(
"vendor"
,
barcode
.
getProvider
());
//供应商
materialInfoMap
.
put
(
"location"
,
task
.
getPosName
());
//location
materialInfoMap
.
put
(
"qrCodeInfo"
,
barcode
.
getFullCodeStr
());
//完整的二维码信息
materialInfoMap
.
put
(
"reelType"
,
"0"
);
//料卷类型
String
materialInfo
=
JsonUtil
.
toJsonStr
(
materialInfoMap
);
//materialInfo = "{\"dnOrFacility\":\"DNMIST1901002587\",\"reelID\":\"R000002014042300013\",\"reelType\":\"0\",\"partNum\":\"6H.15010.204\",\"qty\":\"3\",\"lifeCycle\":\"240\",\"productCode\":\"20191102\",\"lot\":\"L00000000IA9617JL1D81\",\"vendor\":\"82012\",\"location\":\"1-1\",\"qrCodeInfo\":\"L00000000IA9617JL1D81;E20190101 0730;B8C.00501.010503562019010103000;R000002014042300013\"}";
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
paramMap
.
put
(
"materialInfo"
,
materialInfo
);
paramMap
.
put
(
"userName"
,
USER_NAME
);
log
.
info
(
"DN单收料或Facility收料通知Qisda接口(VMIMateriaReceive)返回:"
+
materialInfo
);
try
{
String
result
=
HttpHelper
.
postParam
(
url
,
paramMap
);
log
.
info
(
"DN单收料或Facility收料接口返回:"
+
result
);
}
catch
(
ApiException
e
)
{
log
.
error
(
"DN单收料或Facility收料接口出错"
,
e
);
}
}
/**
/**
...
@@ -1099,10 +768,10 @@ public class QisdaApiController extends BaseController {
...
@@ -1099,10 +768,10 @@ public class QisdaApiController extends BaseController {
materialInfoMap
.
put
(
"slotserial"
,
slotlocation
+
""
);
materialInfoMap
.
put
(
"slotserial"
,
slotlocation
+
""
);
log
.
info
(
"发送分盘料信息:"
+
cutItem
);
log
.
info
(
"发送分盘料信息:"
+
cutItem
);
VMILocationOut
(
materialInfoMap
);
QisdaApi
.
VMILocationOut
(
materialInfoMap
);
}
}
}
else
{
}
else
{
VMILocationOut
(
materialInfoMap
);
QisdaApi
.
VMILocationOut
(
materialInfoMap
);
}
}
}
}
...
@@ -1138,78 +807,7 @@ public class QisdaApiController extends BaseController {
...
@@ -1138,78 +807,7 @@ public class QisdaApiController extends BaseController {
return
materialInfoMap
;
return
materialInfoMap
;
}
}
private
static
void
VMILocationOut
(
Map
<
String
,
Object
>
materialInfoMap
){
String
url
=
"http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMILocationOut"
;
String
materialInfo
=
JsonUtil
.
toJsonStr
(
materialInfoMap
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
paramMap
.
put
(
"materialInfo"
,
materialInfo
);
paramMap
.
put
(
"userName"
,
USER_NAME
);
log
.
info
(
"出仓完成时通知Qisda:materialInfo="
+
materialInfo
);
try
{
String
result
=
HttpHelper
.
postParam
(
url
,
paramMap
);
log
.
info
(
"出仓完成时通知Qisda(VMILocationOut)返回:"
+
result
);
}
catch
(
ApiException
e
)
{
log
.
error
(
"出仓完成时通知Qisda(VMILocationOut)接口出错"
,
e
);
}
}
/**
* 物料放上小车时调用
* @param task 任务信息
* @param barcode 条码信息
* @param latest 本次工单第几盘料(F 第一次,L 最后一次, M 中间)
*/
public
static
void
VMIMateriaRecAss
(
DataLog
task
,
Barcode
barcode
,
String
latest
){
String
url
=
"http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMIMateriaRecAss"
;
Map
<
String
,
Object
>
materialInfoMap
=
new
HashMap
<
String
,
Object
>();
AppendInfo
appendInfo
=
task
.
getAppendInfo
();
materialInfoMap
.
put
(
"action"
,
appendInfo
.
getAction
());
materialInfoMap
.
put
(
"facility"
,
appendInfo
.
getFacility
());
materialInfoMap
.
put
(
"so"
,
appendInfo
.
getSo
());
materialInfoMap
.
put
(
"partNum"
,
task
.
getPartNumber
());
materialInfoMap
.
put
(
"reelID"
,
task
.
getBarcode
());
materialInfoMap
.
put
(
"slot"
,
appendInfo
.
getSlotStr
());
materialInfoMap
.
put
(
"slotserial"
,
appendInfo
.
getSlotIndex
());
materialInfoMap
.
put
(
"qty"
,
task
.
getNum
()
+
""
);
materialInfoMap
.
put
(
"latest"
,
latest
);
//本次工单第几盘料(F 第一次,L 最后一次, M 中间, E是错误)
materialInfoMap
.
put
(
"cloudLocation"
,
task
.
getPosName
());
//云料仓的库位
materialInfoMap
.
put
(
"location"
,
""
);
//料架库位
materialInfoMap
.
put
(
"vehicleID"
,
appendInfo
.
getRfid
());
//料车编号
if
(
latest
.
equals
(
"E"
)){
//错误状态不发料车编号
materialInfoMap
.
put
(
"vehicleID"
,
""
);
//料车编号
}
materialInfoMap
.
put
(
"vehicleLocation"
,
appendInfo
.
getRfidLoc
());
//料车架位号
materialInfoMap
.
put
(
"lot"
,
barcode
.
getBatch
());
//生产批次(批次号)
String
productCode
=
DateUtil
.
toDateString
(
barcode
.
getProduceDate
(),
"yyyyMMdd"
);
materialInfoMap
.
put
(
"productCode"
,
productCode
);
//生产日期
materialInfoMap
.
put
(
"vendorCode"
,
barcode
.
getProvider
());
//供应商
materialInfoMap
.
put
(
"hSerial"
,
appendInfo
.
gethSerial
());
materialInfoMap
.
put
(
"flag"
,
""
);
//子盘或母盘(L:子盘,M:母盘,其他'')
String
idte
=
DateUtil
.
toDateString
(
task
.
getUpdateDate
(),
"yyyyMMdd"
);
String
idme
=
DateUtil
.
toDateString
(
task
.
getUpdateDate
(),
"HHmmss"
);
materialInfoMap
.
put
(
"idte"
,
idte
);
//发料日期
materialInfoMap
.
put
(
"itme"
,
idme
);
//发料时间
materialInfoMap
.
put
(
"soseq"
,
appendInfo
.
getSoseq
());
//工单序号
String
materialInfo
=
JsonUtil
.
toJsonStr
(
materialInfoMap
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
paramMap
.
put
(
"materialInfo"
,
materialInfo
);
paramMap
.
put
(
"userName"
,
USER_NAME
);
log
.
info
(
"物料放上小车时通知Qisda:materialInfo="
+
materialInfo
);
try
{
String
result
=
HttpHelper
.
postParam
(
url
,
paramMap
);
log
.
info
(
"物料放上小车时通知Qisda(VMIMateriaRecAss)返回:"
+
result
);
}
catch
(
ApiException
e
)
{
log
.
error
(
"物料放上小车时通知Qisda(VMIMateriaRecAss)接口出错"
,
e
);
}
}
private
List
<
DataLog
>
checkOutUrgent
(
OutItem
outItem
){
private
List
<
DataLog
>
checkOutUrgent
(
OutItem
outItem
){
...
@@ -1385,8 +983,8 @@ public class QisdaApiController extends BaseController {
...
@@ -1385,8 +983,8 @@ public class QisdaApiController extends BaseController {
}
}
if
(!
hasUrgenReel
){
if
(!
hasUrgenReel
){
log
.
info
(
"已无紧急料和分盘料任务,清空紧急料/分盘料料架"
);
log
.
info
(
"已无紧急料和分盘料任务,清空紧急料/分盘料料架"
);
InquiryShelfBean
.
clearShelf
(
"1"
);
InquiryShelfBean
.
clearShelf
(
InquiryShelfBean
.
URGENT_SHELF_MAP_KEY
);
InquiryShelfBean
.
clearShelf
(
"2"
);
InquiryShelfBean
.
clearShelf
(
InquiryShelfBean
.
CUT_SHELF_MAP_KEY
);
}
}
//首盘和补料
//首盘和补料
...
@@ -1463,13 +1061,28 @@ public class QisdaApiController extends BaseController {
...
@@ -1463,13 +1061,28 @@ public class QisdaApiController extends BaseController {
if
(
outReelNum
==
0
){
if
(
outReelNum
==
0
){
List
<
OutItem
>
outItemList
=
outItemDao
.
findByHSerial
(
outInfo
.
gethSerial
());
List
<
OutItem
>
outItemList
=
outItemDao
.
findByHSerial
(
outInfo
.
gethSerial
());
boolean
lessBind
=
false
;
boolean
lessBind
=
false
;
VMILocationOutFeedback
(
outItemList
,
lessBind
);
QisdaApi
.
VMILocationOutFeedback
(
outItemList
,
lessBind
);
}
}
}
}
return
"需求单"
+
hSerial
+
"任务分配完成,共["
+
outReelNum
+
"]盘任务"
;
return
"需求单"
+
hSerial
+
"任务分配完成,共["
+
outReelNum
+
"]盘任务"
;
}
}
/**
* 获取接收参数
*/
private
String
receiveParamInfo
(
HttpServletRequest
request
){
String
paramInfo
=
request
.
getParameter
(
"paramInfo"
);
if
(
Strings
.
isNullOrEmpty
(
paramInfo
)){
//从body里面再获取一次
Map
<
String
,
String
>
bodyParamMap
=
getParamMapFromBody
(
request
);
paramInfo
=
bodyParamMap
.
get
(
"paramInfo"
);
}
return
paramInfo
;
}
private
DataLog
newTask
(
OutItem
outItem
,
StoragePos
pos
){
private
DataLog
newTask
(
OutItem
outItem
,
StoragePos
pos
){
DataLog
task
=
new
DataLog
();
DataLog
task
=
new
DataLog
();
task
.
setType
(
StorageConstants
.
OP
.
CHECKOUT
);
task
.
setType
(
StorageConstants
.
OP
.
CHECKOUT
);
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaDeviceController.java
查看文件 @
7c15fb1
...
@@ -16,6 +16,7 @@ import com.myproject.dao.mongo.qisda.IOutItemDao;
...
@@ -16,6 +16,7 @@ import com.myproject.dao.mongo.qisda.IOutItemDao;
import
com.myproject.exception.ValidateException
;
import
com.myproject.exception.ValidateException
;
import
com.myproject.manager.IBarcodeManager
;
import
com.myproject.manager.IBarcodeManager
;
import
com.myproject.manager.IComponentManager
;
import
com.myproject.manager.IComponentManager
;
import
com.myproject.util.QisdaApi
;
import
com.myproject.util.StorageConstants
;
import
com.myproject.util.StorageConstants
;
import
com.myproject.webapp.controller.qisda.util.OutInfoCache
;
import
com.myproject.webapp.controller.qisda.util.OutInfoCache
;
import
com.myproject.webapp.controller.storage.BaseController
;
import
com.myproject.webapp.controller.storage.BaseController
;
...
@@ -236,6 +237,18 @@ public class QisdaDeviceController extends BaseController {
...
@@ -236,6 +237,18 @@ public class QisdaDeviceController extends BaseController {
if
(
hSerial
.
isEmpty
()){
if
(
hSerial
.
isEmpty
()){
return
ResultBean
.
newErrorResult
(-
2
,
"未找到大料架["
+
bigRfid
+
"]"
);
return
ResultBean
.
newErrorResult
(-
2
,
"未找到大料架["
+
bigRfid
+
"]"
);
}
}
List
<
DataLog
>
allTasks
=
taskService
.
getAllTasks
();
for
(
DataLog
task
:
allTasks
)
{
//如果还有小料任务未完成,说明换了需求单了,放行大料架
if
(
task
.
isCheckOutTask
()
&&
task
.
isSmallReel
()
&&
!
task
.
isPackageReel
()){
AppendInfo
appendInfo
=
task
.
getAppendInfo
();
if
(
appendInfo
.
isFirstReelAction
()
||
appendInfo
.
isTailAction
()){
return
ResultBean
.
newErrorResult
(-
3
,
"还有小料任务,需求单已更换,大料架["
+
bigRfid
+
"]放行"
);
}
}
}
log
.
info
(
"收到机器人[3]获取包装料摆放位置信息请求:[packageRfid="
+
packageRfid
+
"]bigRfid="
+
bigRfid
+
"当前工单料需求:["
+
hSerial
+
"]"
);
log
.
info
(
"收到机器人[3]获取包装料摆放位置信息请求:[packageRfid="
+
packageRfid
+
"]bigRfid="
+
bigRfid
+
"当前工单料需求:["
+
hSerial
+
"]"
);
ShelfInfo
packageShelf
=
inquiryShelfBean
.
findPackageShelf
(
hSerial
,
packageRfid
);
ShelfInfo
packageShelf
=
inquiryShelfBean
.
findPackageShelf
(
hSerial
,
packageRfid
);
...
@@ -253,11 +266,6 @@ public class QisdaDeviceController extends BaseController {
...
@@ -253,11 +266,6 @@ public class QisdaDeviceController extends BaseController {
}
}
if
(
bigShelf
!=
null
){
if
(
bigShelf
!=
null
){
Collection
<
DataLog
>
queueTasks
=
taskService
.
getQueueTasks
();
List
<
DataLog
>
allTasks
=
taskService
.
getFinishedTasks
();
if
(!
queueTasks
.
isEmpty
()){
allTasks
.
addAll
(
queueTasks
);
}
//剩余包装料任务
//剩余包装料任务
int
packageTask
=
0
;
int
packageTask
=
0
;
for
(
DataLog
task
:
allTasks
)
{
for
(
DataLog
task
:
allTasks
)
{
...
@@ -294,7 +302,7 @@ public class QisdaDeviceController extends BaseController {
...
@@ -294,7 +302,7 @@ public class QisdaDeviceController extends BaseController {
//包装料架上有料,且大料架有空位,从大料架上查找空位
//包装料架上有料,且大料架有空位,从大料架上查找空位
DataLog
task
=
taskService
.
getFinishedTask
(
barcode
);
DataLog
task
=
taskService
.
getFinishedTask
(
barcode
);
if
(
task
==
null
){
if
(
task
==
null
){
String
msg
=
"机器人[3]获取包装料摆放位置信息,未找到
包装料架[]上
条码["
+
barcode
+
"]的任务"
;
String
msg
=
"机器人[3]获取包装料摆放位置信息,未找到条码["
+
barcode
+
"]的任务"
;
log
.
error
(
msg
);
log
.
error
(
msg
);
return
ResultBean
.
newErrorResult
(
103
,
msg
);
return
ResultBean
.
newErrorResult
(
103
,
msg
);
}
}
...
@@ -510,6 +518,48 @@ public class QisdaDeviceController extends BaseController {
...
@@ -510,6 +518,48 @@ public class QisdaDeviceController extends BaseController {
}
}
/**
/**
* 分盘料/紧急料放上料串或料架流出时调用
*/
@RequestMapping
(
value
=
"/clearRfid"
)
@ResponseBody
public
ResultBean
clearRfid
(
HttpServletRequest
request
)
{
String
rfid
=
request
.
getParameter
(
"rfid"
);
if
(
rfid
==
null
){
rfid
=
""
;
}
boolean
clearResult
=
InquiryShelfBean
.
clearShelf
(
InquiryShelfBean
.
URGENT_SHELF_MAP_KEY
,
rfid
);
if
(!
clearResult
){
log
.
info
(
"从分盘料料架中查找["
+
rfid
+
"]准备清除"
);
clearResult
=
InquiryShelfBean
.
clearShelf
(
InquiryShelfBean
.
CUT_SHELF_MAP_KEY
,
rfid
);
}
log
.
info
(
"清除料架["
+
rfid
+
"]完成:"
+
clearResult
);
return
ResultBean
.
newOkResult
(
clearResult
);
}
/**
* 取消入库任务
*/
@RequestMapping
(
value
=
"/cancelPutInTask"
)
@ResponseBody
public
ResultBean
cancelPutInTask
(
HttpServletRequest
request
)
{
String
barcode
=
request
.
getParameter
(
"barcode"
);
if
(
Strings
.
isBlank
(
barcode
)){
return
ResultBean
.
newErrorResult
(
2001
,
"未找到参数barcode"
);
}
Collection
<
DataLog
>
queueTasks
=
taskService
.
getQueueTasks
();
for
(
DataLog
queueTask
:
queueTasks
)
{
if
(
queueTask
.
isPutInTask
()
&&
queueTask
.
getBarcode
().
equals
(
barcode
)){
//只能取消入库任务
boolean
cancelResult
=
taskService
.
cancelTask
(
queueTask
.
getId
());
log
.
info
(
"客户端取消["
+
barcode
+
"]的入库任务结果:"
+
cancelResult
);
return
ResultBean
.
newOkResult
(
cancelResult
);
}
}
return
ResultBean
.
newErrorResult
(
2002
,
"任务["
+
barcode
+
"]取消失败"
);
}
/**
* 分盘料/紧急料放上料串或料架时调用
* 分盘料/紧急料放上料串或料架时调用
*/
*/
@RequestMapping
(
value
=
"/afterPutCut"
)
@RequestMapping
(
value
=
"/afterPutCut"
)
...
@@ -522,37 +572,31 @@ public class QisdaDeviceController extends BaseController {
...
@@ -522,37 +572,31 @@ public class QisdaDeviceController extends BaseController {
String
barcode
=
request
.
getParameter
(
"barcode"
);
String
barcode
=
request
.
getParameter
(
"barcode"
);
String
rfid
=
request
.
getParameter
(
"rfid"
);
String
rfid
=
request
.
getParameter
(
"rfid"
);
String
rfidLoc
=
request
.
getParameter
(
"rfidLoc"
);
String
rfidLoc
=
request
.
getParameter
(
"rfidLoc"
);
log
.
info
(
"收到["
+
cid
+
"]紧急/分盘料["
+
barcode
+
"]放入"
+
rfid
+
"["
+
rfidLoc
+
"]指令"
);
log
.
debug
(
"收到["
+
cid
+
"]紧急/分盘料["
+
barcode
+
"]放入"
+
rfid
+
"["
+
rfidLoc
+
"]指令"
);
DataLog
task
=
findFinishedTask
(
barcode
);
DataLog
task
=
findFinishedTask
(
barcode
);
if
(
task
==
null
){
if
(
task
!=
null
){
return
ResultBean
.
newErrorResult
(
301
,
"任务不存在"
);
ShelfLoc
shelfLoc
=
inquiryShelfBean
.
putInCutReel
(
task
,
rfid
,
Integer
.
valueOf
(
rfidLoc
));
}
if
(
shelfLoc
!=
null
){
log
.
info
(
"["
+
cid
+
"]紧急/分盘料["
+
barcode
+
"]放入"
+
rfid
+
"["
+
rfidLoc
+
"]成功"
);
ShelfLoc
shelfLoc
=
inquiryShelfBean
.
putInCutReel
(
task
,
rfid
,
Integer
.
valueOf
(
rfidLoc
));
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
FINISHED
.
name
());
if
(
shelfLoc
!=
null
){
rfidLoc
=
shelfLoc
.
getLoc
()
+
""
;
log
.
info
(
"收到["
+
cid
+
"]紧急/分盘料["
+
barcode
+
"]放入"
+
rfid
+
"["
+
rfidLoc
+
"]成功"
);
}
else
{
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
FINISHED
.
name
());
log
.
info
(
""
+
cid
+
"紧急/分盘料["
+
barcode
+
"]放入"
+
rfid
+
"["
+
rfidLoc
+
"]失败"
);
rfidLoc
=
shelfLoc
.
getLoc
()
+
""
;
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
INSHELF
.
toString
());
}
else
{
}
log
.
info
(
"收到"
+
cid
+
"紧急/分盘料["
+
barcode
+
"]放入"
+
rfid
+
"["
+
rfidLoc
+
"]失败"
);
AppendInfo
appendInfo
=
task
.
getAppendInfo
();
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
INSHELF
.
toString
());
appendInfo
.
setRfid
(
rfid
);
appendInfo
.
setRfidLoc
(
Integer
.
valueOf
(
rfidLoc
));
task
.
setAppendInfo
(
appendInfo
);
task
=
dataLogDao
.
save
(
task
);
taskService
.
updateFinishedTask
(
task
);
}
}
AppendInfo
appendInfo
=
task
.
getAppendInfo
();
appendInfo
.
setRfid
(
rfid
);
appendInfo
.
setRfidLoc
(
Integer
.
valueOf
(
rfidLoc
));
task
.
setAppendInfo
(
appendInfo
);
task
=
dataLogDao
.
save
(
task
);
taskService
.
updateFinishedTask
(
task
);
int
cutPackageTask
=
0
;
int
cutPackageTask
=
0
;
int
urgentPackageTask
=
0
;
int
urgentPackageTask
=
0
;
int
cutTask
=
0
;
int
cutTask
=
0
;
int
urgentTask
=
0
;
int
urgentTask
=
0
;
Collection
<
DataLog
>
queueTasks
=
taskService
.
getQueueTasks
();
List
<
DataLog
>
allTasks
=
taskService
.
getAllTasks
();
List
<
DataLog
>
allTasks
=
taskService
.
getFinishedTasks
();
if
(!
queueTasks
.
isEmpty
()){
allTasks
.
addAll
(
queueTasks
);
}
for
(
DataLog
unFinishedTask
:
allTasks
)
{
for
(
DataLog
unFinishedTask
:
allTasks
)
{
if
(!
unFinishedTask
.
isFinished
()
&&
!
unFinishedTask
.
isCancel
()
&&
unFinishedTask
.
isCheckOutTask
()){
if
(!
unFinishedTask
.
isFinished
()
&&
!
unFinishedTask
.
isCancel
()
&&
unFinishedTask
.
isCheckOutTask
()){
if
(
unFinishedTask
.
isPackageReel
()){
if
(
unFinishedTask
.
isPackageReel
()){
...
@@ -563,9 +607,9 @@ public class QisdaDeviceController extends BaseController {
...
@@ -563,9 +607,9 @@ public class QisdaDeviceController extends BaseController {
urgentPackageTask
=
urgentPackageTask
+
1
;
urgentPackageTask
=
urgentPackageTask
+
1
;
}
}
}
}
}
else
if
(
t
ask
.
isCutReel
()){
}
else
if
(
unFinishedT
ask
.
isCutReel
()){
cutTask
=
cutTask
+
1
;
cutTask
=
cutTask
+
1
;
}
else
if
(
t
ask
.
isUrgentReel
()){
}
else
if
(
unFinishedT
ask
.
isUrgentReel
()){
urgentTask
=
urgentTask
+
1
;
urgentTask
=
urgentTask
+
1
;
}
}
}
}
...
@@ -577,6 +621,16 @@ public class QisdaDeviceController extends BaseController {
...
@@ -577,6 +621,16 @@ public class QisdaDeviceController extends BaseController {
resultMap
.
put
(
"cutTask"
,
cutTask
+
""
);
resultMap
.
put
(
"cutTask"
,
cutTask
+
""
);
resultMap
.
put
(
"urgentTask"
,
urgentTask
+
""
);
resultMap
.
put
(
"urgentTask"
,
urgentTask
+
""
);
if
(
cutPackageTask
+
cutTask
==
0
){
log
.
info
(
"已无分盘料任务,清空分盘料使用料架/料串"
);
InquiryShelfBean
.
clearShelf
(
InquiryShelfBean
.
CUT_SHELF_MAP_KEY
);
}
if
(
urgentPackageTask
+
urgentTask
==
0
){
log
.
info
(
"已无紧急料任务,清空紧急料使用料架/料串"
);
InquiryShelfBean
.
clearShelf
(
InquiryShelfBean
.
URGENT_SHELF_MAP_KEY
);
}
return
ResultBean
.
newOkResult
(
resultMap
);
return
ResultBean
.
newOkResult
(
resultMap
);
}
}
...
@@ -589,7 +643,7 @@ public class QisdaDeviceController extends BaseController {
...
@@ -589,7 +643,7 @@ public class QisdaDeviceController extends BaseController {
String
barcode
=
request
.
getParameter
(
"barcode"
);
String
barcode
=
request
.
getParameter
(
"barcode"
);
String
statusStr
=
request
.
getParameter
(
"status"
);
String
statusStr
=
request
.
getParameter
(
"status"
);
String
locInfo
=
request
.
getParameter
(
"locInfo"
);
String
locInfo
=
request
.
getParameter
(
"locInfo"
);
log
.
info
(
"收到料盘["
+
barcode
+
"]更新位置指令["
+
statusStr
+
"]="
+
locInfo
);
log
.
debug
(
"收到料盘["
+
barcode
+
"]更新位置指令["
+
statusStr
+
"]="
+
locInfo
);
DataLog
task
=
findFinishedTask
(
barcode
);
DataLog
task
=
findFinishedTask
(
barcode
);
if
(
task
==
null
){
if
(
task
==
null
){
...
@@ -682,7 +736,7 @@ public class QisdaDeviceController extends BaseController {
...
@@ -682,7 +736,7 @@ public class QisdaDeviceController extends BaseController {
String
latest
=
outInfo
.
getShelfLatest
();
String
latest
=
outInfo
.
getShelfLatest
();
QisdaApi
Controller
.
VMIMateriaRecAss
(
cacheTask
,
barcodeObj
,
latest
);
QisdaApi
.
VMIMateriaRecAss
(
cacheTask
,
barcodeObj
,
latest
);
//发料完成,更新发料数量
//发料完成,更新发料数量
int
slotSeq
=
appendInfo
.
getSlotIndex
();
int
slotSeq
=
appendInfo
.
getSlotIndex
();
OutItem
outItem
=
outItemDao
.
findItem
(
hSerial
,
slotSeq
);
OutItem
outItem
=
outItemDao
.
findItem
(
hSerial
,
slotSeq
);
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/TaskService.java
查看文件 @
7c15fb1
...
@@ -28,6 +28,7 @@ import com.myproject.manager.IStoragePosManager;
...
@@ -28,6 +28,7 @@ import com.myproject.manager.IStoragePosManager;
import
com.myproject.model.User
;
import
com.myproject.model.User
;
import
com.myproject.service.UserManager
;
import
com.myproject.service.UserManager
;
import
com.myproject.util.HttpHelper
;
import
com.myproject.util.HttpHelper
;
import
com.myproject.util.QisdaApi
;
import
com.myproject.util.StorageConstants
;
import
com.myproject.util.StorageConstants
;
import
com.myproject.webapp.controller.qisda.QisdaController
;
import
com.myproject.webapp.controller.qisda.QisdaController
;
import
com.myproject.webapp.controller.qisda.util.OutInfoCache
;
import
com.myproject.webapp.controller.qisda.util.OutInfoCache
;
...
@@ -192,6 +193,19 @@ public class TaskService implements ITaskService {
...
@@ -192,6 +193,19 @@ public class TaskService implements ITaskService {
return
resultTasks
;
return
resultTasks
;
}
}
/**
* 获取所有任务
*/
@Override
public
List
<
DataLog
>
getAllTasks
(){
Collection
<
DataLog
>
queueTasks
=
getQueueTasks
();
List
<
DataLog
>
allTasks
=
getFinishedTasks
();
if
(!
queueTasks
.
isEmpty
()){
allTasks
.
addAll
(
queueTasks
);
}
return
allTasks
;
}
@Override
@Override
public
DataLog
getFinishedTask
(
String
barcode
){
public
DataLog
getFinishedTask
(
String
barcode
){
...
@@ -834,7 +848,7 @@ public class TaskService implements ITaskService {
...
@@ -834,7 +848,7 @@ public class TaskService implements ITaskService {
log
.
info
(
"需求单["
+
outInfo
.
gethSerial
()
+
"]任务完成数量:"
+
outInfo
.
getTaskFinishNum
()
+
"/"
+
outInfo
.
getTaskNum
()
+
"已出仓料盘数量:"
+
outInfo
.
getOutReelNum
());
log
.
info
(
"需求单["
+
outInfo
.
gethSerial
()
+
"]任务完成数量:"
+
outInfo
.
getTaskFinishNum
()
+
"/"
+
outInfo
.
getTaskNum
()
+
"已出仓料盘数量:"
+
outInfo
.
getOutReelNum
());
outInfoDao
.
save
(
outInfo
);
outInfoDao
.
save
(
outInfo
);
InquiryShelfBean
.
cancelReelTask
(
task
);
InquiryShelfBean
.
cancelReelTask
(
task
);
QisdaApi
Controller
.
VMIMateriaRecAss
(
task
,
barcode
,
"E"
);
QisdaApi
.
VMIMateriaRecAss
(
task
,
barcode
,
"E"
);
}
}
}
}
finishedTaskMap
.
remove
(
task
.
getBarcode
());
finishedTaskMap
.
remove
(
task
.
getBarcode
());
...
@@ -2015,7 +2029,6 @@ public class TaskService implements ITaskService {
...
@@ -2015,7 +2029,6 @@ public class TaskService implements ITaskService {
if
(
outItem
!=
null
){
if
(
outItem
!=
null
){
if
(
barcode
.
hasCutInfo
()){
if
(
barcode
.
hasCutInfo
()){
log
.
info
(
"分盘料出库,更新需求单出库数量"
);
//分盘料,需要更新对应的需求单出库数量
//分盘料,需要更新对应的需求单出库数量
final
List
<
Map
<
String
,
Object
>>
cutItems
=
barcode
.
getCutItems
();
final
List
<
Map
<
String
,
Object
>>
cutItems
=
barcode
.
getCutItems
();
for
(
Map
<
String
,
Object
>
cutItem
:
cutItems
)
{
for
(
Map
<
String
,
Object
>
cutItem
:
cutItems
)
{
...
@@ -2049,16 +2062,19 @@ public class TaskService implements ITaskService {
...
@@ -2049,16 +2062,19 @@ public class TaskService implements ITaskService {
outInfo
=
outInfoDao
.
findByHSerial
(
outItem
.
gethSerial
());
outInfo
=
outInfoDao
.
findByHSerial
(
outItem
.
gethSerial
());
int
outReelNum
=
outInfo
.
getOutReelNum
();
int
outReelNum
=
outInfo
.
getOutReelNum
();
outInfo
.
setOutReelNum
(
outReelNum
+
1
);
outInfo
.
setOutReelNum
(
outReelNum
+
1
);
if
(
outItem
.
isUrgentAction
()
||
outItem
.
isReelCutAction
()){
outInfo
.
setTaskFinishNum
(
outInfo
.
getTaskFinishNum
()
+
1
);
}
outInfo
=
outInfoDao
.
save
(
outInfo
);
outInfo
=
outInfoDao
.
save
(
outInfo
);
String
latest
=
outInfo
.
getOutLatest
();
String
latest
=
outInfo
.
getOutLatest
();
QisdaApiController
.
OutFinished
(
task
,
barcode
,
latest
);
QisdaApiController
.
OutFinished
(
task
,
barcode
,
latest
);
if
(
latest
.
equals
(
"L"
))
{
if
(
latest
.
equals
(
"L"
))
{
log
.
info
(
"工单["
+
outItem
.
getSo
()
+
"]的最后一盘出库完成,发送缺料通知"
);
log
.
info
(
"工单["
+
outItem
.
getSo
()
+
"]
需求单["
+
outItem
.
gethSerial
()+
"]
的最后一盘出库完成,发送缺料通知"
);
List
<
OutItem
>
outItemList
=
outItemDao
.
findByHSerial
(
outItem
.
gethSerial
());
List
<
OutItem
>
outItemList
=
outItemDao
.
findByHSerial
(
outItem
.
gethSerial
());
boolean
lessBind
=
false
;
boolean
lessBind
=
false
;
QisdaApi
Controller
.
VMILocationOutFeedback
(
outItemList
,
lessBind
);
QisdaApi
.
VMILocationOutFeedback
(
outItemList
,
lessBind
);
}
}
}
}
...
...
myproject/src/main/webapp/WEB-INF/pages/cloud/alarmInfoSearch.jsp
查看文件 @
7c15fb1
...
@@ -43,6 +43,15 @@
...
@@ -43,6 +43,15 @@
</div>
</div>
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="form-group form-inline">
<div class="input-group margin-top-10">
<span class="input-group-addon"><fmt:message key="条码"/></span>
<input type="text" class="form-control input-xlarge" name="alarmMsg" value="${alarmMsg}"/>
</div>
</div>
</div>
<div class="col-md-2">
<div class="col-md-2">
<button class="btn purple margin-top-10" type="submit"><i class="fa fa-search"></i>
<button class="btn purple margin-top-10" type="submit"><i class="fa fa-search"></i>
<fmt:message key="button.search"/>
<fmt:message key="button.search"/>
...
...
myproject/src/main/webapp/WEB-INF/pages/component/storagePosFind.jsp
查看文件 @
7c15fb1
...
@@ -164,6 +164,9 @@
...
@@ -164,6 +164,9 @@
<%--<%–<display:column property="barcode.amount" titleKey="数量"/>–%>--%>
<%--<%–<display:column property="barcode.amount" titleKey="数量"/>–%>--%>
<%--<display:column property="barcode.lockName" titleKey="menu.inRule"/>--%>
<%--<display:column property="barcode.lockName" titleKey="menu.inRule"/>--%>
<display:column property="posName" titleKey="checkOut.pos" sortProperty="posName" sortable="true"/>
<display:column property="posName" titleKey="checkOut.pos" sortProperty="posName" sortable="true"/>
<display:column titleKey="尺寸">
${pos.sizeStr}
</display:column>
<display:column property="barcode.appendInfo.facility" titleKey="Facility" sortProperty="barcode.appendInfo.facility" sortable="true"/>
<display:column property="barcode.appendInfo.facility" titleKey="Facility" sortProperty="barcode.appendInfo.facility" sortable="true"/>
<display:column titleKey="时间" sortProperty="barcode.updateDate" sortable="true">
<display:column titleKey="时间" sortProperty="barcode.updateDate" sortable="true">
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论