Example #1
0
        public List <PayNoticeEntity> MakePayNoticeList(IDataReader dr)
        {
            List <PayNoticeEntity> list = new List <PayNoticeEntity>();

            while (dr.Read())
            {
                PayNoticeEntity payNoticeEntity = new PayNoticeEntity();
                payNoticeEntity.NoticeID  = (Int64)dr["NoticeID"];
                payNoticeEntity.JournalID = (Int64)dr["JournalID"];
                payNoticeEntity.PayType   = (Byte)dr["PayType"];
                payNoticeEntity.CID       = (Int64)dr["CID"];
                payNoticeEntity.Amount    = (Decimal)dr["Amount"];
                payNoticeEntity.Title     = (String)dr["Title"];
                payNoticeEntity.Body      = (String)dr["Body"];
                payNoticeEntity.SendDate  = (DateTime)dr["SendDate"];
                payNoticeEntity.Status    = (Byte)dr["Status"];
                //if (dr.HasColumn("CNumber"))
                payNoticeEntity.CNumber = (String)dr["CNumber"];
                //if (dr.HasColumn("CTitle"))
                payNoticeEntity.CTitle = (String)dr["CTitle"];
                list.Add(payNoticeEntity);
            }
            dr.Close();
            return(list);
        }
Example #2
0
        public bool UpdatePayNotice(PayNoticeEntity payNoticeEntity)
        {
            bool          flag             = false;
            StringBuilder whereCommandText = new StringBuilder();

            whereCommandText.Append("  NoticeID=@NoticeID");
            StringBuilder sqlCommandText = new StringBuilder();

            sqlCommandText.Append(" PayType=@PayType");
            sqlCommandText.Append(", Amount=@Amount");
            sqlCommandText.Append(", Title=@Title");
            sqlCommandText.Append(", Body=@Body");
            sqlCommandText.Append(", Status=@Status");

            DbCommand cmd = db.GetSqlStringCommand(String.Format("UPDATE dbo.PayNotice SET {0} WHERE  {1}", sqlCommandText.ToString(), whereCommandText.ToString()));

            db.AddInParameter(cmd, "@NoticeID", DbType.Int64, payNoticeEntity.NoticeID);
            db.AddInParameter(cmd, "@PayType", DbType.Byte, payNoticeEntity.PayType);
            db.AddInParameter(cmd, "@Amount", DbType.Decimal, payNoticeEntity.Amount);
            db.AddInParameter(cmd, "@Title", DbType.AnsiString, payNoticeEntity.Title);
            db.AddInParameter(cmd, "@Body", DbType.AnsiString, payNoticeEntity.Body);
            db.AddInParameter(cmd, "@Status", DbType.Byte, payNoticeEntity.Status);
            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
            return(flag);
        }
Example #3
0
        public bool AddPayNotice(PayNoticeEntity payNoticeEntity)
        {
            bool          flag           = false;
            StringBuilder sqlCommandText = new StringBuilder();

            sqlCommandText.Append(" @JournalID");
            sqlCommandText.Append(", @PayType");
            sqlCommandText.Append(", @CID");
            sqlCommandText.Append(", @Amount");
            sqlCommandText.Append(", @Title");
            sqlCommandText.Append(", @Body");
            sqlCommandText.Append(", @Status");

            DbCommand cmd = db.GetSqlStringCommand(String.Format("INSERT INTO dbo.PayNotice ({0},SendDate) VALUES ({1},getdate())", sqlCommandText.ToString().Replace("@", ""), sqlCommandText.ToString()));

            db.AddInParameter(cmd, "@JournalID", DbType.Int64, payNoticeEntity.JournalID);
            db.AddInParameter(cmd, "@PayType", DbType.Byte, payNoticeEntity.PayType);
            db.AddInParameter(cmd, "@CID", DbType.Int64, payNoticeEntity.CID);
            db.AddInParameter(cmd, "@Amount", DbType.Decimal, payNoticeEntity.Amount);
            db.AddInParameter(cmd, "@Title", DbType.AnsiString, payNoticeEntity.Title);
            db.AddInParameter(cmd, "@Body", DbType.AnsiString, payNoticeEntity.Body);
            db.AddInParameter(cmd, "@Status", DbType.Byte, payNoticeEntity.Status);
            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
            return(flag);
        }
