/// <summary> /// Get MO by Model(含Virtual Mo和真实Mo) /// </summary> /// <param name="model">Model</param> /// <param name="editor">operator</param> /// <param name="stationId">stationId</param> /// <param name="customerId">customerId</param> /// <returns>MOInfoList查询结果</returns> public IList<MOInfo> GetVirtualMOByModel(string model, string editor, string stationId, string customerId) { // SELECT MO, Model, CreateDate, StartDate, Qty, Print_Qty FROM IMES_GetData..MO // WHERE Model = @Model // AND Cdt BETWEEN CONVERT(varchar, GETDATE(),111) AND CONVERT(varchar, DATEADD(day, 1, GETDATE()), 111) // ORDER BY MO try { var currentMORepository = RepositoryFactory.GetInstance().GetRepository<IMORepository, MO>(); IList<MO> currentMOList = (IList<MO>)currentMORepository.GetVirtualMOAndRealMObyModel(model); IList<MOInfo> returnMOList = new List<MOInfo>(); if (currentMOList != null) { foreach (MO moItem in currentMOList) { MOInfo tempMO = new MOInfo(); tempMO.createDate = moItem.CreateDate; tempMO.startDate = moItem.StartDate; tempMO.qty = moItem.Qty; tempMO.pqty = moItem.PrtQty; tempMO.model = moItem.Model; tempMO.id = moItem.MONO; returnMOList.Add(tempMO); } } return returnMOList; } catch (FisException e) { throw e; } catch (Exception e) { throw new SystemException(e.Message); } }
MOInfo IMO.GetMOInfo(string MOId) { IMORepository moRepository = RepositoryFactory.GetInstance().GetRepository<IMORepository, MO>(); var currentMO = moRepository.Find(MOId); MOInfo currentMOInfo = new MOInfo(); currentMOInfo.qty = currentMO.Qty; currentMOInfo.pqty = currentMO.PrtQty; return currentMOInfo; }
public IList<MOInfo> GetMOList(string modelId) { //IMORepository moRepository = RepositoryFactory.GetInstance().GetRepository<IMORepository, MO>(); IList<string> moLst = new List<string>(); IMBMORepository myRepository = RepositoryFactory.GetInstance().GetRepository<IMBMORepository, IMBMO>(); moLst = myRepository.GetMOsRecentOneMonthByModelRegardlessUdt(modelId); IList<MOInfo> infoLst = new List<MOInfo>(); foreach (string temp in moLst) { MOInfo currentMOInfo = new MOInfo(); currentMOInfo.id = temp; currentMOInfo.friendlyName = temp; infoLst.Add(currentMOInfo); } return infoLst; //return (List<MOInfo>)moRepository.GetMOListFor014ConsiderStartDateOrderByMo(modelId); }
// <summary> /// Get MO (For Query) /// </summary> /// <param name="mo">mo</param> /// <param name="model">Model</param> /// <param name="family">family</param> /// <param name="editor">editor</param> /// <param name="stationId">stationId</param> /// <param name="customerId">customerId</param> /// <returns>MOInfoList查询结果</returns> public IList<MOInfo> GetVirtualForQuery(string mo, string model, string family, string editor, string stationId, string customerId) { //UC Revision:6789: //SELECT MO, Model, CreateDate, StartDate, Qty, Print_Qty FROM MO // WHERE MO = @MO //或者 //SELECT MO, Model, CreateDate, StartDate, Qty, Print_Qty FROM MO // WHERE Model = @Model and Qty> Print_Qty order by MO //或者 //SELECT MO, Model, CreateDate, StartDate, Qty, Print_Qty FROM MO a,Model b // WHERE a.Model=b.Model and b.Family= @Family and Qty> Print_Qty order by MO //查询顺序具有优先级: MO -> Model -> Family //Revision: 8815: 查询窗口的查询结果增加CustomerSN_Qty的显示 try { var currentMORepository = RepositoryFactory.GetInstance().GetRepository<IMORepository, MO>(); IList<MOInfo> returnMOList = new List<MOInfo>(); if (!string.IsNullOrEmpty(mo)) { MO moItem = new IMES.FisObject.Common.MO.MO(); moItem = currentMORepository.Find(mo); if (moItem != null) { MOInfo tempMO = new MOInfo(); tempMO.createDate = moItem.CreateDate; tempMO.startDate = moItem.StartDate; tempMO.qty = moItem.Qty; tempMO.pqty = moItem.PrtQty; tempMO.model = moItem.Model; tempMO.id = moItem.MONO; tempMO.customerSN_Qty = moItem.CustomerSN_Qty; returnMOList.Add(tempMO); } } else if (!string.IsNullOrEmpty(model)) { IList<MOInfo> MOInfoList = new List<MOInfo>(); MOInfoList = currentMORepository.GetMOList(model); if (MOInfoList != null) { foreach (MOInfo moItem in MOInfoList) { if (moItem.qty > moItem.pqty) { returnMOList.Add(moItem); } } } } else if (!string.IsNullOrEmpty(family)) { returnMOList = currentMORepository.GetMOListByFamily(family); } return returnMOList; } catch (FisException e) { throw e; } catch (Exception e) { throw new SystemException(e.Message); } }
public IList<MOInfo> GetVirtualForQuery2(string mo, string model, string family, DateTime startTime, DateTime endTime) { //SELECT MO, a.Model, CreateDate, StartDate, Qty, Print_Qty ,CustomerSN_Qty FROM MO a, Model b //WHERE a.Model=b.Model and b.Family like '%@Family%' //and a.Model like '%@Model%' //and a.MO like '%@MO%' //and CONVERT(Varchar,a.CreateDate,111)>='@StartDate' //and CONVERT(Varchar,a.CreateDate,111)<='@EndDate' //and Qty> Print_Qty //and a.Status = 'H' //order by MO try { IMBMORepository mbMORepository = RepositoryFactory.GetInstance().GetRepository<IMBMORepository, IMBMO>(); IList<MO> moLst = new List<MO>(); moLst = mbMORepository.GetMoModelInfoListFromMoModel(family, model, mo, startTime, endTime, "H"); IList<MOInfo> returnMOList = new List<MOInfo>(); foreach (MO temp in moLst) { MOInfo tempMO = new MOInfo(); tempMO.createDate = temp.CreateDate; tempMO.startDate = temp.StartDate; tempMO.qty = temp.Qty; tempMO.pqty = temp.PrtQty; tempMO.model = temp.Model; tempMO.id = temp.MONO; tempMO.customerSN_Qty = temp.CustomerSN_Qty; returnMOList.Add(tempMO); } return returnMOList; } catch (FisException e) { throw e; } catch (Exception e) { throw new SystemException(e.Message); } }
/// <summary> /// 根据MO标识,取得MO信息 /// </summary> /// <param name="MOId">MO标识</param> /// <returns>MO信息</returns> public MOInfo GetMOInfo(string moId) { MOInfo moInfo = new MOInfo(); try { if (!String.IsNullOrEmpty(moId)) { IMORepository moRepository = RepositoryFactory.GetInstance().GetRepository<IMORepository, MO>(); MO mo = moRepository.Find(moId); if (mo != null) { moInfo.qty = mo.Qty; moInfo.pqty = mo.PrtQty; } } return moInfo; } catch (Exception) { throw; } }