You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.7 KiB
C#
49 lines
1.7 KiB
C#
using Admin.Core.IRepository;
|
|
using Admin.Core.IService;
|
|
using Admin.Core.Model;
|
|
using Admin.Core.Model.Model_New;
|
|
using log4net;
|
|
using Microsoft.AspNetCore.Razor.TagHelpers;
|
|
using Microsoft.IdentityModel.Logging;
|
|
using NPOI.SS.Formula.Functions;
|
|
using NPOI.XSSF.UserModel;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Admin.Core.Service
|
|
{
|
|
public class BaseMaterialInfoServices : BaseServices<BaseMaterialInfo>, IBaseMaterialInfoServices
|
|
{
|
|
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(BaseMaterialInfoServices));
|
|
private readonly IBaseRepository<BaseMaterialInfo> _dal;
|
|
private readonly IBaseMaterialInfoRepository _baseMaterialInfoRepository;
|
|
public BaseMaterialInfoServices(IBaseRepository<BaseMaterialInfo> dal, IBaseMaterialInfoRepository baseMaterialInfoRepository)
|
|
{
|
|
this._dal = dal;
|
|
base.BaseDal = dal;
|
|
_baseMaterialInfoRepository = baseMaterialInfoRepository;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 1.条件查询使用,查出BASE_MATERIALINFO中存在的成品类型
|
|
/// </summary>
|
|
public async Task<List<BaseMaterialInfo>> queryAsyncLike(string search)
|
|
{
|
|
List<BaseMaterialInfo> list;
|
|
if (!string.IsNullOrEmpty(search))
|
|
{
|
|
|
|
list = await _baseMaterialInfoRepository.QueryAsync(x => x.MaterialType == "FERT" && (x.MaterialCode.Contains(search) || x.MaterialName.Contains(search)));
|
|
}
|
|
else
|
|
{
|
|
list = await _baseMaterialInfoRepository.QueryAsync(x => x.MaterialType == "FERT");
|
|
}
|
|
|
|
return list;
|
|
}
|
|
|
|
}
|
|
} |