Example #4
0
        public PayNoticeEntity GetModel(PayNoticeQuery query)
        {
            IPayNoticeService service = ServiceContainer.Instance.Container.Resolve <IPayNoticeService>();
            PayNoticeEntity   model   = service.GetPayNotice(query.NoticeID);

            return(model);
        }
Example #5
0
        /// <summary>
        /// 获取通知缴费金额
        /// </summary>
        /// <param name="PayType"></param>
        /// <param name="NoticeID"></param>
        /// <param name="CID"></param>
        /// <returns></returns>
        public ActionResult GetPayNoticeAmount(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(Json(new { Amount = model.Amount }));
        }
Example #6
0
        public List <PayNoticeEntity> MakePayNoticeList(DataTable dt)
        {
            List <PayNoticeEntity> list = new List <PayNoticeEntity>();

            if (dt != null)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    PayNoticeEntity payNoticeEntity = MakePayNotice(dt.Rows[i]);
                    list.Add(payNoticeEntity);
                }
            }
            return(list);
        }
Example #7
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());
        }
Example #8
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 #9
0
        public ActionResult GoPay(PayNoticeEntity model, string productTable = "ContributionInfo")
        {
            SiteConfigEntity config = GetSiteConfig();

            if (config == null || config.EBankType != 3)
            {
                return(Json(new { result = EnumJsonResult.failure.ToString(), msg = "本网暂未开通网银支付!请通过邮局汇款方式邮寄给我们,汇款地址请查看交费通知单,谢谢!" }));
            }

            //商户扩展信息包含4项信息用英文逗号分隔如:交费类型,产品表名,产品表主键字段值,产品描述
            string strKzInfo = model.PayType.ToString() + "," + productTable + "," + model.CNumber + ",用户:" + CurAuthor.LoginName + ",支付编号" + model.CNumber + model.PayTypeName + "," + model.NoticeID;

            string url = new YeepayHelper(config.EBankCode, config.EBankEncryKey)
                         .CreateBuyUrl(model.Amount.ToString(), model.CNumber, model.PayTypeName, model.CTitle, "http://" + Request.Url.Authority.ToString() + "/AuthorFinance/YeepayCallback/", strKzInfo);

            return(Json(new { result = EnumJsonResult.success.ToString(), url = url }));
        }
Example #10
0
        public PayNoticeEntity GetPayNotice(Int64 noticeID)
        {
            PayNoticeEntity payNoticeEntity = null;
            StringBuilder   sqlCommandText  = new StringBuilder();

            sqlCommandText.Append("SELECT top 1 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");
            sqlCommandText.Append(" WHERE  a.NoticeID=@NoticeID");

            DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString());

            db.AddInParameter(cmd, "@NoticeID", DbType.Int64, noticeID);

            using (IDataReader dr = db.ExecuteReader(cmd))
            {
                payNoticeEntity = MakePayNotice(dr);
            }
            return(payNoticeEntity);
        }
Example #11
0
        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);
        }
Example #12
0
        public PayNoticeEntity MakePayNotice(DataRow dr)
        {
            PayNoticeEntity payNoticeEntity = null;

            if (dr != null)
            {
                payNoticeEntity           = new PayNoticeEntity();
                payNoticeEntity.NoticeID  = (Int64)dr["NoticeID"];
                payNoticeEntity.JournalID = (Int64)dr["JournalID"];
                payNoticeEntity.PayType   = (Byte)dr["PayType"];
                payNoticeEntity.CID       = (Int64)dr["CID"];
                payNoticeEntity.Amount    = (Decimal)dr["Amount"];
                payNoticeEntity.Title     = (String)dr["Title"];
                payNoticeEntity.Body      = (String)dr["Body"];
                payNoticeEntity.SendDate  = (DateTime)dr["SendDate"];
                payNoticeEntity.Status    = (Byte)dr["Status"];
            }
            return(payNoticeEntity);
        }
