add - 出入库记录

collectionStore
wenjy 11 months ago
parent b056d9e8b4
commit 9d07289b53

Binary file not shown.

@ -5,6 +5,7 @@ using HighWayIot.Log4net;
using HighWayIot.Repository.service;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using static Aucma.Scada.Business.InStoreTaskHandle;
@ -53,6 +54,8 @@ namespace Aucma.Scada.Business
private IBaseSpaceDetailService _baseSpaceDetailService;
private IBaseBomInfoService _baseBomInfoService;
private IRecordInStoreService _recordInStore;
#endregion
#region 委托事件
@ -88,6 +91,7 @@ namespace Aucma.Scada.Business
_taskInfoService = registerServices.GetService<IRealTaskInfoService>();
_baseSpaceDetailService = registerServices.GetService<IBaseSpaceDetailService>();
_baseBomInfoService = registerServices.GetService<IBaseBomInfoService>();
_recordInStore = registerServices.GetService<IRecordInStoreService>();
taskHandle.InStoreFinsihEvent += TaskFeedback;
grabImage.RefreshMaterialCodeStrEvent += InStore;
grabImage.RefreshLogMessageEvent += PrintLogInfoMessage;
@ -96,10 +100,12 @@ namespace Aucma.Scada.Business
//Task.Run(() =>
//{
// Thread.Sleep(6000);
// for (int i = 1; i < 7; i++)
// for (int i = 1; i < 15; i++)
// {
// //InStore(appConfig.shellStoreCode, "B23600000781102300" + i);
// InStore(appConfig.linerStoreCode, "L23600000788102300" + i);
// InStore(appConfig.shellStoreCode, "B2360000078110230" + i.ToString().PadLeft(2, '0'));
// Thread.Sleep(1000);
// InStore(appConfig.linerStoreCode, "L2360000078810230" + i.ToString().PadLeft(2, '0'));
// Thread.Sleep(1000);
// }
//});
@ -402,6 +408,19 @@ namespace Aucma.Scada.Business
_baseSpaceDetailService.InsertSpaceDetail(spaceDetail);
#endregion
#region 添加入库任务
RecordInstore recordInstore = new RecordInstore();
recordInstore.storeCode = taskInfo.storeCode;
recordInstore.spaceCode = taskInfo.spaceCode;
recordInstore.materialCode = taskInfo.materialCode;
recordInstore.materialType = taskInfo.materialType;
recordInstore.materialName = GetMaterialName(taskInfo.materialType);
recordInstore.inStoreAmount = 1;
recordInstore.inStoreTime = DateTime.Now;
recordInstore.barcodeCode = taskInfo.materialCode;
_recordInStore.InsertRecordInStore(recordInstore);
#endregion
}
//清除任务信息
_taskInfoService.DeleteTaskInfo(taskCode, storeCode);

