yidi.wu 11 months ago
parent
commit
f792a39bbd
  1. 3
      Controller/SCP_PO_CONTROLLER.cs
  2. 77
      Controller/UniApiController.cs
  3. 4
      Models/UniApiEntity/PURReplenishQty.cs
  4. 4
      SCP/Global.asax.cs
  5. 16
      SCP/SCP.csproj
  6. 5
      UniApiGroup/Controller/OdbcApiScpController.cs

3
Controller/SCP_PO_CONTROLLER.cs

@ -816,7 +816,8 @@ namespace CK.SCP.Controller
private static List<string> CheckExce2(ScpEntities db, string lt)
{
List<string> ErrorList = new List<string>();
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));

77
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();
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 = 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;
}
}
//}
//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 = 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 = str5;
// }
// }
if (bill.SubSite == "W21")
{
apiData.VendBatch = detail.UpdateUser;

4
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; }
/// <summary>
/// asn单号
/// </summary>
public string PurAsnBillNum { get; set; }
public string client { get; set; }
public string plant { get; set; }
}

4
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);
}
}

16
SCP/SCP.csproj

@ -208,6 +208,7 @@
<Content Include="Admin\user_select_title.aspx" />
<Content Include="Admin\user_view.aspx" />
<Content Include="App_Data\nwind.xml" />
<Content Include="default.aspx" />
<Content Include="default_CYJ.aspx" />
<Content Include="Default_FW.aspx" />
<Content Include="default_XG.aspx" />
@ -298,7 +299,6 @@
<Content Include="Content\bootstrap.css" />
<Content Include="Content\bootstrap.min.css" />
<Content Include="Content\Site.css" />
<Content Include="default.aspx" />
<Content Include="extjs\ext-all.js" />
<Content Include="extjs\ext-fineui.js" />
<Content Include="extjs\lang\en.js" />
@ -4958,6 +4958,13 @@
<Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="Common\MailHelper.cs" />
<Compile Include="Common\ReportHelper.cs" />
<Compile Include="default.aspx.cs">
<DependentUpon>default.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="default.aspx.designer.cs">
<DependentUpon>default.aspx</DependentUpon>
</Compile>
<Compile Include="default_CYJ.aspx.cs">
<DependentUpon>default_CYJ.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -5279,13 +5286,6 @@
<Compile Include="Contact.aspx.designer.cs">
<DependentUpon>Contact.aspx</DependentUpon>
</Compile>
<Compile Include="default.aspx.cs">
<DependentUpon>default.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="default.aspx.designer.cs">
<DependentUpon>default.aspx</DependentUpon>
</Compile>
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>

5
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

Loading…
Cancel
Save