|
|
@ -397,6 +397,106 @@ namespace CK.SCP.Controller |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_detailList.ForEach(itm => { |
|
|
|
var _entity = new SCP_ARRIVE_DETAIL_EXPORT(); |
|
|
|
_entity.单据号 =itm.ArrvBillNum; |
|
|
|
_entity.发货单号 = itm.AsnBillNum; |
|
|
|
_entity.订单号 = itm.PoBillNum; |
|
|
|
_entity.订单行 = itm.PoLine.ToString(); |
|
|
|
_entity.零件号 = itm.PartCode; |
|
|
|
_entity.零件名称 = itm.PartDesc1; |
|
|
|
_entity.单位 = itm.Unit; |
|
|
|
_entity.数量 = itm.Qty.ToString(); |
|
|
|
_entity.时间 = itm.ShipTime == null ? string.Empty : itm.ShipTime.Value.ToString("yyyyMMdd"); |
|
|
|
_entity.备注 = itm.Remark; |
|
|
|
_exportDetailList.Add(_entity); |
|
|
|
}); |
|
|
|
var _list_dt = ConvertHelper.ToDataTable(_exportDetailList); |
|
|
|
_ds.Tables.Add(_list_dt); |
|
|
|
} |
|
|
|
return _ds; |
|
|
|
} |
|
|
|
|
|
|
|
// 分地点导出
|
|
|
|
public static DataSet GET_ARRIVE_EXECELBySite(List<string> p_lst, string p_vendid = "",string site ="") |
|
|
|
{ |
|
|
|
DataSet _ds = new DataSet(); |
|
|
|
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|
|
|
{ |
|
|
|
List<V_TB_ARRIVE> _ls = new List<V_TB_ARRIVE>(); |
|
|
|
if (!string.IsNullOrEmpty(p_vendid)) |
|
|
|
{ |
|
|
|
if (!string.IsNullOrWhiteSpace(site)) |
|
|
|
{ |
|
|
|
_ls = db.V_TB_ARRIVE.Where(p => p_lst.Contains(p.ArrvBillNum) && (p.VendId == p_vendid) && (p.SubSite == site)).ToList(); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_ls = db.V_TB_ARRIVE.Where(p => (p_lst.Contains(p.ArrvBillNum)) && (p.VendId == p_vendid)).ToList(); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (!string.IsNullOrWhiteSpace(site)) |
|
|
|
{ |
|
|
|
_ls = db.V_TB_ARRIVE.Where(p => p_lst.Contains(p.ArrvBillNum) && (p.SubSite == site)).ToList(); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_ls = db.V_TB_ARRIVE.Where(p => p_lst.Contains(p.ArrvBillNum)).ToList(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var str = JsonHelper.GetJson(_ls); |
|
|
|
var _exportList = new List<SCP_ARRIVE_EXPORT>(); |
|
|
|
_ls.ForEach(itm => |
|
|
|
{ |
|
|
|
var _entity = new SCP_ARRIVE_EXPORT(); |
|
|
|
_entity.状态 = itm.State_DESC; |
|
|
|
_entity.单据类型 = itm.BillType_DESC; |
|
|
|
_entity.到货单号 = itm.ArrvBillNum; |
|
|
|
_entity.发货单号 = itm.AsnBillNum; |
|
|
|
_entity.要货看板号 = itm.AskBillNum; |
|
|
|
_entity.订单号 = itm.PoBillNum; |
|
|
|
_entity.供应商 = itm.VendName; |
|
|
|
_entity.供应商编码 = itm.VendId; |
|
|
|
_entity.地点 = itm.SubSite; |
|
|
|
_entity.地点名称 = itm.Site_Desc; |
|
|
|
_entity.到货日期 = itm.ShipTime == null ? string.Empty : itm.ShipTime.ToString("yyyyMMdd"); |
|
|
|
_exportList.Add(_entity); |
|
|
|
}); |
|
|
|
var _dt = ConvertHelper.ToDataTable(_exportList); |
|
|
|
_ds.Tables.Add(_dt); |
|
|
|
var _exportDetailList = new List<SCP_ARRIVE_DETAIL_EXPORT>(); |
|
|
|
|
|
|
|
List<V_TB_ARRIVE_DETAIL> _detailList = new List<V_TB_ARRIVE_DETAIL>(); |
|
|
|
if (!string.IsNullOrEmpty(p_vendid)) |
|
|
|
{ |
|
|
|
if (!string.IsNullOrWhiteSpace(site)) |
|
|
|
{ |
|
|
|
_detailList = db.V_TB_ARRIVE_DETAIL.Where(p => p_lst.Contains(p.ArrvBillNum) && (p.VendId == p_vendid) && (p.SubSite == site)).ToList(); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_detailList = db.V_TB_ARRIVE_DETAIL.Where(p => p_lst.Contains(p.ArrvBillNum) && (p.VendId == p_vendid)).ToList(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (!string.IsNullOrWhiteSpace(site)) |
|
|
|
{ |
|
|
|
_detailList = db.V_TB_ARRIVE_DETAIL.Where(p => p_lst.Contains(p.ArrvBillNum)&& (p.SubSite == site)).ToList(); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_detailList = db.V_TB_ARRIVE_DETAIL.Where(p => p_lst.Contains(p.ArrvBillNum)).ToList(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_detailList.ForEach(itm => { |
|
|
|
var _entity = new SCP_ARRIVE_DETAIL_EXPORT(); |
|
|
|
_entity.单据号 = itm.ArrvBillNum; |
|
|
|