Browse Source

接口增加一列asnbillnumber 标包数量改成qty 行号改成正常

master
qian 1 year ago
parent
commit
d3b850eb37
  1. 3
      Controller/SCP_PO_CONTROLLER.cs
  2. 69
      Controller/UniApiController.cs
  3. 4
      Models/UniApiEntity/PURReplenishQty.cs
  4. 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));

69
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;

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

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