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.

125 lines
5.1 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.Util;
using Estsh.Core.Repository.IRepositories;
using Estsh.Core.Services.IServices;
using Estsh.Core.Models;
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 ProductDeliveryResultService : BaseService<MesJisShipping>, IProductDeliveryResultService
{
private readonly IProductDeliveryResultRepository repository;
public ProductDeliveryResultService(IProductDeliveryResultRepository _repository) : base(_repository)
{
repository = _repository;
}
/// <summary>
/// 根据分页条件获取分页菜单数据
/// </summary>
/// <param name="menuName"></param>
/// <param name="pager"></param>
/// <param name="direction"></param>
/// <param name="sort"></param>
/// <returns></returns>
public Hashtable getInQCListByPage(string pdlineCode, string partNo, string partSpec, string serialNumber, string beginCreateTime, string endCreateTime, Pager pager, String direction, String sort)
{
Hashtable result = new Hashtable();
String strWhere = " 1=1 ";
if (pdlineCode != null && !pdlineCode.Trim().Equals(""))
{
strWhere += "and a.pdline_code like '%" + pdlineCode.Trim() + "%'";
}
if (partNo != null && !partNo.Trim().Equals(""))
{
strWhere += "and a.part_no like '%" + partNo.Trim() + "%'";
}
if (partSpec != null && !partSpec.Trim().Equals(""))
{
strWhere += "and a.part_spec = '" + partSpec.Trim() + "'";
}
if (serialNumber != null && !serialNumber.Trim().Equals(""))
{
strWhere += "and a.serial_number = '" + serialNumber.Trim() + "'";
}
if (!String.IsNullOrEmpty(beginCreateTime) && !String.IsNullOrEmpty(endCreateTime))
{
strWhere += " and a.create_time BETWEEN '" + beginCreateTime.Trim() + "' AND '" + endCreateTime.Trim() + "'";
}
if (String.IsNullOrEmpty(beginCreateTime) && !String.IsNullOrEmpty(endCreateTime))
{
strWhere += " and a.create_time <'" + endCreateTime.Trim() + "'";
}
if (!String.IsNullOrEmpty(beginCreateTime) && String.IsNullOrEmpty(endCreateTime))
{
strWhere += " and a.create_time > '" + beginCreateTime.Trim() + "'";
}
String orderBy = "";
if (sort != null && !"".Equals(sort.Trim()))
{
orderBy += "a." + typeof(MesJisShipping).GetEntityColumnName(sort.Trim()) + " " + direction;
}
else
{
orderBy += "a." + typeof(MesJisShipping).GetEntityColumnName("createTime") + " " + direction;
}
result = repository.getListByPage(pager.pageSize, pager.pageNo, strWhere, orderBy);
return result;
}
public List<ProductDeliveryResult> getSearchDataList(string pdlineCode, string partNo, string partSpec, string serialNumber, string beginCreateTime, string endCreateTime)
{
Hashtable result = new Hashtable();
String strWhere = " 1=1 ";
if (pdlineCode != null && !pdlineCode.Trim().Equals(""))
{
strWhere += "and pdline_code like '%" + pdlineCode.Trim() + "%'";
}
if (partNo != null && !partNo.Trim().Equals(""))
{
strWhere += "and part_no like '%" + partNo.Trim() + "%'";
}
if (partSpec != null && !partSpec.Trim().Equals(""))
{
strWhere += "and part_spec = '" + partSpec.Trim() + "'";
}
if (serialNumber != null && !serialNumber.Trim().Equals(""))
{
strWhere += "and serial_number = '" + serialNumber.Trim() + "'";
}
if (!String.IsNullOrEmpty(beginCreateTime) && !String.IsNullOrEmpty(endCreateTime))
{
strWhere += " and create_time BETWEEN '" + beginCreateTime.Trim() + "' AND '" + endCreateTime.Trim() + "'";
}
if (String.IsNullOrEmpty(beginCreateTime) && !String.IsNullOrEmpty(endCreateTime))
{
strWhere += " and create_time <'" + endCreateTime.Trim() + "'";
}
if (!String.IsNullOrEmpty(beginCreateTime) && String.IsNullOrEmpty(endCreateTime))
{
strWhere += " and create_time > '" + beginCreateTime.Trim() + "'";
}
string orderBy = " order by create_time ";
return repository.getSearchDataList(strWhere, orderBy);
}
}
}