Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
Gree
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit da869e65
由
sunke
编写于
2020-07-15 14:11:57 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
尺寸不一致,使用佳世达维护的尺寸
需求单手动操作时,重复执行问题 访问Qisda接口时,返回内部异常,进行重发
1 个父辈
796407e1
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
122 行增加
和
20 行删除
myproject/src/main/java/com/myproject/bean/qisda/InquiryShelfBean.java
myproject/src/main/java/com/myproject/bean/update/DataLog.java
myproject/src/main/java/com/myproject/util/QisdaApi.java
myproject/src/main/java/com/myproject/webapp/controller/qisda/util/OutInfoCache.java
myproject/src/main/java/com/myproject/webapp/controller/webService/DataCache.java
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaApiController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaCache.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/updateHistory.jsp
myproject/src/main/java/com/myproject/bean/qisda/InquiryShelfBean.java
查看文件 @
da869e6
...
...
@@ -383,7 +383,7 @@ public class InquiryShelfBean {
if
(
Strings
.
isEmpty
(
rfid
)){
return
null
;
}
ShelfInfo
minIndexShelf
=
null
;
//
ShelfInfo minIndexShelf = null;
for
(
Map
<
String
,
ShelfInfo
>
shelfInfoMap
:
hSerialShelfMap
.
values
())
{
for
(
ShelfInfo
shelf
:
shelfInfoMap
.
values
())
{
String
shelfRFID
=
shelf
.
getRealRfid
();
...
...
myproject/src/main/java/com/myproject/bean/update/DataLog.java
查看文件 @
da869e6
...
...
@@ -633,7 +633,7 @@ public class DataLog extends BaseMongoBean /*implements Comparable<DataLog>*/ {
long
now
=
System
.
currentTimeMillis
();
long
timeoutTime
=
20
*
60
*
1000
;
if
(!
isWait
()){
timeoutTime
=
10
*
60
*
1000
;
timeoutTime
=
8
*
60
*
1000
;
}
return
now
-
getUpdateDate
().
getTime
()
>
timeoutTime
;
}
...
...
myproject/src/main/java/com/myproject/util/QisdaApi.java
查看文件 @
da869e6
...
...
@@ -418,8 +418,13 @@ public class QisdaApi {
try
{
String
result
=
HttpHelper
.
postParam
(
url
,
paramMap
);
log
.
info
(
reelID
+
"纯入库操作完成时通知Qisda接口(VMILocationIn)返回:"
+
result
);
String
resultStr
=
XmlUtil
.
getNodeBody
(
"string"
,
result
);
if
(
resultStr
.
startsWith
(
"-1"
)){
log
.
info
(
"Qisda接口内部异常,需要进行重发"
);
}
else
{
QisdaCache
.
removeFailedRequest
(
apiRequest
);
return
;
}
}
catch
(
Exception
e
)
{
log
.
error
(
reelID
+
"纯入库操作完成时通知Qisda接口(VMILocationIn)出错"
,
e
);
}
...
...
@@ -459,8 +464,14 @@ public class QisdaApi {
try
{
String
result
=
HttpHelper
.
postParam
(
url
,
paramMap
);
log
.
info
(
"DN单收料或Facility收料["
+
barcode
.
getBarcode
()+
"]接口返回:"
+
result
);
String
resultStr
=
XmlUtil
.
getNodeBody
(
"string"
,
result
);
if
(
resultStr
.
startsWith
(
"-1"
)){
log
.
info
(
"Qisda接口内部异常,需要进行重发"
);
}
else
{
QisdaCache
.
removeFailedRequest
(
apiRequest
);
return
;
}
}
catch
(
Exception
e
)
{
log
.
error
(
"DN单收料或Facility收料接口出错"
,
e
);
}
...
...
@@ -485,9 +496,14 @@ public class QisdaApi {
QisdaApiRequest
apiRequest
=
new
QisdaApiRequest
(
"出仓"
,
paramMap
,
reelId
,
url
);
try
{
String
result
=
HttpHelper
.
postParam
(
url
,
paramMap
);
log
.
info
(
"出仓完成时通知Qisda(VMILocationOut)返回:"
+
result
);
log
.
info
(
reelId
+
"出仓完成时通知Qisda(VMILocationOut)返回:"
+
result
);
String
resultStr
=
XmlUtil
.
getNodeBody
(
"string"
,
result
);
if
(
resultStr
.
startsWith
(
"-1"
)){
log
.
info
(
"Qisda接口内部异常,需要进行重发"
);
}
else
{
QisdaCache
.
removeFailedRequest
(
apiRequest
);
return
;
}
}
catch
(
Exception
e
)
{
log
.
error
(
"出仓完成时通知Qisda(VMILocationOut)接口出错"
,
e
);
}
...
...
@@ -552,8 +568,13 @@ public class QisdaApi {
try
{
String
result
=
HttpHelper
.
postParam
(
url
,
paramMap
);
log
.
info
(
task
.
getBarcode
()
+
"物料放上小车时通知Qisda(VMIMateriaRecAss)返回:"
+
result
);
String
resultStr
=
XmlUtil
.
getNodeBody
(
"string"
,
result
);
if
(
resultStr
.
startsWith
(
"-1"
)){
log
.
info
(
"Qisda接口内部异常,需要进行重发"
);
}
else
{
QisdaCache
.
removeFailedRequest
(
apiRequest
);
return
;
}
}
catch
(
Exception
e
)
{
log
.
error
(
task
.
getBarcode
()
+
"物料放上小车时通知Qisda(VMIMateriaRecAss)接口出错"
,
e
);
}
...
...
myproject/src/main/java/com/myproject/webapp/controller/qisda/util/OutInfoCache.java
查看文件 @
da869e6
...
...
@@ -30,6 +30,7 @@ import org.springframework.stereotype.Service;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.atomic.AtomicBoolean
;
/**
* Created by sunke on 2020/3/5.
...
...
@@ -631,7 +632,25 @@ public class OutInfoCache {
return
null
;
}
private
static
AtomicBoolean
outProcessing
=
new
AtomicBoolean
(
false
);
public
synchronized
ResultBean
checkOutOutItems
(
String
hSerial
){
boolean
canProcess
=
outProcessing
.
compareAndSet
(
false
,
true
);
try
{
if
(
canProcess
){
ResultBean
resultBean
=
executeOutItems
(
hSerial
);
return
resultBean
;
}
else
{
return
ResultBean
.
newErrorResult
(
1007
,
"有需求单执行任务未完成,请稍后再试"
);
}
}
catch
(
Exception
e
){
return
ResultBean
.
newErrorResult
(
1008
,
"需求单执行出错:"
+
e
.
getMessage
());
}
finally
{
outProcessing
.
set
(
false
);
}
}
public
synchronized
ResultBean
executeOutItems
(
String
hSerial
){
//OutInfo outInfo = outInfoDao.findByHSerial(hSerial);
OutInfo
outInfo
=
getOutInfoFromCache
(
hSerial
);
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/DataCache.java
查看文件 @
da869e6
...
...
@@ -374,22 +374,26 @@ public class DataCache{
Component
component
=
getComponent
(
barcodeFromRule
);
if
(
component
.
isSizeConfirmed
()){
//尺寸已经确认的,判断尺寸,如果大小不符合,直接NG,如果大小符合,尺寸差别在4mm内的修改尺寸
if
(
barcodeFromRule
.
getPlateSize
()
!=
component
.
getPlateSize
()){
String
msg
=
barcodeFromRule
.
getBarcode
()
+
"测量尺寸["
+
barcodeFromRule
.
getSizeStr
()+
"]与给定尺寸["
+
component
.
getSizeStr
()+
"]不符"
;
throw
new
ValidateException
(
msg
);
}
else
{
//如果厚度小于4mm,使用确认的尺寸入库
int
diffHeight
=
barcodeFromRule
.
getHeight
()
-
component
.
getHeight
();
if
(
Math
.
abs
(
diffHeight
)
>
4
){
String
msg
=
barcodeFromRule
.
getBarcode
()
+
"测量厚度["
+
barcodeFromRule
.
getSizeStr
()+
"]与给定厚度["
+
component
.
getSizeStr
()+
"]误差过大"
;
throw
new
ValidateException
(
msg
);
}
else
if
(
diffHeight
!=
0
&&
Math
.
abs
(
diffHeight
)
<=
4
){
log
.
info
(
barcodeFromRule
.
getBarcode
()
+
"测量尺寸["
+
barcodeFromRule
.
getSizeStr
()+
"]与给定寸["
+
component
.
getSizeStr
()+
"]厚度误差在4mm以内,使用给定尺寸进行入库"
);
// if(barcodeFromRule.getPlateSize() != component.getPlateSize()){
// String msg = barcodeFromRule.getBarcode() + "测量尺寸["+barcodeFromRule.getSizeStr()+"]与给定尺寸["+component.getSizeStr()+"]不符";
// throw new ValidateException(msg);
// }else{
// //如果厚度小于4mm,使用确认的尺寸入库
// int diffHeight = barcodeFromRule.getHeight() - component.getHeight();
// if(Math.abs(diffHeight) > 4){
// String msg = barcodeFromRule.getBarcode() + "测量厚度["+barcodeFromRule.getSizeStr()+"]与给定厚度["+component.getSizeStr()+"]误差过大";
// throw new ValidateException(msg);
// }else if(diffHeight !=0 && Math.abs(diffHeight) <= 4){
// log.info(barcodeFromRule.getBarcode() + "测量尺寸["+barcodeFromRule.getSizeStr()+"]与给定寸["+component.getSizeStr()+"]厚度误差在4mm以内,使用给定尺寸进行入库");
// barcodeFromRule.setHeight(component.getHeight());
// barcodeFromRule = barcodeManager.save(barcodeFromRule);
// }
// }
barcodeFromRule
.
setPlateSize
(
component
.
getPlateSize
());
barcodeFromRule
.
setHeight
(
component
.
getHeight
());
barcodeFromRule
=
barcodeManager
.
save
(
barcodeFromRule
);
}
}
}
if
(
barcode
==
null
){
barcode
=
barcodeFromRule
;
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaApiController.java
查看文件 @
da869e6
...
...
@@ -117,6 +117,7 @@ public class QisdaApiController extends BaseController {
String
hSerial
=
request
.
getParameter
(
"hSerial"
);
//OutInfo outInfo = outInfoCache.getOutInfoFromCache(hSerial);
//qisdaBindService.realBindOutInfo(outInfo);
log
.
info
(
"手动执行需求单["
+
hSerial
+
"]出库"
);
ResultBean
resultBean
=
outInfoCache
.
checkOutOutItems
(
hSerial
);
return
resultBean
.
getMsg
();
}
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaCache.java
查看文件 @
da869e6
...
...
@@ -11,6 +11,7 @@ import com.myproject.dao.mongo.qisda.ICacheInfoDao;
import
com.myproject.dao.mongo.qisda.IDNItemDao
;
import
com.myproject.exception.ApiException
;
import
com.myproject.util.HttpHelper
;
import
com.myproject.util.XmlUtil
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.util.Strings
;
...
...
@@ -315,6 +316,15 @@ public class QisdaCache {
}
public
static
void
updateUsedRfid
(
List
<
String
>
usedRfidList
){
String
oldUsedRfid
=
""
;
if
(
lastHSerialUsedRfidList
!=
null
){
oldUsedRfid
=
String
.
join
(
","
,
lastHSerialUsedRfidList
);
}
String
newUsedRfid
=
""
;
if
(
usedRfidList
!=
null
){
newUsedRfid
=
String
.
join
(
","
,
usedRfidList
);
}
log
.
info
(
"已使用过的料架信息更新:["
+
oldUsedRfid
+
"]=>["
+
newUsedRfid
+
"]"
);
lastHSerialUsedRfidList
=
usedRfidList
;
}
...
...
@@ -390,9 +400,15 @@ public class QisdaCache {
log
.
info
(
"重发通知指令["
+
apiRequest
.
getMapKey
()
+
"]到Qisda"
);
String
result
=
HttpHelper
.
postParam
(
apiRequest
.
getUrl
(),
apiRequest
.
getParamMap
());
log
.
info
(
"重发通知指令["
+
apiRequest
.
getMapKey
()
+
"]到Qisda返回:"
+
result
);
String
resultStr
=
XmlUtil
.
getNodeBody
(
"string"
,
result
);
if
(
resultStr
.
startsWith
(
"-1"
)){
log
.
info
(
"Qisda接口内部异常,需要进行重发"
);
return
;
}
else
{
QisdaCache
.
removeFailedRequest
(
apiRequest
);
}
}
}
private
synchronized
static
void
saveRfidDnMap
(){
cacheInfoDao
.
updateCacheItem
(
RFID_DN_MAP_KEY
,
rfidDnMap
);
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaDeviceController.java
查看文件 @
da869e6
...
...
@@ -996,6 +996,7 @@ public class QisdaDeviceController extends BaseController {
//料架上一个工单使用过,直接放行,其他情况继续使用
boolean
lastHSerialUsed
=
QisdaCache
.
isLastHSerialUsedRfid
(
rfid
);
if
(!
lastHSerialUsed
){
//没有使用过
smallEmpty
=
100
;
bigEmpty
=
100
;
packageEmpty
=
100
;
...
...
@@ -1004,8 +1005,10 @@ public class QisdaDeviceController extends BaseController {
if
(!
usedRfidList
.
isEmpty
()){
log
.
info
(
"料架["
+
rfid
+
"]上一个需求单已使用,当前需求单["
+
hSerial
+
"]物料已放上料架,清理上一个需求单使用过的料架"
);
QisdaCache
.
updateUsedRfid
(
null
);
smallEmpty
=
100
;
bigEmpty
=
100
;
packageEmpty
=
100
;
}
}
}
...
...
@@ -1111,6 +1114,7 @@ public class QisdaDeviceController extends BaseController {
String
rfid
=
request
.
getParameter
(
"rfid"
);
ShelfInfo
shelfInfo
=
InquiryShelfBean
.
findShelf
(
rfid
);
int
taskCount
=
0
;
String
msg
=
"ok"
;
if
(
shelfInfo
!=
null
){
Map
<
Integer
,
ShelfLoc
>
locMap
=
shelfInfo
.
getLocMap
();
for
(
ShelfLoc
shelfLoc
:
locMap
.
values
())
{
...
...
@@ -1118,11 +1122,13 @@ public class QisdaDeviceController extends BaseController {
taskCount
=
taskCount
+
1
;
}
}
}
else
{
msg
=
"未找到包装料架"
+
rfid
;
}
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"taskCount"
,
taskCount
);
resultMap
.
put
(
"rfid"
,
rfid
);
return
ResultBean
.
newOkResult
(
resultMap
);
return
ResultBean
.
newOkResult
(
msg
,
resultMap
);
}
/**
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/TaskService.java
查看文件 @
da869e6
...
...
@@ -1097,7 +1097,7 @@ public class TaskService implements ITaskService {
}
for
(
DataLog
dataLog
:
finishedTaskMap
.
values
())
{
if
(!
dataLog
.
isPackageReel
()){
if
(!
dataLog
.
isSmallReel
()
&&
!
dataLog
.
isFinished
()){
if
(!
dataLog
.
isSmallReel
()
&&
!
dataLog
.
isFinished
()
&&
!
dataLog
.
isLessSendReel
()
){
//非包装料大料任务还未完成(未放入料架),暂时不出大料
unFinishedBigTaskCount
=
unFinishedBigTaskCount
+
1
;
}
...
...
myproject/src/main/webapp/WEB-INF/pages/updateHistory.jsp
查看文件 @
da869e6
...
...
@@ -12,7 +12,42 @@
<div class="row">
<div class="col-md-12">
<ul class="timeline">
<li class="timeline-yellow">
<div class="timeline-time">
<span class="date">2020 </span>
<span class="time">07-15 </span>
</div>
<div class="timeline-icon">
<i class="fa fa-clock-o"></i>
</div>
<div class="timeline-body">
<h2>版本: V2020071511</h2>
<div class="timeline-content">
<ul>
<li>调用Qisda接口返回内部异常时进行重发</li>
</ul>
</div>
</div>
</li>
<li class="timeline-grey">
<div class="timeline-time">
<span class="date">2020 </span>
<span class="time">07-08 </span>
</div>
<div class="timeline-icon">
<i class="fa fa-clock-o"></i>
</div>
<div class="timeline-body">
<h2>版本: V2020070811</h2>
<div class="timeline-content">
<ul>
<li>上一个需求单使用过的料架重用</li>
<li>解决缺料重发影响大料出库的问题</li>
<li>手动点击出库导致同一盘料两个任务的问题</li>
</ul>
</div>
</div>
</li>
<li class="timeline-purple">
<div class="timeline-time">
<span class="date">2020 </span>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论