Example #13
0
        /// <summary>
        /// 保存缴费通知数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ExecResult SavePayNotice(PayNoticeEntity model)
        {
            HttpClientHelper clientHelper = new HttpClientHelper();
            ExecResult       result       = clientHelper.Post <ExecResult, PayNoticeEntity>(GetAPIUrl(APIConstant.PAYNOTICE_SAVE), model);

            if (result.result == EnumJsonResult.success.ToString())
            {
                SiteConfigFacadeAPIService service  = new SiteConfigFacadeAPIService();
                MessageRecodeEntity        logModel = new MessageRecodeEntity();
                logModel.MsgType    = 1;
                logModel.JournalID  = model.JournalID;
                logModel.SendUser   = model.SendUser;
                logModel.MsgTitle   = model.Title;
                logModel.MsgContent = model.Body;
                logModel.CID        = model.CID;
                if (model.PayType == 1)
                {
                    logModel.SendType = -3;
                }
                else if (model.PayType == 2)
                {
                    logModel.SendType = -4;
                }
                IList <Int64> userList = new List <Int64>()
                {
                    model.AuthorID
                };
                var emailResult = service.SendEmailOrSms(userList, logModel);
                result.msg += emailResult.msg;
                if (model.IsSms && !string.IsNullOrWhiteSpace(model.SmsContent))
                {
                    logModel.MsgType    = 2;
                    logModel.MsgContent = model.SmsContent;
                    var smsResult = service.SendEmailOrSms(userList, logModel);
                    result.msg += smsResult.msg;
                }
            }
            return(result);
        }
Example #14
0
        public bool DeletePayNotice(PayNoticeEntity payNoticeEntity)
        {
            bool          flag           = false;
            StringBuilder sqlCommandText = new StringBuilder();

            sqlCommandText.Append("DELETE FROM dbo.PayNotice");
            sqlCommandText.Append(" WHERE  NoticeID=@NoticeID");

            DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString());

            db.AddInParameter(cmd, "@NoticeID", DbType.Int64, payNoticeEntity.NoticeID);

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
            return(flag);
        }
Example #15
0
        public ActionResult SavePayNotice(PayNoticeEntity model)
        {
            IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve <IFinanceFacadeAPIService>();

            model.JournalID = CurAuthor.JournalID;
            model.SendUser  = CurAuthor.AuthorID;
            model.Status    = 0;
            model.Body      = Server.UrlDecode(model.Body).Replace("${金额}$", model.Amount.ToString());
            if (model.NoticeID == 0)
            {
                #region 改变稿件状态  为 通知交审稿费

                int actionID = 0;
                ISiteConfigFacadeService facadeService = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();
                DictEntity dicteEntity = null;
                if (model.PayType == 1)//审稿费
                {
                    dicteEntity = facadeService.GetDictModelByKey(new DictQuery()
                    {
                        JournalID = CurAuthor.JournalID, DictKey = "PayNotice"
                    });
                }
                else //版面费
                {
                    dicteEntity = facadeService.GetDictModelByKey(new DictQuery()
                    {
                        JournalID = CurAuthor.JournalID, DictKey = "PayPageNotice"
                    });
                }
                if (dicteEntity != null)
                {
                    ISiteConfigFacadeService currentService = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();
                    IList <DictValueEntity>  list           = currentService.GetDictValueList(new DictValueQuery()
                    {
                        JournalID = CurAuthor.JournalID, DictKey = dicteEntity.DictKey
                    });
                    if (list != null && list.Count > 0)
                    {
                        DictValueEntity entity = list.Single <DictValueEntity>();
                        if (entity != null)
                        {
                            actionID = entity.ValueID;
                            #region 获取流程操作

                            FlowActionQuery actionQuery = new FlowActionQuery();
                            actionQuery.JournalID  = JournalID;
                            actionQuery.ToStatusID = actionID;
                            IFlowFacadeService       flowService      = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
                            IList <FlowActionEntity> actionEntityList = flowService.GetFlowActionList(actionQuery);
                            //long statusID = actionEntity != null ? actionEntity.StatusID : 0;

                            #endregion

                            #region 根据审稿状态获取  审稿流程日志ID

                            CirculationEntity cirQuery        = new CirculationEntity();
                            AuditBillEntity   auditBillEntity = new AuditBillEntity();
                            cirQuery.CID       = model.CID;
                            cirQuery.JournalID = JournalID;
                            cirQuery.GroupID   = 1;
                            IFlowFacadeService        flowInfoLogService = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
                            IList <FlowLogInfoEntity> flowLogEntityList  = flowInfoLogService.GetFlowLog(cirQuery);
                            FlowActionEntity          single             = null;
                            FlowLogInfoEntity         flowLogEntity      = null;
                            if (flowLogEntityList != null && flowLogEntityList.Count > 0)
                            {
                                auditBillEntity.ReveiverList = flowLogEntityList[flowLogEntityList.Count - 1].SendUserID.ToString();
                                flowLogEntity = flowLogEntityList.OrderByDescending(o => o.FlowLogID).Take(1).SingleOrDefault();
                                single        = actionEntityList.Where(o => o.StatusID == flowLogEntity.TargetStatusID).FirstOrDefault();
                            }

                            #endregion

                            IFlowFacadeService flowFacadeService = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();

                            auditBillEntity.JournalID = JournalID;
                            auditBillEntity.Processer = CurAuthor.AuthorID;


                            if (single != null)
                            {
                                auditBillEntity.ActionID = single.ActionID;
                                auditBillEntity.StatusID = single.StatusID;
                            }
                            auditBillEntity.ActionType = 1;
                            auditBillEntity.CID        = model.CID;
                            if (flowLogEntity != null)
                            {
                                auditBillEntity.FlowLogID  = flowLogEntity.FlowLogID;
                                auditBillEntity.CPath      = "";
                                auditBillEntity.FigurePath = "";
                                auditBillEntity.OtherPath  = "";
                            }
                            flowFacadeService.SubmitAuditBill(auditBillEntity);
                        }
                    }
                }

                #endregion
            }
            ExecResult result = service.SavePayNotice(model);

            return(Json(new { result = result.result, msg = result.msg }));
        }
