Commit f48ee5f9 by 泽锋 李

提货单新增字段

parent 0123aa37
......@@ -49,7 +49,9 @@ namespace AutoTurnOver.DB
pick_up_goods_time = dc_base_supplier_data.laster_pockup_time ?? "",
purchase_id = itemP.Key,
warehouse_code = item.Max(v=>v.warehouse_code),
warehouse_name = item.Max(v=>v.warehouse_name)
warehouse_name = item.Max(v=>v.warehouse_name),
suppliers_id =item.Key.supplier_id??0,
suppliers_name = item.Key.supplier_name
};
// 查询是否已经存在
......@@ -99,37 +101,36 @@ namespace AutoTurnOver.DB
try
{
var sql = @"select
t1.*,
( case when t5.`status`=0 or t5.`status` is null then '监控中' else '停止监控' end ) as 'monitor_status_str'
from dc_auto_return_goods_sku as t1
left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
t2.`no` as 'no',
t2.`date` as 'date',
t2.pay_time,
t2.order_1688_time,
t2.pick_up_goods_time,
t2.purchase_id,
t2.warehouse_code,
t2.warehouse_name,
t1.bailun_sku,
t1.price,
t1.quantity,
t1.amount
from dc_auto_pick_up_goods_order_sku as t1
left join dc_auto_pick_up_goods_order as t2 on t1.main_id = t2.id
left join dc_base_warehouse as t3 on t1.warehouse_code = t2.warehouse_code
where 1 = 1 ";
DynamicParameters parameters = new DynamicParameters();
if (m.monitor_status != null)
{
if (m.monitor_status == 1)
{
sql += " and t5.`status`=1 ";
}
else if (m.monitor_status == 2)
{
sql += " and ( t5.`status`=0 or t5.`status` is null ) ";
}
}
if (m.btime != null)
{
sql += " and t1.create_date>=@btime ";
sql += " and t1.date>=@btime ";
parameters.Add("btime", m.btime.Value.ToDayHome());
}
if (m.etime != null)
{
sql += " and t1.create_date<=@etime ";
sql += " and t1.date<=@etime ";
parameters.Add("etime", m.etime.Value.ToDayEnd());
}
if (!string.IsNullOrWhiteSpace(m.warehousetype))
{
sql += " and t2.hq_type=@warehousetype";
sql += " and t3.hq_type=@warehousetype";
parameters.Add("warehousetype", m.warehousetype);
}
if (!string.IsNullOrWhiteSpace(m.sku))
......@@ -139,7 +140,7 @@ where 1 = 1 ";
}
if (m.warehousearea > 0)
{
sql += " and t2.area_id=" + m.warehousearea;
sql += " and t3.area_id=" + m.warehousearea;
}
if (m.warehouse_code != null)
{
......@@ -151,18 +152,7 @@ where 1 = 1 ";
sql += " and t1.suppliers_name =@suppliers_name ";
parameters.Add("suppliers_name", m.supplier_name);
}
if (m.status != null)
{
sql += " and t1.status=" + m.status;
}
if (m.oms_out_status != null)
{
sql += " and t1.oms_out_status=" + m.oms_out_status;
}
if (m.no_library_sys_push_status > 0)
{
sql += " and t1.no_library_sys_push_status=" + m.no_library_sys_push_status;
}
total = _connection.ExecuteScalar<int>("select count(0) from (" + sql + ") tb1", parameters);
......
......@@ -15,6 +15,8 @@ namespace AutoTurnOver.Models
public string purchase_id { get; set; }
public string warehouse_code { get; set; }
public string warehouse_name { get; set; }
public int suppliers_id { get; set; }
public string suppliers_name { get; set; }
}
public class dc_auto_pick_up_goods_order_sku
......@@ -40,10 +42,13 @@ namespace AutoTurnOver.Models
public int id { get; set; }
public string no { get; set; }
public DateTime date { get; set; }
public string date_str { get { return date.ToString("yyyy-MM-dd"); } }
public DateTime? pay_time { get; set; }
public DateTime? order_1688_time { get; set; }
public string pick_up_goods_time { get; set; }
public string purchase_id { get; set; }
public string warehouse_code { get; set; }
public string warehouse_name { get; set; }
public string bailun_sku { get; set; }
public decimal price { get; set; }
public int quantity { 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