/// <summary> /// 模型转换 /// </summary> /// <typeparam name="TDestination">目标模型</typeparam> /// <param name="oldModel"></param> /// <returns></returns> protected TDestination ConventModel <TDestination>(TEntity oldModel) where TDestination : class, new() { TDestination newModel = new TDestination(); OOMaper.Mapper(oldModel, newModel); return(newModel); }
/// <summary> /// 转换为Erp工单模型 /// </summary> /// <param name="model"></param> /// <returns></returns> private OrderModel ConvertToErpOrderModel(DReportsOrderModel model) { try { if (model == null) { return(null); } var orderDetails = new OrderModel(); OOMaper.Mapper(model, orderDetails); return(orderDetails); } catch (Exception) { throw new NotImplementedException(); } }
public OpResult StoreInspectionIqcMasterModelForm(InspectionItemDataSummaryVM model) { InspectionIqcMasterModel masterModel = new InspectionIqcMasterModel(); OOMaper.Mapper <InspectionItemDataSummaryVM, InspectionIqcMasterModel>(model, masterModel); masterModel.InspectionItems = model.InspectionItem; masterModel.MaterialCount = model.MaterialInCount; masterModel.FinishDate = DateTime.Now.Date; masterModel.InspectionStatus = "未完成"; masterModel.InspectionResult = model.InspectionItemResult; masterModel.OpSign = OpMode.Add; if (IsExistOrderIdAndMaterailId(model.OrderId, model.MaterialId)) { return(ChangeMasterModelStatus(masterModel)); } return(InspectionManagerCrudFactory.IqcMasterCrud.Store(masterModel, true));; }
/// <summary> /// 日报审核 /// </summary> /// <returns></returns> public OpResult AuditDailyReport(string department, DateTime dailyReportDate) { //将临时表中的本部门的所有列表 克隆至正式日报表中 var dailyReportTempList = DailyReportInputCrudFactory.DailyReportTempCrud.GetDailyReportListBy(department, dailyReportDate); if (!dailyReportTempList.IsNullOrEmpty()) { return(OpResult.SetErrorResult("未找到本部门的任何日报记录!")); } //清除正式表中的本部门的日报数据 DailyReportInputCrudFactory.DailyReportCrud.DeleteDailyReportListBy(department, dailyReportDate.ToDate()); //改审核状态 DailyReportInputCrudFactory.DailyReportTempCrud.ChangeChackSign(department, dailyReportDate.ToDate(), "已审核"); //由DailyReportTempModel 转化为 DailyReportModel var dailyReportList = OOMaper.Mapper <DailyReportTempModel, DailyReportModel>(dailyReportTempList).ToList(); return(DailyReportInputCrudFactory.DailyReportCrud.SavaDailyReportList(dailyReportList)); }
/// <summary> ///通过供应商信息得到证书信息 /// </summary> /// <param name="supplierInfo"></param> /// <returns></returns> private SuppliersSumInfoVM GetSuppliersInfoAddrLatestTwoPurchaseInfo(SupplierInfoModel supplierInfo) { //从ERP中得到最新二次采购信息 //// 获取供应商证书字典 //var certificateDictionary = CertificateDictionary(supplierInfo.SupplierId); SuppliersSumInfoVM m = new SuppliersSumInfoVM(); OOMaper.Mapper <SupplierInfoModel, SuppliersSumInfoVM>(supplierInfo, m); SupplierLatestTwoPurchaseCell LatestTwoPurchaseModel = new SupplierLatestTwoPurchaseCell(); //从ERP中得到最新二次采购信息 var supplierLatestTwoPurchase = PurchaseDbManager.PurchaseDb.FindSupplierLatestTwoPurchaseBy(supplierInfo.SupplierId); if (supplierLatestTwoPurchase != null) { LatestTwoPurchaseModel.LastPurchaseDate = supplierLatestTwoPurchase[0].PurchaseDate.Trim().ToDate(); LatestTwoPurchaseModel.UpperPurchaseDate = supplierLatestTwoPurchase[1].PurchaseDate.Trim().ToDate(); LatestTwoPurchaseModel.PurchaseUser = supplierLatestTwoPurchase[0].PurchasePerson.Trim(); } OOMaper.Mapper <SupplierLatestTwoPurchaseCell, SuppliersSumInfoVM>(LatestTwoPurchaseModel, m); return(m); }