去除引用common.props
This commit is contained in:
@@ -2,11 +2,10 @@ 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.Dto;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.BasicData.Entities.Dto;
|
||||
using Tnb.BasicData.Interfaces;
|
||||
|
||||
namespace Tnb.BasicData
|
||||
@@ -16,14 +15,14 @@ namespace Tnb.BasicData
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 1102)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
public class BasDefectService: IBasDefectService,IDynamicApiController, ITransient
|
||||
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)
|
||||
ISqlSugarRepository<BasDefect> repository, DataBaseManager dbManager, IDictionaryDataService dictionaryDataService)
|
||||
{
|
||||
_repository = repository;
|
||||
_dbManager = dbManager;
|
||||
@@ -34,16 +33,16 @@ namespace Tnb.BasicData
|
||||
public async Task<dynamic> GetDefectListByProcessId(Dictionary<string, string> dic)
|
||||
{
|
||||
string processId = dic["processId"];
|
||||
var db = _repository.AsSugarClient();
|
||||
List<string> defectIds = await db.Queryable<BasProcessDefective>().Where(x=>x.process_id==processId).Select(x=>x.defective_id).ToListAsync();
|
||||
List<string?> defectTypeIds = await db.Queryable<BasDefect>().Where(x=>defectIds.Contains(x.id) && x.enabled==1).Select(x=>x.defect_type_id).ToListAsync();
|
||||
ISqlSugarClient db = _repository.AsSugarClient();
|
||||
List<string> defectIds = await db.Queryable<BasProcessDefective>().Where(x => x.process_id == processId).Select(x => x.defective_id).ToListAsync();
|
||||
List<string?> defectTypeIds = await db.Queryable<BasDefect>().Where(x => defectIds.Contains(x.id) && x.enabled == 1).Select(x => x.defect_type_id).ToListAsync();
|
||||
return await _repository.AsSugarClient().Queryable<BasDefectType>()
|
||||
.Where((a) => defectTypeIds.Contains(a.id))
|
||||
.Select(a => new
|
||||
{
|
||||
defect_type_id = a.id,
|
||||
defect_type_name = a.defect_type_name,
|
||||
children = SqlFunc.Subqueryable<BasDefect>().Where(x=>x.defect_type_id==a.id && defectIds.Contains(x.id)).ToList(x=>new DefectOutput()
|
||||
a.defect_type_name,
|
||||
children = SqlFunc.Subqueryable<BasDefect>().Where(x => x.defect_type_id == a.id && defectIds.Contains(x.id)).ToList(x => new DefectOutput()
|
||||
{
|
||||
id = x.id,
|
||||
defect_code = x.defect_code,
|
||||
|
||||
Reference in New Issue
Block a user