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
{
///
/// mes入库申请
///
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)]
[Route("api/[area]/[controller]/[action]")]
public class PrdInstockService : IPrdInstockService, IDynamicApiController, ITransient
{
private readonly ISqlSugarRepository _repository;
private readonly IUserManager _userManager;
private readonly IBillRullService _billRullService;
public PrdInstockService(
ISqlSugarRepository repository,
IBillRullService billRullService,
IUserManager userManager
)
{
_repository = repository;
_userManager = userManager;
_billRullService = billRullService;
}
///
/// 入库申请同步
///
/// source_id
///
public async Task SyncInstock(Dictionary 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;
}
}
}