zhoufan 7 lat temu
rodzic
commit
31d543b6a4

+ 1 - 1
1.代码/HySoftSMS/HySoftSMS/FrmMain.cs

@@ -176,7 +176,7 @@ namespace HySoftSMS
176 176
                         logtxt += item.号码 + ":" + (string.IsNullOrEmpty(result) ? "发送成功" : "发送失败,原因:" + result) + "\n";
177 177
                         AsyncThreadUI.SetText(rtb1, logtxt, this);
178 178
 
179
-                        bool bl = ti.SetSMSTaskItemSendResult(task.ID, item.ID, string.IsNullOrEmpty(result), result, item.短信内容, balance.ToString());
179
+                        bool bl = ti.SetSMSTaskItemSendResult(task.ID, item.任务条目ID.Value, string.IsNullOrEmpty(result), result, item.短信内容, balance.ToString());
180 180
                         if (bl)
181 181
                         {
182 182
                             Logtxt(item.号码 + ":更新任务成功");

+ 3 - 3
1.代码/HySoftSMS/HySoftSMS/taskitem.cs

@@ -70,15 +70,15 @@ namespace HySoftSMS
70 70
         public bool SetSMSTaskItemSendResult(int taskid, int itemid, bool result, string errinfo,string content, string balance)
71 71
         {
72 72
             bool bl = false;
73
-            var item = new 阿里短信任务执行表().GetModelList(" ID=" + itemid + " and 任务ID=" + taskid).FirstOrDefault();
73
+            var item = new 阿里短信任务执行表().GetModelList(" 任务条目ID=" + itemid + " and 任务ID=" + taskid).FirstOrDefault();
74 74
             var tablename = DbHelperSQL.GetSingle("SELECT [任务条目子表名称] FROM [阿里短信任务表] WHERE [ID]=" + taskid);
75
-            string sql1 = "DELETE FROM [阿里短信任务执行表] WHERE [任务ID]=" + taskid + " AND [ID]=" + itemid;
75
+            string sql1 = "DELETE FROM [阿里短信任务执行表] WHERE [任务ID]=" + taskid + " AND [任务条目ID]=" + itemid;
76 76
             string sql2 = "UPDATE " + tablename + " SET [已执行次数]=[已执行次数]+1,状态=" + (result ? 3 : 2)
77 77
                 + ",最后执行方式=2,最后执行时间=GETDATE(),最后执行是否成功=" + (result ? 1 : -1) + ",最后执行失败原因='" + errinfo
78 78
                 + "' WHERE 任务ID=" + taskid + " AND [ID]=" + itemid;
79 79
             string sql3 = "UPDATE 阿里短信任务表 SET [执行完成数量]=[执行完成数量]+1,[未执行数量]=[未执行数量]-1,[短信已执行完成数量]=[短信已执行完成数量]+1 WHERE ID=" + taskid;
80 80
             string sql4 = "INSERT INTO [任务执行历史表] ([任务ID],[任务条目表名],[任务条目ID],[号码],[结果],[执行方式],[执行时间],[执行内容]) VALUES ('"
81
-                + taskid + "','" + tablename + "','" + item.任务条目ID + "','" + item.号码 + "','" + (result ? 3 : 2) + "',2,GETDATE(),N'" + content + "')";
81
+                + taskid + "','" + tablename + "','" + itemid + "','" + item.号码 + "','" + (result ? 3 : 2) + "',2,GETDATE(),N'" + content + "')";
82 82
 
83 83
 
84 84
             List<string> sqls = new List<string> { sql1, sql2, sql3, sql4 };