@ -1,6 +1,7 @@
using Aucma.Scada.Model.domain;
using HighWayIot.Config;
using HighWayIot.Log4net;
using HighWayIot.Repository;
using HighWayIot.Repository.service;
using System;
using System.Collections.Generic;
@ -62,6 +63,8 @@ namespace Aucma.Scada.Business
private IExecutePlanInfoService _executePlanInfoService;
private IProductPlanInfoService _productPlanInfoService;
private IRecordOutStoreService _recordOutStoreService;
#endregion
#region 委托事件
@ -104,6 +107,8 @@ namespace Aucma.Scada.Business
_spaceDetailService = registerServices.GetService<IBaseSpaceDetailService>();
_executePlanInfoService = registerServices.GetService<IExecutePlanInfoService>();
_productPlanInfoService = registerServices.GetService<IProductPlanInfoService>();
_recordOutStoreService = registerServices.GetService<IRecordOutStoreService>();
assemblyPlanBusiness.NextPassExecutePlanInfoEvent += PlanHandle;
taskHandleBusiness.OutStoreFinsihEvent += TaskFeedback;
StartPassDown();
@ -517,6 +522,17 @@ namespace Aucma.Scada.Business
}
_spaceInfoService.UpdateSpaceInfo(spaceInfo);
#region 添加出库记录
RecordOutstore recordOutstore = new RecordOutstore();
recordOutstore.storeCode = taskInfo.storeCode;
recordOutstore.spaceCode = taskInfo.spaceCode;
recordOutstore.materialCode = taskInfo.materialCode;
recordOutstore.materialType = taskInfo.materialType;
recordOutstore.materialName = GetMaterialName(taskInfo.materialType);
recordOutstore.outStoreAmount = 1;
recordOutstore.outStoreTime = DateTime.Now;
_recordOutStoreService.InsertReocrdOutStoreService(recordOutstore);
#endregion
}
//清除任务信息
_taskInfoService.DeleteTaskInfo(taskCode, storeCode);
@ -684,5 +700,22 @@ namespace Aucma.Scada.Business
GetAllRelese(sph);
}
}
/// <summary>
/// 通过BOM获取物料名称
/// </summary>
/// <param name="materialType"></param>
/// <returns></returns>
public string GetMaterialName(string materialType)
{
string materialName = string.Empty;
var info = _bomInfoService.GetBomInfoByMaterialCode(materialType);
if (info != null)
{
materialName = info.materialName;
}
return materialName;
}
}
}

@ -1,4 +1,5 @@
using HighWayIot.Repository.service;
using HighWayIot.Repository;
using HighWayIot.Repository.service;
using HighWayIot.Repository.service.Impl;
using Microsoft.Extensions.DependencyInjection;
using System;
@ -58,6 +59,8 @@ namespace Aucma.Scada.Business
services.AddSingleton<IProductPlanInfoService, ProductPlanInfoServiceImpl>();
services.AddSingleton<IRealTaskInfoService, RealTaskInfoServiceImpl>();
services.AddSingleton<ISysUserInfoService, SysUserInfoServiceImpl>();
services.AddSingleton<IRecordInStoreService, RecordInStoreServiceImpl>();
services.AddSingleton<IRecordOutStoreService, RecordOutStoreServiceImpl>();
}
public T GetService<T>()

@ -50,6 +50,8 @@
<Compile Include="domain\ExecutePlanInfo.cs" />
<Compile Include="domain\ProductPlanInfo.cs" />
<Compile Include="domain\RealTaskInfo.cs" />
<Compile Include="domain\RecordInstore.cs" />
<Compile Include="domain\RecordOutstore.cs" />
<Compile Include="domain\SysUserInfo.cs" />
<Compile Include="dto\OperationType.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

