From 1eabab0981f744e91123be259d77a25cf15b1633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Mon, 2 Nov 2020 14:02:34 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Models/CK.SCP.Models.csproj | 1 + Models/ScpEntity/TB_RECEIVE_QTY.cs | 19 ++++++++ .../PlanData/SCP_ASN_DETAIL_View.aspx.cs | 1 + .../SupplierData/SCP_PALLET_CREATE.aspx.cs | 1 + .../SupplierData/SCP_RECEIVE_LIST.aspx.cs | 2 - SCP/default.aspx | 4 +- .../Controller/OdbcApiWmsController.cs | 46 +++++++++++++++++-- UniApiWpf/MainWindow.xaml.cs | 2 +- 8 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 Models/ScpEntity/TB_RECEIVE_QTY.cs diff --git a/Models/CK.SCP.Models.csproj b/Models/CK.SCP.Models.csproj index de1bb5e..ea1e77a 100644 --- a/Models/CK.SCP.Models.csproj +++ b/Models/CK.SCP.Models.csproj @@ -354,6 +354,7 @@ + diff --git a/Models/ScpEntity/TB_RECEIVE_QTY.cs b/Models/ScpEntity/TB_RECEIVE_QTY.cs new file mode 100644 index 0000000..8b0e767 --- /dev/null +++ b/Models/ScpEntity/TB_RECEIVE_QTY.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public class TB_RECEIVE_QTY + { + + public decimal? RecQty { set; get; } + public string AsnBillNum { set; get; } + public int PoLine { set; get; } + public string PartCode { set; get; } + public string PoBillNum { set; get; } + public string Batch { set; get; } + } +} diff --git a/SCP/Views/PlanData/SCP_ASN_DETAIL_View.aspx.cs b/SCP/Views/PlanData/SCP_ASN_DETAIL_View.aspx.cs index 82dd86f..89f079b 100644 --- a/SCP/Views/PlanData/SCP_ASN_DETAIL_View.aspx.cs +++ b/SCP/Views/PlanData/SCP_ASN_DETAIL_View.aspx.cs @@ -15,6 +15,7 @@ namespace SCP.PlanData { public partial class SCP_ASN_DETAIL_View : PageBase { + protected void Page_Load(object sender, EventArgs e) { diff --git a/SCP/Views/SupplierData/SCP_PALLET_CREATE.aspx.cs b/SCP/Views/SupplierData/SCP_PALLET_CREATE.aspx.cs index 6126abb..a222c77 100644 --- a/SCP/Views/SupplierData/SCP_PALLET_CREATE.aspx.cs +++ b/SCP/Views/SupplierData/SCP_PALLET_CREATE.aspx.cs @@ -18,6 +18,7 @@ namespace SCP.SupplierData public partial class SCP_PALLET_CREATE : PageBase { + protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) diff --git a/SCP/Views/SupplierData/SCP_RECEIVE_LIST.aspx.cs b/SCP/Views/SupplierData/SCP_RECEIVE_LIST.aspx.cs index d6a1a66..1781db5 100644 --- a/SCP/Views/SupplierData/SCP_RECEIVE_LIST.aspx.cs +++ b/SCP/Views/SupplierData/SCP_RECEIVE_LIST.aspx.cs @@ -307,8 +307,6 @@ namespace SCP.SupplierData Alert.Show("不允许开负数发票!退货、索赔零件数量有问题,请联系工厂库房和质量解决!"); return; } - - if (IdList.Count > 200) { Alert.Show("选择零件记录超过,发票允许条数!"); diff --git a/SCP/default.aspx b/SCP/default.aspx index beef335..a302f85 100644 --- a/SCP/default.aspx +++ b/SCP/default.aspx @@ -111,10 +111,10 @@ for (var i = 0; obj.options.length; i++) { - if ('JZ1' == obj.options[i].value) { + if ('BJCIAI' == obj.options[i].value) { obj.options[i].selected = true; _factory = document.getElementById(_factoryValue); - _factory.value = 'JZ1'; + _factory.value = 'BJCIAI'; } } } diff --git a/UniApiGroup/Controller/OdbcApiWmsController.cs b/UniApiGroup/Controller/OdbcApiWmsController.cs index 7ae290d..4c96ff5 100644 --- a/UniApiGroup/Controller/OdbcApiWmsController.cs +++ b/UniApiGroup/Controller/OdbcApiWmsController.cs @@ -205,6 +205,18 @@ namespace CK.SCP.GrupUniApi.Controller private static void AddMaterialReceive(UniApiEntities idb, ScpEntities wdb, string seq, int billtype) { + + +string _recvQty = "SELECT RecQty, AsnBillNum, PoLine, PartCode, PoBillNum,Batch\n" + +"FROM (SELECT SUM(a.Qty) AS RecQty, a.AsnBillNum, a.PoLine, a.PartCode, a.PoBillNum,a.batch\n" + +" FROM V_TB_RECEIVE_DETAIL AS a INNER JOIN\n" + +" V_TB_ASN_DETAIL AS B ON a.AsnBillNum = B.AsnBillNum AND a.PoLine = B.PoLine AND\n" + +" a.PartCode = B.PartCode AND a.PoBillNum = B.PoBillNum and a.Batch=b.Batch\n" + +" GROUP BY a.AsnBillNum, a.PoLine, a.PartCode, a.PoBillNum) AS d\n" + +"WHERE (AsnBillNum = '{0}')"; + + + var qadRcvDetailList = idb.xxwms_rc_det.Where(p => p.xxwms_rc_seq == seq&&p.xxwms_rc_qty_total>=0).ToList(); var scpRcvList = new List(); var scpRcveDetailList = new List(); @@ -222,7 +234,7 @@ namespace CK.SCP.GrupUniApi.Controller } var firstqadData = qadDataList[0]; - + List _lsQty = new List(); var scpRcv = wdb.TB_RECEIVE.SingleOrDefault(p => p.RecvBillNum != null && p.RecvBillNum == qadRcvNbrList && p.Site==firstqadData.xxwms_rc_domain); //ж0100ջԶǷΪ @@ -267,6 +279,13 @@ namespace CK.SCP.GrupUniApi.Controller BillType = billtype }; scpRcvList.Add(scpRcv); + if (!string.IsNullOrEmpty(scpRcv.AsnBillNum)) + { + _lsQty = wdb.Database.SqlQuery(_recvQty, scpRcv.RecvBillNum).ToList(); + } + + + } scpRcv.PoBillNum = firstqadData.xxwms_rc_po_nbr;//ɹ scpRcv.AsnBillNum = firstqadData.xxwms_rc_ps_nbr;// @@ -274,7 +293,7 @@ namespace CK.SCP.GrupUniApi.Controller scpRcv.VendId = firstqadData.xxwms_rc_vend;// scpRcv.ShipTime = firstqadData.xxwms_rc_date_ship;//ջ scpRcv.SubSite = !string.IsNullOrEmpty(firstqadData.xxwms_rc_site)? firstqadData.xxwms_rc_site: firstqadData.xxwms_rc_domain; - + //var scpAsn = wdb.TF_ASN.FirstOrDefault(p => p.BillNum == scpRcv.AsnBillNum); var scpAsn = wdb.TB_ASN.Where(p => p.AsnBillNum== scpRcv.AsnBillNum && p.IsDeleted==false).ToList();//==ջ if (scpAsn != null && scpAsn.Count>0) @@ -292,6 +311,7 @@ namespace CK.SCP.GrupUniApi.Controller }); wdb.TB_ASN_DETAIL.AddOrUpdate(scpAsnDetail.ToArray()); } + foreach (var qadData in qadDataList) { try @@ -304,9 +324,10 @@ namespace CK.SCP.GrupUniApi.Controller p.PoLine == poLineNum && p.PartCode == qadData.xxwms_rc_part && p.Batch == qadData.xxwms_rc_lot - - ); + + + if (scpRcvDetail == null) { int istate = 0; @@ -340,6 +361,23 @@ namespace CK.SCP.GrupUniApi.Controller BillType = billtype }; scpRcveDetailList.Add(scpRcvDetail); + var _first= wdb.TB_ASN_DETAIL.FirstOrDefault(p => p.AsnBillNum == scpRcv.AsnBillNum + && p.PartCode== qadData.xxwms_rc_part + && p.Batch==qadData.xxwms_rc_lot + && p.PoBillNum==qadData.xxwms_rc_po_nbr + && p.PoLine==qadData.xxwms_rc_po_line + ); + var _fs=_lsQty.FirstOrDefault(p => p.AsnBillNum == scpRcv.AsnBillNum + && p.PartCode == qadData.xxwms_rc_part + && p.Batch == qadData.xxwms_rc_lot + && p.PoBillNum == qadData.xxwms_rc_po_nbr + && p.PoLine == qadData.xxwms_rc_po_line); + + if (_first != null && _fs!=null) + { + _first.Extend1 = (_fs.RecQty.Value + qadData.xxwms_rc_qty_total).ToString(); + wdb.TB_ASN_DETAIL.AddOrUpdate(_first); + } } //var scpPoDetail = // wdb.TB_PO_DETAIL.FirstOrDefault( diff --git a/UniApiWpf/MainWindow.xaml.cs b/UniApiWpf/MainWindow.xaml.cs index d568b63..55e0e5d 100644 --- a/UniApiWpf/MainWindow.xaml.cs +++ b/UniApiWpf/MainWindow.xaml.cs @@ -198,7 +198,7 @@ namespace UniApiWpf try { SCP_DC_UNI_CONTROLLER.ReadService((rs) => - { + { List _list = new List(); if (rs.State == ReturnStatus.Succeed) { From d661c5861244e6366a0ceffa4038139b5e4915d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Mon, 2 Nov 2020 14:11:19 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UniApiGroup/Controller/OdbcApiWmsController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UniApiGroup/Controller/OdbcApiWmsController.cs b/UniApiGroup/Controller/OdbcApiWmsController.cs index 4c96ff5..9052f99 100644 --- a/UniApiGroup/Controller/OdbcApiWmsController.cs +++ b/UniApiGroup/Controller/OdbcApiWmsController.cs @@ -375,7 +375,7 @@ string _recvQty = "SELECT RecQty, AsnBillNum, PoLine, PartCode, PoBillNum,Batc if (_first != null && _fs!=null) { - _first.Extend1 = (_fs.RecQty.Value + qadData.xxwms_rc_qty_total).ToString(); + _first.Extend1 = (_fs.RecQty!=null?_fs.RecQty.Value:0 + qadData.xxwms_rc_qty_total).ToString(); wdb.TB_ASN_DETAIL.AddOrUpdate(_first); } } From ae228f26afcc76b3c9478b19b36ceae6e4adc226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Mon, 2 Nov 2020 16:58:59 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SCP/Views/PlanData/SCP_PO_PLAN_EXTEND.aspx.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SCP/Views/PlanData/SCP_PO_PLAN_EXTEND.aspx.cs b/SCP/Views/PlanData/SCP_PO_PLAN_EXTEND.aspx.cs index 4d438c7..7ea45af 100644 --- a/SCP/Views/PlanData/SCP_PO_PLAN_EXTEND.aspx.cs +++ b/SCP/Views/PlanData/SCP_PO_PLAN_EXTEND.aspx.cs @@ -49,7 +49,11 @@ namespace SCP.PlanData SearchV_TB_PO((result)=> { Grid_V_TB_PO.RecordCount = result.Count(); var list = SortAndPage(result, Grid_V_TB_PO); - string str = "SELECT MAX(B.EndTime) EndTime ,a.PoBillNum ,a.site,max(B.Version) AS Version FROM V_TB_PO A INNER JOIN V_TB_PO_PLAN_EXTEND B ON A.PoBillNum = B.PoBillNum AND B.AskBillNum <> '' and a.Site = b.Domain GROUP BY A.PoBillNum,a.Site"; + +string str = "SELECT MAX(A.EndTime) EndTime ,A.PoBillNum ,Domain AS SITE,max(Version) AS Version\n" + +" FROM [TB_PO_PLAN_EXTEND] A left join TB_ASK B ON A.PoBillNum=B.PoBillNum AND A.Domain=B.Site and A.EndTime=B.EndTime\n" + +" where A.IsDeleted=0 AND B.IsDeleted=0 AND B.AskBillNum<>'' group by A.PoBillNum, a.Domain"; + var _tempList= SCPDB.Database.SqlQuery(str).ToList(); foreach (var itm in list) { From ca1e339f13fda2ca23fb46c53f2771856eeece3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Tue, 3 Nov 2020 08:33:33 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/OdbcApiWmsController.cs | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/UniApiGroup/Controller/OdbcApiWmsController.cs b/UniApiGroup/Controller/OdbcApiWmsController.cs index 9052f99..28a2906 100644 --- a/UniApiGroup/Controller/OdbcApiWmsController.cs +++ b/UniApiGroup/Controller/OdbcApiWmsController.cs @@ -207,13 +207,13 @@ namespace CK.SCP.GrupUniApi.Controller -string _recvQty = "SELECT RecQty, AsnBillNum, PoLine, PartCode, PoBillNum,Batch\n" + -"FROM (SELECT SUM(a.Qty) AS RecQty, a.AsnBillNum, a.PoLine, a.PartCode, a.PoBillNum,a.batch\n" + -" FROM V_TB_RECEIVE_DETAIL AS a INNER JOIN\n" + -" V_TB_ASN_DETAIL AS B ON a.AsnBillNum = B.AsnBillNum AND a.PoLine = B.PoLine AND\n" + -" a.PartCode = B.PartCode AND a.PoBillNum = B.PoBillNum and a.Batch=b.Batch\n" + -" GROUP BY a.AsnBillNum, a.PoLine, a.PartCode, a.PoBillNum) AS d\n" + -"WHERE (AsnBillNum = '{0}')"; +//string _recvQty = "SELECT RecQty, AsnBillNum, PoLine, PartCode, PoBillNum,Batch\n" + +//"FROM (SELECT SUM(a.Qty) AS RecQty, a.AsnBillNum, a.PoLine, a.PartCode, a.PoBillNum,a.batch\n" + +//" FROM V_TB_RECEIVE_DETAIL AS a INNER JOIN\n" + +//" V_TB_ASN_DETAIL AS B ON a.AsnBillNum = B.AsnBillNum AND a.PoLine = B.PoLine AND\n" + +//" a.PartCode = B.PartCode AND a.PoBillNum = B.PoBillNum and a.Batch=b.Batch\n" + +//" GROUP BY a.AsnBillNum, a.PoLine, a.PartCode, a.PoBillNum) AS d\n" + +//"WHERE (AsnBillNum = '{0}')"; @@ -279,10 +279,10 @@ string _recvQty = "SELECT RecQty, AsnBillNum, PoLine, PartCode, PoBillNum,Batc BillType = billtype }; scpRcvList.Add(scpRcv); - if (!string.IsNullOrEmpty(scpRcv.AsnBillNum)) - { - _lsQty = wdb.Database.SqlQuery(_recvQty, scpRcv.RecvBillNum).ToList(); - } + //if (!string.IsNullOrEmpty(scpRcv.AsnBillNum)) + //{ + // _lsQty = wdb.Database.SqlQuery(_recvQty, scpRcv.RecvBillNum).ToList(); + //} @@ -361,23 +361,23 @@ string _recvQty = "SELECT RecQty, AsnBillNum, PoLine, PartCode, PoBillNum,Batc BillType = billtype }; scpRcveDetailList.Add(scpRcvDetail); - var _first= wdb.TB_ASN_DETAIL.FirstOrDefault(p => p.AsnBillNum == scpRcv.AsnBillNum - && p.PartCode== qadData.xxwms_rc_part - && p.Batch==qadData.xxwms_rc_lot - && p.PoBillNum==qadData.xxwms_rc_po_nbr - && p.PoLine==qadData.xxwms_rc_po_line - ); - var _fs=_lsQty.FirstOrDefault(p => p.AsnBillNum == scpRcv.AsnBillNum - && p.PartCode == qadData.xxwms_rc_part - && p.Batch == qadData.xxwms_rc_lot - && p.PoBillNum == qadData.xxwms_rc_po_nbr - && p.PoLine == qadData.xxwms_rc_po_line); - - if (_first != null && _fs!=null) - { - _first.Extend1 = (_fs.RecQty!=null?_fs.RecQty.Value:0 + qadData.xxwms_rc_qty_total).ToString(); - wdb.TB_ASN_DETAIL.AddOrUpdate(_first); - } + //var _first= wdb.TB_ASN_DETAIL.FirstOrDefault(p => p.AsnBillNum == scpRcv.AsnBillNum + //&& p.PartCode== qadData.xxwms_rc_part + //&& p.Batch==qadData.xxwms_rc_lot + //&& p.PoBillNum==qadData.xxwms_rc_po_nbr + //&& p.PoLine==qadData.xxwms_rc_po_line + //); + //var _fs=_lsQty.FirstOrDefault(p => p.AsnBillNum == scpRcv.AsnBillNum + // && p.PartCode == qadData.xxwms_rc_part + // && p.Batch == qadData.xxwms_rc_lot + // && p.PoBillNum == qadData.xxwms_rc_po_nbr + // && p.PoLine == qadData.xxwms_rc_po_line); + + //if (_first != null && _fs!=null) + //{ + // _first.Extend1 = (_fs.RecQty!=null?_fs.RecQty.Value:0 + qadData.xxwms_rc_qty_total).ToString(); + // wdb.TB_ASN_DETAIL.AddOrUpdate(_first); + //} } //var scpPoDetail = // wdb.TB_PO_DETAIL.FirstOrDefault(