Browse Source

修改查询及导出收货查询

master
qian 11 months ago
parent
commit
20de9f0eb7
  1. 100
      北京北汽/Controller/SCP_EXCEL_CONTROLLER.cs
  2. 8
      北京北汽/Controller/SCP_RECEIVE_CONTROLLER.cs
  3. 8
      北京北汽/SCP/Views/SupplierData/SCP_ARRIVE.aspx.cs

100
北京北汽/Controller/SCP_EXCEL_CONTROLLER.cs

@ -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;

8
北京北汽/Controller/SCP_RECEIVE_CONTROLLER.cs

@ -1281,6 +1281,10 @@ namespace CK.SCP.Controller
{
q = q.Where(p => p.SubSite == p_entity.SubSite);
}
else if (p_entity.UserInSubSite != null && p_entity.UserInSubSite.Count > 0)
{
q = q.Where(p => p_entity.UserInSubSite.Contains(p.SubSite));
}
if (!string.IsNullOrEmpty(p_entity.VendId))
{
q = q.Where(p => p.VendId==p_entity.VendId);
@ -1313,10 +1317,6 @@ namespace CK.SCP.Controller
{
q = q.Where(p => p.Site_Desc.Contains(p_entity.Site_Desc));
}
if (p_entity.UserInSubSite != null && p_entity.UserInSubSite.Count > 0)
{
q = q.Where(p => p_entity.UserInSubSite.Contains(p.SubSite));
}
if (p_entity.UserInVendIds != null && p_entity.UserInVendIds.Count > 0)
{
q = q.Where(p => p_entity.UserInVendIds.Contains(p.VendId));

8
北京北汽/SCP/Views/SupplierData/SCP_ARRIVE.aspx.cs

@ -169,13 +169,19 @@ namespace SCP.Views.SupplierData
}
protected void btnOutput_OnClick(object sender, EventArgs e)
{
string SubSite = "";
List<string> _ls = new List<string>();
SearchV_TB_ARRIVEData(rs => {
_ls = rs.Select(p => p.ArrvBillNum).ToList();
DataSet ds = null;
if (CurrentUser.VenderList.Count > 0)
{
ds = SCP_EXCEL_CONTROLLER.GET_ARRIVE_EXECEL(_ls, CurrentUser.VenderList.FirstOrDefault());
if (!string.IsNullOrEmpty(factoryList.SelectedValue))
{
SubSite = factoryList.SelectedValue;
}
ds = SCP_EXCEL_CONTROLLER.GET_ARRIVE_EXECELBySite(_ls, CurrentUser.VenderList.FirstOrDefault(), SubSite);
}
else
{

Loading…
Cancel
Save