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; using Estsh.Core.Base; /*************************************************************************************************** * * 更新人:sitong.dong * 描述:质检结果查询 * 修改时间:2022.06.22 * 修改日志:系统迭代升级 * **************************************************************************************************/ namespace Estsh.Core.Services { public class QualityResultService : BaseService, IQualityResultService { private readonly IQualityResultRepository repository; public QualityResultService(IQualityResultRepository _repository) : base(_repository) { repository = _repository; } /// /// 根据分页条件获取分页菜单数据 /// /// /// /// /// /// public Hashtable getInQCListByPage(string prove, string evrtn, string matnr, string partSpec, string beginSynTim, string endSynTim, string synflg, Pager pager, String direction, String sort) { Hashtable result = new Hashtable(); String strWhere = " 1=1 "; if (prove != null && !prove.Trim().Equals("")) { strWhere += "and prove like '" + prove.Trim() + "' "; } if (evrtn != null && !evrtn.Trim().Equals("")) { strWhere += "and evrtn like '%" + evrtn.Trim() + "%' "; } if (matnr != null && !matnr.Trim().Equals("")) { strWhere += "and matnr like '%" + matnr.Trim() + "%' "; } if (partSpec != null && !partSpec.Trim().Equals("")) { strWhere += "and part_spec like '%" + partSpec.Trim() + "%' "; } if (synflg != null && !synflg.Trim().Equals("")) { strWhere += "and synflg = '" + synflg.Trim() + "' "; } if (!String.IsNullOrEmpty(beginSynTim) && !String.IsNullOrEmpty(endSynTim)) { strWhere += " and RECTIM BETWEEN '" + beginSynTim.Trim() + "' AND '" + endSynTim.Trim() + "' "; } if (String.IsNullOrEmpty(beginSynTim) && !String.IsNullOrEmpty(endSynTim)) { strWhere += " and RECTIM <'" + endSynTim.Trim() + "' "; } if (!String.IsNullOrEmpty(beginSynTim) && String.IsNullOrEmpty(endSynTim)) { strWhere += " and RECTIM > '" + beginSynTim.Trim() + "' "; } String orderBy = ""; if (sort != null && !"".Equals(sort.Trim())) { orderBy += typeof(WmsInqc).GetEntityColumnName(sort.Trim()) + " " + direction; } else { orderBy += typeof(WmsInqc).GetEntityColumnName("evrtn") + " " + direction; } result = repository.getListByPage(pager.pageSize, pager.pageNo, strWhere, orderBy); return result; } public List getSearchDataList(string prove, string evrtn, string matnr, string partSpec, string beginSynTim, string endSynTim, string synflg) { Hashtable result = new Hashtable(); String strWhere = " 1=1 "; if (prove != null && !prove.Trim().Equals("")) { strWhere += "and prove like '%" + prove.Trim() + "%' "; } if (evrtn != null && !evrtn.Trim().Equals("")) { strWhere += "and evrtn like '%" + evrtn.Trim() + "%' "; } if (matnr != null && !matnr.Trim().Equals("")) { strWhere += "and matnr like '%" + matnr.Trim() + "%' "; } if (partSpec != null && !partSpec.Trim().Equals("")) { strWhere += "and part_spec like '%" + partSpec.Trim() + "%' "; } if (synflg != null && !synflg.Trim().Equals("")) { strWhere += "and synflg = '" + synflg.Trim() + "' "; } if (!String.IsNullOrEmpty(beginSynTim) && !String.IsNullOrEmpty(endSynTim)) { strWhere += " and RECTIM BETWEEN '" + beginSynTim.Trim() + "' AND '" + endSynTim.Trim() + "' "; } if (String.IsNullOrEmpty(beginSynTim) && !String.IsNullOrEmpty(endSynTim)) { strWhere += " and RECTIM <'" + endSynTim.Trim() + "' "; } if (!String.IsNullOrEmpty(beginSynTim) && String.IsNullOrEmpty(endSynTim)) { strWhere += " and RECTIM > '" + beginSynTim.Trim() + "' "; } string orderBy = " order by evrtn,convert(int,etenr) "; return repository.getSearchDataList(strWhere, orderBy); } } }