add - 出入库记录

foamRearStore
wenjy 11 months ago
parent 94f52253e8
commit 2833fac217

Binary file not shown.

@ -56,6 +56,8 @@ namespace Aucma.Scada.Business
private IBaseSpaceDetailService _baseSpaceDetailService;
private IBaseBomInfoService _baseBomInfoService;
private IRecordInStoreService _recordInStoreService;
#endregion
#region 委托事件
@ -91,6 +93,8 @@ namespace Aucma.Scada.Business
_taskInfoService = registerServices.GetService<IRealTaskInfoService>();
_baseSpaceDetailService = registerServices.GetService<IBaseSpaceDetailService>();
_baseBomInfoService = registerServices.GetService<IBaseBomInfoService>();
_recordInStoreService = registerServices.GetService<IRecordInStoreService>();
taskHandle.InStoreFinsihEvent += FoamTaskFeedback;
grabImage.RefreshMaterialCodeStrEvent += InStore;
grabImage.RefreshLogMessageEvent += PrintLogInfoMessage;
@ -99,9 +103,10 @@ namespace Aucma.Scada.Business
Task.Run(() =>
{
Thread.Sleep(6000);
for (int i = 1; i < 9; i++)
for (int i = 1; i < 15; i++)
{
InStore("F23406001225101901" + i);
InStore("F2340600122510190" + i.ToString().PadLeft(2,'0'));
Thread.Sleep(1000);
}
});
}
@ -320,6 +325,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;
_recordInStoreService.InsertRecordInStore(recordInstore);
#endregion
}
//清除任务信息
_taskInfoService.DeleteTaskInfo(taskCode, appConfig.foamStoreCode);

@ -62,6 +62,8 @@ namespace Aucma.Scada.Business
private IExecutePlanInfoService _executePlanInfoService;
private IProductPlanInfoService _productPlanInfoService;
private IRecordOutStoreService _recordOutStoreService;
#endregion
#region 委托事件
@ -104,6 +106,7 @@ 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();
@ -449,6 +452,18 @@ namespace Aucma.Scada.Business
_spaceInfoService.UpdateSpaceInfo(spaceInfo);
//读取PLC获取物料类型进行绑定
#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);
@ -616,5 +631,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;
}
}
}

@ -58,6 +58,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\FoamStoreStockDto.cs" />
<Compile Include="dto\OperationType.cs" />

@ -0,0 +1,75 @@
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; }
}
}

@ -0,0 +1,75 @@
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; }
}
}

@ -1 +1 @@
39336b1f3475a4e8d9459ed0dd66be75ea5b0106
473beecf09d8e61b9d3ea111c8c22f1208383589

@ -1,4 +1,4 @@

E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\GeneratedInternalTypeHelper.g.cs
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\App.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\Page\AssemblyPlan\AssemblyPlanControl.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\Page\AssemblyPlan\PlanInfoEditWindow.xaml;;

@ -1,62 +1,2 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace XamlGeneratedNamespace {
/// <summary>
/// GeneratedInternalTypeHelper
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper {
/// <summary>
/// CreateInstance
/// </summary>
protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) {
return System.Activator.CreateInstance(type, ((System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)
| (System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.CreateInstance)), null, null, culture);
}
/// <summary>
/// GetPropertyValue
/// </summary>
protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) {
return propertyInfo.GetValue(target, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// SetPropertyValue
/// </summary>
protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) {
propertyInfo.SetValue(target, value, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// CreateDelegate
/// </summary>
protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) {
return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod
| (System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)), null, target, new object[] {
delegateType,
handler}, null)));
}
/// <summary>
/// AddEventHandler
/// </summary>
protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) {
eventInfo.AddEventHandler(target, handler);
}
}
}


@ -71,8 +71,12 @@
<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\IRecordOutStoreService.cs" />
<Compile Include="service\ISysUserInfoService.cs" />
<Compile Include="service\Impl\SysUserInfoServiceImpl.cs" />
<Compile Include="SqlSugarHelper.cs" />

@ -1 +1 @@
23cd80385b397fa6fe8fd3585bc10f301878a043
8893118b84e2105a65c287bff95b4c1f41b6812c

@ -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,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 IRecordOutStoreService
{
/// <summary>
/// 添加出库记录
/// </summary>
/// <param name="recordOutstore"></param>
/// <returns></returns>
bool InsertReocrdOutStoreService(RecordOutstore recordOutstore);
}
}

@ -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