wxw
2024-09-04 11645f5f19cad36d938d0579941500a7d7d3a360
绑定分拣码垛设备数据;增加分拣任务实体
3个文件已修改
1个文件已添加
335 ■■■■ 已修改文件
Admin.NET/WCS.Application/Entity/WcsCheckTask.cs 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Web/src/api/wcs/wcsDevice.ts 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Web/src/views/device/sortPallet/index.vue 190 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Admin.NET/WCS.Application/Entity/WcsCheckTask.cs
New file
@@ -0,0 +1,113 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
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; }
}
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
}
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'
    });
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>