合并仓库管理:checklog
This commit is contained in:
@@ -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; }
|
||||
|
||||
@@ -7,6 +7,14 @@ namespace ZR.Model.MES.wms.Dto
|
||||
/// </summary>
|
||||
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; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace ZR.Service.mes.wms.IService
|
||||
/// </summary>
|
||||
public interface IWmGoodsOutProductionService : IBaseService<WmGoodsOutRecord>
|
||||
{
|
||||
PagedInfo<WmGoodsOutProductionDto> GetList(WmGoodsOutProductionQueryDto parm);
|
||||
(List<WmGoodsOutProductionDto>, int) GetList(WmGoodsOutProductionQueryDto parm);
|
||||
|
||||
WmGoodsOutRecord GetInfo(string Id);
|
||||
|
||||
|
||||
@@ -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
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<WmGoodsOutProductionDto> GetList(WmGoodsOutProductionQueryDto parm)
|
||||
public (List<WmGoodsOutProductionDto>,int) GetList(WmGoodsOutProductionQueryDto parm)
|
||||
{
|
||||
int total = 0;
|
||||
var predicate = Expressionable.Create<WmGoodsOutRecord>()
|
||||
.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<WmMaterial>((wgo, wml) => wgo.Partnumber == wml.Partnumber)
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<WmGoodsOutRecord, WmGoodsOutProductionDto>(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
|
||||
/// <returns></returns>
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,13 @@ namespace ZR.Service.mes.wms
|
||||
/// <returns></returns>
|
||||
public PagedInfo<WmOutOrderDto> GetList(WmOutOrderQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<WmOutOrder>();
|
||||
|
||||
var predicate = Expressionable.Create<WmOutOrder>()
|
||||
.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<WmOutOrder, WmOutOrderDto>(parm);
|
||||
|
||||
Reference in New Issue
Block a user