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) {