Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
Gree
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 88cfe62f
由
LN
编写于
2021-07-12 09:33:17 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge remote-tracking branch 'origin/master'
2 个父辈
9d6a689a
30a75ffa
显示空白字符变更
内嵌
并排
正在显示
27 个修改的文件
包含
785 行增加
和
339 行删除
myproject/src/main/java/com/myproject/bean/qisda/AppendInfo.java
myproject/src/main/java/com/myproject/bean/qisda/InquiryShelfBean.java
myproject/src/main/java/com/myproject/bean/qisda/SoseqLockInfo.java → myproject/src/main/java/com/myproject/bean/qisda/LockInfo.java
myproject/src/main/java/com/myproject/bean/update/DataLog.java
myproject/src/main/java/com/myproject/dao/mongo/IStoragePosDao.java
myproject/src/main/java/com/myproject/dao/mongo/impl/StoragePosDaoImpl.java
myproject/src/main/java/com/myproject/dao/mongo/qisda/IOutInfoDao.java
myproject/src/main/java/com/myproject/dao/mongo/qisda/impl/OutInfoDaoImpl.java
myproject/src/main/java/com/myproject/manager/impl/StoragePosManagerImpl.java
myproject/src/main/java/com/myproject/util/HttpHelper.java
myproject/src/main/java/com/myproject/util/QisdaApi.java
myproject/src/main/java/com/myproject/util/StorageConstants.java
myproject/src/main/java/com/myproject/webapp/controller/qisda/OutInfoSearchController.java
myproject/src/main/java/com/myproject/webapp/controller/qisda/util/OutInfoCache.java
myproject/src/main/java/com/myproject/webapp/controller/user/DataLogSearchController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/GreeDeviceController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaApiController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaBindService.java
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaDeviceController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/StorageDataController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/TaskService.java
myproject/src/main/resources/mongo.xml
myproject/src/main/webapp/WEB-INF/pages/component/storagePosFind.jsp
myproject/src/main/webapp/WEB-INF/pages/qisda/orderOut.jsp
myproject/src/main/webapp/WEB-INF/pages/qisda/outInfoSearch.jsp
myproject/src/main/webapp/common/metroTopMenu.jsp
myproject/src/main/webapp/decorators/metro.jsp
myproject/src/main/java/com/myproject/bean/qisda/AppendInfo.java
查看文件 @
88cfe62
...
...
@@ -309,6 +309,13 @@ public class AppendInfo {
return
getAction
().
contains
(
"急料"
)
||
getAction
().
contains
(
"指定"
)
||
getAction
().
contains
(
"单独出库"
)
||
isCheckAction
();
}
public
boolean
isPnAction
(){
if
(
action
==
null
){
return
false
;
}
return
getAction
().
contains
(
"PN"
);
}
/**
* 盘点出库需求单
*/
...
...
myproject/src/main/java/com/myproject/bean/qisda/InquiryShelfBean.java
查看文件 @
88cfe62
...
...
@@ -264,9 +264,17 @@ public class InquiryShelfBean {
if
(
hSerial
!=
null
){
Map
<
String
,
ShelfInfo
>
shelfMap
=
hSerialShelfMap
.
get
(
hSerial
);
if
(
shelfMap
!=
null
){
List
<
ShelfInfo
>
shelfList
=
new
ArrayList
<>(
shelfMap
.
values
());
shelfList
.
sort
(
new
Comparator
<
ShelfInfo
>()
{
@Override
public
int
compare
(
ShelfInfo
o1
,
ShelfInfo
o2
)
{
Integer
index1
=
o1
.
getRfidIndex
();
Integer
index2
=
o2
.
getRfidIndex
();
return
index1
.
compareTo
(
index2
);
}
});
ShelfInfo
minIndexShelf
=
null
;
for
(
ShelfInfo
shelf
:
shelfMap
.
values
())
{
for
(
ShelfInfo
shelf
:
shelfList
)
{
if
(
shelf
.
isFull
()){
//已经放满,查找下一个
continue
;
...
...
@@ -290,12 +298,24 @@ public class InquiryShelfBean {
log
.
error
(
"任务条码["
+
task
.
getBarcode
()+
"]已无料架可放"
);
return
null
;
}
else
{
//这里判断是否有未绑定过的料架
boolean
hasEmptyShelf
=
false
;
for
(
String
rfid
:
rfidList
)
{
ShelfInfo
shelf
=
findShelfByRealRfid
(
rfid
);
if
(
shelf
==
null
){
hasEmptyShelf
=
true
;
break
;
}
}
if
(
hasEmptyShelf
){
lockLoc
=
minIndexShelf
.
lockOneEmptyLoc
(
task
);
if
(
lockLoc
!=
null
){
shelfInfo
=
minIndexShelf
;
}
}
}
}
}
}
...
...
myproject/src/main/java/com/myproject/bean/qisda/
Soseq
LockInfo.java
→
myproject/src/main/java/com/myproject/bean/qisda/LockInfo.java
查看文件 @
88cfe62
...
...
@@ -6,7 +6,7 @@ import java.util.List;
/**
* Created by sunke on 2020/6/12.
*/
public
class
Soseq
LockInfo
{
public
class
LockInfo
{
/**
* 工单序号
*/
...
...
@@ -15,6 +15,11 @@ public class SoseqLockInfo {
private
String
so
;
/**
* 需求序号
*/
private
String
hSerial
;
/**
* 站位序号
*/
private
List
<
LockItemInfo
>
lockItems
=
new
ArrayList
<>();
...
...
@@ -46,4 +51,12 @@ public class SoseqLockInfo {
public
void
addLockItem
(
LockItemInfo
lockItem
){
lockItems
.
add
(
lockItem
);
}
public
String
gethSerial
()
{
return
hSerial
;
}
public
void
sethSerial
(
String
hSerial
)
{
this
.
hSerial
=
hSerial
;
}
}
myproject/src/main/java/com/myproject/bean/update/DataLog.java
查看文件 @
88cfe62
...
...
@@ -618,10 +618,10 @@ public class DataLog extends BaseMongoBean /*implements Comparable<DataLog>*/ {
}
/**
* 是否是在
皮带
线上
* 是否是在
流水
线上
*/
public
boolean
isInBelt
(){
return
status
.
toLowerCase
().
equals
(
"inbelt"
);
return
status
.
toLowerCase
().
equals
(
"inbelt"
)
||
status
.
toLowerCase
().
equals
(
"inline"
)
||
status
.
toLowerCase
().
equals
(
"inrobot"
)
;
}
/**
...
...
myproject/src/main/java/com/myproject/dao/mongo/IStoragePosDao.java
查看文件 @
88cfe62
...
...
@@ -72,6 +72,8 @@ public interface IStoragePosDao extends IMongoDao {
List
<
StoragePos
>
findBindList
(
String
hSerial
);
int
countBind
(
String
hSerial
);
List
<
StoragePos
>
findBindList
(
String
hSerial
,
String
outItemId
);
/**
...
...
myproject/src/main/java/com/myproject/dao/mongo/impl/StoragePosDaoImpl.java
查看文件 @
88cfe62
...
...
@@ -395,6 +395,13 @@ public class StoragePosDaoImpl extends AbstractMongoDao implements IStoragePosDa
return
findByQuery
(
q
);
}
@Override
public
int
countBind
(
String
hSerial
){
Criteria
c
=
Criteria
.
where
(
"barcode.appendInfo.hSerial"
).
is
(
hSerial
);
Query
q
=
new
Query
(
c
);
return
countByQuery
(
q
);
}
/**
* 获取工单的所有绑定料盘
*/
...
...
myproject/src/main/java/com/myproject/dao/mongo/qisda/IOutInfoDao.java
查看文件 @
88cfe62
...
...
@@ -26,7 +26,11 @@ public interface IOutInfoDao extends IMongoDao {
void
updateTaskFinishNum
(
String
hSerail
,
int
taskFinishNum
);
void
updateBindNum
(
String
hSerail
,
int
taskFinishNum
);
void
updateOutReelNum
(
String
hSerial
,
int
outReelNum
);
void
updateExecuteTime
(
String
hSerial
,
long
firstExecuteTime
);
void
updateOutInfo
(
OutInfo
outInfo
);
}
myproject/src/main/java/com/myproject/dao/mongo/qisda/impl/OutInfoDaoImpl.java
查看文件 @
88cfe62
...
...
@@ -90,6 +90,17 @@ public class OutInfoDaoImpl extends AbstractMongoDao implements IOutInfoDao {
updateFirst
(
query
,
update
);
}
/**
* 更新建议和必须出仓时间及线别目的地
*/
@Override
public
void
updateOutInfo
(
OutInfo
outInfo
){
Criteria
c
=
Criteria
.
where
(
"hSerial"
).
is
(
outInfo
.
gethSerial
());
Query
query
=
Query
.
query
(
c
);
Update
update
=
Update
.
update
(
"sdate"
,
outInfo
.
getSdate
()).
set
(
"mdate"
,
outInfo
.
getMdate
()).
set
(
"line"
,
outInfo
.
getLine
());
updateFirst
(
query
,
update
);
}
@Override
public
void
updateTaskEndTime
(
String
hSerial
,
long
taskEndTime
){
update
(
hSerial
,
"taskEndTime"
,
taskEndTime
);
...
...
@@ -101,6 +112,11 @@ public class OutInfoDaoImpl extends AbstractMongoDao implements IOutInfoDao {
}
@Override
public
void
updateBindNum
(
String
hSerail
,
int
taskFinishNum
)
{
update
(
hSerail
,
"totalBindNum"
,
taskFinishNum
);
}
@Override
public
void
updateOutReelNum
(
String
hSerial
,
int
outReelNum
){
update
(
hSerial
,
"outReelNum"
,
outReelNum
);
}
...
...
myproject/src/main/java/com/myproject/manager/impl/StoragePosManagerImpl.java
查看文件 @
88cfe62
...
...
@@ -155,12 +155,12 @@ public class StoragePosManagerImpl implements IStoragePosManager {
c
=
c
.
and
(
"w"
).
is
(
barcode
.
getPlateSize
()).
and
(
"h"
).
is
(
barcode
.
getHeight
());
}
else
if
(
compatibleType
==
StorageConstants
.
COMPATIBLE_TYPE
.
FULLY_COMPATIBLE
){
//同厚度兼容
//c = c.and("w").gte(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度大于等于料盘宽度,高度大于等于料盘高度
if
(
barcode
.
getPlateSize
()
!=
7
){
//
if(barcode.getPlateSize() != 7){
c
=
c
.
and
(
"w"
).
gte
(
barcode
.
getPlateSize
()).
and
(
"h"
).
gte
(
barcode
.
getHeight
());
//除7寸外,完全兼容
}
else
{
//=7寸使用同尺寸兼容
c
=
c
.
and
(
"w"
).
is
(
barcode
.
getPlateSize
()).
and
(
"h"
).
gte
(
barcode
.
getHeight
());
}
//
}else{
//
//=7寸使用同尺寸兼容
//
c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight());
//
}
}
else
if
(
compatibleType
==
StorageConstants
.
COMPATIBLE_TYPE
.
SIZE_COMPATIBLE
){
//同尺寸兼容
c
=
c
.
and
(
"w"
).
is
(
barcode
.
getPlateSize
()).
and
(
"h"
).
gte
(
barcode
.
getHeight
());
//宽度等于料盘宽度,高度大于等于料盘高度
...
...
myproject/src/main/java/com/myproject/util/HttpHelper.java
查看文件 @
88cfe62
...
...
@@ -18,6 +18,7 @@ import org.apache.logging.log4j.util.Strings;
import
java.io.*
;
import
java.net.URL
;
import
java.net.URLConnection
;
import
java.net.URLEncoder
;
import
java.util.*
;
import
java.util.Map.Entry
;
...
...
@@ -41,7 +42,7 @@ public class HttpHelper {
// return postJson(url,params,null, "http");
// }
public
static
String
get
(
String
url
,
Hash
Map
<
String
,
String
>
params
)
throws
ApiException
{
public
static
String
get
(
String
url
,
Map
<
String
,
String
>
params
)
throws
ApiException
{
return
get
(
url
,
params
,
null
,
"http"
);
}
...
...
@@ -233,7 +234,7 @@ public class HttpHelper {
* 请求协议 "http" / "https"
* @return 服务器响应的请求结果
*/
public
static
String
get
(
String
url
,
Hash
Map
<
String
,
String
>
params
,
public
static
String
get
(
String
url
,
Map
<
String
,
String
>
params
,
HashMap
<
String
,
String
>
cookies
,
String
protocol
)
throws
ApiException
{
// if (protocol.equalsIgnoreCase("https")) {
// Protocol httpsProtocol = new Protocol("https", new SecureProtocolSocketFactoryImpl(), 443);
...
...
@@ -251,7 +252,9 @@ public class HttpHelper {
int
i
=
0
;
while
(
iterator
.
hasNext
())
{
Entry
<
String
,
String
>
entry
=
iterator
.
next
();
data
[
i
]
=
new
NameValuePair
(
entry
.
getKey
(),
entry
.
getValue
());
String
paramValue
=
entry
.
getValue
();
paramValue
=
URLEncoder
.
encode
(
paramValue
);
data
[
i
]
=
new
NameValuePair
(
entry
.
getKey
(),
paramValue
);
++
i
;
}
getMethod
.
setQueryString
(
data
);
...
...
myproject/src/main/java/com/myproject/util/QisdaApi.java
查看文件 @
88cfe62
...
...
@@ -319,93 +319,103 @@ public class QisdaApi {
* 3. CIS入库判定接口 (没绑过料串的条码调用此接口)
*/
public
static
Barcode
VMILocationInCheck
(
Barcode
barcode
)
throws
ValidateException
{
if
(
DataCache
.
isProductionFor
(
DataCache
.
CUSTOMER
.
DEBUG
)){
log
.
info
(
"程序调试阶段,暂不处理,调试完成后更改PRO"
);
return
barcode
;
}
String
url
=
"http://1
0.85.17.233/ESMTCommonInterface/CommonService.asmx/VMILocationInCheck
"
;
//
if(DataCache.isProductionFor(DataCache.CUSTOMER.DEBUG)){
//
log.info("程序调试阶段,暂不处理,调试完成后更改PRO");
//
return barcode;
//
}
String
url
=
"http://1
72.74.1.175:1235/api/SMDBOXAPI
"
;
String
reelid
=
barcode
.
getBarcode
();
String
partNum
=
barcode
.
getPartNumber
();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
String
>
paramMap
=
new
HashMap
<
String
,
String
>();
paramMap
.
put
(
"reelid"
,
reelid
);
paramMap
.
put
(
"partNum"
,
partNum
);
log
.
info
(
"纯入库判断参数:reelid="
+
reelid
+
" partNum="
+
partNum
);
try
{
//0+提示信息/1+工单 0:为NG ;1:为OK 工单号码则表示该料卷被绑定在此工单上;-1为内部异常
String
result
=
HttpHelper
.
postParam
(
url
,
paramMap
);
String
result
=
HttpHelper
.
get
(
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
(
"收到("
+
reelid
+
")纯入库判定接口返回:"
+
result
);
String
resultStr
=
XmlUtil
.
getNodeBody
(
"string"
,
result
);
//
String resultStr = XmlUtil.getNodeBody("string", result);
//0+提示信息/1/-1 0为NG,1为OK,-1为系统内部异常
Map
<
String
,
Object
>
resultMap
=
JsonUtil
.
toMap
(
result
Str
);
Map
<
String
,
Object
>
resultMap
=
JsonUtil
.
toMap
(
result
);
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
(
"写入条码["
+
reelid
+
"]工单数量信息,并清空分盘数据"
);
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
;
soseq
=
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
){
log
.
error
(
"纯入库判定出错"
,
e
);
}
}
appendInfo
.
setFacility
(
facility
);
appendInfo
.
setCompany
(
company
);
int
amount
=
Integer
.
valueOf
(
qty
);
Object
qty
=
resultMap
.
get
(
"qty"
);
if
(
qty
!=
null
){
int
amount
=
Integer
.
valueOf
(
qty
.
toString
());
if
(
amount
>
0
){
barcode
.
setAmount
(
amount
);
barcode
.
setInitialAmount
(
amount
);
//绑定工单
// appendInfo.sethSerial(outItem.gethSerial());
// appendInfo.setRefno(outItem.getRefno());
// appendInfo.setSlotIndex(outItem.getSlotlocation());
log
.
info
(
"更新条码["
+
reelid
+
"]数量为:"
+
amount
);
}
}
// Object infoObj = resultMap.get("info");
// if(infoObj != null){
// log.info("写入条码["+reelid+"]工单数量信息,并清空分盘数据");
// 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;
// soseq = 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){
// log.error("纯入库判定出错",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);
// int realLockQty = outItem.getRealLockQty() + barcode.getAmount();
// outItem.setRealLockQty(realLockQty);
barcode
.
setAppendInfo
(
appendInfo
);
}
// }
}
else
{
log
.
info
(
reelid
+
" 纯入库判定: NG"
+
result
Str
);
log
.
info
(
reelid
+
" 纯入库判定: NG"
+
result
);
String
ngMsg
=
resultMap
.
get
(
"msg"
).
toString
();
throw
new
ValidateException
(
"纯入库判定NG:["
+
state
+
"]"
+
ngMsg
);
}
...
...
@@ -645,31 +655,31 @@ public class QisdaApi {
* @return
*/
public
static
PLATE_SIZE
PartNoRule
(
String
partNum
,
String
vendorCode
){
if
(
DataCache
.
isProductionFor
(
DataCache
.
CUSTOMER
.
DEBUG
)){
log
.
info
(
"程序调试阶段,暂不处理,调试完成后更改PRO"
);
return
null
;
}
String
url
=
"http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/PartNoRule"
;
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
paramMap
.
put
(
"partNum"
,
partNum
);
paramMap
.
put
(
"vendorCode"
,
vendorCode
);
try
{
String
result
=
HttpHelper
.
postParam
(
url
,
paramMap
);
log
.
info
(
"从Qisda获取料号"
+
partNum
+
"["
+
vendorCode
+
"]尺寸(PartNoRule)返回:"
+
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
)
{
String
w
=
itemMap
.
get
(
"specifications"
).
toString
();
String
h
=
itemMap
.
get
(
"widthSize"
).
toString
();
return
new
PLATE_SIZE
(
Integer
.
valueOf
(
w
),
Integer
.
valueOf
(
h
));
}
}
}
catch
(
ApiException
e
)
{
log
.
error
(
"从Qisda获取料号["
+
partNum
+
"["
+
vendorCode
+
"]尺寸(PartNoRule)接口出错"
,
e
);
}
//
if(DataCache.isProductionFor(DataCache.CUSTOMER.DEBUG)){
//
log.info("程序调试阶段,暂不处理,调试完成后更改PRO");
//
return null;
//
}
//
String url = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/PartNoRule";
//
Map<String,Object> paramMap = new HashMap<String,Object>();
//
paramMap.put("partNum",partNum);
//
paramMap.put("vendorCode",vendorCode);
//
//
try {
//
String result = HttpHelper.postParam(url,paramMap);
//
log.info("从Qisda获取料号"+partNum+"["+vendorCode+"]尺寸(PartNoRule)返回:" + 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) {
//
String w = itemMap.get("specifications").toString();
//
String h = itemMap.get("widthSize").toString();
//
return new PLATE_SIZE(Integer.valueOf(w),Integer.valueOf(h));
//
}
//
}
//
} catch (ApiException e) {
//
log.error("从Qisda获取料号["+partNum+"["+vendorCode+"]尺寸(PartNoRule)接口出错",e);
//
}
return
null
;
}
...
...
myproject/src/main/java/com/myproject/util/StorageConstants.java
查看文件 @
88cfe62
...
...
@@ -531,7 +531,7 @@ public class StorageConstants {
/**
* 完全兼容
*/
FULLY_COMPATIBLE
(
"
11,13,15
完全兼容"
),
FULLY_COMPATIBLE
(
"完全兼容"
),
/**
* 同尺寸兼容
*/
...
...
myproject/src/main/java/com/myproject/webapp/controller/qisda/OutInfoSearchController.java
查看文件 @
88cfe62
...
...
@@ -43,26 +43,38 @@ public class OutInfoSearchController extends BaseSearchController {
@RequestMapping
(
"/outInfoSearch*"
)
public
String
onSubmit
(
@ModelAttribute
(
"searchCriteria"
)
BaseSearchCriteria
searchCriteria
,
HttpServletRequest
request
)
{
boolean
stop
Out
=
dataCache
.
getSettings
().
isStopOut
();
request
.
setAttribute
(
"stop
Out"
,
stopOut
);
boolean
stop
Job
=
dataCache
.
getSettings
().
isStopJob
();
request
.
setAttribute
(
"stop
Job"
,
stopJob
);
Query
query
=
new
Query
();
Criteria
criteria
=
new
Criteria
();
addLikeParam
(
request
,
criteria
,
"so"
);
String
reelId
=
request
.
getParameter
(
"reelId"
);
if
(
Strings
.
isNotBlank
(
reelId
)){
Pattern
pattern
=
Pattern
.
compile
(
reelId
,
Pattern
.
CASE_INSENSITIVE
);
Criteria
c
=
Criteria
.
where
(
"reelID"
).
regex
(
pattern
);
String
lineStr
=
request
.
getParameter
(
"line"
);
if
(
lineStr
==
null
){
lineStr
=
"NONE"
;
}
request
.
setAttribute
(
"line"
,
lineStr
);
if
(
Strings
.
isNotBlank
(
lineStr
)){
String
line
=
lineStr
;
if
(
lineStr
.
equals
(
"NONE"
)){
line
=
null
;
}
criteria
.
and
(
"line"
).
is
(
line
);
}
String
pn
=
request
.
getParameter
(
"pn"
);
if
(
Strings
.
isNotBlank
(
pn
)){
Pattern
pattern
=
Pattern
.
compile
(
pn
,
Pattern
.
CASE_INSENSITIVE
);
Criteria
c
=
Criteria
.
where
(
"pn"
).
regex
(
pattern
);
List
<
OutItem
>
itemList
=
outItemDao
.
findByQuery
(
new
Query
(
c
));
List
<
String
>
hSerialList
=
new
ArrayList
<>();
for
(
OutItem
outItem
:
itemList
)
{
hSerialList
.
add
(
outItem
.
gethSerial
());
}
criteria
.
and
(
"hSerial"
).
in
(
hSerialList
);
request
.
setAttribute
(
"
reelId"
,
reelId
);
request
.
setAttribute
(
"
pn"
,
pn
);
}
else
{
addLikeParam
(
request
,
criteria
,
"hSerial"
);
}
...
...
myproject/src/main/java/com/myproject/webapp/controller/qisda/util/OutInfoCache.java
查看文件 @
88cfe62
...
...
@@ -77,6 +77,7 @@ public class OutInfoCache {
if
(!
isProcessTimer
){
isProcessTimer
=
true
;
try
{
closeOutInfos
();
if
(!
dataCache
.
getSettings
().
isStopJob
()){
updateMustExeOutInfo
();
executeBindTask
();
...
...
@@ -90,15 +91,16 @@ public class OutInfoCache {
}
}
public
void
executeOutTask
(){
/**
* 关闭已完成的需求单
*/
public
void
closeOutInfos
(){
Date
now
=
new
Date
();
List
<
OutInfo
>
cachedOutInfos
=
getCachedOutInfos
();
for
(
OutInfo
unEndOutInfo
:
cachedOutInfos
)
{
if
(!
unEndOutInfo
.
isClosed
()
&&
unEndOutInfo
.
isTaskEnd
()
&&
!
unEndOutInfo
.
isReelCutAction
()){
long
last
EndTime
=
unEndOutInfo
.
getTaskEndTime
();
if
(
now
.
getTime
()
-
last
EndTime
>=
5
*
60
*
1000
){
long
task
EndTime
=
unEndOutInfo
.
getTaskEndTime
();
if
(
taskEndTime
>
0
&&
now
.
getTime
()
-
task
EndTime
>=
5
*
60
*
1000
){
//任务已结束5分钟
if
(
unEndOutInfo
.
isEndOutInfo
()){
log
.
info
(
"需求单["
+
unEndOutInfo
.
gethSerial
()+
"]已执行过,且是工单的最后一个需求单,关闭工单"
+
unEndOutInfo
.
getSo
()+
"["
+
unEndOutInfo
.
getSoseq
()+
"]"
);
...
...
@@ -110,6 +112,19 @@ public class OutInfoCache {
}
}
if
(
unEndOutInfo
.
getFirstExecuteTime
()<=
0
&&
unEndOutInfo
.
getTotalBindNum
()
<=
0
){
//未执行过,且未绑定的,更新绑定数量
int
bindCount
=
storagePosDao
.
countBind
(
unEndOutInfo
.
gethSerial
());
updateBindNum
(
unEndOutInfo
.
gethSerial
(),
bindCount
);
}
}
}
public
void
executeOutTask
(){
Date
now
=
new
Date
();
List
<
OutInfo
>
cachedOutInfos
=
getCachedOutInfos
();
for
(
OutInfo
unEndOutInfo
:
cachedOutInfos
)
{
if
(
unEndOutInfo
.
isReelCutAction
()
||
unEndOutInfo
.
isUrgentAction
()
||
unEndOutInfo
.
isCheckAction
()){
//单独出库,分盘料或盘点料,不按时间可直接执行,距离上次任务完成5分钟后才可再次执行
if
(
unEndOutInfo
.
isTaskEnd
()
||
unEndOutInfo
.
isNew
()){
...
...
@@ -277,7 +292,11 @@ public class OutInfoCache {
continue
;
}
//寻找未执行过的到达建议时间和必须出库时间的工单料(首盘或补料)
if
(
unEndOutInfo
.
isTailAction
()
||
unEndOutInfo
.
isFirstReelAction
()){
if
(
unEndOutInfo
.
isTailAction
()
||
unEndOutInfo
.
isFirstReelAction
()
||
unEndOutInfo
.
isPnAction
()){
if
(
Strings
.
isBlank
(
unEndOutInfo
.
getLine
())){
//无目的地
continue
;
}
long
firstExecuteTime
=
unEndOutInfo
.
getFirstExecuteTime
();
if
(
firstExecuteTime
<
0
){
if
(
mustOutInfo
==
null
||
firstExecuteTime
>
mustOutInfo
.
getFirstExecuteTime
()){
...
...
@@ -626,6 +645,16 @@ public class OutInfoCache {
return
outInfoList
;
}
public
void
updateBindNum
(
String
hSerial
,
int
bindNum
){
OutInfo
outInfo
=
getOutInfoFromCache
(
hSerial
);
if
(
outInfo
!=
null
&&
outInfo
.
getFirstExecuteTime
()
<=
0
)
{
//未执行过,更新
outInfo
.
setTotalBindNum
(
bindNum
);
outInfoDao
.
updateBindNum
(
hSerial
,
bindNum
);
outInfoMap
.
put
(
hSerial
,
outInfo
);
}
}
/**
* 任务开始时,初始化出库任务数
* @param hSerial
...
...
@@ -811,6 +840,25 @@ public class OutInfoCache {
}
}
/**
* 更新需求单的建议和必须出仓时间及线别
*/
public
void
updateOutInfo
(
OutInfo
outInfo
){
//已经执行过的不能更新
outInfoDao
.
updateOutInfo
(
outInfo
);
if
(
outInfo
.
isPnAction
()
&&
Strings
.
isNotBlank
(
outInfo
.
getLine
())){
qisdaBindService
.
bindPnOutInfo
(
outInfo
);
List
<
StoragePos
>
bindPosList
=
storagePosDao
.
findBindList
(
outInfo
.
gethSerial
());
int
bindReelNum
=
bindPosList
.
size
();
outInfo
.
setTotalBindNum
(
bindReelNum
);
log
.
info
(
"PN需求单["
+
outInfo
.
gethSerial
()+
"]绑定料盘数量为:"
+
bindReelNum
);
outInfoDao
.
save
(
outInfo
);
}
outInfoMap
.
put
(
outInfo
.
gethSerial
(),
outInfo
);
log
.
info
(
"更新需求单["
+
outInfo
.
gethSerial
()+
"]的建议时间为:"
+
outInfo
.
getSdate
()
+
" 必须时间为:"
+
outInfo
.
getMdate
()
+
" 目的地为:"
+
outInfo
.
getLine
());
}
private
void
removeFromCache
(
String
hSerial
){
outInfoMap
.
remove
(
hSerial
);
...
...
@@ -867,14 +915,15 @@ public class OutInfoCache {
* @return
*/
private
ResultBean
checkOutInfoCanOut
(
OutInfo
outInfo
){
if
(
dataCache
.
getSettings
().
isStopOut
()){
return
ResultBean
.
newErrorResult
(
100
,
"系统更新中,暂停出库,请稍后再试"
,
false
);
}
if
(
outInfo
==
null
){
return
ResultBean
.
newErrorResult
(
1001
,
"未找到需求单"
,
false
);
}
if
(
Strings
.
isBlank
(
outInfo
.
getLine
())){
return
ResultBean
.
newErrorResult
(
1007
,
"未设置线别"
,
false
);
}
String
hSerial
=
outInfo
.
gethSerial
();
String
executingHSerial
=
QisdaCache
.
getCurrentOrderHSerial
();
if
(
hSerial
.
equals
(
executingHSerial
)){
...
...
@@ -894,20 +943,22 @@ public class OutInfoCache {
//是否有工单料任务
boolean
hasOrderTask
=
false
;
boolean
hasUrgenReel
=
false
;
for
(
DataLog
dataLog
:
allTasks
)
{
if
(
dataLog
.
isCheckOutTask
()){
if
(
dataLog
.
isCheckOutTask
()
&&
!
dataLog
.
isFinished
()
&&
!
dataLog
.
isCancel
()
){
//if(!dataLog.isUrgentReel() && !dataLog.isCutReel() && !dataLog.isLessSendReel()){
if
(
dataLog
.
getAppendInfo
().
isTailAction
()
||
dataLog
.
getAppendInfo
().
isFirstReelAction
()){
//工单料(不是指定料也不是分盘料即首盘或补料)
hasOrderTask
=
true
;
}
else
if
(
dataLog
.
getAppendInfo
().
isPnAction
()){
if
(!
dataLog
.
isInBelt
()){
return
ResultBean
.
newErrorResult
(
1006
,
"上一需求单全部任务出库完成后才可执行"
,
false
);
}
}
else
{
//分盘和紧急料或缺料补发的料
String
taskHSerial
=
dataLog
.
getAppendInfo
().
gethSerial
();
if
(
taskHSerial
.
equals
(
outInfo
.
gethSerial
())){
return
ResultBean
.
newErrorResult
(
1002
,
"当前需求单还有未完成的任务"
,
false
);
}
hasUrgenReel
=
true
;
}
}
}
...
...
@@ -954,6 +1005,11 @@ public class OutInfoCache {
private
static
AtomicBoolean
outProcessing
=
new
AtomicBoolean
(
false
);
public
synchronized
ResultBean
checkOutOutItems
(
String
hSerial
){
if
(
dataCache
.
getSettings
().
isStopOut
()){
return
ResultBean
.
newErrorResult
(
1001
,
"系统更新中,暂停出入库,请稍后再试"
,
false
);
}
boolean
canProcess
=
outProcessing
.
compareAndSet
(
false
,
true
);
try
{
if
(
canProcess
){
...
...
@@ -970,7 +1026,7 @@ public class OutInfoCache {
}
}
p
ublic
synchronized
ResultBean
executeOutItems
(
String
hSerial
){
p
rivate
synchronized
ResultBean
executeOutItems
(
String
hSerial
){
//OutInfo outInfo = outInfoDao.findByHSerial(hSerial);
OutInfo
outInfoToExecute
=
getOutInfoFromCache
(
hSerial
);
...
...
@@ -1103,12 +1159,6 @@ public class OutInfoCache {
msg
=
"需求单"
+
hSerial
+
"任务分配完成,共["
+
outReelNum
+
"]盘任务"
;
log
.
info
(
msg
);
}
else
{
msg
=
"需求单"
+
outInfo
.
gethSerial
()+
"本次出库料盘数量为0"
;
if
(
outInfo
.
isEndOutInfo
()){
log
.
info
(
"需求单["
+
outInfo
.
gethSerial
()+
"]是工单的最后一个需求单,关闭工单"
+
outInfo
.
getSo
()+
"["
+
outInfo
.
getSoseq
()+
"]"
);
closeSoSeq
(
outInfo
.
getSoseq
());
}
}
if
(
outInfo
.
isReelCutAction
()
||
outInfo
.
isFirstReelAction
()){
...
...
@@ -1118,6 +1168,15 @@ public class OutInfoCache {
QisdaApi
.
VMILocationOutFeedback
(
outItemList
,
lessBind
);
}
}
if
(
outReelNum
==
0
){
msg
=
"需求单"
+
outInfo
.
gethSerial
()+
"本次出库料盘数量为0"
;
if
(
outInfo
.
isEndOutInfo
()){
log
.
info
(
"需求单["
+
outInfo
.
gethSerial
()+
"]是工单的最后一个需求单,关闭工单"
+
outInfo
.
getSo
()+
"["
+
outInfo
.
getSoseq
()+
"]"
);
closeSoSeq
(
outInfo
.
getSoseq
());
}
else
{
closeHSerial
(
outInfo
.
gethSerial
());
}
}
return
ResultBean
.
newOkResult
(
msg
,
"ok"
);
}
...
...
myproject/src/main/java/com/myproject/webapp/controller/user/DataLogSearchController.java
查看文件 @
88cfe62
...
...
@@ -82,13 +82,13 @@ public class DataLogSearchController extends BaseSearchController {
String
barcode
=
searchCriteria
.
getBarcode
();
if
(!
Strings
.
isNullOrEmpty
(
barcode
)){
Pattern
pattern
=
Pattern
.
compile
(
barcode
,
Pattern
.
CASE_INSENSITIVE
);
Pattern
pattern
=
Pattern
.
compile
(
escapeExprSpecialWord
(
barcode
)
,
Pattern
.
CASE_INSENSITIVE
);
criteria
.
and
(
"barcode"
).
regex
(
pattern
);
}
String
partNumber
=
searchCriteria
.
getPartNumber
();
if
(!
Strings
.
isNullOrEmpty
(
partNumber
))
{
Pattern
pattern
=
Pattern
.
compile
(
partNumber
,
Pattern
.
CASE_INSENSITIVE
);
Pattern
pattern
=
Pattern
.
compile
(
escapeExprSpecialWord
(
partNumber
)
,
Pattern
.
CASE_INSENSITIVE
);
criteria
.
and
(
"partNumber"
).
regex
(
pattern
);
}
...
...
@@ -129,6 +129,18 @@ public class DataLogSearchController extends BaseSearchController {
return
SUCCESS_VIEW
;
}
private
String
escapeExprSpecialWord
(
String
keyword
)
{
if
(!
Strings
.
isNullOrEmpty
(
keyword
))
{
String
[]
fbsArr
=
{
"\\"
,
"$"
,
"("
,
")"
,
"*"
,
"+"
,
"."
,
"["
,
"]"
,
"?"
,
"^"
,
"{"
,
"}"
,
"|"
};
for
(
String
key
:
fbsArr
)
{
if
(
keyword
.
contains
(
key
))
{
keyword
=
keyword
.
replace
(
key
,
"\\"
+
key
);
}
}
}
return
keyword
;
}
@Override
protected
BaseSearchCriteria
getNewSearchCriteria
()
{
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/GreeDeviceController.java
查看文件 @
88cfe62
...
...
@@ -65,7 +65,6 @@ public class GreeDeviceController {
}
}
String
hSerial
=
QisdaCache
.
getCurrentOrderHSerial
();
List
<
String
>
usedRfidList
=
InquiryShelfBean
.
getUsedRfidList
(
hSerial
);
Map
<
String
,
Integer
>
rfidMap
=
new
HashMap
<>();
if
(!
Strings
.
isBlank
(
rfids
))
{
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaApiController.java
查看文件 @
88cfe62
package
com
.
myproject
.
webapp
.
controller
.
webService
;
import
com.google.common.base.Strings
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Sets
;
import
com.myproject.bean.json.ChartItem
;
import
com.myproject.bean.qisda.*
;
...
...
@@ -120,7 +119,26 @@ public class QisdaApiController extends BaseController {
}
@RequestMapping
(
"/updateLine"
)
@ResponseBody
public
ResultBean
updateLine
(
HttpServletRequest
request
){
String
hSerial
=
request
.
getParameter
(
"hSerial"
);
String
line
=
request
.
getParameter
(
"line"
);
//OutInfo outInfo = outInfoCache.getOutInfoFromCache(hSerial);
//qisdaBindService.realBindOutInfo(outInfo);
log
.
info
(
"手动修改需求单["
+
hSerial
+
"]目的地:"
+
line
);
OutInfo
outInfo
=
outInfoCache
.
getOutInfoFromCache
(
hSerial
);
if
(!
Strings
.
isNullOrEmpty
(
line
)
&&
outInfo
!=
null
){
outInfo
.
setLine
(
line
);
outInfo
.
setSdate
(
new
Date
());
outInfo
.
setMdate
(
new
Date
());
outInfoCache
.
updateOutInfo
(
outInfo
);
return
ResultBean
.
newOkResult
(
outInfo
);
}
else
{
return
ResultBean
.
newErrorResult
(
2001
,
"线别为空"
);
}
}
@RequestMapping
(
"/executeOut"
)
@ResponseBody
...
...
@@ -128,8 +146,14 @@ public class QisdaApiController extends BaseController {
String
hSerial
=
request
.
getParameter
(
"hSerial"
);
//OutInfo outInfo = outInfoCache.getOutInfoFromCache(hSerial);
//qisdaBindService.realBindOutInfo(outInfo);
ResultBean
resultBean
=
null
;
if
(!
dataCache
.
getSettings
().
isStopJob
()){
resultBean
=
ResultBean
.
newErrorResult
(
1001
,
"自动任务开启时,不允许手动出库"
,
false
);
}
else
{
log
.
info
(
"手动执行需求单["
+
hSerial
+
"]出库"
);
ResultBean
resultBean
=
outInfoCache
.
checkOutOutItems
(
hSerial
);
resultBean
=
outInfoCache
.
checkOutOutItems
(
hSerial
);
}
return
resultBean
.
getMsg
();
}
...
...
@@ -161,6 +185,31 @@ public class QisdaApiController extends BaseController {
QisdaApi
.
VMIMateriaReceive
(
barcode
,
task
);
}
}
/**
* 获取需求单的绑定信息
*/
@RequestMapping
(
value
=
"/hSerialLockInfo"
)
@ResponseBody
public
ResultBean
hSerialLockInfo
(
HttpServletRequest
request
){
String
hSerialListStr
=
receiveParamInfo
(
request
,
"hSerialList"
);
log
.
info
(
"收到工单绑定查询请求hSerialListStr="
+
hSerialListStr
);
Set
<
String
>
hSerialSet
=
Sets
.
newHashSet
();
if
(!
Strings
.
isNullOrEmpty
(
hSerialListStr
)){
String
[]
hSerialArr
=
hSerialListStr
.
split
(
","
);
for
(
String
hSerial
:
hSerialArr
)
{
hSerialSet
.
add
(
hSerial
);
}
}
List
<
LockInfo
>
lockInfos
=
new
ArrayList
<>();
for
(
String
soseq
:
hSerialSet
)
{
LockInfo
lockInfo
=
getHSerialLockInfo
(
soseq
);
lockInfos
.
add
(
lockInfo
);
}
return
ResultBean
.
newOkResult
(
lockInfos
);
}
/**
* 获取工单的绑定信息
*/
...
...
@@ -188,20 +237,43 @@ public class QisdaApiController extends BaseController {
}
}
List
<
Soseq
LockInfo
>
lockInfos
=
new
ArrayList
<>();
List
<
LockInfo
>
lockInfos
=
new
ArrayList
<>();
for
(
String
soseq
:
soseqSet
)
{
SoseqLockInfo
lockInfo
=
get
LockInfo
(
soseq
);
LockInfo
lockInfo
=
getSoSeq
LockInfo
(
soseq
);
lockInfos
.
add
(
lockInfo
);
}
return
ResultBean
.
newOkResult
(
lockInfos
);
}
private
SoseqLockInfo
getLockInfo
(
String
soseq
){
SoseqLockInfo
soseqLockInfo
=
new
SoseqLockInfo
();
soseqLockInfo
.
setSoseq
(
soseq
);
private
LockInfo
getHSerialLockInfo
(
String
hSerial
){
LockInfo
lockInfo
=
new
LockInfo
();
lockInfo
.
sethSerial
(
hSerial
);
OutInfo
outInfo
=
outInfoCache
.
getOutInfoFromCache
(
hSerial
);
if
(
outInfo
!=
null
){
lockInfo
.
setSo
(
outInfo
.
getSo
());
lockInfo
.
setSoseq
(
outInfo
.
getSoseq
());
for
(
OutItem
outItem
:
outInfo
.
getOutItems
())
{
LockItemInfo
lockItemInfo
=
new
LockItemInfo
();
lockItemInfo
.
setSoseq
(
outItem
.
getSoseq
());
lockItemInfo
.
setSlotlocation
(
outItem
.
getSlotlocation
());
lockItemInfo
.
setPartNum
(
outItem
.
getPn
());
lockItemInfo
.
setQty
(
outItem
.
getQty
());
lockItemInfo
.
setPreLockQty
(
outItem
.
getLockQty
());
lockItemInfo
.
setRealLockQty
(
outItem
.
getRealLockQty
());
lockItemInfo
.
setTotalSendQty
(
outItem
.
getSendQty
());
lockItemInfo
.
setFirstSendQty
(
outItem
.
getOutQty
());
lockInfo
.
addLockItem
(
lockItemInfo
);
}
}
return
lockInfo
;
}
private
LockInfo
getSoSeqLockInfo
(
String
soseq
){
LockInfo
lockInfo
=
new
LockInfo
();
lockInfo
.
setSoseq
(
soseq
);
OutInfo
cutOutInfo
=
soseqCache
.
getCutActionInfoFromCache
(
soseq
);
if
(
cutOutInfo
!=
null
){
soseqL
ockInfo
.
setSo
(
cutOutInfo
.
getSo
());
l
ockInfo
.
setSo
(
cutOutInfo
.
getSo
());
for
(
OutItem
outItem
:
cutOutInfo
.
getOutItems
())
{
LockItemInfo
lockItemInfo
=
new
LockItemInfo
();
lockItemInfo
.
setSoseq
(
outItem
.
getSoseq
());
...
...
@@ -212,10 +284,10 @@ public class QisdaApiController extends BaseController {
lockItemInfo
.
setRealLockQty
(
outItem
.
getRealLockQty
());
lockItemInfo
.
setTotalSendQty
(
outItem
.
getSendQty
());
lockItemInfo
.
setFirstSendQty
(
outItem
.
getOutQty
());
soseqL
ockInfo
.
addLockItem
(
lockItemInfo
);
l
ockInfo
.
addLockItem
(
lockItemInfo
);
}
}
return
soseqL
ockInfo
;
return
l
ockInfo
;
}
/**
...
...
@@ -297,19 +369,28 @@ public class QisdaApiController extends BaseController {
}
/**
* 关闭工单
* 关闭工单
或需求单
*/
@RequestMapping
(
value
=
"/close
SoSeq
"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/close
OutInfo
"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
ResultBean
close
SoSeq
(
HttpServletRequest
request
)
{
public
ResultBean
close
OutInfo
(
HttpServletRequest
request
)
{
try
{
String
soseq
=
receiveParamInfo
(
request
,
"soseq"
);
log
.
info
(
"收到关闭工单请求soseq="
+
soseq
);
if
(
soseq
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
"未找到soseq参数"
);
String
hSerial
=
receiveParamInfo
(
request
,
"hSerial"
);
log
.
info
(
"收到关闭工单请求soseq="
+
soseq
+
"&hSerial="
+
hSerial
);
if
(
soseq
==
null
&&
hSerial
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
"未找到soseq或hSerial参数"
);
}
String
msg
=
""
;
if
(
soseq
!=
null
){
ResultBean
resultBean
=
outInfoCache
.
closeSoSeq
(
soseq
);
return
resultBean
;
msg
=
resultBean
.
getMsg
();
}
if
(
hSerial
!=
null
){
ResultBean
resultBean
=
outInfoCache
.
closeHSerial
(
hSerial
);
msg
=
msg
+
resultBean
.
getMsg
();
}
return
ResultBean
.
newOkResult
(
msg
);
}
catch
(
Exception
e
)
{
log
.
error
(
"需求单请求处理出错"
,
e
);
return
ResultBean
.
newErrorResult
(
1001
,
"内部错误:"
+
e
.
getMessage
());
...
...
@@ -457,46 +538,6 @@ public class QisdaApiController extends BaseController {
outItem
=
outItemDao
.
save
(
outItem
);
if
(
outItem
.
isPnAction
()){
int
needNum
=
outItem
.
getQty
()
-
outItem
.
getSendQty
()
-
outItem
.
getRealLockQty
();
log
.
info
(
"将预绑定转为真实绑定结束,所需数量("
+
needNum
+
")=需求单数量("
+
outItem
.
getQty
()+
")-已发料数量("
+
outItem
.
getSendQty
()+
")-真实绑定数量"
+
outItem
.
getRealLockQty
()
+
")"
);
if
(
needNum
>=
0
){
log
.
info
(
"预绑定数量不足,查找未绑定料盘进行真实绑定结束,当前数量:"
+
outItem
.
getSendQty
()+
"+"
+
outItem
.
getRealLockQty
()
+
"/"
+
outItem
.
getQty
());
while
(
needNum
>=
0
){
StoragePos
pos
=
storagePosDao
.
findNoBindMinQty
(
outItem
.
getPn
(),
outItem
.
getFacility
());
if
(
pos
!=
null
){
Barcode
barcode
=
pos
.
getBarcode
();
AppendInfo
appendInfo
=
barcode
.
getAppendInfo
();
//未真实绑定过,可以出库,绑定
appendInfo
.
sethSerial
(
outItem
.
gethSerial
());
appendInfo
.
setRefno
(
outItem
.
getRefno
());
appendInfo
.
setSo
(
"HSerial-"
+
outItem
.
gethSerial
());
appendInfo
.
setSoseq
(
"HSerial-"
+
outItem
.
gethSerial
());
appendInfo
.
setSlotStr
(
outItem
.
getSlotStr
());
appendInfo
.
setOutItemId
(
outItem
.
getId
());
appendInfo
.
setBindSlot
(
"1"
);
appendInfo
.
setSlotIndex
(
1
);
barcode
.
setAppendInfo
(
appendInfo
);
pos
.
setBarcode
(
barcode
);
storagePosDao
.
save
(
pos
);
int
totalLockQty
=
outItem
.
getLockQty
()
+
barcode
.
getAmount
();
outItem
.
setLockQty
(
totalLockQty
);
outItem
.
setRealLockQty
(
totalLockQty
);
}
else
{
break
;
}
if
(
outItem
.
getRealLockQty
()
>
outItem
.
getQty
()){
//已经满足需求了,直接跳出
break
;
}
}
}
outItem
=
outItemDao
.
save
(
outItem
);
outInfo
.
updateItem
(
outItem
);
outInfoMap
.
put
(
hSerial
,
outInfo
);
}
else
if
(
outItem
.
isUrgentAction
()){
...
...
@@ -627,6 +668,73 @@ public class QisdaApiController extends BaseController {
}
/**
* 更新需求单时间
*/
@RequestMapping
(
value
=
"/updateOutInfo"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
updateOutInfo
(
HttpServletRequest
request
)
{
try
{
String
paramInfo
=
receiveParamInfo
(
request
,
"paramInfo"
);
log
.
info
(
"收到需求单修改时间请求:"
+
paramInfo
);
if
(
paramInfo
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
"参数为空"
);
}
List
<
RequestOutItemBean
>
items
=
JsonUtil
.
toList
(
paramInfo
,
RequestOutItemBean
.
class
);
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
log
.
info
(
"需求单修改时间请求解析成功,开始处理"
);
for
(
RequestOutItemBean
itemBean
:
items
)
{
OutItem
outItem
=
new
OutItem
(
itemBean
);
String
hSerial
=
outItem
.
gethSerial
();
OutInfo
outInfo
=
outInfoCache
.
getOutInfoFromCache
(
hSerial
);
String
resultMsg
=
""
;
if
(
outInfo
==
null
){
resultMsg
=
"需求单号不存在"
;
}
else
{
boolean
outInfoExecuted
=
outInfo
.
getFirstExecuteTime
()
>
0
;
if
(
outInfoExecuted
){
resultMsg
=
"需求单已执行过,不允许修改"
;
}
else
{
Date
now
=
new
Date
();
Date
oldMustDate
=
outInfo
.
getMdate
();
Date
newSuggestDate
=
outItem
.
getSdate
();
Date
newMustDate
=
outItem
.
getMdate
();
if
(
oldMustDate
.
before
(
now
)){
resultMsg
=
"需求单已到达必须时间,不允许修改"
;
}
else
if
(
newSuggestDate
.
before
(
now
)){
resultMsg
=
"新的建议时间不能早于当前时间"
;
}
else
if
(
newMustDate
.
before
(
now
)){
resultMsg
=
"新的必须时间不能早于当前时间"
;
}
else
{
if
(
newMustDate
!=
null
){
outInfo
.
setMdate
(
newMustDate
);
}
if
(
newSuggestDate
!=
null
){
outInfo
.
setSdate
(
newSuggestDate
);
}
String
newLine
=
outItem
.
getLine
();
if
(
Strings
.
isNullOrEmpty
(
newLine
)){
outInfo
.
setLine
(
outItem
.
getLine
());
}
outInfoCache
.
updateOutInfo
(
outInfo
);
resultMsg
=
"ok"
;
}
}
}
resultMap
.
put
(
hSerial
,
resultMsg
);
log
.
info
(
"需求单["
+
hSerial
+
"]修改时间结果:"
+
resultMsg
);
}
return
ResultBean
.
newOkResult
(
resultMap
);
}
catch
(
Exception
e
)
{
log
.
error
(
"需求单修改时间请求处理出错"
,
e
);
return
ResultBean
.
newErrorResult
(
1001
,
"内部错误:"
+
e
.
getMessage
());
}
}
//-------------------------Private Method----------------------------------------
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaBindService.java
查看文件 @
88cfe62
...
...
@@ -90,6 +90,55 @@ public class QisdaBindService {
}
}
/**
* 绑定PN需求单
*/
public
void
bindPnOutInfo
(
OutInfo
pnOutInfo
){
log
.
info
(
"Pn需求单["
+
pnOutInfo
.
gethSerial
()+
"]线别["
+
pnOutInfo
.
getLine
()+
"]开始进行绑定"
);
for
(
OutItem
outItem
:
pnOutInfo
.
getOutItems
())
{
int
needNum
=
outItem
.
getQty
()
-
outItem
.
getSendQty
()
-
outItem
.
getRealLockQty
();
//log.info("开始绑定,所需数量("+needNum+")=需求单数量("+outItem.getQty()+")-已发料数量("+ outItem.getSendQty()+")-真实绑定数量"+ outItem.getRealLockQty() +")");
if
(
needNum
>=
0
){
log
.
info
(
"查找未绑定料盘进行真实绑定结束,当前数量:"
+
outItem
.
getSendQty
()+
"+"
+
outItem
.
getRealLockQty
()
+
"/"
+
outItem
.
getQty
());
while
(
needNum
>=
0
){
StoragePos
pos
=
storagePosDao
.
findNoBindMinQty
(
outItem
.
getPn
(),
outItem
.
getFacility
());
if
(
pos
!=
null
){
Barcode
barcode
=
pos
.
getBarcode
();
AppendInfo
appendInfo
=
barcode
.
getAppendInfo
();
//未真实绑定过,可以出库,绑定
appendInfo
.
sethSerial
(
outItem
.
gethSerial
());
appendInfo
.
setRefno
(
outItem
.
getRefno
());
appendInfo
.
setSo
(
"HSerial-"
+
outItem
.
gethSerial
());
appendInfo
.
setSoseq
(
"HSerial-"
+
outItem
.
gethSerial
());
appendInfo
.
setSlotStr
(
outItem
.
getSlotStr
());
appendInfo
.
setOutItemId
(
outItem
.
getId
());
appendInfo
.
setBindSlot
(
"1"
);
appendInfo
.
setSlotIndex
(
1
);
barcode
.
setAppendInfo
(
appendInfo
);
pos
.
setBarcode
(
barcode
);
storagePosDao
.
save
(
pos
);
int
totalLockQty
=
outItem
.
getLockQty
()
+
barcode
.
getAmount
();
outItem
.
setLockQty
(
totalLockQty
);
outItem
.
setRealLockQty
(
totalLockQty
);
log
.
info
(
"绑定料盘"
+
barcode
.
getBarcode
()+
"["
+
barcode
.
getPartNumber
()+
"]到PN需求单["
+
outItem
.
gethSerial
()+
"]"
);
}
else
{
break
;
}
if
(
outItem
.
getRealLockQty
()
>
outItem
.
getQty
()){
//已经满足需求了,直接跳出
break
;
}
}
}
outItem
=
outItemDao
.
save
(
outItem
);
pnOutInfo
.
updateItem
(
outItem
);
}
}
/******************************** 以下是 Private 方法*******************************************/
...
...
@@ -323,102 +372,106 @@ public class QisdaBindService {
* 绑定入库料盘
*/
public
Barcode
bindPutInReel
(
Barcode
barcode
){
boolean
isCutReelIn
=
false
;
String
bindSoseq
=
barcode
.
getAppendInfo
().
getSoseq
();
String
bindSlot
=
barcode
.
getAppendInfo
().
getBindSlot
();
OutItem
bindItem
=
null
;
if
(
Strings
.
isBlank
(
bindSoseq
)){
//未绑定
bindItem
=
findNeedBindItem
(
barcode
);
}
else
{
//料盘分盘过后入库(已经预绑定过)
isCutReelIn
=
true
;
bindItem
=
soseqCache
.
getCutOutItem
(
bindSoseq
,
Integer
.
valueOf
(
bindSlot
));
}
if
(
bindItem
!=
null
){
log
.
info
(
"找到未绑定需求单["
+
bindItem
.
gethSerial
()+
"],准备进行绑定"
);
if
(
bindItem
.
isPnAction
()){
OutInfo
outInfo
=
outInfoCache
.
getOutInfoFromCache
(
bindItem
.
gethSerial
());
if
(
outInfo
!=
null
&&
outInfo
.
isClosed
()){
log
.
info
(
"需求单["
+
outInfo
.
gethSerial
()+
"]已关闭,不再绑定料盘["
+
barcode
.
getBarcode
()+
"]"
);
barcode
=
barcode
.
removeBindInfo
();
}
else
{
AppendInfo
appendInfo
=
barcode
.
getAppendInfo
();
//未真实绑定过,可以出库,绑定
appendInfo
.
sethSerial
(
bindItem
.
gethSerial
());
appendInfo
.
setRefno
(
bindItem
.
getRefno
());
appendInfo
.
setSo
(
"HSerial-"
+
bindItem
.
gethSerial
());
appendInfo
.
setSoseq
(
"HSerial-"
+
bindItem
.
gethSerial
());
appendInfo
.
setSlotStr
(
bindItem
.
getSlotStr
());
appendInfo
.
setOutItemId
(
bindItem
.
getId
());
appendInfo
.
setBindSlot
(
"1"
);
appendInfo
.
setSlotIndex
(
1
);
barcode
.
setAppendInfo
(
appendInfo
);
int
totalLockQty
=
bindItem
.
getLockQty
()
+
barcode
.
getAmount
();
bindItem
.
setLockQty
(
totalLockQty
);
bindItem
.
setRealLockQty
(
totalLockQty
);
outItemDao
.
updateLockQty
(
bindItem
.
getId
(),
totalLockQty
,
totalLockQty
);
outInfoCache
.
updateOutItem
(
bindItem
.
getId
());
log
.
info
(
"绑定料盘["
+
barcode
.
getBarcode
()+
"]到需求单["
+
bindItem
.
gethSerial
()+
"]完成"
);
}
}
else
if
(
bindItem
.
isReelCutAction
()){
OutInfo
cutOutInfo
=
soseqCache
.
getCutActionInfoFromCache
(
bindItem
.
getSoseq
());
if
(
cutOutInfo
!=
null
&&
cutOutInfo
.
isClosed
()){
log
.
info
(
"工单["
+
cutOutInfo
.
getSo
()+
"]已关闭,不再绑定料盘["
+
barcode
.
getBarcode
()+
"]"
);
barcode
=
barcode
.
removeBindInfo
();
}
else
{
//分盘料
if
(
bindItem
.
isCutMaterial
()){
if
(!
isCutReelIn
){
//不是分完盘入库的,需要先进行预绑定
int
preBindQty
=
bindItem
.
getLockQty
()
+
barcode
.
getAmount
();
if
(
preBindQty
>
bindItem
.
getQty
()){
int
reelRemainNum
=
barcode
.
cutCount
(
bindItem
);
if
(
reelRemainNum
>
0
){
//母盘还有剩余,说明该需求slot已经满足
preBindQty
=
bindItem
.
getQty
();
}
else
{
//母盘正好用完或全部用完也达不到需求量,此母盘绑定slot后,需要继续寻找其他盘进行绑定
preBindQty
=
preBindQty
+
barcode
.
getAmount
();
}
}
bindItem
.
setLockQty
(
preBindQty
);
soseqCache
.
udpateTotalPreLockQty
(
bindItem
,
preBindQty
);
log
.
info
(
"\t分盘料"
+
barcode
.
getBarcode
()+
"["
+
barcode
.
getPartNumber
()+
"]绑定到soseq=["
+
bindItem
.
getSoseq
()+
"]so=["
+
bindItem
.
getSo
()+
"]的["
+
bindItem
.
getSlotlocation
()+
"] 数量:"
+
preBindQty
+
"/"
+
bindItem
.
getQty
());
}
if
(!
barcode
.
hasCutInfo
()){
//没有分盘信息,可以直接绑定
barcode
.
realBindItem
(
bindItem
);
int
realBindQty
=
bindItem
.
getRealLockQty
()
+
barcode
.
getAmount
();
bindItem
.
setRealLockQty
(
realBindQty
);
soseqCache
.
updateTotalRealLockQty
(
bindItem
,
realBindQty
);
}
else
{
AppendInfo
appendInfo
=
barcode
.
getAppendInfo
();
appendInfo
.
setSlotIndex
(
bindItem
.
getSlotlocation
());
appendInfo
.
setSo
(
bindItem
.
getSo
());
appendInfo
.
setSoseq
(
bindItem
.
getSoseq
());
barcode
.
setAppendInfo
(
appendInfo
);
log
.
info
(
"分盘料["
+
barcode
.
getBarcode
()+
"]分盘信息:"
+
barcode
.
getAppendInfo
().
getCutMap
());
}
}
else
{
//绑定
barcode
.
realBindItem
(
bindItem
);
int
realBindQty
=
bindItem
.
getRealLockQty
()
+
barcode
.
getAmount
();
bindItem
.
setRealLockQty
(
realBindQty
);
soseqCache
.
updateTotalRealLockQty
(
bindItem
,
realBindQty
);
log
.
info
(
barcode
.
getBarcode
()
+
"["
+
barcode
.
getPartNumber
()+
"]入库完成,工单so=["
+
bindItem
.
getSo
()+
"] soseq=["
+
bindItem
.
getSoseq
()+
"]slotSeq=["
+
bindItem
.
getSlotlocation
()+
"]绑定数量增加"
+
barcode
.
getAmount
()+
"="
+
realBindQty
);
}
unbindSurplusReel
(
bindItem
);
}
}
}
barcode
=
barcodeDao
.
save
(
barcode
);
// boolean isCutReelIn = false;
// String bindSoseq = barcode.getAppendInfo().getSoseq();
// String bindSlot = barcode.getAppendInfo().getBindSlot();
// OutItem bindItem = null;
// if(Strings.isBlank(bindSoseq)){
// //未绑定
// bindItem = findNeedBindItem(barcode);
// barcode = barcode.removeBindInfo();
// }else{
// //料盘分盘过后入库(已经预绑定过)
// isCutReelIn = true;
// bindItem = soseqCache.getCutOutItem(bindSoseq, Integer.valueOf(bindSlot));
// }
// if(bindItem != null){
// log.info("找到未绑定需求单["+bindItem.gethSerial()+"],准备进行绑定");
// if(bindItem.isPnAction()){
// OutInfo outInfo = outInfoCache.getOutInfoFromCache(bindItem.gethSerial());
// if(outInfo != null && outInfo.isClosed()){
// log.info("需求单["+outInfo.gethSerial()+"]已关闭,不再绑定料盘["+barcode.getBarcode()+"]");
// barcode = barcode.removeBindInfo();
// }else{
// AppendInfo appendInfo = barcode.getAppendInfo();
// //未真实绑定过,可以出库,绑定
// appendInfo.sethSerial(bindItem.gethSerial());
// appendInfo.setRefno(bindItem.getRefno());
// appendInfo.setSo("HSerial-" + bindItem.gethSerial());
// appendInfo.setSoseq("HSerial-" + bindItem.gethSerial());
// appendInfo.setSlotStr(bindItem.getSlotStr());
// appendInfo.setOutItemId(bindItem.getId());
//
// appendInfo.setBindSlot("1");
// appendInfo.setSlotIndex(1);
// barcode.setAppendInfo(appendInfo);
// int totalLockQty = bindItem.getLockQty() + barcode.getAmount();
// bindItem.setLockQty(totalLockQty);
// bindItem.setRealLockQty(totalLockQty);
// outItemDao.updateLockQty(bindItem.getId(), totalLockQty, totalLockQty);
//
// int bindCount = storagePosDao.countBind(bindItem.gethSerial());
// outInfoCache.updateBindNum(bindItem.gethSerial(),bindCount);
// outInfoCache.updateOutItem(bindItem.getId());
// log.info("绑定料盘["+barcode.getBarcode()+"]到需求单["+bindItem.gethSerial()+"]完成");
// }
// }else if(bindItem.isReelCutAction()){
// OutInfo cutOutInfo = soseqCache.getCutActionInfoFromCache(bindItem.getSoseq());
// if(cutOutInfo != null && cutOutInfo.isClosed()){
// log.info("工单["+cutOutInfo.getSo()+"]已关闭,不再绑定料盘["+barcode.getBarcode()+"]");
// barcode = barcode.removeBindInfo();
// }else{
// //分盘料
// if(bindItem.isCutMaterial()){
// if(!isCutReelIn){
// //不是分完盘入库的,需要先进行预绑定
// int preBindQty = bindItem.getLockQty() + barcode.getAmount();
// if(preBindQty > bindItem.getQty()){
// int reelRemainNum = barcode.cutCount(bindItem);
// if(reelRemainNum > 0){
// //母盘还有剩余,说明该需求slot已经满足
// preBindQty = bindItem.getQty();
// }else {
// //母盘正好用完或全部用完也达不到需求量,此母盘绑定slot后,需要继续寻找其他盘进行绑定
// preBindQty = preBindQty + barcode.getAmount();
// }
// }
// bindItem.setLockQty(preBindQty);
// soseqCache.udpateTotalPreLockQty(bindItem,preBindQty);
//
//
// log.info("\t分盘料"+barcode.getBarcode()+"["+barcode.getPartNumber()+"]绑定到soseq=["+bindItem.getSoseq()+"]so=["+bindItem.getSo()+"]的["+bindItem.getSlotlocation()+"] 数量:" + preBindQty +"/" + bindItem.getQty());
// }
//
// if(!barcode.hasCutInfo()){
// //没有分盘信息,可以直接绑定
// barcode.realBindItem(bindItem);
// int realBindQty = bindItem.getRealLockQty() + barcode.getAmount();
// bindItem.setRealLockQty(realBindQty);
// soseqCache.updateTotalRealLockQty(bindItem,realBindQty);
// }else{
// AppendInfo appendInfo = barcode.getAppendInfo();
// appendInfo.setSlotIndex(bindItem.getSlotlocation());
// appendInfo.setSo(bindItem.getSo());
// appendInfo.setSoseq(bindItem.getSoseq());
// barcode.setAppendInfo(appendInfo);
// log.info("分盘料["+barcode.getBarcode()+"]分盘信息:" + barcode.getAppendInfo().getCutMap());
// }
// }else{
// //绑定
// barcode.realBindItem(bindItem);
// int realBindQty = bindItem.getRealLockQty() + barcode.getAmount();
// bindItem.setRealLockQty(realBindQty);
// soseqCache.updateTotalRealLockQty(bindItem,realBindQty);
// log.info(barcode.getBarcode() + "["+barcode.getPartNumber()+"]入库完成,工单so=["+bindItem.getSo()+"] soseq=["+bindItem.getSoseq()+"]slotSeq=["+bindItem.getSlotlocation()+"]绑定数量增加"+barcode.getAmount()+"="+ realBindQty);
// }
//
// unbindSurplusReel(bindItem);
// }
// }
// }
//
// barcode = barcodeDao.save(barcode);
return
barcode
;
}
...
...
@@ -466,6 +519,7 @@ public class QisdaBindService {
List
<
OutInfo
>
cacheOutInfoList
=
outInfoCache
.
getCachedOutInfos
();
List
<
String
>
lessHSerialList
=
new
ArrayList
<>();
for
(
OutInfo
unEndOutInfo
:
cacheOutInfoList
)
{
if
(
Strings
.
isNotBlank
(
unEndOutInfo
.
getLine
())){
if
(!
unEndOutInfo
.
isClosed
()
&&
!
unEndOutInfo
.
isRealBindOk
()){
if
(
unEndOutInfo
.
isPnAction
()){
lessHSerialList
.
add
(
unEndOutInfo
.
gethSerial
());
...
...
@@ -473,7 +527,7 @@ public class QisdaBindService {
lessHSerialList
.
add
(
unEndOutInfo
.
gethSerial
());
}
}
}
}
String
pn
=
barcode
.
getPartNumber
();
...
...
@@ -481,6 +535,7 @@ public class QisdaBindService {
//List<OutItem> cutItemList = outItemDao.findCutItemList(lessSoseqList, pn, facility);
log
.
info
(
"查找["
+
String
.
join
(
","
,
lessHSerialList
)+
"]未完成pn=["
+
pn
+
"]facility=["
+
facility
+
"]的需求单详情"
);
List
<
OutItem
>
outItemList
=
outItemDao
.
findUnFinishedItemList
(
lessHSerialList
,
pn
,
facility
);
//优先绑定执行过的工单,如果没有,则绑定优先执行的工单
...
...
@@ -489,8 +544,11 @@ public class QisdaBindService {
for
(
OutItem
outItem
:
outItemList
)
{
if
(!
outItem
.
isBindOk
()){
OutInfo
outInfo
=
soseqCache
.
getCutActionInfoFromCache
(
outItem
.
getSoseq
());
OutInfo
outInfo
=
outInfoCache
.
getOutInfoFromCache
(
outItem
.
gethSerial
());
if
(
outInfo
!=
null
){
//只对有目的地并且缺料的进行绑定
if
(
outInfo
.
isPnAction
()
||
outInfo
.
isReelCutAction
()){
//真实绑定缺料
if
(
outItem
.
realBindLessQty
()
>
0
){
int
orderIndex
=
lessHSerialList
.
indexOf
(
outItem
.
gethSerial
());
...
...
@@ -500,6 +558,8 @@ public class QisdaBindService {
}
}
}
}
}
}
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaDeviceController.java
查看文件 @
88cfe62
...
...
@@ -171,6 +171,8 @@ public class QisdaDeviceController extends BaseController {
try
{
String
rfid
=
request
.
getParameter
(
"rfid"
);
//是否是在横移上判断
String
onMoving
=
request
.
getParameter
(
"onMoving"
);
String
codeStr
=
request
.
getParameter
(
"barcode"
);
Barcode
barcode
=
dataCache
.
resolveOneValideBarcode
(
codeStr
);
DataLog
task
=
taskService
.
getFinishedTask
(
barcode
.
getBarcode
());
...
...
@@ -199,9 +201,9 @@ public class QisdaDeviceController extends BaseController {
AppendInfo
appendInfo
=
task
.
getAppendInfo
();
ShelfLoc
shelfLoc
=
InquiryShelfBean
.
lockShelfLoc
(
task
,
rfid
);
if
(
shelfLoc
==
null
){
String
msg
=
"获取料架["
+
rfid
+
"]位置信息失败"
;
log
.
info
(
msg
);
return
ResultBean
.
newErrorResult
(
202
,
msg
);
String
msg
=
task
.
getBarcode
()
+
"获取料架["
+
rfid
+
"]位置信息失败"
;
//
log.info(msg);
return
ResultBean
.
newErrorResult
(
99
,
msg
);
}
String
rfidToSave
=
shelfLoc
.
getRealRfid
();
...
...
@@ -214,8 +216,10 @@ public class QisdaDeviceController extends BaseController {
appendInfo
.
setRfidLoc
(
shelfLoc
.
getLoc
());
task
.
setAppendInfo
(
appendInfo
);
if
(!
Boolean
.
valueOf
(
onMoving
)){
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
INROBOT
.
name
());
task
.
setLocInfo
(
""
);
}
task
=
dataLogDao
.
save
(
task
);
taskService
.
updateFinishedTask
(
task
);
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/StorageDataController.java
查看文件 @
88cfe62
...
...
@@ -8,6 +8,7 @@ import com.google.common.collect.Sets;
import
com.myproject.bean.CodeBean
;
import
com.myproject.bean.json.*
;
import
com.myproject.bean.qisda.ReelLockPosInfo
;
import
com.myproject.bean.qisda.ResultBean
;
import
com.myproject.bean.search.PageList
;
import
com.myproject.bean.update.*
;
import
com.myproject.bean.utils.BoxStatusBean
;
...
...
@@ -251,6 +252,10 @@ public class StorageDataController extends BaseController {
@ResponseBody
public
String
checkPos
(
HttpServletRequest
request
)
{
if
(
dataCache
.
getSettings
().
isStopOut
()){
return
"系统更新中,暂停出入库,请稍后再试"
;
}
String
cid
=
request
.
getParameter
(
"cid"
);
String
partnumber
=
request
.
getParameter
(
"pn"
);
if
(
partnumber
!=
null
){
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/TaskService.java
查看文件 @
88cfe62
...
...
@@ -843,7 +843,7 @@ public class TaskService implements ITaskService {
QisdaApi
.
VMIMateriaRecAss
(
task
,
barcode
,
latest
);
}
}
}
else
if
(
taskAppendInfo
.
isUrgentAction
()
||
taskAppendInfo
.
isReelCutAction
()){
}
else
if
(
taskAppendInfo
.
isUrgentAction
()
||
taskAppendInfo
.
isReelCutAction
()
||
taskAppendInfo
.
isPnAction
()
){
//紧急料或分盘料,增加任务完成数量
log
.
info
(
"紧急料或分盘料["
+
task
.
getBarcode
()+
"]任务已出库完成,发料任务完成数量+1"
);
outInfoCache
.
incTaskFinishNum
(
taskAppendInfo
.
gethSerial
(),
0
,
0
);
...
...
myproject/src/main/resources/mongo.xml
查看文件 @
88cfe62
...
...
@@ -22,7 +22,7 @@
socket-timeout=
"${mongo.socketTimeout}"
slave-ok=
"${mongo.slaveOk}"
write-number=
"1"
write-timeout=
"0"
write-fsync=
"true"
/>
</mongo:mongo>
<mongo:db-factory
dbname=
"
qisda
"
username=
"${mongo.username}"
<mongo:db-factory
dbname=
"
gree
"
username=
"${mongo.username}"
password=
"${mongo.password}"
mongo-ref=
"mongo"
/>
<bean
id=
"mongoTemplate"
class=
"org.springframework.data.mongodb.core.MongoTemplate"
>
<constructor-arg
name=
"mongoDbFactory"
ref=
"mongoDbFactory"
/>
...
...
myproject/src/main/webapp/WEB-INF/pages/component/storagePosFind.jsp
查看文件 @
88cfe62
...
...
@@ -223,15 +223,15 @@
<%--<display:column titleKey="barcode.expireDate" sortProperty="barcode.expireDate" sortable="true">--%>
<%--<fmt:formatDate value="${pos.barcode.expireDate}" pattern="yyyy-MM-dd"/>--%>
<%--</display:column>--%>
<
%--<security:authorize ifAnyGranted="ROLE_MANAGE_STACK_OUT, ROLE_MANAGE_FEEDER">--%
>
<
%--<display:column titleKey="checkOut.operate" media="html">--%
>
<
%--<c:if test="${!limitCheckOut}">--%
>
<%--<button class="btn yellow limit${pos.barcode.inFixture}" id="btn${pos.id}"--%>
<%--onclick="checkoutStorage('${pos.id}')">--%
>
<
%--<i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/></button>--%
>
<
%--</c:if>--%
>
<
%--</display:column>--%
>
<
%--</security:authorize>--%
>
<
security:authorize ifAnyGranted="ROLE_MANAGE_STACK_OUT, ROLE_MANAGE_FEEDER"
>
<
display:column titleKey="checkOut.operate" media="html"
>
<
c:if test="${!limitCheckOut}"
>
<button class="btn yellow limit${pos.barcode.inFixture}" id="btn${pos.id}"
onclick="checkoutStorage('${pos.id}')"
>
<
i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/></button
>
<
/c:if
>
<
/display:column
>
<
/security:authorize
>
<c:if test="${limitCheckOut}">
<c:set var="limitCodes" value="${pos.barcode.inFixture},${limitCodes}"/>
</c:if>
...
...
myproject/src/main/webapp/WEB-INF/pages/qisda/orderOut.jsp
查看文件 @
88cfe62
...
...
@@ -75,7 +75,7 @@
<h4 class="panel-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#executing" href="#priorityOrder">
<i class="icon-cursor-move"></i>
[首盘] 需求单: 808 工单: 879235
备料单: F001_879235N_1
<span class="right">建议时间: 2019-11-18 08:59</span>
[首盘] 需求单: 808 工单: 879235 <span class="right">建议时间: 2019-11-18 08:59</span>
</a>
</h4>
</div>
...
...
@@ -101,7 +101,7 @@
<h4 class="panel-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#executing" href="#priorityOrder">
<i class="icon-cursor-move"></i>
[首盘] 需求单: 808 工单: 879235
备料单: F001_879235N_1
<span class="right">建议时间: 2019-11-18 08:59</span>
[首盘] 需求单: 808 工单: 879235 <span class="right">建议时间: 2019-11-18 08:59</span>
</a>
</h4>
</div>
...
...
@@ -144,24 +144,24 @@
'<h4 class="panel-title">' +
'<a class="accordion-toggle" data-toggle="collapse" href="#'+outInfo.hSerial+'">' +
moveHandle + //outInfo.firstExecuteTime +
'需求单:'+ outInfo.hSerial+' ['+outInfo.action+'] 工单: ' + outInfo.so +'
备料单: ' + outInfo.refno + '[' + outInfo.sendStatus +'] 工单序号:' + outInfo.soseq
+
'需求单:'+ outInfo.hSerial+' ['+outInfo.action+'] 工单: ' + outInfo.so +'
线别: ' + outInfo.line + ' 绑定:' + outInfo.totalBindNum
+
'<span class="right">创建时间: '+createDate+'</span>' +
'<span class="right">建议时间: '+sdate+'</span>' +
'<span class="right">必须时间: '+mdate+'</span>' +
//
'<span class="right">必须时间: '+mdate+'</span>' +
//'<span class="right">['+outInfo.firstExecuteTime+']</span>' +
'</a></h4></div>' +
'<div id="'+outInfo.hSerial+'" class="panel-collapse collapse">' +
'<div class="panel-body bg-grey">' +
'<ul class="list-inline">' +
'<li><i class="fa fa-tasks"></i>工单: '+outInfo.so+'</li>' +
'<li><i class="fa fa-briefcase"></i>备料单: '+outInfo.refno+'</li>' +
//
'<li><i class="fa fa-briefcase"></i>备料单: '+outInfo.refno+'</li>' +
'<li><i class="fa fa-calendar"></i>建议时间:'+sdate+'</li>' +
'<li><i class="fa fa-star"></i>必须出仓日期:'+mdate+'</li>' +
'<li><i class="fa fa-star"></i>创建时间:'+createDate+'</li>' +
'</ul>' +
'<h4 class="list-inline '+bgClass+'">' +
'线体['+outInfo.line+']未解绑料架信息: '+outInfo.lineBindShelfInfo+'' +
'</h4>' +
//
'<h4 class="list-inline '+bgClass+'">' +
//
'线体['+outInfo.line+']未解绑料架信息: '+outInfo.lineBindShelfInfo+'' +
//
'</h4>' +
'</div></div></div></div>';
return infoHtml;
}
...
...
@@ -174,6 +174,9 @@
for(var i in data){
var outInfo = data[i];
if(outInfo.line == '' || outInfo.line == null){
continue;
}
var infoHtml = getOutInfoHtml(outInfo);
if(outInfo.executing || outInfo.sendLess || outInfo.firstExecuteTime > 0){
executingHtml = executingHtml + infoHtml;
...
...
myproject/src/main/webapp/WEB-INF/pages/qisda/outInfoSearch.jsp
查看文件 @
88cfe62
...
...
@@ -17,12 +17,6 @@
</style>
<c:if test="${stopOut}">
系统更新中,暂停出库,请稍后再试
</c:if>
<c:if test="${!stopOut}">
<!-- BEGIN PAGE HEADER-->
<h3 class="page-title">
<fmt:message key="需求单"/>
...
...
@@ -59,15 +53,27 @@
</div>
</div>
<label class="control-label col-md-1"><fmt:message key="ReelId"/></label>
<label class="control-label col-md-1"><fmt:message key="线别"/></label>
<div class="col-md-1">
<select class="form-control" name="line">
<option value="">所有</option>
<option value="NONE" <c:if test='${line=="NONE"}'>selected</c:if>>未定义</option>
<c:forEach begin="1" end="20" var="lineStr">
<c:set var="lineValue" value="SMT${lineStr}"/>
<option value="${lineValue}" <c:if test='${line == lineValue}'>selected</c:if>>${lineValue}</option>
</c:forEach>
</select>
</div>
<label class="control-label col-md-1"><fmt:message key="PN"/></label>
<div class="col-md-2">
<div style="text-align:left" class="input-group">
<input type="text" name="reelId" class="form-control" value="${
reelId
}"/>
<input type="text" name="reelId" class="form-control" value="${
pn
}"/>
</div>
</div>
<div class="col-md-
2
">
<div class="col-md-
1
">
<button class="btn purple" type="submit"><i class="fa fa-search"></i>
<fmt:message key="button.search"/>
</button>
...
...
@@ -83,6 +89,10 @@
<c:if test="${outInfo.endOutInfo}">
<c:set var="endOutInfoClass" value="bg-yellow"/>
</c:if>
<c:set var="closedClass" value=""/>
<c:if test="${outInfo.closed}">
<c:set var="closedClass" value="closed"/>
</c:if>
<display:column titleKey="需求单号" sortable="true" sortProperty="hSerial" media="html">
<a href="#" onclick="showDetail('${outInfo.hSerial}')">${outInfo.hSerial}</a>
</display:column>
...
...
@@ -91,8 +101,14 @@
<display:column titleKey="工单" sortable="true" sortProperty="so">
${outInfo.so}<c:if test="${outInfo.soseq != null}">(${outInfo.soseq})</c:if>
</display:column>
<display:column titleKey="线别" property="line" sortable="true" sortProperty="line"/>
<display:column titleKey="备料单号" property="refno" sortable="true" sortProperty="refno"/>
<display:column titleKey="线别" sortable="true" sortProperty="line" media="html">
<span id="${outInfo.hSerial}Line">${outInfo.line}</span>
<c:if test="${outInfo.firstExecuteTime <=0}">
<a href="#" onclick="changeLine('${outInfo.hSerial}')">[编辑]</a>
</c:if>
</display:column>
<%--<display:column titleKey="备料单号" property="refno" sortable="true" sortProperty="refno"/>--%>
<display:column titleKey="建议出仓时间" sortable="true" sortProperty="sdate">
<fmt:formatDate value="${outInfo.sdate}" pattern="yyyy-MM-dd HH:mm"/>
</display:column>
...
...
@@ -100,27 +116,32 @@
<fmt:formatDate value="${outInfo.mdate}" pattern="yyyy-MM-dd HH:mm"/>
</display:column>
<display:column titleKey="任务" sortable="true" sortProperty="
mdate
">
<display:column titleKey="任务" sortable="true" sortProperty="
taskNum
">
${outInfo.taskFinishNum}/${outInfo.taskNum}
</display:column>
<display:column titleKey="累计任务" sortable="true" sortProperty="totalTaskNum">
${outInfo.totalTaskNum}/${outInfo.totalBindNum}
<display:column titleKey="绑定数量" sortable="true" sortProperty="totalBindNum" class="${closedClass}">
${outInfo.totalBindNum}
<%--<c:if test="${!outInfo.closed}">--%>
<%--<a href="#" class="right" onclick="closeOut('${outInfo.hSerial}')" id="${outInfo.hSerial}Btn">--%>
<%--[<fmt:message key="关闭"/>]--%>
<%--</a>--%>
<%--</c:if>--%>
</display:column>
<display:column titleKey="创建时间" sortable="true" sortProperty="createDate">
<display:column titleKey="创建时间" sortable="true" sortProperty="createDate"
>
<fmt:formatDate value="${outInfo.createDate}" pattern="yyyy-MM-dd HH:mm"/>
</display:column>
<
display:column titleKey="更新时间" sortable="true" sortProperty="updateDate"
>
<
fmt:formatDate value="${outInfo.updateDate}" pattern="yyyy-MM-dd HH:mm"/
>
<
/display:column
>
<
%--<display:column titleKey="更新时间" sortable="true" sortProperty="updateDate">--%
>
<
%--<fmt:formatDate value="${outInfo.updateDate}" pattern="yyyy-MM-dd HH:mm"/>--%
>
<
%--</display:column>--%
>
<display:column titleKey="需求时间" sortable="true" sortProperty="taskNeedOutDate">
<fmt:formatDate value="${outInfo.taskNeedOutDate}" pattern="yyyy-MM-dd HH:mm"/>
</display:column>
<display:column titleKey="checkOut.operate" media="html" sortProperty="sendStatus" sortable="true">
<c:if test="${!outInfo.executing}">
<c:if test="${!outInfo.executing
&& stopJob
}">
<c:if test="${(outInfo.urgentAction && outInfo.taskFinishNum != outInfo.taskNum) || (!outInfo.sendEnd && !outInfo.closed)}">
<button class="btn yellow" id="btn${outInfo.hSerial}" onclick="executeOut('${outInfo.hSerial}')">
<i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/>
...
...
@@ -141,7 +162,6 @@
<!-- END EXAMPLE TABLE PORTLET-->
</div>
</div>
</c:if>
<div id="detail" class="modal fade" tabindex="-1" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="margin-top: 10%;width:80%;margin-left:10%;">
...
...
@@ -202,6 +222,45 @@
</div>
</div>
<div id="lineModifyWindow" class="modal fade" tabindex="-1" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="margin-top: 10%;width:50%;margin-left:25%;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" style="font-weight: 500;">线别修改</h4>
</div>
<div class="modal-body" style="height:80px;overflow-y:hidden;">
<div class="row">
<label class="control-label col-md-2"><fmt:message key="线别:"/></label>
<div class="input-group">
<input type="hidden" id="hSerialToModify" value=""/>
<select class="form-control" id="lineToModify">
<option value="">--</option>
<c:forEach begin="1" end="20" var="line">
<option value="SMT${line}">SMT${line}</option>
</c:forEach>
</select>
</div>
<h4>
<span id="lineErrorMsg" style="font-weight: 500;color:red;"></span>
</h4>
</div>
</div>
<div class="modal-footer">
<div>
<%--<a href="" class="btn yellow left" id="findAndOut"><i class="fa fa-sign-out"></i><fmt:message key="allBoxView.findAndOut"/></a>--%>
<button type="button" class="btn green" onclick="lineModifyOkClick();" >
<fmt:message key="button.save"/></button>
<button type="button" data-dismiss="modal" class="btn default" id="cancelAuthBtn"><fmt:message key="button.cancel"/></button>
</div>
</div>
</div>
</div>
</div>
<c:set var="scripts" scope="request">
<script type="text/javascript">
$(document).ready(function(){
...
...
@@ -265,6 +324,44 @@
});
}
closeOut = function(hSerial){
Lobibox.confirm({
title: "确认",
msg: "确定要关闭并解绑需求单["+hSerial+"]吗?",
callback: function ($this, type, ev) {
if(type == 'yes'){
$.post("${ctx}/service/store/qisda/closeHSerial", {hSerial: hSerial}, function (data) {
if(data){
Lobibox.alert("success",
{
msg: data
});
var btnId = "#" +hSerial + "Btn";
$(btnId).hide();
}
});
}
}
});
}
changeLine = function (hSerial){
$("#hSerialToModify").val(hSerial);
var oldLine = $("#lineToModify").text();
$("#lineToModify").val(oldLine);
$("#lineModifyWindow").modal("show");
}
lineModifyOkClick = function(){
var line = $("#lineToModify").val();
var hSerial = $("#hSerialToModify").val();
$.post("${ctx}/rest/api/dcs/updateLine", {hSerial: hSerial, line: line}, function (data) {
$("#"+hSerial+"Line").html(line);
$("#lineModifyWindow").modal("hide");
});
}
$(".filterInput").on('input propertychange',function(){
var searchStr = $(this).val();
$(".theItems").children().each(function(){
...
...
@@ -276,6 +373,11 @@
});
});
$(".closed").each(function(){
var oldClass = $(this).parent().attr("class");
$(this).parents("tr").attr("class",oldClass + " font-grey");
});
});
</script>
</c:set>
\ No newline at end of file
myproject/src/main/webapp/common/metroTopMenu.jsp
查看文件 @
88cfe62
...
...
@@ -85,11 +85,11 @@
</a>
</li>
<
%--<li class="classic-menu-dropdown">--%
>
<
%--<a href="${ctx}/workOrder/checkOutSettings.html" name="workOrder">--%
>
<
%--<fmt:message key="menu.outRule"/><span class="selected"></span>--%
>
<
%--</a>--%
>
<
%--</li>--%
>
<
li class="classic-menu-dropdown"
>
<
a href="${ctx}/workOrder/checkOutSettings.html" name="workOrder"
>
<
fmt:message key="menu.outRule"/><span class="selected"></span
>
<
/a
>
<
/li
>
</security:authorize>
</ul>
</security:authorize>
...
...
myproject/src/main/webapp/decorators/metro.jsp
查看文件 @
88cfe62
...
...
@@ -237,9 +237,9 @@
<!-- BEGIN FOOTER -->
<div
class=
"page-footer"
>
<div
class=
"page-footer-inner"
>
2016
©
<a
href=
"
${ctx}/updateHistory.html
"
>
SMD BOX
</a>
2016
©
<a
href=
""
>
SMD BOX
</a>
</div>
<span
class=
"right"
style=
"color: #a3a3a3;"
>
Version:
2021.03.25
</span>
<span
class=
"right"
style=
"color: #a3a3a3;"
>
Version:
1.6.2910
</span>
<div
class=
"scroll-to-top"
>
<i
class=
"icon-arrow-up"
></i>
</div>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论