Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
43
BasicData/Tnb.BasicData/BasDefectService.cs
Normal file
43
BasicData/Tnb.BasicData/BasDefectService.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.BasicData.Interfaces;
|
||||
|
||||
namespace Tnb.BasicData
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料清单
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 1102)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
public class BasDefectService: IBasDefectService,IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly ISqlSugarRepository<BasDefect> _repository;
|
||||
private readonly DataBaseManager _dbManager;
|
||||
private readonly IDictionaryDataService _dictionaryDataService;
|
||||
|
||||
public BasDefectService(
|
||||
ISqlSugarRepository<BasDefect> repository,DataBaseManager dbManager,IDictionaryDataService dictionaryDataService)
|
||||
{
|
||||
_repository = repository;
|
||||
_dbManager = dbManager;
|
||||
_dictionaryDataService = dictionaryDataService;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetDefectListByProcessId(Dictionary<string, string> dic)
|
||||
{
|
||||
string processId = dic["processId"];
|
||||
return await _repository.AsSugarClient().Queryable<BasProcessDefective>()
|
||||
.LeftJoin<BasProcess>((a, b) => a.process_id == b.id)
|
||||
.LeftJoin<BasDefect>((a, b, c) => a.defective_id == c.id)
|
||||
.Where((a, b, c) => a.process_id == processId)
|
||||
.Select((a, b, c) => c).ToListAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user