liuwf 10 months ago
commit 37120d2994

@ -3526,7 +3526,7 @@
线号
</summary>
</member>
<member name="P:Admin.Core.Model.TemperatureHistory.Gongwno">
<member name="P:Admin.Core.Model.TemperatureHistory.GongwNo">
<summary>
工位号
</summary>
@ -3551,6 +3551,11 @@
工作电压
</summary>
</member>
<member name="P:Admin.Core.Model.TemperatureHistory.Frequency">
<summary>
供电频率
</summary>
</member>
<member name="P:Admin.Core.Model.TemperatureHistory.Point2">
<summary>
测试通道
@ -3616,41 +3621,6 @@
部件测试数据
</summary>
</member>
<member name="P:Admin.Core.Model.TemperatureHistory.ErrorCode_Mes">
<summary>
故障代码
</summary>
</member>
<member name="P:Admin.Core.Model.TemperatureHistory.T1Name">
<summary>
内部传感器 1 名称
</summary>
</member>
<member name="P:Admin.Core.Model.TemperatureHistory.T2Name">
<summary>
内部传感器 2 名称
</summary>
</member>
<member name="P:Admin.Core.Model.TemperatureHistory.T3Name">
<summary>
内部传感器 3 名称
</summary>
</member>
<member name="P:Admin.Core.Model.TemperatureHistory.T4Name">
<summary>
内部传感器 4 名称
</summary>
</member>
<member name="P:Admin.Core.Model.TemperatureHistory.T5Name">
<summary>
内部传感器 5 名称
</summary>
</member>
<member name="P:Admin.Core.Model.TemperatureHistory.T6Name">
<summary>
内部传感器 6 名称
</summary>
</member>
<member name="P:Admin.Core.Model.TemperatureHistory.IsOrder">
<summary>
是否测试部件”Y”测试
@ -3701,7 +3671,7 @@
线号
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.Gongwno">
<member name="P:Admin.Core.Model.TestedCode_MES.GongwNo">
<summary>
工位号
</summary>
@ -3716,7 +3686,12 @@
产品型号
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.FactoryModel">
<member name="P:Admin.Core.Model.TestedCode_MES.factoryModel">
<summary>
基准型号
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.factoryOrder">
<summary>
基准型号
</summary>
@ -3726,6 +3701,11 @@
工作电压
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.Frequency">
<summary>
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.Point2">
<summary>
测试通道
@ -3791,69 +3771,59 @@
部件测试数据
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.ErrorCode_Mes">
<summary>
故障代码
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.T1Name">
<member name="P:Admin.Core.Model.TestedCode_MES.T_Name">
<summary>
内部传感器 1 名称
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.T2Name">
<summary>
内部传感器 2 名称
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.T3Name">
<summary>
内部传感器 3 名称
</summary>
<member name="P:Admin.Core.Model.TestedCode_MES.isOrder">
<summary>
是否测试部件”Y”测试
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.T4Name">
<member name="P:Admin.Core.Model.TestedCode_MES.LowV_Time">
<summary>
内部传感器 4 名称
低压启动测试时间
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.T5Name">
<member name="P:Admin.Core.Model.TestedCode_MES.LowV_PowerMin">
<summary>
内部传感器 5 名称
低压启动标准下限
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.T6Name">
<member name="P:Admin.Core.Model.TestedCode_MES.LowV_PowerMax">
<summary>
内部传感器 6 名称
低压启动标准上限
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.IsOrder">
<member name="P:Admin.Core.Model.TestedCode_MES.LowV_PowerFact">
<summary>
是否测试部件”Y”测试
低压启动实际采集值
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.LowV_Time">
<member name="P:Admin.Core.Model.TestedCode_MES.LowVoltage">
<summary>
低压启动测试时间
低压启动测试电压
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.LowV_PowerMin">
<member name="P:Admin.Core.Model.TestedCode_MES.CodeDateTime">
<summary>
低压启动标准下限
低压启动测试电压
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.LowV_PowerMax">
<member name="P:Admin.Core.Model.TestedCode_MES.isCopyRead">
<summary>
低压启动标准上限
低压启动测试电压
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.LowV_PowerFact">
<member name="P:Admin.Core.Model.TestedCode_MES.CodeDateTime2">
<summary>
低压启动实际采集值
低压启动测试电压
</summary>
</member>
<member name="P:Admin.Core.Model.TestedCode_MES.LowVoltage">
<member name="P:Admin.Core.Model.TestedCode_MES.IsSync">
<summary>
低压启动测试电压
是否同步 1同步 0 位同步
</summary>
</member>
<member name="T:Admin.Core.Model.DeptView">

@ -15,7 +15,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Api")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f242c55c6773055ed882072b4cbd144f26a025f1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5972c771230554e7ffbf66d51846cd501637e447")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Api")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Api")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
d3fb98a6e9753e9778fbd74bfb1bab4b2109502e6ffb588dd6ac7fa35784db36
328d019814fd578ff1b66effb7a3d5f785bbe47d82c52d4e18a8e00a46e47ecd

@ -9,7 +9,7 @@ namespace Admin.Core.Common.Config
public sealed class PlcSpaceConfig
{
private static IniHelper iniHelper = new IniHelper(System.Environment.CurrentDirectory + "/config/PlcSpace.Ini");
//private static IniHelper iniHelper = new IniHelper("E:/桌面/澳柯玛MES项目/程序设计/Aucma.Scada/Aucma.Scada.UI/bin/Debug/config/PlcSpace.Ini");
private static readonly Lazy<PlcSpaceConfig> lazy = new Lazy<PlcSpaceConfig>(() => new PlcSpaceConfig());
@ -26,7 +26,12 @@ namespace Admin.Core.Common.Config
}
/// <summary>
/// 获取6条货道的信息在库数量,货道物料号,入库完成,仓库状态,出库完成
/// </summary>
/// <param name="storeCode"></param>
/// <param name="spaceCode"></param>
/// <returns></returns>
public SpaceAddress GetSpaceAddress(string storeCode, string spaceCode)
{
SpaceAddress spaceAddress = new SpaceAddress();

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Common")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f242c55c6773055ed882072b4cbd144f26a025f1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5972c771230554e7ffbf66d51846cd501637e447")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Common")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Common")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
87a0600a7f41dbd7fb6e17317b46dab48d599fb88ba27b9ecafe90600b623f5e
f91c01806ecb0cbf45a7945a9a1cea32793a3f91782b50a074b5df8e15698347

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.EventBus")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f242c55c6773055ed882072b4cbd144f26a025f1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5972c771230554e7ffbf66d51846cd501637e447")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.EventBus")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.EventBus")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
0b6334a8eca6220f34a70ef7e8638a5a7d7d915a08c883404c49ce9b20597be9
0bee910b6d77564b4792ae2101f6977a7b7cdcc5da106cd66660a3ad7476a8ab

