重写设备维修新增接口
This commit is contained in:
@@ -29,5 +29,12 @@ namespace Tnb.BasicData
|
||||
/// 生产齐套领料
|
||||
/// </summary>
|
||||
public const string PRDKITTINGOUTSTOCK_CODE = "PrdKittingOutStocK";
|
||||
|
||||
/// <summary>
|
||||
/// 设备维修单
|
||||
/// </summary>
|
||||
public const string EQPREPAIR_CODE = "EqpRepair";
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.Common.Security;
|
||||
@@ -7,6 +8,10 @@ using JNPF.DynamicApiController;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
using JNPF.VisualDev.Interfaces;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
@@ -22,16 +27,61 @@ namespace Tnb.EquipMgr
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
public class EqpRepairApplyService : IEqpRepairApplyService, IDynamicApiController, ITransient
|
||||
[OverideVisualDev(ModuleId)]
|
||||
public class EqpRepairApplyService : IEqpRepairApplyService, IOverideVisualDevService, IDynamicApiController, ITransient
|
||||
{
|
||||
private const string ModuleId = "26165698078741";
|
||||
private readonly ISqlSugarRepository<EqpRepairApply> _repository;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
private readonly IRunService _runService;
|
||||
private readonly IBillRullService _billRuleService;
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
|
||||
public EqpRepairApplyService(ISqlSugarRepository<EqpRepairApply> repository,
|
||||
IVisualDevService visualDevService,
|
||||
IRunService runService,
|
||||
IBillRullService billRullService,
|
||||
IUserManager userManager)
|
||||
{
|
||||
_repository = repository;
|
||||
_visualDevService = visualDevService;
|
||||
_runService = runService;
|
||||
_userManager = userManager;
|
||||
_billRuleService = billRullService;
|
||||
OverideFuncs.CreateAsync = Create;
|
||||
}
|
||||
|
||||
private async Task<dynamic> Create(VisualDevModelDataCrInput input)
|
||||
{
|
||||
if (!input.data.ContainsKey("create_time"))
|
||||
{
|
||||
input.data.Add("create_time",DateTime.Now);
|
||||
}
|
||||
|
||||
if (!input.data.ContainsKey("create_id"))
|
||||
{
|
||||
input.data.Add("create_id",_userManager.UserId);
|
||||
}
|
||||
|
||||
if (!input.data.ContainsKey("apply_user_id"))
|
||||
{
|
||||
input.data.Add("apply_user_id",_userManager.UserId);
|
||||
}
|
||||
|
||||
if (!input.data.ContainsKey("org_id"))
|
||||
{
|
||||
input.data.Add("org_id",_userManager.GetUserInfo().Result.organizeId);
|
||||
}
|
||||
|
||||
if (!input.data.ContainsKey("code"))
|
||||
{
|
||||
input.data.Add("code",await _billRuleService.GetBillNumber(CodeTemplateConst.EQPREPAIR_CODE));
|
||||
}
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true);
|
||||
await _runService.Create(templateEntity, input);
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
|
||||
Reference in New Issue
Block a user