Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO908-XLRStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 7390aa08
由
张东亮
编写于
2022-12-20 12:57:13 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
入料机构放完料上报
1 个父辈
2b367d0c
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
55 行增加
和
60 行删除
source/DeviceLibrary/manager/SServerManager.cs
source/DeviceLibrary/manager/SServerManager.cs
查看文件 @
7390aa0
...
...
@@ -735,74 +735,69 @@ namespace OnlineStore.DeviceLibrary
}
return
msg
;
}
static
string
Addr_UploadLocInfo
=
"/service/store/updateLocInfo"
;
/// <summary>
/// A 出库更新任务状态 -OK
/// </summary>
/// <param name="barcode">料盘条码</param>
/// <param name="status"></param>
/// <returns></returns>
public
static
bool
UpdateLocInfo
(
string
barcode
,
string
status
,
string
loc
=
""
)
{
try
{
string
msg
=
""
;
Dictionary
<
string
,
string
>
map
=
new
Dictionary
<
string
,
string
>();
map
.
Add
(
"cid"
,
StoreManager
.
XLRStore
.
Config
.
CID
);
map
.
Add
(
"barcode"
,
barcode
);
map
.
Add
(
"status"
,
status
);
map
.
Add
(
"loc"
,
loc
);
string
server
=
GetAddr
(
Addr_UploadLocInfo
,
map
);
DateTime
startTime
=
DateTime
.
Now
;
string
resultStr
=
HttpHelper
.
Get
(
server
);
ServerData1
serverResult
=
JsonHelper
.
DeserializeJsonToObject
<
ServerData1
>(
resultStr
);
if
(
serverResult
==
null
)
{
msg
=
$
"UpdateLocInfo【{barcode}】【{status}】"
+
"没有收到服务器反馈"
;
}
else
if
(
serverResult
.
code
.
Equals
(
0
).
Equals
(
false
))
{
// code: 0为正常,其他为异常, msg: 消息, data: 为空
msg
=
$
"UpdateLocInfo 【{barcode}】【{status}】【{JsonHelper.SerializeObject(serverResult)}】"
;
LogUtil
.
error
(
msg
);
return
false
;
}
else
{
msg
=
$
"UpdateLocInfo 【{barcode}】【{status}】【{JsonHelper.SerializeObject(serverResult)}】"
;
LogUtil
.
info
(
msg
);
return
true
;
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"UpdateLocInfo"
,
ex
);
}
return
false
;
}
private
static
string
Addr_ShelfFinish
=
"/rest/api/qisda/device/putShelfFinished"
;
public
static
ShelfTaskInfo
ShelfFinish
(
string
rfid
,
string
barcode
=
""
,
string
rfidLoc
=
"0"
,
string
robotIndex
=
"1"
)
{
UpdateLocInfo
(
barcode
,
"END"
,
rfid
);
LogUtil
.
info
(
$
"ShelfFinish rifd【{rfid}】barcode【{barcode}】rfidLoc【{rfidLoc}】robotIndex【{robotIndex}】"
);
ShelfTaskInfo
task
=
new
ShelfTaskInfo
();
task
.
rfid
=
rfid
;
return
task
;
// DateTime startTime = DateTime.Now;
// try
// {
// string api = Addr_ShelfFinish;
// Dictionary<string, string> paramMap = new Dictionary<string, string>();
// paramMap.Add("barcode", barcode);
// paramMap.Add("rfid", rfid);
// paramMap.Add("rfidLoc", rfidLoc);
// paramMap.Add("robotIndex", robotIndex);
// //string url = httpAddr + api + "?barcode=" + barcode + "&rfid=" + rfid + "&rfidLoc=" + rfidLoc + "&robotIndex=" + robotIndex;
// string url = GetAddr(api, paramMap);
// LogUtil.debug("http :URL:" + url);
// string json = HttpHelper.Post(url, "", 10000);
// if (barcode != "")
// {
// LogUtil.info("http :URL:" + url + " :Response:" + json + " 耗时[" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "]");
// }
// else
// {
// LogUtil.debug("http :URL:" + url + " :Response:" + json);
// }
// if (string.IsNullOrWhiteSpace(json)) return task;
// //行 2234: [2021 - 04 - 07 15:09:31,412][9]INFO - http :URL:
// //http://192.168.100.14/myproject/rest/api/qisda/device/putShelfFinished?barcode=640253A*34005600000309*QG00006*5000*23C4&rfid=F103&rfidLoc=8&robotIndex=1 :
// //Response:{"code":0,"msg":"ok","data":{"smallTask":"0","cutPackageTask":"0","packageTask":"0","bigTask":"0","smallEmpty":"0","bigEmpty":"5","packageEmpty":"0","rfid":"F103","usedRfidList":"F106,F105,F103","barcode":"640253A*34005600000309*QG00006*5000*23C4","cutTask":"0"}} 耗时[00:00:00.1]
// JavaScriptSerializer serializer = new JavaScriptSerializer();
// Dictionary<string, object> obj = (Dictionary<string, object>)serializer.DeserializeObject(json);
// if (!obj.TryGetValue("code", out object value)) return task;
// if (value.ToString() != "0")
// {
// if (obj.TryGetValue("msg", out value))
// LogUtil.error("http" + api + ": " + value.ToString());
// return task;
// }
// if (!obj.TryGetValue("data", out value)) return task;
// Dictionary<string, object> dict = (Dictionary<string, object>)value;
// if (dict == null)
// {
// LogUtil.info("http" + api + ": data=null");
// return task;
// }
return
null
;
}
}
public
class
ServerData1
{
public
int
code
{
get
;
set
;
}
// if (dict.TryGetValue("bigEmpty", out value))
// int.TryParse(value.ToString(), out task.bigEmpty);
// if (dict.TryGetValue("smallEmpty", out value))
// int.TryParse(value.ToString(), out task.smallEmpty);
public
string
msg
{
get
;
set
;
}
// if (dict.TryGetValue("usedRfidList", out value))
// task.usedRfidList = value.ToString();
// }
// catch (Exception ex)
// {
// LogUtil.error("http error : " + ex.ToString());
// }
// return task;
}
public
Dictionary
<
string
,
string
>
data
{
get
;
set
;
}
}
public
class
ShelfTaskInfo
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论