铁芯打印

入库单明细拆分,打印拆分
出库对账(仓库建使用)
This commit is contained in:
zgf committed 2024-01-14 13:48:13 +08:00
1 parent d19f62e48b
commit cec65caa32
11 files changed
+170 -57

No files matched your search

@@ -8,6 +8,7 @@ using HHWMS.Web;
using HHWMS.Web.Models;
using System.Linq;
using System.Collections.Generic;
using System.Web;
namespace HHWMS.Web.Controllers
{
@@ -268,6 +269,13 @@ namespace HHWMS.Web.Controllers
return PartialView(vm);
}
[ActionDescription("Sys.Prints")]
[FixConnection(CsName = "hangyong")]
public ActionResult Prints(string ids)
{
return Ok();
}
[ActionDescription("Sys.SearchDetail")]
[FixConnection(CsName = "hangyong")]
public ActionResult SearchDetail(int id)
@@ -301,10 +309,26 @@ namespace HHWMS.Web.Controllers
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);
var detail = new ReceiptDetail2();
detail.WarehouseId = receipt.WarehouseId;
detail.ReceiptId = receipt.ReceiptId;
detail.ReceiptCode = receipt.ReceiptCode;
detail.SourceCode = receipt.SourceCode;
detail.SourceLine = receipt.SourceLine;
detail.MaterialCode = receipt.MaterialCode;
detail.MaterialName = receipt.MaterialName;
detail.Lot = receipt.Lot;
detail.SupplierCode = receipt.SupplierCode;
detail.SupplierName = receipt.SupplierName;
detail.Qty = item.Qty;
detail.Unit = receipt.Unit;
detail.PurchasQty = receipt.PurchasQty;
detail.PurchasUnits = receipt.PurchasUnits;
detail.InventoryStatus = receipt.InventoryStatus;
detail.Batch = receipt.Batch;
detail.Status = 0;
detail.CreateTime = DateTime.Now;
ll.Add(detail);
}
_unit.BatchAdd(ll.ToArray());
tran.Commit();
@@ -94,7 +94,7 @@ namespace HHWMS.Web.Controllers
}
else
{
return FFResult().CloseDialog().RefreshGrid();
return FFResult().CloseDialog().RefreshGrid(index:0);
}
}
}
@@ -479,29 +479,47 @@ namespace HHWMS.Web.Controllers
{
return JsonMore(null, 500, "ERP无足够库存!");
}
if(ship.Qty <= item.QTYSTU_0)
var qty = ship.Qty;
int skipNum = 0;
while(qty > 0)
{
ship.Batch = item.LOT_0;
ship.InventoryStatus = item.STA_0;
_unitwork.Update(ship);
}
else if(ship.Qty > item.QTYSTU_0)
{
var newShip = ship;
newShip.ID = null;
newShip.Qty = ship.Qty - item.QTYSTU_0;
_unitwork.Add(newShip);
item = data.Skip(skipNum).Take(1).FirstOrDefault();
// 新建明细
var newShip = new ShipmentDetail2();
newShip.WarehouseId = ship.WarehouseId;
newShip.ShipmentId = ship.ShipmentId;
newShip.ShipmentCode = ship.ShipmentCode;
newShip.SourceCode = ship.SourceCode;
newShip.SourceLine = ship.SourceLine;
newShip.MaterialCode = ship.MaterialCode;
newShip.MaterialName = ship.MaterialName;
newShip.Lot = ship.Lot;
newShip.Unit = ship.Unit;
newShip.PurchasQty = ship.PurchasQty;
newShip.PurchasUnits = ship.PurchasUnits;
newShip.Status = 0;
newShip.CreateTime = DateTime.Now;
if (qty <= item.QTYSTU_0)
{
ship.Qty = qty;
ship.Batch = item.LOT_0;
ship.InventoryStatus = item.STA_0;
_unitwork.Update(ship);
ship.Qty = item.QTYSTU_0;
ship.Batch = item.LOT_0;
ship.InventoryStatus = item.STA_0;
_unitwork.Update(ship);
qty = 0;
}
else if (qty > item.QTYSTU_0)
{
newShip.Qty = item.QTYSTU_0;
newShip.Batch = item.LOT_0;
newShip.InventoryStatus = item.STA_0;
_unitwork.Add(newShip);
data.Remove(item);
Check(newShip.ID.ToString(), data);
}
qty = qty - item.QTYSTU_0;
skipNum++;
}
};
return JsonMore(null);
}
@@ -99,6 +99,10 @@ public class XWMSMFMController : BaseController
{
var warehouseId = Wtm.LoginUserInfo.Groups.FirstOrDefault().GroupCode;
var _unitwork = new UnitWork(Wtm);
var codeList = data.AsEnumerable().Select(x => x.ITMREF_0).ToHashSet();
var matList = _unitwork.Find<Material2>(x => codeList.Contains(x.Code));
var dc = Wtm.CreateDC(cskey: "hangyong");
using (var tran = dc.BeginTransaction())
{
@@ -129,11 +133,12 @@ public class XWMSMFMController : BaseController
detail.MaterialName = HttpUtility.HtmlDecode(item.ITMDES1_0);
detail.Lot = HttpUtility.HtmlDecode(item.ITMDES2_0);
detail.Qty = item.THISQTYSTU;
detail.Unit = item.BOMSEQ_0.ToString();
detail.Unit = matList.FirstOrDefault(y => y.Code == item.ITMREF_0)?.MasterUnit ?? "";
//detail.PurchasQty = item.THISQTYUOM;
//detail.PurchasUnits = item.UOM_0;
//detail.PurchasUnits = item.PurchasUnits;
//detail.InventoryStatus = item.STA_0;
//detail.Batch = _unitwork.GetSerialNumber("HYB", 5).Remove(3, 2);
detail.UserDef3 = item.BOMSEQ_0.ToString();
detail.Status = 0;
detail.CreateTime = DateTime.Now;
detailList.Add(detail);
@@ -120,10 +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, $"状态不能为空!");
}
//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