Commit c0f1e0d9 by 泽锋 李

fix

parent 5266f14f
......@@ -27,7 +27,7 @@ namespace AutoTurnOver.DB
{
var conn = _connection;
int page = 1;
int rows = 2000;
int rows = 5000;
List<dc_report_cash_flow_config> configs = conn.Query<dc_report_cash_flow_config>(" select * from dc_report_cash_flow_config ").AsList();
while (true)
{
......@@ -57,12 +57,6 @@ namespace AutoTurnOver.DB
{
var item_no = order_item.bailun_order_id;
var old_cash_flow_list = conn.Query<old_cash_flow_dto>(" select data_type,id from dc_report_cash_flow_log where bailun_sku=@bailun_sku and item_no=@item_no ", new
{
bailun_sku = order_item.bailun_sku,
item_no = item_no
}).ToList();
#region PayPal
dc_report_cash_flow_log item8 = new dc_report_cash_flow_log()
......@@ -84,7 +78,12 @@ namespace AutoTurnOver.DB
item8.occur_time_year_month_no = $"{item8.occur_time.Year}-{item8.occur_time.Month}-{item8.bailun_sku}";
item8.pay_time = CalculationPayTime(configs, item8.occur_time, item8.data_type, item8.platform_type);
item8.pay_time_year_month_no = $"{item8.pay_time.Year}-{item8.pay_time.Month}-{item8.bailun_sku}";
item8.id = (old_cash_flow_list.FirstOrDefault(s => s.data_type == item8.data_type) ?? new old_cash_flow_dto()).id;
item8.id = conn.QuerySingleOrDefault<int?>(" select id from dc_report_cash_flow_log where data_type=@data_type and bailun_sku=@bailun_sku and item_no=@item_no ", new
{
data_type = item8.data_type,
bailun_sku = item8.bailun_sku,
item_no = item8.item_no
}) ?? 0;
if (item8.id > 0)
{
updateList.Add(item8);
......@@ -119,7 +118,12 @@ namespace AutoTurnOver.DB
item7.occur_time_year_month_no = $"{item7.occur_time.Year}-{item7.occur_time.Month}-{item7.bailun_sku}";
item7.pay_time = CalculationPayTime(configs, item7.occur_time, item7.data_type, item7.platform_type);
item7.pay_time_year_month_no = $"{item7.pay_time.Year}-{item7.pay_time.Month}-{item7.bailun_sku}";
item7.id = (old_cash_flow_list.FirstOrDefault(s => s.data_type == item7.data_type) ?? new old_cash_flow_dto()).id;
item7.id = conn.QuerySingleOrDefault<int?>(" select id from dc_report_cash_flow_log where data_type=@data_type and bailun_sku=@bailun_sku and item_no=@item_no ", new
{
data_type = item7.data_type,
bailun_sku = item7.bailun_sku,
item_no = item7.item_no
}) ?? 0;
if (item7.id > 0)
{
updateList.Add(item7);
......@@ -154,7 +158,12 @@ namespace AutoTurnOver.DB
item6.occur_time_year_month_no = $"{item6.occur_time.Year}-{item6.occur_time.Month}-{item6.bailun_sku}";
item6.pay_time = CalculationPayTime(configs, item6.occur_time, item6.data_type, item6.platform_type);
item6.pay_time_year_month_no = $"{item6.pay_time.Year}-{item6.pay_time.Month}-{item6.bailun_sku}";
item6.id = (old_cash_flow_list.FirstOrDefault(s => s.data_type == item6.data_type) ?? new old_cash_flow_dto()).id;
item6.id = conn.QuerySingleOrDefault<int?>(" select id from dc_report_cash_flow_log where data_type=@data_type and bailun_sku=@bailun_sku and item_no=@item_no ", new
{
data_type = item6.data_type,
bailun_sku = item6.bailun_sku,
item_no = item6.item_no
}) ?? 0;
if (item6.id > 0)
{
updateList.Add(item6);
......@@ -189,7 +198,12 @@ namespace AutoTurnOver.DB
item5.occur_time_year_month_no = $"{item5.occur_time.Year}-{item5.occur_time.Month}-{item5.bailun_sku}";
item5.pay_time = CalculationPayTime(configs, item5.occur_time, item5.data_type, item5.platform_type);
item5.pay_time_year_month_no = $"{item5.pay_time.Year}-{item5.pay_time.Month}-{item5.bailun_sku}";
item5.id = (old_cash_flow_list.FirstOrDefault(s => s.data_type == item5.data_type) ?? new old_cash_flow_dto()).id;
item5.id = conn.QuerySingleOrDefault<int?>(" select id from dc_report_cash_flow_log where data_type=@data_type and bailun_sku=@bailun_sku and item_no=@item_no ", new
{
data_type = item5.data_type,
bailun_sku = item5.bailun_sku,
item_no = item5.item_no
}) ?? 0;
if (item5.id > 0)
{
updateList.Add(item5);
......@@ -224,7 +238,12 @@ namespace AutoTurnOver.DB
item3.occur_time_year_month_no = $"{item3.occur_time.Year}-{item3.occur_time.Month}-{item3.bailun_sku}";
item3.pay_time = CalculationPayTime(configs, item3.occur_time, item3.data_type, item3.platform_type);
item3.pay_time_year_month_no = $"{item3.pay_time.Year}-{item3.pay_time.Month}-{item3.bailun_sku}";
item3.id = (old_cash_flow_list.FirstOrDefault(s => s.data_type == item3.data_type) ?? new old_cash_flow_dto()).id;
item3.id = conn.QuerySingleOrDefault<int?>(" select id from dc_report_cash_flow_log where data_type=@data_type and bailun_sku=@bailun_sku and item_no=@item_no ", new
{
data_type = item3.data_type,
bailun_sku = item3.bailun_sku,
item_no = item3.item_no
}) ?? 0;
if (item3.id > 0)
{
updateList.Add(item3);
......@@ -259,7 +278,12 @@ namespace AutoTurnOver.DB
item2.occur_time_year_month_no = $"{item2.occur_time.Year}-{item2.occur_time.Month}-{item2.bailun_sku}";
item2.pay_time = CalculationPayTime(configs, item2.occur_time, item2.data_type, item2.platform_type);
item2.pay_time_year_month_no = $"{item2.pay_time.Year}-{item2.pay_time.Month}-{item2.bailun_sku}";
item2.id = (old_cash_flow_list.FirstOrDefault(s => s.data_type == item2.data_type) ?? new old_cash_flow_dto()).id;
item2.id = conn.QuerySingleOrDefault<int?>(" select id from dc_report_cash_flow_log where data_type=@data_type and bailun_sku=@bailun_sku and item_no=@item_no ", new
{
data_type = item2.data_type,
bailun_sku = item2.bailun_sku,
item_no = item2.item_no
}) ?? 0;
if (item2.id > 0)
{
updateList.Add(item2);
......@@ -294,7 +318,12 @@ namespace AutoTurnOver.DB
item1.occur_time_year_month_no = $"{item1.occur_time.Year}-{item1.occur_time.Month}-{item1.bailun_sku}";
item1.pay_time = CalculationPayTime(configs, item1.occur_time, item1.data_type, item1.platform_type);
item1.pay_time_year_month_no = $"{item1.pay_time.Year}-{item1.pay_time.Month}-{item1.bailun_sku}";
item1.id = (old_cash_flow_list.FirstOrDefault(s => s.data_type == item1.data_type) ?? new old_cash_flow_dto()).id;
item1.id = conn.QuerySingleOrDefault<int?>(" select id from dc_report_cash_flow_log where data_type=@data_type and bailun_sku=@bailun_sku and item_no=@item_no ", new
{
data_type = item1.data_type,
bailun_sku = item1.bailun_sku,
item_no = item1.item_no
}) ?? 0;
if (item1.id > 0)
{
updateList.Add(item1);
......@@ -329,7 +358,12 @@ namespace AutoTurnOver.DB
item.occur_time_year_month_no = $"{item.occur_time.Year}-{item.occur_time.Month}-{item.bailun_sku}";
item.pay_time = CalculationPayTime(configs, item.occur_time, item.data_type, item.platform_type);
item.pay_time_year_month_no = $"{item.pay_time.Year}-{item.pay_time.Month}-{item.bailun_sku}";
item.id = (old_cash_flow_list.FirstOrDefault(s => s.data_type == item.data_type) ?? new old_cash_flow_dto()).id;
item.id = conn.QuerySingleOrDefault<int?>(" select id from dc_report_cash_flow_log where data_type=@data_type and bailun_sku=@bailun_sku and item_no=@item_no ", new
{
data_type = item.data_type,
bailun_sku = item.bailun_sku,
item_no = item.item_no
}) ?? 0;
if (item.id > 0)
{
updateList.Add(item);
......@@ -388,7 +422,7 @@ namespace AutoTurnOver.DB
{
var conn = _connection;
int page = 1;
int rows = 2000;
int rows = 5000;
var logisticsList = ApiUtility.RealTimeShipLogisticsList();
List<dc_report_logistics_company_config_dto> logistics_company_list = conn.Query<dc_report_logistics_company_config_dto>(" select * from dc_report_logistics_company_config ").AsList();
List<dc_report_cash_flow_config> configs = conn.Query<dc_report_cash_flow_config>(" select * from dc_report_cash_flow_config ").AsList();
......
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