schangxiang@126.com
2025-09-18 49a51c068d62084bc4c3e77c4be94a20de556c4a
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using wcftest.BussinessExtension.Common;
using wcftest.orm;
 
namespace wcftest.BussinessExtension.Handle
{
    /// <summary>
    /// 托盘处理类
    /// </summary>
    public class PlateCodeHandler
    {
        /// <summary>
        /// 验证托盘号是否可以组盘
        /// </summary>
        /// <param name="plateCode"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static bool ValiatePlateIsAllowZP(string plateCode, ref string msg)
        {
            using (dbModel mod = new dbModel())
            {
                var obj = mod.Base_Plate.Where(x => x.PlateCode == plateCode).FirstOrDefault();
                if (obj == null)
                {
                    msg = "托盘号" + plateCode + "不存在";
                    return false;
                }
                //如果该托盘在货架上,则报错
                var find_PositionName = SysGlole.PositionName_SHZCQ;
                var aa = mod.Base_ProductPosition.Where(x => x.PlateCode == plateCode && (x.PositionName != find_PositionName && x.PositionName != "")).FirstOrDefault();
                if (aa != null)
                {
                    msg = "托盘号" + plateCode + "在库位'" + aa.PositionName + "'上,不允许操作";
                    return false;
                }
            }
            return true;
        }
    }
}