From f7ea333dff348f7ac087f95b91e1076d1aca2910 Mon Sep 17 00:00:00 2001 From: qian Date: Mon, 30 Dec 2024 09:02:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E8=AE=A2=E5=8D=95=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/SCP_ASN_CONTROLLER.cs | 2 +- Controller/SCP_PO_CONTROLLER.cs | 16 ++++---- Models/ScpEntity/V_TA_ToleranceProportion.cs | 2 + .../BasicData/SCP_ToleranceProportion.aspx | 11 ++--- .../BasicData/SCP_ToleranceProportion.aspx.cs | 40 ++++++++----------- .../SCP_ToleranceProportion.aspx.designer.cs | 9 +++++ SCP/Views/SupplierData/SCP_ASN_DETAIL.aspx.cs | 2 +- .../富维冲压件/SCP_PO_MAX_DETAIL.aspx | 4 +- .../Controller/OdbcApiWmsController.cs | 6 +-- 9 files changed, 50 insertions(+), 42 deletions(-) diff --git a/Controller/SCP_ASN_CONTROLLER.cs b/Controller/SCP_ASN_CONTROLLER.cs index 5bdd206..391508e 100644 --- a/Controller/SCP_ASN_CONTROLLER.cs +++ b/Controller/SCP_ASN_CONTROLLER.cs @@ -3036,7 +3036,7 @@ namespace CK.SCP.Controller { 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; if (_maxpolist.Count() > 0) { diff --git a/Controller/SCP_PO_CONTROLLER.cs b/Controller/SCP_PO_CONTROLLER.cs index d6639b5..7364fbe 100644 --- a/Controller/SCP_PO_CONTROLLER.cs +++ b/Controller/SCP_PO_CONTROLLER.cs @@ -5076,14 +5076,14 @@ namespace CK.SCP.Controller var _list = p.ToList(); decimal _PlanQTY = _list.Sum(t => t.PlanQty); 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) { _ret.MessageList.Add(string.Format("物料号{0}大订单总剩余数{1}小于本次要货数{2}", _ls.PartCode, MaxP, _PlanQTY)); } 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) { if (_maxpo.SurplusQty > _PlanQTY) @@ -8067,9 +8067,11 @@ namespace CK.SCP.Controller { 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); uni.State = 1; + db.TB_MAXPO_DETAIL.AddOrUpdate(maxpodetail); db.TS_UNI_API.AddOrUpdate(uni); } } @@ -9300,7 +9302,7 @@ namespace CK.SCP.Controller 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) { _ret.MessageList.Add("零件号" + _entity.PartCode + "剩余可消耗订货量不足!"); @@ -9458,7 +9460,7 @@ namespace CK.SCP.Controller foreach (var itm in p_entitys) { 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 + "单次削减量不能大于剩余订货量(千克)"); } @@ -9526,8 +9528,8 @@ namespace CK.SCP.Controller maxuni.CreateTime = DateTime.Now; maxuni.PutTime = DateTime.Now; maxuni.Extend1 = _entity.PartNumber; - maxuni.PackQty = _entity.OrderQtykg/1000; - maxuni.Price = _entity.OrderQtydNow; + maxuni.PackQty = _entity.MinordQty; + maxuni.Price = _entity.OrderQtykg / 1000; maxuni.VendBatch = _entity.ContractMonth;//合同月 maxuni.Currency = _entity.Model; maxuni.Buyer = _entity.TechStandard; diff --git a/Models/ScpEntity/V_TA_ToleranceProportion.cs b/Models/ScpEntity/V_TA_ToleranceProportion.cs index 79140e5..17ed941 100644 --- a/Models/ScpEntity/V_TA_ToleranceProportion.cs +++ b/Models/ScpEntity/V_TA_ToleranceProportion.cs @@ -16,5 +16,7 @@ namespace CK.SCP.Models.ScpEntity [DisplayName("零件名称")] public string PartName { get; set; } + [DisplayName("零件类型")] + public string PartGroup { get; set; } } } diff --git a/SCP/Views/BasicData/SCP_ToleranceProportion.aspx b/SCP/Views/BasicData/SCP_ToleranceProportion.aspx index 60518cd..4f14bc1 100644 --- a/SCP/Views/BasicData/SCP_ToleranceProportion.aspx +++ b/SCP/Views/BasicData/SCP_ToleranceProportion.aspx @@ -23,8 +23,8 @@ - - + + @@ -35,9 +35,10 @@ DataKeyNames="PartCode" AllowSorting="true" IsDatabasePaging="true" SortField="PartCode"> - - - + + + + diff --git a/SCP/Views/BasicData/SCP_ToleranceProportion.aspx.cs b/SCP/Views/BasicData/SCP_ToleranceProportion.aspx.cs index d9f09a5..f40933a 100644 --- a/SCP/Views/BasicData/SCP_ToleranceProportion.aspx.cs +++ b/SCP/Views/BasicData/SCP_ToleranceProportion.aspx.cs @@ -53,29 +53,23 @@ namespace SCP.Views.BasicData //导出 public void BtnOutPut_OnClick(object sender, EventArgs e) { - //_list = SCP_TB_VENDER_CONTROLLER.Getlist(); - //var list = Sort(_list.AsQueryable(), Grid1).ToList(); - //// 2.设置单元格抬头 - //// key:实体对象属性名称,可通过反射获取值 - //// value:Excel列的名称 - //Dictionary cellheader = new Dictionary { - // { "VendId", "供应商编号" }, - // { "VendName", "供应商名称" }, - // { "VendAbbCode", "供应商缩写" }, - // { "VendType", "供应商类型" }, - // { "Country", "国家" }, - // { "City", "城市" }, - // { "Currency", "币种" }, - // { "Address", "地址" }, - // { "ZipCode", "邮编" }, - // { "Contacter", "联系人" }, - // { "Phone", "电话" }, - // { "Fax", "传真" }, - // { "Email", "电子邮件" }, - // { "State", "状态" }, - // { "Remark", "备注" }, - //}; - //string url = EntityListToExcel2003(cellheader, list, "供应商"); + TA_ToleranceProportion _entity = new TA_ToleranceProportion(); + + _entity.PartCode = txtPartCode.Text; + SCP_ToleranceProportion_Controller.Get_TA_ToleranceProportion_List(_entity, (_ret) => + { + if (_ret.State == ReturnStatus.Succeed) + { + Dictionary cellheader = new Dictionary { + { "PartCode", "零件号" }, + { "PartName", "零件名称" }, + { "VToleranceProportion", "容差" }, + { "PartGroup", "零件类型" }, + + }; + string url = EntityListToExcel2003(cellheader, _ret.Result.ToList(), "零件容差控制导出"); + } + }); } diff --git a/SCP/Views/BasicData/SCP_ToleranceProportion.aspx.designer.cs b/SCP/Views/BasicData/SCP_ToleranceProportion.aspx.designer.cs index 6a26d3c..79ea621 100644 --- a/SCP/Views/BasicData/SCP_ToleranceProportion.aspx.designer.cs +++ b/SCP/Views/BasicData/SCP_ToleranceProportion.aspx.designer.cs @@ -95,6 +95,15 @@ namespace SCP.Views.BasicData /// protected global::FineUI.Button btnInput; + /// + /// Button1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Button Button1; + /// /// Grid1 控件。 /// diff --git a/SCP/Views/SupplierData/SCP_ASN_DETAIL.aspx.cs b/SCP/Views/SupplierData/SCP_ASN_DETAIL.aspx.cs index 79450f7..951c251 100644 --- a/SCP/Views/SupplierData/SCP_ASN_DETAIL.aspx.cs +++ b/SCP/Views/SupplierData/SCP_ASN_DETAIL.aspx.cs @@ -381,7 +381,7 @@ namespace SCP.SupplierData { 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; SCPDB.TB_MAXPO_DETAIL.AddOrUpdate(maxdetail); SCPDB.TB_MAXPO_CONSUME.Remove(con); diff --git a/SCP/Views/富维冲压件/SCP_PO_MAX_DETAIL.aspx b/SCP/Views/富维冲压件/SCP_PO_MAX_DETAIL.aspx index c63ba96..345f3b9 100644 --- a/SCP/Views/富维冲压件/SCP_PO_MAX_DETAIL.aspx +++ b/SCP/Views/富维冲压件/SCP_PO_MAX_DETAIL.aspx @@ -25,8 +25,8 @@ - diff --git a/UniApiGroup/Controller/OdbcApiWmsController.cs b/UniApiGroup/Controller/OdbcApiWmsController.cs index ab9ae3f..f225b70 100644 --- a/UniApiGroup/Controller/OdbcApiWmsController.cs +++ b/UniApiGroup/Controller/OdbcApiWmsController.cs @@ -358,7 +358,7 @@ namespace CK.SCP.GrupUniApi.Controller string[] arrr = ar.Split('-'); string pobillnum = arrr[0]; 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) { maxpodetail.ReceQty = maxpodetail.ReceQty + qty; @@ -392,7 +392,7 @@ namespace CK.SCP.GrupUniApi.Controller string[] arrr = ar.Split('-'); string pobillnum = arrr[0]; 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) { maxpodetail.ReturnQty = maxpodetail.ReturnQty - qty; @@ -849,7 +849,7 @@ namespace CK.SCP.GrupUniApi.Controller string[] arrr = ar.Split('-'); string pobillnum = arrr[0]; 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) { maxpodetail.ReturnQty = maxpodetail.ReturnQty -qty;