change -添加过点数据

collectionStore
liuwf 1 year ago
parent 299b7eb6f4
commit 71f58c24d6

@ -59,6 +59,13 @@ namespace Aucma.Scada.Business
private IBaseBomInfoService _baseBomInfoService; private IBaseBomInfoService _baseBomInfoService;
private IRecordInStoreService _recordInStore; private IRecordInStoreService _recordInStore;
private IPrintBarCodeServices _printBarCodeServices;
// 过点数据表
private IMaterialCompletionServices _iMaterialCompletionServices;
private IProductPlanInfoService _productPlanInfoServices;
#endregion #endregion
#region 委托事件 #region 委托事件
@ -95,7 +102,9 @@ namespace Aucma.Scada.Business
_baseSpaceDetailService = registerServices.GetService<IBaseSpaceDetailService>(); _baseSpaceDetailService = registerServices.GetService<IBaseSpaceDetailService>();
_baseBomInfoService = registerServices.GetService<IBaseBomInfoService>(); _baseBomInfoService = registerServices.GetService<IBaseBomInfoService>();
_recordInStore = registerServices.GetService<IRecordInStoreService>(); _recordInStore = registerServices.GetService<IRecordInStoreService>();
_printBarCodeServices = registerServices.GetService<IPrintBarCodeServices>();
_productPlanInfoServices = registerServices.GetService<IProductPlanInfoService>();
_iMaterialCompletionServices = registerServices.GetService<IMaterialCompletionServices>();
taskHandle.InStoreFinsihEvent += InStoreFinish; taskHandle.InStoreFinsihEvent += InStoreFinish;
taskHandle.InStoreAnswerEvent += InStoreAnswer; taskHandle.InStoreAnswerEvent += InStoreAnswer;
@ -141,6 +150,20 @@ namespace Aucma.Scada.Business
var result = CreateInStoreTask(spaceInfo, materialCode); //创建入库任务 var result = CreateInStoreTask(spaceInfo, materialCode); //创建入库任务
if (result) if (result)
{ {
#region 2023-12-15 更新过点数据,插入记录到MATERIAL_COMPLETION表
PrintBarCode print =_printBarCodeServices.query(materialCode);
string planCode = _productPlanInfoServices.GetPlanCode(print.OrderCode, appConfig.stationCode);
MaterialCompletion completion = new MaterialCompletion();
completion.OrderCode = print.OrderCode;
completion.MaterialBarcode = materialCode;
completion.MaterialCode = print.MaterialCode;
completion.MaterialName = print.MaterialName;
completion.StationName = appConfig.stationCode;
completion.CompleteDate = DateTime.Now;
completion.planCode = planCode;
_iMaterialCompletionServices.Add(completion);
#endregion
//spaceInfo.onRouteAmount += 1; //通过PLC获取货道信息在库、在途数量时不需要修改在途数量 //spaceInfo.onRouteAmount += 1; //通过PLC获取货道信息在库、在途数量时不需要修改在途数量
_spaceInfoService.UpdateSpaceInfo(spaceInfo); _spaceInfoService.UpdateSpaceInfo(spaceInfo);
} }
@ -177,7 +200,6 @@ namespace Aucma.Scada.Business
realTaskInfo.taskStatus = 1; realTaskInfo.taskStatus = 1;
realTaskInfo.createTime = DateTime.Now; realTaskInfo.createTime = DateTime.Now;
#endregion #endregion
result = _taskInfoService.AddTaskInfo(realTaskInfo); result = _taskInfoService.AddTaskInfo(realTaskInfo);
if (result) if (result)
{ {

@ -187,7 +187,7 @@ namespace Aucma.Core.Scanner
RefreshMaterialCodeStrEvent?.Invoke(appConfig.shellStoreCode, strCode); RefreshMaterialCodeStrEvent?.Invoke(appConfig.shellStoreCode, strCode);
}else if(appConfig.linerHikRobotIp == hashmap.Value) }else if(appConfig.linerHikRobotIp == hashmap.Value)
{ {
RefreshMaterialCodeStrEvent?.Invoke(appConfig.linerHikRobotIp, strCode); RefreshMaterialCodeStrEvent?.Invoke(appConfig.linerStoreCode, strCode);
} }
} }
} }

