add - 完成记录

collectionStore
wenjy 1 year ago
parent f593c93d6d
commit ede5a195a2

Binary file not shown.

@ -65,6 +65,8 @@ namespace Aucma.Scada.Business
private IProductPlanInfoService _productPlanInfoService; private IProductPlanInfoService _productPlanInfoService;
private IRecordOutStoreService _recordOutStoreService; private IRecordOutStoreService _recordOutStoreService;
private IRecordProductfinishService _recordProductfinishService;
#endregion #endregion
#region 委托事件 #region 委托事件
@ -108,6 +110,7 @@ namespace Aucma.Scada.Business
_executePlanInfoService = registerServices.GetService<IExecutePlanInfoService>(); _executePlanInfoService = registerServices.GetService<IExecutePlanInfoService>();
_productPlanInfoService = registerServices.GetService<IProductPlanInfoService>(); _productPlanInfoService = registerServices.GetService<IProductPlanInfoService>();
_recordOutStoreService = registerServices.GetService<IRecordOutStoreService>(); _recordOutStoreService = registerServices.GetService<IRecordOutStoreService>();
_recordProductfinishService = registerServices.GetService<IRecordProductfinishService>();
assemblyPlanBusiness.NextPassExecutePlanInfoEvent += PlanHandle; assemblyPlanBusiness.NextPassExecutePlanInfoEvent += PlanHandle;
taskHandleBusiness.OutStoreFinsihEvent += TaskFeedback; taskHandleBusiness.OutStoreFinsihEvent += TaskFeedback;
@ -581,6 +584,16 @@ namespace Aucma.Scada.Business
_productPlanInfoService.UpdateProductPlanInfo(productInfo); _productPlanInfoService.UpdateProductPlanInfo(productInfo);
} }
#region 添加完成记录
RecordProductfinish productfinish = new RecordProductfinish();
productfinish.planCode = executeInfo.executePlanCode;
productfinish.productlineCode = appConfig.stationCode;
productfinish.materialCode = executeInfo.materialCode;
productfinish.completeAmount = 1; //目前一个箱体一个任务下发给plc
productfinish.recordTime = DateTime.Now;
_recordProductfinishService.InsertRecordProductfinish(productfinish);
#endregion
} }
RefreshAssemblyPlanInitEvent?.Invoke(); RefreshAssemblyPlanInitEvent?.Invoke();

@ -61,6 +61,8 @@ namespace Aucma.Scada.Business
services.AddSingleton<ISysUserInfoService, SysUserInfoServiceImpl>(); services.AddSingleton<ISysUserInfoService, SysUserInfoServiceImpl>();
services.AddSingleton<IRecordInStoreService, RecordInStoreServiceImpl>(); services.AddSingleton<IRecordInStoreService, RecordInStoreServiceImpl>();
services.AddSingleton<IRecordOutStoreService, RecordOutStoreServiceImpl>(); services.AddSingleton<IRecordOutStoreService, RecordOutStoreServiceImpl>();
services.AddSingleton<IRecordProductfinishService, RecordProductfinishServiceImpl>();
} }
public T GetService<T>() public T GetService<T>()

@ -52,6 +52,7 @@
<Compile Include="domain\RealTaskInfo.cs" /> <Compile Include="domain\RealTaskInfo.cs" />
<Compile Include="domain\RecordInstore.cs" /> <Compile Include="domain\RecordInstore.cs" />
<Compile Include="domain\RecordOutstore.cs" /> <Compile Include="domain\RecordOutstore.cs" />
<Compile Include="domain\RecordProductfinish.cs" />
<Compile Include="domain\SysUserInfo.cs" /> <Compile Include="domain\SysUserInfo.cs" />
<Compile Include="dto\OperationType.cs" /> <Compile Include="dto\OperationType.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugar;
namespace Aucma.Scada.Model.domain
{
/// <summary>
/// 完成记录
///</summary>
[SugarTable("RECORD_PRODUCTFINISH")]
public class RecordProductfinish
{
/// <summary>
/// 主键标识
///</summary>
[SugarColumn(ColumnName="OBJ_ID" ,IsPrimaryKey = true ,OracleSequenceName = "SEQ_RECORD_PRODUCTFINISH")]
public decimal objId { get; set; }
/// <summary>
/// 计划编号
///</summary>
[SugarColumn(ColumnName="PLAN_CODE" )]
public string planCode { get; set; }
/// <summary>
/// 物料编号
///</summary>
[SugarColumn(ColumnName="MATERIAL_CODE" )]
public string materialCode { get; set; }
/// <summary>
/// 计划工位
///</summary>
[SugarColumn(ColumnName="PRODUCTLINE_CODE" )]
public string productlineCode { get; set; }
/// <summary>
/// 完成数量
///</summary>
[SugarColumn(ColumnName="COMPLETE_AMOUNT" )]
public decimal? completeAmount { get; set; }
/// <summary>
/// 记录时间
///</summary>
[SugarColumn(ColumnName="RECORD_TIME" )]
public DateTime? recordTime { get; set; }
/// <summary>
/// 是否标识
///</summary>
[SugarColumn(ColumnName="IS_FLAG" )]
public decimal? isFlag { get; set; }
}
}

@ -1 +1 @@
88285eb5de22a36a49c734ce03d953412e564964 18c4bfb08d50bd6f5b9fa705009ee111ebbc33e4

@ -59,6 +59,7 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="service\Impl\RecordProductfinishServiceImpl.cs" />
<Compile Include="service\IRecordOutStoreService.cs" /> <Compile Include="service\IRecordOutStoreService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Repository.cs" /> <Compile Include="Repository.cs" />
@ -77,6 +78,7 @@
<Compile Include="service\IProductPlanInfoService.cs" /> <Compile Include="service\IProductPlanInfoService.cs" />
<Compile Include="service\IRealTaskInfoService.cs" /> <Compile Include="service\IRealTaskInfoService.cs" />
<Compile Include="service\IRecordInStoreService.cs" /> <Compile Include="service\IRecordInStoreService.cs" />
<Compile Include="service\IRecordProductfinishService.cs" />
<Compile Include="service\ISysUserInfoService.cs" /> <Compile Include="service\ISysUserInfoService.cs" />
<Compile Include="service\Impl\SysUserInfoServiceImpl.cs" /> <Compile Include="service\Impl\SysUserInfoServiceImpl.cs" />
<Compile Include="SqlSugarHelper.cs" /> <Compile Include="SqlSugarHelper.cs" />

@ -1 +1 @@
1787c726d992ae303d75dcdc63f8103e034413b6 8f9d7080ff3e6488cd9caca8fcf73a6721e8a385

@ -0,0 +1,14 @@
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 IRecordProductfinishService
{
bool InsertRecordProductfinish(RecordProductfinish productfinish);
}
}

@ -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 RecordProductfinishServiceImpl : IRecordProductfinishService
{
Repository<RecordProductfinish> _repository => new Repository<RecordProductfinish>("mes");
private LogHelper logHelper = LogHelper.Instance;
public bool InsertRecordProductfinish(RecordProductfinish productfinish)
{
bool result = false;
try
{
result = _repository.Insert(productfinish);
}
catch (Exception ex)
{
logHelper.Error("完成记录添加异常", ex);
}
return result;
}
}
}
Loading…
Cancel
Save