Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 981e0e18
由
几米阳光
编写于
2019-04-10 17:27:41 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
出入库处理修改
1 个父辈
50efea0e
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
46 行增加
和
17 行删除
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
981e0e1
...
@@ -1411,6 +1411,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1411,6 +1411,19 @@ namespace OnlineStore.DeviceLibrary
return
;
return
;
}
}
IsScanCode
=
false
;
IsScanCode
=
false
;
ReviceInStoreProcess
(
message
,
resultOperation
);
}
catch
(
Exception
ex
)
{
IsScanCode
=
false
;
LOGGER
.
Error
(
StoreName
+
ex
.
StackTrace
);
}
}
private
void
ReviceInStoreProcess
(
string
message
,
Operation
resultOperation
)
{
try
{
Dictionary
<
string
,
string
>
data
=
resultOperation
.
data
;
Dictionary
<
string
,
string
>
data
=
resultOperation
.
data
;
if
(
data
!=
null
&&
data
.
ContainsKey
(
ParamDefine
.
posId
)
&&
data
.
ContainsKey
(
ParamDefine
.
plateH
)
&&
data
.
ContainsKey
(
ParamDefine
.
plateW
))
if
(
data
!=
null
&&
data
.
ContainsKey
(
ParamDefine
.
posId
)
&&
data
.
ContainsKey
(
ParamDefine
.
plateH
)
&&
data
.
ContainsKey
(
ParamDefine
.
plateW
))
{
{
...
@@ -1441,9 +1454,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1441,9 +1454,7 @@ namespace OnlineStore.DeviceLibrary
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
if
(
CanStarInOut
())
if
(
CanStarInOut
())
{
{
IsScanCode
=
false
;
InOutStoreParam
param
=
new
InOutStoreParam
(
message
,
posId
,
plateH
,
plateW
,
0
);
InOutStoreParam
param
=
new
InOutStoreParam
(
message
,
posId
,
plateH
,
plateW
,
0
);
StartInStoreMove
(
param
);
StartInStoreMove
(
param
);
//如果当前正在出入库中,需要记录下来,等待空闲时执行
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 收到服务器入库命令:库位号【"
+
posId
+
"】二维码【"
+
message
+
"】 开始入库!"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 收到服务器入库命令:库位号【"
+
posId
+
"】二维码【"
+
message
+
"】 开始入库!"
);
...
@@ -1451,14 +1462,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1451,14 +1462,11 @@ namespace OnlineStore.DeviceLibrary
else
else
{
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 收到服务器入库命令:库位号【"
+
posId
+
"】二维码【"
+
message
+
"】 正在忙碌中,无法入库!"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 收到服务器入库命令:库位号【"
+
posId
+
"】二维码【"
+
message
+
"】 正在忙碌中,无法入库!"
);
IsScanCode
=
false
;
}
}
}
}
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
{
{
IsScanCode
=
false
;
LogUtil
.
error
(
"处理入库命令出错:"
+
ex
.
ToString
());
LOGGER
.
Error
(
StoreName
+
ex
.
StackTrace
);
}
}
}
}
...
@@ -1918,10 +1926,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1918,10 +1926,10 @@ namespace OnlineStore.DeviceLibrary
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
lineOperation
,
false
);
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
lineOperation
,
false
);
//增加报警处理
//增加报警处理
if
(
resultOperation
.
data
!=
null
&&
resultOperation
.
data
.
ContainsKey
(
ParamDefine
.
inTimeout
)
&&
resultOperation
.
data
[
ParamDefine
.
inTimeout
].
ToLower
().
Equals
(
"alarm"
))
if
(
resultOperation
.
data
!=
null
&&
resultOperation
.
data
.
ContainsKey
(
ParamDefine
.
inTimeout
)
&&
resultOperation
.
data
[
ParamDefine
.
inTimeout
].
ToLower
().
Equals
(
"alarm"
))
{
{
WarnMsg
=
"盘点入库超时报警"
;
WarnMsg
=
"盘点入库超时报警"
;
LogUtil
.
error
(
LOGGER
,
"收到服务器端报警:盘点入库超时报警"
,
1000
);
LogUtil
.
error
(
LOGGER
,
"收到服务器端报警:盘点入库超时报警"
,
1000
);
Alarm
(
StoreAlarmType
.
CheckInStoreTimeOut
,
StoreAlarmType
.
CheckInStoreTimeOut
.
ToString
(),
WarnMsg
,
StoreMoveType
.
None
);
Alarm
(
StoreAlarmType
.
CheckInStoreTimeOut
,
StoreAlarmType
.
CheckInStoreTimeOut
.
ToString
(),
WarnMsg
,
StoreMoveType
.
None
);
}
}
else
else
...
@@ -1934,12 +1942,33 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1934,12 +1942,33 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
//发送状态信息到服务器
//发送状态信息到服务器
if
(
resultOperation
==
null
||
(
resultOperation
.
op
!=
2
))
if
(
resultOperation
==
null
||
(
resultOperation
.
op
<=
0
))
{
{
//判断服务端是否返回出库操作
//判断服务端是否返回出库操作
return
;
return
;
}
}
if
(
resultOperation
.
op
.
Equals
(
2
))
{
ReviceOutStoreProcess
(
resultOperation
);
}
else
if
(
resultOperation
.
op
.
Equals
(
1
))
{
ReviceInStoreProcess
(
""
,
resultOperation
);
}
else
{
LogUtil
.
error
(
"收到服务器命令:op="
+
resultOperation
.
op
+
",未找到对应处理"
);
}
TimeSpan
span
=
DateTime
.
Now
-
time
;
if
(
span
.
TotalMilliseconds
>
10
)
{
LogUtil
.
info
(
StoreName
+
"执行TimerProcess 共处理了【"
+
span
.
TotalMilliseconds
+
"】毫秒"
);
}
}
private
void
ReviceOutStoreProcess
(
Operation
resultOperation
)
{
try
{
Dictionary
<
string
,
string
>
data
=
resultOperation
.
data
;
Dictionary
<
string
,
string
>
data
=
resultOperation
.
data
;
if
(
data
!=
null
&&
data
.
ContainsKey
(
ParamDefine
.
posId
)
if
(
data
!=
null
&&
data
.
ContainsKey
(
ParamDefine
.
posId
)
&&
data
.
ContainsKey
(
ParamDefine
.
plateH
)
&&
data
.
ContainsKey
(
ParamDefine
.
plateW
))
&&
data
.
ContainsKey
(
ParamDefine
.
plateH
)
&&
data
.
ContainsKey
(
ParamDefine
.
plateW
))
...
@@ -1952,7 +1981,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1952,7 +1981,7 @@ namespace OnlineStore.DeviceLibrary
{
{
needInAfterOut
=
data
[
ParamDefine
.
needInAfterOut
].
ToLower
().
Equals
(
"true"
);
needInAfterOut
=
data
[
ParamDefine
.
needInAfterOut
].
ToLower
().
Equals
(
"true"
);
}
}
LogUtil
.
info
(
LOGGER
,
"收到服务器出库消息:poaIs="
+
posIdStr
+
",platew="
+
plateWStr
+
",plateh="
+
plateHStr
+
",needInAfterOut="
+
needInAfterOut
);
LogUtil
.
info
(
LOGGER
,
"收到服务器出库消息:poaIs="
+
posIdStr
+
",platew="
+
plateWStr
+
",plateh="
+
plateHStr
+
",needInAfterOut="
+
needInAfterOut
);
char
splitChar
=
'|'
;
char
splitChar
=
'|'
;
string
[]
posIdArray
=
posIdStr
.
Split
(
splitChar
);
string
[]
posIdArray
=
posIdStr
.
Split
(
splitChar
);
string
[]
plateWArray
=
plateWStr
.
Split
(
splitChar
);
string
[]
plateWArray
=
plateWStr
.
Split
(
splitChar
);
...
@@ -1983,10 +2012,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1983,10 +2012,10 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
FixtureCodeInfo
currInOutFixture
=
new
FixtureCodeInfo
(
0
,
""
,
posId
,
plateW
,
plateH
,
needInAfterOut
);
FixtureCodeInfo
currInOutFixture
=
new
FixtureCodeInfo
(
0
,
""
,
posId
,
plateW
,
plateH
,
needInAfterOut
);
if
(
CanStarInOut
())
if
(
CanStarInOut
())
{
{
bool
result
=
StartOutStoreMove
(
new
InOutStoreParam
(
""
,
posId
,
position
,
needInAfterOut
));
bool
result
=
StartOutStoreMove
(
new
InOutStoreParam
(
""
,
posId
,
position
,
needInAfterOut
));
if
(!
result
)
if
(!
result
)
{
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 执行出库【"
+
currInOutFixture
.
ToStr
()
+
"】失败,加入等待队列"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 执行出库【"
+
currInOutFixture
.
ToStr
()
+
"】失败,加入等待队列"
);
...
@@ -2001,11 +2030,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -2001,11 +2030,11 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
TimeSpan
span
=
DateTime
.
Now
-
time
;
if
(
span
.
TotalMilliseconds
>
10
)
{
LogUtil
.
info
(
StoreName
+
"执行TimerProcess 共处理了【"
+
span
.
TotalMilliseconds
+
"】毫秒"
);
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"处理服务器出库命令出错:"
+
ex
.
ToString
());
}
}
}
}
#
endregion
#
endregion
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论