Commit c333aff5 by 泽锋 李

fix

parent 4d154e1d
...@@ -4,6 +4,7 @@ using System.Collections.Generic; ...@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Text; using System.Text;
using Dapper; using Dapper;
using System.Linq; using System.Linq;
using AutoTurnOver.Utility;
namespace AutoTurnOver.DB namespace AutoTurnOver.DB
{ {
...@@ -73,7 +74,7 @@ namespace AutoTurnOver.DB ...@@ -73,7 +74,7 @@ namespace AutoTurnOver.DB
using (var t = conn.BeginTransaction()) using (var t = conn.BeginTransaction())
{ {
// 查询当前待出建议的sku // 查询当前待出建议的sku
var sku_list = conn.Query<dc_auto_first_order_sku>(" select * from dc_auto_first_order_sku where order_time < '2020-01-01' and is_error=0 ").AsList(); var sku_list = conn.Query<dc_auto_first_order_sku>(" select * from dc_auto_first_order_sku where order_time < '2020-01-01' and is_error<=10 ").AsList();
var rule_list = conn.Query<dc_auto_first_order_rule>(" select * from dc_auto_first_order_rule ").AsList(); var rule_list = conn.Query<dc_auto_first_order_rule>(" select * from dc_auto_first_order_rule ").AsList();
...@@ -233,15 +234,18 @@ namespace AutoTurnOver.DB ...@@ -233,15 +234,18 @@ namespace AutoTurnOver.DB
} }
catch (Exception ex) catch (Exception ex)
{ {
conn.Execute(" update dc_auto_first_order_sku set is_error=1 where id in @ids ",new { ids = itemGroup.Select(s=>s.id)}); var goods_sku = $"【商品sku】:【{itemGroup.Key.product_inner_code}】【{itemGroup.Key.warehouse_code}】";
conn.Execute(" update dc_auto_first_order_sku set is_error=1 where id in @ids ",new { ids = itemGroup.Select(s=>s.id)},t);
err_count = true; err_count = true;
conn.Insert(new dc_task_error_log conn.Insert(new dc_task_error_log
{ {
message = $"【商品sku】:【{itemGroup.Key.product_inner_code}】【{itemGroup.Key.warehouse_code}】" + ex.Message, message = goods_sku + ex.Message,
stack_trace = ex.StackTrace, stack_trace = ex.StackTrace,
task_name = "auto_first_order_GeneratePurchaseAdvise", task_name = "auto_first_order_GeneratePurchaseAdvise",
date = DateTime.Now date = DateTime.Now
}, t); }, t);
QiYeJiQiRenHelper.QiYeJiQiRenMsPush(new QiYeJiQiRenHelper.QiYeJiQiRenMsDto { msgtype = "text", text = new QiYeJiQiRenHelper.QiYeJiQiRenMsDto.text_dto { content = " 查收异常消息: "+ goods_sku + ex.Message } },
"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=0ff68206-f585-4d1e-824b-630c473978d8");
} }
} }
......
using System;
using System.Collections.Generic;
using System.Text;
namespace AutoTurnOver.Utility
{
public class QiYeJiQiRenHelper
{
public static void QiYeJiQiRenMsPush(QiYeJiQiRenMsDto data,string url)
{
string resultStr = HttpHelper.Request(url, RequestType.POST, data.ToJson(), timeout: 1000 * 60 * 60 * 24, entype: "application/json");
}
public class QiYeJiQiRenMsDto
{
public string msgtype { get; set; }
public text_dto text { get; set; }
public class text_dto
{
public string content { get; set; }
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment