From 11645f5f19cad36d938d0579941500a7d7d3a360 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期三, 04 九月 2024 11:28:38 +0800
Subject: [PATCH] 绑定分拣码垛设备数据;增加分拣任务实体

---
 Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs |   23 +++
 Web/src/views/device/sortPallet/index.vue                       |  190 +++++++++++++++----------------
 Web/src/api/wcs/wcsDevice.ts                                    |    9 +
 Admin.NET/WCS.Application/Entity/WcsCheckTask.cs                |  113 ++++++++++++++++++
 4 files changed, 238 insertions(+), 97 deletions(-)

diff --git a/Admin.NET/WCS.Application/Entity/WcsCheckTask.cs b/Admin.NET/WCS.Application/Entity/WcsCheckTask.cs
new file mode 100644
index 0000000..fff6418
--- /dev/null
+++ b/Admin.NET/WCS.Application/Entity/WcsCheckTask.cs
@@ -0,0 +1,113 @@
+锘�// Admin.NET 椤圭洰鐨勭増鏉冦�佸晢鏍囥�佷笓鍒╁拰鍏朵粬鐩稿叧鏉冨埄鍧囧彈鐩稿簲娉曞緥娉曡鐨勪繚鎶ゃ�備娇鐢ㄦ湰椤圭洰搴旈伒瀹堢浉鍏虫硶寰嬫硶瑙勫拰璁稿彲璇佺殑瑕佹眰銆�
+//
+// 鏈」鐩富瑕侀伒寰� MIT 璁稿彲璇佸拰 Apache 璁稿彲璇侊紙鐗堟湰 2.0锛夎繘琛屽垎鍙戝拰浣跨敤銆傝鍙瘉浣嶄簬婧愪唬鐮佹爲鏍圭洰褰曚腑鐨� LICENSE-MIT 鍜� LICENSE-APACHE 鏂囦欢銆�
+//
+// 涓嶅緱鍒╃敤鏈」鐩粠浜嬪嵄瀹冲浗瀹跺畨鍏ㄣ�佹壈涔辩ぞ浼氱З搴忋�佷镜鐘粬浜哄悎娉曟潈鐩婄瓑娉曞緥娉曡绂佹鐨勬椿鍔紒浠讳綍鍩轰簬鏈」鐩簩娆″紑鍙戣�屼骇鐢熺殑涓�鍒囨硶寰嬬籂绾峰拰璐d换锛屾垜浠笉鎵挎媴浠讳綍璐d换锛�
+
+using Admin.NET.Core;
+namespace WCS.Application.Entity;
+
+/// <summary>
+/// 鍒嗘嫞浠诲姟琛�
+/// </summary>
+[SugarTable("WCSCheckTask","鍒嗘嫞浠诲姟琛�")]
+[Tenant("1300000000001")]
+public class WcsCheckTask  : EntityBaseData
+{
+    /// <summary>
+    /// WMS涓嬪彂鍗曞彿
+    /// </summary>
+    [SugarColumn(ColumnName = "OrderNo", ColumnDescription = "WMS涓嬪彂鍗曞彿", Length = 20)]
+    public string? OrderNo { get; set; }
+    
+    /// <summary>
+    /// 鏈哄櫒浜虹紪鍙�
+    /// </summary>
+    [SugarColumn(ColumnName = "RoboatNo", ColumnDescription = "鏈哄櫒浜虹紪鍙�", Length = 5)]
+    public string? RoboatNo { get; set; }
+    
+    /// <summary>
+    /// 鍒嗘嫞绾跨紪鍙�
+    /// </summary>
+    [SugarColumn(ColumnName = "LineNO", ColumnDescription = "鍒嗘嫞绾跨紪鍙�", Length = 5)]
+    public string? LineNO { get; set; }
+    
+    /// <summary>
+    /// 鐮佺洏宸ヤ綅鍙�
+    /// </summary>
+    [SugarColumn(ColumnName = "Port", ColumnDescription = "鐮佺洏宸ヤ綅鍙�", Length = 5)]
+    public string? Port { get; set; }
+    
+    /// <summary>
+    /// 鐗╂枡缂栫爜
+    /// </summary>
+    [SugarColumn(ColumnName = "SkuNo", ColumnDescription = "鐗╂枡缂栫爜", Length = 20)]
+    public string? SkuNo { get; set; }
+    
+    /// <summary>
+    /// 瑙勬牸
+    /// </summary>
+    [SugarColumn(ColumnName = "BoxType", ColumnDescription = "瑙勬牸", Length = 20)]
+    public string? BoxType { get; set; }
+    
+    /// <summary>
+    /// 宸ヤ綅缁戝畾鐘舵��
+    /// </summary>
+    [SugarColumn(ColumnName = "Status", ColumnDescription = "宸ヤ綅缁戝畾鐘舵��", Length = 2)]
+    public string? Status { get; set; }
+    
+    /// <summary>
+    /// 鍝佺鍙�
+    /// </summary>
+    [SugarColumn(ColumnName = "PZNo", ColumnDescription = "鍝佺鍙�", Length = 10)]
+    public string? PZNo { get; set; }
+    
+    /// <summary>
+    /// 鎵樼洏鍙�
+    /// </summary>
+    [SugarColumn(ColumnName = "PalletNo", ColumnDescription = "鎵樼洏鍙�", Length = 20)]
+    public string? PalletNo { get; set; }
+    
+    /// <summary>
+    /// 鎻掔爜鏁伴噺
+    /// </summary>
+    [SugarColumn(ColumnName = "BoxInsert", ColumnDescription = "鎻掔爜鏁伴噺", Length = 20)]
+    public string? BoxInsert { get; set; }
+    
+    /// <summary>
+    /// 鎵樼洏涓婄鏁伴噺
+    /// </summary>
+    [SugarColumn(ColumnName = "BoxCount", ColumnDescription = "鎵樼洏涓婄鏁伴噺", Length = 20)]
+    public string? BoxCount { get; set; }
+    
+    /// <summary>
+    /// 鎬荤鏁�/璁″垝绠辨暟/棰勪及绠辨暟
+    /// </summary>
+    [SugarColumn(ColumnName = "Qty", ColumnDescription = "鎬荤鏁�/璁″垝绠辨暟/棰勪及绠辨暟")]
+    public int? Qty { get; set; }
+    
+    /// <summary>
+    /// 宸茬爜绠辨暟
+    /// </summary>
+    [SugarColumn(ColumnName = "FinishQty", ColumnDescription = "宸茬爜绠辨暟")]
+    public int? FinishQty { get; set; }
+    
+    /// <summary>
+    /// 缁戝畾鏃堕棿
+    /// </summary>
+    [SugarColumn(ColumnName = "BindTime", ColumnDescription = "缁戝畾鏃堕棿")]
+    public DateTime? BindTime { get; set; }
+    
+    /// <summary>
+    /// 缁戝畾浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "BindUser", ColumnDescription = "缁戝畾浜�")]
+    public int? BindUser { get; set; }
+    
+    /// <summary>
+    /// 鍒涘缓浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "CreateUser", ColumnDescription = "鍒涘缓浜�")]
+    public int? CreateUser { get; set; }
+    
+}
diff --git a/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs b/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs
index 8a5e853..7b91e7e 100644
--- a/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs
+++ b/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs
@@ -271,4 +271,27 @@
 
         return list;
     }
+
+    #region 鍒嗘嫞鐮佸灈
+    /// <summary>
+    /// 鑾峰彇鐮佸灈鏈哄櫒浜哄拰鎷嗗灈鏈哄櫒浜哄垪琛�
+    /// </summary>
+    /// <returns></returns>
+    [HttpGet]
+    [ApiDescriptionSettings(Name = "WcsPackPlcList")]
+    [DisplayName("鑾峰彇鐮佸灈鏈哄櫒浜哄拰鎷嗗灈鏈哄櫒浜哄垪琛�")]
+    public async Task<dynamic> WcsPackPlcList()
+    {
+        return await _wcsDeviceRep.Context.Queryable<WcsPlc>()
+                .Where(w => w.Type == PLCTypeEnum.RobotPalletizer || w.Type == PLCTypeEnum.StackingRobot)
+                .OrderBy(o => o.Type)
+                .Select(u => new
+                {
+                    id = u.Id,
+                    name = u.Text                    
+                }
+                ).ToListAsync();
+    }
+
+    #endregion
 }
diff --git a/Web/src/api/wcs/wcsDevice.ts b/Web/src/api/wcs/wcsDevice.ts
index f531fe1..a0f122f 100644
--- a/Web/src/api/wcs/wcsDevice.ts
+++ b/Web/src/api/wcs/wcsDevice.ts
@@ -8,6 +8,8 @@
   GetWcsPlcPlcIdDropdown = '/api/wcsDevice/WcsPlcPlcIdDropdown',
   GeneratePos = '/api/wcsDevice/GeneratePos',
   ListWcsDevice = '/api/wcsDevice/list',