Example #16
0
        public ActionResult BatchSavePayNotice(PayNoticeEntity model)
        {
            IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve <IFinanceFacadeAPIService>();
            IList <PayNoticeEntity>  list    = (IList <PayNoticeEntity>)TempData["list"];

            if (list != null && list.Count > 0)
            {
                #region 批量改变稿件状态  为 通知交审稿费
                int actionID = 0;
                ISiteConfigFacadeService facadeService = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();
                DictEntity dicteEntity = null;
                if (model.PayType == 1)//审稿费
                {
                    dicteEntity = facadeService.GetDictModelByKey(new DictQuery()
                    {
                        JournalID = CurAuthor.JournalID, DictKey = "PayNotice"
                    });
                }
                else //版面费
                {
                    dicteEntity = facadeService.GetDictModelByKey(new DictQuery()
                    {
                        JournalID = CurAuthor.JournalID, DictKey = "PayPageNotice"
                    });
                }
                if (dicteEntity != null)
                {
                    ISiteConfigFacadeService currentService = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();
                    IList <DictValueEntity>  currentList    = currentService.GetDictValueList(new DictValueQuery()
                    {
                        JournalID = CurAuthor.JournalID, DictKey = dicteEntity.DictKey
                    });
                    if (currentList != null && currentList.Count > 0)
                    {
                        DictValueEntity entity = currentList.Single <DictValueEntity>();
                        if (entity != null)
                        {
                            actionID = entity.ValueID;
                            IFlowFacadeService flowFacadeService = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();

                            #region 获取流程操作

                            FlowActionQuery actionQuery = new FlowActionQuery();
                            actionQuery.JournalID  = JournalID;
                            actionQuery.ToStatusID = actionID;
                            IFlowFacadeService       flowService      = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
                            IList <FlowActionEntity> actionEntityList = flowService.GetFlowActionList(actionQuery);
                            #endregion

                            foreach (var item in list)
                            {
                                item.Status   = 0;
                                item.Body     = Server.UrlDecode(model.Body).Replace("${金额}$", model.Amount.ToString()).Replace("${接收人}$", item.AuthorName).Replace("${邮箱}$", item.LoginName).Replace("${稿件编号}$", item.CNumber).Replace("${稿件标题}$", item.CTitle).Replace("${手机}$", item.Mobile);
                                item.SendUser = CurAuthor.AuthorID;
                                item.Amount   = model.Amount;
                                item.Title    = model.Title;
                                if (item.NoticeID == 0)
                                {
                                    #region 根据审稿状态获取  审稿流程日志ID

                                    CirculationEntity cirQuery = new CirculationEntity();
                                    cirQuery.CID       = item.CID;
                                    cirQuery.JournalID = JournalID;
                                    cirQuery.GroupID   = 1;
                                    IFlowFacadeService        flowInfoLogService = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
                                    IList <FlowLogInfoEntity> flowLogEntityList  = flowInfoLogService.GetFlowLog(cirQuery);
                                    FlowActionEntity          single             = null;
                                    FlowLogInfoEntity         flowLogEntity      = null;
                                    if (flowLogEntityList != null && flowLogEntityList.Count > 0)
                                    {
                                        flowLogEntity = flowLogEntityList.OrderByDescending(o => o.FlowLogID).Take(1).SingleOrDefault();
                                        single        = actionEntityList.Where(o => o.StatusID == flowLogEntity.TargetStatusID).SingleOrDefault();
                                    }
                                    #endregion

                                    #region 批量提交审稿状态

                                    AuditBillEntity auditBillEntity = new AuditBillEntity();
                                    auditBillEntity.JournalID  = JournalID;
                                    auditBillEntity.Processer  = CurAuthor.AuthorID;
                                    auditBillEntity.ActionType = 1;
                                    auditBillEntity.CID        = item.CID;
                                    if (single != null && flowLogEntity != null)
                                    {
                                        auditBillEntity.ActionID     = single.ActionID;
                                        auditBillEntity.StatusID     = single.StatusID;
                                        auditBillEntity.ReveiverList = flowLogEntity.RecUserID.ToString();
                                        auditBillEntity.FlowLogID    = flowLogEntity.FlowLogID;
                                        auditBillEntity.CPath        = string.IsNullOrEmpty(flowLogEntity.CPath) ? "" : flowLogEntity.CPath;
                                        auditBillEntity.FigurePath   = string.IsNullOrEmpty(flowLogEntity.FigurePath) ? "" : flowLogEntity.FigurePath;
                                        auditBillEntity.OtherPath    = string.IsNullOrEmpty(flowLogEntity.OtherPath) ? "" : flowLogEntity.OtherPath;
                                        flowFacadeService.SubmitAuditBill(auditBillEntity);
                                    }

                                    #endregion
                                }
                            }
                        }
                    }
                }
                #endregion
            }

            ExecResult result = service.BatchSavePayNotice(list);

            return(Json(new { result = result.result, msg = result.msg }));
        }