@ -14,6 +14,7 @@ namespace Admin.Core.Extensions.Middlewares
try
{
Console.WriteLine("测温服务开启中...");
aucamTemperatureMeasurementService.Execute();
Console.WriteLine("测温服务已开启");
}

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Extensions")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f242c55c6773055ed882072b4cbd144f26a025f1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5972c771230554e7ffbf66d51846cd501637e447")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Extensions")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Extensions")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
4a7a5e632f75acc2920835c957e2ba4bacf9c19fa66b0e4b558910512e4ad1f0
9a166f9c5576cc93aa769b28702c48c7668be85e3c1f883f9be15da877a5adad

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.FrameWork")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+09425abb94ddbc502762491aeee6d081b0fd9246")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5972c771230554e7ffbf66d51846cd501637e447")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.FrameWork")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.FrameWork")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
95b9afb20f612087230db37b666e22f3502b9cda1b891f7e39f9c1fa82a9e378
616655c58b838f58c492ec366edb01af19150c2ad3b48292ef216310410558aa

@ -17,5 +17,11 @@ namespace Admin.Core.IRepository
/// <param name="time">结束时间</param>
/// <returns></returns>
List<TestedCode_MES> QueryTemperatureHistory(DateTime time);
/// <summary>
/// 更新测温标识
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
int UpateTemperatureHistoryFlag(List<TestedCode_MES> list);
}
}

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.IRepository")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f242c55c6773055ed882072b4cbd144f26a025f1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5972c771230554e7ffbf66d51846cd501637e447")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.IRepository")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.IRepository")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
1729bdd33c92c32780dfc41d1c8c22b6e81b413dc7bcedea2de590235227a7d0
79a4e7c71cd8afc6ca51d0337c0ed07e190d421af6c26bb5e1d5ac9f776c8e5e

@ -14,6 +14,11 @@ namespace Admin.Core.IService
/// 获取系统班组时间
/// </summary>
public List<TestedCode_MES> QueryTemperatureHistory(DateTime startTime);
/// <summary>
/// 跟新同步标识
/// </summary>
public int UpateTemperatureHistoryFlag(List<TestedCode_MES> list);
}
}

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.IService")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f242c55c6773055ed882072b4cbd144f26a025f1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5972c771230554e7ffbf66d51846cd501637e447")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.IService")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.IService")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
c83a04ebc368821387c3ab97734761bca5244ace0e4e216ff1cefcac9c4ba4da
a901275feb6085c1f28b281e48e5553475a5b4c8ded34ec63b1c37b3fa5b07fa

@ -14,7 +14,7 @@ namespace Admin.Core.Model
/// <summary>
/// 主键
/// </summary>
[SugarColumn(ColumnName = "OBJ_ID", IsIdentity = true, IsPrimaryKey = true, OracleSequenceName = "SEQ_CODE_BINDING")]
[SugarColumn(ColumnName = "OBJ_ID", IsIdentity = true, IsPrimaryKey = true, OracleSequenceName = "SEQ_TEMPERATUREMEASUREMENTHISTORY")]
public int ObjId { get; set; }
/// <summary>
@ -27,7 +27,7 @@ namespace Admin.Core.Model
/// 工位号
/// </summary>
[SugarColumn(ColumnName = "GONGWNO")]
public int Gongwno { get; set; }
public int GongwNo { get; set; }
/// <summary>
/// 产品条码
@ -50,9 +50,13 @@ namespace Admin.Core.Model
/// <summary>
/// 工作电压
/// </summary>
[SugarColumn(ColumnName = "FACTORYMODEL")]
[SugarColumn(ColumnName = "VOLTAGE")]
public int Voltage { get; set; }
/// <summary>
/// 供电频率
/// </summary>
[SugarColumn(ColumnName = "FREQUENCY")]
public int Frequency { get; set; }
/// <summary>
/// 测试通道
/// </summary>
@ -81,7 +85,7 @@ namespace Admin.Core.Model
/// 开始测试时间
/// </summary>
[SugarColumn(ColumnName = "BEGINDATETIME")]
public string BeginDateTime { get; set; }
public DateTime BeginDateTime { get; set; }
/// <summary>
/// 测试结果
@ -93,7 +97,7 @@ namespace Admin.Core.Model
/// 测试结束时间
/// </summary>
[SugarColumn(ColumnName = "ENDDATETIME")]
public string EndDateTime { get; set; }
public DateTime EndDateTime { get; set; }
/// <summary>
/// 系统用户
@ -131,48 +135,6 @@ namespace Admin.Core.Model
[SugarColumn(ColumnName = "PART_MES")]
public string Part_Mes { get; set; }
/// <summary>
/// 故障代码
/// </summary>
[SugarColumn(ColumnName = "ERRORCODE_MES")]
public string ErrorCode_Mes { get; set; }
/// <summary>
/// 内部传感器 1 名称
/// </summary>
[SugarColumn(ColumnName = "T1NAME")]
public string T1Name { get; set; }
/// <summary>
/// 内部传感器 2 名称
/// </summary>
[SugarColumn(ColumnName = "T2NAME")]
public string T2Name { get; set; }
/// <summary>
/// 内部传感器 3 名称
/// </summary>
[SugarColumn(ColumnName = "T3NAME")]
public string T3Name { get; set; }
/// <summary>
/// 内部传感器 4 名称
/// </summary>
[SugarColumn(ColumnName = "T4NAME")]
public string T4Name { get; set; }
/// <summary>
/// 内部传感器 5 名称
/// </summary>
[SugarColumn(ColumnName = "T5NAME")]
public string T5Name { get; set; }
/// <summary>
/// 内部传感器 6 名称
/// </summary>
[SugarColumn(ColumnName = "T6NAME")]
public string T6Name { get; set; }
/// <summary>
/// 是否测试部件”Y”测试
/// </summary>
@ -208,6 +170,8 @@ namespace Admin.Core.Model
/// </summary>
[SugarColumn(ColumnName = "LOWVOLTAGE")]
public decimal LowVoltage { get; set; }
/// <summary>
/// 同步时间
/// </summary>

