Browse Source

提交

master
学 赵 4 years ago
parent
commit
1eabab0981
  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. 1
      SCP/Views/SupplierData/SCP_PALLET_CREATE.aspx.cs
  5. 2
      SCP/Views/SupplierData/SCP_RECEIVE_LIST.aspx.cs
  6. 4
      SCP/default.aspx
  7. 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)

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)

2
SCP/Views/SupplierData/SCP_RECEIVE_LIST.aspx.cs

@ -307,8 +307,6 @@ namespace SCP.SupplierData
Alert.Show("不允许开负数发票!退货、索赔零件数量有问题,请联系工厂库房和质量解决!"); Alert.Show("不允许开负数发票!退货、索赔零件数量有问题,请联系工厂库房和质量解决!");
return; return;
} }
if (IdList.Count > 200) if (IdList.Count > 200)
{ {
Alert.Show("选择零件记录超过,发票允许条数!"); Alert.Show("选择零件记录超过,发票允许条数!");

4
SCP/default.aspx

@ -111,10 +111,10 @@
for (var i = 0; obj.options.length; i++) for (var i = 0; obj.options.length; i++)
{ {
if ('JZ1' == obj.options[i].value) { if ('BJCIAI' == obj.options[i].value) {
obj.options[i].selected = true; obj.options[i].selected = true;
_factory = document.getElementById(_factoryValue); _factory = document.getElementById(_factoryValue);
_factory.value = 'JZ1'; _factory.value = 'BJCIAI';
} }
} }
} }

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.Value + 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