/// <summary> /// 新增实时交易信息 /// </summary> /// <param name="query"></param> /// <returns></returns> public Result_Msg TransactionRecordAdd(TransactionRecordAddQuery query) { Result_Msg res = new Result_Msg(); Result_Model <TransactionRecord> model = GetTransactionRecordByYearMonthAndCurveType(query.CurveType, query.YearMonth); if (!model.Msg.IsSuccess) { TransactionRecord job = new TransactionRecord() { CurveType = query.CurveType, YearMonth = query.YearMonth, XName_CN = query.XName_CN, XName_Eng = query.XName_Eng, Y_CompleteAmount = query.Y_CompleteAmount, Y_OrderAmount = query.Y_OrderAmount, Y_CompleteNumber = query.Y_CompleteNumber, Y_OrderQuantity = query.Y_OrderQuantity, IsTrue = 1//1:真是;0:伪造 }; context.TransactionRecord.Add(job); res.IsSuccess = context.SaveChanges() == 1; } else { res.IsSuccess = false; res.Message = model.Msg.Message; } return(res); }
public string Get_PageInfo_Default_Web(QueryCommon <IWantToBuyQuery> query) { Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); resModel = iWantToBuyService.Get_PageInfo_Web_Supply(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
/// <summary> /// 根据参数,统计指定的实时交易数据 /// </summary> /// <param name="query"></param> /// <returns></returns> public Result_Model <TransactionRecord> ComputeFun(TransactionRecordCompute query) { Result_Model <TransactionRecord> res = new Result_Model <TransactionRecord>() { Msg = new Result_Msg(), Model = new TransactionRecord() }; try { res.Model = new TransactionRecord() { CurveType = query.CurveType, YearMonth = query.YearMonth, Y_CompleteAmount = Get_Y_CompleteAmount(query), Y_OrderAmount = Get_Y_OrderAmount(query), Y_CompleteNumber = Get_Y_CompleteNumber(query), Y_OrderQuantity = Get_Y_OrderQuantity(query) }; res.Msg.IsSuccess = true; } catch (Exception ex) { res.Msg.IsSuccess = false; res.Msg.Message = ex.Message; } return(res); }
/// <summary> /// 获取当前登录用户类型信息 /// </summary> /// <param name="query"></param> /// <returns></returns> public string GetCurrentUserType(QueryCommon <IWantToBuyQuery> query) { Result_Model <CurrentUserInfo> res = new Result_Model <CurrentUserInfo>() { Model = new CurrentUserInfo(), Msg = new Result_Msg() { IsSuccess = true } }; if (base.CurrentUser != null) { res.Model.Id = base.CurrentUser.Id; res.Model.UserType = base.CurrentUser.UserType; res.Model.UserName = base.CurrentUser.UserName; } else { res.Msg = new Result_Msg() { IsSuccess = false, Message = "获取当前用户登陆信息失败" }; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
public string Get_PageInfo(QueryCommon <WhatBusyQuery> query) { Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); resModel = whatBuys.Get_PageInfo(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public string Get_PageInfo(QueryCommon <JobsQuery> query) { Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); resModel = jobsService.Get_PageInfo(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public IResult GetEntities(Type type) { var db = AAAS.Core.Application.DocumentManager.MdiActiveDocument.Database; var returnresult = new Result_Model(); using (AADS.Transaction tr = db.TransactionManager.StartTransaction()) { try { var modelspaceId = AADS.SymbolUtilityServices.GetBlockModelSpaceId(db); var modelspace = modelspaceId.GetObject(AADS.OpenMode.ForRead, false) as AADS.BlockTableRecord; var rxobjclass = AAR.RXObject.GetClass(type); var entityids = modelspace.Cast <AADS.ObjectId>().Where(id => id.ObjectClass == rxobjclass); returnresult.Payload.Clear(); entityids.ToList().ForEach(id => returnresult.Payload.Add(id.GetObject(AADS.OpenMode.ForRead, false))); tr.Commit(); } catch { tr.Abort(); returnresult.ResultType = Core.Enums.ResultTypes.Failed; } } return(returnresult); }
public string Get_PageInfo(QueryCommon <BannerIndexQuery> query) { Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); IBannersIndexService bannerService = ServiceHelper.Create <IBannersIndexService>(); resModel = bannerService.Get_PageInfo(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public string Get_PageInfo(QueryCommon <LawInfoQuery_Web> query) { Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); ILawInfoService jobsService = ServiceHelper.Create <ILawInfoService>(); resModel = jobsService.Get_PageInfo_Web(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public string Get_PageInfo_Member(QueryCommon <IWantToBuyQuery> query) { Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); query.ParamInfo.PurchaseID = base.CurrentUser.Id; resModel = supplyService.Get_PageInfo_IWantToBuyList_SupplyUser(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public string IWantToBuyOrderAdd(QueryCommon <IWantToSupplyQuery> query) { DateTime now = DateTime.Now; Result_Model <IWantToSupply> res = iWantToBuyService.GetObjectById_Supply(query.ParamInfo.Id); Result_Model <IWantToBuy_Orders> res1 = iWantToBuyService.AddIWantToBuyOrder(res.Model); return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
public IResult GetEntities(Type type) { var returnresult = new Result_Model(); FilteredElementCollector allelements = new FilteredElementCollector(doc).OfClass(type); allelements.ToList().ForEach(element => returnresult.Payload.Add(element)); return(returnresult); }
public string Get_PageInfo_Member(QueryCommon <JobsQuery> query) { Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); query.ParamInfo.UserId = base.CurrentUser.Id; query.ParamInfo.UserType = base.CurrentUser.UserType; resModel = jobsService.Get_PageInfo_Member(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public string Get_PageInfo_IWantToSupply_List(QueryCommon <IWantToBuyQuery> query) { if (base.CurrentUser != null) { query.ParamInfo.PurchaseID = base.CurrentUser.Id; } Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); resModel = iWantToBuyService.Get_PageInfo_IWantToSupply_List(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public string Get_PageInfo_Buy_Web(QueryCommon <IWantToBuyQuery> query) { query.ParamInfo = new IWantToBuyQuery(); if (base.CurrentUser != null) { query.ParamInfo.Id = base.CurrentUser.Id; } Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); resModel = iWantToBuyService.Get_PageInfo_Web_Buy(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public string IWantToBuy_Update(QueryCommon <IWantToBuyQuery> query) { Result_Msg res = new Result_Msg() { IsSuccess = true }; DateTime dtNow = DateTime.Now; query.ParamInfo.UpdateDate = dtNow; try { Result_Model <IWantToBuy> resIWantToBuy = iWantToBuyService.GetObjectById_Web_Buy(query.ParamInfo.Id); if (resIWantToBuy.Msg.IsSuccess) { switch (resIWantToBuy.Model.Status) { case 0: break; case 1: res.Message = "“废弃采购”采购单不能修改!"; res.IsSuccess = false; break; case 2: res.Message = "“终止公示”采购单不能修改!"; res.IsSuccess = false; break; case 3: res.Message = "“已确定”采购单不能修改!"; res.IsSuccess = false; break; default: break; } if (res.IsSuccess) { res = iWantToBuyService.IWantToBuy_Update(query); } } } catch (Exception ex) { res.IsSuccess = false; res.Message = ex.Message; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
/// <summary> /// 分页信息 /// </summary> /// <param name="query"></param> /// <returns></returns> public Result_Model <PageInfo> Get_PageInfo_Admin(QueryCommon <JobsQuery> query) { Result_Model <PageInfo> resPage = new Result_Model <PageInfo>() { Model = new PageInfo(), Msg = new Result_Msg() { IsSuccess = true } }; try { var linqList = from job in context.Jobs select job; #region 拼接 Linq 查询条件 if (query.ParamInfo.UserType != 0) { linqList = linqList.Where(x => x.UserType == query.ParamInfo.UserType); } if (query.ParamInfo.LanguageType != 0) { //语言类型(0:所有 ;1:中文;2:英文;) linqList = linqList.Where(x => x.LanguageType == query.ParamInfo.LanguageType); } if (query.ParamInfo.ApprovalStatus != 0) { linqList = linqList.Where(x => x.ApprovalStatus == query.ParamInfo.ApprovalStatus); } if (query.ParamInfo.JobTitle != null && query.ParamInfo.JobTitle != string.Empty) { linqList = linqList.Where(x => x.JobTitle.IndexOf(query.ParamInfo.JobTitle) != -1); } #endregion int total = linqList.Count(); resPage.Model.CurrentPage = query.PageInfo.CurrentPage; resPage.Model.PageSize = query.PageInfo.PageSize; resPage.Model.Total = total; resPage.Model.PageCount = Convert.ToInt32(Math.Ceiling((double)total / (double)query.PageInfo.PageSize)); } catch (Exception ex) { resPage.Msg = new Result_Msg() { IsSuccess = false, Message = ex.Message }; } return(resPage); }
/// <summary> /// 统计计算数据 /// </summary> /// <param name="query"></param> /// <returns></returns> public string ComputeFun(TransactionRecordCompute query) { Result_Model <TransactionRecord> res = new Result_Model <TransactionRecord>(); if (base.CurrentManager != null && base.CurrentManager.Id > 0) { long userId = base.CurrentManager.Id; res = bannerIndexService.ComputeFun(query); } else { res.Msg.IsSuccess = false; res.Msg.Message = "计算" + query.YearMonth + "数据失败"; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
/// <summary> /// 更新数据 /// </summary> /// <param name="query"></param> /// <returns></returns> public string UpdateWhatBusy_By_WhatBusyType(QueryCommon <WhatBusyQuery> query) { Result_Model <WhatBusy> res = new Result_Model <WhatBusy>(); if (base.CurrentManager != null && base.CurrentManager.Id > 0) { long userId = base.CurrentManager.Id; res = whatBuys.UpdateWhatBusy_By_WhatBusyType(query); } else { res.Msg.IsSuccess = false; res.Msg.Message = "计算" + hashSet.Get_DictionariesList_ByTypeID(19).Where(y => y.DKey == query.ParamInfo.BusyType.ToString()).FirstOrDefault().DValue + "数据失败"; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
public string Detail_Apply(QueryCommon <ApplyAmountInfo> query) { Result_Model <ApplyAmountInfo> res = new Result_Model <ApplyAmountInfo>() { Model = new ApplyAmountInfo(), Msg = new Result_Msg() }; res.Model = ServiceHelper.Create <IApplyAmountService>().GetApplyById(query.ParamInfo.Id); if (res.Model != null) { switch (res.Model.ApplyStatus) { case 0: res.Msg = new Result_Msg() { IsSuccess = true }; break; case 1: res.Msg = new Result_Msg() { IsSuccess = false, Message = "审核已通过,不能修改" }; break; case 2: res.Msg = new Result_Msg() { IsSuccess = true, }; break; default: break; } } else { res.Msg = new Result_Msg() { IsSuccess = false, Message = "未找到记录" }; }; return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
/// <summary> /// 分页信息 /// </summary> /// <param name="query"></param> /// <returns></returns> public Result_Model <PageInfo> Get_PageInfo_Web(QueryCommon <MeetingInfoQuery_Web> query) { Result_Model <PageInfo> resPage = new Result_Model <PageInfo>() { Model = new PageInfo(), Msg = new Result_Msg() { IsSuccess = true } }; try { var linqList = from listMeet in context.MeetingInfo select listMeet; if (query.ParamInfo.LanguageType != 0) { //语言类型(0:所有 ;1:中文;2:英文;) linqList = linqList.Where(x => x.LanguageType == query.ParamInfo.LanguageType); } if (query.ParamInfo.Type == 1)//最新 { linqList = linqList.Where(x => x.MeetingTime >= query.ParamInfo.EndTime); } if (query.ParamInfo.Type == 2)//历史 { linqList = linqList.Where(x => x.MeetingTime < query.ParamInfo.EndTime); } if (query.ParamInfo.Type == 0) { linqList = linqList.Where(x => x.MeetingTime >= query.ParamInfo.StartTime && x.MeetingTime < query.ParamInfo.EndTime); } int total = linqList.Count(); resPage.Model.CurrentPage = query.PageInfo.CurrentPage; resPage.Model.PageSize = query.PageInfo.PageSize; resPage.Model.Total = total; resPage.Model.PageCount = Convert.ToInt32(Math.Ceiling((double)total / (double)query.PageInfo.PageSize)); } catch (Exception ex) { resPage.Msg = new Result_Msg() { IsSuccess = false, Message = ex.Message }; } return(resPage); }
public IResult GetEntities(dynamic obj) { var returnresult = new Result_Model(); if (obj is Type data) { var doc = Bootstrapper.Instance.Container.Resolve <Document>(); FilteredElementCollector allelements = new FilteredElementCollector(doc).OfClass(data); allelements.ToList().ForEach(element => returnresult.Payload.Add(element)); } else { returnresult.ResultType = Core.Enums.ResultTypes.Failed; } return(returnresult); }
/// <summary> /// 分页信息 /// </summary> /// <param name="query"></param> /// <returns></returns> public Result_Model <PageInfo> Get_PageInfo_Web(QueryCommon <LawInfoQuery_Web> query) { Result_Model <PageInfo> resPage = new Result_Model <PageInfo>() { Model = new PageInfo(), Msg = new Result_Msg() { IsSuccess = true } }; try { var linqList = from listMeet in context.LawInfo select listMeet; if (query.ParamInfo.LanguageType != 0) { //语言类型(0:所有 ;1:中文;2:英文;) linqList = linqList.Where(x => x.LanguageType == query.ParamInfo.LanguageType); } if (query.ParamInfo.Title != null && query.ParamInfo.Title != string.Empty) { linqList = linqList.Where(x => x.Title.IndexOf(query.ParamInfo.Title) != -1); } if (query.ParamInfo.StartTime != null && query.ParamInfo.EndTime != null) { linqList = linqList.Where(x => x.CreateTime >= query.ParamInfo.StartTime && x.CreateTime <= query.ParamInfo.EndTime); } if (!string.IsNullOrWhiteSpace(query.ParamInfo.LawsInfo)) { linqList = linqList.Where(x => x.LawsInfo.Contains(query.ParamInfo.LawsInfo)); } int total = linqList.Count(); resPage.Model.CurrentPage = query.PageInfo.CurrentPage; resPage.Model.PageSize = query.PageInfo.PageSize; resPage.Model.Total = total; resPage.Model.PageCount = Convert.ToInt32(Math.Ceiling((double)total / (double)query.PageInfo.PageSize)); } catch (Exception ex) { resPage.Msg = new Result_Msg() { IsSuccess = false, Message = ex.Message }; } return(resPage); }
public string Get_PageInfo(QueryCommon <TechnicalInfoQuery_Web> query) { if (query.ParamInfo.Type > 0) { query.ParamInfo.EndTime = DateTime.Now.Date; } //else //{ // query.ParamInfo.StartTime = query.ParamInfo.StartTime.Date; // query.ParamInfo.EndTime = query.ParamInfo.EndTime.Date.AddDays(1); //} Result_Model <PageInfo> resModel = new Result_Model <PageInfo>(); ITechnicalInfoService jobsService = ServiceHelper.Create <ITechnicalInfoService>(); resModel = jobsService.Get_PageInfo_Web(query); return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel)); }
public IResult GetEntities(string type, string dataPropertyNames) { var returnresult = new Result_Model(); Search s = new Search(); s.SearchConditions.Add(SearchCondition.HasCategoryByName(PropertyCategoryNames.Geometry)); s.SearchConditions.Add(SearchCondition.HasPropertyByName(PropertyCategoryNames.Item, DataPropertyNames.ItemHidden).EqualValue(VariantData.FromBoolean(false))); s.SearchConditions.Add(SearchCondition.HasPropertyByName(PropertyCategoryNames.Item, dataPropertyNames).EqualValue(VariantData.FromDisplayString(type))); s.Selection.SelectAll(); s.Locations = SearchLocations.DescendantsAndSelf; var result = s.FindAll(Application.ActiveDocument, false); result.ToList().ForEach(model => returnresult.Payload.Add(model)); return(returnresult); }
public Result_Model <IWantToBuy_Orders> GetOrders_ByPurchaseNum(long purchaseNum) { DateTime now = DateTime.Now; Result_Model <IWantToBuy_Orders> res1 = iWantToBuyService.GetOrders_ByPurchaseNum(purchaseNum); if (res1.Msg.IsSuccess) { //if (res1.Model.PayStatus==1) //{ // return 4; //} //else //{ //} } return(res1); }
public string GetObjectById_Supply_DeliverGoods(QueryCommon <IWantToBuyQuery> query) { Result_Model <Result_IWantToBuy_Orders> res = new Result_Model <Result_IWantToBuy_Orders>() { Msg = new Result_Msg() { IsSuccess = true }, Model = new Result_IWantToBuy_Orders() }; var listHash = hashSet.Get_DictionariesList(); Result_Model <IWantToSupply> model1 = iWantToBuyService.GetObjectById_Supply(query.ParamInfo.Id); Result_Model <IWantToBuy_Orders> model = iWantToBuyService.GetObjectById_Web_Supply_DeliverGoods(model1.Model.Id); if (model.Msg.IsSuccess) { res.Model = new Result_IWantToBuy_Orders() { Id = model.Model.Id, ProductName = model.Model.ProductName, PurchaseNum = model.Model.PurchaseNum.ToString(), UnitPrice = model.Model.UnitPrice, Quantity = model.Model.Quantity, TotalPrice = model.Model.TotalPrice, Unit = model.Model.Unit, Status = model.Model.Status, CreateDate = model.Model.CreateDate.ToString("yyyy-MM-dd hh:mm"), PayDate = model.Model.PayDate.ToString("yyyy-MM-dd hh:mm"), IWantToSupplyID = model.Model.IWantToSupplyID, LogisticsNum = model.Model.LogisticsNum, LogisticsType = model.Model.LogisticsType, LogisticsDes = model.Model.LogisticsDes }; } else { res.Msg = model.Msg; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
/// <summary> /// 根据年月、订单类型,查找实时交易统计数据 /// </summary> /// <param name="yaarMonth"></param> /// <param name="curveType"></param> /// <returns></returns> public Result_Model <TransactionRecord> GetTransactionRecordByYearMonthAndCurveType(int curveType, DateTime yearMonth) { string curveTypeName = curveType == 1 ? "代理采购" : "定制合成"; Result_Model <TransactionRecord> res = new Result_Model <TransactionRecord>() { Msg = new Result_Msg() }; res.Model = (from p in context.TransactionRecord where p.CurveType == curveType && p.YearMonth == yearMonth select p).FirstOrDefault(); if (res.Model != null) { res.Msg.IsSuccess = true; res.Msg.Message = "交易类型为:" + curveTypeName + ",时间为:" + yearMonth.ToString() + " 的记录已存在。"; } else { res.Msg.IsSuccess = false; } return(res); }
/// <summary> /// 根据IWantToBuyId , supplierId 获取当前登录供应商的竞价信息 /// </summary> /// <param name="iWantToBuy"></param> /// <param name="supplierId"></param> /// <returns></returns> public Result_Model <Result_IWantToSupply> GetObjectById_Web_Supply(long iWantToBuy, long supplierId) { var listHash = hashSet.Get_DictionariesList(); Result_Model <Result_IWantToSupply> res = new Result_Model <Result_IWantToSupply>() { Msg = new Result_Msg() { }, Model = new Result_IWantToSupply() }; Result_Model <IWantToSupply> model = iWantToBuyService.GetObjectById_Web_Supply(iWantToBuy, supplierId); if (model.Msg.IsSuccess) { res.Model = new Result_IWantToSupply() { Id = model.Model.Id, IWantToBuyID = model.Model.IWantToBuyID, PurchaseNum = model.Model.PurchaseNum.ToString(), UnitPrice = model.Model.UnitPrice, Quantity = model.Model.Quantity, TotalPrice = model.Model.TotalPrice, Unit = model.Model.Unit, Status = model.Model.Status, SupplierID = model.Model.SupplierID, CreateDate = model.Model.CreateDate.ToString("yyyy-MM-dd hh:mm"), LatestDeliveryTime = model.Model.LatestDeliveryTime.ToString("yyyy-MM-dd hh:mm"), UpdateDate = model.Model.UpdateDate.ToString("yyyy-MM-dd hh:mm"), BidDate = model.Model.BidDate.ToString("yyyy-MM-dd hh:mm"), TypeOfCurrency = listHash.Where(y => y.DictionaryTypeId == 1 && y.DValue == model.Model.TypeOfCurrency.ToString()).FirstOrDefault().Remarks, }; } else { res.Msg = model.Msg; } return(res); }
public string GetObjectById_Supply(QueryCommon <IWantToSupplyQuery> query) { Result_Model <Result_IWantToSupply> res = new Result_Model <Result_IWantToSupply>() { Msg = new Result_Msg() { IsSuccess = true }, Model = new Result_IWantToSupply() }; var listHash = hashSet.Get_DictionariesList(); Result_Model <IWantToSupply> model = supplyService.GetObjectById_Web_Supply(query.ParamInfo.IWantToBuyID, base.CurrentUser.Id); if (model.Msg.IsSuccess) { res.Model = new Result_IWantToSupply() { Id = model.Model.Id, IWantToBuyID = model.Model.IWantToBuyID, PurchaseNum = model.Model.PurchaseNum.ToString(), UnitPrice = model.Model.UnitPrice, Quantity = model.Model.Quantity, TotalPrice = model.Model.TotalPrice, Unit = model.Model.Unit, Status = model.Model.Status, SupplierID = model.Model.SupplierID, CreateDate = model.Model.CreateDate.ToString("yyyy-MM-dd hh:mm"), LatestDeliveryTime = model.Model.LatestDeliveryTime.ToString("yyyy-MM-dd hh:mm"), UpdateDate = model.Model.UpdateDate.ToString("yyyy-MM-dd hh:mm"), BidDate = model.Model.BidDate.ToString("yyyy-MM-dd hh:mm"), TypeOfCurrency = listHash.Where(y => y.DictionaryTypeId == 1 && y.DValue == model.Model.TypeOfCurrency.ToString()).FirstOrDefault().Remarks, }; } else { res.Msg = model.Msg; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }