仓库模块_当前货物表:init

This commit is contained in:
qianhao.xu
2024-03-22 09:29:40 +08:00
parent 3e7cd97255
commit 6e27c0eb94
6 changed files with 276 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using System;
using ZR.Model;
using ZR.Model.Dto;
using System.Collections.Generic;
using ZR.Model.MES.wms;
using ZR.Model.MES.wms.Dto;
namespace ZR.Service.Business.IBusinessService
{
/// <summary>
/// 成品库当前货物表service接口
/// </summary>
public interface IWmGoodsNowProductionService : IBaseService<WmGoodsNowProduction>
{
PagedInfo<WmGoodsNowProductionDto> GetList(WmGoodsNowProductionQueryDto parm);
WmGoodsNowProduction GetInfo(string Id);
WmGoodsNowProduction AddWmGoodsNowProduction(WmGoodsNowProduction parm);
int UpdateWmGoodsNowProduction(WmGoodsNowProduction parm);
}
}

View File

@@ -0,0 +1,89 @@
using System;
using SqlSugar;
using Infrastructure.Attribute;
using Infrastructure.Extensions;
using ZR.Model;
using ZR.Repository;
using ZR.Service.Business.IBusinessService;
using System.Linq;
using ZR.Model.MES.wms;
using ZR.Model.MES.wms.Dto;
namespace ZR.Service.Business
{
/// <summary>
/// 成品库当前货物表Service业务层处理
/// </summary>
[AppService(ServiceType = typeof(IWmGoodsNowProductionService), ServiceLifetime = LifeTime.Transient)]
public class WmGoodsNowProductionService : BaseService<WmGoodsNowProduction>, IWmGoodsNowProductionService
{
/// <summary>
/// 查询成品库当前货物表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
public PagedInfo<WmGoodsNowProductionDto> GetList(WmGoodsNowProductionQueryDto parm)
{
var predicate = Expressionable.Create<WmGoodsNowProduction>();
var response = Queryable()
.Where(predicate.ToExpression())
.ToPage<WmGoodsNowProduction, WmGoodsNowProductionDto>(parm);
return response;
}
/// <summary>
/// 获取详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public WmGoodsNowProduction GetInfo(string Id)
{
var response = Queryable()
.Where(x => x.Id == Id)
.First();
return response;
}
/// <summary>
/// 添加成品库当前货物表
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public WmGoodsNowProduction AddWmGoodsNowProduction(WmGoodsNowProduction model)
{
return Context.Insertable(model).ExecuteReturnEntity();
}
/// <summary>
/// 修改成品库当前货物表
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public int UpdateWmGoodsNowProduction(WmGoodsNowProduction model)
{
//var response = Update(w => w.Id == model.Id, it => new WmGoodsNowProduction()
//{
// PackageCode = model.PackageCode,
// PackageCodeClient = model.PackageCodeClient,
// PackageCodeOriginal = model.PackageCodeOriginal,
// LocationCode = model.LocationCode,
// Partnumber = model.Partnumber,
// GoodsNumLogic = model.GoodsNumLogic,
// GoodsNumAction = model.GoodsNumAction,
// EntryWarehouseTime = model.EntryWarehouseTime,
// Remark = model.Remark,
// UpdatedBy = model.UpdatedBy,
// UpdatedTime = model.UpdatedTime,
// CreatedBy = model.CreatedBy,
// CreatedTime = model.CreatedTime,
//});
//return response;
return Update(model, true);
}
}
}