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.

90 lines
3.2 KiB
C#

2 years ago
using System.Collections;
using Estsh.Core.Models;
using Estsh.Core.Repository.IRepositories;
using Estsh.Core.Util;
using Estsh.Core.Services.IServices;
using Estsh.Core.Model.Result;
using Estsh.Core.Dapper;
using Estsh.Core.Model.ExcelModel;
/***************************************************************************************************
*
* sitong.dong
*
* 2022.06.22
*
*
**************************************************************************************************/
namespace Estsh.Core.Services
{
/// <summary>
/// 收货查询补打模块管理业务处理类
/// </summary>
public class FinishedHalfInventoryQueryService : BaseService<MesOutPdline>, IFinishedHalfInventoryQueryService
{
private readonly IFinishedHalfInventoryQueryRepository repository;
public FinishedHalfInventoryQueryService(IFinishedHalfInventoryQueryRepository _repository) : base(_repository)
{
repository = _repository;
}
#region 收货查询补打
/// <summary>
/// 根据分页条件获取列表
/// </summary>
/// <param name="account"></param>
/// <param name="pager"></param>
/// <param name="direction"></param>
/// <param name="sort"></param>
/// <returns></returns>
public Hashtable getListByPage(string partNo, string partSpec,string enabled, int factoryId, Pager pager, String direction, String sort)
{
Hashtable result = new Hashtable();
String strWhere = " ";
if (partNo != null && !partNo.Trim().Equals(""))
{
strWhere += "and part_no like '%" + partNo.Trim() + "%' ";
}
String strWhere2 = " ";
if (partSpec != null && !partSpec.Trim().Equals(""))
{
strWhere += "and part_spec like '%" + partSpec.Trim() + "%' ";
}
String orderBy = "";
if (sort != null && !"".Equals(sort.Trim()))
{
orderBy += "a." + typeof(MesOutPdline).GetEntityColumnName(sort.Trim()) + " " + direction;
}
else
{
orderBy += "a." + typeof(MesOutPdline).GetEntityColumnName("PartNo") + " " + direction;
}
result = repository.getListByPage(pager.pageSize, pager.pageNo, strWhere, orderBy);
return result;
}
public List<FinishedHalfInventory> getExportList(string partNo, string partSpec, string enabled, string factoryId)
{
String strWhere = " ";
if (partNo != null && !partNo.Trim().Equals(""))
{
strWhere += "and part_no like '%" + partNo.Trim() + "%' ";
}
String strWhere2 = " ";
if (partSpec != null && !partSpec.Trim().Equals(""))
{
strWhere += "and part_spec like '%" + partSpec.Trim() + "%' ";
}
String orderBy = " a.part_no ";
return repository.getExportList(strWhere, orderBy);
}
#endregion
}
}