public ActionResult GetToMakeMoneyPageList(PayNoticeQuery query)
 {
     IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve<IFinanceFacadeAPIService>();
     query.JournalID = CurAuthor.JournalID;
     query.AuthorID = CurAuthor.AuthorID;
     query.Status = 10;
     query.CurrentPage = Convert.ToInt32(Request.Params["page"]);
     query.PageSize = Convert.ToInt32(Request.Params["pagesize"]);
     Pager<PayNoticeEntity> pager = service.GetPayNoticePageList(query);
     return Json(new { Rows = pager.ItemList, Total = pager.TotalRecords });
 }
Example #2
0
        /// <summary>
        /// 批量通知交费单
        /// </summary>
        /// <param name="NoticeID"></param>
        /// <returns></returns>
        public ActionResult BatchPayNotice()
        {
            string str = Request.QueryString["Array"];
            IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve<IFinanceFacadeAPIService>();
            IList<PayNoticeEntity> list = new List<PayNoticeEntity>();
            if (!string.IsNullOrEmpty(str))
            {
                string[] paras = str.Split('|');
                if (paras != null && paras.Length > 0)
                {
                    foreach (var item in paras)
                    {
                        if (!string.IsNullOrEmpty(item))
                        {
                            string[] paras1 = item.Split(',');
                            if (paras1 != null && paras1.Length > 0)
                            {
                                PayNoticeQuery query = new PayNoticeQuery();
                                query.JournalID = JournalID;
                                query.NoticeID = int.Parse(paras1[1]);
                                query.PayType = byte.Parse(paras1[0]);
                                query.CID = int.Parse(paras1[2]);
                                query.AuthorID = int.Parse(paras1[3]);
                                query.IsBatch = true;
                                PayNoticeEntity model = service.GetPayNoticeModel(query);
                                if (model != null)
                                {
                                    model.AuthorID = int.Parse(paras1[3]);
                                    model.AuthorName = query.AuthorName;
                                    model.CTitle = query.Title;
                                    model.Mobile = query.Mobile;
                                    model.LoginName = query.LoginName;
                                    if (!string.IsNullOrEmpty(model.Body))
                                    {
                                        ViewBag.body = model.Body;
                                    }
                                    list.Add(model);
                                }

                                ViewBag.payType = byte.Parse(paras1[0]);
                            }

                        }
                    }
                }
            }
            TempData["list"] = list;

            return View();
        }
 /// <summary>
 /// 获取缴费通知数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public IList<PayNoticeEntity> GetPayNoticeList(PayNoticeQuery query)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     IList<PayNoticeEntity> list = clientHelper.Post<IList<PayNoticeEntity>, PayNoticeQuery>(GetAPIUrl(APIConstant.PAYNOTICE_GETLIST), query);
     return list;
 }
Example #4
0
 /// <summary>
 /// 保存稿件费用信息
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public ExecResult Save(PayNoticeEntity model)
 {
     ExecResult execResult = new ExecResult();
     bool result = false;
     model.Title = model.Title.TextFilter();
     model.Body = model.Body.HtmlFilter();
     if (model.NoticeID == 0)
     {
         PayNoticeQuery query = new PayNoticeQuery();
         query.JournalID = model.JournalID;
         query.CID = model.CID;
         query.PayType = model.PayType;
         if (PayNoticeBusProvider.PayNotinceIsExists(query))
         {
             execResult.result = EnumJsonResult.failure.ToString();
             execResult.msg = "该缴费通知已经存在!";
             return execResult;
         }
         result = AddPayNotice(model);
         if (result)
         {
             execResult.result = EnumJsonResult.success.ToString();
             execResult.msg = "新增缴费通知成功!";
         }
         else
         {
             execResult.result = EnumJsonResult.failure.ToString();
             execResult.msg = "新增缴费通知失败!";
         }
     }
     else
     {
         result = UpdatePayNotice(model);
         if (result)
         {
             execResult.result = EnumJsonResult.success.ToString();
             execResult.msg = "修改缴费通知成功!";
         }
         else
         {
             execResult.result = EnumJsonResult.failure.ToString();
             execResult.msg = "修改缴费通知失败!";
         }
     }
     return execResult;
 }
