入库明细拆分
铁心库打码
This commit is contained in:
1 parent
fa7b5814ba
commit
d19f62e48b
21 files changed
+513
-93
No files matched your search
@@ -7,6 +7,7 @@ using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web;
|
||||
using HHWMS.Web.Models;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
@@ -137,7 +138,7 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGridRow(vm.Entity.ID);
|
||||
return FFResult().CloseDialog().RefreshGridRow((long)vm.Entity.ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -192,7 +193,7 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
if (!ModelState.IsValid || !vm.DoBatchEdit())
|
||||
{
|
||||
return PartialView("BatchEdit",vm);
|
||||
return PartialView("BatchEdit", vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -216,7 +217,7 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
if (!ModelState.IsValid || !vm.DoBatchDelete())
|
||||
{
|
||||
return PartialView("BatchDelete",vm);
|
||||
return PartialView("BatchDelete", vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -226,7 +227,7 @@ namespace HHWMS.Web.Controllers
|
||||
#endregion
|
||||
|
||||
#region Import
|
||||
[ActionDescription("Sys.Import")]
|
||||
[ActionDescription("Sys.Import")]
|
||||
public ActionResult Import()
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptDetail2ImportVM>();
|
||||
@@ -258,9 +259,64 @@ namespace HHWMS.Web.Controllers
|
||||
#endregion
|
||||
|
||||
[ActionDescription("Sys.Print")]
|
||||
public ActionResult Print()
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public ActionResult Print(string id)
|
||||
{
|
||||
return Ok();
|
||||
var dc = Wtm.CreateDC(cskey: "hangyong");
|
||||
Wtm.DC = dc;
|
||||
var vm = Wtm.CreateVM<ReceiptDetail2VM>(id);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.SearchDetail")]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public ActionResult SearchDetail(int id)
|
||||
{
|
||||
var dc = Wtm.CreateDC(cskey: "hangyong");
|
||||
Wtm.DC = dc;
|
||||
var data = dc.Set<ReceiptDetail2>().Where(x => x.ID == id);
|
||||
return JsonMore(data);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.ChaiDetail")]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public ActionResult ChaiDetail(List<ReceiptDetail> data)
|
||||
{
|
||||
var dc = Wtm.CreateDC(cskey: "hangyong");
|
||||
Wtm.DC = dc;
|
||||
var _unit = new UnitWork(Wtm);
|
||||
|
||||
using (var tran = dc.BeginTransaction())
|
||||
{
|
||||
try
|
||||
{
|
||||
var receipt = _unit.FindSingle<ReceiptDetail2>(x =>
|
||||
x.MaterialCode == data.FirstOrDefault().MaterialCode
|
||||
&& x.Batch == data.FirstOrDefault().Batch);
|
||||
if (receipt != null)
|
||||
{
|
||||
receipt.Qty = data.FirstOrDefault().Qty;
|
||||
_unit.Update(receipt);
|
||||
|
||||
var ll = new List<ReceiptDetail2>();
|
||||
foreach (var item in data.Skip(1))
|
||||
{
|
||||
var re = receipt;
|
||||
re.ID = null;
|
||||
re.Qty = item.Qty;
|
||||
ll.Add(re);
|
||||
}
|
||||
_unit.BatchAdd(ll.ToArray());
|
||||
tran.Commit();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tran.Rollback();
|
||||
return JsonMore(null, 500, ex.Message);
|
||||
}
|
||||
}
|
||||
return JsonMore(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -248,7 +248,7 @@ namespace HHWMS.Web.Controllers
|
||||
#endregion
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.Create")]
|
||||
[ActionDescription("Sys.Create3")]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public ActionResult CreateDetail3(string px,string pxName, string lot, int num)
|
||||
{
|
||||
@@ -277,6 +277,7 @@ namespace HHWMS.Web.Controllers
|
||||
detail.WarehouseId = receipt.WarehouseId;
|
||||
detail.ReceiptId = receipt.ID;
|
||||
detail.ReceiptCode = receipt.Code;
|
||||
detail.MaterialCode = lot;
|
||||
detail.MaterialName = pxName;
|
||||
detail.Lot = lot;
|
||||
detail.Project = $"{lot}--{px}";
|
||||
|
||||
@@ -404,6 +404,7 @@ namespace HHWMS.Web.Controllers
|
||||
return JsonMore(null);
|
||||
}
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.CheckInv")]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public ActionResult CheckInv(string id)
|
||||
@@ -411,6 +412,7 @@ namespace HHWMS.Web.Controllers
|
||||
var vm = Wtm.CreateVM<ShipmentDetail2VM>(id);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.CheckInv")]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public ActionResult CheckInvData(string str)
|
||||
@@ -427,11 +429,10 @@ namespace HHWMS.Web.Controllers
|
||||
|
||||
var WmsQty = _unitwork.Find<Inventory2>(x =>
|
||||
x.MaterialCode == ship.MaterialCode
|
||||
&& x.Batch == ship.Batch
|
||||
&& x.WarehouseId == int.Parse(warehouseId)
|
||||
).Sum(x => x.Qty);
|
||||
|
||||
var sql = @"select * from QREQ3.XWMSSTOHYB where 1=1";
|
||||
var sql = @"select * from QRE.XWMSSTOHYB where 1=1";
|
||||
sql += $" and LOC_0 = '{loc}' and ITMREF_0 = '{ship.MaterialCode}'";
|
||||
// and LOT_0 = '{ship.Batch}'
|
||||
var data = OracleHelper.GetDataSet(sql).Tables[0];
|
||||
|
||||
@@ -14,7 +14,6 @@ namespace HHWMS.Web.Controllers;
|
||||
|
||||
[Area("xwms")]
|
||||
[ActionDescription("采购订单")]
|
||||
[Public]
|
||||
public class XWMSPOHController : BaseController
|
||||
{
|
||||
public XWMSPOHController()
|
||||
@@ -30,7 +29,7 @@ public class XWMSPOHController : BaseController
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Search")]
|
||||
public ActionResult Search(string address, string billno, string supply, string materialcode)
|
||||
public ActionResult Search(string address, string ITMDES2_0, string billno, string supply, string materialcode)
|
||||
{
|
||||
var sql = @"select * from QRE.XWMSPOH where 1=1";
|
||||
if (!string.IsNullOrEmpty(address))
|
||||
@@ -49,6 +48,10 @@ public class XWMSPOHController : BaseController
|
||||
{
|
||||
sql += $"and ITMREF_0 like '%{materialcode}%'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(ITMDES2_0))
|
||||
{
|
||||
sql += $"and ITMDES2_0 like '%{ITMDES2_0}%'";
|
||||
}
|
||||
|
||||
var data = OracleHelper.GetDataSet(sql).Tables[0];
|
||||
var list = data.AsEnumerable().Select
|
||||
|
||||
@@ -33,7 +33,7 @@ public class XWMSSHIPController : BaseController
|
||||
|
||||
[ActionDescription("Sys.Search")]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public ActionResult Search(string address, string billno, string sbill, string materialcode)
|
||||
public ActionResult Search(string address, string billno, string ITMDES2_0, string sbill, string materialcode)
|
||||
{
|
||||
var _unitwork = new UnitWork(Wtm);
|
||||
|
||||
@@ -54,7 +54,10 @@ public class XWMSSHIPController : BaseController
|
||||
{
|
||||
sql += $"and ITMREF_0 like '%{materialcode}%'";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(ITMDES2_0))
|
||||
{
|
||||
sql += $"and ITMDES2_0 like '%{ITMDES2_0}%'";
|
||||
}
|
||||
var data = OracleHelper.GetDataSet(sql).Tables[0];
|
||||
|
||||
var codeList = data.AsEnumerable().Select(x => x.Field<string>("ITMREF_0")).ToHashSet();
|
||||
@@ -80,7 +83,7 @@ public class XWMSSHIPController : BaseController
|
||||
POPLIN_0 = x.Field<Int64>("POPLIN_0"),
|
||||
LOT_0 = x.Field<string>("LOT_0"),
|
||||
QTYSTU_0 = x.Field<decimal>("QTYSTU_0"),
|
||||
STATUS = matList.FirstOrDefault(y => y.Code == x.Field<string>("ITMREF_0"))?.ClassA
|
||||
STATUS = matList.FirstOrDefault(y => y.Code == x.Field<string>("ITMREF_0"))?.ClassA ?? ""
|
||||
}
|
||||
).ToList();
|
||||
|
||||
@@ -117,6 +120,10 @@ public class XWMSSHIPController : BaseController
|
||||
var detailList = new List<ReceiptDetail2>();
|
||||
foreach (var item in data)
|
||||
{
|
||||
if (string.IsNullOrEmpty(item.STATUS)){
|
||||
tran.Rollback();
|
||||
return JsonMore(null, 500, $"状态不能为空!");
|
||||
}
|
||||
var qr = _unitwork.FindSingle<MaterialQr2>(x =>
|
||||
x.Code == item.ITMREF_0
|
||||
&& x.Batch == item.LOT_0
|
||||
|
||||
Reference in new issue
Block a user