调整在线开发,组织获取关联工序列表代码

This commit is contained in:
DEVICE8\12494
2023-05-04 15:08:19 +08:00
parent d132c8c229
commit c98236d10a
11 changed files with 192 additions and 70 deletions

View File

@@ -1,7 +0,0 @@
namespace Tnb.EquipMgr.Entities
{
public class Class1
{
}
}

View File

@@ -0,0 +1,9 @@
namespace Tnb.EquipMgr.Entities.Consts
{
public class ModuleConsts
{
public const string Tag = "EquimentManager";
public const string Area = "equiment";
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tnb.EquipMgr.Entities.Dto
{
/// <summary>
/// 设备列表输出类
/// </summary>
public class EquipmentListOutput
{
public string id { get; set; }
public string eqp_code { get; set; }
public string eqp_name { get; set; }
public string eqp_type_code { get; set; }
public string accept_status { get; set; }
public string supplier_code { get; set; }
public string accept_date { get; set; }
public string install_date { get; set; }
public string use_department_code { get; set; }
public string remark { get; set; }
}
}

View File

@@ -1,6 +1,6 @@
namespace Tnb.EquipMgr.Interfaces
{
public class Class1
public interface IEquipmentService
{
}

View File

@@ -1,7 +0,0 @@
namespace Tnb.EquipMgr
{
public class Class1
{
}
}

View 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;
}
}
}