Example #5
0
 /// <summary>
 /// 改变缴费通知状态
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public ExecResult ChangeStatus(PayNoticeQuery query)
 {
     ExecResult result = new ExecResult();
     bool flag = PayNoticeBusProvider.ChangeStatus(query);
     if (flag)
     {
         result.result = EnumJsonResult.success.ToString();
         result.msg = "更新缴费通知状态成功!";
     }
     else
     {
         result.result = EnumJsonResult.failure.ToString();
         result.msg = "更新缴费通知状态失败!";
     }
     return result;
 }
Example #6
0
 /// <summary>
 /// 通知单
 /// </summary>
 /// <param name="NoticeID"></param>
 /// <returns></returns>
 public ActionResult PayNotice(Byte PayType, Int64 NoticeID, Int64 CID)
 {
     PayNoticeQuery query = new PayNoticeQuery();
     query.JournalID = JournalID;
     query.NoticeID = NoticeID;
     query.PayType = PayType;
     query.CID = CID;
     IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve<IFinanceFacadeAPIService>();
     PayNoticeEntity model = service.GetPayNoticeModel(query);
     return View(model);
 }
 /// <summary>
 /// 保存稿件费用信息
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public ExecResult Save(FinanceContributeEntity model)
 {
     ExecResult execResult = new ExecResult();
     bool result = false;
     model.RemitBillNo = model.RemitBillNo.TextFilter();
     model.InvoiceNo = model.InvoiceNo.TextFilter();
     model.PostNo = model.PostNo.TextFilter();
     model.Note = model.Note.TextFilter();
     if (model.IsSystem)
     {
         model.InComeDate = DateTime.Now;
         model.Status = 1;
     }
     if (model.PKID == 0)
     {
         FinanceContributeQuery fQuery = new FinanceContributeQuery();
         fQuery.JournalID = model.JournalID;
         fQuery.CID = model.CID;
         fQuery.FeeType = model.FeeType;
         if (FinanceContributeBusProvider.FinanceContributeIsExists(fQuery))
         {
             execResult.result = EnumJsonResult.failure.ToString();
             execResult.msg = "该费用已经存在!";
             return execResult;
         }
         result = AddFinanceContribute(model);
         if (result)
         {
             execResult.result = EnumJsonResult.success.ToString();
             execResult.msg = "新增稿件费用成功!";
         }
         else
         {
             execResult.result = EnumJsonResult.failure.ToString();
             execResult.msg = "新增稿件费用失败!";
         }
     }
     else
     {
         result = UpdateFinanceContribute(model);
         if (result)
         {
             execResult.result = EnumJsonResult.success.ToString();
             execResult.msg = "修改稿件费用成功!";
         }
         else
         {
             execResult.result = EnumJsonResult.failure.ToString();
             execResult.msg = "修改稿件费用失败!";
         }
     }
     if (result)
     {
         //更新缴费通知记录
         if (model.NoticeID > 0)
         {
             PayNoticeQuery query = new PayNoticeQuery();
             query.NoticeID = model.NoticeID;
             query.Status = (Byte)(model.IsSystem ? 1 : 2);
             PayNoticeBusiness business = new PayNoticeBusiness();
             business.ChangeStatus(query);
         }
     }
     return execResult;
 }
 public PayNoticeEntity GetModel(PayNoticeQuery query)
 {
     IPayNoticeService service = ServiceContainer.Instance.Container.Resolve<IPayNoticeService>();
     PayNoticeEntity model = service.GetPayNotice(query.NoticeID);
     return model;
 }
Example #9
0
 /// <summary>
 /// 改变缴费通知状态
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public bool ChangeStatus(PayNoticeQuery query)
 {
     return PayNoticeDataAccess.Instance.ChangeStatus(query);
 }
Example #10
0
 /// <summary>
 /// 缴费通知是否存在
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public bool PayNotinceIsExists(PayNoticeQuery query)
 {
     return PayNoticeDataAccess.Instance.PayNotinceIsExists(query);
 }
