大标签追溯
This commit is contained in:
23
ZR.Service/mes/pro/IService/IWmPackingrecordService.cs
Normal file
23
ZR.Service/mes/pro/IService/IWmPackingrecordService.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using ZR.Model;
|
||||
using System.Collections.Generic;
|
||||
using ZR.Model.mes.pro;
|
||||
using ZR.Model.MES.pro.DTO;
|
||||
|
||||
namespace ZR.Service.mes.pro.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// 包装记录service接口
|
||||
/// </summary>
|
||||
public interface IWmPackingrecordService : IBaseService<WmPackingrecord>
|
||||
{
|
||||
PagedInfo<WmPackingrecordDto> GetList(WmPackingrecordQueryDto parm);
|
||||
|
||||
WmPackingrecord GetInfo(long Id);
|
||||
|
||||
WmPackingrecord AddWmPackingrecord(WmPackingrecord parm);
|
||||
|
||||
int UpdateWmPackingrecord(WmPackingrecord parm);
|
||||
|
||||
}
|
||||
}
|
||||
95
ZR.Service/mes/pro/WmPackingrecordService.cs
Normal file
95
ZR.Service/mes/pro/WmPackingrecordService.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
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.pro;
|
||||
using ZR.Model.MES.pro.DTO;
|
||||
|
||||
namespace ZR.Service.mes.pro.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// 包装记录Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IWmPackingrecordService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class WmPackingrecordService : BaseService<WmPackingrecord>, IWmPackingrecordService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询包装记录列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<WmPackingrecordDto> GetList(WmPackingrecordQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<WmPackingrecord>();
|
||||
predicate.AndIF(!string.IsNullOrEmpty(parm.PartNum), it => it.PartNum == parm.PartNum)
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Machine), it => it.Machine == parm.Machine)
|
||||
.AndIF(!string.IsNullOrEmpty(parm.WorkOrderNum), it => it.WorkOrderNum == parm.WorkOrderNum)
|
||||
.AndIF(parm.start_time > new DateTime(2021, 1, 1), it => it.CreateTime >= parm.start_time)
|
||||
.AndIF(parm.end_time > new DateTime(2021, 1, 1), it => it.CreateTime <= parm.end_time);
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<WmPackingrecord, WmPackingrecordDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public WmPackingrecord GetInfo(long Id)
|
||||
{
|
||||
var response = Queryable()
|
||||
.Where(x => x.Id == Id)
|
||||
.First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加包装记录
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public WmPackingrecord AddWmPackingrecord(WmPackingrecord model)
|
||||
{
|
||||
model.Id = SnowFlakeSingle.Instance.NextId();
|
||||
model.CreateTime = DateTime.Now;
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改包装记录
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateWmPackingrecord(WmPackingrecord model)
|
||||
{
|
||||
//var response = Update(w => w.Id == model.Id, it => new WmPackingrecord()
|
||||
//{
|
||||
// PartNum = model.PartNum,
|
||||
// Machine = model.Machine,
|
||||
// ProductCode = model.ProductCode,
|
||||
// PackingCode = model.PackingCode,
|
||||
// ScannerContent = model.ScannerContent,
|
||||
// WorkOrderNum = model.WorkOrderNum,
|
||||
// Standby3 = model.Standby3,
|
||||
// Standby4 = model.Standby4,
|
||||
// Standby5 = model.Standby5,
|
||||
// BFilled = model.BFilled,
|
||||
// CreateTime = model.CreateTime,
|
||||
//});
|
||||
//return response;
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user