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.

161 lines
5.7 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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.IRepositories;
using Estsh.Core.Dapper;
using Estsh.Core.Model.ExcelModel;
/***************************************************************************************************
*
* 更新人sitong.dong
* 描述:事物查询
* 修改时间2022.06.22
* 修改日志:系统迭代升级
*
**************************************************************************************************/
namespace Estsh.Core.Services
{
public class InventTransQueryService : BaseService<SysStockTrans>, IInventTransQueryService
{
private readonly IInventTransQueryRepository repository;
public InventTransQueryService(IInventTransQueryRepository _repository) : base(_repository)
{
repository = _repository;
}
/// <summary>
/// 根据分页条件获取分页菜单数据
/// </summary>
/// <param name="partNo_search"></param>
/// <param name="pager"></param>
/// <param name="direction"></param>
/// <param name="sort"></param>
/// <returns></returns>
public Hashtable getDPSListByPage(String partNo, String partSpec, String cartonNo, String refOrderNo, String transType, String destErpWarehouse, string startTime
, string endTime, Pager pager, String direction, String sort)
{
Hashtable result = new Hashtable();
String strWhere = " 1=1 ";
if (!String.IsNullOrEmpty(partNo))
{
strWhere += " and a.part_no like '%" + partNo.Trim() + "%'";
}
if (!String.IsNullOrEmpty(partSpec))
{
strWhere += " and a.part_spec like '%" + partSpec.Trim() + "%'";
}
if (!String.IsNullOrEmpty(cartonNo))
{
strWhere += " and a.carton_no = '" + cartonNo.Trim() + "'";
}
if (!String.IsNullOrEmpty(refOrderNo))
{
strWhere += " and a.ref_order_no like '%" + refOrderNo.Trim() + "%'";
}
if (!String.IsNullOrEmpty(transType))
{
strWhere += " and a.trans_code = '" + transType.Trim() + "'";
}
if (!String.IsNullOrEmpty(destErpWarehouse))
{
strWhere += " and a.dest_erp_warehouse = '" + destErpWarehouse.Trim() + "'";
}
if (!String.IsNullOrEmpty(startTime) && !String.IsNullOrEmpty(endTime))
{
strWhere += " and a.create_time BETWEEN '" + startTime.Trim() + "' AND '" + endTime.Trim() + "'";
}
else if (String.IsNullOrEmpty(startTime) && !String.IsNullOrEmpty(endTime))
{
strWhere += " and a.create_time < '" + endTime.Trim() + "'";
}
else if (!String.IsNullOrEmpty(startTime) && String.IsNullOrEmpty(endTime))
{
strWhere += " and a.create_time >'" + startTime.Trim() + "'";
}
return repository.getListByPage(pager.pageSize, pager.pageNo, strWhere, "ruid");
}
public List<InventTransQuery> getExportList(String partNo, String partSpec, String cartonNo, String refOrderNo, String transType, String destErpWarehouse, String startTime, String endTime)
{
Hashtable result = new Hashtable();
String strWhere = " 1=1 ";
if (!String.IsNullOrEmpty(partNo))
{
strWhere += " and a.part_no like '%" + partNo.Trim() + "%'";
}
if (!String.IsNullOrEmpty(partSpec))
{
strWhere += " and a.part_spec like '%" + partSpec.Trim() + "%'";
}
if (!String.IsNullOrEmpty(cartonNo))
{
strWhere += " and a.carton_no like '%" + cartonNo.Trim() + "%'";
}
if (!String.IsNullOrEmpty(refOrderNo))
{
strWhere += " and a.ref_order_no like '%" + refOrderNo.Trim() + "%'";
}
if (!String.IsNullOrEmpty(transType))
{
strWhere += " and a.trans_code = '" + transType.Trim() + "'";
}
if (!String.IsNullOrEmpty(destErpWarehouse))
{
strWhere += " and a.dest_erp_warehouse = '" + destErpWarehouse.Trim() + "'";
}
if (!String.IsNullOrEmpty(startTime) && !String.IsNullOrEmpty(endTime))
{
strWhere += " and a.create_time BETWEEN '" + startTime.Trim() + "' AND '" + endTime.Trim() + "'";
}
else if (String.IsNullOrEmpty(startTime) && !String.IsNullOrEmpty(endTime))
{
strWhere += " and a.create_time < '" + endTime.Trim() + "'";
}
else if (!String.IsNullOrEmpty(startTime) && String.IsNullOrEmpty(endTime))
{
strWhere += " and a.create_time >'" + startTime.Trim() + "'";
}
string orderBy = " order by a.create_time desc ";
return repository.getExportList( strWhere, orderBy);
}
public List<KeyValueResult> GetStockTransType()
{
return repository.GetStockTransType();
}
public List<KeyValueResult> GetErpwarehouse()
{
return repository.GetErpwarehouse();
}
public List<KeyValueResult> GetSrcLocate()
{
return repository.GetSrcLocate();
}
public List<KeyValueResult> Getuserinfo()
{
return repository.Getuserinfo();
}
}
}