@ -18,7 +18,7 @@ namespace Admin.Core.Model
/// <summary>
/// 主键
/// </summary>
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
[SugarColumn(IsPrimaryKey = true)]
public int ID { get; set; }
/// <summary>
/// 线号
@ -28,7 +28,7 @@ namespace Admin.Core.Model
/// <summary>
/// 工位号
/// </summary>
public int Gongwno { get; set; }
public int GongwNo { get; set; }
/// <summary>
/// 产品条码
@ -43,13 +43,19 @@ namespace Admin.Core.Model
/// <summary>
/// 基准型号
/// </summary>
public string FactoryModel { get; set; }
public string factoryModel { get; set; }
/// <summary>
/// 基准型号
/// </summary>
public string factoryOrder { get; set; }
/// <summary>
/// 工作电压
/// </summary>
public int Voltage { get; set; }
/// <summary>
///
/// </summary>
public int Frequency { get; set; }
/// <summary>
/// 测试通道
/// </summary>
@ -99,61 +105,32 @@ namespace Admin.Core.Model
/// 第几次测试
/// </summary>
public int TestNo { get; set; }
public int DataLengthT { get; set; }
/// <summary>
/// 温度数据
/// </summary>
public string Temp_Mes { get; set; }
public int DataLengthP { get; set; }
/// <summary>
/// 功率数据
/// </summary>
public string Power_Mes { get; set; }
/// <summary>
/// 部件测试数据
/// </summary>
public string Part_Mes { get; set; }
/// <summary>
/// 故障代码
/// </summary>
public string ErrorCode_Mes { get; set; }
public int OrderCount { get; set; }
/// <summary>
/// 内部传感器 1 名称
/// </summary>
public string T1Name { get; set; }
/// <summary>
/// 内部传感器 2 名称
/// </summary>
public string T2Name { get; set; }
public string T_Name { get; set; }
/// <summary>
/// 内部传感器 3 名称
///是否测试部件”Y”测试
/// </summary>
public string T3Name { get; set; }
/// <summary>
/// 内部传感器 4 名称
/// </summary>
public string T4Name { get; set; }
/// <summary>
/// 内部传感器 5 名称
/// </summary>
public string T5Name { get; set; }
/// <summary>
/// 内部传感器 6 名称
/// </summary>
public string T6Name { get; set; }
/// <summary>
/// 是否测试部件”Y”测试
/// </summary>
public string IsOrder { get; set; }
public string isOrder { get; set; }
/// <summary>
/// 低压启动测试时间
@ -179,5 +156,26 @@ namespace Admin.Core.Model
/// 低压启动测试电压
/// </summary>
public decimal LowVoltage { get; set; }
public int isMESRead { get; set; }
/// <summary>
/// 低压启动测试电压
/// </summary>
public DateTime CodeDateTime { get; set; }
/// <summary>
/// 低压启动测试电压
/// </summary>
public int isCopyRead { get; set; }
/// <summary>
/// 低压启动测试电压
/// </summary>
public DateTime CodeDateTime2 { get; set; }
public string GE_CpNo { get; set; }
public string GE_CpModel { get; set; }
/// <summary>
/// 是否同步 1同步 0 位同步
/// </summary>
public int IsSync { get; set; }
}
}

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Model")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f242c55c6773055ed882072b4cbd144f26a025f1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5972c771230554e7ffbf66d51846cd501637e447")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Model")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Model")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
1aeaf67c9b05c0229d5cde75302719d662a4718be25a06f06faf717d4b7ecb6e
5b3de9b5743074ed362450d920da18b56180e797235d4eba9eed0f9c19e5101c

@ -30,5 +30,11 @@ namespace Admin.Core.Repository
return list;
}
#endregion
public int UpateTemperatureHistoryFlag(List<TestedCode_MES> mes)
{
var r = Db.CopyNew().Updateable(mes).UpdateColumns(it => new { it.IsSync}).ExecuteCommand(); ;
return r;
}
}
}

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Repository")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f242c55c6773055ed882072b4cbd144f26a025f1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5972c771230554e7ffbf66d51846cd501637e447")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Repository")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Repository")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
b421458c05255ab19c6ba5623d1ed22be575b82ed8d7983727203ddffdd5b0aa
8ba667252ca16fab385dcb2d4668df57b2070d4ed5f6f76f06f05f8ebe489baf

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Serilog.Es")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f242c55c6773055ed882072b4cbd144f26a025f1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5972c771230554e7ffbf66d51846cd501637e447")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Serilog.Es")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Serilog.Es")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
9d1ed847a59d4aaa1c69df7da8b87e219b4aa9e3db77ec0e15f4efb6543c845c
eccc15ed85fe869f68dfcf35d0b6292c4c4ee8c6f2ef025e659bc791fabdf8b2

@ -46,20 +46,17 @@ namespace Admin.Core.Service
/// <returns>获取合适货道</returns>
public async Task<List<BaseSpaceInfo>> InStoreGetSpaceInfoByMaterialType(string store, string materialType)
{
List<BaseSpaceInfo> spaceInfos = null;
try
{
spaceInfos = await _baseSpaceInfoRepository.QueryAsync(x => x.StoreCode == store && (x.MaterialType == materialType || x.typeCodeB == materialType || x.typeCodeC == materialType ) && x.SpaceStatus == 1);
if (spaceInfos == null || spaceInfos.Count == 0)
return null;
logHelper.Info($"根据仓库{store};物料:{materialType};获取到的货道信息:{spaceInfos.ToJson()}");
spaceInfos = await _baseSpaceInfoRepository.QueryAsync(x => x.StoreCode == store && (x.MaterialType == materialType || x.typeCodeB == materialType || x.typeCodeC == materialType) && x.SpaceStatus == 1);
if (spaceInfos == null || spaceInfos.Count == 0) return null;
}
catch (Exception ex)
{
logHelper.Error("入库通过物料类型获取货道信息异常", ex);
Console.WriteLine($"入库通过物料类型获取货道信息异常:{ex.Message}");
}
return spaceInfos;
}

@ -29,5 +29,10 @@ namespace Admin.Core.Service
{
return _testedCodeMESRepository.QueryTemperatureHistory(time);
}
public int UpateTemperatureHistoryFlag(List<TestedCode_MES> list)
{
return _testedCodeMESRepository.UpateTemperatureHistoryFlag(list);
}
}
}

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Service")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f242c55c6773055ed882072b4cbd144f26a025f1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5972c771230554e7ffbf66d51846cd501637e447")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Service")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Service")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
f06bf3f95de6133293581e9c4d429b8fc9930722c7d92c532fcb3f4c84aab97d
a10e0780416426304801009d0aa85274d1639779b70a2e8d8703d332b3513a06

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Tasks")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f242c55c6773055ed882072b4cbd144f26a025f1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5972c771230554e7ffbf66d51846cd501637e447")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Tasks")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Tasks")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
f7fa8a41ec3905813b997136243c860aeed960ff6eeb235d5d9115eb72d57db0
49a715b382f39d30953405dc212b106cf0da985854a38dd3ede368558dc2ca64

@ -14,7 +14,7 @@
<ItemGroup>
<Content Include="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>

@ -1,10 +1,6 @@
using Admin.Core.Common;
using Admin.Core.Extensions;
using Admin.Core.Extensions.Middlewares;
using Admin.Core.IService.ISys;
using Admin.Core.Tasks;
using Aucma.Core.RunPlc;
using Aucma.Core.Tasks;
using Aucma.Core.TemperatureTask;
using Autofac;
using Microsoft.AspNetCore.Builder;