@ -49,6 +49,8 @@
<Compile Include="domain\BaseSpaceInfo.cs" /> <Compile Include="domain\BaseSpaceInfo.cs" />
<Compile Include="domain\CodeBindingRecord.cs" /> <Compile Include="domain\CodeBindingRecord.cs" />
<Compile Include="domain\ExecutePlanInfo.cs" /> <Compile Include="domain\ExecutePlanInfo.cs" />
<Compile Include="domain\MaterialCompletion.cs" />
<Compile Include="domain\PrintBarCode.cs" />
<Compile Include="domain\ProductPlanInfo.cs" /> <Compile Include="domain\ProductPlanInfo.cs" />
<Compile Include="domain\RealTaskInfo.cs" /> <Compile Include="domain\RealTaskInfo.cs" />
<Compile Include="domain\RecordInstore.cs" /> <Compile Include="domain\RecordInstore.cs" />

@ -0,0 +1,64 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Scada.Model.domain
{
/// <summary>
/// 物料完成记录
/// </summary>
[SugarTable("MATERIAL_COMPLETION", "AUCMA_SCADA")]
public class MaterialCompletion
{
/// <summary>
/// 主键
/// </summary>
[SugarColumn(ColumnName = "OBJ_ID", IsIdentity = true, IsPrimaryKey = true)]
public int ObjId { get; set; }
/// <summary>
/// 订单编号
/// </summary>
[SugarColumn(ColumnName = "ORDER_CODE")]
public string OrderCode { get; set; }
/// <summary>
/// 物料条码
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_BARCODE")]
public string MaterialBarcode { 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 = "STATION_NAME")]
public string StationName { get; set; }
/// <summary>
/// 完成时间
/// </summary>
[SugarColumn(ColumnName = "COMPLETE_DATE")]
public DateTime CompleteDate { get; set; }
/// <summary>
/// 工单编号
/// </summary>
[SugarColumn(ColumnName = "PLAN_CODE")]
public string planCode { get; set; }
}
}

@ -0,0 +1,62 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Scada.Model.domain
{
/// <summary>
/// 打印条码信息
/// </summary>
[SugarTable("PRINT_BARCODE", "AUCMA_SCADA")]
public class PrintBarCode
{
/// <summary>
/// 主键
/// </summary>
[SugarColumn(ColumnName = "OBJ_ID", IsIdentity = true, IsPrimaryKey = true)]
public int ObjId { get; set; }
/// <summary>
/// 订单号
/// </summary>
[SugarColumn(ColumnName = "ORDER_CODE")]
public string OrderCode { 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 = "MATERIAL_BARCODE")]
public string MaterialBarcode { get; set; }
/// <summary>
/// 打印时间
/// </summary>
[SugarColumn(ColumnName = "PRINT_TIME")]
public DateTime PrintTime { get; set; }
/// <summary>
/// 补打个数
/// </summary>
[SugarColumn(ColumnName = "SUPPLEMENT_MATERIAL")]
public int SupplementMaterial { get; set; }
/// <summary>
/// 打印类型:箱壳、内胆
/// </summary>
[SugarColumn(ColumnName = "PRINT_BARTYPE")]
public int PrintBarType { get; set; }
}
}

@ -13,13 +13,13 @@ namespace Aucma.Scada.Model.domain
public int objId { get; set; } public int objId { get; set; }
/// <summary> /// <summary>
/// 计划编号 /// 计划编号 ----->>> 工单编号
/// </summary> /// </summary>
[SugarColumn(ColumnName = "PLAN_CODE")] [SugarColumn(ColumnName = "PLAN_CODE")]
public string planCode { get; set; } public string planCode { get; set; }
/// <summary> /// <summary>
/// 工单编号 /// 工单编号 ----->>> 订单编号
/// </summary> /// </summary>
[SugarColumn(ColumnName = "ORDER_CODE")] [SugarColumn(ColumnName = "ORDER_CODE")]
public string orderCode { get; set; } public string orderCode { get; set; }

Binary file not shown.

@ -9,6 +9,7 @@ using GalaSoft.MvvmLight.Command;
using HighWayIot.Config; using HighWayIot.Config;
using HighWayIot.Log4net; using HighWayIot.Log4net;
using HighWayIot.Plc; using HighWayIot.Plc;
using SqlSugar.DistributedSystem.Snowflake;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
@ -149,25 +150,11 @@ namespace Aucma.Scada.UI.viewModel
{ {
try try
{ {
var commonFilesPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles); Process proc = new Process();
//程序集目标平台为X86时获取到的是x86的Program Files但TabTip.exe始终在Program Files目录下 proc.StartInfo.FileName = Path.Combine(Directory.GetCurrentDirectory(), "osk.exe");
if (commonFilesPath.Contains("Program Files (x86)")) proc.StartInfo.UseShellExecute = true;
{ proc.StartInfo.Verb = "runas";
commonFilesPath = commonFilesPath.Replace("Program Files (x86)", "Program Files"); proc.Start();
}
string tabTipPath = Path.Combine(commonFilesPath, @"microsoft shared\ink\TabTip.exe");
if (File.Exists(tabTipPath))
{
ProcessStartInfo psi = new ProcessStartInfo
{
FileName = tabTipPath,
UseShellExecute = true,
CreateNoWindow = true
};
Process.Start(psi);
}
} }
catch (Exception ex) catch (Exception ex)
{ {

@ -54,7 +54,11 @@
<ItemGroup> <ItemGroup>
<Compile Include="service\ICodeBindingRecordServices.cs" /> <Compile Include="service\ICodeBindingRecordServices.cs" />
<Compile Include="service\Impl\CodeBindingRecordServiceImpl.cs" /> <Compile Include="service\Impl\CodeBindingRecordServiceImpl.cs" />
<Compile Include="service\Impl\MaterialCompletionServiceImpl.cs" />
<Compile Include="service\Impl\PrintBarCodeServicesImpl.cs" />
<Compile Include="service\Impl\RecordProductfinishServiceImpl.cs" /> <Compile Include="service\Impl\RecordProductfinishServiceImpl.cs" />
<Compile Include="service\IMaterialCompletionServices.cs" />
<Compile Include="service\IPrintBarCodeServices.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" />

@ -0,0 +1,15 @@
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 IMaterialCompletionServices
{
// 添加过点数据
bool Add(MaterialCompletion info);
}
}

@ -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 IPrintBarCodeServices
{
/// <summary>
/// 根据箱体码找到打印记录。订单号
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
PrintBarCode query(string code);
}
}

@ -5,6 +5,10 @@ namespace HighWayIot.Repository.service
{ {
public interface IProductPlanInfoService public interface IProductPlanInfoService
{ {
///<summary>
///通过订单号和工位查询工单号
/// </summary>
string GetPlanCode(string orderCode,string station);
/// <summary> /// <summary>
/// 通过产线工位获取生产计划 /// 通过产线工位获取生产计划
/// </summary> /// </summary>

@ -0,0 +1,24 @@
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.Impl
{
public class MaterialCompletionServiceImpl : IMaterialCompletionServices
{
Repository<MaterialCompletion> _repository => new Repository<MaterialCompletion>("scada");
/// <summary>
/// 添加过点数据
/// </summary>
/// <param name="info"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public bool Add(MaterialCompletion info)
{
return _repository.Insert(info);
}
}
}

@ -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.Impl
{
public class PrintBarCodeServicesImpl: IPrintBarCodeServices
{
Repository<PrintBarCode> _repository => new Repository<PrintBarCode>("scada");
public PrintBarCode query(string code)
{
return _repository.GetFirst(x=>x.MaterialBarcode==code);
}
}
}

@ -15,6 +15,14 @@ namespace HighWayIot.Repository.service.Impl
private JsonChange jsonChange = JsonChange.Instance; private JsonChange jsonChange = JsonChange.Instance;
///<summary>
///通过订单号和工位查询工单号
/// </summary>
public string GetPlanCode(string orderCode, string station)
{
return _mesRepository.GetFirst(x => x.orderCode == orderCode && x.productLineCode == station).planCode;
}
/// <summary> /// <summary>
/// 通过计划编号获取计划信息 /// 通过计划编号获取计划信息
/// </summary> /// </summary>

Loading…
Cancel
Save