9 changed files with 324 additions and 5 deletions
@ -0,0 +1,117 @@ |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Runtime.Serialization; |
|||
|
|||
namespace WMS_GIRAF_Interface.Entities; |
|||
|
|||
[Table("MANAGE_MAIN")] |
|||
public class MANAGE_MAIN |
|||
{ |
|||
///<sumary>
|
|||
/// 任务编号
|
|||
///</sumary>
|
|||
[Column("MANAGE_ID")] |
|||
public int MANAGE_ID { get; set; } |
|||
///<sumary>
|
|||
/// 终点
|
|||
///</sumary>
|
|||
[Column("destinationId")] |
|||
public string DESTINATIONID { get; set; } |
|||
///<sumary>
|
|||
/// 计划编号
|
|||
///</sumary>
|
|||
[Column("PLAN_ID")] |
|||
public int PLAN_ID { get; set; } |
|||
///<sumary>
|
|||
/// 需求号
|
|||
///</sumary>
|
|||
[Column("requestNumber")] |
|||
public string requestNumber { get; set; } |
|||
///<sumary>
|
|||
/// 任务类型编号
|
|||
///</sumary>
|
|||
[Column("MANAGE_TYPE_CODE")] |
|||
public string MANAGE_TYPE_CODE { get; set; } |
|||
///<sumary>
|
|||
/// 任务状态
|
|||
///</sumary>
|
|||
[Column("MANAGE_STATUS")] |
|||
public string MANAGE_STATUS { get; set; } |
|||
///<sumary>
|
|||
/// 托盘条码
|
|||
///</sumary>
|
|||
[Column("STOCK_BARCODE")] |
|||
public string STOCK_BARCODE { get; set; } |
|||
|
|||
///<sumary>
|
|||
/// 物料尺寸
|
|||
///</sumary>
|
|||
[Column("CELL_MODEL")] |
|||
public string CELL_MODEL { get; set; } |
|||
///<sumary>
|
|||
/// 开始位置
|
|||
///</sumary>
|
|||
[Column("START_CELL_ID")] |
|||
public int START_CELL_ID { get; set; } |
|||
///<sumary>
|
|||
/// 终止位置
|
|||
///</sumary>
|
|||
[Column("END_CELL_ID")] |
|||
public int END_CELL_ID { get; set; } |
|||
///<sumary>
|
|||
/// 操作者
|
|||
///</sumary>
|
|||
[Column("MANAGE_OPERATOR")] |
|||
public string MANAGE_OPERATOR { get; set; } |
|||
///<sumary>
|
|||
/// 开始时间
|
|||
///</sumary>
|
|||
[Column("MANAGE_BEGIN_TIME")] |
|||
public string MANAGE_BEGIN_TIME { get; set; } |
|||
///<sumary>
|
|||
/// 结束时间
|
|||
///</sumary>
|
|||
[Column("MANAGE_END_TIME")] |
|||
public string MANAGE_END_TIME { get; set; } |
|||
///<sumary>
|
|||
/// 任务等级
|
|||
///</sumary>
|
|||
[Column("MANAGE_LEVEL")] |
|||
public string MANAGE_LEVEL { get; set; } |
|||
///<sumary>
|
|||
/// 备注
|
|||
///</sumary>
|
|||
[Column("MANAGE_REMARK")] |
|||
public string MANAGE_REMARK { get; set; } |
|||
///<sumary>
|
|||
/// 机械有问题请求保持
|
|||
///</sumary>
|
|||
[Column("keepRequestInMemoryEventIfMechanicalIssue")] |
|||
public bool keepRequestInMemoryEventIfMechanicalIssue { get; set; } |
|||
///<sumary>
|
|||
/// 缺少产品持续叫料
|
|||
///</sumary>
|
|||
[Column("keepRequestInMemoryEventIfLackOfProductIssue")] |
|||
public bool keepRequestInMemoryEventIfLackOfProductIssue { get; set; } |
|||
/// <summary>
|
|||
/// 目标出库时间
|
|||
/// </summary>
|
|||
[Column("TargetOutputDateInUtc")] |
|||
public DateTime? TargetOutputDateInUtc { get; set; } |
|||
/// <summary>
|
|||
/// 批次号
|
|||
/// </summary>
|
|||
[Column("LOTNUMBER")] |
|||
public string LOTNUMBER { get; set; } |
|||
///// <summary>
|
|||
/// 产品类型
|
|||
/// </summary>
|
|||
[Column("POPULATIONNUMBER")] |
|||
public string POPULATIONNUMBER { get; set; } |
|||
|
|||
///<sumary>
|
|||
/// 调用接口
|
|||
///</sumary>
|
|||
[Column("INTERFACE")] |
|||
public string INTERFACE { get; set; } |
|||
|
|||
} |
@ -0,0 +1,59 @@ |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Runtime.Serialization; |
|||
|
|||
namespace WMS_GIRAF_Interface.Entities; |
|||
|
|||
[Table("ProductInformation")] |
|||
public class ProductInformation |
|||
{ |
|||
[Column("BarCode")] |
|||
public string BarCode { get; set; } |
|||
|
|||
///<sumary>
|
|||
/// 物料分类编号
|
|||
///</sumary>
|
|||
[Column("LotNumber")] |
|||
public string LotNumber { get; set; } |
|||
///<sumary>
|
|||
/// 物料分类父编号
|
|||
///</sumary>
|
|||
[Column("PopulationNumber")] |
|||
public string PopulationNumber { get; set; } |
|||
|
|||
///<sumary>
|
|||
/// 物料类型编号
|
|||
///</sumary>
|
|||
[Column("SupportType")] |
|||
public List<string> SupportType { get; set; } |
|||
|
|||
[Column("FabricationDateTimeInUtc")] |
|||
public DateTime FabricationDateTimeInUtc { get; set; } |
|||
|
|||
///<sumary>
|
|||
/// 编码
|
|||
///</sumary>
|
|||
[Column("DryDateTimeInUtc")] |
|||
public DateTime DryDateTimeInUtc { get; set; } |
|||
///<sumary>
|
|||
/// 名称
|
|||
///</sumary>
|
|||
[Column("OldDateTimeInUtc")] |
|||
public DateTime OldDateTimeInUtc { get; set; } |
|||
///<sumary>
|
|||
/// 备注
|
|||
///</sumary>
|
|||
[Column("HdvDateTimeInUtc")] |
|||
public DateTime HdvDateTimeInUtc { get; set; } |
|||
///<sumary>
|
|||
/// 排序
|
|||
///</sumary>
|
|||
[Column("IsPriority")] |
|||
public bool IsPriority { get; set; } |
|||
///<sumary>
|
|||
/// 标记
|
|||
///</sumary>
|
|||
[Column("IsBlocked")] |
|||
public bool IsBlocked { get; set; } |
|||
|
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
using Microsoft.EntityFrameworkCore; |
|||
using WMS_GIRAF_Interface.Data; |
|||
using WMS_GIRAF_Interface.Entities; |
|||
using WMS_GIRAF_Interface.Repositories.Interface; |
|||
|
|||
namespace WMS_GIRAF_Interface.Repositories.Implement; |
|||
|
|||
public class ManageMainRepository: IManageMainRepository |
|||
{ |
|||
|
|||
private readonly MichelinDbContext _context; |
|||
private readonly ILogger<ManageMainRepository> _logger; |
|||
/// <summary>
|
|||
/// 构造函数
|
|||
/// </summary>
|
|||
/// <param name="context"></param>
|
|||
public ManageMainRepository(MichelinDbContext context, ILogger<ManageMainRepository> logger) |
|||
{ |
|||
_context = context; |
|||
_logger = logger; |
|||
} |
|||
/// <summary>
|
|||
/// 获取管理任务信息
|
|||
/// </summary>
|
|||
/// <param name="type">查询类型</param>
|
|||
/// <param name="filterInfo">筛选信息</param>
|
|||
/// <returns></returns>
|
|||
public MANAGE_MAIN? GetManageMain(string type, string filterInfo) |
|||
{ |
|||
MANAGE_MAIN? manageMain = type switch |
|||
{ |
|||
"barcode" => _context.Manage_Main.FirstOrDefault(x => x.STOCK_BARCODE == filterInfo), |
|||
"requestNumber" => _context.Manage_Main.FirstOrDefault(x => x.requestNumber == filterInfo), |
|||
_ => _context.Manage_Main.FirstOrDefault(x => x.STOCK_BARCODE == filterInfo) |
|||
}; |
|||
|
|||
return manageMain; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 添加manageMain
|
|||
/// </summary>
|
|||
/// <param name="manageMain"></param>
|
|||
/// <param name="manageId"></param>
|
|||
/// <returns></returns>
|
|||
public bool AddManageMain(MANAGE_MAIN manageMain, out int manageId) |
|||
{ |
|||
try |
|||
{ |
|||
manageId = 0; |
|||
if (manageMain == null) |
|||
{ |
|||
|
|||
return false; |
|||
} |
|||
_context.Manage_Main.Add(manageMain); |
|||
_context.SaveChanges(); |
|||
_logger.LogInformation($"Catch Manage main info({manageMain.STOCK_BARCODE});"); |
|||
var managemain = _context.Manage_Main.Where(x => x.STOCK_BARCODE == manageMain.STOCK_BARCODE).AsNoTracking().FirstOrDefault(); |
|||
if (managemain != null) |
|||
{ |
|||
manageId = managemain.MANAGE_ID; |
|||
} |
|||
return true; |
|||
} |
|||
catch (Exception e) |
|||
{ |
|||
if (manageMain != null) _logger.LogError($"插入main数据出现问题:桶信息:{manageMain.STOCK_BARCODE};错误信息:{e.Message}"); |
|||
throw; |
|||
} |
|||
} |
|||
|
|||
public bool UpdateManageMain(MANAGE_MAIN manageMain) |
|||
{ |
|||
if (manageMain == null || manageMain.MANAGE_ID == 0) |
|||
{ |
|||
throw new ArgumentNullException(nameof(UpdateManageMain)); |
|||
} |
|||
_context.Manage_Main.Update(manageMain); |
|||
_logger.LogInformation($"Update Manage main info({manageMain.STOCK_BARCODE});"); |
|||
_context.SaveChanges(); |
|||
return true; |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 删除主任务
|
|||
/// </summary>
|
|||
/// <param name="manageMain"></param>
|
|||
/// <returns></returns>
|
|||
public void DeleteManageMain(MANAGE_MAIN manageMain) |
|||
{ |
|||
if (manageMain == null) |
|||
{ |
|||
throw new ArgumentNullException(nameof(manageMain)); |
|||
} |
|||
_context.Manage_Main.Remove(manageMain); |
|||
_logger.LogInformation($"Deleted Manage main info({manageMain.STOCK_BARCODE});"); |
|||
_context.SaveChanges(); |
|||
|
|||
} |
|||
} |
@ -0,0 +1,8 @@ |
|||
using WMS_GIRAF_Interface.Entities; |
|||
|
|||
namespace WMS_GIRAF_Interface.Repositories.Interface; |
|||
|
|||
public interface IManageMainRepository |
|||
{ |
|||
public MANAGE_MAIN? GetManageMain(string type,string filterInfo); |
|||
} |
@ -0,0 +1,33 @@ |
|||
using WMS_GIRAF_Interface.Data; |
|||
using WMS_GIRAF_Interface.Models; |
|||
using WMS_GIRAF_Interface.Repositories.Interface; |
|||
|
|||
namespace WMS_GIRAF_Interface.TaskServices; |
|||
|
|||
public class ManageTaskService(MichelinDbContext context,IManageMainRepository mangeMainRepository) |
|||
{ |
|||
private readonly MichelinDbContext _context = context; |
|||
private readonly IManageMainRepository _mangeMainRepository = mangeMainRepository; |
|||
|
|||
/// <summary>
|
|||
/// 生成入库到line任务逻辑
|
|||
/// </summary>
|
|||
/// <param name="inputRequest"></param>
|
|||
public bool CreateInputTaskFromGiraf( InputRequest.Product inputRequest,bool trans,bool IssendControl ,out string sResult) |
|||
{ |
|||
bool bResult = true; |
|||
sResult = string.Empty; |
|||
//判断当前胎号是否有任务
|
|||
var manageMain = _mangeMainRepository.GetManageMain("barcode", inputRequest.identifier); |
|||
if (manageMain!=null) |
|||
{ |
|||
|
|||
} |
|||
else |
|||
{ |
|||
|
|||
} |
|||
|
|||
return bResult; |
|||
} |
|||
} |
Loading…
Reference in new issue