|
|
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.Dapper;
|
|
|
using Estsh.Core.Model.ExcelModel;
|
|
|
|
|
|
/***************************************************************************************************
|
|
|
*
|
|
|
* 更新人:sitong.dong
|
|
|
* 描述:抽样检测查询
|
|
|
* 修改时间:2022.06.22
|
|
|
* 修改日志:系统迭代升级
|
|
|
*
|
|
|
**************************************************************************************************/
|
|
|
namespace Estsh.Core.Services
|
|
|
{
|
|
|
/// <summary>
|
|
|
/// 菜单业务处理类
|
|
|
/// </summary>
|
|
|
public class SampleTestQueryService : BaseService<SysPartCustOrder>, ISampleTestQueryService
|
|
|
{
|
|
|
private readonly ISampleTestQueryRepository repository;
|
|
|
|
|
|
public SampleTestQueryService(ISampleTestQueryRepository _repository) : base(_repository)
|
|
|
{
|
|
|
repository = _repository;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 根据分页条件获取分页菜单数据
|
|
|
/// </summary>
|
|
|
/// <param name="SampleTestQueryName"></param>
|
|
|
/// <param name="pager"></param>
|
|
|
/// <param name="direction"></param>
|
|
|
/// <param name="sort"></param>
|
|
|
/// <returns></returns>
|
|
|
public Hashtable getSampleTestQueryListByPage(String type_name, String model_name, String Date, String Date2, String StartCarNo, String EndCarNo, Pager pager, String direction, String sort)
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
String strWhere = " 1=1 ";
|
|
|
if (type_name != null && !type_name.Trim().Equals(""))
|
|
|
{
|
|
|
strWhere = " g.type_name like '%" + type_name.Trim() + "%' ";
|
|
|
}
|
|
|
if (model_name != null && !model_name.Trim().Equals(""))
|
|
|
{
|
|
|
strWhere += " AND f.model_name like '%" + model_name.Trim() + "%'";
|
|
|
}
|
|
|
if (!string.IsNullOrEmpty(Date) && !string.IsNullOrEmpty(Date2))
|
|
|
{
|
|
|
strWhere += " AND c.create_time between '" + Date + "' and '" + Date2 + "' ";
|
|
|
}
|
|
|
if (!string.IsNullOrEmpty(StartCarNo) && !string.IsNullOrEmpty(EndCarNo))
|
|
|
{
|
|
|
strWhere += "AND a.car_no between '" + StartCarNo + "' and '" + EndCarNo + "' ";
|
|
|
}
|
|
|
|
|
|
String orderBy = "";
|
|
|
if (sort != null && !"".Equals(sort.Trim()))
|
|
|
{
|
|
|
orderBy +="a."+ typeof(GWorkorder).GetEntityColumnName(sort.Trim()) + " " + direction;
|
|
|
}
|
|
|
|
|
|
result = repository.getListByPage(pager.pageSize, pager.pageNo, strWhere, orderBy);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 保存菜单数据
|
|
|
/// </summary>
|
|
|
/// <param name="htParams"></param>
|
|
|
/// <returns></returns>
|
|
|
public int saveSampleTestQuery(SysPartCustOrder htParams)
|
|
|
{
|
|
|
return repository.saveSampleTestQuery(htParams);
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 更新菜单数据
|
|
|
/// </summary>
|
|
|
/// <param name="htParams"></param>
|
|
|
/// <returns></returns>
|
|
|
public int updateSampleTestQuery(SysPartCustOrder htParams)
|
|
|
{
|
|
|
return repository.updateSampleTestQuery(htParams);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 查看详情
|
|
|
/// </summary>
|
|
|
/// <param name="ruid"></param>
|
|
|
/// <returns></returns>
|
|
|
public List<SysPartCustOrder> getSampleTestQuery(String part_id)
|
|
|
{
|
|
|
part_id = "part_id = " + part_id;
|
|
|
return repository.getList(part_id, "");
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 删除菜单
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <returns></returns>
|
|
|
public int deleteSampleTestQuery(String ids)
|
|
|
{
|
|
|
String[] idArray = ids.Split(',');
|
|
|
int count = 0;
|
|
|
foreach (String id in idArray)
|
|
|
{
|
|
|
if (!"".Equals(id))
|
|
|
{
|
|
|
count += this.repository.deleteSampleTestQuery(id);
|
|
|
}
|
|
|
}
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 启用
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <returns></returns>
|
|
|
public int EnableData(String ids)
|
|
|
{
|
|
|
ids = ids.Substring(0, ids.Length - 1);
|
|
|
return this.repository.EnableData(ids);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 禁用
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <returns></returns>
|
|
|
public int DisableData(String ids)
|
|
|
{
|
|
|
ids = ids.Substring(0, ids.Length - 1);
|
|
|
return this.repository.DisableData(ids);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取下拉框中的菜单数据
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> getSelectSampleTestQuery()
|
|
|
{
|
|
|
return repository.getSelectSampleTestQuery();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取下拉框中的菜单数据
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> getSelectSampleTestQuery_ModelName()
|
|
|
{
|
|
|
return repository.getSelectSampleTestQuery_ModelName();
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 根据分页条件获取分页客户订单数据
|
|
|
/// </summary>
|
|
|
/// <param name="menuName">查询条件</param>
|
|
|
/// <param name="pager"></param>
|
|
|
/// <param name="direction">排序方式</param>
|
|
|
/// <param name="sort">排序字段</param>
|
|
|
/// <returns></returns>
|
|
|
public List<SampleTestQuery> getTableListByPage(String type_name, String model_name, String Date, String Date2, String StartCarNo, String EndCarNo, Pager pager, String direction, String sort, Boolean isPage)
|
|
|
{
|
|
|
String strWhere = " 1=1 ";
|
|
|
int rowCount = 0;
|
|
|
if (type_name != null && !type_name.Trim().Equals(""))
|
|
|
{
|
|
|
strWhere = " g.type_name like '%" + type_name.Trim() + "%' ";
|
|
|
}
|
|
|
if (model_name != null && !model_name.Trim().Equals(""))
|
|
|
{
|
|
|
strWhere += " AND f.model_name like '%" + model_name.Trim() + "%'";
|
|
|
}
|
|
|
if (!string.IsNullOrEmpty(Date) && !string.IsNullOrEmpty(Date2))
|
|
|
{
|
|
|
strWhere += " AND c.create_time between '" + Date + "' and '" + Date2 + "' ";
|
|
|
}
|
|
|
if (!string.IsNullOrEmpty(StartCarNo) && !string.IsNullOrEmpty(EndCarNo))
|
|
|
{
|
|
|
strWhere += "AND a.car_no between '" + StartCarNo + "' and '" + EndCarNo + "' ";
|
|
|
}
|
|
|
|
|
|
String orderBy = "";
|
|
|
if (sort != null && !"".Equals(sort.Trim()))
|
|
|
{
|
|
|
orderBy += "a." + typeof(GWorkorder).GetEntityColumnName(sort.Trim()) + " " + direction;
|
|
|
}
|
|
|
|
|
|
if (isPage)
|
|
|
{
|
|
|
rowCount = pager.pageSize;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
rowCount = pager.pageSize;
|
|
|
}
|
|
|
return repository.getTableListByPage(rowCount, pager.pageNo, strWhere, orderBy);
|
|
|
}
|
|
|
}
|
|
|
} |