@ -0,0 +1,94 @@
using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugar;
namespace Aucma.Scada.Model.domain
{
/// <summary>
/// 入库记录
///</summary>
[SugarTable("RECORD_INSTORE")]
public class RecordInstore
{
/// <summary>
/// 主键标识
///</summary>
[SugarColumn(ColumnName="OBJ_ID" ,IsPrimaryKey = true ,OracleSequenceName = "SEQ_RECORD_INSTORE")]
public decimal objId { get; set; }
/// <summary>
/// 仓库编号
///</summary>
[SugarColumn(ColumnName="STORE_CODE" )]
public string storeCode { get; set; }
/// <summary>
/// 仓库区域
///</summary>
[SugarColumn(ColumnName="STORE_AREA" )]
public string storeArea { get; set; }
/// <summary>
/// 货道编号
///</summary>
[SugarColumn(ColumnName="SPACE_CODE" )]
public string spaceCode { get; set; }
/// <summary>
/// 物料类型
///</summary>
[SugarColumn(ColumnName="MATERIAL_TYPE" )]
public string materialType { get; set; }
/// <summary>
/// 物料编号
///</summary>
[SugarColumn(ColumnName="MATERIAL_CODE" )]
public string materialCode { get; set; }
/// <summary>
/// 入库数量
///</summary>
[SugarColumn(ColumnName="IN_STORE_AMOUNT" )]
public decimal? inStoreAmount { get; set; }
/// <summary>
/// 入库时间
///</summary>
[SugarColumn(ColumnName="IN_STORE_TIME" )]
public DateTime? inStoreTime { get; set; }
/// <summary>
/// 物料条码编号
///</summary>
[SugarColumn(ColumnName="BARCODE_CODE" )]
public string barcodeCode { get; set; }
/// <summary>
/// 物料名称
///</summary>
[SugarColumn(ColumnName="MATERIAL_NAME" )]
public string materialName { get; set; }
/// <summary>
/// 入库方式0-正常1-异常)
///</summary>
[SugarColumn(ColumnName="ENTRY_PATTERN" )]
public short? entryPattern { get; set; }
/// <summary>
/// 是否标识
///</summary>
[SugarColumn(ColumnName="IS_FLAG" )]
public short? isFlag { get; set; }
/// <summary>
/// 创建人
///</summary>
[SugarColumn(ColumnName="CREATED_BY" )]
public string createdBy { get; set; }
/// <summary>
/// 创建时间
///</summary>
[SugarColumn(ColumnName="CREATED_TIME" )]
public DateTime? createdTime { get; set; }
/// <summary>
/// 更新人
///</summary>
[SugarColumn(ColumnName="UPDATED_BY" )]
public string updatedBy { get; set; }
/// <summary>
/// 更新时间
///</summary>
[SugarColumn(ColumnName="UPDATED_TIME" )]
public DateTime? updatedTime { get; set; }
}
}

@ -0,0 +1,94 @@
using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugar;
namespace Aucma.Scada.Model.domain
{
/// <summary>
/// 出库记录
///</summary>
[SugarTable("RECORD_OUTSTORE")]
public class RecordOutstore
{
/// <summary>
/// 主键标识
///</summary>
[SugarColumn(ColumnName="OBJ_ID" ,IsPrimaryKey = true ,OracleSequenceName = "SEQ_RECORD_OUTSTORE")]
public decimal objId { get; set; }
/// <summary>
/// 仓库编号
///</summary>
[SugarColumn(ColumnName="STORE_CODE" )]
public string storeCode { get; set; }
/// <summary>
/// 仓库区域
///</summary>
[SugarColumn(ColumnName="STORE_AREA" )]
public string storeArea { get; set; }
/// <summary>
/// 货道编号
///</summary>
[SugarColumn(ColumnName="SPACE_CODE" )]
public string spaceCode { get; set; }
/// <summary>
/// 物料编号
///</summary>
[SugarColumn(ColumnName="MATERIAL_CODE" )]
public string materialCode { get; set; }
/// <summary>
/// 物料名称
///</summary>
[SugarColumn(ColumnName="MATERIAL_NAME" )]
public string materialName { get; set; }
/// <summary>
/// 出库数量
///</summary>
[SugarColumn(ColumnName="OUT_STORE_AMOUNT" )]
public decimal? outStoreAmount { get; set; }
/// <summary>
/// 出库时间
///</summary>
[SugarColumn(ColumnName="OUT_STORE_TIME" )]
public DateTime? outStoreTime { get; set; }
/// <summary>
/// 物料条码编号
///</summary>
[SugarColumn(ColumnName="BARCODE_CODE" )]
public string barcodeCode { get; set; }
/// <summary>
/// 物料类型
///</summary>
[SugarColumn(ColumnName="MATERIAL_TYPE" )]
public string materialType { get; set; }
/// <summary>
/// 出库方式0-正常1-异常)
///</summary>
[SugarColumn(ColumnName="EXIT_PATTERN" )]
public short? exitPattern { get; set; }
/// <summary>
/// 是否标识
///</summary>
[SugarColumn(ColumnName="IS_FLAG" )]
public decimal? isFlag { get; set; }
/// <summary>
/// 创建人
///</summary>
[SugarColumn(ColumnName="CREATED_BY" )]
public string createdBy { get; set; }
/// <summary>
/// 创建时间
///</summary>
[SugarColumn(ColumnName="CREATED_TIME" )]
public DateTime? createdTime { get; set; }
/// <summary>
/// 更新人
///</summary>
[SugarColumn(ColumnName="UPDATED_BY" )]
public string updatedBy { get; set; }
/// <summary>
/// 更新时间
///</summary>
[SugarColumn(ColumnName="UPDATED_TIME" )]
public DateTime? updatedTime { get; set; }
}
}

@ -1 +1 @@
f21fa175ee2704029739090502d89e171b1728e9
88285eb5de22a36a49c734ce03d953412e564964

@ -59,6 +59,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="IRecordOutStoreService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Repository.cs" />
<Compile Include="service\IBaseBomInfoService.cs" />
@ -71,8 +72,11 @@
<Compile Include="service\Impl\ExecutePlanInfoServiceImpl.cs" />
<Compile Include="service\Impl\ProductPlanInfoServiceImpl.cs" />
<Compile Include="service\Impl\RealTaskInfoServiceImpl.cs" />
<Compile Include="service\Impl\RecordInStoreServiceImpl.cs" />
<Compile Include="service\Impl\RecordOutStoreServiceImpl.cs" />
<Compile Include="service\IProductPlanInfoService.cs" />
<Compile Include="service\IRealTaskInfoService.cs" />
<Compile Include="service\IRecordInStoreService.cs" />
<Compile Include="service\ISysUserInfoService.cs" />
<Compile Include="service\Impl\SysUserInfoServiceImpl.cs" />
<Compile Include="SqlSugarHelper.cs" />

@ -0,0 +1,19 @@
using Aucma.Scada.Model.domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.Repository
{
public interface IRecordOutStoreService
{
/// <summary>
/// 添加出库记录
/// </summary>
/// <param name="recordOutstore"></param>
/// <returns></returns>
bool InsertReocrdOutStoreService(RecordOutstore recordOutstore);
}
}

@ -1 +1 @@
23cd80385b397fa6fe8fd3585bc10f301878a043
7df15e9e31ac50a6a452f6ee0d9264aa210c2058

@ -0,0 +1,19 @@
using Aucma.Scada.Model.domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.Repository.service
{
public interface IRecordInStoreService
{
/// <summary>
/// 添加入库记录
/// </summary>
/// <param name="recordInstore"></param>
/// <returns></returns>
bool InsertRecordInStore(RecordInstore recordInstore);
}
}

@ -0,0 +1,31 @@
using Aucma.Scada.Model.domain;
using HighWayIot.Log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.Repository.service.Impl
{
public class RecordInStoreServiceImpl : IRecordInStoreService
{
Repository<RecordInstore> _repository => new Repository<RecordInstore>("mes");
private LogHelper logHelper = LogHelper.Instance;
public bool InsertRecordInStore(RecordInstore recordInstore)
{
bool result = false;
try
{
result = _repository.Insert(recordInstore);
}catch (Exception ex)
{
logHelper.Error("入库记录添加异常", ex);
}
return result;
}
}
}

@ -0,0 +1,32 @@
using Aucma.Scada.Model.domain;
using HighWayIot.Log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.Repository.service.Impl
{
public class RecordOutStoreServiceImpl : IRecordOutStoreService
{
Repository<RecordOutstore> _repository => new Repository<RecordOutstore>("mes");
private LogHelper logHelper = LogHelper.Instance;
public bool InsertReocrdOutStoreService(RecordOutstore recordOutstore)
{
bool result = false;
try
{
result = _repository.Insert(recordOutstore);
}
catch (Exception ex)
{
logHelper.Error("出库记录添加异常", ex);
}
return result;
}
}
}
Loading…
Cancel
Save