+
+  GetWcsPackPlcList='/api/wcsDevice/WcsPackPlcList',
 }
 
 // 澧炲姞璁惧淇℃伅
@@ -67,4 +69,11 @@
 	request({
 	url: Api.ListWcsDevice,
 	method: 'get'
+	});
+
+
+export const GetWcsPackPlcList = () =>
+	request({
+	url: Api.GetWcsPackPlcList,
+	method: 'get'
 	});
\ No newline at end of file
diff --git a/Web/src/views/device/sortPallet/index.vue b/Web/src/views/device/sortPallet/index.vue
index 0ce1640..950d163 100644
--- a/Web/src/views/device/sortPallet/index.vue
+++ b/Web/src/views/device/sortPallet/index.vue
@@ -14,7 +14,7 @@
                     </el-button>
                 </div>  
             </el-row>
-            <el-row :span="2">
+            <el-row :span="1">
                 <div class="card-container">
                     <el-card class="other-box-card" v-for="deviceInfo in devicePointData" :key="deviceInfo.id">
                         <div slot="header" class="linefix">
@@ -73,100 +73,96 @@
     </el-container>    
 </template>
   
-  <script lang="ts" setup>
-    import { ref } from 'vue';
+<script lang="ts" setup>
+import { ref } from 'vue';
+import { GetWcsPackPlcList } from '/@/api/wcs/wcsDevice';
 
-    const deviceList=[
-        {
-            id: 1,
-            name: '1鍙锋満鍣ㄤ汉'
-        },
-        {
-            id: 2,
-            name: '2鍙锋満鍣ㄤ汉'
-        },
-        {
-            id: 3,
-            name: '3鍙锋満鍣ㄤ汉'
-        },
-    ];
+const deviceList=ref<any>([]);
 
