Browse Source

北汽优化

master
qian 9 months ago
parent
commit
dfce31029c
  1. 28
      北京北汽/Controller/SCP_ASK_CONTROLLER.cs
  2. 17
      北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs
  3. 3
      北京北汽/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs
  4. 10
      北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx
  5. 35
      北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx.cs
  6. 9
      北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx.designer.cs

28
北京北汽/Controller/SCP_ASK_CONTROLLER.cs

@ -1532,26 +1532,36 @@ namespace CK.SCP.Controller
if (p_list.Count > 0)
{
//List<V_TB_ASN_DETAIL> list = new List<V_TB_ASN_DETAIL>();
//var detail = p_list[0];
//foreach (var item in p_list)
//{
// var list1 = db.V_TB_ASN_DETAIL.Where(p => p.IsDeleted == false && item.AskBillNum == p.AskBillNum).ToList();
// if (list1!= null)
// {
// list.AddRange(list1);
// }
//}
//list = db.V_TB_ASN_DETAIL.Where(p => p.IsDeleted == false && detail.AskBillNum == p.AskBillNum).ToList();
var detail = p_list[0];
var list = db.V_TB_ASN_DETAIL.Where(p => p.IsDeleted == false && detail.AskBillNum == p.AskBillNum).ToList();
var list_back = db.TB_ARRIVE_DETAIL.Where(p => p.Remark == detail.AskBillNum && p.IsDeleted == false && p.State == (int)ArriveState.OK && p.Qty < 0 && p.BillType == 3).GroupBy(p => new { p.Remark, p.PoLine, p.PartCode, p.PoBillNum }).Select(p => new { BackSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, Remark = p.Key.Remark, PartCode = p.Key.PartCode, PoBillNum = p.Key.PoBillNum }).ToList();
p_list.ForEach(itm =>
{
var list = db.V_TB_ASN_DETAIL.Where(p => p.IsDeleted == false && itm.AskBillNum == p.AskBillNum).ToList();
var groupList = list.GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode, p.AskBillNum }).Select(
p => new
{
ShipSum = p.Sum(itm => itm.Qty),
ShipSum = p.Sum(itm2 => itm2.Qty),
PoLine = p.Key.PoLine,
PoBillNum = p.Key.PoBillNum,
PartCode = p.Key.PartCode,
AskBillNum = p.Key.AskBillNum
}).ToList();
p_list.ForEach(itm =>
{
groupList.ForEach(p =>
{
if (p.PoBillNum == itm.PoBillNum && p.PoLine == itm.PoLine && p.PartCode == itm.PartCode)
@ -1559,6 +1569,8 @@ namespace CK.SCP.Controller
itm.ShippedQty = p.ShipSum;
}
});
var list_back = db.TB_ARRIVE_DETAIL.Where(p => p.Remark == itm.AskBillNum && p.IsDeleted == false && p.State == (int)ArriveState.OK && p.Qty < 0 && p.BillType == 3).GroupBy(p => new { p.Remark, p.PoLine, p.PartCode, p.PoBillNum }).Select(p => new { BackSum = p.Sum(itm1 => itm1.Qty), PoLine = p.Key.PoLine, Remark = p.Key.Remark, PartCode = p.Key.PartCode, PoBillNum = p.Key.PoBillNum }).ToList();
list_back.ForEach(p =>
{
if (p.PoBillNum == itm.PoBillNum && p.PoLine == itm.PoLine && p.PartCode == itm.PartCode)

17
北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs

@ -45,6 +45,23 @@ namespace SCP.PlanData
var _ls = ScpCache.ADRESSList;
DDL_Site.DataSource = _ls;
DDL_Site.DataBind();
List<string> stinglist = new List<string>();
var list = _ls.Select(q => q.NamePone).ToList();
if (list != null)
{
list.ForEach(q =>
{
if (q.Contains(' '))
{
stinglist.Add(q.Substring(0, q.IndexOf(' ')));
}
});
}
if (stinglist != null)
{
DDL_Site.SelectedIndex = stinglist.IndexOf(CurrentUser.ChineseName) == -1 ? 0 : stinglist.IndexOf(CurrentUser.ChineseName);
}
}
public void LoadData()
{

3
北京北汽/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs

@ -36,7 +36,8 @@ namespace SCP.PlanData
{
Grid_V_TB_ASK_DETAIL.RecordCount = ret.Count();
var list = SortAndPage<V_TB_ASK_DETAIL>(ret, Grid_V_TB_ASK_DETAIL);
Grid_V_TB_ASK_DETAIL.DataSource = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(list.ToList());
var _ls = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(list.ToList());
Grid_V_TB_ASK_DETAIL.DataSource = SCP_ASK_CONTROLLER.Get_CAN_SHIPQTY(_ls); ;
Grid_V_TB_ASK_DETAIL.DataBind();
});
}

10
北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx

@ -58,8 +58,9 @@
<%-- <f:DropDownList ID="DDL_PORT" DataTextField="PORT_DESCRIPTION" DataValueField="PORT_NO" Required="true" runat="server" Label="收货口">
</f:DropDownList>--%>
<f:TextBox ID="txtRemark" runat="server" Label="备注" Text="">
</f:TextBox>
<f:TextBox ID="txtRemark" runat="server" Label="备注" Text="" />
<f:DatePicker runat="server" Required="true" DateFormatString="yyyy-MM-dd" Label="到货日期" EmptyText="请选择日期" ID="DatePicker2" />
</Items>
</f:FormRow>
@ -93,11 +94,9 @@
DataKeyNames="UID,PoBillNum,PoLine,PartCode,PlanQty,ShippedQty,ReceivedQty,RejectQty,BeginTime,EndTime,PoUnit,LocUnit,Price,Currency,PackQty,UnConv,DockCode,State,Remark,CreateTime,CreateUser,UpdateTime,UpdateUser,UpdateInfo,IsDeleted,PartDesc1,CurrencyDesc,ErpBillNum,ModType,Contacter,Site,Buyer,BuyerPhone,VendName,PartDesc2,TempQty,PublishQty,ReceivedPort,PartState"
SortField="PoLine"
AllowPaging="True"
AllowCellEditing="true" ClicksToEdit="2"
IsDatabasePaging="true" PageSize="100" OnPageIndexChange="Grid_V_TB_PO_DETAIL_PageIndexChange"
OnRowDataBound="Grid_V_TB_PO_DETAIL_RowDataBound"
>
OnRowDataBound="Grid_V_TB_PO_DETAIL_RowDataBound">
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
@ -144,7 +143,6 @@
RendererFunction="renderPort" HeaderText="收货口" Hidden="true">
<Editor>
<f:DropDownList ID="DDL_ReceivedPort" DataTextField="PORT_DESCRIPTION" DataValueField="PORT_NO" Required="true" runat="server">
</f:DropDownList>
</Editor>
</f:RenderField>

35
北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx.cs

@ -35,6 +35,23 @@ namespace SCP.PlanData
var _ls = ScpCache.ADRESSList;
DDL_Site.DataSource = _ls;
DDL_Site.DataBind();
List<string> stinglist = new List<string>();
var list = _ls.Select(q => q.NamePone).ToList();
if (list != null)
{
list.ForEach(q =>
{
if (q.Contains(' '))
{
stinglist.Add(q.Substring(0, q.IndexOf(' ')));
}
});
}
if (stinglist != null)
{
DDL_Site.SelectedIndex = stinglist.IndexOf(CurrentUser.ChineseName) == -1?0: stinglist.IndexOf(CurrentUser.ChineseName);
}
}
private void SetRoleRule()
@ -68,7 +85,8 @@ namespace SCP.PlanData
{
V_TB_PO_DETAIL _entity = new V_TB_PO_DETAIL();
_entity.PoBillNum = Request["PoBillNum"];
SCP_PO_CONTROLLER.Get_V_TB_PO_DETAIL_List(_entity,(_ret)=> {
SCP_PO_CONTROLLER.Get_V_TB_PO_DETAIL_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
@ -114,7 +132,8 @@ namespace SCP.PlanData
public void BindDetail()
{
var qadOrder = Session["order"] as V_TB_PO;
SearchV_TB_PO_DETAIL((ret)=> {
SearchV_TB_PO_DETAIL((ret) =>
{
if (!string.IsNullOrEmpty(TextArea_PartCode.Text))
{
List<string> _strlist = new List<string>();
@ -313,7 +332,12 @@ namespace SCP.PlanData
{
_lineList.Add(string.Format("产品名称:{0}截至日期:{1}", _entity.PartDesc1, _endTime.ToString()));
}
else
{
_entity.EndTime = _date;
}
}
else
@ -325,6 +349,10 @@ namespace SCP.PlanData
}
}
}
if (DatePicker2.SelectedDate != null)
{
_entity.EndTime = DatePicker2.SelectedDate;
}
if (_entity.PublishQty != null && _entity.PublishQty > 0)
{
qadOrderList.Add(_entity);
@ -390,7 +418,8 @@ namespace SCP.PlanData
if (qadOrder.ModType == 2)
{
int i = 0;
qadOrderList.ForEach(p => {
qadOrderList.ForEach(p =>
{
if (p.PlanQty != p.PublishQty)
{
i = 1;

9
北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx.designer.cs

@ -140,6 +140,15 @@ namespace SCP.PlanData
/// </remarks>
protected global::FineUI.TextBox txtRemark;
/// <summary>
/// DatePicker2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DatePicker2;
/// <summary>
/// gp1 控件。
/// </summary>

Loading…
Cancel
Save