1
huanghongfeng
2025-09-12 a1a0c91857b670152ec7d4afa7bc4140953a5e98
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
using StackExchange.Profiling.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_DTO.Enum;
using WIDESEAWCS_ISystemRepository;
using WIDESEAWCS_ISystemServices;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_Model.Models.System;
 
namespace WIDESEAWCS_SystemServices
{
 
    public class PlatformStationService : ServiceBase<PlatformStation, IPlatformStationRepository>, IPlatformStationService
    {
        public PlatformStationService(IPlatformStationRepository BaseDal) : base(BaseDal)
        {
 
        }
 
        /// <summary>
        /// 获取入库站台信息
        /// </summary>
        /// <param name="deviceNo"></param>
        /// <returns></returns>
        public string GetSCName(string deviceNo)
        {
            return BaseDal.QueryFirst(x => x.Station_code.Contains(deviceNo) && x.Station_material == (int)PlatformStationEnum.PadRecycle && x.Station_enable == 1).Station_code;
        }
 
        /// <summary>
        /// 获取堆垛机取货站台信息
        /// </summary>
        /// <param name="deviceNo"></param>
        /// <returns></returns>
        public List<PlatformStation> GetPlatformList(string deviceNo)
        {
            return BaseDal.QueryData(x => x.ChildPosiDeviceCode.Contains(deviceNo) && x.Station_enable == 1 && (x.Station_material == (int)PlatformStationEnum.PadRecycle || x.Station_material == (int)PlatformStationEnum.BoardStore || x.Station_material == (int)PlatformStationEnum.EmptyRecycle)).ToList();
        }
 
        /// <summary>
        /// 获取该库位站台类型
        /// </summary>
        /// <param name="deviceNo"></param>
        /// <returns></returns>
        public PlatformStation GetPlatInList(int deviceNo)
        {
            return BaseDal.QueryFirst(x => x.Station_code== deviceNo.ToString());
        }
 
        public string GetSCAdder(int deviceNo,int coty)
        {
            if (coty == 1)
            {
                return BaseDal.QueryFirst(x => x.Station_code == deviceNo.ToString()).Station_storey;
            }
            else
            {
                return BaseDal.QueryFirst(x => x.ChildPosiDeviceCode.Contains(deviceNo.ToString())).Station_storey;
            }
        }
 
        public PlatformStation GetPlatInData()
        {
            return BaseDal.QueryFirst(x => x.Station_material == (int)PlatformStationEnum.PadUse);
        }
 
        /// <summary>
        /// 获取堆垛机出库站台编号
        /// </summary>
        /// <param name="deviceNo"></param>
        /// <returns></returns>
        public string GetOutSCName(string Station_storey)
        {
            return BaseDal.QueryFirst(x => x.ChildPosiDeviceCode.Contains(Station_storey) && x.Station_material == (int)PlatformStationEnum.MaintenanceoutStore && x.Station_enable == 1).Station_code;
 
        }
 
        //*****************************************************************************************************
 
        /// <summary>
        /// 获取RGV入库站台编号
        /// </summary>
        /// <param name="deviceNo"></param>
        /// <returns></returns>
        public List<string> GetPlatform(string deviceNo)
        {
            return BaseDal.QueryData(x => x.ChildPosiDeviceCode.Contains(deviceNo) && x.Station_enable == 1 && (x.Station_material == (int)PlatformStationEnum.BoardStore)).Select(x => x.Station_code).ToList();
        }
 
        /// <summary>
        /// 获取RGV出库站台编号
        /// </summary>
        /// <param name="deviceNo"></param>
        /// <returns></returns>
        public List<string> GetPlatform2(string deviceNo)
        {
            return BaseDal.QueryData(x => x.ChildPosiDeviceCode.Contains(deviceNo) && x.Station_enable == 1 && x.Station_material == (int)PlatformStationEnum.PadUse).Select(x => x.Station_code).ToList();
        }
        public List<string> GetPlatform3(string deviceNo)
        {
            return BaseDal.QueryData(x => x.ChildPosiDeviceCode.Contains(deviceNo) && x.Station_enable == 1 && (x.Station_material == (int)PlatformStationEnum.BoardUnload || x.Station_material == (int)PlatformStationEnum.BoardStore)).Select(x => x.Station_code).ToList();
        }
        
 
 
        /// <summary>
        /// 获取出库站台信息,更新出库口
        /// </summary>
        /// <param name="deviceNo"></param>
        /// <returns></returns>
        public List<PlatformStation> GetPlatformOutList(string deviceNo)
        {
            return BaseDal.QueryData(x => x.ChildPosiDeviceCode.Contains(deviceNo) && x.Station_enable == 1 && x.Station_material == (int)PlatformStationEnum.BoardUnload).ToList();
        }
 
        
 
        
 
        /// <summary>
        /// 获取堆垛机入库站台编号
        /// </summary>
        /// <param name="deviceNo"></param>
        /// <returns></returns>
        public List<string> GetPlatIn(string deviceNo)
        {
            return BaseDal.QueryData(x => x.ChildPosiDeviceCode.Contains(deviceNo) && x.Station_enable == 1 && x.Station_material == (int)PlatformStationEnum.PadRecycle).Select(x => x.Station_code).ToList();
        }
    }
}