From e4690fca932b352927af3d186ed2a4767f017e79 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期日, 17 八月 2025 15:02:37 +0800
Subject: [PATCH] 修改问题
---
Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs | 134 ++++++++++++++++++++++++++++++++++++++++----
1 files changed, 120 insertions(+), 14 deletions(-)
diff --git a/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs b/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs
index 612c67d..16965d2 100644
--- a/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs
+++ b/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs
@@ -46,7 +46,7 @@
.WhereIF(!string.IsNullOrWhiteSpace(input.StationNum), u => u.StationNum.Contains(input.StationNum.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Text), u => u.Text.Contains(input.Text.Trim()))
//澶勭悊澶栭敭鍜孴reeSelector鐩稿叧瀛楁鐨勮繛鎺�
- .LeftJoin<WcsPlc>((u, plcid) => u.PlcId == plcid.Id)
+ .InnerJoin<WcsPlc>((u, plcid) => u.PlcId == plcid.Id)
.Select((u, plcid) => new WcsDeviceOutput
{
Id = u.Id,
@@ -166,36 +166,140 @@
DeviceId = modDevice.Id,
StationNum = modDevice.StationNum,
PlcPos = input.Pos.ToString(),
- PosType = PLCDataTypeEnum.String,
- Text = "TaskNo"
+ PosType = PLCDataTypeEnum.Short,
+ StringLength = null,
+ Text = "PLC",
+ });
+ listPosition.Add(new WcsPosition()
+ {
+ DeviceId = modDevice.Id,
+ StationNum = modDevice.StationNum,
+ PlcPos = (input.Pos + 2).ToString(),
+ PosType = PLCDataTypeEnum.Short,
+ StringLength = null,
+ Text = "WCS",
});
listPosition.Add(new WcsPosition()
{
DeviceId = modDevice.Id,
StationNum = modDevice.StationNum,
PlcPos = (input.Pos + 4).ToString(),
- PosType = PLCDataTypeEnum.UShort,
- Text = "TaskType"
+ PosType = PLCDataTypeEnum.String,
+ StringLength = 8,
+ Text = "鎵樼洏鐮�",
});
listPosition.Add(new WcsPosition()
{
DeviceId = modDevice.Id,
StationNum = modDevice.StationNum,
- PlcPos = (input.Pos + 6).ToString(),
- PosType = PLCDataTypeEnum.UShort,
- Text = "StartLocatNo"
+ PlcPos = (input.Pos + 14).ToString(),
+ PosType = PLCDataTypeEnum.String,
+ StringLength = 15,
+ Text = "浠诲姟鍙�",
});
listPosition.Add(new WcsPosition()
{
DeviceId = modDevice.Id,
StationNum = modDevice.StationNum,
- PlcPos = (input.Pos + 8).ToString(),
- PosType = PLCDataTypeEnum.UShort,
- Text = "EndLocatNo"
+ PlcPos = (input.Pos + 32).ToString(),
+ PosType = PLCDataTypeEnum.Short,
+ StringLength = null,
+ Text = "浠诲姟绫诲瀷",
+ });
+ listPosition.Add(new WcsPosition()
+ {
+ DeviceId = modDevice.Id,
+ StationNum = modDevice.StationNum,
+ PlcPos = (input.Pos + 34).ToString(),
+ PosType = PLCDataTypeEnum.Short,
+ StringLength = null,
+ Text = "璧峰宸ヤ綅",
+ });
+ listPosition.Add(new WcsPosition()
+ {
+ DeviceId = modDevice.Id,
+ StationNum = modDevice.StationNum,
+ PlcPos = (input.Pos + 36).ToString(),
+ PosType = PLCDataTypeEnum.Short,
+ StringLength = null,
+ Text = "鐩殑宸ヤ綅",
+ });
+ listPosition.Add(new WcsPosition()
+ {
+ DeviceId = modDevice.Id,
+ StationNum = modDevice.StationNum,
+ PlcPos = (input.Pos + 38).ToString(),
+ PosType = PLCDataTypeEnum.Short,
+ StringLength = null,
+ Text = "璧峰鎺�",
+ });
+ listPosition.Add(new WcsPosition()
+ {
+ DeviceId = modDevice.Id,
+ StationNum = modDevice.StationNum,
+ PlcPos = (input.Pos + 40).ToString(),
+ PosType = PLCDataTypeEnum.Short,
+ StringLength = null,
+ Text = "璧峰鍒�",
+ });
+ listPosition.Add(new WcsPosition()
+ {
+ DeviceId = modDevice.Id,
+ StationNum = modDevice.StationNum,
+ PlcPos = (input.Pos + 42).ToString(),
+ PosType = PLCDataTypeEnum.Short,
+ StringLength = null,
+ Text = "璧峰灞�",
+ });
+ listPosition.Add(new WcsPosition()
+ {
+ DeviceId = modDevice.Id,
+ StationNum = modDevice.StationNum,
+ PlcPos = (input.Pos + 44).ToString(),
+ PosType = PLCDataTypeEnum.Short,
+ StringLength = null,
+ Text = "鐩殑鎺�",
+ });
+ listPosition.Add(new WcsPosition()
+ {
+ DeviceId = modDevice.Id,
+ StationNum = modDevice.StationNum,
+ PlcPos = (input.Pos + 46).ToString(),
+ PosType = PLCDataTypeEnum.Short,
+ StringLength = null,
+ Text = "鐩殑鍒�",
+ });
+ listPosition.Add(new WcsPosition()
+ {
+ DeviceId = modDevice.Id,
+ StationNum = modDevice.StationNum,
+ PlcPos = (input.Pos + 48).ToString(),
+ PosType = PLCDataTypeEnum.Short,
+ StringLength = null,
+ Text = "鐩殑灞�",
+ });
+ listPosition.Add(new WcsPosition()
+ {
+ DeviceId = modDevice.Id,
+ StationNum = modDevice.StationNum,
+ PlcPos = (input.Pos + 50).ToString(),
+ PosType = PLCDataTypeEnum.Short,
+ StringLength = null,
+ Text = "瀹為檯閲嶉噺",
+ });
+ listPosition.Add(new WcsPosition()
+ {
+ DeviceId = modDevice.Id,
+ StationNum = modDevice.StationNum,
+ PlcPos = (input.Pos + 52).ToString(),
+ PosType = PLCDataTypeEnum.Short,
+ StringLength = null,
+ Text = "Element_1",
});
await _wcsDeviceRep.Context.Insertable(listPosition).ExecuteCommandAsync();
}
+
/// <summary>
/// 鑾峰彇璁惧淇℃伅鍒楄〃
@@ -467,13 +571,13 @@
}
if (modDevice.Plc != null)
{
- var modPositionPLC = listPosition.FirstOrDefault(s => s.Text == "PLC娴佺▼瀛�");
+ var modPositionPLC = listPosition.FirstOrDefault(s => s.Text == "PLC");
if (modPositionPLC != null)
result = modUtil.SetPlcDBValue(modPositionPLC.PosType, modDbDevice.DbNumber, modPositionPLC.PlcPos, modDevice.Plc);
}
if (modDevice.Wcs != null)
{
- var modPositionWCS = listPosition.FirstOrDefault(s => s.Text == "WCS娴佺▼瀛�");
+ var modPositionWCS = listPosition.FirstOrDefault(s => s.Text == "WCS");
if (modPositionWCS != null)
result = modUtil.SetPlcDBValue(modPositionWCS.PosType, modDbDevice.DbNumber, modPositionWCS.PlcPos, modDevice.Wcs);
}
@@ -537,7 +641,7 @@
{
return await _wcsDeviceRep.Context.Queryable<WcsPlc>()
.Where(w => w.Type == PLCTypeEnum.RobotPalletizer || w.Type == PLCTypeEnum.StackingRobot)
- .OrderByDescending(o => o.Type)
+ .OrderBy(o => o.Type)
.Select(u => new
{
id = u.Id,
@@ -580,6 +684,8 @@
Status = task.Status,
PZNo = task.PZNo,
Qty = task.Qty,
+ BoxCount=task.BoxCount,
+ PalletNo=task.PalletNo,
PlcId=device.PlcId,
Type = plc.Type
--
Gitblit v1.8.0