コード例 #1
0
        public ExecutionResult SaveGraphicPushData(List <PushParamModel> textPush)
        {
            ExecutionResult result  = new ExecutionResult();
            U_PushMsg       pushMsg = new U_PushMsg();

            pushMsg.VGUID            = Guid.NewGuid();
            pushMsg.PushType         = 1;
            pushMsg.MessageType      = 3;
            pushMsg.Title            = textPush[0].Title;
            pushMsg.Message          = textPush[0].Message;
            pushMsg.PushPeople       = textPush[0].founder;
            pushMsg.PeriodOfValidity = DateTime.Now.AddMonths(1);
            pushMsg.CreatedUser      = "******";
            pushMsg.CreatedDate      = DateTime.Now;
            UserInfoLogic userInfoLogic = new UserInfoLogic();

            foreach (string item in textPush[0].PushPeople)
            {
                var user = userInfoLogic.GetPerson(item);
                if (user != null && user.UserID != null && user.UserID != "")
                {
                    textPush[0].PushPeoples += user.UserID + "|";
                    pushMsg.PushObject      += user.UserID + "|";
                }
                else
                {
                    result.Message += item + "|";
                }
            }
            if (!string.IsNullOrEmpty(result.Message))
            {
                result.Message = result.Message.Remove(result.Message.Length - 1, 1);
                result.Message = "不存在身份证号码:" + result.Message;
                return(result);
            }
            textPush[0].PushPeoples = textPush[0].PushPeoples.TrimEnd('|');

            List <Business_WeChatPush_MoreGraphic_Information> pushMoreGraphicList = new List <Business_WeChatPush_MoreGraphic_Information>();

            foreach (PushParamModel push in textPush)
            {
                Business_WeChatPush_MoreGraphic_Information pushMoreGraphic = new Business_WeChatPush_MoreGraphic_Information();
                pushMoreGraphic.Title           = push.Title;
                pushMoreGraphic.CoverImg        = pushMoreGraphic.Message = push.Message;
                pushMoreGraphic.CoverImg        = push.Image;
                pushMoreGraphic.CreatedDate     = DateTime.Now;
                pushMoreGraphic.CreatedUser     = "******";
                pushMoreGraphic.WeChatPushVguid = pushMsg.VGUID;
                pushMoreGraphic.VGUID           = Guid.NewGuid();
                pushMoreGraphicList.Add(pushMoreGraphic);
            }


            DraftInfoLogic logic = new DraftInfoLogic();
            Guid           vguid = Guid.Empty;

            result.Success = logic.APISaveImagePushMsg(pushMsg, pushMoreGraphicList);
            result.Result  = new { Uniquekey = pushMsg.VGUID };
            return(result);
        }
        public JsonResult SavePushMsg(U_PushMsg pushMsgModel, string txtMessage, string isEdit, string history, string saveType)
        {
            var model = new ActionResultModel <string>();

            model.isSuccess      = false;
            pushMsgModel.Message = txtMessage;
            bool edit      = bool.Parse(isEdit);
            bool isHistory = bool.Parse(history);

            pushMsgModel.History = isHistory ? "1" : "0";
            model.isSuccess      = _dl.SavePushMsg(pushMsgModel, edit, saveType);
            model.respnseInfo    = model.isSuccess ? "1" : "0";
            return(Json(model, JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        /// 保存保养消息推送消息
        /// </summary>
        /// <param name="pushMsgModel"></param>
        /// <returns></returns>
        public JsonResult SaveMaintenancePush(U_PushMsg pushMsgModel)
        {
            var model = new ResultModel <string>();

            model.IsSuccess = false;
            var msg = string.Empty;

            model.IsSuccess = _dl.SaveMaintenancePush(pushMsgModel, ref msg);
            model.ReturnMsg = model.IsSuccess ? "1" : "0";
            if (!string.IsNullOrEmpty(msg))
            {
                model.ReturnMsg    = "2";
                model.ResponseInfo = msg;
            }

            return(Json(model, JsonRequestBehavior.AllowGet));
        }
コード例 #4
0
        public ExecutionResult SaveNotificationSMS(string pushparam)
        {
            ExecutionResult result  = new ExecutionResult();
            U_PushMsg       pushMsg = new U_PushMsg();

            pushMsg.VGUID       = Guid.NewGuid();
            pushMsg.PushType    = 2;
            pushMsg.MessageType = 3;

            pushMsg.Title            = "短信发送";
            pushMsg.Message          = pushparam;
            pushMsg.PushDate         = DateTime.Now;
            pushMsg.PushPeople       = "接口短信";
            pushMsg.PeriodOfValidity = DateTime.Now.AddMonths(1);
            pushMsg.CreatedUser      = "******";
            pushMsg.CreatedDate      = DateTime.Now;
            List <Business_WeChatPush_MoreGraphic_Information> pushMoreGraphicList = new List <Business_WeChatPush_MoreGraphic_Information>();
            DraftInfoLogic logic = new DraftInfoLogic();
            Guid           vguid = Guid.Empty;

            result.Success = logic.APISaveImagePushMsg(pushMsg, pushMoreGraphicList);
            result.Result  = new { Uniquekey = pushMsg.VGUID };
            return(result);
        }
コード例 #5
0
        public JsonResult TextPush(string SECURITYKEY, string pushparam)
        {
            ExecutionResult result = new ExecutionResult();

            try
            {
                if (API_Authentication(SECURITYKEY))
                {
                    PushParamModel textPush = Extend.JsonToModel <PushParamModel>(pushparam);
                    U_PushMsg      pushMsg  = new U_PushMsg();
                    pushMsg.VGUID            = Guid.NewGuid();
                    pushMsg.PushType         = 1;
                    pushMsg.MessageType      = 1;
                    pushMsg.Title            = textPush.Title;
                    pushMsg.Message          = textPush.Message;
                    pushMsg.PushPeople       = textPush.founder;
                    pushMsg.CreatedUser      = "******";
                    pushMsg.CreatedDate      = DateTime.Now;
                    pushMsg.PeriodOfValidity = DateTime.Now.AddMonths(1);
                    UserInfoLogic userInfoLogic = new UserInfoLogic();
                    if (textPush.PushPeople.Count == 0)
                    {
                        result.Message = "推送人员不能为空!";
                        ExecHistry("TextPush", pushparam, JsonHelper.ModelToJson(result));
                        return(Json(result));
                    }
                    foreach (string item in textPush.PushPeople)
                    {
                        var user = userInfoLogic.GetPerson(item);
                        if (user != null && user.UserID != null && user.UserID != "")
                        {
                            pushMsg.PushPeople += user.UserID + "|";
                            pushMsg.PushObject += user.UserID + "|";
                        }
                        else
                        {
                            result.Message += item + "|";
                        }
                    }
                    if (!string.IsNullOrEmpty(result.Message))
                    {
                        result.Message = result.Message.Remove(result.Message.Length - 1, 1);
                        result.Message = "不存在身份证号码:" + result.Message;
                        ExecHistry("TextPush", pushparam, JsonHelper.ModelToJson(result));
                        return(Json(result));
                    }
                    DraftInfoLogic logic = new DraftInfoLogic();
                    Guid           vguid = Guid.Empty;
                    result.Success = logic.APISavePushMsg(pushMsg);
                    result.Result  = new { Uniquekey = pushMsg.VGUID };
                }
                else
                {
                    result.Message = "SECURITYKEY 无效!";
                }
            }
            catch (Exception ex)
            {
                result.Message = ex.Message;
                LogHelper.WriteLog(ex.Message);
            }
            ExecHistry("TextPush", pushparam, JsonHelper.ModelToJson(result));
            return(Json(result));
        }