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;
|
}
|
|
|
|
|
|
}
|
}
|