Example #17
0
 /// <summary>
 /// 从存储媒介删除实体数据
 /// </summary>
 /// <param name="payNotice">PayNoticeEntity实体对象</param>
 /// <returns>true:删除成功 false:删除失败</returns>
 public bool DeletePayNotice(PayNoticeEntity payNotice)
 {
     return(PayNoticeDataAccess.Instance.DeletePayNotice(payNotice));
 }
Example #18
0
 /// <summary>
 /// 将实体数据存入存储媒介(持久化一个对象)
 /// </summary>
 /// <param name="payNotice">PayNoticeEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddPayNotice(PayNoticeEntity payNotice)
 {
     return(PayNoticeDataAccess.Instance.AddPayNotice(payNotice));
 }
Example #19
0
        /// <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);
        }
Example #20
0
        public ExecResult Save(PayNoticeEntity model)
        {
            IPayNoticeService service = ServiceContainer.Instance.Container.Resolve <IPayNoticeService>();

            return(service.Save(model));
        }
Example #21
0
 /// <summary>
 /// 从存储媒介删除实体数据
 /// </summary>
 /// <param name="payNotice">PayNoticeEntity实体对象</param>
 /// <returns>true:删除成功 false:删除失败</returns>
 public bool DeletePayNotice(PayNoticeEntity payNotice)
 {
     return(PayNoticeBusProvider.DeletePayNotice(payNotice));
 }
Example #22
0
 /// <summary>
 /// 更新存储媒介中的实体数据
 /// </summary>
 /// <param name="payNotice">PayNoticeEntity实体对象</param>
 /// <returns>true:更新成功 false:更新失败</returns>
 public bool UpdatePayNotice(PayNoticeEntity payNotice)
 {
     return(PayNoticeBusProvider.UpdatePayNotice(payNotice));
 }
Example #23
0
 /// <summary>
 /// 将实体数据存入存储媒介(持久化一个对象)
 /// </summary>
 /// <param name="payNotice">PayNoticeEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddPayNotice(PayNoticeEntity payNotice)
 {
     return(PayNoticeBusProvider.AddPayNotice(payNotice));
 }