Browse Source

北汽 采购订单日程单导入提示语增加 pobillnum 首字母为S的筛选条件

master
qian 4 months ago
parent
commit
66a84d53f6
  1. 16
      北京北汽/Controller/SCP_PO_CONTROLLER.cs
  2. 192
      北京北汽/SCP/Views/BasicData/Price.aspx.cs

16
北京北汽/Controller/SCP_PO_CONTROLLER.cs

@ -1428,7 +1428,7 @@ namespace CK.SCP.Controller
int _polinr = Int32.Parse(p_excel.); int _polinr = Int32.Parse(p_excel.);
if (string.IsNullOrEmpty(subsite)) if (string.IsNullOrEmpty(subsite))
{ {
var _partlist = db.TB_PO_DETAIL.Where(p => p.PoBillNum == p_excel. && p.PartCode == p_excel..Trim() && p.PoLine != _polinr).ToList(); var _partlist = db.TB_PO_DETAIL.Where(p => p.PoBillNum == p_excel. && p.PartCode == p_excel..Trim() && p.PoLine != _polinr && p.PoBillNum.Substring(0, 1) == "S").ToList();
if (_partlist.Count > 0) if (_partlist.Count > 0)
{ {
ErrorList.Add(string.Format("订单编号【{0}】零件号【{1}】已经存在(系统:行号-【{2}】),请更换零件号!", p_excel., p_excel., _partlist[0].PoLine)); ErrorList.Add(string.Format("订单编号【{0}】零件号【{1}】已经存在(系统:行号-【{2}】),请更换零件号!", p_excel., p_excel., _partlist[0].PoLine));
@ -1437,27 +1437,27 @@ namespace CK.SCP.Controller
// 判断北汽多次导入 是否存在零件号重复现象 // 判断北汽多次导入 是否存在零件号重复现象
else else
{ {
var _partlist = db.V_TB_PO_DETAIL.Where(p => p.VendId == p_excel..Trim()&&p.SubSite == subsite && p.PartCode == p_excel..Trim()).ToList(); var _partlist = db.V_TB_PO_DETAIL.Where(p => p.VendId == p_excel..Trim()&&p.SubSite == subsite && p.PartCode == p_excel..Trim() && p.PoBillNum.Substring(0,1) =="S").ToList();
if (_partlist.Count > 0) if (_partlist.Count > 0 )
{ {
var pobillnum = db.V_TB_PO_DETAIL.FirstOrDefault(p => p.VendId == p_excel..Trim() && p.SubSite == subsite && p.PartCode == p_excel..Trim()).PoBillNum; var pobillnum = db.V_TB_PO_DETAIL.FirstOrDefault(p => p.VendId == p_excel..Trim() && p.SubSite == subsite && p.PartCode == p_excel..Trim() && p.PoBillNum.Substring(0, 1) == "S").PoBillNum;
ErrorList.Add(string.Format("订单编号【{0}】零件号【{1}】在【{2}】中存在,请更换零件号!", p_excel., p_excel., pobillnum)); ErrorList.Add(string.Format("订单编号【{0}】零件号【{1}】在【{2}】中存在,请更换零件号!", p_excel., p_excel., pobillnum));
} }
int lcount = db.V_TB_PO_DETAIL.Count(p => p.VendId == p_excel..Trim() && p.PoLine == _polinr && p.SubSite == subsite && p.PartCode == p_excel..Trim()); int lcount = db.V_TB_PO_DETAIL.Count(p => p.VendId == p_excel..Trim() && p.PoLine == _polinr && p.SubSite == subsite && p.PartCode == p_excel..Trim() && p.PoBillNum.Substring(0, 1) == "S");
if (lcount > 0) if (lcount > 0)
{ {
var pobillnum = db.V_TB_PO_DETAIL.FirstOrDefault(p => p.VendId == p_excel..Trim() && p.SubSite == subsite && p.PoLine == _polinr && p.PartCode == p_excel..Trim()).PoBillNum; var pobillnum = db.V_TB_PO_DETAIL.FirstOrDefault(p => p.VendId == p_excel..Trim() && p.SubSite == subsite && p.PoLine == _polinr && p.PartCode == p_excel..Trim() && p.PoBillNum.Substring(0, 1) == "S").PoBillNum;
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】在【{2}】订单中已经存在,请更换行号!", p_excel., p_excel.,pobillnum)); ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】在【{2}】订单中已经存在,请更换行号!", p_excel., p_excel.,pobillnum));
} }
} }
int linecount = db.V_TB_PO_DETAIL.Count(p => p.PoBillNum == p_excel. && p.PoLine == _polinr && p.PartCode != p_excel..Trim()); int linecount = db.V_TB_PO_DETAIL.Count(p => p.PoBillNum == p_excel. && p.PoLine == _polinr && p.PartCode != p_excel..Trim() && p.PoBillNum.Substring(0, 1) == "S");
if (linecount > 0) if (linecount > 0)
{ {
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】已经存在,请更换行号!", p_excel., p_excel.)); ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】已经存在,请更换行号!", p_excel., p_excel.));
} }
int partcodeCount = db.TB_PO_DETAIL.Count(p => p.PoBillNum == p_excel. && p.PoLine == _polinr && p.PartCode == p_excel..Trim()); int partcodeCount = db.TB_PO_DETAIL.Count(p => p.PoBillNum == p_excel. && p.PoLine == _polinr && p.PartCode == p_excel..Trim() && p.PoBillNum.Substring(0, 1) == "S");
if (partcodeCount > 0) if (partcodeCount > 0)
{ {
ErrorList.Add(string.Format("订单编号【{0}】零件号【{1}】行号【{2}】已经存在", p_excel., p_excel., p_excel.)); ErrorList.Add(string.Format("订单编号【{0}】零件号【{1}】行号【{2}】已经存在", p_excel., p_excel., p_excel.));

192
北京北汽/SCP/Views/BasicData/Price.aspx.cs

@ -135,7 +135,7 @@ namespace SCP.BasicData
SearchV_TB_PRICEData((result) => SearchV_TB_PRICEData((result) =>
{ {
Grid1.RecordCount = result.Count(); Grid1.RecordCount = result.Count();
var list = SortAndPage<V_TB_PRICE>(result, Grid1); var list = SortAndPage(result, Grid1);
Grid1.DataSource = list; Grid1.DataSource = list;
Grid1.DataBind(); Grid1.DataBind();
@ -144,9 +144,103 @@ namespace SCP.BasicData
//查询 //查询
protected void btnSearch_OnClick(object sender, EventArgs e) protected void btnSearch_OnClick(object sender, EventArgs e)
{ {
BindData(); BindData1();
}
public void BindData1()
{
highlightRows.Text = "";
SearchV_TB_PRICEData1((result) =>
{
Grid1.RecordCount = result.Count();
var list = SortAndPage(result, Grid1);
Grid1.DataSource = list;
Grid1.DataBind();
});
}
public void SearchV_TB_PRICEData1(Action<IQueryable<V_TB_PRICE>> p_action)
{
V_TB_PRICE _entity = new V_TB_PRICE();
if (!string.IsNullOrEmpty(textVendId.Text))
{
_entity.VendId = textVendId.Text;
}
if (!string.IsNullOrEmpty(textPartCode.Text))
{
_entity.PartCode = textPartCode.Text;
}
if (!string.IsNullOrEmpty(textVendName.Text))
{
_entity.Extend3 = textVendName.Text;
}
if (!string.IsNullOrEmpty(textPartName.Text))
{
_entity.PartName = textPartName.Text;
}
if (!string.IsNullOrEmpty(textCreator.Text))
{
_entity.Creator = textCreator.Text;
}
if (DP_StartDate.SelectedDate != null)
{
_entity.StartTime = DP_StartDate.SelectedDate;
}
if (DP_StartDate.SelectedDate != null && Date_EndDate.SelectedDate == null)
{
_entity.EndTime = DateTime.Now;
}
if (DP_StartDate.SelectedDate == null && Date_EndDate.SelectedDate != null)
{
_entity.StartTime = DateTime.Now;
}
if (Date_EndDate.SelectedDate != null)
{
_entity.EndTime = Date_EndDate.SelectedDate;
}
if (!string.IsNullOrEmpty(DDL_State.SelectedValue))
{
_entity.State = int.Parse(DDL_State.SelectedValue);
}
if (!string.IsNullOrEmpty(NB_Amt.Text))
{
_entity.Amt = decimal.Parse(NB_Amt.Text);
}
//_entity.Extend2 = !string.IsNullOrEmpty(DDL_Extend2.SelectedValue) ? DDL_Extend2.SelectedValue : string.Empty;
if (!string.IsNullOrEmpty(NB_Extend2.Text))
{
_entity.Extend2 = NB_Extend2.Text;
}
if (!string.IsNullOrEmpty(NB_TemporaryPrice.Text))
{
_entity.TemporaryPrice = int.Parse(NB_TemporaryPrice.Text);
}
if (!string.IsNullOrEmpty(NB_SharingPrice.Text))
{
_entity.SharingPrice = decimal.Parse(NB_SharingPrice.Text);
}
if (!string.IsNullOrEmpty(factoryList.SelectedValue))
{
_entity.SubSite = factoryList.SelectedValue;
} }
_entity.UserInAddress = CurrentUser.FactoryList;
_entity.UserInVendIds = CurrentUser.VenderList;
//_entity.UserInSubSite = CurrentUser.SubSiteList;
if (CurrentUser.RoleList.Contains("供应商") && CurrentUser.VenderList.Count == 0)
{
return;
}
SCP_TB_PRICE_CONTROLLER.Get_TB_PRICE_List(ckb_Priec.Checked, _entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
Session["PriceSelect"] = "true";
}
public void SearchV_TB_PRICEData(Action<IQueryable<V_TB_PRICE>> p_action) public void SearchV_TB_PRICEData(Action<IQueryable<V_TB_PRICE>> p_action)
{ {
V_TB_PRICE _entity = new V_TB_PRICE(); V_TB_PRICE _entity = new V_TB_PRICE();
@ -426,7 +520,9 @@ namespace SCP.BasicData
public void BtnOutPut_OnClick(object sender, EventArgs e) public void BtnOutPut_OnClick(object sender, EventArgs e)
{ {
// _list = SCP_TB_PRICE_CONTROLLER.Getlist(); // _list = SCP_TB_PRICE_CONTROLLER.Getlist();
SearchV_TB_PRICEData((result) => if (Session["PriceSelect"].ToString() == "true")
{
SearchV_TB_PRICEData1((result) =>
{ {
var list = result.ToList(); var list = result.ToList();
Dictionary<string, string> cellheader = new Dictionary<string, string>(); Dictionary<string, string> cellheader = new Dictionary<string, string>();
@ -496,8 +592,81 @@ namespace SCP.BasicData
// var list = Sort<TB_PRICE>(_list.AsQueryable(), Grid1).ToList(); // var list = Sort<TB_PRICE>(_list.AsQueryable(), Grid1).ToList();
// 2.设置单元格抬头 // 2.设置单元格抬头
// key:实体对象属性名称,可通过反射获取值 // key:实体对象属性名称,可通过反射获取值
}
else
{
SearchV_TB_PRICEData((result) =>
{
var list = result.ToList();
Dictionary<string, string> cellheader = new Dictionary<string, string>();
string[] values = ckb1.SelectedValueArray;
if (values.Contains("14"))
{
cellheader.Add("Extend1", "状态");
}
if (values.Contains("1"))
{
cellheader.Add("VendId", "供应商编号");
}
if (values.Contains("2"))
{
cellheader.Add("Extend3", "供应商名称");
}
if (values.Contains("3"))
{
cellheader.Add("PartCode", "零件编号");
}
if (values.Contains("4"))
{
cellheader.Add("PartName", "零件名称");
}
if (values.Contains("5"))
{
cellheader.Add("SubSite", "地点");
}
if (values.Contains("6"))
{
cellheader.Add("StartTime", "开始时间");
}
if (values.Contains("7"))
{
cellheader.Add("EndTime", "结束时间");
}
if (values.Contains("8"))
{
cellheader.Add("Curr", "币种");
}
if (values.Contains("9"))
{
cellheader.Add("Unit", "单位");
}
if (values.Contains("10"))
{
cellheader.Add("Amt", "零件基础价格");
}
if (values.Contains("11"))
{
cellheader.Add("Extend2", "是否临时价格");
}
//if (values.Contains("12"))
//{
// cellheader.Add("Remarks", "备注");
//}
if (values.Contains("13"))
{
cellheader.Add("SharingPrice", "零件分摊单价");
}
if (values.Contains("15"))
{
cellheader.Add("Creator", "导入人员");
}
string url = EntityListToExcel2003(cellheader, list, "价格信息");
// var list = Sort<TB_PRICE>(_list.AsQueryable(), Grid1).ToList();
// 2.设置单元格抬头
// key:实体对象属性名称,可通过反射获取值
// value:Excel列的名称 // value:Excel列的名称
});
}
} }
/// <summary> /// <summary>
/// 确认 /// 确认
@ -590,13 +759,28 @@ namespace SCP.BasicData
protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e) protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e)
{ {
Grid1.PageIndex = e.NewPageIndex; Grid1.PageIndex = e.NewPageIndex;
if (Session["PriceSelect"].ToString() == "true")
{
BindData1();
}
else
{
BindData(); BindData();
} }
}
protected void ddlGridPageSize_OnSelectedIndexChanged(object sender, EventArgs e) protected void ddlGridPageSize_OnSelectedIndexChanged(object sender, EventArgs e)
{ {
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
if (Session["PriceSelect"].ToString() == "true")
{
BindData1();
}
else
{
BindData(); BindData();
} }
}
protected void Grid1_OnSort(object sender, GridSortEventArgs e) protected void Grid1_OnSort(object sender, GridSortEventArgs e)
{ {
BindData(); BindData();

Loading…
Cancel
Save