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.Base; /*************************************************************************************************** * * 更新人:sitong.dong * 描述:零星出入库 * 修改时间:2022.06.22 * 修改日志:系统迭代升级 * **************************************************************************************************/ namespace Estsh.Core.Services { public class SingleWarePrintDefineService : BaseService, ISingleWarePrintDefineService { private readonly ISingleWarePrintDefineRepository repository; public SingleWarePrintDefineService(ISingleWarePrintDefineRepository _repository) : base(_repository) { repository = _repository; } /// /// 根据分页条件获取分页菜单数据 /// /// /// /// /// /// public List getDPSListByPage(String where, String partNo_search, String option3, String locate_name, String enabled_search, Pager pager, String direction, String sort) { String strWhere = " 1=1 " + where; if (!String.IsNullOrEmpty(partNo_search)) { strWhere += " AND p.part_no = '" + partNo_search.Trim() + "'"; } if (!String.IsNullOrEmpty(option3)) { strWhere += " AND p.option3 =" + option3.Trim() + ""; } //因为select下拉框取view_board_id得到的是view_board_name,select的名字叫view_board_id if (!String.IsNullOrEmpty(locate_name)) { strWhere += " AND l.locate_name= '" + locate_name.Trim() + "'"; } if (!String.IsNullOrEmpty(enabled_search)) { strWhere += " AND s.enabled= '" + enabled_search.Trim() + "'"; } String orderBy = ""; if (sort != null && !"".Equals(sort.Trim())) { orderBy += typeof(SapMisco).GetEntityColumnName(sort.Trim()) + " " + direction; } else { orderBy += typeof(SapMisco).GetEntityColumnName("Zinstno") + " " + direction; } List dt = repository.GetOrderDetail(pager.pageSize, pager.pageNo, strWhere, orderBy); return dt; } /// /// 获取分页总数量 /// /// /// public int getMenuCount(String where, String partNo_search, String option3, String locate_name, String enabled_search, Pager pager, String direction, String sort) { String strWhere = " "; if (!String.IsNullOrEmpty(partNo_search)) { strWhere += " AND p.part_no = '" + partNo_search.Trim() + "'"; } if (!String.IsNullOrEmpty(option3)) { strWhere += " AND p.option3 =" + option3.Trim() + ""; } //因为select下拉框取view_board_id得到的是view_board_name,select的名字叫view_board_id if (!String.IsNullOrEmpty(locate_name)) { strWhere += " AND l.locate_name= '" + locate_name.Trim() + "'"; } if (!String.IsNullOrEmpty(enabled_search)) { strWhere += " AND s.enabled= '" + enabled_search.Trim() + "'"; } return repository.GetOrderCount(strWhere); } /// /// 获取库位名称 /// /// public List GetTaskList() { return repository.GetTaskList(); } public List GetOrderDetail(String order_no, Pager pager, String direction, String sort) { String strWhere = " 1=1 "; if (!String.IsNullOrEmpty(order_no)) { strWhere += " AND a.ZINSTNO = '" + order_no.Trim() + "'"; } else { strWhere += " AND a.ZINSTNO = '1' "; } String orderBy = ""; if (sort != null && !"".Equals(sort.Trim())) { orderBy += typeof(SapMisco).GetEntityColumnName(sort.Trim()) + " " + direction; } else { orderBy += typeof(SapMisco).GetEntityColumnName("Zinstno") + " " + direction; } List dt = repository.GetOrderDetail(pager.pageSize, pager.pageNo, strWhere, orderBy); return dt; } public int GetOrderCount(String order_no) { String strWhere = " "; if (!String.IsNullOrEmpty(order_no)) { strWhere = order_no.Trim(); } else { strWhere = "1"; } return repository.GetOrderCount(strWhere); } } }