diff --git a/Controller/SCP_PO_CONTROLLER.cs b/Controller/SCP_PO_CONTROLLER.cs index c1059e7..a883972 100644 --- a/Controller/SCP_PO_CONTROLLER.cs +++ b/Controller/SCP_PO_CONTROLLER.cs @@ -816,7 +816,8 @@ namespace CK.SCP.Controller private static List CheckExce2(ScpEntities db, string lt) { List ErrorList = new List(); - var _asn = db.TB_ASN_DETAIL.Count(p => p.PoBillNum ==lt); + // 刨除作废的单子 + var _asn = db.TB_ASN_DETAIL.Count(p => (p.PoBillNum ==lt) && (p.State != (int)AsnState.Reject )); if (_asn> 0) { ErrorList.Add(string.Format("订单【{0}】已经生成发货单了,不能作废", lt)); diff --git a/Controller/UniApiController.cs b/Controller/UniApiController.cs index 1dec096..b87daad 100644 --- a/Controller/UniApiController.cs +++ b/Controller/UniApiController.cs @@ -274,7 +274,6 @@ namespace CK.SCP.Controller { var tableName = GetTableName(uniApiType); var apiData = new TS_UNI_API(); - apiData.InterfaceType = uniApiType.ToString(); apiData.TableName = tableName.ToString(); apiData.BillNum = bill.AsnBillNum; @@ -298,47 +297,47 @@ namespace CK.SCP.Controller var ts = db.TS_UNI_API.Count(p => p.ErpLineNum == detail.PoLine && p.ErpBillNum == bill.PoBillNum); string str = "000"; string st = bill.PoBillNum.Substring(0,4); - if (ts == 0) - { + //if (ts == 0) + //{ string str1= detail.PoLine.ToString(); apiData.Extend3 = str1; - } - else - { - if (ts == 1) - { - var ts1 = db.TB_PO_DETAIL.Where(p => p.PoLine == detail.PoLine && p.PoBillNum == bill.PoBillNum).Select(r => r.PoLine).Max(); - int ts2 = ts1 + 50; - string str2 = ts2.ToString(); + //} + //else + // { + // if (ts == 1) + // { + // var ts1 = db.TB_PO_DETAIL.Where(p => p.PoLine == detail.PoLine && p.PoBillNum == bill.PoBillNum).Select(r => r.PoLine).Max(); + // int ts2 = ts1 + 50; + // string str2 = ts2.ToString(); - apiData.Extend3 = str2; - } - else if (ts == 2) - { - var ts1 = db.TB_PO_DETAIL.Where(p => p.PoLine == detail.PoLine && p.PoBillNum == bill.PoBillNum).Select(r => r.PoLine).Max(); - int ts2 = ts1 + 60; - string str3 = ts2.ToString(); + // apiData.Extend3 = str2; + // } + // else if (ts == 2) + // { + // var ts1 = db.TB_PO_DETAIL.Where(p => p.PoLine == detail.PoLine && p.PoBillNum == bill.PoBillNum).Select(r => r.PoLine).Max(); + // int ts2 = ts1 + 60; + // string str3 = ts2.ToString(); - apiData.Extend3 = str3; - } - else if (ts == 3) - { - var ts1 = db.TB_PO_DETAIL.Where(p => p.PoLine == detail.PoLine && p.PoBillNum == bill.PoBillNum).Select(r => r.PoLine).Max(); - int ts2 = ts1 + 70; - string str4 = ts2.ToString(); + // apiData.Extend3 = str3; + // } + // else if (ts == 3) + // { + // var ts1 = db.TB_PO_DETAIL.Where(p => p.PoLine == detail.PoLine && p.PoBillNum == bill.PoBillNum).Select(r => r.PoLine).Max(); + // int ts2 = ts1 + 70; + // string str4 = ts2.ToString(); - apiData.Extend3 = str4; - } - else - { - var ts3 = db.TS_UNI_API.Where(p => p.ErpLineNum == detail.PoLine && p.ErpBillNum == bill.PoBillNum).Select(r => r.Extend3).Max(); - int ts4 = int.Parse(ts3) + 10; - string str5 = ts4.ToString(); + // apiData.Extend3 = str4; + // } + // else + // { + // var ts3 = db.TS_UNI_API.Where(p => p.ErpLineNum == detail.PoLine && p.ErpBillNum == bill.PoBillNum).Select(r => r.Extend3).Max(); + // int ts4 = int.Parse(ts3) + 10; + // string str5 = ts4.ToString(); - apiData.Extend3 = str5; - } - } + // apiData.Extend3 = str5; + // } + // } if (bill.SubSite == "W21") { apiData.VendBatch = detail.UpdateUser; diff --git a/Models/UniApiEntity/PURReplenishQty.cs b/Models/UniApiEntity/PURReplenishQty.cs index 20685c8..ce877a1 100644 --- a/Models/UniApiEntity/PURReplenishQty.cs +++ b/Models/UniApiEntity/PURReplenishQty.cs @@ -11,6 +11,10 @@ namespace CK.SCP.Models.UniApiEntity public string PURDOCNO { get; set; } public string purDocLineNO { get; set; } public decimal replenishQty { get; set; } + /// + /// asn单号 + /// + public string PurAsnBillNum { get; set; } public string client { get; set; } public string plant { get; set; } } diff --git a/SCP/Global.asax.cs b/SCP/Global.asax.cs index 8445953..782e414 100644 --- a/SCP/Global.asax.cs +++ b/SCP/Global.asax.cs @@ -73,10 +73,10 @@ namespace SCP { String errorCode = Guid.NewGuid().ToString(); - String errorMsg = objExp.InnerException == null ? objExp.GetBaseException().Message : objExp.InnerException.Message; + String errorMsg = objExp.InnerException == null ? objExp.GetBaseException().Message : objExp.InnerException.Message+ objExp.InnerException.StackTrace; HttpContext.Current.Server.ClearError(); - + LogHelper.Writlog(LogHelper.LogType.Error, typeof(Global), "Application_Error", objExp.Message+ "InnerMess:" + objExp.InnerException.Message + "InnerST:" + objExp.InnerException.StackTrace); ShowError(errorCode, errorMsg, HttpContext.Current); } } diff --git a/SCP/SCP.csproj b/SCP/SCP.csproj index a49b638..39159b6 100644 --- a/SCP/SCP.csproj +++ b/SCP/SCP.csproj @@ -208,6 +208,7 @@ + @@ -298,7 +299,6 @@ - @@ -4958,6 +4958,13 @@ + + default.aspx + ASPXCodeBehind + + + default.aspx + default_CYJ.aspx ASPXCodeBehind @@ -5279,13 +5286,6 @@ Contact.aspx - - default.aspx - ASPXCodeBehind - - - default.aspx - Global.asax Always diff --git a/UniApiGroup/Controller/OdbcApiScpController.cs b/UniApiGroup/Controller/OdbcApiScpController.cs index 0bb50b2..f244b67 100644 --- a/UniApiGroup/Controller/OdbcApiScpController.cs +++ b/UniApiGroup/Controller/OdbcApiScpController.cs @@ -91,7 +91,10 @@ namespace CK.SCP.GrupUniApi.Controller { PURDOCNO = erpData.ErpBillNum, purDocLineNO = erpData.Extend3, - replenishQty = erpData.PackQty, + // 增加一列BillNum 用来区分 + PurAsnBillNum = erpData.BillNum, + // 发货单里的qty + replenishQty = erpData.Qty, client = "800", plant = erpData.Site