齐套出库 一般出库 物料出库添加状态

This commit is contained in:
2023-11-08 14:06:40 +08:00
parent 30b40fb28e
commit bd739b3060
6 changed files with 159 additions and 25 deletions

View File

@@ -147,6 +147,11 @@ namespace Tnb.ProductionMgr
string locationId = location.id;
PrdOutstockH prdOutstockH = new()
{
bill_code = await _billRullService.GetBillNumber(CodeTemplateConst.PRDOUTSTOCK_CODE),
};
input.outstock.bill_type = DictConst.SHENGCHANLINGLIAO;
// input.outstock.bill_date = visualDevModelDataCrInput.data.ContainsKey("bill_date") ? Convert.ToDateTime(visualDevModelDataCrInput.data["bill_date"].ToString()) : DateTime.Now;
input.outstock.bill_date = DateTime.Now;
@@ -154,6 +159,8 @@ namespace Tnb.ProductionMgr
input.outstock.warehouse_id = warehouse_id;
input.outstock.create_id = _userManager.UserId;
input.outstock.location_code = location?.location_code ?? "";
input.outstock.source_code = prdOutstockH.bill_code;
input.outstock.source_id = prdOutstockH.id;
OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(generalOutstockInput.workstation_id, DictConst.RegionCategoryWorklineCode);
List<string> materialIds = generalOutstockInput.details.Select(x => x.material_id).ToList();
@@ -195,20 +202,17 @@ namespace Tnb.ProductionMgr
}
else
{
PrdOutstockH prdOutstockH = new()
{
bill_code = await _billRullService.GetBillNumber(CodeTemplateConst.PRDOUTSTOCK_CODE),
bill_type = DictConst.SHENGCHANLINGLIAO,
type = "1",
warehouse_id = warehouse_id,
location_code = generalOutstockInput.location_code,
create_id = _userManager.UserId,
org_id = _userManager.GetUserInfo().Result.organizeId,
bill_date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
create_time = DateTime.Now,
workstation_id = generalOutstockInput.workstation_id,
workline = workline?.Id ?? ""
};
prdOutstockH.bill_type = DictConst.SHENGCHANLINGLIAO;
prdOutstockH.type = "1";
prdOutstockH.warehouse_id = warehouse_id;
prdOutstockH.location_code = generalOutstockInput.location_code;
prdOutstockH.create_id = _userManager.UserId;
prdOutstockH.org_id = _userManager.GetUserInfo().Result.organizeId;
prdOutstockH.bill_date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
prdOutstockH.create_time = DateTime.Now;
prdOutstockH.workstation_id = generalOutstockInput.workstation_id;
prdOutstockH.workline = workline?.Id ?? "";
prdOutstockH.status = DictConst.OUTSTOCKSTATUSADD;
List<PrdOutstockD> prdOutstockDs = new();
foreach (GeneralOutstockDInput item in generalOutstockInput.details)
@@ -266,6 +270,11 @@ namespace Tnb.ProductionMgr
BasLocation location = await db.Queryable<BasLocation>().Where(x=>x.location_code==materialOutstockInput.location_code).FirstAsync();
if (location == null) throw Oops.Bah("未找到库位");
string locationId = location.id;
PrdOutstockH prdOutstockH = new()
{
bill_code = await _billRullService.GetBillNumber(CodeTemplateConst.PRDOUTSTOCK_CODE),
};
input.outstock.bill_type = DictConst.SHENGCHANLINGLIAO;
// input.outstock.bill_date = visualDevModelDataCrInput.data.ContainsKey("bill_date") ? Convert.ToDateTime(visualDevModelDataCrInput.data["bill_date"].ToString()) : DateTime.Now;
@@ -274,6 +283,8 @@ namespace Tnb.ProductionMgr
input.outstock.warehouse_id = warehouse_id;
input.outstock.create_id = _userManager.UserId;
input.outstock.location_code = location?.location_code ?? "";
input.outstock.source_code = prdOutstockH.bill_code;
input.outstock.source_id = prdOutstockH.id;
OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(materialOutstockInput.workstation_id, DictConst.RegionCategoryWorklineCode);
List<string> materialIds = materialOutstockInput.details.Select(x => x.material_id).ToList();
@@ -315,8 +326,6 @@ namespace Tnb.ProductionMgr
}
else
{
PrdOutstockH prdOutstockH = new PrdOutstockH();
prdOutstockH.bill_code = await _billRullService.GetBillNumber(CodeTemplateConst.PRDOUTSTOCK_CODE);
prdOutstockH.bill_type = DictConst.SHENGCHANLINGLIAO;
prdOutstockH.type = "2";
prdOutstockH.warehouse_id = warehouse_id;
@@ -327,6 +336,7 @@ namespace Tnb.ProductionMgr
prdOutstockH.create_time = DateTime.Now;
prdOutstockH.workstation_id = materialOutstockInput.workstation_id;
prdOutstockH.workline = workline?.Id ?? "";
prdOutstockH.status = DictConst.OUTSTOCKSTATUSADD;
List<PrdOutstockD> prdOutstockDs = new List<PrdOutstockD>();
foreach (var item in materialOutstockInput.details)