|
|
|
|
@ -18,14 +18,14 @@ namespace CncCollector.Core
|
|
|
|
|
_connectionString = connectionString;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public (string logText, bool changed, decimal todayTotal) Track(
|
|
|
|
|
public (string logText, bool changed, decimal todayTotal, int? matchedWorkerId) Track(
|
|
|
|
|
int machineId, string programName, decimal? totalPartCount, DateTime collectTime)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(programName) || !totalPartCount.HasValue)
|
|
|
|
|
{
|
|
|
|
|
var skipReason = string.IsNullOrEmpty(programName) ? "程序名为空" : "加工零件总数为空";
|
|
|
|
|
_log.Debug(string.Format("机床{0}: 跳过产量跟踪({1})", machineId, skipReason));
|
|
|
|
|
return ("跳过:" + skipReason, false, 0);
|
|
|
|
|
return ("跳过:" + skipReason, false, 0, null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lock (_lock)
|
|
|
|
|
@ -70,13 +70,13 @@ namespace CncCollector.Core
|
|
|
|
|
new { Mid = machineId, Date = effectiveDate, WorkerId = matchedWorkerId });
|
|
|
|
|
|
|
|
|
|
_log.Info(string.Format("机床{0}: {1}(当日累计产量={2})", machineId, logText, todayTotal));
|
|
|
|
|
return (logText, changed, todayTotal);
|
|
|
|
|
return (logText, changed, todayTotal, matchedWorkerId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_log.Error(string.Format("产量跟踪处理失败(machine_id={0})", machineId), ex);
|
|
|
|
|
return ("异常:" + ex.Message, false, 0);
|
|
|
|
|
return ("异常:" + ex.Message, false, 0, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|