调整在线开发,组织获取关联工序列表代码
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
namespace Tnb.EquipMgr
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
69
EquipMgr/Tnb.EquipMgr/EquipmentService.cs
Normal file
69
EquipMgr/Tnb.EquipMgr/EquipmentService.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using Aop.Api.Domain;
|
||||
using Aspose.Cells.Drawing;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.EquipMgr.Entities.Consts;
|
||||
using Tnb.EquipMgr.Entities.Dto;
|
||||
using Tnb.EquipMgr.Interfaces;
|
||||
|
||||
namespace Tnb.EquipMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备管理
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
[OverideVisualDev(ModuleId)]
|
||||
|
||||
public class EquipmentService : IOverideVisualDevService, IEquipmentService, IDynamicApiController, ITransient
|
||||
{
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
private const string ModuleId = "25064865727509";
|
||||
private readonly ISqlSugarRepository<EqpEquipment> _repository;
|
||||
|
||||
public EquipmentService(ISqlSugarRepository<EqpEquipment> repository)
|
||||
{
|
||||
_repository = repository;
|
||||
OverideFuncs.GetListAsync = GetList;
|
||||
}
|
||||
/// <summary>
|
||||
/// 在线开发-获取设备列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
||||
{
|
||||
var dic = new Dictionary<string, string>
|
||||
{
|
||||
{ "Qualified","合格"},
|
||||
{ "Unqualified","不合格"},
|
||||
};
|
||||
|
||||
var pagedList = await _repository.AsQueryable()
|
||||
.Where(it => it.station_code == input.station_code || string.IsNullOrEmpty(input.station_code))
|
||||
.Select(it => new EquipmentListOutput
|
||||
{
|
||||
id = it.id,
|
||||
eqp_code = it.eqp_code,
|
||||
eqp_name = it.eqp_name,
|
||||
eqp_type_code = it.eqp_type_code,
|
||||
accept_status = it.accept_status,
|
||||
supplier_code = it.supplier_code,
|
||||
accept_date = it.accept_date,
|
||||
install_date = it.install_date,
|
||||
use_department_code = it.use_department_code,
|
||||
remark = it.remark,
|
||||
})
|
||||
.Mapper(it => it.accept_status = dic.ContainsKey(it.accept_status) ? dic[it.accept_status] : "")
|
||||
.ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
return pagedList;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user