客户库存显示引入以件数为准;出库清关检测库存重复问题

dev
ZR20090193-陈敬勇 1 year ago
parent 79a99ebe8f
commit 311043aa97

@ -1,4 +1,5 @@
using Snowflake.Core;
using System.Collections;
namespace DS.Module.Core;
@ -59,4 +60,26 @@ public class GuidHelper
long id = worker.NextId();
return id.ToString();
}
/// <summary>
/// Hashtable 方法
/// </summary>
/// <param name="array"></param>
/// <returns></returns>
public static bool IsRepeat(string[] array)
{
Hashtable ht = new Hashtable();
for (int i = 0; i < array.Length; i++)
{
if (ht.Contains(array[i]))
{
return true;
}
else
{
ht.Add(array[i], array[i]);
}
}
return false;
}
}

@ -611,7 +611,7 @@ public class CommonService : ICommonService
{
var companyId = user.GetCompanyId();
var data = db.Queryable<VW_WmsNeedInfo>()
.Where(x => x.ClientId == companyId && x.STOREHOUSE == model.StoreHouse && x.STORAGEUNITCOUNT > 0 &&
.Where(x => x.ClientId == companyId && x.STOREHOUSE == model.StoreHouse && x.PKGS > 0 &&
x.PinYinCode.Contains(model.Code))
.Select<WmsNeedInfo>().ToList();
return DataResult.Successed("获取数据成功!", data);
@ -645,7 +645,7 @@ public class CommonService : ICommonService
},
true)
.MergeTable()
.Where(whereList).Where(a => a.ClientId == companyId && a.STORAGEUNITCOUNT >0).ToQueryPage(request.PageCondition);
.Where(whereList).Where(a => a.ClientId == companyId && a.PKGS >0).ToQueryPage(request.PageCondition);
return data;
}

@ -52,7 +52,7 @@ public class StoreQueryService : IStoreQueryService
true)
// .Select<WmsInPlanListViewModel>()
.MergeTable()
.Where(whereList).Where(a => a.ClientId == companyId && a.STORAGEUNITCOUNT > 0)
.Where(whereList).Where(a => a.ClientId == companyId && a.PKGS > 0)
.ToQueryPage(request.PageCondition);
return data;
}
@ -81,7 +81,7 @@ public class StoreQueryService : IStoreQueryService
true)
.GroupBy("a.CUSTOMERNAME,a.GoodsId,a.GOODSCODE,a.GOODSNAME,a.MBLNO,a.CNTRNO,a.ClientId,a.BILLTYPE,b.GOODSMODEL")
.Where(whereList).Where(a => a.ClientId == companyId && a.STORAGEUNITCOUNT > 0)
.Where(whereList).Where(a => a.ClientId == companyId && a.PKGS > 0)
.ToQueryPage(request.PageCondition);
return data;
}

