|
@@ -15,6 +15,7 @@ namespace MOKA_Factory_Tools.BLL
|
|
|
/// ""=异常,OncePass,NTF,ReadFial
|
|
|
/// </summary>
|
|
|
public string ResultType = "";
|
|
|
+ private string _strLastSN = "";
|
|
|
protected readonly DAL_AMResult dalAMResult = new DAL_AMResult();
|
|
|
protected readonly DAL_AMYields dalAMYields = new DAL_AMYields();
|
|
|
protected readonly DAL_AMResult_TR dalAMResultTR = new DAL_AMResult_TR();
|
|
@@ -28,9 +29,10 @@ namespace MOKA_Factory_Tools.BLL
|
|
|
/// <param name="bResult">抄写结果:成功或失败</param>
|
|
|
/// <param name="strErrMsg">抄写失败时的描述</param>
|
|
|
/// <returns></returns>
|
|
|
- public bool SetDataBuringResult(string strLine, string strStation, string strSN, string strDSN, bool bResult, int nOrderType, string strErrMsg = "")
|
|
|
+ public bool SetDataBuringResult(string strLine, string strStation, string strSN, string strDSN, bool bResult, string strLastSN, int nOrderType, string strErrMsg = "")
|
|
|
{
|
|
|
MaInfo maInfo;
|
|
|
+ _strLastSN = strLastSN;
|
|
|
DateTime dateNow = DateTime.Now;
|
|
|
// 通过SN获取MES服务器中记录的ODF、Model、Dissemination信息;
|
|
|
if (CommonMethod.GetMaInfo(strSN, out maInfo, null))
|
|
@@ -159,11 +161,10 @@ namespace MOKA_Factory_Tools.BLL
|
|
|
public bool UpdateAMResults(AMResult model, bool TestResult, string strErrMsg)
|
|
|
{
|
|
|
// 先获取ReDo="0"的记录;
|
|
|
- string strLastSN = CommonMethod.ReadProfileString("MOKAFactoryTools", "LastGSN", "");
|
|
|
AMResult redo0Model = dalAMResult.GetModel(string.Format("Station='{0}' and SN='{1}' and ReDo='{2}'", model.Station, model.SN, "0"));
|
|
|
- if (strLastSN == model.SN)
|
|
|
+ if (_strLastSN == model.SN)
|
|
|
{// 连续抄写数据,更新ReDo="0"的记录;
|
|
|
- Log.WriteInfoLog(string.Format("上一次SN={0} 与当前SN={1} 相同,只更新数据", strLastSN, model.SN));
|
|
|
+ Log.WriteInfoLog(string.Format("上一次SN={0} 与当前SN={1} 相同,只更新数据", _strLastSN, model.SN));
|
|
|
if (!UpdateReDo0AMResult(redo0Model, TestResult, strErrMsg))
|
|
|
{
|
|
|
// 更新失败;
|
|
@@ -395,11 +396,10 @@ namespace MOKA_Factory_Tools.BLL
|
|
|
public bool UpdateAMResults(AMResult_TR model, bool TestResult, string strErrMsg)
|
|
|
{
|
|
|
// 先获取ReDo="0"的记录;
|
|
|
- string strLastSN = CommonMethod.ReadProfileString("MOKAFactoryTools", "LastGSN", "");
|
|
|
AMResult_TR redo0Model = dalAMResultTR.GetModel(string.Format("Station='{0}' and SN='{1}' and ReDo='{2}'", model.Station, model.SN, "0"));
|
|
|
- if (strLastSN == model.SN)
|
|
|
+ if (_strLastSN == model.SN)
|
|
|
{// 连接抄写数据,更新ReDo="0"的记录;
|
|
|
- Log.WriteInfoLog(string.Format("上一次SN={0} 与当前SN={1} 相同,只更新数据", strLastSN, model.SN));
|
|
|
+ Log.WriteInfoLog(string.Format("上一次SN={0} 与当前SN={1} 相同,只更新数据", _strLastSN, model.SN));
|
|
|
if (!UpdateReDo0AMResult(redo0Model, TestResult, strErrMsg))
|
|
|
{
|
|
|
// 更新失败;
|