扫描数据回传接口

master
nodyang@aliyun.com 4 months ago
parent f7a00451ec
commit 1c3d9e4a15

@ -34,17 +34,18 @@ namespace SlnMesnac.TouchSocket
/// <summary> /// <summary>
/// 扫描的状态回传 /// 扫描的状态回传
/// </summary> /// </summary>
/// <param name="messageHeader"></param> /// <param name="scanStatus"></param>
/// <param name="containerRegisterQuery"></param>
/// <returns></returns> /// <returns></returns>
[EnableCors("cors")] [EnableCors("cors")]
[WebApi(HttpMethodType.POST)] [WebApi(HttpMethodType.POST)]
public Back ScanStatus(ScanStatusSocket scanStatus) public Back ScanStatus(ScanStatusSocket scanStatus)
{ {
BaseLog log = new BaseLog(); BaseLog log = new BaseLog
log.LogLevel = "Info"; {
log.ErrMsg = ""; LogLevel = "Info",
log.Content = scanStatus.ToJsonString(); ErrMsg = "",
Content = scanStatus.ToJsonString()
};
try try
{ {
if (scanStatus.is_alarm == 1 && scanStatus.device_status != null && scanStatus.device_status.Count > 0) if (scanStatus.is_alarm == 1 && scanStatus.device_status != null && scanStatus.device_status.Count > 0)
@ -76,32 +77,31 @@ namespace SlnMesnac.TouchSocket
return new Back(); return new Back();
} }
/// <summary> /// <summary>
/// 入库开始 /// 扫描数据回传接口
/// </summary> /// </summary>
/// <param name="messageHeader"></param> /// <param name="scanLog"></param>
/// <param name="containerRegisterQuery"></param>
/// <returns></returns> /// <returns></returns>
[EnableCors("cors")] [EnableCors("cors")]
[WebApi(HttpMethodType.POST)] [WebApi(HttpMethodType.POST)]
public Back ScanBack(ScanLogSocket scanLogStatus) public Back ScanBack(ScanLogSocket scanLog)
{ {
BaseLog log = new BaseLog(); BaseLog log = new BaseLog();
log.LogLevel = "Info"; log.LogLevel = "Info";
log.ErrMsg = ""; log.ErrMsg = "";
log.Content = scanLogStatus.ToJsonString(); log.Content = scanLog.ToJsonString();
try try
{ {
var model = new ScanLogModel() var model = new ScanLogModel()
{ {
CreateTime = scanLogStatus.CreateTime, CreateTime = scanLog.CreateTime,
DataType = scanLogStatus.data_type, DataType = scanLog.data_type,
Code = scanLogStatus.code, Code = scanLog.code,
Rfid = scanLogStatus.rfid, Rfid = scanLog.rfid,
Ocr = scanLogStatus.ocr, Ocr = scanLog.ocr,
Url = scanLogStatus.url Url = scanLog.url
}; };

Loading…
Cancel
Save