@ -70,6 +70,16 @@ public class WmsClearanceService : IWmsClearanceService
public DataResult EditWmsClearanceInfo(WmsClearanceInput model)
{
var companyId = user.GetCompanyId();
//处理明细库存重复问题
if (model.List.Count() > 0)
{
var ids = model.List.Select(x => x.WMSPHYSICSID.ToString()).ToArray();
if (GuidHelper.IsRepeat(ids))
{
return DataResult.Failed("存在相同记录库存信息!");
}
}
if (model.WMSPLANID.ToString().IsNullOrEmpty())
{
// var exitInfo = db.Queryable<OP_WMS_OUT_PLAN>().Where(x => x.MBLNO == model.MBLNO && x.CONTRACTNO == model.CONTRACTNO && x.ClientId == companyId).First();
@ -245,6 +255,15 @@ public class WmsClearanceService : IWmsClearanceService
{
return DataResult.Failed("预约清关明细为空,不能提交!");
}
if (goods.Count() > 0)
{
var ids = goods.Select(x => x.WMSPHYSICSID.ToString()).ToArray();
if (GuidHelper.IsRepeat(ids))
{
return DataResult.Failed("存在相同记录库存信息!");
}
}
//更新状态为待审批
inPlan.AuditStatus = AuditStatus.Auditing.ToEnumInt();
@ -319,11 +338,14 @@ public class WmsClearanceService : IWmsClearanceService
var stocklist = db.Queryable<OP_WMS_PHYSICS>().Where(x => model.Ids.Contains(x.WMSPHYSICSID.ToString()))
.ToList();
if (stocklist.Any(x => x.STORAGEUNITCOUNT == 0))
if (stocklist.Any(x => x.PKGS == 0))
{
return DataResult.Failed("存在库存为0的信息!");
return DataResult.Failed("存在件数为0的信息!");
}
//if (stocklist.Any(x => x.STORAGEUNITCOUNT == 0))
//{
// return DataResult.Failed("存在库存为0的信息!");
//}
var storeHouse = stocklist.First().STOREHOUSE;

@ -65,6 +65,18 @@ public class WmsOutPlanService : IWmsOutPlanService
public DataResult EditWmsOutPlanInfo(WmsOutPlanInput model)
{
var companyId = user.GetCompanyId();
//处理明细库存重复问题
if (model.List.Count() > 0)
{
var ids = model.List.Select(x => x.WMSPHYSICSID.ToString()).ToArray();
if (GuidHelper.IsRepeat(ids))
{
return DataResult.Failed("存在相同记录库存信息!");
}
}
if (model.WMSPLANID.ToString().IsNullOrEmpty())
{
// var exitInfo = db.Queryable<OP_WMS_OUT_PLAN>().Where(x => x.MBLNO == model.MBLNO && x.CONTRACTNO == model.CONTRACTNO && x.ClientId == companyId).First();
@ -244,7 +256,15 @@ public class WmsOutPlanService : IWmsOutPlanService
{
return DataResult.Failed("出库计划明细为空,不能提交!");
}
if (goods.Count() > 0)
{
var ids = goods.Select(x => x.WMSPHYSICSID.ToString()).ToArray();
if (GuidHelper.IsRepeat(ids))
{
return DataResult.Failed("存在相同记录库存信息!");
}
}
//更新状态为待审批
inPlan.AuditStatus = AuditStatus.Auditing.ToEnumInt();
db.Updateable(inPlan).ExecuteCommand();
@ -316,10 +336,10 @@ public class WmsOutPlanService : IWmsOutPlanService
{
return DataResult.Failed("存在件数为0的信息!");
}
if (stocklist.Any(x=>x.STORAGEUNITCOUNT == 0))
{
return DataResult.Failed("存在库存为0的信息!");
}
//if (stocklist.Any(x=>x.STORAGEUNITCOUNT == 0))
//{
// return DataResult.Failed("存在库存为0的信息!");
//}
var storeHouse = stocklist.First().STOREHOUSE;
if (stocklist.Any(x=>x.STOREHOUSE != storeHouse))

@ -5704,3 +5704,24 @@
2023-08-22 16:14:36.7594 Info Adding target ColoredConsoleTarget(Name=console)
2023-08-22 16:14:36.8619 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config
2023-08-22 16:14:36.8846 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2023-08-22 16:43:12.8893 Info Message Template Auto Format enabled
2023-08-22 16:43:12.9313 Info Loading assembly: NLog.Web.AspNetCore
2023-08-22 16:43:13.1597 Info Adding target FileTarget(Name=allfile)
2023-08-22 16:43:13.1597 Info Adding target FileTarget(Name=ownFile-web)
2023-08-22 16:43:13.1944 Info Adding target ColoredConsoleTarget(Name=console)
2023-08-22 16:43:13.2718 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config
2023-08-22 16:43:13.2975 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2023-08-22 17:07:46.7401 Info Message Template Auto Format enabled
2023-08-22 17:07:46.7584 Info Loading assembly: NLog.Web.AspNetCore
2023-08-22 17:07:46.9891 Info Adding target FileTarget(Name=allfile)
2023-08-22 17:07:46.9891 Info Adding target FileTarget(Name=ownFile-web)
2023-08-22 17:07:47.0333 Info Adding target ColoredConsoleTarget(Name=console)
2023-08-22 17:07:47.1568 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config
2023-08-22 17:07:47.1854 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2023-08-22 17:53:05.5909 Info Message Template Auto Format enabled
2023-08-22 17:53:05.6042 Info Loading assembly: NLog.Web.AspNetCore
2023-08-22 17:53:05.7678 Info Adding target FileTarget(Name=allfile)
2023-08-22 17:53:05.7678 Info Adding target FileTarget(Name=ownFile-web)
2023-08-22 17:53:05.7979 Info Adding target ColoredConsoleTarget(Name=console)
2023-08-22 17:53:05.8548 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config
2023-08-22 17:53:05.8699 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile

Loading…
Cancel
Save