schangxiang@126.com
2025-09-17 ff43ddf18764629ff875478e4e47a7281cbd230a
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
using Admin.NET.Core.TaskModule.Enum;
using iWareSql.MyDbContext;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace iWareCC.Common.Helper
{
    public class BusinessTypeHelper
    {
        /// <summary>
        ///  检查是否是下架业务
        /// </summary>
        /// <param name="businessTypeEnum"></param>
        /// <returns></returns>
        public static bool CheckIsXJOrder(int businessType, MyDbContext mycontext)
        {
 
            var wmsBusinessType = GetBusinessTypeInfoFromDB(businessType, mycontext);
 
            if (wmsBusinessType.UpDownShelvesType == (int)UpDownShelvesTypeEnum.下架)
            {
                return true;
            }
            return false;
        }
 
        /// <summary>
        /// 检查是否是上架业务
        /// </summary>
        /// <param name="businessTypeEnum"></param>
        /// <returns></returns>
        public static bool CheckIsSJOrder(int  businessType, MyDbContext mycontext)
        {
            var wmsBusinessType = GetBusinessTypeInfoFromDB(businessType, mycontext);
 
            if (wmsBusinessType.UpDownShelvesType == (int)UpDownShelvesTypeEnum.上架)
            {
                return true;
            }
            return false;
        }
        /// <summary>
        /// 根据业务类型值获取 业务类型信息
        /// </summary>
        /// <param name="businessType"></param>
        /// <param name="_wmsBusinessTypeRep"></param>
        /// <returns></returns>
        public static wms_base_business_type GetBusinessTypeInfoFromDB(int businessType, MyDbContext mycontext)
        {
 
            var wmsBusinessType = mycontext.wms_base_business_type.FirstOrDefault(x => x.BusinessTypeValue == businessType);
            //如果业务类型为空
            if (wmsBusinessType == null) throw new Exception($"业务类型值{businessType}不存在");
            return wmsBusinessType;
        }
 
 
 
 
 
    }
}