@ -89,17 +89,33 @@
"DBType": 1,
"Enabled": true,
"HitRate": 40,
"Connection": "Data Source=localhost;Initial Catalog=TOPLINE_T10_E_P2_32_AUCMA_HeNan_D_261;User ID=sa;Password=sa;",
"Connection": "Data Source=10.10.92.149;Initial Catalog=TOPLINE_T10_E_P2_32_AUCMA_HeNan_D_261;User ID=mes;Password=Aucma@2024;",
"ProviderName": "System.Data.SqlClient"
}
//{
// "ConnId": "Hsdb",
// "DBType": 1,
// "Enabled": true,
// "HitRate": 10,
// "Connection": "Data Source=localhost;Initial Catalog=Hsdb;User ID=sa;Password=sa;",
// "ProviderName": "System.Data.SqlClient"
//}
],
"QuartzNetJob": [
{
"ID": 1,
"Name": "TestTask",
"JobGroup": "DEFAULT",
"Cron": "*/5 * * * * ?",
"AssemblyName": "Admin.Core.Tasks",
"ClassName": "Job_Admin_Quartz",
"Remark": "执行任务调度系统",
"RunTimes": 3881,
"BeginTime": "2023-04-23 11:08:50.000",
"EndTime": "2324-08-06 16:45:30.000",
"TriggerType": 1,
"IntervalSecond": 1,
"CycleRunTimes": 1,
"IsStart": true,
"JobParams": null,
"DelFlag": false,
"CreateBy": "admin",
"CreateTime": "2023-04-23 11:09:22.0000000",
"UpdateBy": "admin",
"UpdateTime": "2023-08-07 16:45:45.0530000"
}
],
"Startup": {
"Cors": {
@ -128,9 +144,109 @@
"Enabled": false //Nacos
}
},
"Redis": {
//"ConnectionString": "127.0.0.1:6379"
"ConnectionString": "127.0.0.1:6379"
},
"Common": {
"TemperatureApiAddRess": "http://10.100.72.10:8080"
},
"RabbitMQ": {
"Enabled": true,
"Connection": "http://localhost:15672/",
"UserName": "robin",
"Password": "123456",
"RetryCount": 3
},
"EventBus": {
"Enabled": true,
"SubscriptionClientName": "Admin.Core"
},
"Middleware": {
"AucamTask": {
"QuartzNetJob": {
"Enabled": false
},
"ScannerGun": {
"Enabled": true
},
"Scanner": {
"Enabled": true
},
"AucamTask": {
"Enabled": false
}
},
"PLCServer": [
{
"Id": 1,
"EquipName": "MCPlc1",
"IP": "10.10.93.151",
"Port": 5002
},
{
"Id": 1,
"EquipName": "MCPlc2",
"IP": "10.10.93.152",
"Port": 5002
},
{
"Id": 1,
"EquipName": "MCPlc3",
"IP": "10.10.93.153",
"Port": 5002
},
{
"Id": 1,
"EquipName": "MCPlc4",
"IP": "10.10.93.154",
"Port": 5002
}
],
"IpRateLimiting": {
"EnableEndpointRateLimiting": false, //False: globally executed, true: executed for each
"StackBlockedRequests": false, //False: Number of rejections should be recorded on another counter
"RealIpHeader": "X-Real-IP",
"ClientIdHeader": "X-ClientId",
"IpWhitelist": [], //
"EndpointWhitelist": [ "get:/api/xxx", "*:/api/yyy" ],
"ClientWhitelist": [ "dev-client-1", "dev-client-2" ],
"QuotaExceededResponse": {
"Content": "{{\"status\":429,\"msg\":\"访问过于频繁,请稍后重试\",\"success\":false}}",
"ContentType": "application/json",
"StatusCode": 429
},
"HttpStatusCode": 429, //
"GeneralRules": [ //api,*
{
"Endpoint": "*:/api/Admin*",
"Period": "1m",
"Limit": 20
},
{
"Endpoint": "*/api/*",
"Period": "1s",
"Limit": 3
},
{
"Endpoint": "*/api/*",
"Period": "1m",
"Limit": 30
},
{
"Endpoint": "*/api/*",
"Period": "12h",
"Limit": 500
}
]
},
"LogFiedOutPutConfigs": {
"tcpAddressHost": "", // elktcp
"tcpAddressPort": 0, // elktcp
"ConfigsInfo": [ // elk
{
"FiedName": "applicationName",
"FiedValue": "Admin.Core.Api"
}
]
}
}