-    const devicePointList=[
-        {
-          id: 1,
-          deviceId:1,
-          name: '1鍙锋満鍣ㄤ汉 1宸ヤ綅',
-          taskNumber: 'T000001',
-          taskType: '',
-          plc: '',
-          wcs: '',
-          status: 0
-        },
-        {
-          id: 2,
-          deviceId:1,
-          name: '1鍙锋満鍣ㄤ汉 2宸ヤ綅',
-          taskNumber: '',
-          taskType: '',
-          plc: '',
-          wcs: '',
-          status: 1
-        },
-        {
-          id: 3,
-          deviceId:1,
-          name: '1鍙锋満鍣ㄤ汉 3宸ヤ綅',
-          taskNumber: '',
-          taskType: '',
-          plc: '',
-          wcs: '',
-          status: 1
-        },
-        {
-          id: 4,
-          deviceId:2,
-          name: '2鍙锋満鍣ㄤ汉 1宸ヤ綅',
-          taskNumber: 'T000001',
-          taskType: '',
-          plc: '',
-          wcs: '',
-          status: 0
-        },
-        {
-          id: 5,
-          deviceId:2,
-          name: '2鍙锋満鍣ㄤ汉 2宸ヤ綅',
-          taskNumber: '',
-          taskType: '',
-          plc: '',
-          wcs: '',
-          status: 1
-        },
-        {
-          id: 6,
-          deviceId:3,
-          name: '3鍙锋満鍣ㄤ汉 1宸ヤ綅',
-          taskNumber: 'T000001',
-          taskType: '',
-          plc: '',
-          wcs: '',
-          status: 0
-        }
-    ];
+const devicePointList=[
+    {
+        id: 1,
+        deviceId:586494087331909,
+        name: '1鍙风爜鍨涙満鍣ㄤ汉 1宸ヤ綅',
+        taskNumber: 'T000001',
+        taskType: '',
+        plc: '',
+        wcs: '',
+        status: 0
+    },
+    {
+        id: 2,
+        deviceId:586494087331909,
+        name: '1鍙风爜鍨涙満鍣ㄤ汉 2宸ヤ綅',
+        taskNumber: '',
+        taskType: '',
+        plc: '',
+        wcs: '',
+        status: 1
+    },
+    {
+        id: 3,
+        deviceId:586494087331909,
+        name: '1鍙风爜鍨涙満鍣ㄤ汉 3宸ヤ綅',
+        taskNumber: '',
+        taskType: '',
+        plc: '',
+        wcs: '',
+        status: 1
+    },
+    {
+        id: 4,
+        deviceId:586494241939525,
+        name: '2鍙风爜鍨涙満鍣ㄤ汉 1宸ヤ綅',
+        taskNumber: 'T000001',
+        taskType: '',
+        plc: '',
+        wcs: '',
+        status: 0
+    },
+    {
+        id: 5,
+        deviceId:586494241939525,
+        name: '2鍙风爜鍨涙満鍣ㄤ汉 2宸ヤ綅',
+        taskNumber: '',
+        taskType: '',
+        plc: '',
+        wcs: '',
+        status: 1
+    },
+    {
+        id: 6,
+        deviceId:3,
+        name: '3鍙锋満鍣ㄤ汉 1宸ヤ綅',
+        taskNumber: 'T000001',
+        taskType: '',
+        plc: '',
+        wcs: '',
+        status: 0
+    }
+];
+
+let devicePointData = ref<any>([]);
+const selectedDeviceId=ref<any>();
+// 鏌ヨ鎿嶄綔
+const handleQuery = async () => {
+    var res = await GetWcsPackPlcList();
+    deviceList.value = res.data.result;
 
     //杈撻�佺嚎鏁版嵁
-    let devicePointFirst= devicePointList.filter(device => device.deviceId === deviceList[0].id)
-    let devicePointData = ref(devicePointFirst);
-    let selectedDeviceId = ref(deviceList[0].id);
+    selectedDeviceId.value = deviceList.value[0].id;
+    devicePointData.value= devicePointList.filter(device => device.deviceId === selectedDeviceId.value);
+};
+handleQuery();
 
-    //鍒囨崲灞傚钩闈�
-    function chooseDevice(id) {
-        selectedDeviceId.value = id;
-        devicePointData.value = devicePointList.filter(device => device.deviceId === id);
-    }
-  </script>
-  
-  <style scoped>
+//鍒囨崲
+function chooseDevice(id) {
+    selectedDeviceId.value = id;
+    devicePointData.value = devicePointList.filter(device => device.deviceId === id);
+}
+</script>
+
+<style scoped>
     .card-page {
         width: 100%;
         height: 50px;
@@ -181,13 +177,13 @@
         height: 30px;
     }
     .card-container {
-          display: grid;
-          grid-template-columns: repeat(6, 1fr);
-          gap: 10px;
+            display: grid;
+            grid-template-columns: repeat(6, 1fr);
+            gap: 10px;
     }
-    .other-box-card {
-          box-sizing: border-box;
-          background: linear-gradient(135deg, #66ccff, #3399ff);
+    .other-box-card {            
+            box-sizing: border-box;
+            background: linear-gradient(135deg, #66ccff, #3399ff);
     }
     .lineStatus{
         position: absolute;
@@ -226,5 +222,5 @@
     .device-status-1{
         background-color: red;
     }
-  </style>
+</style>
   
\ No newline at end of file

--
Gitblit v1.8.0