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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
varpick_data_logistics_order_id=conn.QueryFirstOrDefault<string>(" select logistics_order_id from dc_base_oms_pick where bailun_order_id=@bailun_order_id and bailun_sku=@bailun_sku limit 1 ",new
varpick_data_logistics_order_id=conn.QueryFirstOrDefault<string>(" select logistics_order_id from dc_base_oms_pick where bailun_order_id=@bailun_order_id and bailun_sku=@bailun_sku limit 1 ",new
item4.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
item4.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
{
{
...
@@ -569,6 +570,7 @@ namespace AutoTurnOver.DB
...
@@ -569,6 +570,7 @@ namespace AutoTurnOver.DB
intpage=1;
intpage=1;
introws=1000;
introws=1000;
List<dc_report_cash_flow_config>configs=conn.Query<dc_report_cash_flow_config>(" select * from dc_report_cash_flow_config ").AsList();
List<dc_report_cash_flow_config>configs=conn.Query<dc_report_cash_flow_config>(" select * from dc_report_cash_flow_config ").AsList();
List<dc_auto_config_safe_inventory>inventoryConfigs=conn.Query<dc_auto_config_safe_inventory>(" select * from dc_auto_config_safe_inventory ").AsList();
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)
{
{
conn.Update(item);
// 把原本未挂载平台的数据删除
conn.Execute(" delete from dc_report_cash_flow_log where data_type=@data_type and bailun_sku=@bailun_sku and `no`=@purchase_id and platform_type='' ",new{
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
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)
{
conn.Update(item);
}
else
{
conn.Insert(item);
}
#endregion
}
}
#endregion
}
}
catch(Exceptionex)
catch(Exceptionex)
{
{
...
@@ -693,7 +760,8 @@ where t1.gmt_create>=@btime and t1.gmt_create<=@etime ";
...
@@ -693,7 +760,8 @@ where t1.gmt_create>=@btime and t1.gmt_create<=@etime ";
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
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
{
{
...
@@ -776,45 +844,106 @@ where t1.create_time>=@btime and t1.create_time<=@etime ";
...
@@ -776,45 +844,106 @@ where t1.create_time>=@btime and t1.create_time<=@etime ";
{
{
try
try
{
{
#region调拨支出
List<dc_auto_config_safe_inventory>inventoryConfigs=conn.Query<dc_auto_config_safe_inventory>(" select * from dc_auto_config_safe_inventory ").AsList();
conn.Execute(" delete from dc_report_cash_flow_log where data_type=@data_type and bailun_sku=@bailun_sku and `no`=@transfer_order_id and platform_type='' ",new
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
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
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