@ -67,10 +67,11 @@ namespace Aucma.Core.BoxFoam.Business
//采集注料记录
Task.Run(() =>
{
Thread.Sleep(3000);
while (true)
{
Thread.Sleep(3000);
var obj = PlcHelper.siemensList.FirstOrDefault(d => d.EquipName.Equals("foamMachinePlc"));
ReadFillingRecord(obj);
Thread.Sleep(200);
}

@ -2,26 +2,15 @@
using Admin.Core.Common;
using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Service;
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Aucma.Core.Scanner;
using static Aucma.Core.Scanner.ScannerService;
using Admin.Core.Model.Model_New;
using Quartz;
using StackExchange.Profiling.Internal;
using Aucma.Core.HwPLc;
using System.Windows.Documents;
using System.Timers;
using NetTaste;
using Org.BouncyCastle.Asn1.Tsp;
using System.Printing;
namespace Aucma.Core.BoxFoam.Business
{
@ -43,6 +32,7 @@ namespace Aucma.Core.BoxFoam.Business
/// </summary>
private List<RealTaskInfo> TaskInfos = new List<RealTaskInfo>();
private Dictionary<string, int> KeyValuePairs = new Dictionary<string, int>();
#region 事件
/// <summary>
/// 扫码信息刷新
@ -83,7 +73,10 @@ namespace Aucma.Core.BoxFoam.Business
#endregion
private string storeCode = string.Empty;
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(InStoreBusiness));
#region 初始化
private readonly IBaseSpaceInfoServices? _baseSpaceInfoServices = App.ServiceProvider.GetService<IBaseSpaceInfoServices>();
private readonly IRealTaskInfoServices? _realTaskInfoService = App.ServiceProvider.GetService<IRealTaskInfoServices>();
private readonly IProductPlanInfoServices? _productPlanInfoServices = App.ServiceProvider.GetService<IProductPlanInfoServices>();
@ -93,22 +86,37 @@ namespace Aucma.Core.BoxFoam.Business
// 过点数据表物料完成记录MaterialCompletion
private readonly IMaterialCompletionServices? _iMaterialCompletionServices = App.ServiceProvider.GetService<IMaterialCompletionServices>();
private readonly IPrintBarCodeServices? _printBarCodeServices = App.ServiceProvider.GetService<IPrintBarCodeServices>();
private PlcSpaceConfig spaceConfig = PlcSpaceConfig.Instance;
private readonly IBaseMaterialInfoServices? _baseMaterialInfoServices = App.ServiceProvider.GetService<IBaseMaterialInfoServices>();
#endregion
#region 初始化对象
private PlcSpaceConfig spaceConfig = PlcSpaceConfig.Instance;
private SemaphoreSlim semaphore = new SemaphoreSlim(0);
private string storeCode = Appsettings.app("StoreInfo", "BeforeStoreCode");//泡前库code
private List<BaseSpaceInfo> allSpaces = null;
private List<SpaceAddress> spaceAddresses = new List<SpaceAddress>();
private SemaphoreSlim _lock = new SemaphoreSlim(1);
#endregion
#region 构造函数
public InStoreBusiness()
{
MvCodeHelper.PQKReceiveCodeEvent += InStore;
storeCode = Appsettings.app("StoreInfo", "BeforeStoreCode");//泡前库code
init();
}
public void init()
{
#endregion
#region 初始化入库任务---模拟测试启用
/// <summary>
/// 初始化入库任务
/// </summary>
public async void init()
{
try
{
allSpaces = _baseSpaceInfoServices.Query(x => x.StoreCode == storeCode);
@ -117,10 +125,10 @@ namespace Aucma.Core.BoxFoam.Business
spaceAddresses.Add(spaceConfig.GetSpaceAddress(storeCode, space.SpaceCode));
}
// 模拟入库
//Task.Run(() =>
//Task.Run(async () =>
//{
// Thread.Sleep(5000);
// InStore("B24010183025024860011");
// await InStore("B24010183025024860011");
//});
//实时监测入库任务下发和入库任务完成
StartPassDownAndRealInstoreFinish();
@ -128,9 +136,12 @@ namespace Aucma.Core.BoxFoam.Business
catch (Exception ex)
{
logHelper.Info(ex.Message.ToString());
Console.WriteLine($"初始化异常:{ex.Message}");
}
}
}
#endregion
#region 定时器实时监测入库出库完成信号
/// <summary>
/// 定时器实时监测入库出库完成信号
/// </summary>
@ -157,7 +168,9 @@ namespace Aucma.Core.BoxFoam.Business
}
}
}
#endregion
#region 实时监测入库任务下发和入库任务完成
/// <summary>
///实时监测入库任务下发和入库任务完成
/// </summary>
@ -181,10 +194,10 @@ namespace Aucma.Core.BoxFoam.Business
Thread.Sleep(1000);
}
});
}
#endregion
}
#region 获取入库任务下发plc
/// <summary>
/// 获取入库任务下发plc
@ -199,7 +212,8 @@ namespace Aucma.Core.BoxFoam.Business
if (taskInfo != null)
{
Console.WriteLine($"下发PLC:{taskInfo.ToJson()}");
#region 测试 禁用PLC 入库先不做交互
if (SendFoamTask_InStore(taskInfo))
{
logHelper.Info($"泡前入库任务:{taskInfo.TaskCode}下发成功等待PLC执行反馈");
@ -217,14 +231,14 @@ namespace Aucma.Core.BoxFoam.Business
RefreshDataGridDelegateEvent?.Invoke();//刷新datagrid 列表
// logHelper.Info($"泡后入库任务:{taskInfo.TaskCode};执行完成");
//logHelper.Info($"泡后入库任务:{taskInfo.TaskCode};执行完成");
// 刷新入库任务列表
}
else
{
logHelper.Info($"泡前入库任务:{taskInfo.TaskCode}下发失败请排除PLC连接");
}
#endregion
}
else
{
@ -237,6 +251,10 @@ namespace Aucma.Core.BoxFoam.Business
}
}
#endregion
#region 获取待执行的入库任务
/// <summary>
/// 获取待执行的入库任务
/// </summary>
@ -256,9 +274,12 @@ namespace Aucma.Core.BoxFoam.Business
logHelper.Info("获取待执行的入库任务异常", ex);
}
return taskInfo;
}
}
#endregion
#region 入库
#region 入库,扫码器委托触发
/// <summary>
/// 入库,扫码器委托触发
/// </summary>
@ -268,25 +289,34 @@ namespace Aucma.Core.BoxFoam.Business
{
try
{
if (string.IsNullOrEmpty(materialBarCode))
{
LogDelegateEvent?.Invoke("未扫到二维码信息!");
Console.WriteLine($"【{DateTime.Now}】未扫到二维码信息,请重新扫码!");
return;
}
Console.WriteLine($"【{DateTime.Now}】扫码成功,物料条码:{materialBarCode}");
logHelper.Info($"扫码成功,物料条码:{materialBarCode}");
LogDelegateEvent?.Invoke($"扫码成功,物料条码:{materialBarCode}");
var taskList = await _realTaskInfoService.QueryAsync(d => d.MaterialCode.Equals(materialBarCode) && d.StoreCode == storeCode);
if (taskList.Count() > 0)
{
LogDelegateEvent?.Invoke($"物料条码[{materialBarCode}],任务创建失败,该物料入库任务已存在!");
Console.WriteLine($"【{DateTime.Now}】物料条码[{materialBarCode}],任务创建失败,该物料入库任务已存在!");
return;
}
//获取要进入的货道
string materialType = SubString(materialBarCode);//截取中间物料条码
BaseSpaceInfo spaceInfo = await GetSpaceInfoByMaterialType(storeCode, materialType);
if (spaceInfo != null)
{
logHelper.Info($"匹配货道:{spaceInfo.ToJson()}");
LogDelegateEvent?.Invoke($"匹配货道:{spaceInfo.ToJson()}");
//Console.WriteLine($"【{DateTime.Now}】匹配货道:{spaceInfo.ToJson()}");
string message = $"箱体码[{materialBarCode}], 入{spaceInfo.SpaceName},入库中....";
Console.WriteLine($"【{DateTime.Now}】{message}");
PrintBarCode print = await _printBarCodeServices.FirstAsync(x => x.MaterialBarcode == materialBarCode);
Console.WriteLine($"【{DateTime.Now}】{message}");
RefreshScanMateriaCodeEvent?.Invoke(materialBarCode, materialType, print.MaterialName, spaceInfo.SpaceName, message); //刷新界面扫码信息
var result = await CreateInStoreTask(spaceInfo, materialBarCode); //创建入库任务
if (result)
@ -304,6 +334,7 @@ namespace Aucma.Core.BoxFoam.Business
//await _iMaterialCompletionServices.AddAsync(completion);
#endregion
RefreshDataGridDelegateEvent?.Invoke();
await _baseSpaceInfoServices.UpdateSpaceInfo(spaceInfo);
}
@ -312,7 +343,6 @@ namespace Aucma.Core.BoxFoam.Business
{
//报警停线
LogDelegateEvent?.Invoke($"未匹配到货道,请设置货道型号!");
}
}
catch (Exception ex)
@ -321,6 +351,8 @@ namespace Aucma.Core.BoxFoam.Business
}
}
#endregion
#region 创建入库任务
/// <summary>
/// 创建入库任务
@ -369,59 +401,54 @@ namespace Aucma.Core.BoxFoam.Business
#endregion
#region 筛选货道
/// <summary>
/// 筛选货道
/// </summary>
/// <param name="storeCode"></param>
/// <param name="materialType"></param>
/// <param name="storeCode">货道编码</param>
/// <param name="materialType">二维码中间8位</param>
/// <returns></returns>
private async Task<BaseSpaceInfo> GetSpaceInfoByMaterialType(string storeCode, string materialType)
{
BaseSpaceInfo result = null;
try
{
List<BaseSpaceInfo> info = await _baseSpaceInfoServices.InStoreGetSpaceInfoByMaterialType(storeCode, materialType);
if (info != null)
Console.WriteLine($"根据仓库{storeCode};物料:{materialType};获取到的货道信息:{info.ToJson()}");
if (info == null || info.Count == 0) return result;
// 更新货道库存
foreach (BaseSpaceInfo item in info)
{
if (info.Count > 0)
{
// 更新货道库存
foreach (BaseSpaceInfo item in info)
{
var spaceInfo = ReadSpaceInfoByPlc(item);
item.SpaceStock = spaceInfo.SpaceStock;
var spaceInfo = ReadSpaceInfoByPlc(item);//更新货道信息
item.SpaceStock = spaceInfo.SpaceStock;
if(item.typeCodeB=="materialType" && (item.SpaceStock+item.OnRouteAmount)==0)
{
string str1 = item.typeCodeB;
string str2 = item.typeNameB;
item.typeCodeB = item.MaterialType;
item.typeNameB = item.typeNameA;
item.MaterialType = str1;
item.typeNameA = str2;
}
// 对调C型号和主型号
else if(spaceInfo.typeCodeC=="materialType" && (item.SpaceStock + item.OnRouteAmount) == 0)
{
string str1 = item.typeCodeC;
string str2 = item.typeNameC;
item.typeCodeC = item.MaterialType;
item.typeNameC = item.typeNameA;
item.MaterialType = str1;
item.typeNameA = str2;
}
}
info = info.Where(x => x.SpaceStatus == 1 && x.SpaceCapacity > (x.SpaceStock + x.OnRouteAmount)).ToList();
if(info.Count > 0)
{
result = info.OrderByDescending(x => x.SpaceStock).First();
}
if (item.typeCodeB == "materialType" && (item.SpaceStock + item.OnRouteAmount) == 0)
{
string str1 = item.typeCodeB;
string str2 = item.typeNameB;
item.typeCodeB = item.MaterialType;
item.typeNameB = item.typeNameA;
item.MaterialType = str1;
item.typeNameA = str2;
}
// 对调C型号和主型号 需要确定未什么要对调类型?
else if (spaceInfo.typeCodeC == "materialType" && (item.SpaceStock + item.OnRouteAmount) == 0)
{
string str1 = item.typeCodeC;
string str2 = item.typeNameC;
item.typeCodeC = item.MaterialType;
item.typeNameC = item.typeNameA;
item.MaterialType = str1;
item.typeNameA = str2;
}
}
info = info.Where(x => x.SpaceStatus == 1 && x.SpaceCapacity > (x.SpaceStock + x.OnRouteAmount)).ToList();
if (info == null || info.Count == 0) return result;
result = info.OrderByDescending(x => x.SpaceStock).First();
return result;
}
catch (Exception ex)
{
@ -431,10 +458,13 @@ namespace Aucma.Core.BoxFoam.Business
return result;
}
#endregion
#region 通过PLC获取货道信息
/// <summary>
/// 通过PLC获取货道信息
/// </summary>
/// <param name="spaceInfo"></param>
/// <param name="spaceInfo">货道信息</param>
/// <returns></returns>
public BaseSpaceInfo ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo)
{
@ -442,13 +472,14 @@ namespace Aucma.Core.BoxFoam.Business
var obj = PlcHelper.siemensList.FirstOrDefault(d => d.EquipName.Equals("泡前库Plc"));
if (obj != null && obj.plc.IsConnected)
{
//将货道信息更新到配置文件中
SpaceAddress spaceAddress = spaceConfig.GetSpaceAddress(spaceInfo.StoreCode, spaceInfo.SpaceCode);
spaceInfo.SpaceStock = obj.plc.ReadInt16(spaceAddress.onStore);
spaceInfo.SpaceStock = obj.plc.ReadInt16(spaceAddress.onStore);//获取
}
return spaceInfo;
}
}
#endregion
#endregion
@ -465,7 +496,6 @@ namespace Aucma.Core.BoxFoam.Business
}
#endregion
#region 泡前入库任务下发处理
public bool SendFoamTask_InStore(RealTaskInfo taskInfo)
{
@ -564,6 +594,7 @@ namespace Aucma.Core.BoxFoam.Business
}
#endregion
#region 入库完成
/// <summary>
/// 入库完成
/// </summary>
@ -583,20 +614,20 @@ namespace Aucma.Core.BoxFoam.Business
if (spaceInfo != null)
{
spaceInfo.MaterialType = taskInfo.MaterialType;
//读取PLC获取货道信息存放数量、在途数量,
#region Add By wenjy 2023-10-30 13:44:00 通过PLC获取货道信息
var item = ReadSpaceInfoByPlc(spaceInfo);
spaceInfo.SpaceStock = item.SpaceStock;
if (spaceInfo.OnRouteAmount>0)
if (spaceInfo.OnRouteAmount > 0)
{
// 入库完成在途减1
spaceInfo.OnRouteAmount -= 1;
}
#endregion
#region 添加货道明细 不控制出库,暂时未添加明细
BaseSpaceDetail spaceDetail = new BaseSpaceDetail();
@ -623,8 +654,8 @@ namespace Aucma.Core.BoxFoam.Business
await _baseSpaceInfoServices.UpdateSpaceInfo(spaceInfo);
_ = _recordInstoreServices.AddAsync(recordInstore).Result;
bool result = _realTaskInfoService.DeleteAsync(taskInfo).Result;
// bool result = await _recordInstoreServices.SaveRecordToDb(recordInstore, taskInfo, spaceInfo, spaceDetail);
bool result = _realTaskInfoService.DeleteAsync(taskInfo).Result;
// bool result = await _recordInstoreServices.SaveRecordToDb(recordInstore, taskInfo, spaceInfo, spaceDetail);
if (result)
{
LogDelegateEvent?.Invoke($"入库完成,更新数据库成功");
@ -634,7 +665,7 @@ namespace Aucma.Core.BoxFoam.Business
{
LogDelegateEvent?.Invoke($"更新数据库异常");
}
}
////清除任务信息
//await _realTaskInfoService.DeleteTaskInfo(taskCode, storeCode);
@ -647,6 +678,9 @@ namespace Aucma.Core.BoxFoam.Business
}
}
#endregion
#region 获取物料名称
/// <summary>
///获取物料名称
/// </summary>
@ -663,6 +697,8 @@ namespace Aucma.Core.BoxFoam.Business
return materialName;
}
#endregion
#region PLC 任务处理表
/// <summary>
/// PLC 任务处理表