Example #11
0
 /// <summary>
 /// 分页获取符合查询条件的数据
 /// </summary>
 /// <param name="payNoticeQuery">PayNoticeQuery查询实体对象</param>
 /// <returns>Pager<PayNoticeEntity></returns>
 public Pager<PayNoticeEntity> GetPayNoticePageList(PayNoticeQuery payNoticeQuery)
 {
     return PayNoticeDataAccess.Instance.GetPayNoticePageList(payNoticeQuery);
 }
 /// <summary>
 /// 更新缴费通知状态
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public ExecResult ChangePayNoticeStatus(PayNoticeQuery query)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     ExecResult result = clientHelper.Post<ExecResult, PayNoticeQuery>(GetAPIUrl(APIConstant.PAYNOTICE_CHANGESTATUS), query);
     return result;
 }
 /// <summary>
 /// 获取缴费通知分页数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public Pager<PayNoticeEntity> GetPayNoticePageList(PayNoticeQuery query)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     Pager<PayNoticeEntity> pager = clientHelper.Post<Pager<PayNoticeEntity>, PayNoticeQuery>(GetAPIUrl(APIConstant.PAYNOTICE_GETPAGELIST), query);
     return pager;
 }
 /// <summary>
 /// 获取缴费通知实体
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public PayNoticeEntity GetPayNoticeModel(PayNoticeQuery query)
 {
     PayNoticeEntity model = null;
     try
     {
         if (query.NoticeID > 0)
         {
             HttpClientHelper clientHelper = new HttpClientHelper();
             model = clientHelper.Post<PayNoticeEntity, PayNoticeQuery>(GetAPIUrl(APIConstant.PAYNOTICE_GETMODEL), query);
         }
         if (model == null)
         {
             model = new PayNoticeEntity();
             model.JournalID = query.JournalID;
             model.PayType = query.PayType.Value;
             model.CID = query.CID.Value;
             SiteConfigFacadeAPIService service = new SiteConfigFacadeAPIService();
             MessageTemplateEntity temp = null;
             if (model.PayType == 1)
                 temp = service.GetMessageTemplate(model.JournalID, -3, 1);
             else if (model.PayType == 2)
                 temp = service.GetMessageTemplate(model.JournalID, -4, 1);
             if (temp != null)
                 model.Body = temp.TContent;
             if (!string.IsNullOrWhiteSpace(model.Body))
             {
                 AuthorPlatformFacadeAPIService authorService = new AuthorPlatformFacadeAPIService();
                 ContributionInfoQuery authorQuery = new ContributionInfoQuery();
                 authorQuery.JournalID = model.JournalID;
                 authorQuery.CID = model.CID;
                 authorQuery.IsAuxiliary = false;
                 var contribution = authorService.GetContributionInfoModel(authorQuery);
                 if (contribution != null)
                 {
                     IDictionary<string, string> dict = service.GetEmailVariable();
                     var user = new AuthorFacadeAPIService().GetAuthorInfo(new AuthorInfoQuery() { JournalID = model.JournalID, AuthorID = contribution.AuthorID });
                     if (!query.IsBatch)
                     {
                         dict["${接收人}$"] = user.RealName;
                         dict["${邮箱}$"] = user.LoginName;
                         dict["${手机}$"] = user.Mobile;
                         dict["${稿件编号}$"] = contribution.CNumber;
                         dict["${稿件标题}$"] = contribution.Title;
                         model.Body = service.GetEmailOrSmsContent(dict, service.GetSiteConfig(model.JournalID), model.Body);
                     }
                     else
                     {
                         query.AuthorName = user.RealName;
                         query.LoginName = user.LoginName;
                         query.Mobile = user.Mobile;
                         query.CNumber = contribution.CNumber;
                         query.Title = contribution.Title;
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogProvider.Instance.Error("获取通知单失败:" + ex.ToString());
         model = new PayNoticeEntity();
         model.JournalID = query.JournalID;
         model.PayType = query.PayType.Value;
         model.CID = query.CID.Value;
     }
     return model;
 }
 public ExecResult Del(PayNoticeQuery query)
 {
     IPayNoticeService service = ServiceContainer.Instance.Container.Resolve<IPayNoticeService>();
     return service.Del(query.NoticeIDs);
 }
 public IList<PayNoticeEntity> GetList(PayNoticeQuery query)
 {
     IPayNoticeService service = ServiceContainer.Instance.Container.Resolve<IPayNoticeService>();
     IList<PayNoticeEntity> list = service.GetPayNoticeList(query);
     return list;
 }
 /// <summary>
 /// 改变缴费通知状态
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public bool ChangeStatus(PayNoticeQuery query)
 {
     if (query.Status == null)
         return false;
     if (query.NoticeID == 0 && query.NoticeIDs.Length < 1)
         return false;
     string strSql = string.Format("UPDATE dbo.PayNotice set Status={0} WHERE NoticeID ", query.Status.Value);
     if (query.NoticeID > 0)
         strSql += " = " + query.NoticeID;
     else if (query.NoticeIDs.Length == 1)
         strSql += " = " + query.NoticeIDs[0];
     else
         strSql += string.Format(" in ({0})", string.Join(",", query.NoticeIDs));
     DbCommand cmd = db.GetSqlStringCommand(strSql);
     return db.ExecuteNonQuery(cmd) > 0;
 }
 public Pager<PayNoticeEntity> GetPageList(PayNoticeQuery query)
 {
     IPayNoticeService service = ServiceContainer.Instance.Container.Resolve<IPayNoticeService>();
     Pager<PayNoticeEntity> pager = service.GetPayNoticePageList(query);
     return pager;
 }
 public List<PayNoticeEntity> GetPayNoticeList(PayNoticeQuery query)
 {
     string strSql = @"SELECT a.*,b.Title as CTitle,b.CNumber FROM dbo.PayNotice a with(nolock)
                       INNER JOIN dbo.ContributionInfo b with(nolock) ON a.JournalID=b.JournalID and a.CID=b.CID";
     string where = PayNoticeQueryToSQLWhere(query);
     if (!string.IsNullOrWhiteSpace(where))
         strSql += " WHERE " + where;
     strSql += " ORDER BY " + PayNoticeQueryToSQLOrder(query);
     return db.GetList<PayNoticeEntity>(strSql, MakePayNoticeList);
 }
 public Pager<PayNoticeEntity> GetPayNoticePageList(PayNoticeQuery query)
 {
     string tableSql = @"SELECT {0} FROM dbo.PayNotice a with(nolock)
                       INNER JOIN dbo.ContributionInfo b with(nolock) ON a.JournalID=b.JournalID and a.CID=b.CID";
     string where = PayNoticeQueryToSQLWhere(query);
     if (!string.IsNullOrWhiteSpace(where))
         tableSql += " WHERE " + where;
     string strSql = string.Format(tableSql, "a.*,b.Title as CTitle,b.CNumber,ROW_NUMBER() OVER(ORDER BY " + PayNoticeQueryToSQLOrder(query) + ") AS ROW_ID")
         , sumStr = string.Format(tableSql, "RecordCount=COUNT(1)");
     return db.GetPageList<PayNoticeEntity>(strSql
         , sumStr
         , query.CurrentPage, query.PageSize
         , (dr, pager) =>
         {
             pager.TotalRecords = TypeParse.ToLong(dr["RecordCount"]);
         }
         , MakePayNoticeList);
 }
 /// <summary>
 /// 将查询实体转换为Order语句
 /// <param name="query">查询实体</param>
 /// <returns>获取Order语句,不包含Order</returns>
 /// </summary>
 public string PayNoticeQueryToSQLOrder(PayNoticeQuery query)
 {
     return " NoticeID DESC";
 }
 private PayNoticeEntity GetModel(Int64 NoticeID)
 {
     PayNoticeEntity model = null;
     if (NoticeID > 0)
     {
         PayNoticeQuery query = new PayNoticeQuery();
         query.JournalID = CurAuthor.JournalID;
         query.NoticeID = NoticeID;
         IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve<IFinanceFacadeAPIService>();
         model = service.GetPayNoticeModel(query);
     }
     if (model == null)
         model = new PayNoticeEntity();
     return model;
 }
 /// <summary>
 /// 将查询实体转换为Where语句
 /// <param name="query">查询实体</param>
 /// <returns>获取Where语句,不包含Where</returns>
 /// </summary>
 public string PayNoticeQueryToSQLWhere(PayNoticeQuery query)
 {
     StringBuilder strFilter = new StringBuilder(" a.JournalID=" + query.JournalID);
     if (query.AuthorID != null)
     {
         strFilter.Append(" AND b.AuthorID = ").Append(query.AuthorID.Value);
     }
     if (query.PayType != null)
     {
         strFilter.Append(" AND a.PayType = ").Append(query.PayType.Value);
     }
     if (query.Status != null)
     {
         if (query.Status == 10)
         {
             strFilter.Append(" AND a.Status in (0,2)");
         }
         else
         {
             strFilter.Append(" AND a.Status = ").Append(query.Status.Value);
         }
     }
     return strFilter.ToString();
 }
        public ActionResult YeepayCallback()
        {
            YeepayHelper myYeepay = new YeepayHelper();
            string message=string.Empty;
            FinancePayDetailEntity model = myYeepay.GetPayResult((msg) => { message = msg; });
            if (model!= null)
            {
                model.JournalID = CurAuthor.JournalID;
                model.AuthorID = CurAuthor.AuthorID;
                model.EBankType = 3;
                model.PayDate = DateTime.Now;
                IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve<IFinanceFacadeAPIService>();
                service.AddFinancePayDetail(model);

                //更新缴费通知记录
                if (model.NoticeID > 0)
                {
                    PayNoticeQuery query = new PayNoticeQuery();
                    query.NoticeID = model.NoticeID;
                    query.Status = 2;
                    service.ChangePayNoticeStatus(query);
                }
            }
            return Content(message);
        }
 /// <summary>
 /// 缴费通知是否存在
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public bool PayNotinceIsExists(PayNoticeQuery query)
 {
     string strSql = "SELECT 1 FROM dbo.PayNotice WHERE JournalID=@JournalID and CID=@CID and PayType=@PayType";
     DbCommand cmd = db.GetSqlStringCommand(strSql);
     db.AddInParameter(cmd, "@JournalID", DbType.Int64, query.JournalID);
     db.AddInParameter(cmd, "@CID", DbType.Int64, query.CID);
     db.AddInParameter(cmd, "@PayType", DbType.Byte, query.PayType);
     return db.ExecuteScalar(cmd).TryParse<Int32>() == 1;
 }
Example #26
0
 /// <summary>
 /// 分页获取符合查询条件的数据
 /// </summary>
 /// <param name="payNoticeQuery">PayNoticeQuery查询实体对象</param>
 /// <returns>Pager<PayNoticeEntity></returns>
 public Pager<PayNoticeEntity> GetPayNoticePageList(PayNoticeQuery payNoticeQuery)
 {
     return PayNoticeBusProvider.GetPayNoticePageList(payNoticeQuery);
 }
 public ExecResult ChangeStatus(PayNoticeQuery query)
 {
     IPayNoticeService service = ServiceContainer.Instance.Container.Resolve<IPayNoticeService>();
     ExecResult result = service.ChangeStatus(query);
     return result;
 }
Example #28
0
 /// <summary>
 /// 保存稿件费用信息
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public ExecResult BatchSave(IList<PayNoticeEntity> list)
 {
     ExecResult execResult = new ExecResult();
     bool result = false;
     var newList = (from data in list where data.NoticeID == 0 select data).ToList<PayNoticeEntity>();
     if (newList != null && newList.Count > 0)
     {
         IList<PayNoticeEntity> matchList = new List<PayNoticeEntity>();
         foreach (var model in newList)
         {
             model.Title = model.Title.TextFilter();
             model.Body = model.Body.HtmlFilter();
             PayNoticeQuery query = new PayNoticeQuery();
             query.JournalID = model.JournalID;
             query.CID = model.CID;
             query.PayType = model.PayType;
             if (!PayNoticeBusProvider.PayNotinceIsExists(query))
             {
                 matchList.Add(model);
             }
         }
         result = BatchAddPayNotice(matchList);
         if (result)
         {
             execResult.result = EnumJsonResult.success.ToString();
             execResult.msg = "新增缴费通知成功!";
         }
         else
         {
             execResult.result = EnumJsonResult.failure.ToString();
             execResult.msg = "新增缴费通知失败!";
         }
     }
     var oldList = (from data in list where data.NoticeID != 0 select data).ToList<PayNoticeEntity>();
     if (oldList != null && oldList.Count > 0)
     {
         result=BatchUpdatePayNotice(oldList);
         if (result)
         {
             execResult.result = EnumJsonResult.success.ToString();
             execResult.msg = "新增缴费通知成功!";
         }
         else
         {
             execResult.result = EnumJsonResult.failure.ToString();
             execResult.msg = "新增缴费通知失败!";
         }
     }
     return execResult;
 }
 /// <summary>
 /// 删除缴费通知
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public ExecResult DelPayNotice(PayNoticeQuery query)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     ExecResult result = clientHelper.Post<ExecResult, PayNoticeQuery>(GetAPIUrl(APIConstant.PAYNOTICE_DEL), query);
     return result;
 }