private void GetUserResumeInfo() { BLL.JobBLL bll = new BLL.JobBLL(); string ResumeId = ReStr("ResumeId"); DataSet ds = bll.GetResumeInfoByResumeId(ResumeId); string resumeJson = JsonHelper.ToJsonNo1(ds.Tables[0]); string resumeVsJobType = JsonHelper.ToJson(ds.Tables[1]); string Education = JsonHelper.ToJson(ds.Tables[2]); ReDict.Add("resumeJson", resumeJson); //简历主体 ReDict.Add("resumeVsJobTypeList", resumeVsJobType); //意向职位列表 ReDict.Add("EducationList", Education); //教育工作经历列表 ReTrue(); }
private void GetAdInfo() { string _id = ReStr("_id", ""); string Client = ReStr("Client", ""); string WinName = ReStr("WinName", ""); string FrameName = ReStr("FrameName", ""); string Loction = ReStr("Loction", ""); BsonDocument b = new BsonDocument(); if (_id != "") { b["_id"] = MongoDB.Bson.ObjectId.Parse(_id); } if (Client != "") { b["Client"] = Client; } if (WinName != "") { b["WinName"] = WinName; } if (FrameName != "") { b["FrameName"] = FrameName; } if (Loction != "") { b["Loction"] = Loction; } JObject j = new JObject(); JArray ja = DAL.Mongo.Find(b, "Ad"); if (ja.Count > 0) { j = (JObject)ja[0]; } ReDict.Add("info", j); ReTrue(); }
private void GetAdList() { BsonDocument b = new BsonDocument(); b = ReBson("b", new BsonDocument()); JArray ja = DAL.Mongo.Find(b, "Ad", "uzor"); ReDict.Add("list", ja); ReTrue(); }
private void GetHouse() { string HouseId = ReStr("HouseId"); BLL.HouseBLL bll = new BLL.HouseBLL(); DataSet ds = bll.GetHouseByHouseId(HouseId); DataTable dt = ds.Tables[0]; string HouseJson = JsonHelper.ToJsonNo1(dt); DataTable dtImg = ds.Tables[1]; string ImgJsonArray = JsonHelper.ToJson(dtImg); ReDict.Add("HouseJson", HouseJson); ReDict.Add("ImgJsonArray", ImgJsonArray); ReTrue(); }
private void GetQyWxPtInfo() { BLL.WxBLL wbll = new BLL.WxBLL(); decimal QyWxPtId = ReDecimal("QyWxPtId", 0); DataSet ds = wbll.GetQyWxPtInfo(QyWxPtId); DataTable dt = ds.Tables[0]; if (dt.Rows.Count == 0) { throw new Exception("企业微信号不存在!"); } ReDict.Add("QyWxPt", JsonHelper.ToJsonNo1(dt)); ReTrue(); }
private void GetQyWxPtGroupList() { StringBuilder s = new StringBuilder(); decimal QyWxPtId = ReDecimal("QyWxPtId", 0); if (QyWxPtId != 0) { s.Append(" QyWxPtId=" + QyWxPtId + " "); } DAL.QyWxPtGroupDAL dal = new DAL.QyWxPtGroupDAL(); DataSet ds = dal.GetList(s.ToString()); DataTable dt = ds.Tables[0]; ReDict.Add("list", JsonHelper.ToJson(dt)); ReTrue(); }
private void GetAboutInfo() { try { decimal AboutId = ReDecimal("AboutId"); BLL.AboutBLL bll = new BLL.AboutBLL(); DataTable dt = bll.GetAbout(AboutId); string json = Common.JsonHelper.ToJsonNo1(dt); ReDict.Add("info", json); ReTrue(); } catch (Exception ex) { ReThrow(ex); } }
private void GetWxPtInfo() { BLL.WxBLL bll = new BLL.WxBLL(); decimal WxPtId = ReDecimal("WxPtId", 0); if (WxPtId == 0) { throw new Exception("没传ID啊!"); } DataSet ds = bll.GetWxPtInfoData(WxPtId); string jr = JsonHelper.ToJson(ds); ReDict.Add("da", jr); ReTrue(); }
private void GetUserData() { BLL.UserBLL bll = new BLL.UserBLL(); try { DataTable dt = bll.GetUserData(ReStr("uid")).Tables[0]; string json = Common.JsonHelper.ToJsonNo1(dt); ReDict.Add("UserInfo", json); ReTrue(); } catch (Exception ex) { ReThrow(ex); } }
private void GetSendInfo() { decimal WxSendId = ReDecimal("WxSendId", 0); if (WxSendId == 0) { throw new Exception("WxSendId不能为空"); } BLL.WxBLL bll = new BLL.WxBLL(); DataSet ds = bll.GetWxSendInfo(WxSendId); DataTable dtSendInfo = ds.Tables[0]; DataTable dtKeyList = ds.Tables[1]; ReDict.Add("SendInfo", JsonHelper.ToJsonNo1(dtSendInfo)); ReDict.Add("KeyList", JsonHelper.ToJson(dtKeyList)); ReTrue(); }
private void GetMerData() { try { BLL.TownBLL bll = new BLL.TownBLL(); BLL.MerchantBLL bllMer = new BLL.MerchantBLL(); DataTable dt = bll.GetTownList(); string json = Common.JsonHelper.ToJson(dt); DataTable dtMerType = bllMer.GetMerTypeList(""); string jsonMerType = Common.JsonHelper.ToJson(dtMerType); ReDict.Add("TownList", json); //乡镇类别 ReDict.Add("jsonMerType", jsonMerType); //商家类别 ReTrue(); } catch (Exception ex) { ReThrow(ex); } }
private void BindSuCaiInfo() { decimal WxSuCaiInfoId = ReDecimal("WxSuCaiInfoId", 0); if (WxSuCaiInfoId == 0) { throw new Exception("没有确定WxSuCaiInfoId的值!"); } StringBuilder s = new StringBuilder(); s.Append(" select * from dbo.WxSuCaiInfo where WxSuCaiInfoId='" + WxSuCaiInfoId + "' "); s.Append(" select * from dbo.WxSuCaiDetailView where WxSuCaiInfoId='" + WxSuCaiInfoId + "' "); DataSet ds = DAL.DalComm.BackData(s.ToString()); ReDict.Add("Info", JsonHelper.ToJsonNo1(ds.Tables[0])); ReDict.Add("Detail", JsonHelper.ToJson(ds.Tables[1])); ReTrue(); }
private void GetQyWxPtAppList() //取得应用列表 { StringBuilder s = new StringBuilder(); decimal QyWxPtId = ReDecimal("QyWxPtId", 0); if (QyWxPtId != 0) { s.Append(" QyWxPtId=" + QyWxPtId + " "); } else { throw new Exception("必须明确一个企业微信平台!"); } DAL.QyWxPtAppDAL dal = new DAL.QyWxPtAppDAL(); DataSet ds = dal.GetList(" QyWxPtId='" + QyWxPtId + "' "); DataTable dt = ds.Tables[0]; ReDict.Add("list", JsonHelper.ToJson(dt)); ReTrue(); }
private void GetPaiSongCount() { StringBuilder s = new StringBuilder(); string BranchId = ReStr("BranchId", ""); DateTime dtm1 = ReTime("dtm1"); DateTime dtm2 = ReTime("dtm2"); s.Append(" SELECT PaiSongUserId, u.RealName, SUM(Amount) AS Amount ,COUNT(0) AS DingDanNum FROM dbo.DingDanView dd"); s.Append(" LEFT JOIN dbo.UserView u ON dd.PaiSongUserId=u.UserId "); s.Append(" WHERE Status>=110 AND BranchId='" + BranchId + "' and dd.CreateTime BETWEEN '" + dtm1 + "' and '" + dtm2 + "' GROUP BY PaiSongUserId ,u.RealName "); DataSet ds = DAL.DalComm.BackData(s.ToString()); DataTable dt = ds.Tables[0]; ReDict.Add("list", JsonHelper.ToJson(dt)); ReTrue(); }
private void GetProClass() { decimal MerId = ReDecimal("MerId", 0); DateTime dtm1 = ReTime("dtm1"); DateTime dtm2 = ReTime("dtm2"); decimal ParentProductClassId = ReDecimal("ParentProductClassId", 0); int CurrentPage = ReInt("CurrentPage", 1); string Order = ReStr("Order", " 销售金额 DESC "); int PageSize = ReInt("PageSize", 20); string BranchId = ReStr("BranchId", ""); if (BranchId == "") { throw new Exception("BranchId不能为空!"); } StringBuilder s = new StringBuilder(); s.Append(" SELECT ProductClassId ,"); s.Append(" ProductClassName ,"); s.Append(" ISNULL(( SELECT SUM(Quantity * Price) AS 类别销售额 "); s.Append(" FROM dbo.DingDanDetailView WITH ( NOLOCK ) "); s.Append(" WHERE Status >= 110 "); s.Append(" and BranchId='" + BranchId + "' "); s.Append(" AND EnTime BETWEEN '" + dtm1 + "' AND '" + dtm2 + "' "); s.Append(" AND ProClassId IN ( "); s.Append(" SELECT ProductClassId "); s.Append(" FROM [YYO2O].[dbo].[AllProClassId2](currentProClass.ProductClassId) ) "); s.Append(" ), 0) AS 类别销售额 "); s.Append(" FROM dbo.ProductClass currentProClass WITH ( NOLOCK ) "); s.Append(" WHERE MerchantId = " + MerId + " "); s.Append(" AND Invalid = 0 "); s.Append(" AND ParentProductClassId = " + ParentProductClassId + " "); s.Append(" ORDER BY 类别销售额 desc "); DataSet ds = DAL.DalComm.BackData(s.ToString()); DataTable dtProClass = ds.Tables[0]; ReDict.Add("jProClass", JsonHelper.ToJson(dtProClass)); ReTrue(); }
private void GetMyResumeInfo() { BLL.UserBLL ubll = new BLL.UserBLL(); string UserId = ubll.CurrentUserId(); BLL.JobBLL bll = new BLL.JobBLL(); DataSet ds = bll.GetResumeListByUserId(UserId); string resumeJson = JsonHelper.ToJsonNo1(ds.Tables[0]); string resumeVsJobType = JsonHelper.ToJson(ds.Tables[1]); string Education = JsonHelper.ToJson(ds.Tables[2]); ReDict.Add("resumeJson", resumeJson); //简历主体 ReDict.Add("resumeVsJobTypeList", resumeVsJobType); //意向职位列表 ReDict.Add("EducationList", Education); //教育工作经历列表 ReTrue(); }
private void CountMsg() { string DeviceId = ReStr("DeviceId", ""); if (DeviceId == "") { throw new Exception("编号不能为空!"); } BLL.MsgBLL bll = new BLL.MsgBLL(); DataSet ds = bll.CountMsg(DeviceId); DataTable dt = ds.Tables[0]; ReDict.Add("Count", JsonHelper.ToJsonNo1(dt)); ReDict.Add("ClassCount", JsonHelper.ToJson(ds.Tables[1])); ReTrue(); }
private void GetXiaoShou() { decimal MerId = ReDecimal("MerId", 0); DateTime dtm1 = ReTime("dtm1"); DateTime dtm2 = ReTime("dtm2"); string BranchId = ReStr("BranchId", ""); if (BranchId == "") { throw new Exception("BranchId不能为空!"); } StringBuilder s = new StringBuilder(); s.Append(@" SELECT SUM(PayAmount) AS 支付金额 , SUM(Amount) AS 订单总金额 , SUM(UseJiFen) AS 消耗积分 , COUNT(DingDanId) AS 订单数量 , CONVERT(VARCHAR(7), CreateTime, 126) AS 月份 FROM dbo.DingDanView WHERE Status >= 100"); s.Append(" and BranchId='" + BranchId + "' "); s.Append(" AND EnTime BETWEEN '" + dtm1 + "' AND '" + dtm2 + "' "); s.Append(" AND MerchantId='" + MerId + "' "); s.Append(" GROUP BY CONVERT(VARCHAR(7), CreateTime, 126) "); DataSet ds = DAL.DalComm.BackData(s.ToString()); DataTable dtAmount = ds.Tables[0]; ReDict.Add("jAmount", JsonHelper.ToJson(dtAmount)); ReTrue(); }
private void GetJiFen() { decimal MerId = ReDecimal("MerId", 0); DateTime dtm1 = ReTime("dtm1"); DateTime dtm2 = ReTime("dtm2"); string BranchId = ReStr("BranchId", ""); if (BranchId == "") { throw new Exception("BranchId不能为空!"); } StringBuilder s = new StringBuilder(); s.Append(@" SELECT SUM(JiFenChangeNum) as 增加积分 , CONVERT(VARCHAR(7), CreateTime, 126) AS 月份 FROM dbo.JiFenChangeView with(nolock) "); //统计增加积分 s.Append(" WHERE CreateTime BETWEEN '" + dtm1 + "' AND '" + dtm2 + "' "); s.Append(" AND MerId='" + MerId + "' "); s.Append(" AND JiFenChangeNum>0 "); s.Append(" GROUP BY CONVERT(VARCHAR(7), CreateTime, 126)"); s.Append(@" SELECT SUM(JiFenChangeNum)*-1 as 减少积分, CONVERT(VARCHAR(7), CreateTime, 126) AS 月份 FROM dbo.JiFenChangeView with(nolock) "); //统计减少积分 s.Append(" WHERE CreateTime BETWEEN '" + dtm1 + "' AND '" + dtm2 + "' "); s.Append(" AND MerId='" + MerId + "' "); s.Append(" AND JiFenChangeNum<0 "); s.Append(" GROUP BY CONVERT(VARCHAR(7), CreateTime, 126)"); DataSet ds = DAL.DalComm.BackData(s.ToString()); DataTable dtAdd = ds.Tables[0]; DataTable dtCut = ds.Tables[1]; ReDict.Add("jAdd", JsonHelper.ToJson(dtAdd)); ReDict.Add("jCut", JsonHelper.ToJson(dtCut)); ReTrue(); }
private void SaveSendInfo() { #region 事务开启 TransactionOptions transactionOption = new TransactionOptions(); transactionOption.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOption)) { #endregion Model.WxSendInfoModel model = new WxSendInfoModel(); BLL.WxBLL bll = new BLL.WxBLL(); model.WxSendId = ReDecimal("WxSendId", 0); if (model.WxSendId == 0) { model.WxPtId = ReDecimal("WxPtId"); } else { //如果是修改, 选取出原来的数据 model = bll.GetWxSendModel(model.WxSendId); } model.WxSendTitle = ReStr("WxSendTitle"); model.WxSendType = ReStr("WxSendType"); model.WxSendClassId = ReInt("WxSendClassId"); model.Memo = ReStr("Memo"); model.FmImgId = ReStr("FmImgId"); model.WxSuCaiId = ReDecimal("WxSuCaiId", 0); model.SendContent = ReStrDeCode("SendContent"); bll.SaveSendInfo(model); DataTable dtKeys = ReTable("KeysAreray"); if (dtKeys.Rows.Count == 0) { throw new Exception("没有添加激发时间, 这个回应没有触发将没有意义!"); } DAL.WxKeyDAL keyDal = new DAL.WxKeyDAL(); keyDal.DeleteList(" WxSendId='" + model.WxSendId + "' "); //首先删除所有的key关联关系 foreach (DataRow drKeys in dtKeys.Rows) { if (model.WxSendId == 0) { throw new Exception("在执行插入之后,WxSendId不能为0!"); } Model.WxKeyModel KeyModel = new WxKeyModel(); KeyModel.WxSendId = model.WxSendId; KeyModel.KeyTitle = drKeys["KeyTitle"].ToString(); KeyModel.KeyTypeId = drKeys["KeyTypeId"].ToString(); KeyModel.KeyTypeDetailId = drKeys["KeyTypeDetailId"].ToString(); keyDal.Add(KeyModel); //逐个添加新的关联关系 } ReDict.Add("WxSendId", model.WxSendId); #region 事务关闭 transactionScope.Complete(); } #endregion ReTrue(); }
private void GetMyExtCount() { decimal MemberId = ReDecimal("MemberId", 0); var SetpNum = 3; StringBuilder s = new StringBuilder(); for (int i = SetpNum - 1; i >= 0; i--) { DateTime d = DateTime.Now.AddMonths(-i); DateTime d2 = DateTime.Parse("" + d.Year + "-" + d.Month + "-01 00:00:00"); DateTime d3 = d2.AddMonths(1); s.Append(" SELECT Isnull( SUM(JiFenChangeNum),0) AS SumJiFenChangeNum," + d2.Month + " AS MM "); s.Append(" FROM dbo.JiFenChange "); s.Append(" where MemberId=" + MemberId + " "); s.Append(" and CreateTime >='" + d2 + "' and CreateTime<='" + d3 + "' "); s.Append(" and JifenChangeTypeId=50 "); if (i != 0) { s.Append(" UNION ALL "); } } // s.Append(" ORDER BY MONTH(CreateTime) "); DataSet ds = DAL.DalComm.BackData(s.ToString()); DataTable dt = ds.Tables[0]; decimal Max = 0; decimal Step = 0; foreach (DataRow dr in dt.Rows) { decimal SumJiFenChangeNum = decimal.Parse(dr["SumJiFenChangeNum"].ToString()); if (Max == 0) { Max = SumJiFenChangeNum; } else { if (Max < SumJiFenChangeNum) { Max = SumJiFenChangeNum; } } } if (Max < 3) { Step = 1; } else { Step = Math.Ceiling(Max / 3); } Max = Max + Step; ReDict.Add("list", JsonHelper.ToJson(dt)); ReDict2.Add("Max", Max.ToString()); ReDict2.Add("Step", Step.ToString()); ReTrue(); }
private void SendPeiHuoRemind() //配货人员提醒 { BLL.WxBLL wbll = new BLL.WxBLL(); string DingDanId = ReStr("DingDanId", ""); DataTable dtUser = ReTable("UserList"); string SendMemo = ReStr("SendMemo", ""); decimal QyWxPtAppId = ReDecimal("QyWxPtAppId", 0); StringBuilder w = new StringBuilder(); StringBuilder s = new StringBuilder(); List <string> ToUserList = new List <string>(); #region 事务开启 TransactionOptions transactionOption = new TransactionOptions(); transactionOption.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOption)) { #endregion BLL.MerchantBLL mbll = new BLL.MerchantBLL(); mbll.ShenHeDingdan(DingDanId, 1, "通过审核"); s.Append("SELECT * FROM dbo.DingDanDetailView WITH(NOLOCK) WHERE DingDanId='" + DingDanId + "' ORDER BY DingDanDetailTypeId "); s.Append(" SELECT * FROM dbo.DingDanView WITH(NOLOCK) WHERE DingDanId='" + DingDanId + "' "); DataSet ds = DAL.DalComm.BackData(s.ToString()); DataTable dtDetail = ds.Tables[0]; DataTable dtInfo = ds.Tables[1]; if (dtInfo.Rows.Count != 1) { throw new Exception("这是个什么订单?"); } DataRow drInfo = dtInfo.Rows[0]; decimal MerId = decimal.Parse(drInfo["MerchantId"].ToString()); decimal amount = decimal.Parse(drInfo["Amount"].ToString()); DateTime PeiSongTime1 = DateTime.Parse(drInfo["PeiSongTime1"].ToString()); DateTime PeiSongTime2 = DateTime.Parse(drInfo["PeiSongTime2"].ToString()); amount = Math.Round(amount, 2); w.Append("编号:\n " + DingDanId + " \n"); if (SendMemo.Trim() != "") { w.Append("调度备注:" + SendMemo + " \n"); } w.Append("总金额:" + amount + " \n"); w.Append("物流:" + PeiSongTime1.ToString("yy年MM月dd日 hh时mm分") + "-" + PeiSongTime2.ToString("yy年MM月dd日 hh时mm分") + ""); w.Append("(" + drInfo["PeiSongTypeName"] + ") \n"); var url = "http://www.sjdfcs.com/App/AppDingDanList_PeiHuo.aspx?DingDanId=" + DingDanId + ""; w.Append("<a href='" + wbll.QyWxUrl(url, MerId) + "' >查看详细</a> \n"); if (dtDetail.Rows.Count == 0) { throw new Exception("这个订单[" + DingDanId + "]没有明细吗?"); } s.Clear(); foreach (DataRow drUser in dtUser.Rows) { ToUserList.Add(drUser["QyWxPtUserId"].ToString()); s.Append(" UPDATE dbo.DingDanInfo SET PeiHuoUserId='" + drUser["UserId"].ToString() + "',Status=20 WHERE DingDanId='" + DingDanId + "' "); } DAL.DalComm.ExReInt(s.ToString()); #region 暂时无用 //foreach (DataRow drDetail in dtDetail.Rows) //{ // decimal Price = decimal.Parse(drDetail["Price"].ToString()); // Price = Math.Round(Price, 2); // decimal Quantity = decimal.Parse(drDetail["Quantity"].ToString()); // Quantity = Math.Round(Quantity); // string 规格 = drDetail["规格"].ToString().Trim(); // int DingDanDetailTypeId = int.Parse(drDetail["DingDanDetailTypeId"].ToString()); // if (DingDanDetailTypeId == 10) // { // w.Append("配送费:" + Price + "元 \n"); // } // else // { // //如果是产品 // w.Append("[" + drDetail["产品编号"] + "]"); // w.Append("" + drDetail["产品名称"] + ","); // if (规格 != "") // { // w.Append("规格:" + drDetail["规格"] + ","); // } // w.Append("单价:" + Price + "元,"); // w.Append("数量:" + Quantity + "" + drDetail["计量单位"] + ""); // w.Append(" \n "); // } //} #endregion #region 事务关闭 transactionScope.Complete(); } #endregion string jsonStr = wbll.SendQyTextMsg(ToUserList, w.ToString(), QyWxPtAppId); ReDict.Add("ReJson", jsonStr); ReTrue(); }