|
|
|
|
@ -2418,20 +2418,20 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
WcsTask? task = dbContext.WcsTask.Where(t => t.nextPointId == baseEquip.objid).FirstOrDefault();
|
|
|
|
|
if (task == null)
|
|
|
|
|
{
|
|
|
|
|
txtReturnbox.Text = ("未查询到退库任务!");
|
|
|
|
|
txtReturnMsg.Text = ("未查询到退库任务!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var material = dbContext.MesBaseBarcodeInfo.FirstOrDefault(t => t.barcodeInfo == txtReturnBarCode.Text);
|
|
|
|
|
if (material == null)
|
|
|
|
|
{
|
|
|
|
|
txtReturnbox.Text = ("未查询到该条码内容!");
|
|
|
|
|
txtReturnMsg.Text = ("未查询到该条码内容!");
|
|
|
|
|
txtReturnBarCode.Text = string.Empty;
|
|
|
|
|
txtReturnBarCode.Focus();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WmsRawReturn? wmsRawReturn = dbContext.WmsRawReturn.Where(t => t.endStationCode == task.currPointNo && t.materialId == material.materialId).FirstOrDefault();
|
|
|
|
|
WmsRawReturn? wmsRawReturn = dbContext.WmsRawReturn.Where(t => t.endStationCode == task.currPointNo && t.executeStatus !="2").FirstOrDefault();
|
|
|
|
|
//if (wmsRawReturn == null)
|
|
|
|
|
//{
|
|
|
|
|
// var result = MessageBox.Show("当前物料不在退出申请单中,确定还要入库吗?", "确认入库", MessageBoxButton.YesNo, MessageBoxImage.Question);
|
|
|
|
|
@ -2449,14 +2449,14 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
.Where(t => t.warehouseFloor == 5 && t.warehouseId == 512).ToList();
|
|
|
|
|
if (wmsRawStocks.Count > 0 && material.batchFlag != "1")
|
|
|
|
|
{
|
|
|
|
|
txtReturnbox.Text = ($"该条码已入库,非批次!料箱号为{wmsRawStocks.First().palletInfoCode},库位号为{wmsRawStocks.First().locationCode}");
|
|
|
|
|
txtReturnMsg.Text = ($"该条码已入库,非批次!料箱号为{wmsRawStocks.First().palletInfoCode},库位号为{wmsRawStocks.First().locationCode}");
|
|
|
|
|
txtReturnBarCode.Text = string.Empty;
|
|
|
|
|
txtReturnBox.Text = string.Empty;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (container == null)
|
|
|
|
|
{
|
|
|
|
|
txtReturnbox.Text = ("未查询到该容器!");
|
|
|
|
|
txtReturnMsg.Text = ("未查询到该容器!");
|
|
|
|
|
txtReturnBox.Text = string.Empty;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
@ -2467,7 +2467,7 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
txtReturnbox.Text = ("请输入正确的数量");
|
|
|
|
|
txtReturnMsg.Text = ("请输入正确的数量");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (wmsRawReturn != null)
|
|
|
|
|
@ -2484,14 +2484,13 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
WmsRawReturnDetail? wmsRawReturnDetail = new WmsRawReturnDetail();
|
|
|
|
|
wmsRawReturnDetail.RawReturnId = (long)wmsRawReturn.rawReturnId;
|
|
|
|
|
wmsRawReturnDetail.LocationCode = container.locationCode;
|
|
|
|
|
wmsRawReturnDetail.MaterialBarcode = txtInBarCode.Text;
|
|
|
|
|
wmsRawReturnDetail.MaterialBarcode = txtReturnBarCode.Text;
|
|
|
|
|
wmsRawReturnDetail.MaterialId = (long)material.materialId;
|
|
|
|
|
wmsRawReturnDetail.InstockBatch = material.batchCode;
|
|
|
|
|
wmsRawReturnDetail.MaterialProductionDate = material.productionDate;
|
|
|
|
|
wmsRawReturnDetail.PlanAmount = wmsRawReturn.planAmount;
|
|
|
|
|
wmsRawReturnDetail.ReturnAmount = wmsRawReturn.returnAmount;
|
|
|
|
|
wmsRawReturnDetail.PlanAmount = amount;
|
|
|
|
|
wmsRawReturnDetail.ReturnAmount = amount;
|
|
|
|
|
wmsRawReturnDetail.ExecuteStatus = "2";
|
|
|
|
|
wmsRawReturnDetail.ReturnAmount = wmsRawReturn.returnAmount;
|
|
|
|
|
wmsRawReturnDetail.ReturnPerson = "WPF";
|
|
|
|
|
wmsRawReturnDetail.ReturnTime = DateTime.Now;
|
|
|
|
|
wmsRawReturnDetail.ReturnWay = "2";
|
|
|
|
|
@ -2537,24 +2536,24 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
txtReturnbox.Text = ($"退库成功!,当前库存{message}");
|
|
|
|
|
txtReturnMsg.Text = ($"退库成功!,当前库存{message}");
|
|
|
|
|
txtReturnBarCode.Text = string.Empty;
|
|
|
|
|
txtReturnBox.Text = string.Empty;
|
|
|
|
|
returnMaterialName.Text = string.Empty;
|
|
|
|
|
returnGG.Text = string.Empty;
|
|
|
|
|
txtReturnScan.Text = string.Empty;
|
|
|
|
|
|
|
|
|
|
txtReturnBarCode.Focus();
|
|
|
|
|
txtReturnBox.Focus();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
txtReturnbox.Text = ("请先扫描容器号和条码!");
|
|
|
|
|
txtReturnMsg.Text = ("请先扫描容器号和条码!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogManager.Error(ex);
|
|
|
|
|
txtReturnbox.Text = ("入库失败");
|
|
|
|
|
txtReturnMsg.Text = ("入库失败");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -2699,7 +2698,7 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
txtReturnbox.Text = "";
|
|
|
|
|
|
|
|
|
|
string barCode = txtReturnBarCode.Text;
|
|
|
|
|
if (barCode.Length < 19) return;
|
|
|
|
|
|
|
|
|
|
@ -2722,7 +2721,7 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
{
|
|
|
|
|
txtReturnBarCode.Text = string.Empty;
|
|
|
|
|
txtReturnScan.Text = string.Empty;
|
|
|
|
|
txtReturnbox.Text = "未查询到该条码绑定的物料信息!";
|
|
|
|
|
txtReturnMsg.Text = "未查询到该条码绑定的物料信息!";
|
|
|
|
|
txtReturnBarCode.Focus();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -2731,6 +2730,7 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
txtReturnScan.Text = (material.batchFlag == "1") ? "" : "1.00";
|
|
|
|
|
this.returnGG.Text = mesBaseMaterialInfo.MaterialSpec;
|
|
|
|
|
this.returnMaterialName.Text = mesBaseMaterialInfo.MaterialName;
|
|
|
|
|
this.txtReturnScan.Focus();
|
|
|
|
|
if (mesBaseMaterialInfo.BatchFlag == "0")
|
|
|
|
|
{
|
|
|
|
|
txtReturnScan.IsReadOnly = true;
|
|
|
|
|
|