Browse Source

合并

master
lvzb 4 years ago
parent
commit
b7fa83103f
  1. 1
      Models/CK.SCP.Models.csproj
  2. 19
      Models/ScpEntity/TB_RECEIVE_QTY.cs
  3. 1
      SCP/Views/PlanData/SCP_ASN_DETAIL_View.aspx.cs
  4. 6
      SCP/Views/PlanData/SCP_PO_PLAN_EXTEND.aspx.cs
  5. 1
      SCP/Views/SupplierData/SCP_PALLET_CREATE.aspx.cs
  6. 42
      UniApiGroup/Controller/OdbcApiWmsController.cs

1
Models/CK.SCP.Models.csproj

@ -354,6 +354,7 @@
<Compile Include="ScpEntity\TB_FORECAST.cs" /> <Compile Include="ScpEntity\TB_FORECAST.cs" />
<Compile Include="ScpEntity\SCP_SQE.cs" /> <Compile Include="ScpEntity\SCP_SQE.cs" />
<Compile Include="ScpEntity\TB_PRICE.cs" /> <Compile Include="ScpEntity\TB_PRICE.cs" />
<Compile Include="ScpEntity\TB_RECEIVE_QTY.cs" />
<Compile Include="ScpEntity\TB_RETURN.cs" /> <Compile Include="ScpEntity\TB_RETURN.cs" />
<Compile Include="ScpEntity\TB_QUALITY.cs" /> <Compile Include="ScpEntity\TB_QUALITY.cs" />
<Compile Include="ScpEntity\EntityCondition.cs" /> <Compile Include="ScpEntity\EntityCondition.cs" />

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

1
SCP/Views/PlanData/SCP_ASN_DETAIL_View.aspx.cs

@ -16,6 +16,7 @@ namespace SCP.PlanData
public partial class SCP_ASN_DETAIL_View : PageBase public partial class SCP_ASN_DETAIL_View : PageBase
{ {
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
if (!IsPostBack) if (!IsPostBack)

6
SCP/Views/PlanData/SCP_PO_PLAN_EXTEND.aspx.cs

@ -49,7 +49,11 @@ namespace SCP.PlanData
SearchV_TB_PO((result)=> { SearchV_TB_PO((result)=> {
Grid_V_TB_PO.RecordCount = result.Count(); Grid_V_TB_PO.RecordCount = result.Count();
var list = SortAndPage<V_TB_PO>(result, Grid_V_TB_PO); var list = SortAndPage<V_TB_PO>(result, Grid_V_TB_PO);
string str = "SELECT MAX(B.EndTime) EndTime ,a.PoBillNum ,a.site,max(B.Version) AS Version FROM V_TB_PO A INNER JOIN V_TB_PO_PLAN_EXTEND B ON A.PoBillNum = B.PoBillNum AND B.AskBillNum <> '' and a.Site = b.Domain GROUP BY A.PoBillNum,a.Site";
string str = "SELECT MAX(A.EndTime) EndTime ,A.PoBillNum ,Domain AS SITE,max(Version) AS Version\n" +
" FROM [TB_PO_PLAN_EXTEND] A left join TB_ASK B ON A.PoBillNum=B.PoBillNum AND A.Domain=B.Site and A.EndTime=B.EndTime\n" +
" where A.IsDeleted=0 AND B.IsDeleted=0 AND B.AskBillNum<>'' group by A.PoBillNum, a.Domain";
var _tempList= SCPDB.Database.SqlQuery<TempPlan>(str).ToList(); var _tempList= SCPDB.Database.SqlQuery<TempPlan>(str).ToList();
foreach (var itm in list) foreach (var itm in list)
{ {

1
SCP/Views/SupplierData/SCP_PALLET_CREATE.aspx.cs

@ -18,6 +18,7 @@ namespace SCP.SupplierData
public partial class SCP_PALLET_CREATE : PageBase public partial class SCP_PALLET_CREATE : PageBase
{ {
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
if (!IsPostBack) if (!IsPostBack)

42
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) 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 qadRcvDetailList = idb.xxwms_rc_det.Where(p => p.xxwms_rc_seq == seq&&p.xxwms_rc_qty_total>=0).ToList();
var scpRcvList = new List<TB_RECEIVE>(); var scpRcvList = new List<TB_RECEIVE>();
var scpRcveDetailList = new List<TB_RECEIVE_DETAIL>(); var scpRcveDetailList = new List<TB_RECEIVE_DETAIL>();
@ -222,7 +234,7 @@ namespace CK.SCP.GrupUniApi.Controller
} }
var firstqadData = qadDataList[0]; var firstqadData = qadDataList[0];
List<TB_RECEIVE_QTY> _lsQty = new List<TB_RECEIVE_QTY>();
var scpRcv = wdb.TB_RECEIVE.SingleOrDefault(p => p.RecvBillNum != null && p.RecvBillNum == qadRcvNbrList && p.Site==firstqadData.xxwms_rc_domain); var scpRcv = wdb.TB_RECEIVE.SingleOrDefault(p => p.RecvBillNum != null && p.RecvBillNum == qadRcvNbrList && p.Site==firstqadData.xxwms_rc_domain);
//判断0100工厂的收货自动审核是否为允许 //判断0100工厂的收货自动审核是否为允许
@ -267,6 +279,13 @@ namespace CK.SCP.GrupUniApi.Controller
BillType = billtype BillType = billtype
}; };
scpRcvList.Add(scpRcv); scpRcvList.Add(scpRcv);
//if (!string.IsNullOrEmpty(scpRcv.AsnBillNum))
//{
// _lsQty = wdb.Database.SqlQuery<TB_RECEIVE_QTY>(_recvQty, scpRcv.RecvBillNum).ToList();
//}
} }
scpRcv.PoBillNum = firstqadData.xxwms_rc_po_nbr;//采购单 scpRcv.PoBillNum = firstqadData.xxwms_rc_po_nbr;//采购单
scpRcv.AsnBillNum = firstqadData.xxwms_rc_ps_nbr;//发货单号 scpRcv.AsnBillNum = firstqadData.xxwms_rc_ps_nbr;//发货单号
@ -292,6 +311,7 @@ namespace CK.SCP.GrupUniApi.Controller
}); });
wdb.TB_ASN_DETAIL.AddOrUpdate(scpAsnDetail.ToArray()); wdb.TB_ASN_DETAIL.AddOrUpdate(scpAsnDetail.ToArray());
} }
foreach (var qadData in qadDataList) foreach (var qadData in qadDataList)
{ {
try try
@ -304,9 +324,10 @@ namespace CK.SCP.GrupUniApi.Controller
p.PoLine == poLineNum && p.PoLine == poLineNum &&
p.PartCode == qadData.xxwms_rc_part && p.PartCode == qadData.xxwms_rc_part &&
p.Batch == qadData.xxwms_rc_lot p.Batch == qadData.xxwms_rc_lot
);
);
if (scpRcvDetail == null) if (scpRcvDetail == null)
{ {
int istate = 0; int istate = 0;
@ -340,6 +361,23 @@ namespace CK.SCP.GrupUniApi.Controller
BillType = billtype BillType = billtype
}; };
scpRcveDetailList.Add(scpRcvDetail); 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!=null?_fs.RecQty.Value:0 + qadData.xxwms_rc_qty_total).ToString();
// wdb.TB_ASN_DETAIL.AddOrUpdate(_first);
//}
} }
//var scpPoDetail = //var scpPoDetail =
// wdb.TB_PO_DETAIL.FirstOrDefault( // wdb.TB_PO_DETAIL.FirstOrDefault(

Loading…
Cancel
Save