Browse Source

大订单相关修改

SCP_CYJ
qian 1 month ago
parent
commit
f7ea333dff
  1. 2
      Controller/SCP_ASN_CONTROLLER.cs
  2. 16
      Controller/SCP_PO_CONTROLLER.cs
  3. 2
      Models/ScpEntity/V_TA_ToleranceProportion.cs
  4. 11
      SCP/Views/BasicData/SCP_ToleranceProportion.aspx
  5. 40
      SCP/Views/BasicData/SCP_ToleranceProportion.aspx.cs
  6. 9
      SCP/Views/BasicData/SCP_ToleranceProportion.aspx.designer.cs
  7. 2
      SCP/Views/SupplierData/SCP_ASN_DETAIL.aspx.cs
  8. 4
      SCP/Views/富维冲压件/SCP_PO_MAX_DETAIL.aspx
  9. 6
      UniApiGroup/Controller/OdbcApiWmsController.cs

2
Controller/SCP_ASN_CONTROLLER.cs

@ -3036,7 +3036,7 @@ namespace CK.SCP.Controller
{ {
p_entitys.ForEach(p => p_entitys.ForEach(p =>
{ {
var _maxpolist = db.TB_MAXPO_DETAIL.Where(t => t.PartCode == p.PartCode && t.VendId == p.Extend1&&t.AsnQty>0).ToList().OrderBy(t=>t.ContractMonth); var _maxpolist = db.TB_MAXPO_DETAIL.Where(t => t.PartCode == p.PartCode && t.VendId == p.Extend1&&t.AsnQty>0 && !t.IsDeleted).ToList().OrderBy(t=>t.ContractMonth);
decimal sum = 0; decimal sum = 0;
if (_maxpolist.Count() > 0) if (_maxpolist.Count() > 0)
{ {

16
Controller/SCP_PO_CONTROLLER.cs

@ -5076,14 +5076,14 @@ namespace CK.SCP.Controller
var _list = p.ToList(); var _list = p.ToList();
decimal _PlanQTY = _list.Sum(t => t.PlanQty); decimal _PlanQTY = _list.Sum(t => t.PlanQty);
var _ls = _list.First(); var _ls = _list.First();
var MaxP = db.TB_MAXPO_DETAIL.Where(t => t.PartCode == _ls.PartCode && t.VendId == _ls.UpdateInfo).Sum(t => t.SurplusQty); var MaxP = db.TB_MAXPO_DETAIL.Where(t => t.PartCode == _ls.PartCode && t.VendId == _ls.UpdateInfo && !t.IsDeleted).Sum(t => t.SurplusQty);
if (_PlanQTY > MaxP) if (_PlanQTY > MaxP)
{ {
_ret.MessageList.Add(string.Format("物料号{0}大订单总剩余数{1}小于本次要货数{2}", _ls.PartCode, MaxP, _PlanQTY)); _ret.MessageList.Add(string.Format("物料号{0}大订单总剩余数{1}小于本次要货数{2}", _ls.PartCode, MaxP, _PlanQTY));
} }
else else
{ {
var _MaxpoList = db.TB_MAXPO_DETAIL.Where(t => t.PartCode == _ls.PartCode && t.SurplusQty > 0 && t.VendId == _ls.UpdateInfo).OrderBy(t => t.PoBillNum).ToList(); var _MaxpoList = db.TB_MAXPO_DETAIL.Where(t => t.PartCode == _ls.PartCode && t.SurplusQty > 0 && t.VendId == _ls.UpdateInfo && !t.IsDeleted).OrderBy(t => t.PoBillNum).ToList();
foreach (var _maxpo in _MaxpoList) foreach (var _maxpo in _MaxpoList)
{ {
if (_maxpo.SurplusQty > _PlanQTY) if (_maxpo.SurplusQty > _PlanQTY)
@ -8067,9 +8067,11 @@ namespace CK.SCP.Controller
{ {
foreach (var ui in Uid) foreach (var ui in Uid)
{ {
var maxpodetail = db.V_TB_MAXPO_DETAIL.FirstOrDefault(p => p.UID.ToString() == ui); var maxpodetail = db.TB_MAXPO_DETAIL.FirstOrDefault(p => p.UID.ToString() == ui);
maxpodetail.IsDeleted = true;
var uni = db.TS_UNI_API.FirstOrDefault(p => p.PartCode == maxpodetail.PartCode && p.BillNum == maxpodetail.PoBillNum); var uni = db.TS_UNI_API.FirstOrDefault(p => p.PartCode == maxpodetail.PartCode && p.BillNum == maxpodetail.PoBillNum);
uni.State = 1; uni.State = 1;
db.TB_MAXPO_DETAIL.AddOrUpdate(maxpodetail);
db.TS_UNI_API.AddOrUpdate(uni); db.TS_UNI_API.AddOrUpdate(uni);
} }
} }
@ -9300,7 +9302,7 @@ namespace CK.SCP.Controller
foreach (var itm in p_entitys) foreach (var itm in p_entitys)
{ {
var _entity = db.TB_MAXPO_DETAIL.Where(p => p.UID == itm.UID).FirstOrDefault(); var _entity = db.TB_MAXPO_DETAIL.Where(p => p.UID == itm.UID && !p.IsDeleted).FirstOrDefault();
if (itm.OrderQtykg < _entity.OrderQtykg - _entity.AsnQty) if (itm.OrderQtykg < _entity.OrderQtykg - _entity.AsnQty)
{ {
_ret.MessageList.Add("零件号" + _entity.PartCode + "剩余可消耗订货量不足!"); _ret.MessageList.Add("零件号" + _entity.PartCode + "剩余可消耗订货量不足!");
@ -9458,7 +9460,7 @@ namespace CK.SCP.Controller
foreach (var itm in p_entitys) foreach (var itm in p_entitys)
{ {
var _entity = db.V_TB_MAXPO_DETAIL.Where(p => p.UID == itm.UID).FirstOrDefault(); var _entity = db.V_TB_MAXPO_DETAIL.Where(p => p.UID == itm.UID).FirstOrDefault();
if (Math.Abs( (itm.ReductionQty * 1000).Value) < _entity.SurplusQty) if (Math.Abs( (itm.ReductionQty * 1000).Value) > _entity.SurplusQty)
{ {
_ret.MessageList.Add("零件号" + _entity.PartCode + "单次削减量不能大于剩余订货量(千克)"); _ret.MessageList.Add("零件号" + _entity.PartCode + "单次削减量不能大于剩余订货量(千克)");
} }
@ -9526,8 +9528,8 @@ namespace CK.SCP.Controller
maxuni.CreateTime = DateTime.Now; maxuni.CreateTime = DateTime.Now;
maxuni.PutTime = DateTime.Now; maxuni.PutTime = DateTime.Now;
maxuni.Extend1 = _entity.PartNumber; maxuni.Extend1 = _entity.PartNumber;
maxuni.PackQty = _entity.OrderQtykg/1000; maxuni.PackQty = _entity.MinordQty;
maxuni.Price = _entity.OrderQtydNow; maxuni.Price = _entity.OrderQtykg / 1000;
maxuni.VendBatch = _entity.ContractMonth;//合同月 maxuni.VendBatch = _entity.ContractMonth;//合同月
maxuni.Currency = _entity.Model; maxuni.Currency = _entity.Model;
maxuni.Buyer = _entity.TechStandard; maxuni.Buyer = _entity.TechStandard;

2
Models/ScpEntity/V_TA_ToleranceProportion.cs

@ -16,5 +16,7 @@ namespace CK.SCP.Models.ScpEntity
[DisplayName("零件名称")] [DisplayName("零件名称")]
public string PartName { get; set; } public string PartName { get; set; }
[DisplayName("零件类型")]
public string PartGroup { get; set; }
} }
} }

11
SCP/Views/BasicData/SCP_ToleranceProportion.aspx

@ -23,8 +23,8 @@
<f:ToolbarSeparator runat="server" /> <f:ToolbarSeparator runat="server" />
<f:FileUpload runat="server" ID="FileUp" EmptyText="请选择导入模板" Required="true" Width="200" ButtonIcon="Add" ShowRedStar="true"></f:FileUpload> <f:FileUpload runat="server" ID="FileUp" EmptyText="请选择导入模板" Required="true" Width="200" ButtonIcon="Add" ShowRedStar="true"></f:FileUpload>
<f:Button ID="btnInput" runat="server" Text="导入" Icon="PageExcel" OnClick="btnInput_Click"> <f:Button ID="btnInput" runat="server" Text="导入" Icon="PageExcel" OnClick="btnInput_Click"/>
</f:Button> <f:Button ID="Button1" runat="server" Text="导出" Icon="PageExcel" OnClick="BtnOutPut_OnClick" />
</Items> </Items>
</f:Toolbar> </f:Toolbar>
@ -35,9 +35,10 @@
DataKeyNames="PartCode" AllowSorting="true" IsDatabasePaging="true" SortField="PartCode"> DataKeyNames="PartCode" AllowSorting="true" IsDatabasePaging="true" SortField="PartCode">
<Columns> <Columns>
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" Width="200px" /> <f:BoundField runat="server" SortField="PartCode" DataField="PartCode" HeaderText="零件号" Width="200px" />
<f:BoundField SortField="PartName" DataField="PartName" HeaderText="零件名称" Width="200px" /> <f:BoundField runat="server" SortField="PartName" DataField="PartName" HeaderText="零件名称" Width="200px" />
<f:BoundField SortField="VToleranceProportion" DataField="VToleranceProportion" HeaderText="容差" Width="100px" /> <f:BoundField runat="server" SortField="VToleranceProportion" DataField="VToleranceProportion" HeaderText="容差" Width="100px" />
<f:BoundField runat="server" HeaderText="零件类型" ColumnID="" DataField="PartGroup" Width="200px" />
</Columns> </Columns>
</f:Grid> </f:Grid>
</Items> </Items>

40
SCP/Views/BasicData/SCP_ToleranceProportion.aspx.cs

@ -53,29 +53,23 @@ namespace SCP.Views.BasicData
//导出 //导出
public void BtnOutPut_OnClick(object sender, EventArgs e) public void BtnOutPut_OnClick(object sender, EventArgs e)
{ {
//_list = SCP_TB_VENDER_CONTROLLER.Getlist(); TA_ToleranceProportion _entity = new TA_ToleranceProportion();
//var list = Sort<TA_VENDER>(_list.AsQueryable(), Grid1).ToList();
//// 2.设置单元格抬头 _entity.PartCode = txtPartCode.Text;
//// key:实体对象属性名称,可通过反射获取值 SCP_ToleranceProportion_Controller.Get_TA_ToleranceProportion_List(_entity, (_ret) =>
//// value:Excel列的名称 {
//Dictionary<string, string> cellheader = new Dictionary<string, string> { if (_ret.State == ReturnStatus.Succeed)
// { "VendId", "供应商编号" }, {
// { "VendName", "供应商名称" }, Dictionary<string, string> cellheader = new Dictionary<string, string> {
// { "VendAbbCode", "供应商缩写" }, { "PartCode", "零件号" },
// { "VendType", "供应商类型" }, { "PartName", "零件名称" },
// { "Country", "国家" }, { "VToleranceProportion", "容差" },
// { "City", "城市" }, { "PartGroup", "零件类型" },
// { "Currency", "币种" },
// { "Address", "地址" }, };
// { "ZipCode", "邮编" }, string url = EntityListToExcel2003(cellheader, _ret.Result.ToList(), "零件容差控制导出");
// { "Contacter", "联系人" }, }
// { "Phone", "电话" }, });
// { "Fax", "传真" },
// { "Email", "电子邮件" },
// { "State", "状态" },
// { "Remark", "备注" },
//};
//string url = EntityListToExcel2003(cellheader, list, "供应商");
} }

9
SCP/Views/BasicData/SCP_ToleranceProportion.aspx.designer.cs

@ -95,6 +95,15 @@ namespace SCP.Views.BasicData
/// </remarks> /// </remarks>
protected global::FineUI.Button btnInput; protected global::FineUI.Button btnInput;
/// <summary>
/// Button1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button1;
/// <summary> /// <summary>
/// Grid1 控件。 /// Grid1 控件。
/// </summary> /// </summary>

2
SCP/Views/SupplierData/SCP_ASN_DETAIL.aspx.cs

@ -381,7 +381,7 @@ namespace SCP.SupplierData
{ {
foreach (var con in conasn) foreach (var con in conasn)
{ {
var maxdetail = SCPDB.TB_MAXPO_DETAIL.FirstOrDefault(p => p.PoBillNum == con.PoBillNum && p.PartCode == con.PartCode); var maxdetail = SCPDB.TB_MAXPO_DETAIL.FirstOrDefault(p => p.PoBillNum == con.PoBillNum && p.PartCode == con.PartCode && !p.IsDeleted);
maxdetail.AsnQty = maxdetail.AsnQty +con.PoQty; maxdetail.AsnQty = maxdetail.AsnQty +con.PoQty;
SCPDB.TB_MAXPO_DETAIL.AddOrUpdate(maxdetail); SCPDB.TB_MAXPO_DETAIL.AddOrUpdate(maxdetail);
SCPDB.TB_MAXPO_CONSUME.Remove(con); SCPDB.TB_MAXPO_CONSUME.Remove(con);

4
SCP/Views/富维冲压件/SCP_PO_MAX_DETAIL.aspx

@ -25,8 +25,8 @@
</f:Toolbar> </f:Toolbar>
</Toolbars> </Toolbars>
<Items> <Items>
<f:Grid ID="Grid_V_TB_PO_SUBDETAIL" Title="大订单明细" BoxFlex="1" ShowBorder="True" ShowHeader="True" AllowCellEditing="True" ClicksToEdit="1" <f:Grid ID="Grid_V_TB_PO_SUBDETAIL" Title="大订单明细" BoxFlex="1" ShowBorder="True" ShowHeader="True" AllowCellEditing="True" ClicksToEdit="1" EnableCheckBoxSelect="true"
runat="server" PageSize="1000" SortField="UID" IsDatabasePaging="True" AllowPaging="True" SortDirection="Desc" AutoScroll="True" runat="server" PageSize="1000" SortField="UID" IsDatabasePaging="True" AllowPaging="True" SortDirection="Desc" AutoScroll="True"
DataKeyNames="UID,PoBillNum,PartCode,Qty,SubQty,ReductionQty,ReductionQtyOne,ReductionQtyTwo,ReductionQtyThree,ReductionQtyFour,ReductionQtyFive" > DataKeyNames="UID,PoBillNum,PartCode,Qty,SubQty,ReductionQty,ReductionQtyOne,ReductionQtyTwo,ReductionQtyThree,ReductionQtyFour,ReductionQtyFive" >
<Columns> <Columns>
<f:BoundField Width="100px" DataField="PartCode" DataFormatString="{0}" HeaderText="原料物料号" SortField="PartCode" /> <f:BoundField Width="100px" DataField="PartCode" DataFormatString="{0}" HeaderText="原料物料号" SortField="PartCode" />

6
UniApiGroup/Controller/OdbcApiWmsController.cs

@ -358,7 +358,7 @@ namespace CK.SCP.GrupUniApi.Controller
string[] arrr = ar.Split('-'); string[] arrr = ar.Split('-');
string pobillnum = arrr[0]; string pobillnum = arrr[0];
decimal qty = decimal.Parse(arrr[1]); decimal qty = decimal.Parse(arrr[1]);
var maxpodetail = wdb.TB_MAXPO_DETAIL.FirstOrDefault(p => p.PartCode == qadData.xxwms_rc_part && p.PoBillNum == pobillnum); var maxpodetail = wdb.TB_MAXPO_DETAIL.FirstOrDefault(p => p.PartCode == qadData.xxwms_rc_part && p.PoBillNum == pobillnum && !p.IsDeleted);
if (maxpodetail != null) if (maxpodetail != null)
{ {
maxpodetail.ReceQty = maxpodetail.ReceQty + qty; maxpodetail.ReceQty = maxpodetail.ReceQty + qty;
@ -392,7 +392,7 @@ namespace CK.SCP.GrupUniApi.Controller
string[] arrr = ar.Split('-'); string[] arrr = ar.Split('-');
string pobillnum = arrr[0]; string pobillnum = arrr[0];
decimal qty = decimal.Parse(arrr[1]); decimal qty = decimal.Parse(arrr[1]);
var maxpodetail = wdb.TB_MAXPO_DETAIL.FirstOrDefault(p => p.PartCode == qadData.xxwms_rc_part && p.PoBillNum == pobillnum); var maxpodetail = wdb.TB_MAXPO_DETAIL.FirstOrDefault(p => p.PartCode == qadData.xxwms_rc_part && p.PoBillNum == pobillnum && !p.IsDeleted);
if (maxpodetail != null) if (maxpodetail != null)
{ {
maxpodetail.ReturnQty = maxpodetail.ReturnQty - qty; maxpodetail.ReturnQty = maxpodetail.ReturnQty - qty;
@ -849,7 +849,7 @@ namespace CK.SCP.GrupUniApi.Controller
string[] arrr = ar.Split('-'); string[] arrr = ar.Split('-');
string pobillnum = arrr[0]; string pobillnum = arrr[0];
decimal qty = decimal.Parse(arrr[1]); decimal qty = decimal.Parse(arrr[1]);
var maxpodetail = wdb.TB_MAXPO_DETAIL.FirstOrDefault(p => p.PartCode == qadData.xxwms_rt_part && p.PoBillNum == pobillnum); var maxpodetail = wdb.TB_MAXPO_DETAIL.FirstOrDefault(p => p.PartCode == qadData.xxwms_rt_part && p.PoBillNum == pobillnum && !p.IsDeleted);
if (maxpodetail != null) if (maxpodetail != null)
{ {
maxpodetail.ReturnQty = maxpodetail.ReturnQty -qty; maxpodetail.ReturnQty = maxpodetail.ReturnQty -qty;

Loading…
Cancel
Save