diff --git a/ZR.Model/MES/wms/Dto/WmGoodsOutProductionDto.cs b/ZR.Model/MES/wms/Dto/WmGoodsOutProductionDto.cs
index a12160a8..0af3eaa2 100644
--- a/ZR.Model/MES/wms/Dto/WmGoodsOutProductionDto.cs
+++ b/ZR.Model/MES/wms/Dto/WmGoodsOutProductionDto.cs
@@ -25,6 +25,8 @@ namespace ZR.Model.MES.wms.Dto
public string Partnumber { get; set; }
+ public string Description { get; set; }
+
public int? GoodsNumLogic { get; set; }
public int? GoodsNumAction { get; set; }
@@ -69,6 +71,8 @@ namespace ZR.Model.MES.wms.Dto
public string Partnumber { get; set; }
+ public string Description { get; set; }
+
public int? GoodsNumLogic { get; set; }
public int? GoodsNumAction { get; set; }
diff --git a/ZR.Model/MES/wms/Dto/WmOutOrderDto.cs b/ZR.Model/MES/wms/Dto/WmOutOrderDto.cs
index 981312d1..edb92ee7 100644
--- a/ZR.Model/MES/wms/Dto/WmOutOrderDto.cs
+++ b/ZR.Model/MES/wms/Dto/WmOutOrderDto.cs
@@ -7,6 +7,14 @@ namespace ZR.Model.MES.wms.Dto
///
public class WmOutOrderQueryDto : PagerInfo
{
+ public string ShipmentNum { get; set; }
+ public int? Year { get; set; }
+
+ public int? Week { get; set; }
+
+ public int? Date { get; set; }
+
+ public string CustomNo { get; set; }
}
///
diff --git a/ZR.Service/mes/wms/IService/IWmGoodsOutProductionService.cs b/ZR.Service/mes/wms/IService/IWmGoodsOutProductionService.cs
index e64c0d81..eb907056 100644
--- a/ZR.Service/mes/wms/IService/IWmGoodsOutProductionService.cs
+++ b/ZR.Service/mes/wms/IService/IWmGoodsOutProductionService.cs
@@ -12,7 +12,7 @@ namespace ZR.Service.mes.wms.IService
///
public interface IWmGoodsOutProductionService : IBaseService
{
- PagedInfo GetList(WmGoodsOutProductionQueryDto parm);
+ (List, int) GetList(WmGoodsOutProductionQueryDto parm);
WmGoodsOutRecord GetInfo(string Id);
diff --git a/ZR.Service/mes/wms/WmGoodsOutProductionService.cs b/ZR.Service/mes/wms/WmGoodsOutProductionService.cs
index ffe0c5b3..1301ff7c 100644
--- a/ZR.Service/mes/wms/WmGoodsOutProductionService.cs
+++ b/ZR.Service/mes/wms/WmGoodsOutProductionService.cs
@@ -10,6 +10,7 @@ using System.Linq;
using ZR.Service.mes.wms.IService;
using ZR.Model.MES.wms;
using ZR.Model.MES.wms.Dto;
+using static System.Runtime.InteropServices.JavaScript.JSType;
namespace ZR.Service.mes.wms
{
@@ -24,8 +25,9 @@ namespace ZR.Service.mes.wms
///
///
///
- public PagedInfo GetList(WmGoodsOutProductionQueryDto parm)
+ public (List,int) GetList(WmGoodsOutProductionQueryDto parm)
{
+ int total = 0;
var predicate = Expressionable.Create()
.AndIF(!string.IsNullOrEmpty(parm.Partnumber),it=>it.Partnumber.Contains(parm.Partnumber))
.AndIF(!string.IsNullOrEmpty(parm.PackageCodeClient),it=>it.PackageCodeClient.Contains(parm.PackageCodeClient))
@@ -34,10 +36,12 @@ namespace ZR.Service.mes.wms
;
var response = Queryable()
+ .LeftJoin((wgo, wml) => wgo.Partnumber == wml.Partnumber)
.Where(predicate.ToExpression())
- .ToPage(parm);
-
- return response;
+ .Select((wgo, wml) => new WmGoodsOutProductionDto { Description = wml.Description }, true)
+ .ToPageList(parm.PageNum, parm.PageSize,ref total);
+
+ return (response,total);
}
@@ -62,10 +66,23 @@ namespace ZR.Service.mes.wms
///
public WmGoodsOutRecord AddWmGoodsOutProduction(WmGoodsOutRecord model)
{
+ if(string.IsNullOrEmpty(model.PackageCode))
+ {
+ model.PackageCode = "L" + DateTime.Now.ToString("yyMMddHHmmss");
+ }
if (string.IsNullOrEmpty(model.Id))
{
model.Id= SnowFlakeSingle.Instance.NextId().ToString();//也可以在程序中直接获取ID
}
+ //2. 根据成品仓库id修改记录
+ WmGoodsNowProduction updateModel = new WmGoodsNowProduction();
+ updateModel.Id = model.FkNowProductionId;
+ updateModel.GoodsNumAction = model.GoodsNumLogic - model.GoodsNumAction;
+ if (updateModel.GoodsNumAction <= 0)
+ {
+ updateModel.GoodsNumAction = 0;
+ }
+ Context.Updateable(updateModel).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return Context.Insertable(model).ExecuteReturnEntity();
}
diff --git a/ZR.Service/mes/wms/WmOutOrderService.cs b/ZR.Service/mes/wms/WmOutOrderService.cs
index 2bebd353..35a4af52 100644
--- a/ZR.Service/mes/wms/WmOutOrderService.cs
+++ b/ZR.Service/mes/wms/WmOutOrderService.cs
@@ -29,8 +29,13 @@ namespace ZR.Service.mes.wms
///
public PagedInfo GetList(WmOutOrderQueryDto parm)
{
- var predicate = Expressionable.Create();
-
+ var predicate = Expressionable.Create()
+ .AndIF(!string.IsNullOrEmpty(parm.ShipmentNum), it => it.ShipmentNum.Contains(parm.ShipmentNum))
+ .AndIF(!string.IsNullOrEmpty(parm.CustomNo), it => it.CustomNo.Contains(parm.CustomNo))
+ .AndIF(parm.Year>0, it => it.Year == parm.Year)
+ .AndIF(parm.Week>0, it => it.Year == parm.Week)
+ .AndIF(parm.Date>0, it => it.Year == parm.Date)
+ ;
var response = Queryable()
.Where(predicate.ToExpression())
.ToPage(parm);