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; /*************************************************************************************************** * * 更新人:sitong.dong * 描述:移动单管理 * 修改时间:2022.06.22 * 修改日志:系统迭代升级 * **************************************************************************************************/ namespace Estsh.Core.Services { public class MovementManageService : BaseService, IMovementManageService { private readonly IMovementManageRepository repository; public MovementManageService(IMovementManageRepository _repository) : base(_repository) { repository = _repository; } public Hashtable getMoveHeaderListByPage(string orderNo, string orderType, string orderStatus, string startTime, string endTime, string enabled, int factoryId, Pager pager, String direction, String sort,string refOrderNo) { Hashtable result = new Hashtable(); String strWhere = " 1=1 "; if (orderNo != null && !orderNo.Trim().Equals("")) { strWhere += "and a.order_no like '%" + orderNo.Trim() + "%' "; } if (orderType != null && !orderType.Trim().Equals("")) { strWhere += "and a.order_type ='" + orderType.Trim() + "' "; } if (refOrderNo != null && !refOrderNo.Trim().Equals("")) { strWhere += "and a.ref_Order_No ='" + refOrderNo.Trim() + "' "; } if (orderStatus != null && !orderStatus.Trim().Equals("")) { strWhere += "and a.order_status ='" + orderStatus.Trim() + "' "; } if (!String.IsNullOrEmpty(startTime) && !String.IsNullOrEmpty(endTime)) { strWhere += " and a.create_time BETWEEN '" + startTime.Trim() + "' AND '" + endTime.Trim() + "'"; } else if (String.IsNullOrEmpty(startTime) && !String.IsNullOrEmpty(endTime)) { strWhere += " and a.create_time < '" + endTime.Trim() + "'"; } else if (!String.IsNullOrEmpty(startTime) && String.IsNullOrEmpty(endTime)) { strWhere += " and a.create_time >'" + startTime.Trim() + "'"; } if (enabled != null && !enabled.Trim().Equals("")) { strWhere += "and a.enabled = '" + enabled.Trim() + "' "; } strWhere += " and a.factory_id = " + factoryId + " "; String orderBy = ""; if (sort != null && !"".Equals(sort.Trim())) { orderBy += typeof(WmsMoveHeader).GetEntityColumnName(sort.Trim()) + " " + direction; } else { orderBy += typeof(WmsMoveHeader).GetEntityColumnName("ruid") + " " + direction; } return repository.getMoveHeaderListByPage(pager.pageSize, pager.pageNo, strWhere, orderBy); } public Hashtable getMoveDetailListByPage(string orderNo, string enabled, int factoryId) { Hashtable result = new Hashtable(); String strWhere = " 1=1 "; if (orderNo != null && !orderNo.Trim().Equals("")) { strWhere += "and a.order_no like '%" + orderNo.Trim() + "%' "; } if (enabled != null && !enabled.Trim().Equals("")) { strWhere += "and a.enabled = '" + enabled.Trim() + "' "; } strWhere += " and a.factory_id = " + factoryId + " "; return repository.getMoveDetailListByPage(strWhere); } public Hashtable getMoveSnListByPage(string orderNo, string partNo, string enabled, int factoryId) { Hashtable result = new Hashtable(); String strWhere = " 1=1 "; if (orderNo != null && !orderNo.Trim().Equals("")) { strWhere += "and a.order_no = '" + orderNo.Trim() + "' "; } if (partNo != null && !partNo.Trim().Equals("")) { strWhere += "and a.part_no = '" + partNo.Trim() + "' "; } if (enabled != null && !enabled.Trim().Equals("")) { strWhere += "and a.enabled = '" + enabled.Trim() + "' "; } strWhere += " and a.factory_id = " + factoryId + " "; return repository.getMoveSnListByPage(strWhere); } public Hashtable onBarcodeGenerator(String ids) { ids = ids.Substring(0, ids.Length - 1); return this.repository.onBarcodeGenerator(ids); } public List GetErpwarehouse() { return repository.GetErpwarehouse(); } public List GetMoveOrderType() { return repository.GetMoveOrderType(); } public List getSelectRefOrderNo() { return repository.getSelectRefOrderNo(); } public List GetFedbatchType() { return repository.GetFedbatchType(); } public List GetFedbatchMethods() { return repository.GetFedbatchMethods(); } public List GetMoveOrderStatus() { return repository.GetMoveOrderStatus(); } public List getSelectFactory() { return repository.getSelectFactory(); } public List getSelectWarehouse() { return repository.getSelectWarehouse(); } public List getSelectWarehouse(string warehouseid) { return repository.getSelectWarehouse(warehouseid); } public List getSelectZone(string zoneid) { return repository.getSelectZone(zoneid); } public List getSelectZone() { return repository.getSelectZone(); } public List getSelectVendor() { return repository.getSelectVendor(); } public List getSelectVendor(string vendorId) { return repository.getSelectVendor(vendorId); } public List GetPart() { return repository.GetPart(0); } public List GetPart(string PartNo) { return repository.GetPart(0, PartNo); } /// /// 保存菜单数据 /// /// /// public bool saveMovementManage(WmsMoveHeader htParams, IList htDetailParams) { return repository.saveMovementManage(htParams, htDetailParams); } public List GetPartNoInfo(string part_no) { return this.repository.GetPartNoInfo(part_no); } public List GetPartNoInfoByPartNo(string part_no) { return this.repository.GetPartNoInfoByPartNo(part_no); } public List GetPartSpecInfo(string partSpec) { return this.repository.GetPartSpecInfo(partSpec); } public List GetPartSpecInfoByPartSpec(string partSpec) { return this.repository.GetPartSpecInfoByPartSpec(partSpec); } public List GetWorkRefOrderNo(string refOrderNo, string orderType) { return this.repository.GetWorkRefOrderNo(refOrderNo,orderType); } public List GetWorkOrderInfo(string refOrderNo) { return this.repository.GetWorkOrderInfo(refOrderNo); } /// /// 关闭 /// /// /// public bool onClose(String ids, String empId) { ids = ids.Substring(0, ids.Length - 1); return this.repository.onClose(ids, empId); } /// /// 启用 /// /// /// public bool EnableData(String ids) { ids = ids.Substring(0, ids.Length - 1); return this.repository.EnableData(ids); } /// /// 禁用 /// /// /// public bool DisableData(String ids) { ids = ids.Substring(0, ids.Length - 1); return this.repository.DisableData(ids); } } }