<point>[important]可用初版
This commit is contained in:
parent
99d6668cf2
commit
579852e4bd
|
|
@ -0,0 +1,29 @@
|
|||
using Newtonsoft.Json;
|
||||
|
||||
namespace WcsMain.ApiClient.DataEntity.WmsEntity;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 上报输送线按钮
|
||||
/// </summary>
|
||||
public class ConceyButtonClickRequest
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 载具号
|
||||
/// </summary>
|
||||
[JsonProperty("vehicleNo")]
|
||||
public string? VehicleNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拣选站台
|
||||
/// </summary>
|
||||
[JsonProperty("location")]
|
||||
public string? Location { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[JsonProperty("remark")]
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
using Newtonsoft.Json;
|
||||
|
||||
namespace WcsMain.ApiClient.DataEntity.WmsEntity;
|
||||
|
||||
/// <summary>
|
||||
/// 电子标签确认按钮按下请求数据
|
||||
/// </summary>
|
||||
public class ElTagComfirmButtonClickRequest
|
||||
{
|
||||
|
||||
[JsonProperty("taskGroup")]
|
||||
public string? TaskGroup { get; set; }
|
||||
|
||||
[JsonProperty("taskType")]
|
||||
public int? TaskType { get; set; }
|
||||
|
||||
[JsonProperty("vehicleNo")]
|
||||
public string? VehicleNo { get; set; }
|
||||
|
||||
[JsonProperty("orderId")]
|
||||
public string? OrderId { get; set; }
|
||||
|
||||
[JsonProperty("taskId")]
|
||||
public string? TaskId { get; set; }
|
||||
|
||||
[JsonProperty("location")]
|
||||
public string? Location { get; set; }
|
||||
|
||||
[JsonProperty("goodsId")]
|
||||
public string? GoodsId { get; set; }
|
||||
|
||||
[JsonProperty("goodsName")]
|
||||
public string? GoodsName { get; set; }
|
||||
|
||||
[JsonProperty("needNum")]
|
||||
public int? NeedNum { get; set; }
|
||||
|
||||
[JsonProperty("confirmNum")]
|
||||
public int? ConfirmNum { get; set; }
|
||||
|
||||
}
|
||||
18
WcsMain/ApiClient/DataEntity/WmsEntity/RequestBackRequest.cs
Normal file
18
WcsMain/ApiClient/DataEntity/WmsEntity/RequestBackRequest.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using Newtonsoft.Json;
|
||||
|
||||
namespace WcsMain.ApiClient.DataEntity.WmsEntity;
|
||||
|
||||
public class RequestBackRequest
|
||||
{
|
||||
|
||||
public RequestBackRequest(string? vehicleId) => VehicleId = vehicleId;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 载具号
|
||||
/// </summary>
|
||||
[JsonProperty("vehicleId")]
|
||||
public string? VehicleId { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -8,6 +8,12 @@ namespace WcsMain.ApiClient.DataEntity.WmsEntity;
|
|||
/// </summary>
|
||||
public class UploadPickStandRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务组
|
||||
/// </summary>
|
||||
[JsonProperty("taskGroup")]
|
||||
public string? TaskGroup { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 载具号
|
||||
/// </summary>
|
||||
|
|
@ -17,8 +23,8 @@ public class UploadPickStandRequest
|
|||
/// <summary>
|
||||
/// 拣选站台
|
||||
/// </summary>
|
||||
[JsonProperty("pickStand")]
|
||||
public string? PickStand { get; set; }
|
||||
[JsonProperty("location")]
|
||||
public string? Location { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ public class ConveyService(DataBaseData dataBaseData, AppConveyTaskDao conveyTas
|
|||
public WmsApiResponse DisposeVehicle(DisposeVehicleRequest request)
|
||||
{
|
||||
if(string.IsNullOrEmpty(request.Location)) return WmsApiResponseFactory.RequestErr("存在必填项未填");
|
||||
var writeResult = conveyOperation.DisposeVehicle(request.Location);
|
||||
var writeResult = conveyOperation.AllowPickStandGo(request.Location, 2);
|
||||
if(string.IsNullOrEmpty(writeResult)) return WmsApiResponseFactory.Success();
|
||||
return WmsApiResponseFactory.Fail(writeResult);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,19 +44,18 @@ public class PickStandButton(AppConveyStandDao conveyStandDao, ConveyOperation c
|
|||
{
|
||||
int pickButtonStatus = conveyOperation.GetAllowPickStandGo(pickStand.StandId!);
|
||||
if (pickButtonStatus != 1) return;
|
||||
ConsoleLog.Info($"【提示】拣选站:{pickStand.StandId} 按钮已经按下");
|
||||
conveyOperation.AllowPickStandGo(pickStand.StandId!, 2);
|
||||
ConsoleLog.Success($"{pickStand.StandId}按钮按下,调试阶段直接放行");
|
||||
return;
|
||||
//ConsoleLog.Info($"【提示】拣选站:{pickStand.StandId} 按钮已经按下");
|
||||
//conveyOperation.AllowPickStandGo(pickStand.StandId!, 2);
|
||||
//ConsoleLog.Success($"{pickStand.StandId}按钮按下,调试阶段直接放行");
|
||||
//return;
|
||||
// 发送wms按钮按下
|
||||
UploadPickStandRequest request = new UploadPickStandRequest()
|
||||
ConceyButtonClickRequest request = new()
|
||||
{
|
||||
PickStand = pickStand.StandId,
|
||||
Location = pickStand.StandId,
|
||||
VehicleNo = "",
|
||||
Remark = "按钮按下上报"
|
||||
};
|
||||
var responseEntity = wmsWebApiPost.HttpPost<UploadPickStandRequest, WmsResponse>(request,
|
||||
CommonData.AppApiBaseInfos.GetAddress("UploadPickStandButtonMethod") ?? "", 5000);
|
||||
var responseEntity = wmsWebApiPost.HttpPost<ConceyButtonClickRequest, WmsResponse>(request, CommonData.AppApiBaseInfos.GetAddress("UploadPickStandButtonMethod") ?? "", 2000);
|
||||
if (!responseEntity.IsSend) return; // 发送失败不处理,下一次循环在发送
|
||||
// 只要发送成功则不再发送
|
||||
ConsoleLog.Info( $"拣选站:{pickStand.StandId} 按钮已经按下上报成功,WMS返回:{responseEntity.ResponseMsg}");
|
||||
|
|
|
|||
|
|
@ -31,23 +31,27 @@ public class ReadScanCode(AppRouterMethodDao routerMethodDao, ConveyOperation co
|
|||
}
|
||||
List<Task> tasks = [];
|
||||
foreach(AppRouterMethod router in routers)
|
||||
{
|
||||
tasks.Add(Task.Factory.StartNew(() =>
|
||||
{
|
||||
(var readErrText, var scanOk, var code) = conveyOperation.ReadScanInfo(router.Area);
|
||||
if (!string.IsNullOrEmpty(readErrText))
|
||||
{
|
||||
ConsoleLog.Exception($"【异常】读取扫码:{router.Area} 数据异常,信息:{readErrText}");
|
||||
Thread.Sleep(5000);
|
||||
return true; // 不读了,估计网断了
|
||||
return; // 不读了,估计网断了
|
||||
}
|
||||
if(scanOk != (int)TrueFalseEnum.TRUE) { continue; }
|
||||
tasks.Add(Task.Factory.StartNew(() =>
|
||||
{
|
||||
historyConveyDataHander.GetData("-", code, router.Area ?? "");
|
||||
if (scanOk != (short)TrueFalseEnum.TRUE) { return; }
|
||||
string clearErrText = conveyOperation.ClearScanStatus(router.Area);
|
||||
if (!string.IsNullOrEmpty(clearErrText))
|
||||
{
|
||||
ConsoleLog.Exception($"【异常】扫码:{router.Area} 清理读码信号异常,信息:{clearErrText}");
|
||||
}
|
||||
else
|
||||
{
|
||||
ConsoleLog.Success($"扫码:{router.Area} 清理读码信号成功,点位:{router.Area}");
|
||||
}
|
||||
historyConveyDataHander.GetData("-", code, router.Area ?? "");
|
||||
scanRecordDao.Insert(new AppScanRecord() { RecordId = dataBaseData.GetNewUUID2(), ScanId = router.Area, Code = code, ScanTime = DateTime.Now });
|
||||
}));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ public class UploadBoxArrive(AppConveyStandDao conveyStandDao, ConveyOperation c
|
|||
List<Task> tasks = [];
|
||||
foreach (AppConveyStand stand in _pickStands)
|
||||
{
|
||||
Thread.Sleep(20);
|
||||
Task task = new(() =>
|
||||
{
|
||||
string code = conveyOperation.ReadStandCode(stand.StandId!);
|
||||
|
|
@ -69,19 +68,22 @@ public class UploadBoxArrive(AppConveyStandDao conveyStandDao, ConveyOperation c
|
|||
{
|
||||
TaskId = pickTask.TaskId,
|
||||
TaskStatus = (int)ConveyTaskStatusEnum.arrive,
|
||||
ArriveLocation = stand.StandId,
|
||||
CompleteTime = DateTime.Now,
|
||||
Remark = "PLC上报料箱到达"
|
||||
});
|
||||
//return; // 测试
|
||||
|
||||
// 发送wms料箱到达
|
||||
UploadPickStandRequest request = new()
|
||||
{
|
||||
PickStand = stand.StandId,
|
||||
Location = stand.StandId,
|
||||
VehicleNo = pickTask.VehicleNo,
|
||||
Remark = ""
|
||||
};
|
||||
|
||||
var responseEntity = wmsWebApiPost.HttpPost<UploadPickStandRequest, WmsResponse>(request,
|
||||
CommonData.AppApiBaseInfos.GetAddress("UploadBoxArrive") ?? "", 5000);
|
||||
CommonData.AppApiBaseInfos.GetAddress("UploadBoxArrive") ?? "", 2000);
|
||||
if (responseEntity.IsSend) // 发送失败不处理,下一次循环在发送
|
||||
{
|
||||
// 只要发送成功则不再发送
|
||||
|
|
|
|||
|
|
@ -57,15 +57,13 @@ public class LightElTag(AppElTagTaskDao tagTaskDao, AtopOperation atopOperation,
|
|||
/* 点亮标签 */
|
||||
LedColor lEDColor = new Func<LedColor>(() =>
|
||||
{
|
||||
switch (tagTask.TaskType)
|
||||
return tagTask.TaskType switch
|
||||
{
|
||||
case (int)ElTagTaskTypeEnum.PICK:
|
||||
return LedColor.Green;
|
||||
case (int)ElTagTaskTypeEnum.STOCK:
|
||||
return LedColor.Blue;
|
||||
default:
|
||||
return LedColor.Red;
|
||||
(int)ElTagTaskTypeEnum.PICK => LedColor.Green,
|
||||
(int)ElTagTaskTypeEnum.STOCK => LedColor.Blue,
|
||||
_ => LedColor.Red,
|
||||
};
|
||||
;
|
||||
}).Invoke();
|
||||
var resultException = atopOperation.ShowMsg(tagInfo.ControllerDisplayName, tagInfo.TagId, tagTask.NeedNum, lEDColor);
|
||||
if(resultException == default )
|
||||
|
|
@ -81,6 +79,13 @@ public class LightElTag(AppElTagTaskDao tagTaskDao, AtopOperation atopOperation,
|
|||
return;
|
||||
}
|
||||
ConsoleLog.Warning($"【警告】点亮电子标签失败,点位:{tagTask.Location},数据:{tagTask.NeedNum},载具号:{tagTask.VehicleNo},标签号:{tagInfo.TagId},异常信息:{resultException.Message}");
|
||||
tagTaskDao.Update(new AppElTagTask
|
||||
{
|
||||
TaskId = tagTask.TaskId,
|
||||
TaskStatus = (int)ElTagTaskStatusEnum.Error,
|
||||
ConfirmTime = DateTime.Now,
|
||||
Remark = resultException.Message
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,10 +28,7 @@ public class ExeTaskDoubleFork(
|
|||
[Circulation("执行堆垛机任务")]
|
||||
public bool ExecuteStackerTask()
|
||||
{
|
||||
List<Task> tasks = [];
|
||||
foreach (var stacker in CommonData.AppStackers.Open())
|
||||
{
|
||||
tasks.Add(Task.Factory.StartNew(() =>
|
||||
{
|
||||
var stackerUseStatus = stackerOperation.StackerCanUse(stacker.StackerId, out int plcId, out int spare1);
|
||||
if (stackerUseStatus == StackerUseStatusEnum.Free)
|
||||
|
|
@ -39,13 +36,13 @@ public class ExeTaskDoubleFork(
|
|||
/* 空闲时正常执行任务 */
|
||||
// 移库
|
||||
bool exeMoveTask = ExecuteMoveTask(stacker.StackerId);
|
||||
if (exeMoveTask) return;
|
||||
if (exeMoveTask) continue;
|
||||
// 出库
|
||||
bool exeOutTask = ExecuteOutTask(stacker.StackerId);
|
||||
if (exeOutTask) return;
|
||||
if (exeOutTask) continue;
|
||||
// 入库
|
||||
bool exeInTask = ExecuteInTask(stacker.StackerId);
|
||||
if (exeInTask) return;
|
||||
if (exeInTask) continue;
|
||||
// 拣选
|
||||
//bool exePickTask = ExecutePickTask(stacker.StackerId);
|
||||
//if (exePickTask) return;
|
||||
|
|
@ -54,13 +51,11 @@ public class ExeTaskDoubleFork(
|
|||
{
|
||||
/* 重复入库时执行任务 */
|
||||
bool exeDoubleInTask = ExecuteDoubleInTask(stacker.StackerId, plcId, 1);
|
||||
if (exeDoubleInTask) return;
|
||||
if (exeDoubleInTask) continue;
|
||||
exeDoubleInTask = ExecuteDoubleInTask(stacker.StackerId, spare1, 2);
|
||||
if (exeDoubleInTask) return;
|
||||
if (exeDoubleInTask) continue;
|
||||
}
|
||||
}));
|
||||
}
|
||||
Task.WaitAll([.. tasks]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,19 +35,19 @@ public class LoginGetData(WmsWebApiPost wmsWebApiPost) : IBaseGetData
|
|||
public void ReadSuccess(string? disPlayName, string msg, string? area, AppRouterMethod routerMethodData)
|
||||
{
|
||||
/* 发送 WMS 请求入库 */
|
||||
//ApplyInRequest applyInRequest = new(area, msg, msg);
|
||||
//var postResult = wmsWebApiPost.HttpPost<ApplyInRequest, WmsResponse>(applyInRequest, CommonData.AppApiBaseInfos.GetAddress("ApplyEnterApiAddress") ?? "");
|
||||
//if(!postResult.IsSend || postResult.ResponseEntity == default)
|
||||
//{
|
||||
// ConsoleLog.Exception($"【异常】注册口:{area} 箱码:{msg} 请求入库发生异常,异常信息:{postResult.RequestException}");
|
||||
// return;
|
||||
//}
|
||||
//if( postResult.ResponseEntity.Code == 0)
|
||||
//{
|
||||
// ConsoleLog.Success($"注册口:{area} 箱码:{msg} 请求入库成功 {postResult.ResponseEntity.Message}");
|
||||
// return;
|
||||
//}
|
||||
//ConsoleLog.Warning($"【警告】注册口:{area} 箱码:{msg} 请求入库失败,信息:{postResult.ResponseEntity.Message}");
|
||||
//return;
|
||||
ApplyInRequest applyInRequest = new(area, msg, msg);
|
||||
var postResult = wmsWebApiPost.HttpPost<ApplyInRequest, WmsResponse>(applyInRequest, CommonData.AppApiBaseInfos.GetAddress("ApplyEnterApiAddress") ?? "", 2000);
|
||||
if (!postResult.IsSend || postResult.ResponseEntity == default)
|
||||
{
|
||||
ConsoleLog.Exception($"【异常】注册口:{area} 箱码:{msg} 请求入库发生异常,异常信息:{postResult.RequestException}");
|
||||
return;
|
||||
}
|
||||
if (postResult.ResponseEntity.Code == 0)
|
||||
{
|
||||
ConsoleLog.Success($"注册口:{area} 箱码:{msg} 请求入库成功 {postResult.ResponseEntity.Message}");
|
||||
return;
|
||||
}
|
||||
ConsoleLog.Warning($"【警告】注册口:{area} 箱码:{msg} 请求入库失败,信息:{postResult.ResponseEntity.Message}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
using WcsMain.Business.Convey.HistoryDataHandler.HisGetData.I;
|
||||
using WcsMain.ApiClient.DataEntity.WmsEntity;
|
||||
using WcsMain.Business.Convey.HistoryDataHandler.HisGetData.I;
|
||||
using WcsMain.Common;
|
||||
using WcsMain.DataBase.Dao;
|
||||
using WcsMain.DataBase.TableEntity;
|
||||
using WcsMain.DataService;
|
||||
|
|
@ -6,6 +8,7 @@ using WcsMain.Enum.Convey;
|
|||
using WcsMain.EquipOperation.Convey;
|
||||
using WcsMain.EquipOperation.Entity;
|
||||
using WcsMain.ExtendMethod;
|
||||
using WcsMain.Plugins;
|
||||
|
||||
namespace WcsMain.Business.Convey.HistoryDataHandler.HisGetData;
|
||||
|
||||
|
|
@ -15,7 +18,7 @@ namespace WcsMain.Business.Convey.HistoryDataHandler.HisGetData;
|
|||
/// <param name="conveyOperation"></param>
|
||||
/// <param name="dataBaseData"></param>
|
||||
/// <param name="conveyTaskDao"></param>
|
||||
public class Pick1StandOutC3(ConveyOperation conveyOperation, DataBaseData dataBaseData, AppConveyTaskDao conveyTaskDao) : IBaseGetData
|
||||
public class Pick1StandOutC3(ConveyOperation conveyOperation, DataBaseData dataBaseData, AppConveyTaskDao conveyTaskDao, WmsWebApiPost wmsWebApiPost) : IBaseGetData
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -49,6 +52,51 @@ public class Pick1StandOutC3(ConveyOperation conveyOperation, DataBaseData dataB
|
|||
public void ReadSuccess(string? disPlayName, string msg, string? area, AppRouterMethod routerMethodData)
|
||||
{
|
||||
int plcId = dataBaseData.GetNewPlcTaskId() ?? StaticData.StaticInt.ErrPlcId; // 获取一个 plcId
|
||||
// 调用注册查看有没有剩余任务
|
||||
RequestBackRequest applyInRequest = new(msg);
|
||||
var postResult = wmsWebApiPost.HttpPost<RequestBackRequest, WmsResponse>(applyInRequest, CommonData.AppApiBaseInfos.GetAddress("RequestBackRequest") ?? "", 2000);
|
||||
if (!postResult.IsSend || postResult.ResponseEntity == default)
|
||||
{
|
||||
ConsoleLog.Exception($"【异常】拣选站台出口:{area} 箱码:{msg} 请求入库发生异常,异常信息:{postResult.RequestException}");
|
||||
ConveyPLCTask plcTask = new(plcId, (short)ConveyRouterEnum.Go); // 连接中断一区环线运行
|
||||
string errText = conveyOperation.WriteTask(area, plcTask);
|
||||
if (string.IsNullOrEmpty(errText))
|
||||
{
|
||||
ConsoleLog.Success($"一区出口:{area} 箱码:{msg},写入PLC成功,{plcTask}");
|
||||
return;
|
||||
}
|
||||
ConsoleLog.Warning($"【警告】一区出口:{area} 箱码:{msg},写入PLC失败,{plcTask},信息:{errText}");
|
||||
return;
|
||||
}
|
||||
if (postResult.ResponseEntity.Code == 0)
|
||||
{
|
||||
ConsoleLog.Success($"拣选站台出口:{area} 箱码:{msg} 请求入库成功 {postResult.ResponseEntity.Message}");
|
||||
// 给通行信号,同时将未完成的拣选任务全部结束
|
||||
ConveyPLCTask plcTask = new(plcId, (short)ConveyRouterEnum.RightMove);
|
||||
string errText = conveyOperation.WriteTask(area, plcTask);
|
||||
if (string.IsNullOrEmpty(errText))
|
||||
{
|
||||
ConsoleLog.Success($"一区出口:{area} 箱码:{msg},写入PLC成功,{plcTask}");
|
||||
}
|
||||
else
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】一区出口:{area} 箱码:{msg},写入PLC失败,{plcTask},信息:{errText}");
|
||||
}
|
||||
// 更新拣选站台任务
|
||||
List<AppConveyTask>? notCompleteConveyTasks = conveyTaskDao.Query(new AppConveyTask { VehicleNo = msg, TaskStatus = (int)ConveyTaskStatusEnum.create });
|
||||
if (notCompleteConveyTasks != null && notCompleteConveyTasks.Count > 0)
|
||||
{
|
||||
foreach (var notCompleteConveyTask in notCompleteConveyTasks)
|
||||
{
|
||||
notCompleteConveyTask.TaskStatus = (int)ConveyTaskStatusEnum.arrive;
|
||||
notCompleteConveyTask.ArriveLocation = "一区回库口自动完成";
|
||||
notCompleteConveyTask.CompleteTime = DateTime.Now;
|
||||
}
|
||||
conveyTaskDao.Update([.. notCompleteConveyTasks]); // 更新任务状态
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* 判断条码有没有拣选任务 */
|
||||
List<AppConveyTask>? conveyTasks = conveyTaskDao.Query(new AppConveyTask { VehicleNo = msg, TaskStatus = (int)ConveyTaskStatusEnum.create });
|
||||
if (conveyTasks == default)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using WcsMain.Business.Convey.HistoryDataHandler.HisGetData.I;
|
||||
using WcsMain.ApiClient.DataEntity.WmsEntity;
|
||||
using WcsMain.Business.Convey.HistoryDataHandler.HisGetData.I;
|
||||
using WcsMain.Common;
|
||||
using WcsMain.DataBase.Dao;
|
||||
using WcsMain.DataBase.TableEntity;
|
||||
|
|
@ -7,6 +8,7 @@ using WcsMain.Enum.Convey;
|
|||
using WcsMain.EquipOperation.Convey;
|
||||
using WcsMain.EquipOperation.Entity;
|
||||
using WcsMain.ExtendMethod;
|
||||
using WcsMain.Plugins;
|
||||
|
||||
namespace WcsMain.Business.Convey.HistoryDataHandler.HisGetData;
|
||||
|
||||
|
|
@ -16,7 +18,7 @@ namespace WcsMain.Business.Convey.HistoryDataHandler.HisGetData;
|
|||
/// <param name="conveyOperation"></param>
|
||||
/// <param name="dataBaseData"></param>
|
||||
/// <param name="conveyTaskDao"></param>
|
||||
public class Pick2StandOutC4(ConveyOperation conveyOperation, DataBaseData dataBaseData, AppConveyTaskDao conveyTaskDao) : IBaseGetData
|
||||
public class Pick2StandOutC4(ConveyOperation conveyOperation, DataBaseData dataBaseData, AppConveyTaskDao conveyTaskDao, WmsWebApiPost wmsWebApiPost) : IBaseGetData
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -50,6 +52,51 @@ public class Pick2StandOutC4(ConveyOperation conveyOperation, DataBaseData dataB
|
|||
public void ReadSuccess(string? disPlayName, string msg, string? area, AppRouterMethod routerMethodData)
|
||||
{
|
||||
int plcId = dataBaseData.GetNewPlcTaskId() ?? StaticData.StaticInt.ErrPlcId; // 获取一个 plcId
|
||||
// 调用注册查看有没有剩余任务
|
||||
RequestBackRequest applyInRequest = new(msg);
|
||||
var postResult = wmsWebApiPost.HttpPost<RequestBackRequest, WmsResponse>(applyInRequest, CommonData.AppApiBaseInfos.GetAddress("RequestBackRequest") ?? "", 2000);
|
||||
if (!postResult.IsSend || postResult.ResponseEntity == default)
|
||||
{
|
||||
ConsoleLog.Exception($"【异常】拣选站台出口:{area} 箱码:{msg} 请求入库发生异常,异常信息:{postResult.RequestException}");
|
||||
ConveyPLCTask plcTask = new(plcId, (short)ConveyRouterEnum.Go); // 连接中断一区环线运行
|
||||
string errText = conveyOperation.WriteTask(area, plcTask);
|
||||
if (string.IsNullOrEmpty(errText))
|
||||
{
|
||||
ConsoleLog.Success($"二区出口:{area} 箱码:{msg},写入PLC成功,{plcTask}");
|
||||
return;
|
||||
}
|
||||
ConsoleLog.Warning($"【警告】二区出口:{area} 箱码:{msg},写入PLC失败,{plcTask},信息:{errText}");
|
||||
return;
|
||||
}
|
||||
if (postResult.ResponseEntity.Code == 0)
|
||||
{
|
||||
ConsoleLog.Success($"拣选站台出口:{area} 箱码:{msg} 请求入库成功 {postResult.ResponseEntity.Message}");
|
||||
// 给通行信号,同时将未完成的拣选任务全部结束
|
||||
ConveyPLCTask plcTask = new(plcId, (short)ConveyRouterEnum.RightMove);
|
||||
string errText = conveyOperation.WriteTask(area, plcTask);
|
||||
if (string.IsNullOrEmpty(errText))
|
||||
{
|
||||
ConsoleLog.Success($"二区出口:{area} 箱码:{msg},写入PLC成功,{plcTask}");
|
||||
}
|
||||
else
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】二区出口:{area} 箱码:{msg},写入PLC失败,{plcTask},信息:{errText}");
|
||||
}
|
||||
// 更新拣选站台任务
|
||||
List<AppConveyTask>? notCompleteConveyTasks = conveyTaskDao.Query(new AppConveyTask { VehicleNo = msg, TaskStatus = (int)ConveyTaskStatusEnum.create });
|
||||
if (notCompleteConveyTasks != null && notCompleteConveyTasks.Count > 0)
|
||||
{
|
||||
foreach (var notCompleteConveyTask in notCompleteConveyTasks)
|
||||
{
|
||||
notCompleteConveyTask.TaskStatus = (int)ConveyTaskStatusEnum.arrive;
|
||||
notCompleteConveyTask.ArriveLocation = "二区回库口自动完成";
|
||||
notCompleteConveyTask.CompleteTime = DateTime.Now;
|
||||
}
|
||||
conveyTaskDao.Update([.. notCompleteConveyTasks]); // 更新任务状态
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* 判断条码有没有拣选任务 */
|
||||
List<AppConveyTask>? conveyTasks = conveyTaskDao.Query(new AppConveyTask { VehicleNo = msg, TaskStatus = (int)ConveyTaskStatusEnum.create });
|
||||
if (conveyTasks == default)
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public class StackerInErr(ConveyOperation conveyOperation, DataBaseData dataBase
|
|||
ConsoleLog.Warning($"【警告】入库分流:{area} 箱码:{msg},写入PLC失败,{plcTask},信息:{errText}");
|
||||
return;
|
||||
}
|
||||
ConveyRouterEnum router = (ConveyRouterEnum)(locationDetail.TunnelNo ?? 0);
|
||||
ConveyRouterEnum router = (ConveyRouterEnum)(6 - locationDetail.TunnelNo ?? 0);
|
||||
ConsoleLog.Success($"入库分流:{area} 箱码:{msg} 终点:{wcsTask.Destination} 巷道:{locationDetail.TunnelNo}");
|
||||
ConveyPLCTask plcTaskOk = new(plcId, (short)router);
|
||||
string errTextOk = conveyOperation.WriteTask(area, plcTaskOk);
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public class StackerInSpliter(ConveyOperation conveyOperation, DataBaseData data
|
|||
ConsoleLog.Warning($"【警告】入库分流:{area} 箱码:{msg},写入PLC失败,{plcTask},信息:{errText}");
|
||||
return;
|
||||
}
|
||||
ConveyRouterEnum router = (ConveyRouterEnum)(locationDetail.TunnelNo ?? 0);
|
||||
ConveyRouterEnum router = (ConveyRouterEnum)(6 - locationDetail.TunnelNo ?? 0);
|
||||
ConsoleLog.Success($"入库分流:{area} 箱码:{msg} 终点:{wcsTask.Destination} 巷道:{locationDetail.TunnelNo}");
|
||||
ConveyPLCTask plcTaskOk = new(plcId, (short)router);
|
||||
string errTextOk = conveyOperation.WriteTask(area, plcTaskOk);
|
||||
|
|
|
|||
|
|
@ -351,39 +351,6 @@ public class AppWmsTaskDao
|
|||
return result.Data ? string.Empty : result.ErrorMessage;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 完成任务 ---- 完成最后一个任务
|
||||
/// </summary>
|
||||
/// <param name="wcsTaskUpdateEntity"></param>
|
||||
/// <param name="wmsTaskUpdateEntity"></param>
|
||||
/// <returns></returns>
|
||||
public string CompleteTaskWithTaskInfo(AppWcsTask wcsTaskUpdateEntity, AppWmsTask wmsTaskUpdateEntity)
|
||||
{
|
||||
/*
|
||||
需要执行的操作
|
||||
1、完成WMS任务表状态
|
||||
2、删除WCS任务表数据
|
||||
*/
|
||||
var result = CommonTool.DbServe.Ado.UseTran(() =>
|
||||
{
|
||||
// -- 更新wms任务状态
|
||||
CommonTool.DbServe
|
||||
.Updateable(wmsTaskUpdateEntity)
|
||||
.IgnoreColumns(ignoreAllNullColumns: true)
|
||||
.ExecuteCommand();
|
||||
// -- 更新wcs任务表状态
|
||||
CommonTool.DbServe
|
||||
.Updateable(wcsTaskUpdateEntity)
|
||||
.IgnoreColumns(ignoreAllNullColumns: true)
|
||||
.ExecuteCommand();
|
||||
// -- 备份WCS任务表
|
||||
CommonTool.DbServe.Ado.ExecuteCommand(
|
||||
$"insert into tbl_app_wcs_task_bak select * from tbl_app_wcs_task where task_id = '{wmsTaskUpdateEntity.TaskId}'");
|
||||
// -- 删除WCS任务表
|
||||
CommonTool.DbServe.Deleteable<AppWcsTask>().Where(w => w.TaskId == wmsTaskUpdateEntity.TaskId).ExecuteCommand();
|
||||
});
|
||||
return result.Data ? string.Empty : result.ErrorMessage;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
using WcsMain.Common;
|
||||
using System.Threading.Tasks;
|
||||
using WcsMain.Common;
|
||||
using WcsMain.DataBase.Dao;
|
||||
using WcsMain.DataBase.TableEntity;
|
||||
using WcsMain.Enum.Stacker;
|
||||
using WcsMain.ExtendMethod;
|
||||
|
|
@ -183,16 +185,24 @@ public class TaskDao
|
|||
.ExecuteCommand();
|
||||
if (wcsTask.IsLastTask())
|
||||
{
|
||||
/* 更新WMS任务表状态 */
|
||||
CommonTool.DbServe.Updateable(new AppWmsTask
|
||||
{
|
||||
TaskId = wcsTask.TaskId,
|
||||
TaskStatus = (int)WmsTaskStatusEnum.complete,
|
||||
EndTime = dateTime,
|
||||
TaskMsg = msg
|
||||
})
|
||||
// -- 更新wms任务状态
|
||||
CommonTool.DbServe
|
||||
.Updateable(new AppWmsTask()
|
||||
{ TaskId = wcsTask.TaskId, TaskStatus = (int)WmsTaskStatusEnum.complete, EndTime = DateTime.Now, TaskMsg = msg })
|
||||
.IgnoreColumns(ignoreAllNullColumns: true)
|
||||
.ExecuteCommand();
|
||||
// -- 更新wcs任务表状态
|
||||
CommonTool.DbServe
|
||||
.Updateable(new AppWcsTask()
|
||||
{ TaskId = wcsTask.TaskId, TaskStatus = (int)WcsTaskStatusEnum.complete, Remark = msg, CompleteTime = DateTime.Now })
|
||||
.UpdateColumns(u => new { u.TaskStatus, u.Remark, u.CompleteTime }).WhereColumns(w => new { w.TaskId })
|
||||
.ExecuteCommand();
|
||||
// -- 备份WCS任务表
|
||||
CommonTool.DbServe.Ado.ExecuteCommand(
|
||||
$"insert into tbl_app_wcs_task_bak select * from tbl_app_wcs_task where task_id = '{wcsTask.TaskId}'");
|
||||
// -- 删除WCS任务表
|
||||
CommonTool.DbServe.Deleteable<AppWcsTask>().Where(w => w.TaskId == wcsTask.TaskId).ExecuteCommand();
|
||||
|
||||
}
|
||||
});
|
||||
return result.Data ? string.Empty : result.ErrorException.Message;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
using System.Text.RegularExpressions;
|
||||
using WcsMain.ApiClient.DataEntity.WmsEntity;
|
||||
using WcsMain.Common;
|
||||
using WcsMain.DataBase.Dao;
|
||||
using WcsMain.DataBase.TableEntity;
|
||||
using WcsMain.ElTag.Atop.AtopEnum;
|
||||
|
|
@ -6,6 +8,7 @@ using WcsMain.ElTag.Atop.Entity;
|
|||
using WcsMain.Enum.ElTag;
|
||||
using WcsMain.EquipOperation.ElTag;
|
||||
using WcsMain.ExtendMethod;
|
||||
using WcsMain.Plugins;
|
||||
using WcsMain.WcsAttribute.AutoFacAttribute;
|
||||
|
||||
namespace WcsMain.ElTag.Atop;
|
||||
|
|
@ -14,13 +17,9 @@ namespace WcsMain.ElTag.Atop;
|
|||
/// 电子标签收到数据的数据处理类
|
||||
/// </summary>
|
||||
[Component]
|
||||
public class BaseOprDataHandler(AppElTagLocationDao tagBaseDao, AppElTagTaskDao tagTaskDao, AtopOperation atopOperation)
|
||||
public class BaseOprDataHandler(AppElTagLocationDao tagBaseDao, AppElTagTaskDao tagTaskDao, AtopOperation atopOperation, WmsWebApiPost wmsWebApiPost)
|
||||
{
|
||||
|
||||
private readonly AppElTagLocationDao _tagBaseDao = tagBaseDao;
|
||||
private readonly AppElTagTaskDao _tagTaskDao = tagTaskDao;
|
||||
private readonly AtopOperation _atopOperation = atopOperation;
|
||||
|
||||
/// <summary>
|
||||
/// 收到数据时的处理方法
|
||||
/// </summary>
|
||||
|
|
@ -59,11 +58,11 @@ public class BaseOprDataHandler(AppElTagLocationDao tagBaseDao, AppElTagTaskDao
|
|||
{
|
||||
// _atopOperation.ShowMsgOnly(tcpServe.ControllerDisplayName, tcpServe.TagId, tcpServe.Data); // 重新点亮标签,仅显示字符
|
||||
/* 找出这个标签最新点亮的那条记录 */
|
||||
List<AppElTagLocation>? eltags = _tagBaseDao.Query(new AppElTagLocation { ControllerDisplayName = tcpServe.ControllerDisplayName, TagId = tcpServe.TagId });
|
||||
List<AppElTagLocation>? eltags = tagBaseDao.Query(new AppElTagLocation { ControllerDisplayName = tcpServe.ControllerDisplayName, TagId = tcpServe.TagId });
|
||||
if(eltags == default)
|
||||
{
|
||||
ConsoleLog.Exception($"【异常】电子标签确认查询数据库标签信息失败,与数据库服务器连连接中断,控制器:{tcpServe.ControllerDisplayName},标签号:{tcpServe.TagId},数据:{tcpServe.Data}");
|
||||
_atopOperation.ShowMsg(tcpServe.ControllerDisplayName, tcpServe.TagId, tcpServe.Data); // 重新点亮标签
|
||||
atopOperation.ShowMsg(tcpServe.ControllerDisplayName, tcpServe.TagId, tcpServe.Data); // 重新点亮标签
|
||||
return;
|
||||
}
|
||||
if(eltags.Count < 1)
|
||||
|
|
@ -81,11 +80,11 @@ public class BaseOprDataHandler(AppElTagLocationDao tagBaseDao, AppElTagTaskDao
|
|||
return;
|
||||
}
|
||||
/* 获取该任务号对应的任务 */
|
||||
List<AppElTagTask>? tagTasks = _tagTaskDao.Query(new AppElTagTask { TaskId = taskId });
|
||||
List<AppElTagTask>? tagTasks = tagTaskDao.Query(new AppElTagTask { TaskId = taskId });
|
||||
if(tagTasks == default)
|
||||
{
|
||||
ConsoleLog.Exception($"【异常】电子标签确认查询数据库任务失败,与数据库服务器连连接中断,控制器:{tcpServe.ControllerDisplayName},标签号:{tcpServe.TagId},数据:{tcpServe.Data}");
|
||||
_atopOperation.ShowMsg(tcpServe.ControllerDisplayName, tcpServe.TagId, tcpServe.Data); // 重新点亮标签
|
||||
atopOperation.ShowMsg(tcpServe.ControllerDisplayName, tcpServe.TagId, tcpServe.Data); // 重新点亮标签
|
||||
return;
|
||||
}
|
||||
if (tagTasks.Count < 1)
|
||||
|
|
@ -96,12 +95,37 @@ public class BaseOprDataHandler(AppElTagLocationDao tagBaseDao, AppElTagTaskDao
|
|||
var tagTask = tagTasks[0]; // 获取到的任务
|
||||
int pickNum = Regex.Replace(tcpServe.Data!, "\\D", "").IsNumber() ? Convert.ToInt32(tcpServe.Data) : -1;
|
||||
/* 更新任务状态为确认 */
|
||||
_tagTaskDao.Update(new AppElTagTask() { TaskId = tagTask.TaskId, ConfirmTime = DateTime.Now, TaskStatus = (int)ElTagTaskStatusEnum.Confirm, PickNum = pickNum, Remark = "标签确认", OffTime = DateTime.Now });
|
||||
tagTaskDao.Update(new AppElTagTask() { TaskId = tagTask.TaskId, ConfirmTime = DateTime.Now, TaskStatus = (int)ElTagTaskStatusEnum.Confirm, PickNum = pickNum, Remark = "标签确认", OffTime = DateTime.Now });
|
||||
/* 更新绑定的库位信息为空 */
|
||||
_tagBaseDao.ResetLocation(eltag.Location!);
|
||||
tagBaseDao.ResetLocation(eltag.Location!);
|
||||
ConsoleLog.Success($"电子标签确认按钮按下,标签任务号:{tagTask.TaskId} 已经确认,箱号:{tagTask.VehicleNo},拣选数量:{tagTask.NeedNum}({pickNum}) 控制器:{tcpServe.ControllerDisplayName},标签号:{tcpServe.TagId},数据:{tcpServe.Data}");
|
||||
/* 发送WMS电子标签任务完成 */
|
||||
// [TODO]
|
||||
ElTagComfirmButtonClickRequest elTagComfirmButtonClickRequest = new()
|
||||
{
|
||||
TaskGroup = tagTask.TaskGroup,
|
||||
TaskType = tagTask.TaskType,
|
||||
VehicleNo = tagTask.VehicleNo,
|
||||
OrderId = tagTask.OrderId,
|
||||
TaskId = tagTask.TaskId,
|
||||
Location = tagTask.Location,
|
||||
GoodsId = tagTask.GoodsId,
|
||||
GoodsName = tagTask.GoodsName,
|
||||
NeedNum = tagTask.NeedNum,
|
||||
ConfirmNum = pickNum
|
||||
};
|
||||
var postResult = wmsWebApiPost.HttpPost<ElTagComfirmButtonClickRequest, WmsResponse>(elTagComfirmButtonClickRequest, CommonData.AppApiBaseInfos.GetAddress("GetETaskFeedBack") ?? "", 2000);
|
||||
if (!postResult.IsSend || postResult.ResponseEntity == default)
|
||||
{
|
||||
ConsoleLog.Exception($"【异常】电子标签按钮按下:标签任务号:{tagTask.TaskId} 已经确认,箱号:{tagTask.VehicleNo},拣选数量:{tagTask.NeedNum}({pickNum}) 请求WMS发生异常,异常信息:{postResult.RequestException}");
|
||||
return;
|
||||
}
|
||||
if (postResult.ResponseEntity.Code == 0)
|
||||
{
|
||||
ConsoleLog.Success($"电子标签按钮按下:标签任务号:{tagTask.TaskId} 已经确认,箱号:{tagTask.VehicleNo},拣选数量:{tagTask.NeedNum}({pickNum}) 请求WMS成功 {postResult.ResponseEntity.Message}");
|
||||
return;
|
||||
}
|
||||
ConsoleLog.Warning($"【警告】电子标签按钮按下:标签任务号:{tagTask.TaskId} 已经确认,箱号:{tagTask.VehicleNo},拣选数量:{tagTask.NeedNum}({pickNum}) 请求WMS失败,信息:{postResult.ResponseEntity.Message}");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,8 @@ public class ConnectOprServe(AppTcpDao tcpDao, BaseOprDataHandler baseOprDataHan
|
|||
/// </summary>
|
||||
/// <param name="tcpServe"></param>
|
||||
public void ConnectSuccess(TcpServeConnectionData tcpServe)
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
ConsoleLog.Success($"电子标签:{tcpServe.TcpServe!.TcpIp} 连接成功");
|
||||
_atopOperation.BlinkingAll(tcpServe);
|
||||
|
|
@ -77,6 +79,7 @@ public class ConnectOprServe(AppTcpDao tcpDao, BaseOprDataHandler baseOprDataHan
|
|||
return;
|
||||
}
|
||||
tasks.ForEach(LightTask);
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -178,18 +178,6 @@ public class ConveyOperation
|
|||
public string WriteTask(string? equipmentId, int plcId, short router) => WriteTask(equipmentId, new ConveyPLCTask(plcId, router));
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 释放指定位置的箱子
|
||||
/// </summary>
|
||||
/// <param name="conveyId"></param>
|
||||
/// <returns></returns>
|
||||
public string DisposeVehicle(string? conveyId)
|
||||
{
|
||||
if (!CommonData.IsConnectPlc || CommonTool.Siemens == default) return "PLC尚未连接。";
|
||||
var (writeResult, _) = CommonTool.Siemens.WritePlcWhithName($"箱式线释放{conveyId}", (short)1);
|
||||
return writeResult.Success ? string.Empty : writeResult.Message ?? "写入失败,未知原因";
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 读取拣选站台释放的信号
|
||||
|
|
@ -218,122 +206,4 @@ public class ConveyOperation
|
|||
return string.Empty;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取箱式线出库站台状态
|
||||
/// </summary>
|
||||
/// <param name="standId"></param>
|
||||
/// <returns></returns>
|
||||
public bool GetOutConveyStatus(string? standId)
|
||||
{
|
||||
if (!CommonData.IsConnectPlc || CommonTool.Siemens == default)
|
||||
{
|
||||
// 未连接PLC
|
||||
return false;
|
||||
}
|
||||
var readGoodsExistResult = CommonTool.Siemens.ReadBoolWithName($"站台货物检测{standId}");
|
||||
if (!readGoodsExistResult.Success || readGoodsExistResult.Value) // 读取失败,或者有货 就不允许出库
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var readAGVExistResult = CommonTool.Siemens.ReadBoolWithName($"站台AGV检测{standId}");
|
||||
if (!readAGVExistResult.Success || readAGVExistResult.Value) // 读取失败,或者有AGV 就不允许出库
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!readGoodsExistResult.Value && !readAGVExistResult.Value) // 无货并且没有AGV才能出库
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// 10.40.200.210
|
||||
|
||||
/// <summary>
|
||||
/// 获取入库站台状态 --- 是否可以入库
|
||||
/// </summary>
|
||||
/// <param name="standId"></param>
|
||||
/// <returns></returns>
|
||||
public bool GetInConveyStatus(string? standId)
|
||||
{
|
||||
if (!CommonData.IsConnectPlc || CommonTool.Siemens == default)
|
||||
{
|
||||
// 未连接PLC
|
||||
return false;
|
||||
}
|
||||
if (string.IsNullOrEmpty(standId)) { return false; }
|
||||
if (standId.StartsWith('P'))
|
||||
{
|
||||
var readGoodsNeedIn = CommonTool.Siemens.ReadBoolWithName($"站台请求入库{standId}");
|
||||
if (!readGoodsNeedIn.Success || !readGoodsNeedIn.Value) // 读取失败,或者没有货 就不允许入库
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
var readGoodsExistResult = CommonTool.Siemens.ReadBoolWithName($"站台货物检测{standId}");
|
||||
if (!readGoodsExistResult.Success || !readGoodsExistResult.Value) // 读取失败,或者没有货 就不允许入库
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var readAGVExistResult = CommonTool.Siemens.ReadBoolWithName($"站台AGV检测{standId}");
|
||||
if (!readAGVExistResult.Success || readAGVExistResult.Value) // 读取失败,或者有AGV 就不允许入库
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (readGoodsExistResult.Value && !readAGVExistResult.Value) // 有货并且没有AGV才能入库
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取箱式线拣选站台状态
|
||||
/// </summary>
|
||||
/// <param name="standId"></param>
|
||||
/// <returns></returns>
|
||||
public bool GetPickConveyStatus(string? standId)
|
||||
{
|
||||
if (!CommonData.IsConnectPlc || CommonTool.Siemens == default)
|
||||
{
|
||||
// 未连接PLC
|
||||
return false;
|
||||
}
|
||||
var readGoodsExistResult = CommonTool.Siemens.ReadBoolWithName($"站台货物检测{standId}");
|
||||
if (!readGoodsExistResult.Success) // 读取失败,或者有货 就不允许出库
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return !readGoodsExistResult.Value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取输送机箱子号
|
||||
/// </summary>
|
||||
/// <param name="stackerId"></param>
|
||||
/// <returns></returns>
|
||||
public string GetStandCode(int stackerId)
|
||||
{
|
||||
if (!CommonData.IsConnectPlc || CommonTool.Siemens == default)
|
||||
{
|
||||
// 未连接PLC
|
||||
return string.Empty;
|
||||
}
|
||||
var readResult1 = CommonTool.Siemens.ReadStringWithName($"箱式线入库载具号{stackerId}", 10, Encoding.ASCII);
|
||||
if (!readResult1.Success)
|
||||
{
|
||||
// 读取失败
|
||||
return string.Empty;
|
||||
}
|
||||
// 返回读取到的任务号
|
||||
return Regex.Replace(readResult1.Value ?? "", "\\W", "");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -68,6 +68,7 @@ public class AtopOperation
|
|||
return new Exception("必须的值为空,无法发送电子标签");
|
||||
}
|
||||
byte[] elTagData = TagSendInfo.ShowValue(Convert.ToByte(tagId), value);
|
||||
if (CommonTool.OprTcpClient == default) return new Exception("电子标签连接不存在");
|
||||
var sendResult = CommonTool.OprTcpClient.Send(elTagData, controllerDisplayName); // 显示字符
|
||||
//CommonTool.OprTcpClient.Send(TagSendInfo.SetValueKeepAlive(Convert.ToByte(tagId)), controllerDisplayName); // 使标签确认后仍然显示字符
|
||||
CommonTool.OprTcpClient.Send(TagSendInfo.LedColor(Convert.ToByte(tagId), ledColor), controllerDisplayName); // 显示颜色
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using ApiTool;
|
||||
using WcsMain.Business.CommonAction;
|
||||
using WcsMain.Common;
|
||||
using WcsMain.DataBase.Dao;
|
||||
using WcsMain.DataBase.TableEntity;
|
||||
using WcsMain.ExtendMethod;
|
||||
using WcsMain.WcsAttribute.AutoFacAttribute;
|
||||
|
||||
|
|
@ -17,4 +19,5 @@ public class WmsWebApiPost : WebApiPost
|
|||
SetResponseAction(wmsApiResponseAction.WMSApiResponse);
|
||||
SetBaseUrl(CommonData.AppApiBaseInfos.GetAddress("WmsBaseApiAddress") ?? "");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ builder.Services.AddCors(options =>
|
|||
});
|
||||
});
|
||||
|
||||
builder.WebHost.UseUrls(CommonData.Settings.UseUrls ?? ["http://*:890"]); // 地址请在 appSettings.json 里面配置,这里是默认值
|
||||
builder.WebHost.UseUrls(CommonData.Settings.UseUrls ?? ["http://*:18990"]); // 地址请在 appSettings.json 里面配置,这里是默认值
|
||||
|
||||
// 使用 autoFac 替换注入容器
|
||||
builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory());
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
"ApiOnly": false,
|
||||
"Language": "zh-CN"
|
||||
},
|
||||
"UseUrls": [ "http://*:890" ]
|
||||
"UseUrls": [ "http://*:18990" ]
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user