|
|
|
|
@ -249,7 +249,8 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
}
|
|
|
|
|
SystemData.PlcDic.TryAdd(plcConfig.Code, plc);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
;
|
|
|
|
|
});
|
|
|
|
|
GetMenu();
|
|
|
|
|
GetTask();
|
|
|
|
|
@ -3029,89 +3030,89 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (wmsRawStock.safeFlag != "1")
|
|
|
|
|
if (wmsRawStock.safeFlag != "1" && wmsRawStock.safeFlag != "0")
|
|
|
|
|
{
|
|
|
|
|
scanOutMsg.Text = "该条码不是安全库存,且无申请单,禁止出库!";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (mesBaseBarcodeInfo.PurchaseOrderId == null)
|
|
|
|
|
//if (mesBaseBarcodeInfo.PurchaseOrderId == null)
|
|
|
|
|
//{
|
|
|
|
|
wmsRawStock.totalAmount -= outScan;
|
|
|
|
|
if (wmsRawStock.totalAmount == 0)
|
|
|
|
|
{
|
|
|
|
|
wmsRawStock.totalAmount -= outScan;
|
|
|
|
|
if (wmsRawStock.totalAmount == 0)
|
|
|
|
|
{
|
|
|
|
|
dbContext.WmsRawStock.Remove(wmsRawStock);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dbContext.WmsRawStock.Update(wmsRawStock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 插入rawOutstock
|
|
|
|
|
|
|
|
|
|
string timeStamp = DateTime.Now.ToString("yyyyMMddHHmmss");
|
|
|
|
|
WmsRawOutstock newWmsRawOutstock = new WmsRawOutstock();
|
|
|
|
|
newWmsRawOutstock.taskCode = timeStamp + "CTU" + Random.Shared.Next(10, 99);
|
|
|
|
|
newWmsRawOutstock.warehouseId = 512;
|
|
|
|
|
newWmsRawOutstock.locationCode = wmsRawStock.locationCode;
|
|
|
|
|
newWmsRawOutstock.stationId = 512;
|
|
|
|
|
newWmsRawOutstock.materialId = mesBaseBarcodeInfo.materialId;
|
|
|
|
|
newWmsRawOutstock.materialBatch = mesBaseBarcodeInfo.barcodeInfo;
|
|
|
|
|
newWmsRawOutstock.palletInfoCode = wmsRawStock.palletInfoCode;
|
|
|
|
|
newWmsRawOutstock.outstockAmount = outScan;
|
|
|
|
|
newWmsRawOutstock.realOutstockAmount = outScan;
|
|
|
|
|
newWmsRawOutstock.operationType = "1";
|
|
|
|
|
newWmsRawOutstock.taskType = "1";
|
|
|
|
|
newWmsRawOutstock.auditStatus = "1";
|
|
|
|
|
newWmsRawOutstock.applyBy = "CtuGun";
|
|
|
|
|
newWmsRawOutstock.applyDate = DateTime.Now;
|
|
|
|
|
newWmsRawOutstock.executeStatus = "2";
|
|
|
|
|
newWmsRawOutstock.saleOrderId = mesBaseBarcodeInfo.saleOrderId;
|
|
|
|
|
newWmsRawOutstock.updateDate = DateTime.Now;
|
|
|
|
|
newWmsRawOutstock.beginTime = DateTime.Now;
|
|
|
|
|
newWmsRawOutstock.endTime = DateTime.Now;
|
|
|
|
|
dbContext.WmsRawOutstock.Add(newWmsRawOutstock);
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
|
|
|
|
|
#endregion 插入rawOutstock
|
|
|
|
|
|
|
|
|
|
//if (mesBaseBarcodeInfo != null)
|
|
|
|
|
//{
|
|
|
|
|
// WmsRawOutstockDetail wmsProductOutstockDetail = new WmsRawOutstockDetail()
|
|
|
|
|
// {
|
|
|
|
|
// rawOutstockDetailId = Global.SnowId.NextId(),
|
|
|
|
|
// rawOutstockId = 0,
|
|
|
|
|
// materialId = mesBaseBarcodeInfo.materialId,
|
|
|
|
|
// createDate = DateTime.Now,
|
|
|
|
|
// createBy = "WCS",
|
|
|
|
|
// taskCode = wcsTask.objid.ToString(),
|
|
|
|
|
// executeStatus = "2",
|
|
|
|
|
// locationCode = wcsTask.currPointNo,
|
|
|
|
|
// outstockAmount = outScan,
|
|
|
|
|
// planAmount = outScan,
|
|
|
|
|
// warehouseId = 512,
|
|
|
|
|
// materialBarcode = mesBaseBarcodeInfo.barcodeInfo,
|
|
|
|
|
// instockBatch = mesBaseBarcodeInfo.batchCode,
|
|
|
|
|
// stackAmount = outScan,
|
|
|
|
|
// outstockPerson = "WCS",
|
|
|
|
|
// outstockTime = DateTime.Now,
|
|
|
|
|
// outstockWay = "2",
|
|
|
|
|
// materialProductionDate = mesBaseBarcodeInfo.productionDate
|
|
|
|
|
// };
|
|
|
|
|
// dbContext.WmsRawOutstockDetail.Add(wmsProductOutstockDetail);
|
|
|
|
|
//}
|
|
|
|
|
// dbContext.SaveChanges();
|
|
|
|
|
dbContext.WmsRawStock.Remove(wmsRawStock);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
scanOutMsg.Text = "该条码的销售订单不正确";
|
|
|
|
|
txtOutScan.Text = string.Empty;
|
|
|
|
|
txtOutBarCode.Text = string.Empty;
|
|
|
|
|
outMaterialSpecTxt.Text = string.Empty;
|
|
|
|
|
outMaterialNameTxt.Text = string.Empty;
|
|
|
|
|
txtOutBox.Text = string.Empty;
|
|
|
|
|
txtOutBox.Focus();
|
|
|
|
|
return;
|
|
|
|
|
dbContext.WmsRawStock.Update(wmsRawStock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 插入rawOutstock
|
|
|
|
|
|
|
|
|
|
string timeStamp = DateTime.Now.ToString("yyyyMMddHHmmss");
|
|
|
|
|
WmsRawOutstock newWmsRawOutstock = new WmsRawOutstock();
|
|
|
|
|
newWmsRawOutstock.taskCode = timeStamp + "CTU" + Random.Shared.Next(10, 99);
|
|
|
|
|
newWmsRawOutstock.warehouseId = 512;
|
|
|
|
|
newWmsRawOutstock.locationCode = wmsRawStock.locationCode;
|
|
|
|
|
newWmsRawOutstock.stationId = 512;
|
|
|
|
|
newWmsRawOutstock.materialId = mesBaseBarcodeInfo.materialId;
|
|
|
|
|
newWmsRawOutstock.materialBatch = mesBaseBarcodeInfo.barcodeInfo;
|
|
|
|
|
newWmsRawOutstock.palletInfoCode = wmsRawStock.palletInfoCode;
|
|
|
|
|
newWmsRawOutstock.outstockAmount = outScan;
|
|
|
|
|
newWmsRawOutstock.realOutstockAmount = outScan;
|
|
|
|
|
newWmsRawOutstock.operationType = "1";
|
|
|
|
|
newWmsRawOutstock.taskType = "1";
|
|
|
|
|
newWmsRawOutstock.auditStatus = "1";
|
|
|
|
|
newWmsRawOutstock.applyBy = "CtuGun";
|
|
|
|
|
newWmsRawOutstock.applyDate = DateTime.Now;
|
|
|
|
|
newWmsRawOutstock.executeStatus = "2";
|
|
|
|
|
newWmsRawOutstock.saleOrderId = mesBaseBarcodeInfo.saleOrderId;
|
|
|
|
|
newWmsRawOutstock.updateDate = DateTime.Now;
|
|
|
|
|
newWmsRawOutstock.beginTime = DateTime.Now;
|
|
|
|
|
newWmsRawOutstock.endTime = DateTime.Now;
|
|
|
|
|
dbContext.WmsRawOutstock.Add(newWmsRawOutstock);
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
|
|
|
|
|
#endregion 插入rawOutstock
|
|
|
|
|
|
|
|
|
|
//if (mesBaseBarcodeInfo != null)
|
|
|
|
|
//{
|
|
|
|
|
// WmsRawOutstockDetail wmsProductOutstockDetail = new WmsRawOutstockDetail()
|
|
|
|
|
// {
|
|
|
|
|
// rawOutstockDetailId = Global.SnowId.NextId(),
|
|
|
|
|
// rawOutstockId = 0,
|
|
|
|
|
// materialId = mesBaseBarcodeInfo.materialId,
|
|
|
|
|
// createDate = DateTime.Now,
|
|
|
|
|
// createBy = "WCS",
|
|
|
|
|
// taskCode = wcsTask.objid.ToString(),
|
|
|
|
|
// executeStatus = "2",
|
|
|
|
|
// locationCode = wcsTask.currPointNo,
|
|
|
|
|
// outstockAmount = outScan,
|
|
|
|
|
// planAmount = outScan,
|
|
|
|
|
// warehouseId = 512,
|
|
|
|
|
// materialBarcode = mesBaseBarcodeInfo.barcodeInfo,
|
|
|
|
|
// instockBatch = mesBaseBarcodeInfo.batchCode,
|
|
|
|
|
// stackAmount = outScan,
|
|
|
|
|
// outstockPerson = "WCS",
|
|
|
|
|
// outstockTime = DateTime.Now,
|
|
|
|
|
// outstockWay = "2",
|
|
|
|
|
// materialProductionDate = mesBaseBarcodeInfo.productionDate
|
|
|
|
|
// };
|
|
|
|
|
// dbContext.WmsRawOutstockDetail.Add(wmsProductOutstockDetail);
|
|
|
|
|
//}
|
|
|
|
|
// dbContext.SaveChanges();
|
|
|
|
|
//}
|
|
|
|
|
//else
|
|
|
|
|
//{
|
|
|
|
|
// scanOutMsg.Text = "该条码的销售订单不正确";
|
|
|
|
|
// txtOutScan.Text = string.Empty;
|
|
|
|
|
// txtOutBarCode.Text = string.Empty;
|
|
|
|
|
// outMaterialSpecTxt.Text = string.Empty;
|
|
|
|
|
// outMaterialNameTxt.Text = string.Empty;
|
|
|
|
|
// txtOutBox.Text = string.Empty;
|
|
|
|
|
// txtOutBox.Focus();
|
|
|
|
|
// return;
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
scanOutMsg.Text = "出库成功!";
|
|
|
|
|
txtOutScan.Text = string.Empty;
|
|
|
|
|
|