diff --git a/PunchingMistake/Function2.cs b/PunchingMistake/Function2.cs index d7d11ca..d9a8bd1 100644 --- a/PunchingMistake/Function2.cs +++ b/PunchingMistake/Function2.cs @@ -428,10 +428,10 @@ namespace PunchingMistake public static int SavePartAndProduct_New(string barcode, string partNo1, string partNo2, string ZcID, string OrderNo, string WorkClass, string planID, string SerialNo, string barCode1, string barCode2, string barCode3, string barCode4, string barCode5, string barCode6, string stationId, string description,string carMoedelCode) { - int res = 0; + int res = 0; string sql = string.Empty; try { - string sql = @" + sql = @" INSERT INTO [dbo].[tb_Punch_Code_Record] ([barcode] ,[BcpID] @@ -458,7 +458,8 @@ namespace PunchingMistake catch (Exception ex) { //LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name); - return res; + LogHelper.WriteLog("向表tb_Punch_Code_Record保存数据异常,语句:" + sql + "异常原因:" + ex.Message); + return res; } } @@ -501,10 +502,10 @@ namespace PunchingMistake } public static int AddCompleteCount(string ID,string state) { - int res = 0; + int res = 0; string sql = string.Empty; try { - string sql = string.Empty; + if(state == "合格") { sql = " update tb_ZP_MK_Plan set OKCount = OKCount + 1 where ID = '" + ID + "' "; @@ -524,15 +525,16 @@ namespace PunchingMistake catch (Exception ex) { //LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name); + LogHelper.WriteLog("更新tb_ZP_MK_Plan表完成数量异常,语句:" + sql + "异常原因:" + ex.Message); return res; } } public static int UpdateRecordFlag(string ID, string state) { - int res = 0; + int res = 0; string sql = string.Empty; try { - string sql = string.Empty; + sql = $" update tb_Punch_Code_Record set Flag = {state} where ID = '" + ID + "' "; res = SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnString, CommandType.Text, sql, null); @@ -540,6 +542,7 @@ namespace PunchingMistake } catch (Exception ex) { + LogHelper.WriteLog("更新tb_Punch_Code_Record表Flag状态异常,语句:" + sql + "异常原因:" + ex.Message); //LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name); return res; }