生产入库记录

This commit is contained in:
2023-11-27 10:54:33 +08:00
parent 8cff8f3bd0
commit 5db9603be2
5 changed files with 260 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ using JNPF.FriendlyException;
using JNPF.Logging;
using JNPF.Systems.Entitys.Permission;
using JNPF.Systems.Interfaces.Permission;
using JNPF.Systems.Interfaces.System;
using JNPF.VisualDev;
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
using Microsoft.AspNetCore.Authorization;
@@ -40,18 +41,22 @@ namespace Tnb.ProductionMgr
private readonly ISqlSugarRepository<PrdInstockH> _repository;
private readonly IUserManager _userManager;
private readonly IOrganizeService _organizeService;
private readonly IBillRullService _billRuleService;
private const string ModuleId = "25572529329173";
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
public PrdInstockService(
ISqlSugarRepository<PrdInstockH> repository,
IOrganizeService organizeService,
IBillRullService billRullService,
IUserManager userManager
)
{
_repository = repository;
_organizeService = organizeService;
_userManager = userManager;
_billRuleService= billRullService;
OverideFuncs.GetListAsync = GetList;
}
@@ -327,8 +332,10 @@ namespace Tnb.ProductionMgr
OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(prdReport.station, DictConst.RegionCategoryWorklineCode);
OrganizeEntity workshop = await _organizeService.GetAnyParentByWorkstationId(prdReport.station, DictConst.RegionCategoryWorkshopCode);
string code = await _billRuleService.GetBillNumber(CodeTemplateConst.PRDINSTOCK_CODE);
prdInstockH = new PrdInstockH()
{
code = code,
bill_type = DictConst.CHANCHENGPINRUKUDAN,
bill_date = DateTime.Now,
create_id = create_id,
@@ -342,6 +349,7 @@ namespace Tnb.ProductionMgr
// warehouse_id = basLocation?.wh_id,
warehouse_id = warehouse_id,
status = 0,
mo_task_id = prdReport.mo_task_id,
};
prdInstockDs.Add(new PrdInstockD()
@@ -600,9 +608,11 @@ namespace Tnb.ProductionMgr
{
OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(prdReport.station, DictConst.RegionCategoryWorklineCode);
OrganizeEntity workshop = await _organizeService.GetAnyParentByWorkstationId(prdReport.station, DictConst.RegionCategoryWorkshopCode);
string code = await _billRuleService.GetBillNumber(CodeTemplateConst.PRDINSTOCK_CODE);
prdInstockH = new PrdInstockH()
{
code = code,
bill_type = DictConst.CHANCHENGPINRUKUDAN,
bill_date = DateTime.Now,
create_id = create_id,
@@ -615,6 +625,7 @@ namespace Tnb.ProductionMgr
org_id = org_id,
warehouse_id = warehouse_id,
status = 0,
mo_task_id = prdReport.mo_task_id,
};
prdInstockDs.Add(new PrdInstockD()
@@ -731,6 +742,7 @@ namespace Tnb.ProductionMgr
org_id = org_id,
warehouse_id = warehouse_id,
status = 0,
mo_task_id = prdReport.mo_task_id,
};
prdInstockDs.Add(new PrdInstockD()
@@ -886,6 +898,7 @@ namespace Tnb.ProductionMgr
string create_id = prdReports[0].create_id;
UserEntity user = await db.Queryable<UserEntity>().SingleAsync(x => x.Id == create_id);
string org_id = user.OrganizeId;
string mo_task_id = prdReports[0].mo_task_id;
PrdInstockH? prdInstockH = null;
List<PrdInstockD> prdInstockDs = new() { };
@@ -896,9 +909,11 @@ namespace Tnb.ProductionMgr
{
OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(station.Id, DictConst.RegionCategoryWorklineCode);
OrganizeEntity workshop = await _organizeService.GetAnyParentByWorkstationId(station.Id, DictConst.RegionCategoryWorkshopCode);
string code = await _billRuleService.GetBillNumber(CodeTemplateConst.PRDINSTOCK_CODE);
prdInstockH = new PrdInstockH()
{
code = code,
bill_type = DictConst.CHANCHENGPINRUKUDAN,
bill_date = DateTime.Now,
create_id = create_id,
@@ -912,6 +927,7 @@ namespace Tnb.ProductionMgr
// warehouse_id = basLocation?.wh_id,
warehouse_id = warehouse_id,
status = 0,
mo_task_id = mo_task_id,
};
foreach (var prdReport in prdReports)