using Estsh.Core.Dapper; using Estsh.Core.IRepositories; using Estsh.Core.Model.ExcelModel; using Estsh.Core.Model.Result; using Estsh.Core.Models; using Estsh.Core.Repository.IRepositories; using Estsh.Core.Services.IServices; using Estsh.Core.Util; using System.Collections; using System.Data; using System.Text; /*************************************************************************************************** * * 更新人:sitong.dong * 描述:安灯信息查询 * 修改时间:2022.06.22 * 修改日志:系统迭代升级 * **************************************************************************************************/ namespace Estsh.Core.Services { public class AndonInfoQueryService : BaseService, IAndonInfoQueryService { private readonly IAndonInfoQueryRepository repository; public AndonInfoQueryService(IAndonInfoQueryRepository _repository) : base(_repository) { repository = _repository; } /// /// 根据分页条件获取分页菜单数据 /// /// /// /// /// /// public Hashtable getListByPage(String txtStartTime, String txtEndTime, string type, Pager pager, String direction, String sort,String enabled) { Hashtable result = new Hashtable(); String strWhere = ""; if (!String.IsNullOrEmpty(txtStartTime) && !String.IsNullOrEmpty(txtEndTime)) { strWhere += " AND ( g.start_time > '" + txtStartTime + "' AND g.end_time < '" + txtEndTime + "') "; } else { return null; } if (!String.IsNullOrEmpty(type)) { strWhere += " AND g.andon_type = '" + type.Trim() + "'"; } if (!String.IsNullOrEmpty(enabled)) { strWhere += " AND g.enabled = '" + enabled + "'"; } Hashtable dt = repository.getListByPage(pager.pageSize, pager.pageNo, strWhere, sort + " "); return dt; } /// /// 查看菜单详情 /// /// /// public Hashtable getPartSNRuleDetail(String ruid) { ruid = " ruid = " + ruid; List dt = repository.getList(ruid, ""); Hashtable result = new Hashtable(); result.Add("ruid", dt[0].Ruid); result.Add("type", dt[0].Type); result.Add("lenght", dt[0].Lenght); result.Add("from1", dt[0].From1); result.Add("part_no", dt[0].PartNo); result.Add("to1", dt[0].To1); result.Add("fix1", dt[0].Fix1); result.Add("from2", dt[0].From2); result.Add("to2", dt[0].To2); result.Add("fix2", dt[0].Fix2); result.Add("part_id", dt[0].PartId); //result.Add("ext_rule", dt[0]["ext_rule"]); result.Add("enabled", dt[0].Enabled); return result; } /// /// 删除菜单 /// /// /// public int deletePartSNRule(String ids) { String[] idArray = ids.Split(','); int count = 0; foreach (String id in idArray) { if (!"".Equals(id)) { count += this.repository.deletePartSNRule(id); } } return count; } /// /// 获取 类型 信息 /// BY NOAH /// /// public List getTypeData() { return repository.getTypeData(); } /// /// 判断是否存在 用户输入的零件号 /// BY NOAH /// /// /// public String isExsitPart_no(String part_no) { return this.repository.isExsitPart_no(part_no); } /// /// 根据分页条件获取分页菜单数据 /// /// 查询条件 /// /// 排序方式 /// 排序字段 /// public Hashtable getTableListByPage(String txtStartTime, String txtEndTime, string type, Pager pager, String direction, String sort, Boolean isPage) { int rowCount = 0; String strWhere = " AND 1=1 "; if (!String.IsNullOrEmpty(txtStartTime) && !String.IsNullOrEmpty(txtEndTime)) { strWhere += " AND ( g.start_time > '" + txtStartTime + "' AND g.end_time < '" + txtEndTime + "') "; } if (!String.IsNullOrEmpty(type)) { strWhere += " AND g.andon_type = '" + type.Trim() + "'"; } if (isPage) { rowCount = pager.pageSize; } else { rowCount = pager.pageSize; } return repository.getTableListByPage(rowCount, pager.pageNo, strWhere, sort + " "); } public List getAndonCount(string condition) { return repository.getAndonCount(condition); } public List getAndonTime(string condition) { return repository.getAndonTime(condition); } } }