入库申请同步
This commit is contained in:
55
ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs
Normal file
55
ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user