1
This commit is contained in:
@@ -16,6 +16,9 @@ using SqlSugar;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.ProductionMgr.Entities;
|
||||
using Tnb.ProductionMgr.Interfaces;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using Tnb.BasicData;
|
||||
using JNPF.Common.Extension;
|
||||
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
@@ -32,40 +35,45 @@ namespace Tnb.ProductionMgr
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
private readonly IDictionaryDataService _dictionaryDataService;
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
public ProductionReportRecordService(ISqlSugarRepository<PrdMoTask> repository, IRunService runService, IVisualDevService visualDevService)
|
||||
public ProductionReportRecordService(ISqlSugarRepository<PrdMoTask> repository, IRunService runService, IVisualDevService visualDevService, IDictionaryDataService dictionaryDataService)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
_visualDevService = visualDevService;
|
||||
OverideFuncs.GetListAsync = GetList;
|
||||
_dictionaryDataService = dictionaryDataService;
|
||||
}
|
||||
|
||||
|
||||
private async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
||||
{
|
||||
|
||||
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true);
|
||||
var data = await _runService.GetListResult(templateEntity, input);
|
||||
if (data?.list?.Count > 0)
|
||||
{
|
||||
foreach (var row in data.list)
|
||||
{
|
||||
var dic = row.ToDictionary(x => x.Key, x => x.Value);
|
||||
var pkName = "material_id_id";
|
||||
if (dic.ContainsKey(pkName))
|
||||
{
|
||||
var materialId = dic[pkName]?.ToString();
|
||||
var material = await _db.Queryable<BasMaterial>().FirstAsync(it => it.id == materialId);
|
||||
//if (material != null)
|
||||
//{
|
||||
// row.Add("material_name", material.name);
|
||||
// row.Add($"material_attribute", material.attribute);
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
//if (data?.list?.Count > 0)
|
||||
//{
|
||||
// var dicMoTaskStatus = await _dictionaryDataService.GetDicByTypeId(DictConst.PrdTaskStatusTypeId);
|
||||
// foreach (var row in data.list)
|
||||
// {
|
||||
// var dic = row.ToDictionary(x => x.Key, x => x.Value);
|
||||
// //if (dic.ContainsKey(nameof(PrdReportRecord.status)))
|
||||
// //{
|
||||
// // var statusCode = dic[nameof(PrdReportRecord.status)].ToString();
|
||||
// // row[nameof(PrdReportRecord.status)] = dicMoTaskStatus[statusCode];
|
||||
// //}
|
||||
// if (dic.ContainsKey(nameof(PrdReportRecord.mo_task_type)))
|
||||
// {
|
||||
// var moTypeId = dic[nameof(PrdReportRecord.mo_task_type)].ToString();
|
||||
// if (moTypeId.IsNotEmptyOrNull())
|
||||
// {
|
||||
// row[nameof(PrdReportRecord.mo_task_type)] = (await _dictionaryDataService.GetInfo(moTypeId)).FullName;
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
return data!;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user