change-20240831提交5F测试版

master
liuwf 1 year ago
parent 6e77b9b53c
commit 4ca70d4848

@ -598,7 +598,7 @@ namespace Khd.Core.Wcs.Wcs
occupyAmount = 0, occupyAmount = 0,
planCode = wmsProductInstock.planCode, planCode = wmsProductInstock.planCode,
planDetailCode = wmsProductInstock.planDetailCode, planDetailCode = wmsProductInstock.planDetailCode,
warehouseId = 512 warehouseId = 521
}; };
BaseEquip startEquip = StaticData.BaseEquip.First(t => t.objid == item.currPointId); BaseEquip startEquip = StaticData.BaseEquip.First(t => t.objid == item.currPointId);
//wmsProductInstockDetail.executeStatus = "2"; //wmsProductInstockDetail.executeStatus = "2";

@ -4437,7 +4437,8 @@ namespace Khd.Core.Wpf.Form
{ {
rawSourceMaterialName.Text = mesBaseMaterialInfo.MaterialName; rawSourceMaterialName.Text = mesBaseMaterialInfo.MaterialName;
rawSourceMaterialSpec.Text = mesBaseMaterialInfo.MaterialSpec; rawSourceMaterialSpec.Text = mesBaseMaterialInfo.MaterialSpec;
this.removeScan.Text = string.Format("{0:0}", wmsRawStock.totalAmount - wmsRawStock.frozenAmount); this.removeScan.Text = string.Format("{0:0.00}", wmsRawStock.totalAmount - wmsRawStock.frozenAmount);
removeSourceBox.Focus(); removeSourceBox.Focus();
} }
} }
@ -4522,7 +4523,7 @@ namespace Khd.Core.Wpf.Form
private void btnRemoveConfirmBox_Click(object sender, RoutedEventArgs e) private void btnRemoveConfirmBox_Click(object sender, RoutedEventArgs e)
{ {
this.RemoveMsg.Text = "";
if (string.IsNullOrEmpty(this.rawSourceBox.Text)) if (string.IsNullOrEmpty(this.rawSourceBox.Text))
{ {
this.RemoveMsg.Text = "请先选择原托盘!"; this.RemoveMsg.Text = "请先选择原托盘!";
@ -4543,8 +4544,23 @@ namespace Khd.Core.Wpf.Form
this.RemoveMsg.Text = "请先选择移库目标条码!"; this.RemoveMsg.Text = "请先选择移库目标条码!";
return; return;
} }
decimal amount = decimal.Parse(this.removeScan.Text);
if (amount<=0)
{
this.RemoveMsg.Text = "移库数量需要大于0!";
return;
}
using var scope = _host.Services.CreateScope(); using var scope = _host.Services.CreateScope();
using var dbContext = scope.ServiceProvider.GetRequiredService<DefaultDbContext>(); using var dbContext = scope.ServiceProvider.GetRequiredService<DefaultDbContext>();
WmsRawStock? wmsRawStock = dbContext.WmsRawStock
.Where(t => t.instockBatch == this.rawSourceBarCode.Text).FirstOrDefault();
if (amount > (wmsRawStock.totalAmount-wmsRawStock.frozenAmount))
{
this.RemoveMsg.Text = "移库数量不能大于库存数量";
return;
}
try try
{ {
WmsBaseLocation removeLocation = dbContext.WmsBaseLocation.Where(t => t.containerCode == this.removeSourceBox.Text).First(); WmsBaseLocation removeLocation = dbContext.WmsBaseLocation.Where(t => t.containerCode == this.removeSourceBox.Text).First();
@ -4574,8 +4590,10 @@ namespace Khd.Core.Wpf.Form
} }
else else
{ {
targetStock.totalAmount += Convert.ToInt32(this.removeScan.Text); targetStock.totalAmount += decimal.Parse(this.removeScan.Text);
dbContext.WmsRawStock.Update(targetStock); dbContext.WmsRawStock.Update(targetStock);
} }
#region 插入移库记录 #region 插入移库记录

Loading…
Cancel
Save