Esempio n. 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 HistoryController()
 {
     _dl = new DraftInfoLogic();
     _pushedListLogic = new PushedListLogic();
     _historyLogic    = new PushHistoryLogic();
     _al = new AuthorityManageLogic();
 }
Esempio n. 3
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);
        }
 public CommitedListController()
 {
     _cl = new CommitedListLogic();
     _al = new AuthorityManageLogic();
     _dl = new DraftInfoLogic();
 }
 public DraftListController()
 {
     _dl = new DraftInfoLogic();
     _al = new AuthorityManageLogic();
 }
 public CheckedListController()
 {
     _cl = new CheckedListLogic();
     _dl = new DraftInfoLogic();
 }
 public PushedListController()
 {
     _pl = new PushedListLogic();
     _dl = new DraftInfoLogic();
 }
Esempio n. 8
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));
        }