@ -64,6 +64,7 @@ namespace Aucma.Core.BoxFoam.Business
Console.WriteLine("Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]");
// RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), LinerScannerIp);
// 业务处理
Console.WriteLine(strCode.Trim().TrimEnd('\0'));
PQKReceiveCodeEvent?.Invoke(strCode.Trim().TrimEnd('\0'));
}
}

@ -31,7 +31,7 @@ namespace Aucma.Core.BoxFoam.ViewModels
public IndexPageViewModel()
{
inStoreBusiness.init();
// inStoreBusiness.init();//初始化界面?
_recordInstoreServices = App.ServiceProvider.GetService<IRecordInStoreServices>();

@ -14,6 +14,7 @@ namespace Aucma.Core.BoxFoam.ViewModels
private AfterFoamingPageView afterFoaming = new AfterFoamingPageView();
LinerInventory linerInventoryView =new LinerInventory();
ShellInventory shellInventoryView =new ShellInventory();
public RealTimeInventoryPageViewModel()
{
InventoryControl = beforeFoaming;

@ -49,13 +49,10 @@ namespace Aucma.Core.BoxFoam.ViewModels
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(BaseSpaceInfoServices));
private readonly IBaseMaterialInfoServices? _baseMaterialInfoServices;
private readonly IBaseSpaceInfoServices _baseSpaceInfoServices;
public RelayCommand<object> MouseClickCommand { get; set; }
private string spaceCodes = string.Empty;
private AppConfigHelper appConfig = new AppConfigHelper();
@ -150,7 +147,7 @@ namespace Aucma.Core.BoxFoam.ViewModels
public async void Load()
{
var infos = await _baseMaterialInfoServices.QueryAsync(x=>x.MaterialSubclass=="400");
var infos = await _baseMaterialInfoServices.QueryAsync(x=>x.MaterialSubclass=="200");
MaterialDataGrid.Clear();
Application.Current.Dispatcher.Invoke(() =>
{
@ -366,7 +363,7 @@ namespace Aucma.Core.BoxFoam.ViewModels
{
if (!string.IsNullOrEmpty(searchText))
{
var infos =await _baseMaterialInfoServices.QueryAsync(x=>x.MaterialSubclass=="400" && (x.MaterialName.Contains(searchText) || x.MaterialCode.Contains(searchText)));
var infos =await _baseMaterialInfoServices.QueryAsync(x=>x.MaterialSubclass== "200" && (x.MaterialName.Contains(searchText) || x.MaterialCode.Contains(searchText)));
MaterialDataGrid.Clear();
Application.Current.Dispatcher.Invoke(() =>
{

@ -108,7 +108,7 @@
"TriggerType": 1,
"IntervalSecond": 5,
"CycleRunTimes": 1,
"IsStart": true,
"IsStart": false,
"JobParams": null,
"DelFlag": false,
"CreateBy": "admin",

@ -3,6 +3,7 @@ using Admin.Core.Model;
using Admin.Core.Model.ViewModels;
using Aucma.Core.PrintTo.Models;
using Aucma.Core.PrintTo.Views;
using Castle.Core.Internal;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
@ -153,7 +154,7 @@ namespace Aucma.Core.PrintTo.ViewModels
}
if (type == "箱体")
{
printType = 400;
printType = 200;
}
}
#endregion
@ -181,9 +182,9 @@ namespace Aucma.Core.PrintTo.ViewModels
MessageBox.Show("请输入打印数量!", "系统提醒");
return;
}
if (SelectedCells.PlanAmount == 0)
if (SelectedCells.PlanAmount < PrintAmount)
{
MessageBox.Show("请输入打印数量!", "系统提醒");
MessageBox.Show("打印数量能高于计划数量!", "系统提醒");
return;
}
if (printType==0)
@ -194,7 +195,6 @@ namespace Aucma.Core.PrintTo.ViewModels
try
{
string order_code = SelectedCells.OrderCode;
string product_code = SelectedCells.ProductCode;
string product_name = SelectedCells.ProductName;
@ -205,8 +205,12 @@ namespace Aucma.Core.PrintTo.ViewModels
PrintIsEnabled = "False";
//更新打印名称
var baseOrder= _baseOrderInfoServices.FirstAsync(d=>d.OrderCode== order_code).Result;
_ = _baseOrderInfoServices.UpdatePrintName(baseOrder).Result;
var baseOrder = _baseOrderInfoServices.FirstAsync(d => d.OrderCode == order_code).Result;
if (string.IsNullOrEmpty(baseOrder.PrintName))
{
baseOrder.PrintName = printName;
_ = _baseOrderInfoServices.UpdatePrintName(baseOrder).Result;
}
PrintToDevView printToDev = new PrintToDevView(order_code,product_code, product_name, standard_amount, printName,printType);
printToDev.ShowDialog();
}

@ -260,8 +260,9 @@ namespace Aucma.Core.PrintTo.ViewModels
{
tmpList.Clear();
BaseBomInfo baseBomInfo = null;
List<BaseBomInfo> orderBomInfoList = await _baseBomInfoServices.QueryAsync();
if (printType== 400)//箱壳
if (printType== 200)//箱体
{
GetParentID(orderBomInfoList, productCode);
//OrderBomInfo obj = await _orderBomInfoServices.FirstAsync(d => d.MaterialCode == materialCode);
@ -270,7 +271,10 @@ namespace Aucma.Core.PrintTo.ViewModels
MessageBox.Show("无法查询打印条码数据", "系统提醒");
return;
}
baseBomInfo= tmpList.FirstOrDefault(d=>d.MaterialType== "400");
baseBomInfo= tmpList.FirstOrDefault(d=>d.MaterialType== "200");
ProductCode = baseBomInfo.MaterialCode;
ProductName = baseBomInfo.MaterialName;
}
if (printType == 500)//内胆
{
@ -282,6 +286,9 @@ namespace Aucma.Core.PrintTo.ViewModels
return;
}
baseBomInfo = tmpList.FirstOrDefault(d => d.MaterialType == "500");
ProductCode = baseBomInfo.MaterialCode;
ProductName = baseBomInfo.MaterialName;
}
if (baseBomInfo == null)
@ -314,7 +321,7 @@ namespace Aucma.Core.PrintTo.ViewModels
{
var item = BarcodesUnprinted.Peek();
string barCode = string.Empty;
if (_printType== 400)
if (_printType== 200)
{
string rowNum = GetMaxNumAsync(item.MaterialCode,"B").Result;//最大值+1
barCode = $"B{DateTime.Now.ToString("yyMMdd")}{item.MaterialCode}{rowNum}";
@ -387,7 +394,6 @@ namespace Aucma.Core.PrintTo.ViewModels
}
//打印完成
SetCompletetd();
Thread.Sleep (1000);
}
catch (Exception ex)
{

@ -183,7 +183,7 @@
<DataGridTextColumn Width="1.2*" Binding="{Binding ProductCode}" Header="产品编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="3*" Binding="{Binding ProductName}" Header="产品型号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding PlanAmount}" Header="订单数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding CompleteAmount}" Header="完成数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding CompleteAmount}" Header="下线数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<!--<DataGridTextColumn Width="*" Binding="{Binding LinerAmount}" Header="内胆编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Width="*" Binding="{Binding BoxAmount}" Header="箱体编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>-->
<DataGridTextColumn Width="*" Binding="{Binding LinerCodeNum}" Header="内胆码&#x0a;已打数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>

@ -1,8 +1,12 @@
using Admin.Core.IService;
using Admin.Core.Common;
using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using log4net;
using Serilog;
using StackExchange.Profiling.Internal;
using System.Collections.Generic;
using System.Timers;
/// <summary>
/// 测温数据采集
@ -17,22 +21,29 @@ namespace Aucma.Core.TemperatureTask
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(AucamTemperatureMeasurementService));
private readonly ITestedCodeMESServices _codeMESServices;
private readonly ITemperatureHistoryServices _temperatureHistoryServices;
private readonly IMaterialCompletionServices _materialCompletionServices;
private readonly IPrintBarCodeServices _printBarCodeServices;
private readonly IReportQualityInspectionServices _reportQualityInspectionServices;
System.Timers.Timer timer1 = new System.Timers.Timer(5000);
bool flag = true;
public AucamTemperatureMeasurementService(ITemperatureHistoryServices temperatureHistoryServices,
ITestedCodeMESServices codeMESServices)
ITestedCodeMESServices codeMESServices, IMaterialCompletionServices materialCompletionServices,
IPrintBarCodeServices printBarCodeServices, IReportQualityInspectionServices reportQualityInspectionServices)
{
_codeMESServices = codeMESServices;
_temperatureHistoryServices = temperatureHistoryServices;
_materialCompletionServices = materialCompletionServices;
_printBarCodeServices = printBarCodeServices;
_reportQualityInspectionServices = reportQualityInspectionServices;
}
public void Execute()
{
while (true)
{
Run();
Thread.Sleep(5000);
}
timer1.Elapsed += new System.Timers.ElapsedEventHandler(Run); //到达时间的时候执行事件;
timer1.AutoReset = true;//设置是执行一次false还是一直执行(true)
timer1.Enabled = true;//需要调用 timer.Start()或者timer.Enabled = true来启动它
timer1.Start();//timer.Start()的内部原理还是设置timer.Enabled = true;
}
#region 采集任务处理
@ -40,87 +51,67 @@ namespace Aucma.Core.TemperatureTask
/// 采集任务处理
/// </summary>
/// <returns></returns>
public async void Run()
private void Run(object? sender, ElapsedEventArgs e)
{
try
{
Console.WriteLine($"【{DateTime.Now}】开始读取测温数据");
if (flag)
{
try
{
flag = false;
DateTime dt;
Console.WriteLine($"【{DateTime.Now}】开始读取测温数据");
string sql = "select top 1 * from TemperatureHistory order by SyncDate desc";
var allList= await _temperatureHistoryServices.QuerySqlAsync(sql,null);
if (allList == null || allList.Count == 0)
{
dt = DateTime.Now.AddMinutes(-5);
}
else
{
TemperatureHistory maxHistory = allList.First();
if (maxHistory.SyncDate.ToString()==null)
{
dt = Convert.ToDateTime(maxHistory.EndDateTime);
}
else
{
dt = Convert.ToDateTime(maxHistory.SyncDate);
}
}
var historyList = _codeMESServices.QueryTemperatureHistory(dt);
var historyList = _codeMESServices.QueryAsync(d=>d.IsSync==0).Result;
Console.WriteLine(historyList.ToJson());
var query = (from a in historyList
select new TemperatureHistory
{
Line_No = a.Line_No,
Gongwno = a.Gongwno,
GongwNo = a.GongwNo,
CpNo = a.CpNo,
CpModel = a.CpModel,
FactoryModel = a.FactoryModel,
FactoryModel = a.factoryModel,
Voltage = a.Voltage,
Frequency = a.Frequency,
Point2 = a.Point2,
TestTime = a.TestTime,
TestedTime = a.TestedTime,
Etemp = a.Etemp,
BeginDateTime = a.BeginDateTime,
BeginDateTime =Convert.ToDateTime(a.BeginDateTime),
CpResult = a.CpResult,
EndDateTime = a.EndDateTime,
EndDateTime = Convert.ToDateTime(a.EndDateTime),
UserName = a.UserName,
Remark = a.Remark,
TestNo = a.TestNo,
Temp_Mes = a.Temp_Mes,
Power_Mes = a.Power_Mes,
Part_Mes = a.Part_Mes,
ErrorCode_Mes = a.ErrorCode_Mes,
T1Name = a.T1Name,
T2Name = a.T2Name,
T3Name = a.T3Name,
T4Name = a.T4Name,
T5Name = a.T5Name,
T6Name = a.T6Name,
IsOrder = a.IsOrder,
LowV_Time = a.LowV_Time,
LowV_PowerMin = a.LowV_PowerMin,
LowV_PowerMax = a.LowV_PowerMax,
LowV_PowerFact = a.LowV_PowerFact,
LowVoltage = a.LowVoltage,
SyncDate = dt
SyncDate =DateTime.Now
}).ToList();
if (query == null|| query.Count==0) return;
if (query == null || query.Count == 0) return;
logHelper.Error($"读取数据个数:{historyList.Count()}");
Console.WriteLine($"【{DateTime.Now}】读取数据个数:{historyList.Count()}");
var result = await _temperatureHistoryServices.AddAsync(query);
var result = _temperatureHistoryServices.AddAsync(query).Result;
if (result > 0)
{
Console.WriteLine($"【{DateTime.Now}】保存测温数据成功!保存数量:{query.Count}");
}
Thread.Sleep(50000);
historyList.ForEach(d => d.IsSync = 1);
int r = _codeMESServices.UpateTemperatureHistoryFlag(historyList);
if (r > 0)
{
InsertToCompleteAndCheck(query);//保存过点数据
//发送post 请求
PostToMes(query);
Console.WriteLine($"【{DateTime.Now}】保存测温数据成功!保存数量:{query.Count}");
} }
Console.WriteLine($"【{DateTime.Now}】测温数据同步成功!数量:{query.Count}");
}
catch (Exception ex)
{
@ -129,16 +120,78 @@ namespace Aucma.Core.TemperatureTask
}
finally { flag = true; }
}
}
catch (Exception ex)
{
logHelper.Error($"测温数据处理异常:{ex.Message}");
Console.WriteLine($"测温数据处理异常:{ex.Message}");
}
}
#endregion
#region 保存过点数和测温质检
/// <summary>
/// 保存过点数和测温质检
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public bool InsertToCompleteAndCheck(List<TemperatureHistory> list)
{
List<MaterialCompletion> completionList = new List<MaterialCompletion>();
var printBarCodeList = _printBarCodeServices.QueryAsync().Result;
foreach (var temperatureHistory in list)
{
PrintBarCode barcode = printBarCodeList.First(d => d.MaterialBarcode == temperatureHistory.CpNo);
if (barcode != null) return false;
#region 更新过点数据
MaterialCompletion completion = new MaterialCompletion();
completion.OrderCode = barcode.OrderCode;
completion.MaterialBarcode = temperatureHistory.CpNo;
completion.MaterialCode = barcode.MaterialCode;
completion.MaterialName = barcode.MaterialName;
completion.StationName = "测温检验01";
completion.ProductLineCode = "CX_02";
completion.CompleteDate = DateTime.Now;
completionList.Add(completion);
#endregion
}
int r = _materialCompletionServices.AddAsync(completionList).Result;
if (r > 0) return true;
else return false;
}
#endregion
#region 发送质检请求
/// <summary>
/// 发送质检请求
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public bool PostToMes(List<TemperatureHistory> list)
{
string address = Appsettings.app("Common", "TemperatureApiAddRess");//测温地址
string check = HttpHelper.Post(address + "/report/qualityInspection/temperatureApi", list.ToJson());
Result r = check.FromJson<Result>();
if (r.code == 200)
{
Console.WriteLine("发送质检请求!");
return true;
}
return false;
}
#endregion
}
public class Result{
/// <summary>
/// 返回抓鬼太
/// </summary>
public int code { get; set; }
/// <summary>
/// 返回信息
/// </summary>
public string msg { get; set; }
}
}

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("HwControlLib")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f242c55c6773055ed882072b4cbd144f26a025f1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5972c771230554e7ffbf66d51846cd501637e447")]
[assembly: System.Reflection.AssemblyProductAttribute("HwControlLib")]
[assembly: System.Reflection.AssemblyTitleAttribute("HwControlLib")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
938e93d92c7c67284652ee523db08e364763aa2a01370cdfa8200ffd97beede9
68fe028e8fb6dd00ab226c595d729f086b7922e724f85c2e7a8e8bde11373554

Loading…
Cancel
Save