kazelee
3 天以前 63e94e068622d4ef843cee0d19d4f2d231316304
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
 
using HH.WCS.Mobox3.DSZSH.models;
using HH.WCS.Mobox3.DSZSH.util;
 
using Newtonsoft.Json;
 
using static HH.WCS.Mobox3.DSZSH.api.ApiModel;
 
namespace HH.WCS.Mobox3.DSZSH.wms {
    /// <summary>
    /// [ 具体业务 ] 帮助类
    /// </summary>
    public class WMSHelper {
        /// <summary>
        /// 检查容器类型
        /// </summary>
        /// <param name="cntrCode"></param>
        /// <param name="cntrType"></param>
        /// <param name="cntr"></param>
        /// <returns></returns>
        public static (bool, string) CheckCntrType(string cntrCode, string cntrType, out TN_Container cntr) { 
            var db = new SqlHelper<object>().GetInstance();
 
            cntr = db.Queryable<TN_Container>().Where(c => c.S_CODE == cntrCode).First();
            if (cntr == null) {
                return (false, $"容器'{cntrCode}'在[容器表]中不存在,请在前台页面中维护!!");
            }
            if (cntr.S_TYPE != cntrType) {
                return (false, $"容器'{cntrCode}'在[容器表]中的类型为'{cntr.S_TYPE}',与当前流程所需容器类型'{cntrType}'不同!!");
            }
            return (true, "检查容器类型成功!!");
        }
    }
}