分支自 SuZhouGuanHong/TaiYuanTaiZhong

huanghongfeng
2024-06-26 2d5a73f505946e0101f0fdd06fc3f3a94794236d
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WebApi/Controllers/ReadplcController.cs
@@ -1,7 +1,13 @@
using Microsoft.AspNetCore.Mvc;
using OfficeOpenXml.Drawing.Chart;
using System;
using System.Collections.Generic;
using System.Linq;
using WIDESEA_Comm;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Core.Extensions;
using WIDESEA_Core.Utilities;
using WIDESEA_Entity.DomainModels;
using WIDESEA_WCS.IRepositories;
using WIDESEA_WCS.Repositories;
using WIDESEA_WMS.IRepositories;
@@ -13,6 +19,731 @@
    [ApiController]
    public class ReadplcController : Controller
    {
        #region PCS平面图
        public class SectionData    //静态参数
        {
            public int r_direction { get; set; }
            public bool r_machine_nr { get; set; }
            public int r_part_process { get; set; }
            public int r_part_status { get; set; }
            public string r_wheel_SN { get; set; }
            public int r_wheel_type { get; set; }
            public string stackerNo { get; set; }
            public string Name { get; set; }
            public int vk_state { get; set; }
        }
        #region è¾Šé“1
        [HttpPost("One_unit_plc")]
        public IActionResult One_unit_plc()
        {
            var DBIems = WheelDBItem.VK4WheelDBItem; //获取辊道,输送线信息
            var DBIems2 = VKDBItem.VK4DBItem;       //VK4状态信息对象集合
                                                    // VK4桁架机械手对象集合
            if (DBIems.Count == 0)
            {
                List<SectionData> DBIemss = new List<SectionData>();
                for (int i = 0; i < 32; i++)
                {
                    var seDataList = new SectionData
                    {
                        r_direction = 0,
                        r_machine_nr = false,
                        r_part_process = 1,
                        r_part_status = 0,
                        r_wheel_SN = "",
                        r_wheel_type = 3,
                        stackerNo = "4." + i.ToString(),
                    };
                    switch (i)
                    {
                        case 27:
                            seDataList.stackerNo = "机械手1";
                            break;
                        case 28:
                            seDataList.stackerNo = "10.11";
                            break;
                        case 29:
                            seDataList.stackerNo = "10.12";
                            break;
                        case 30:
                            seDataList.stackerNo = "10.5";
                            break;
                        case 31:
                            seDataList.stackerNo = "10.6";
                            break;
                        default:
                            break;
                    }
                    DBIemss.Add(seDataList);
                }
                List<WheelDBItem> convertedList = DBIemss.Select(sd => new WheelDBItem
                {
                    StackerNo = sd.stackerNo,
                }).ToList();
                DBIems = convertedList;
            }
            var Section_one = DBIems.Where(x => IsInRange(x.StackerNo, 4, 13, 4, 24)).ToList();
            var Section_two = DBIems.Where(x => IsInRange(x.StackerNo, 4, 11, 4, 12)).ToList();
            var Section_three = DBIems.Where(x => IsInRange(x.StackerNo, 4, 9, 4, 10)).ToList();
            var Section_four = DBIems.Where(x => IsInRange(x.StackerNo, 4, 1, 4, 8)).ToList();
            var Section_six = DBIems.Where(x => IsInRange(x.StackerNo, 10, 1, 10, 2)).ToList();   //10.1-10.2
            var Section_seven = DBIems.Where(x => IsInRange(x.StackerNo, 10, 3, 10, 4)).ToList(); //10.3-10.4
            var Section_eight = DBIems.Where(x => IsInRange(x.StackerNo, 10, 7, 10, 8)).ToList();     //10.7-10.8
            var Section_nine = DBIems.Where(x => IsInRange(x.StackerNo, 10, 9, 10, 10)).OrderByDescending(x => x.StackerNo).ToList();      //10.9-10.10
            #region
            var Section_five = DBIems
                .Where(x => IsInRange(x.StackerNo, 10, 5, 10, 6) || IsInRange(x.StackerNo, 10, 11, 10, 12))
                .Select(x => CreateSectionFiveItem(x))
                .ToList();
            #endregion
            //老机械手
            var Section_ten = DBIems.Where(x => x.StackerNo == "机械手1")
                .Select(x => CreateSectionFiveItem4(x, 1))
                .ToList();
            //新机械手(下料口位)
            var Section_twelve = DBIems.Where(x => x.StackerNo == "机械手1")
                .Select(x => new
                {
                    stackerNo = x.StackerNo,
                    r_wheel_SN = x.R_wheel_SN,
                    r_wheel_type = x.R_wheel_type,
                    r_part_status = x.R_part_status,
                    r_part_process = x.R_part_process,
                })
                .ToList();
            List<SectionData> sectDataList7 = new List<SectionData>();
            var seDataList7 = new SectionData
            {
                r_direction = 0,
                r_machine_nr = false,
                r_part_process = 1,         //读取车轮零件工艺
                r_part_status = 0,          //读取车轮零件状态
                r_wheel_SN = "2222",
                r_wheel_type = 3,       //读取车轮类型
                stackerNo = "10.12",
            };
            sectDataList7.Add(seDataList7);
            var Section_eleven = sectDataList7.ToList();
            var Section_thirteen = DBIems.Where(x => x.StackerNo == "4.11").ToList();   //视觉检测台
            var Section_fourteen = DBIems.Where(x => x.StackerNo == "4.12").ToList();   //视觉检测台
            var Section_fifteen = DBIems2.ToList();
            if (DBIems2.Count == 0)
            {
                List<SectionData> sectDataList1 = new List<SectionData>();
                var seDataList1 = new SectionData
                {
                    Name = "VK4",
                    vk_state = 0,
                };
                sectDataList1.Add(seDataList1);
                List<VKDBItem> convertedList = sectDataList1.Select(sd => new VKDBItem
                {
                    Name = sd.Name,
                }).ToList();
                Section_fifteen = convertedList;
            }
            var data = new
            {
                Section_one,
                Section_two,
                Section_three,
                Section_four,
                Section_five,
                Section_six,
                Section_seven,
                Section_eight,
                Section_nine,
                Section_ten,   //老机械手
                Section_eleven,   //涂油机
                Section_twelve,     //新机械手
                Section_thirteen,  //最左边
                Section_fourteen,  //第二个靠涂油机
                Section_fifteen     //VK4信息
            };
            return Ok(data);
        }
        private object CreateSectionFiveItem(WheelDBItem x)   //车床数据
        {
            var stackerToMachineMap = new Dictionary<string, string>
        {
            { "10.5", "Machine1" },
            { "10.6", "Machine2" },
            { "10.11", "Machine3" },
            { "10.12", "Machine4" }
        };
            var machineDataLookup = MachineDBItem.VK4MachineDBItem.Where(x => x.Name == "Machine1" || x.Name == "Machine2" || x.Name == "Machine3" || x.Name == "Machine4").ToDictionary(x => x.Name, x => x);       //VK4机床对象集合
            if (stackerToMachineMap.TryGetValue(x.StackerNo, out var machineName) && machineDataLookup.TryGetValue(machineName, out var machineData))
            {
                return new
                {
                    stackerNo = x.StackerNo,
                    r_wheel_SN = x.R_wheel_SN,
                    r_wheel_type = x.R_wheel_type,
                    r_part_status = x.R_part_status,
                    r_part_process = x.R_part_process,
                    c_machine_state = machineData.machine_state,
                };
            }
            else
            {
                return new
                {
                    stackerNo = x.StackerNo,
                    r_wheel_SN = x.R_wheel_SN,
                    r_wheel_type = x.R_wheel_type,
                    r_part_status = x.R_part_status,
                    r_part_process = x.R_part_process,
                    c_machine_state = 0,
                };
            }
        }
        [HttpGet("Four_unit_plc")]
        public IActionResult Four_unit_plc(string staname)
        {
            var data = MachineDBItem.VK4MachineDBItem.Where(x => x.Name == staname).ToList();
            return Ok(data);
        }
        #endregion
        #region å…±ç”¨æ–¹æ³•(辊道1-2)
        private object CreateSectionFiveItem4(WheelDBItem x, int k) //机械手数据
        {
            var DBIems3 = GantryDBItem.VK4GantryDBItem.Where(x => x.Name == "Gantry1").FirstOrDefault();
            if (k == 2)
            {
                DBIems3 = GantryDBItem.VK4GantryDBItem.Where(x => x.Name == "Gantry2").FirstOrDefault();
            }
            if (DBIems3 == null)
            {
                return new
                {
                    stackerNo = x.StackerNo,
                    r_wheel_SN = x.R_wheel_SN,
                    r_wheel_type = x.R_wheel_type,
                    r_part_status = x.R_part_status,
                    r_part_process = x.R_part_process,
                    g_name = false,
                    g_communication_IO = false,
                    g_drive_fault = false,
                    g_emergency_stop_portal = false,
                    g_gantry_state = false,
                    g_portal_fault = false,
                    g_power_on = false,
                    g_programm_running = false,
                    g_ready_for_auto_start = false,
                    g_ready_for_operate = false,
                    g_state_AUTO = false,
                    g_state_JOG = false,
                    g_state_MDA = false,
                };
            }
            else
            {
                return new
                {
                    stackerNo = x.StackerNo,
                    r_wheel_SN = x.R_wheel_SN,
                    r_wheel_type = x.R_wheel_type,
                    r_part_status = x.R_part_status,
                    r_part_process = x.R_part_process,
                    g_name = DBIems3.Name,
                    g_communication_IO = DBIems3.communication_IO,
                    g_drive_fault = DBIems3.drive_fault,
                    g_emergency_stop_portal = DBIems3.emergency_stop_portal,
                    g_gantry_state = DBIems3.gantry_state,
                    g_portal_fault = DBIems3.portal_fault,
                    g_power_on = DBIems3.power_on,
                    g_programm_running = DBIems3.programm_running,
                    g_ready_for_auto_start = DBIems3.ready_for_auto_start,
                    g_ready_for_operate = DBIems3.ready_for_operate,
                    g_state_AUTO = DBIems3.state_AUTO,
                    g_state_JOG = DBIems3.state_JOG,
                    g_state_MDA = DBIems3.state_MDA,
                };
            }
        }
        #endregion
        #region è¾Šé“2
        [HttpPost("Two_unit_plc")]
        public IActionResult Two_unit_plc()
        {
            var DBIems = WheelDBItem.VK4WheelDBItem;
            var DBIems3 = GantryDBItem.VK4GantryDBItem.Where(x => x.Name == "Gantry2").FirstOrDefault();
            if (DBIems.Count == 0)
            {
                List<SectionData> DBIemss = new List<SectionData>();
                for (int i = 0; i < 32; i++)
                {
                    var seDataList = new SectionData
                    {
                        r_direction = 0,
                        r_machine_nr = false,
                        r_part_process = 1,
                        r_part_status = 0,
                        r_wheel_SN = "",
                        r_wheel_type = 3,
                        stackerNo = "5." + i.ToString(),
                    };
                    switch (i)
                    {
                        case 27:
                            seDataList.stackerNo = "机械手2";
                            break;
                        case 28:
                            seDataList.stackerNo = "20.11";
                            break;
                        case 29:
                            seDataList.stackerNo = "20.12";
                            break;
                        case 30:
                            seDataList.stackerNo = "20.5";
                            break;
                        case 31:
                            seDataList.stackerNo = "20.6";
                            break;
                        default:
                            break;
                    }
                    DBIemss.Add(seDataList);
                }
                List<WheelDBItem> convertedList = DBIemss.Select(sd => new WheelDBItem
                {
                    StackerNo = sd.stackerNo,
                }).ToList();
                DBIems = convertedList;
            }
            List<SectionData> DataList2 = new List<SectionData>();
            var Section_one = DBIems.Where(x => IsInRange(x.StackerNo, 5, 13, 5, 24)).ToList();
            var Section_two = DBIems.Where(x => IsInRange(x.StackerNo, 5, 11, 5, 12)).ToList();
            var Section_three = DBIems.Where(x => IsInRange(x.StackerNo, 5, 9, 5, 10)).ToList();
            var Section_four = DBIems.Where(x => IsInRange(x.StackerNo, 5, 1, 5, 8)).ToList();
            #region
            //var Section_five = DBIems.Where(x => IsInRange(x.StackerNo, 20, 5, 20, 6) || IsInRange(x.StackerNo, 20, 11, 20, 12)).ToList();       //车间
            var Section_five = DBIems
                .Where(x => IsInRange(x.StackerNo, 20, 5, 20, 6) || IsInRange(x.StackerNo, 20, 11, 20, 12))
                .Select(x => CreateSectionFiveItem2(x))
                .ToList();
            #endregion
            var Section_six = DBIems.Where(x => IsInRange(x.StackerNo, 20, 1, 20, 2)).ToList();   //10.1-10.2
            var Section_seven = DBIems.Where(x => IsInRange(x.StackerNo, 20, 3, 20, 4)).ToList(); //10.3-10.4
            var Section_eight = DBIems.Where(x => IsInRange(x.StackerNo, 20, 7, 20, 8)).ToList();     //10.7-10.8
            var Section_nine = DBIems.Where(x => IsInRange(x.StackerNo, 20, 9, 20, 10)).OrderByDescending(x => x.StackerNo).ToList();      //10.9-10.10
            //老机械手(机床位)
            var Section_ten = DBIems.Where(x => x.StackerNo == "机械手2")
               .Select(x => CreateSectionFiveItem4(x, 2))
                .ToList();
            var Section_twelve = DBIems.Where(x => x.StackerNo == "机械手2").ToList();      //新机械手(下料口位)
            List<SectionData> sectDataList7 = new List<SectionData>();
            var seDataList7 = new SectionData
            {
                r_direction = 0,
                r_machine_nr = false,
                r_part_process = 1,         //读取车轮零件工艺
                r_part_status = 0,          //读取车轮零件状态
                r_wheel_SN = "2222",
                r_wheel_type = 3,       //读取车轮类型
                stackerNo = "20.12",
            };
            sectDataList7.Add(seDataList7);
            var Section_eleven = sectDataList7.ToList();        //涂油机
            var Section_thirteen = DBIems.Where(x => x.StackerNo == "5.11").ToList();   //视觉检测台
            var Section_fourteen = DBIems.Where(x => x.StackerNo == "5.12").ToList();   //视觉检测台
            var data = new
            {
                Section_one,
                Section_two,
                Section_three,
                Section_four,
                Section_five,
                Section_six,
                Section_seven,
                Section_eight,
                Section_nine,
                Section_ten,
                Section_eleven,
                Section_twelve,
                Section_thirteen,
                Section_fourteen
            };
            return Ok(data);
        }
        private object CreateSectionFiveItem2(WheelDBItem x)
        {
            var stackerToMachineMap = new Dictionary<string, string>
        {
            { "20.5", "Machine5" },
            { "20.6", "Machine6" },
            { "20.11", "Machine7" },
            { "20.12", "Machine8" }
        };
            var machineDataLookup = MachineDBItem.VK4MachineDBItem.Where(x => x.Name == "Machine5" || x.Name == "Machine6" || x.Name == "Machine7" || x.Name == "Machine8").ToDictionary(x => x.Name, x => x);       //VK4机床对象集合
            if (stackerToMachineMap.TryGetValue(x.StackerNo, out var machineName) && machineDataLookup.TryGetValue(machineName, out var machineData))
            {
                return new
                {
                    stackerNo = x.StackerNo,
                    r_wheel_SN = x.R_wheel_SN,
                    r_wheel_type = x.R_wheel_type,
                    r_part_status = x.R_part_status,
                    r_part_process = x.R_part_process,
                    c_machine_state = machineData.machine_state,
                };
            }
            else
            {
                return new
                {
                    stackerNo = x.StackerNo,
                    r_wheel_SN = x.R_wheel_SN,
                    r_wheel_type = x.R_wheel_type,
                    r_part_status = x.R_part_status,
                    r_part_process = x.R_part_process,
                    c_machine_state = 0,
                };
            }
        }
        [HttpGet("Four_unit_plc2")]
        public IActionResult Four_unit_plc2(string staname)
        {
            var data = MachineDBItem.VK4MachineDBItem.Where(x => x.Name == staname).ToList();
            return Ok(data);
        }
        #endregion
        #region è¾Šé“3
        [HttpPost("Three_unit_plc")]
        public IActionResult Three_unit_plc()
        {
            var DBIems = WheelDBItem.VK5WheelDBItem;
            var DBIems2 = VKDBItem.VK5DBItem;       //VK4状态信息对象集合
            if (DBIems.Count == 0)
            {
                List<SectionData> DBIemss = new List<SectionData>();
                for (int i = 0; i < 31; i++)
                {
                    var seDataList = new SectionData
                    {
                        r_direction = 0,
                        r_machine_nr = false,
                        r_part_process = 0,
                        r_part_status = 0,
                        r_wheel_SN = "",
                        r_wheel_type = 0,
                        stackerNo = "6." + i.ToString(),
                    };
                    switch (i)
                    {
                        case 25:
                            seDataList.stackerNo = "7.21";
                            break;
                        case 26:
                            seDataList.stackerNo = "30.9";
                            break;
                        case 27:
                            seDataList.stackerNo = "30.10";
                            break;
                        case 28:
                            seDataList.stackerNo = "30.4";
                            break;
                        case 29:
                            seDataList.stackerNo = "30.5";
                            break;
                        case 30:
                            seDataList.stackerNo = "机械手3";
                            break;
                        default:
                            break;
                    }
                    DBIemss.Add(seDataList);
                }
                List<WheelDBItem> convertedList = DBIemss.Select(sd => new WheelDBItem
                {
                    StackerNo = sd.stackerNo,
                }).ToList();
                DBIems = convertedList;
            }
            var Section_one = DBIems.Where(x => IsInRange(x.StackerNo, 6, 13, 6, 20) || x.StackerNo == "6.24" || x.StackerNo == "7.21").ToList();
            var Section_two = DBIems.Where(x => IsInRange(x.StackerNo, 6, 11, 6, 12)).ToList();
            var Section_three = DBIems.Where(x => IsInRange(x.StackerNo, 6, 9, 6, 10)).ToList();
            var Section_four = DBIems.Where(x => IsInRange(x.StackerNo, 6, 1, 6, 8)).ToList();
            var Section_thirteen = DBIems.Where(x => IsInRange(x.StackerNo, 6, 21, 6, 23)).ToList();
            //车间
            #region
            //var Section_five = DBIems.Where(x => IsInRange(x.StackerNo, 30, 4, 30, 5) || IsInRange(x.StackerNo, 30, 9, 30, 10)).ToList();       //车间
            var Section_five = DBIems
                .Where(x => IsInRange(x.StackerNo, 30, 4, 30, 5) || IsInRange(x.StackerNo, 30, 9, 30, 10))
                .Select(x => CreateSectionFiveItem3(x))
                .ToList();
            #endregion
            var Section_six = DBIems.Where(x => x.StackerNo == "30.1").ToList();   //30.7
            var Section_seven = DBIems.Where(x => IsInRange(x.StackerNo, 30, 2, 30, 3)).ToList(); //30.2-30.3
            var Section_eight = DBIems.Where(x => x.StackerNo == "30.6").ToList();     //30.6
            var Section_nine = DBIems.Where(x => IsInRange(x.StackerNo, 30, 7, 30, 8)).ToList();      //30.7-30.8
            //老机械手(机床位)
            var Section_ten = DBIems.Where(x => x.StackerNo == "机械手3")
               .Select(x => CreateSectionFiveItem4(x))
                .ToList();
            var Section_twelve = DBIems.Where(x => x.StackerNo == "机械手3").ToList();      //新机械手(下料口位)
            List<SectionData> sectDataList7 = new List<SectionData>();
            var seDataList7 = new SectionData
            {
                r_direction = 0,
                r_machine_nr = false,
                r_part_process = 1,         //读取车轮零件工艺
                r_part_status = 0,          //读取车轮零件状态
                r_wheel_SN = "",
                r_wheel_type = 3,       //读取车轮类型
                stackerNo = "30.12",
            };
            sectDataList7.Add(seDataList7);
            var Section_eleven = sectDataList7.ToList();  //涂油机
            var Section_fifteen = DBIems2.ToList();
            if (DBIems2.Count == 0)
            {
                List<SectionData> sectDataList1 = new List<SectionData>();
                var seDataList1 = new SectionData
                {
                    Name = "VK5",
                    vk_state = 0,
                };
                sectDataList1.Add(seDataList1);
                List<VKDBItem> convertedList = sectDataList1.Select(sd => new VKDBItem
                {
                    Name = sd.Name,
                }).ToList();
                Section_fifteen = convertedList;
            }
            var data = new
            {
                Section_one,
                Section_two,
                Section_three,
                Section_four,
                Section_five,
                Section_six,
                Section_seven,
                Section_eight,
                Section_nine,
                Section_ten,
                Section_eleven,
                Section_twelve,
                Section_thirteen,
                Section_fifteen
            };
            return Ok(data);
        }
        private object CreateSectionFiveItem3(WheelDBItem x)
        {
            var stackerToMachineMap = new Dictionary<string, string>
        {
            { "30.4", "Machine9" },
            { "30.5", "Machine10" },
            { "30.9", "Machine11" },
            { "30.10", "Machine12" }
        };
            var machineDataLookup = MachineDBItem.VK5MachineDBItem.Where(x => x.Name == "Machine9" || x.Name == "Machine10" || x.Name == "Machine11" || x.Name == "Machine12").ToDictionary(x => x.Name, x => x);       //VK4机床对象集合
            if (stackerToMachineMap.TryGetValue(x.StackerNo, out var machineName) && machineDataLookup.TryGetValue(machineName, out var machineData))
            {
                return new
                {
                    stackerNo = x.StackerNo,
                    r_wheel_SN = x.R_wheel_SN,
                    r_wheel_type = x.R_wheel_type,
                    r_part_status = x.R_part_status,
                    r_part_process = x.R_part_process,
                    c_machine_state = machineData.machine_state,
                };
            }
            else
            {
                return new
                {
                    stackerNo = x.StackerNo,
                    r_wheel_SN = x.R_wheel_SN,
                    r_wheel_type = x.R_wheel_type,
                    r_part_status = x.R_part_status,
                    r_part_process = x.R_part_process,
                    c_machine_state = 0
                };
            }
        }
        private object CreateSectionFiveItem4(WheelDBItem x) //机械手数据
        {
            var DBIems3 = GantryDBItem.VK5GantryDBItem.Where(x => x.Name == "Gantry3").FirstOrDefault();
            if (DBIems3 == null)
            {
                return new
                {
                    stackerNo = x.StackerNo,
                    r_wheel_SN = x.R_wheel_SN,
                    r_wheel_type = x.R_wheel_type,
                    r_part_status = x.R_part_status,
                    r_part_process = x.R_part_process,
                    g_name = false,
                    g_communication_IO = false,
                    g_drive_fault = false,
                    g_emergency_stop_portal = false,
                    g_gantry_state = false,
                    g_portal_fault = false,
                    g_power_on = false,
                    g_programm_running = false,
                    g_ready_for_auto_start = false,
                    g_ready_for_operate = false,
                    g_state_AUTO = false,
                    g_state_JOG = false,
                    g_state_MDA = false,
                };
            }
            else
            {
                return new
                {
                    stackerNo = x.StackerNo,
                    r_wheel_SN = x.R_wheel_SN,
                    r_wheel_type = x.R_wheel_type,
                    r_part_status = x.R_part_status,
                    r_part_process = x.R_part_process,
                    g_name = DBIems3.Name,
                    g_communication_IO = DBIems3.communication_IO,
                    g_drive_fault = DBIems3.drive_fault,
                    g_emergency_stop_portal = DBIems3.emergency_stop_portal,
                    g_gantry_state = DBIems3.gantry_state,
                    g_portal_fault = DBIems3.portal_fault,
                    g_power_on = DBIems3.power_on,
                    g_programm_running = DBIems3.programm_running,
                    g_ready_for_auto_start = DBIems3.ready_for_auto_start,
                    g_ready_for_operate = DBIems3.ready_for_operate,
                    g_state_AUTO = DBIems3.state_AUTO,
                    g_state_JOG = DBIems3.state_JOG,
                    g_state_MDA = DBIems3.state_MDA,
                };
            }
        }
        [HttpGet("Four_unit_plc3")]
        public IActionResult Four_unit_plc3(string staname)
        {
            var data = MachineDBItem.VK5MachineDBItem.Where(x => x.Name == staname).ToList();
            return Ok(data);
        }
        #endregion
        // è¾…助方法:检查给定的 stackerNo æ˜¯å¦åœ¨æŒ‡å®šçš„范围内
        private bool IsInRange(string stackerNo, int startRow, int startColumn, int endRow, int endColumn)
        {
            string[] parts = stackerNo.Split('.');
            if (parts.Length != 2)
                return false;
            if (!int.TryParse(parts[0], out int row) || !int.TryParse(parts[1], out int column))
                return false;
            return row == startRow && column >= startColumn && row == endRow && column <= endColumn;
        }
        #endregion
        #region  ç¬¬äº”板块(新增内容)
        /// <summary>
        /// å·¥å•信息VV_Workinfo
@@ -25,7 +756,8 @@
            Idt_mes_headRepository db = new dt_mes_headRepository(volContext);
            Idt_mes_detailRepository dbs = new dt_mes_detailRepository(volContext);
            var data = db.Find(_ => true).Where(x => x.processCode == "28").OrderByDescending(x => x.CreateTime).Take(10).ToList();
            var dataList = data.Select(x => new {
            var dataList = data.Select(x => new
            {
                jobID = x.jobID,
                drawingNo = x.drawingNo,
                quantity = x.quantity,
@@ -34,5 +766,39 @@
            return Ok(dataList);
        }
        #endregion
        [HttpPost("dt_stationinfolist")]
        public WebResponseContent dt_stationinfolist()
        {
            WebResponseContent content = new WebResponseContent();
            VOLContext volContext = new VOLContext();
            Idt_stationinfoRepository dsta = new dt_stationinfoRepository(volContext);
            string[] stationCodes = { "W", "A", "B", "C", "D01" };
            List<Tuple<List<dt_stationinfo>, int>> responseData = new List<Tuple<List<dt_stationinfo>, int>>();
            foreach (string code in stationCodes)
            {
                var data = dsta.Find(_ => true).Where(a => a.stationCode.Contains(code)).OrderBy(a => a.stationCode).ToList();
                int inst = dsta.Find(_ => true).Where(a => a.stationCode.Contains(code)).GroupBy(a => a.line).Count();
                responseData.Add(Tuple.Create(data, inst));
            }
            content.Data = responseData;
            return content;
        }
        [HttpPost("pcs_dt_stationinfolist")]
        public WebResponseContent pcs_dt_stationinfolist()
        {
            WebResponseContent content = new WebResponseContent();
            VOLContext volContext = new VOLContext();
            Idt_stationinfoRepository dsta = new dt_stationinfoRepository(volContext);
            string[] stationCodes = { "X01", "X02", "X03", "S", "DD001" };
            List<Tuple<List<dt_stationinfo>>> responseData = new List<Tuple<List<dt_stationinfo>>>();
            foreach (string code in stationCodes)
            {
                var data = dsta.Find(_ => true).Where(a => a.stationCode.Contains(code)).OrderBy(a => a.stationCode).ToList();
                responseData.Add(Tuple.Create(data));
            }
            content.Data = responseData;
            return content;
        }
    }
}