Browse Source

提交

master
学 赵 4 years ago
parent
commit
ca1e339f13
  1. 56
      UniApiGroup/Controller/OdbcApiWmsController.cs

56
UniApiGroup/Controller/OdbcApiWmsController.cs

@ -207,13 +207,13 @@ namespace CK.SCP.GrupUniApi.Controller
string _recvQty = "SELECT RecQty, AsnBillNum, PoLine, PartCode, PoBillNum,Batch\n" + //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 (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" + //" 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" + //" 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" + //" 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" + //" GROUP BY a.AsnBillNum, a.PoLine, a.PartCode, a.PoBillNum) AS d\n" +
"WHERE (AsnBillNum = '{0}')"; //"WHERE (AsnBillNum = '{0}')";
@ -279,10 +279,10 @@ string _recvQty = "SELECT RecQty, AsnBillNum, PoLine, PartCode, PoBillNum,Batc
BillType = billtype BillType = billtype
}; };
scpRcvList.Add(scpRcv); scpRcvList.Add(scpRcv);
if (!string.IsNullOrEmpty(scpRcv.AsnBillNum)) //if (!string.IsNullOrEmpty(scpRcv.AsnBillNum))
{ //{
_lsQty = wdb.Database.SqlQuery<TB_RECEIVE_QTY>(_recvQty, scpRcv.RecvBillNum).ToList(); // _lsQty = wdb.Database.SqlQuery<TB_RECEIVE_QTY>(_recvQty, scpRcv.RecvBillNum).ToList();
} //}
@ -361,23 +361,23 @@ string _recvQty = "SELECT RecQty, AsnBillNum, PoLine, PartCode, PoBillNum,Batc
BillType = billtype BillType = billtype
}; };
scpRcveDetailList.Add(scpRcvDetail); scpRcveDetailList.Add(scpRcvDetail);
var _first= wdb.TB_ASN_DETAIL.FirstOrDefault(p => p.AsnBillNum == scpRcv.AsnBillNum //var _first= wdb.TB_ASN_DETAIL.FirstOrDefault(p => p.AsnBillNum == scpRcv.AsnBillNum
&& p.PartCode== qadData.xxwms_rc_part //&& p.PartCode== qadData.xxwms_rc_part
&& p.Batch==qadData.xxwms_rc_lot //&& p.Batch==qadData.xxwms_rc_lot
&& p.PoBillNum==qadData.xxwms_rc_po_nbr //&& p.PoBillNum==qadData.xxwms_rc_po_nbr
&& p.PoLine==qadData.xxwms_rc_po_line //&& p.PoLine==qadData.xxwms_rc_po_line
); //);
var _fs=_lsQty.FirstOrDefault(p => p.AsnBillNum == scpRcv.AsnBillNum //var _fs=_lsQty.FirstOrDefault(p => p.AsnBillNum == scpRcv.AsnBillNum
&& p.PartCode == qadData.xxwms_rc_part // && p.PartCode == qadData.xxwms_rc_part
&& p.Batch == qadData.xxwms_rc_lot // && p.Batch == qadData.xxwms_rc_lot
&& p.PoBillNum == qadData.xxwms_rc_po_nbr // && p.PoBillNum == qadData.xxwms_rc_po_nbr
&& p.PoLine == qadData.xxwms_rc_po_line); // && p.PoLine == qadData.xxwms_rc_po_line);
if (_first != null && _fs!=null) //if (_first != null && _fs!=null)
{ //{
_first.Extend1 = (_fs.RecQty!=null?_fs.RecQty.Value:0 + 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); // wdb.TB_ASN_DETAIL.AddOrUpdate(_first);
} //}
} }
//var scpPoDetail = //var scpPoDetail =
// wdb.TB_PO_DETAIL.FirstOrDefault( // wdb.TB_PO_DETAIL.FirstOrDefault(

Loading…
Cancel
Save