55 lines
1.7 KiB
C#
55 lines
1.7 KiB
C#
using JNPF.Common.Core.Manager;
|
|
using JNPF.DependencyInjection;
|
|
using JNPF.DynamicApiController;
|
|
using JNPF.Systems.Interfaces.System;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using SqlSugar;
|
|
using Tnb.ProductionMgr.Entities;
|
|
using Tnb.ProductionMgr.Entities.Dto;
|
|
using Tnb.ProductionMgr.Interfaces;
|
|
|
|
namespace Tnb.ProductionMgr
|
|
{
|
|
/// <summary>
|
|
/// mes入库申请
|
|
/// </summary>
|
|
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)]
|
|
[Route("api/[area]/[controller]/[action]")]
|
|
public class PrdInstockService : IPrdInstockService, IDynamicApiController, ITransient
|
|
{
|
|
private readonly ISqlSugarRepository<PrdInstockH> _repository;
|
|
private readonly IUserManager _userManager;
|
|
private readonly IBillRullService _billRullService;
|
|
|
|
|
|
public PrdInstockService(
|
|
ISqlSugarRepository<PrdInstockH> repository,
|
|
IBillRullService billRullService,
|
|
IUserManager userManager
|
|
)
|
|
{
|
|
_repository = repository;
|
|
_userManager = userManager;
|
|
_billRullService = billRullService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 入库申请同步
|
|
/// </summary>
|
|
/// <param name="dic">source_id</param>
|
|
/// <returns></returns>
|
|
public async Task<dynamic> SyncInstock(Dictionary<string, string> dic)
|
|
{
|
|
string sourceId = dic.ContainsKey("source_id") ? dic["source_id"] : "";
|
|
if (!string.IsNullOrEmpty(sourceId))
|
|
{
|
|
return await _repository.UpdateAsync(x => new PrdInstockH()
|
|
{
|
|
status = 1
|
|
}, x => x.id == sourceId);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
} |