图文管理:添加接口
This commit is contained in:
parent
4574da0be6
commit
eda6b8108b
@ -0,0 +1,12 @@
|
||||
using MineTec.ProManager.Commd;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.FigureNumber.Dto
|
||||
{
|
||||
public class FigureNumberOutPut : OutputBase
|
||||
{
|
||||
public List<FigureNumberDto> data { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using Abp.Application.Services.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.FigureNumber.Dto
|
||||
{
|
||||
public class GetAllFigureNumber : PagedResultRequestDto
|
||||
{
|
||||
public int FigureNum { get; set; } //用于图号搜索
|
||||
public string Remark { get; set; } //用于备注搜索
|
||||
}
|
||||
}
|
@ -1,8 +1,11 @@
|
||||
using Abp.Application.Services;
|
||||
using Abp.Application.Services.Dto;
|
||||
using Abp.Collections.Extensions;
|
||||
using Abp.Domain.Repositories;
|
||||
using MineTec.ProManager.FigureNumber.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MineTec.ProManager.FigureNumber
|
||||
@ -22,6 +25,27 @@ namespace MineTec.ProManager.FigureNumber
|
||||
return base.CreateAsync(input);
|
||||
}
|
||||
|
||||
public async Task<FigureNumberOutPut> GetAllFigureNumber(GetAllFigureNumber input)
|
||||
{
|
||||
|
||||
var result = new FigureNumberOutPut();
|
||||
try
|
||||
{
|
||||
var query = base.CreateFilteredQuery(input).Where(t => t.IsDelete != 1).WhereIf(input.FigureNum.ToString().Length > 0, t => t.FigureNum == input.FigureNum).WhereIf(!string.IsNullOrEmpty(input.Remark), t => t.Remark.Contains(input.Remark));
|
||||
var figurenumcount = query.Count();
|
||||
var figurenumlist = query.ToList();
|
||||
var list = ObjectMapper.Map<List<FigureNumberDto>>(figurenumlist);
|
||||
result.code = 0;
|
||||
result.count = figurenumcount;
|
||||
result.data = list;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.msg = ex.Message;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using Abp.Application.Services.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.MaterialNumber.Dto
|
||||
{
|
||||
public class GetAllMaterialNumber : PagedResultRequestDto
|
||||
{
|
||||
public int MaterialNum { get; set; } //用于物料编码搜索
|
||||
public string Remark { get; set; } //用于备注搜索
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using MineTec.ProManager.Commd;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.MaterialNumber.Dto
|
||||
{
|
||||
public class MaterialNumberOutput : OutputBase
|
||||
{
|
||||
public List<MaterialNumberDto> data { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
using Abp.Application.Services;
|
||||
using Abp.Application.Services.Dto;
|
||||
using MineTec.ProManager.MaterialNumber.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.MaterialNumber
|
||||
{
|
||||
public interface IMaterialNumberAppService : IAsyncCrudAppService<//定义了CRUD方法
|
||||
MaterialNumberDto, //用来展示物料编码信息
|
||||
Guid, //ProductNumber实体的主键
|
||||
PagedResultRequestDto, //获取物料编码信息的时候用于分页
|
||||
MaterialNumberDto, //用于创建物料编码
|
||||
MaterialNumberDto> //用于更新物料编码信息
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
using Abp.Application.Services;
|
||||
using Abp.Application.Services.Dto;
|
||||
using Abp.Collections.Extensions;
|
||||
using Abp.Domain.Repositories;
|
||||
using MineTec.ProManager.MaterialNumber.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MineTec.ProManager.MaterialNumber
|
||||
{
|
||||
public class MaterialNumberAppService : AsyncCrudAppService<Entitys.Graphic.MaterialNumber.MaterialNumber, MaterialNumberDto, Guid, PagedResultRequestDto,
|
||||
MaterialNumberDto, MaterialNumberDto>, IMaterialNumberAppService
|
||||
{
|
||||
public MaterialNumberAppService(IRepository<Entitys.Graphic.MaterialNumber.MaterialNumber, Guid> repository) : base(repository)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override Task<MaterialNumberDto> CreateAsync(MaterialNumberDto input)
|
||||
{
|
||||
return base.CreateAsync(input);
|
||||
}
|
||||
|
||||
public async Task<MaterialNumberOutput> GetAllFigureNumber(GetAllMaterialNumber input)
|
||||
{
|
||||
|
||||
var result = new MaterialNumberOutput();
|
||||
try
|
||||
{
|
||||
var query = base.CreateFilteredQuery(input).Where(t => t.IsDelete != 1).WhereIf(input.MaterialNum.ToString().Length > 0, t => t.MaterialNum == input.MaterialNum).WhereIf(!string.IsNullOrEmpty(input.Remark), t => t.Remark.Contains(input.Remark));
|
||||
var materialnumcount = query.Count();
|
||||
var materialnumlist = query.ToList();
|
||||
var list = ObjectMapper.Map<List<MaterialNumberDto>>(materialnumlist);
|
||||
result.code = 0;
|
||||
result.count = materialnumcount;
|
||||
result.data = list;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.msg = ex.Message;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using Abp.Application.Services.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.ProductNumber.Dto
|
||||
{
|
||||
public class GetAllProductNumber : PagedResultRequestDto
|
||||
{
|
||||
public string ProductNum { get; set; } //用于产品编码搜索
|
||||
public string Remark { get; set; } //用于备注搜索
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using MineTec.ProManager.Commd;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.ProductNumber.Dto
|
||||
{
|
||||
public class ProductNumberOutput : OutputBase
|
||||
{
|
||||
public List<ProductNumberDto> data { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
using Abp.Application.Services;
|
||||
using Abp.Application.Services.Dto;
|
||||
using MineTec.ProManager.ProductNumber.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.ProductNumber
|
||||
{
|
||||
public interface IProductNumberAppService : IAsyncCrudAppService<//定义了CRUD方法
|
||||
ProductNumberDto, //用来展示产品编码信息
|
||||
Guid, //ProductNumber实体的主键
|
||||
PagedResultRequestDto, //获取产品编码信息的时候用于分页
|
||||
ProductNumberDto, //用于创建产品编码
|
||||
ProductNumberDto> //用于更新产品编码信息
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
using Abp.Application.Services;
|
||||
using Abp.Application.Services.Dto;
|
||||
using Abp.Collections.Extensions;
|
||||
using Abp.Domain.Repositories;
|
||||
using MineTec.ProManager.ProductNumber.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MineTec.ProManager.ProductNumber
|
||||
{
|
||||
public class ProductNumberAppService : AsyncCrudAppService<Entitys.Graphic.ProductNumber.ProductNumber, ProductNumberDto, Guid, PagedResultRequestDto,
|
||||
ProductNumberDto, ProductNumberDto>, IProductNumberAppService
|
||||
{
|
||||
|
||||
public ProductNumberAppService(IRepository<Entitys.Graphic.ProductNumber.ProductNumber, Guid> repository)
|
||||
: base(repository)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override Task<ProductNumberDto> CreateAsync(ProductNumberDto input)
|
||||
{
|
||||
return base.CreateAsync(input);
|
||||
}
|
||||
|
||||
public async Task<ProductNumberOutput> GetAllFigureNumber(GetAllProductNumber input)
|
||||
{
|
||||
|
||||
var result = new ProductNumberOutput();
|
||||
try
|
||||
{
|
||||
var query = base.CreateFilteredQuery(input).Where(t => t.IsDelete != 1).WhereIf(!string.IsNullOrEmpty(input.ProductNum), t => t.ProductNum.Contains(input.ProductNum)).WhereIf(!string.IsNullOrEmpty(input.Remark), t => t.Remark.Contains(input.Remark));
|
||||
var productnumcount = query.Count();
|
||||
var productnumlist = query.ToList();
|
||||
var list = ObjectMapper.Map<List<ProductNumberDto>>(productnumlist);
|
||||
result.code = 0;
|
||||
result.count = productnumcount;
|
||||
result.data = list;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.msg = ex.Message;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user