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 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); }