Commit 00d7ea5f by 泽锋 李

解决由于主从同步延时,导致没有读到写入的采购建议,推送异常的问题

parent 84ded3b1
......@@ -1494,7 +1494,15 @@ and EXISTS (
sql += " limit " + offset + "," + limit;
}
var obj = _connection.Query<dc_auto_purchase_advise_detailed_dto>(sql, parameters, buffered: false, commandTimeout: 0);
List<dc_auto_purchase_advise_detailed_dto> obj = new List<dc_auto_purchase_advise_detailed_dto>();
if (m.data_base_type == 1)
{
MyMySqlConnection._connection.Query<dc_auto_purchase_advise_detailed_dto>(sql, parameters, buffered: false, commandTimeout: 0).ToList();
}
else
{
_connection.Query<dc_auto_purchase_advise_detailed_dto>(sql, parameters, buffered: false, commandTimeout: 0).ToList();
}
return obj.AsList();
}
......
......@@ -344,6 +344,10 @@ namespace AutoTurnOver.Models
public class dc_auto_purchase_advise_detailed_search_dto
{
/// <summary>
/// 数据库类型 0 = 读库,1 = 写库
/// </summary>
public int? data_base_type { get; set; }
/// <summary>
/// 主表ID
/// </summary>
public int main_id { get; set; }
......
......@@ -400,7 +400,7 @@ namespace AutoTurnOver.Services
List<dc_auto_purchase_advise_detailed_dto> datas = new List<dc_auto_purchase_advise_detailed_dto>();
var total = 0;
datas.AddRange(PurchaseAdviseServices.DetailList(new dc_auto_purchase_advise_detailed_search_dto { main_id = mainID, ispush = false }, 0, int.MaxValue, ref total));
datas.AddRange(PurchaseAdviseServices.DetailList(new dc_auto_purchase_advise_detailed_search_dto { data_base_type = 1, main_id = mainID, ispush = false }, 0, int.MaxValue, ref total));
Console.WriteLine($"查询建议数,total:{datas.Count}");
//datas.AddRange(PurchaseAdviseServices.DetailList(new dc_auto_purchase_advise_detailed_search_dto { main_id = mainID, ispush = false }, 0, int.MaxValue, ref total));
if (true)
......
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