Commit 7b7c76ca authored by 席世权's avatar 席世权

删除Svn

parent 61c1d5a2
Pipeline #1671 failed with stages

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PushPlatform.Common.Enumerate
{
public enum SmsType
{
博士通 = 1,
正奥 = 2,
互亿 = 3,
阿里云 = 4
}
}
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="PushMsg" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>PushService.Act.Model.PushMsg, PushService.Act, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PushInfo.Core.BLL;
namespace PushInfo.Act.BLL
{
public class MqBLL
{
public void ReleaseTaskMq()
{
ProcessTaskBLL processBll = new ProcessTaskBLL();
processBll.ReleaseTaskMq();
}
}
}
@model System.Data.DataTable
@using System.Data;
@{
Layout = null;
}
<style type="text/css">
.table{ width:100%; text-align:center; font-size:12px;border-spacing: 0; border: 0;}
.table-bordered{border:1px solid #DDDDDD}
.table td{ padding:0px 10px; }
.table td a.name{ color:#438EB9}
.table_list { line-height:30px;padding: 2px 2px 0px 2px;}
.table_list thead{ background-color:#ededed; }
.table_list thead th{text-align:center;font-weight:inherit!important;}
.table_striped thead tr{color: #707070;background: #f2f2f2;}
.table_striped thead tr th{border: 1px solid #ddd; line-height:40px; font-size:14px; color:#666}
.table-bordered>thead>tr>th,
.table-bordered>tbody>tr>th,
.table-bordered>tfoot>tr>th,
.table-bordered>thead>tr>td,
.table-bordered>tbody>tr>td,
.table-bordered>tfoot>tr>td{border: 0px ; border-bottom: 1px solid #ddd;border-left: 1px solid #DDDDDD; }
.table-bordered>thead>tr>th:first-of-type,
.table-bordered>tbody>tr>th:first-of-type,
.table-bordered>tfoot>tr>th:first-of-type,
.table-bordered>thead>tr>td:first-of-type,
.table-bordered>tbody>tr>td:first-of-type,
.table-bordered>tfoot>tr>td:first-of-type{border-left:0;}
.table thead>tr>td,
.table tbody>tr>td,
.table tfoot>tr>td {padding: 5px 5px;line-height: 28px;vertical-align: middle ;color:#666 }
.table tbody>tr>td:first-of-type{position: relative;}
.table thead>tr>td:last-of-type,
.table tbody>tr>td:last-of-type,
.table tfoot>tr>td:last-of-type{border-right: 0px }
.table tbody>tr.odd{ background-color:#f5f5f5}
.table tbody>tr.selected{ background-color:#438EB9; }
.table tbody>tr.selected td{color:#FFF}
.table thead>tr>th,
.table tbody>tr>th,
.table tfoot>tr>th{padding: 5px 5px;line-height: 28px;vertical-align: middle ;position: relative;}
.table .tab_prompt{border-radius: 2px ;padding: 2px 4px;}
.table .checkbox input[type=checkbox] {position:static;margin-left:0px;cursor:pointer;}
</style>
<table class="gallery table table_list table_striped table-bordered border " id="tableList" style="width: 100%;" cellpadding="0">
<thead>
<tr>
<th width="50px">
<label class="checkbox relative"><input type="checkbox" class="ace" name="checkall" id="j_cbAll"><span class="lbl"></span></label>
</th>
<th>姓名</th>
<th>账号</th>
<th>手机号</th>
<th>加入日期</th>
<th>角色</th>
</tr>
</thead>
<tbody id="j_tb">
@foreach (DataRow row in Model.Rows)
{
<tr class="relative" data-id="1" userid="@row["userId"].ToString()" roleId="@row["Role_Id"].ToString()">
<td><label class="checkbox relative"><input type="checkbox" class="ace" name="checkbox"><span class="lbl"></span></label></td>
<td>@row["Real_Name"].ToString()</td>
<td>@row["Login_Name"].ToString()</td>
<td>@row["Phone_Number"].ToString()</td>
<td>@row["Create_Time"].ToString()</td>
<td>@row["Role_Name"].ToString()</td>
</tr>
}
</tbody>
</table>
<script>
var all = document.getElementById("j_cbAll");
var tbody = document.getElementById("j_tb");
var checkboxs = tbody.getElementsByTagName("input");
all.onclick = function() {
for (var i = 0; i < checkboxs.length; i++) {
var checkbox = checkboxs[i];
checkbox.checked = this.checked;
}
};
for (var i = 0; i < checkboxs.length; i++) {
checkboxs[i].onclick = function() {
var isCheckedAll = true;
for (var i = 0; i < checkboxs.length; i++) {
if (!checkboxs[i].checked) {
isCheckedAll = false;
break;
}
}
all.checked = isCheckedAll;
};
}</script>
using PushInfo.Act.BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using PushPlatform.Common.Util;
using System.Threading;
using System.Runtime.Serialization;
using System.Reflection;
using PushTest.BLL;
using PushService.Act;
using PushService.Act.BLL;
namespace PushTest
{
class Program
{
static void Main(string[] args)
{
//QuartzBLL.Start();
#region 推送body截取属性测试
//List<string> returnModel = new List<string>();
//string test = "[afaf]你需要随访患者数[nums],病例[needvalue],测试[bage]";
//int indexNums = 0;
//int startIndex = test.IndexOf("[");
//int endIndex = 0;
//while (startIndex>-1)
//{
// endIndex = test.IndexOf("]", startIndex + 1);
// if(endIndex>-1)
// {
// returnModel.Add(test.Substring(startIndex+1, endIndex- startIndex - 1));
// }
// startIndex = test.IndexOf("[",endIndex);
// if(++indexNums>100) //防止陷入死循环
// {
// break;
// }
//}
#endregion
#region 线程测试
//var result = test();
//var result2 = test2();
////Console.WriteLine(result.Result);
//Task.Run(() => { Thread.Sleep(1000); Console.WriteLine("task"); });
//Task.WaitAll(new Task[] { result2 });
////result.Wait();
////Thread.Sleep(1600);
//Console.WriteLine("主线程");
#endregion
using (pushServer.PushPfServiceClient push = new pushServer.PushPfServiceClient())
{
var result = push.QueryPushMsgList("2699618d-2d91-45ba-b54e-88b8d632cb1b", new int[] { 3 }, 1, 10);
var result2 = push.QuerySelectItem();
}
//OutProcessTaskBLL.SendPushOfProCfg("123b854b-0f39-488f-a2e7-7cfef0719b06", "E65D65E3-F7B9-4C77-80F4-434D9B8D5F29");
//using (pushPfWebserver.PushPlatformSoapClient push = new pushPfWebserver.PushPlatformSoapClient())
//{
// var result = push.SendPushOfProCfg("123b854b-0f39-488f-a2e7-7cfef0719b06", "E65D65E3-F7B9-4C77-80F4-434D9B8D5F29");
//}
//SocketClient.SendInfo();
PushInfo.Act.BLL.QuartzBLL.Start();
Console.Read();
}
private static Task<string> test()
{
return getstrasync();
}
private static Task<string> test2()
{
return getstrasync2();
}
private async static Task<string> getstrasync()
{
await Task.Run(() =>
{
Thread.Sleep(1000);
Console.WriteLine("test1");
});
Console.WriteLine("test11");
return "123";
}
private async static Task<string> getstrasync2()
{
return await Task.Run(() =>
{
Thread.Sleep(500);
Console.WriteLine("test2");
return "test2";
});
}
}
public class test
{
public Dictionary<string, string> dicValue { get; set; }
public string data { get; set; }
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PushInfo.Act.Models.QueryResults
{
public class PushConfigResult
{
public string Id { get; set; }
/// <summary>
/// 推送任务描述
/// </summary>
public System.String Name_Des { get; set; }
public string Db_ConnectId { get; set; }
public string Push_Id { get; set; }
/// <summary>
/// 推送对象
/// </summary>
public System.Int32? Push_Target { get; set; }
/// <summary>
/// 项目的Id
/// </summary>
public System.String Project_Id { get; set; }
/// <summary>
/// 推送方式0:短信 1:APP
/// </summary>
public string Push_Style { get; set; }
/// <summary>
/// 推送title
/// </summary>
public System.String Push_Title { get; set; }
/// <summary>
/// 推送Body
/// </summary>
public System.String Push_Body { get; set; }
/// <summary>
/// 推送方式一次,小时,日,周,月
/// </summary>
public System.Int32? Push_Type { get; set; }
/// <summary>
/// 推送周期
/// </summary>
public System.Int32? Push_Cycle { get; set; }
/// <summary>
/// 推送月份1,2 1月,2月推送
/// </summary>
public System.String Push_Month { get; set; }
/// <summary>
/// 推送订周几,几号推送周一,周二/2号,5号
/// </summary>
public System.String Push_Which { get; set; }
/// <summary>
/// 推送数据来源
/// </summary>
public System.String Push_Action { get; set; }
/// <summary>
/// 推送数据来源方式
/// </summary>
public System.Int32? Push_ActionType { get; set; }
/// <summary>
/// ios跳转
/// </summary>
public System.String Push_IosLink { get; set; }
/// <summary>
/// and跳转
/// </summary>
public System.String Push_AndLink { get; set; }
/// <summary>
/// web跳转
/// </summary>
public System.String Push_WebLink { get; set; }
/// <summary>
/// 下次执行的时间
/// </summary>
public DateTime Exec_Time { get; set; }
/// <summary>
/// 任务状态
/// </summary>
public int Exec_Status { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime Create_Time { get; set; }
}
}
using DapperORM.Common.Models;
using PushInfo.Core.BLL;
using PushInfo.Core.Models.QueryResults;
using PushInfo.Core.Models.Tables;
using PushPlatform.Common.Enumerate;
using PushPlatform.Common.Util;
using PushService.Act.Model.Request;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PushService.Act.BLL
{
public class OutProcessTaskBLL
{
private static MapProjectPushBLL mProPushBll = new MapProjectPushBLL();
private static ProcessTaskBLL proTaskBll = new ProcessTaskBLL();
#region 系统主动调用发送任务,数据来源配置表查询
/// <summary>
/// 系统主动调用发送任务,数据来源配置表查询
/// </summary>
/// <param name="proCfgId">配置表的Id</param>
/// <param name="userId">用户Id</param>
/// <returns>执行结果1-成功,0-失败</returns>
public static ResultModel SendPushOfProCfg(string proCfgId, string userId, Dictionary<string, string> valMap = null)
{
ResultModel result = new ResultModel();
try
{
Map_Project_Push task = mProPushBll.Query_Sys_Task_By_Id(proCfgId);
if (task == null)
{
LogHelper.Info("执行任务时查询结果为NULL,不正常-" + task.Name_Des);
result.Result = 0;
result.Msg = "传输的配置表的Id有误,推送失败。";
return result;
}
if (task.Exec_Status == (int)ExecuteStatus.已经停用)
{
result.Result = 0;
result.Msg = "推送任务已停用,推送失败,请查询配置信息。";
return result;
}
task.valMap = valMap;
mProPushBll.Modify_Task_Excute(proCfgId, ExecuteStatus.已安排触发器, task.Trigger_Key, null);
task.User_Id = userId;
if(proTaskBll.StartTask(task))
{
result.Result = 1;
result.Msg = "发送成功";
}
else
{
result.Result = 0;
result.Msg = "发送失败";
}
}
catch (Exception ex)
{
result.Result = 0;
result.Msg = ex.Message;
LogHelper.Error(ex);
}
return result;
}
#endregion
#region 系统主动调用发送任务,数据来源配置表查询
/// <summary>
/// 系统主动调用发送任务,数据来源配置表查询
/// </summary>
/// <param name="proCfgId">配置表的Id</param>
/// <param name="userId">用户Id</param>
/// <returns>执行结果1-成功,0-失败</returns>
public static ResultModel SendPushOfProSyspush(string sysPushId, string projectId, Dictionary<string, string> valMap = null)
{
ResultModel result = new ResultModel();
try
{
Map_Project_Push task = mProPushBll.Query_SysTask_ByProId(sysPushId, projectId);
if (task == null)
{
LogHelper.Info("执行任务时查询结果为NULL,不正常-" + task.Name_Des);
result.Result = 0;
result.Msg = "传输的配置表的Id有误,推送失败。";
return result;
}
if (task.Exec_Status == (int)ExecuteStatus.已经停用)
{
result.Result = 0;
result.Msg = "推送任务已停用,推送失败,请查询配置信息。";
return result;
}
task.valMap = valMap;
mProPushBll.Modify_Task_Excute(task.Id, ExecuteStatus.已安排触发器, task.Trigger_Key, null);
if (proTaskBll.StartTask(task))
{
result.Result = 1;
result.Msg = "发送成功";
}
else
{
result.Result = 0;
result.Msg = "发送失败";
}
}
catch (Exception ex)
{
result.Result = 0;
result.Msg = ex.Message;
LogHelper.Error(ex);
}
return result;
}
#endregion
#region
public static ResultModel SendPushOfExternal(PushValueModel valModel)
{
ProcessTaskBLL taskBll = new ProcessTaskBLL();
ResultModel result = new ResultModel();
try
{
Map_Project_Push task = mProPushBll.Query_Sys_Task_By_Id(valModel.ProCfg_Id);
if (task == null)
{
result.Result = 0;
result.Msg = "传输的配置表的Id有误,推送失败。";
return result;
}
if(task.Exec_Status == (int)ExecuteStatus.已经停用)
{
result.Result = 0;
result.Msg = "推送任务已停用,推送失败,请查询配置信息。";
return result;
}
mProPushBll.Modify_Task_Excute(valModel.ProCfg_Id, ExecuteStatus.已安排触发器, task.Trigger_Key, null);
task.Push_Style = valModel.Push_Style?? task.Push_Style;
task.Push_TagId = valModel.Push_TagId?? task.Push_TagId;
task.Push_Title = valModel.Push_Title ?? task.Push_Title;
task.Push_Body = valModel.Push_Body ?? task.Push_Body;
task.Wx_MsmTemp = valModel.Wx_MsmTemp ?? task.Wx_MsmTemp;
task.Push_IosLink = valModel.Push_IosLink ?? task.Push_IosLink;
task.Push_AndLink = valModel.Push_AndLink ?? task.Push_AndLink;
task.Push_WebLink = valModel.Push_WebLink ?? task.Push_WebLink;
task.Push_WechatLink = valModel.Push_WechatLink ?? task.Push_WechatLink;
DataMessage data = new DataMessage();
data.userId = valModel.User_Id;
data.clientType = valModel.Client_Type;
data.clientID = valModel.Client_ID;
data.realName = valModel.Real_Name;
data.mobile = valModel.Mobile;
data.openId = valModel.Open_Id;
if (taskBll.ConfirmSend(task, data))
{
result.Result = 1;
result.Msg = "发送成功";
}
else
{
result.Result = 0;
result.Msg = "发送失败";
}
}
catch (Exception ex)
{
result.Result = 0;
result.Msg = ex.Message;
LogHelper.Error(ex);
}
return result;
}
#endregion
}
}
using System;
using System.Linq.Expressions;
using System.Collections.Generic;
using DapperORM;
using DapperORM.Common.Models;
using PushInfo.Core.Models.Tables;
using PushInfo.Core.IDAL;
using System.Linq;
namespace PushInfo.Core.DAL.MySql
{
public class MapProjectPushDAL : BaseRepository<Map_Project_Push>, IMapProjectPushDAL
{
public ResultModel<Map_Project_Push> GetModel(Expression<Func<Map_Project_Push, bool>> where = null, Expression<Func<Map_Project_Push, object>> select = null, IDictionary<string, bool> sort = null)
{
return GetAsync(where, select, sort).Result;
}
public Map_Project_Push GetModel(string Id)
{
string sql = @"select t1.Id,t1.Name_Des,t1.Push_Id,t1.PushSys_ProId,t1.Project_Id,
t1.Exec_Time,t1.Exec_Status,t1.Push_Target,t1.Push_Style,t1.Push_TagId,t1.Push_Title,t2.Push_Body as Push_Body,
t1.Push_Type,t1.Push_Cycle,t1.Push_Month,t1.Push_Which,t2.Push_Action,t2.Push_ActionType,
t2.Push_IosLink,t2.Push_AndLink,t2.Push_WebLink,t2.Push_WechatLink,t2.Db_ConnectId,
t1.Wx_MsmodelId,t1.Is_Deleted,t1.Trigger_Key,t2.Push_User_Action,t2.Push_User_ActionType,t2.Db_User_ConnectId
from map_project_push t1 join sys_push t2 on t1.Push_Id = t2.Id and t1.ID = @Id";
Dictionary<string, object> param = new Dictionary<string, object>();
param.Add("@Id", Id);
var result = QueryAsync<Map_Project_Push>(sql, param).Result;
if(result.Data.Count() >0 && result.IsSuccess())
{
return result.Data.FirstOrDefault();
}
else
{
return null;
}
}
public Map_Project_Push GetModel(string sysPushId, string projectId)
{
string sql = @"select t1.Id,t1.Name_Des,t1.Push_Id,t1.PushSys_ProId,t1.Project_Id,
t1.Exec_Time,t1.Exec_Status,t1.Push_Target,t1.Push_Style,t1.Push_TagId,t1.Push_Title,case when t1.Push_Body is null then t2.Push_Body else t1.Push_Body end as Push_Body,
t1.Push_Type,t1.Push_Cycle,t1.Push_Month,t1.Push_Which,t2.Push_Action,t2.Push_ActionType,
t2.Push_IosLink,t2.Push_AndLink,t2.Push_WebLink,t2.Push_WechatLink,t2.Db_ConnectId,
t1.Wx_MsmodelId,t1.Is_Deleted,t1.Trigger_Key,t2.Push_User_Action,t2.Push_User_ActionType,t2.Db_User_ConnectId
from map_project_push t1 join sys_push t2 on t1.Push_Id = t2.Id and t2.ID = @sysPushId and t1.Project_Id = @projectId";
Dictionary<string, object> param = new Dictionary<string, object>();
param.Add("@sysPushId", sysPushId);
param.Add("@projectId", projectId);
var result = QueryAsync<Map_Project_Push>(sql, param).Result;
if (result.Data.Count() > 0 && result.IsSuccess())
{
return result.Data.FirstOrDefault();
}
else
{
return null;
}
}
public ResultModel<IEnumerable<Map_Project_Push>> GetList(Expression<Func<Map_Project_Push, bool>> where = null, Expression<Func<Map_Project_Push, object>> select = null, IDictionary<string, bool> sort = null)
{
return FetchAsync(where, select, sort).Result;
}
/// <summary>
/// 查询数据集合
/// </summary>
/// <param name="sqlStr">查询sql语句</param>
/// <returns></returns>
public ResultModel<IEnumerable<Map_Project_Push>> GetList(string sqlStr, Dictionary<string, object> param)
{
return QueryAsync<Map_Project_Push>(sqlStr, param).Result;
}
public ResultModel Update(Map_Project_Push model, Expression<Func<Map_Project_Push, object>> updateExp, Expression<Func<Map_Project_Push, bool>> whereExp)
{
if(updateExp == null)
{
return UpdateAllAsync<Map_Project_Push>(model, whereExp).Result;
}
else
{
return UpdatePartailAsync<Map_Project_Push>(model, updateExp, whereExp).Result;
}
}
}
}
using System;
using System.Linq;
using System.Collections.Generic;
using PushPlatform.Data;
namespace PushPlatform.Data.DaoAchieve
{
public partial class MappushUserRoleDaoAchieve
{
#region Dao
#endregion
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Security;
using PushPlatform.Data;
namespace PushPlatform.Data.MvcModel
{
public partial class ProjectInfoModel
{
#region Column Mapped Properties
[Display(Name = "Id")]
public System.String Id { get; set; }
[Display(Name = "Projectname")]
public System.String Projectname { get; set; }
[Display(Name = "Projecttype")]
public System.Int32 Projecttype { get; set; }
[Display(Name = "Internalprincipal")]
public System.String Internalprincipal { get; set; }
[Display(Name = "Internalprincipalmobile")]
public System.String Internalprincipalmobile { get; set; }
[Display(Name = "DbConnectid")]
public System.String DbConnectid { get; set; }
[Display(Name = "ObjectSql")]
public System.String ObjectSql { get; set; }
[Display(Name = "ChildProjectinfo")]
public System.String ChildProjectinfo { get; set; }
[Display(Name = "UserSql")]
public System.String UserSql { get; set; }
[Display(Name = "CreateUser")]
public System.String CreateUser { get; set; }
[Display(Name = "CreateTime")]
public System.DateTime CreateTime { get; set; }
[Display(Name = "UpdateUser")]
public System.String UpdateUser { get; set; }
[Display(Name = "UpdateTime")]
public System.DateTime? UpdateTime { get; set; }
[Display(Name = "IsDeleted")]
public System.SByte IsDeleted { get; set; }
[Display(Name = "Timestamp")]
public System.Int64 Timestamp { get; set; }
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
namespace PushPfService
{
// 注意: 使用“重构”菜单上的“重命名”命令,可以同时更改代码、svc 和配置文件中的类名“Service1”。
// 注意: 为了启动 WCF 测试客户端以测试此服务,请在解决方案资源管理器中选择 Service1.svc 或 Service1.svc.cs,然后开始调试。
public class PushPfService : IPushPfService
{
public string GetData(int value)
{
return string.Format("You entered: {0}", value);
}
}
}
using PushInfo.Act.BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Threading;
using System.Runtime.Serialization;
using System.Reflection;
using PushTest.BLL;
using PushService.Act;
using PushService.Act.BLL;
using PushPlatform.Common.Util;
namespace PushTest
{
class Program
{
static void Main(string[] args)
{
//QuartzBLL.Start();
#region 推送body截取属性测试
//List<string> returnModel = new List<string>();
//string test = "[afaf]你需要随访患者数[nums],病例[needvalue],测试[bage]";
//int indexNums = 0;
//int startIndex = test.IndexOf("[");
//int endIndex = 0;
//while (startIndex>-1)
//{
// endIndex = test.IndexOf("]", startIndex + 1);
// if(endIndex>-1)
// {
// returnModel.Add(test.Substring(startIndex+1, endIndex- startIndex - 1));
// }
// startIndex = test.IndexOf("[",endIndex);
// if(++indexNums>100) //防止陷入死循环
// {
// break;
// }
//}
#endregion
#region 线程测试
//var result = test();
//var result2 = test2();
////Console.WriteLine(result.Result);
//Task.Run(() => { Thread.Sleep(1000); Console.WriteLine("task"); });
//Task.WaitAll(new Task[] { result2 });
////result.Wait();
////Thread.Sleep(1600);
//Console.WriteLine("主线程");
#endregion
//OutProcessTaskBLL.SendPushOfProCfg("123b854b-0f39-488f-a2e7-7cfef0719b06", "E65D65E3-F7B9-4C77-80F4-434D9B8D5F29");
//using (pushPfWebserver.PushPfServiceSoapClient push = new pushPfWebserver.PushPfServiceSoapClient())
//{
// var test = push.QueryPushMsgList("05f845e0-cf77-40f8-acbb-44a15fbb4e6a", new int[] { 5 },null, 1, 10);
// var result = push.UpPushMsgRead("fa01e0e3-3014-464f-9675-0104eca5bba2");
//}
//SocketClient.SendInfo();
//PushInfo.Act.BLL.QuartzBLL.Start();
Dictionary<string, string> dic = new Dictionary<string, string>();
//dic.Add("@House_Id", "851d5845-6294-437d-8fca-4fae8f4cbfcc");
//dic.Add("@medicineId", "8d8f8a14-8040-4c3e-af08-0d521acabf21");
//dic.Add("@conversionId", "5f2968d3-eb90-45d6-9924-23ba52f35c18");
dic.Add("@Operator", "席世全");
dic.Add("@patientId", "1");
dic.Add("@visitId", "cf124afa-17c2-4b62-b074-3681269c1e1e");
dic.Add("@houseId", "851d5845-6294-437d-8fca-4fae8f4cbfcc");
string str = JsonUtil.ConvertToJson(dic);
using (pushPfWebserver.PushPfServiceSoapClient push = new pushPfWebserver.PushPfServiceSoapClient())
{
//push.SendPushOfPCValmap("3c3b61a7-ae08-4192-9a97-6d7833fed618","", str);
//push.SendPushOfPCValmap("90120daf-2f27-48cb-9707-f5915d47bd2a", "", str);
push.SendPushOfPCValmap("e90a08e2-3dfe-48f7-be34-7faacf7e5c94", "", "");
}
Console.Read();
}
private static Task<string> test()
{
return getstrasync();
}
private static Task<string> test2()
{
return getstrasync2();
}
private async static Task<string> getstrasync()
{
await Task.Run(() =>
{
Thread.Sleep(1000);
Console.WriteLine("test1");
});
Console.WriteLine("test11");
return "123";
}
private async static Task<string> getstrasync2()
{
return await Task.Run(() =>
{
Thread.Sleep(500);
Console.WriteLine("test2");
return "test2";
});
}
}
public class test
{
public Dictionary<string, string> dicValue { get; set; }
public string data { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using PushPlatform.Data;
namespace PushPlatform.Data
{
public partial class MappushUserRole
{
// Place your custom code here.
}
}
\ No newline at end of file
/**
* Theme: Ubold Admin Template
* Author: Coderthemes
* Component: Editable
*
*/
(function( $ ) {
'use strict';
var EditableTable = {
options: {
addButton: '#addToTable',
table: '#datatable-editable',
dialog: {
wrapper: '#dialog',
cancelButton: '#dialogCancel',
confirmButton: '#dialogConfirm'
}
},
initialize: function() {
this
.setVars()
.build()
.events();
},
setVars: function() {
this.$table = $( this.options.table );
this.$addButton = $( this.options.addButton );
// dialog
this.dialog = {};
this.dialog.$wrapper = $( this.options.dialog.wrapper );
this.dialog.$cancel = $( this.options.dialog.cancelButton );
this.dialog.$confirm = $( this.options.dialog.confirmButton );
return this;
},
build: function() {
this.datatable = this.$table.DataTable({
aoColumns: [
null,
null,
null,
{ "bSortable": false }
]
});
window.dt = this.datatable;
return this;
},
events: function() {
var _self = this;
this.$table
.on('click', 'a.save-row', function( e ) {
e.preventDefault();
_self.rowSave( $(this).closest( 'tr' ) );
})
.on('click', 'a.cancel-row', function( e ) {
e.preventDefault();
_self.rowCancel( $(this).closest( 'tr' ) );
})
.on('click', 'a.edit-row', function( e ) {
e.preventDefault();
_self.rowEdit( $(this).closest( 'tr' ) );
})
.on( 'click', 'a.remove-row', function( e ) {
e.preventDefault();
var $row = $(this).closest( 'tr' );
$.magnificPopup.open({
items: {
src: _self.options.dialog.wrapper,
type: 'inline'
},
preloader: false,
modal: true,
callbacks: {
change: function() {
_self.dialog.$confirm.on( 'click', function( e ) {
e.preventDefault();
_self.rowRemove( $row );
$.magnificPopup.close();
});
},
close: function() {
_self.dialog.$confirm.off( 'click' );
}
}
});
});
this.$addButton.on( 'click', function(e) {
e.preventDefault();
_self.rowAdd();
});
this.dialog.$cancel.on( 'click', function( e ) {
e.preventDefault();
$.magnificPopup.close();
});
return this;
},
// ==========================================================================================
// ROW FUNCTIONS
// ==========================================================================================
rowAdd: function() {
this.$addButton.attr({ 'disabled': 'disabled' });
var actions,
data,
$row;
actions = [
'<a href="#" class="hidden on-editing save-row"><i class="fa fa-save"></i></a>',
'<a href="#" class="hidden on-editing cancel-row"><i class="fa fa-times"></i></a>',
'<a href="#" class="on-default edit-row"><i class="fa fa-pencil"></i></a>',
'<a href="#" class="on-default remove-row"><i class="fa fa-trash-o"></i></a>'
].join(' ');
data = this.datatable.row.add([ '', '', '', actions ]);
$row = this.datatable.row( data[0] ).nodes().to$();
$row
.addClass( 'adding' )
.find( 'td:last' )
.addClass( 'actions' );
this.rowEdit( $row );
this.datatable.order([0,'asc']).draw(); // always show fields
},
rowCancel: function( $row ) {
var _self = this,
$actions,
i,
data;
if ( $row.hasClass('adding') ) {
this.rowRemove( $row );
} else {
data = this.datatable.row( $row.get(0) ).data();
this.datatable.row( $row.get(0) ).data( data );
$actions = $row.find('td.actions');
if ( $actions.get(0) ) {
this.rowSetActionsDefault( $row );
}
this.datatable.draw();
}
},
rowEdit: function( $row ) {
var _self = this,
data;
data = this.datatable.row( $row.get(0) ).data();
$row.children( 'td' ).each(function( i ) {
var $this = $( this );
if ( $this.hasClass('actions') ) {
_self.rowSetActionsEditing( $row );
} else {
$this.html( '<input type="text" class="form-control input-block" value="' + data[i] + '"/>' );
}
});
},
rowSave: function( $row ) {
var _self = this,
$actions,
values = [];
if ( $row.hasClass( 'adding' ) ) {
this.$addButton.removeAttr( 'disabled' );
$row.removeClass( 'adding' );
}
values = $row.find('td').map(function() {
var $this = $(this);
if ( $this.hasClass('actions') ) {
_self.rowSetActionsDefault( $row );
return _self.datatable.cell( this ).data();
} else {
return $.trim( $this.find('input').val() );
}
});
this.datatable.row( $row.get(0) ).data( values );
$actions = $row.find('td.actions');
if ( $actions.get(0) ) {
this.rowSetActionsDefault( $row );
}
this.datatable.draw();
},
rowRemove: function( $row ) {
if ( $row.hasClass('adding') ) {
this.$addButton.removeAttr( 'disabled' );
}
this.datatable.row( $row.get(0) ).remove().draw();
},
rowSetActionsEditing: function( $row ) {
$row.find( '.on-editing' ).removeClass( 'hidden' );
$row.find( '.on-default' ).addClass( 'hidden' );
},
rowSetActionsDefault: function( $row ) {
$row.find( '.on-editing' ).addClass( 'hidden' );
$row.find( '.on-default' ).removeClass( 'hidden' );
}
};
$(function() {
EditableTable.initialize();
});
}).apply( this, [ jQuery ]);
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using PushPlatform.Data;
using PushPlatform.Data.Bll;
using PushPlatform.Data.Criteria;
using PushPlatform.Data.MvcModels;
using PushPlatform.Common.Model;
using PushInfo.Act.BLL;
using PushInfo.Act.Models.QueryResults;
using DapperORM.Common.Models;
using PushPlatform.Common.Enumerate;
using System.Data;
using PushPlatform.Data.Blls;
namespace PushPlatform.Background.Areas.BackGround.Controllers
{
public class ChildProjectController : BaseController
{
BllProjectInfo bllProInfo = new BllProjectInfo();
BllSelectItemDetail bllsetItem = new BllSelectItemDetail();
// GET: BackGround/ChildProject
#region 当前系统内的子系统的列表
public ActionResult Index()
{
List<ChildProject> modelList = new List<ChildProject>();
CurrentUserModel user = BllSysUser.GetCurrentUser();
ProjectInfo pModel = bllProInfo.Get(user.CurrentProjectId);
if(!string.IsNullOrEmpty(pModel.Child_ProjectInfo) && !string.IsNullOrEmpty(pModel.Db_ConnectId))
{
var dbcon = bllsetItem.Get(pModel.Db_ConnectId);
if(dbcon!=null)
{
DataTable table = DbHelpBll.FetchSql(pModel.Child_ProjectInfo, dbcon.Value);
foreach(DataRow row in table.Rows)
{
ChildProject model = new ChildProject();
model.Id = row["Id"].ToString();
model.ProjectName = row["Project_Name"].ToString();
modelList.Add(model);
}
}
}
if(modelList.Count == 0)
{
ChildProject model = new ChildProject();
model.Id = user.CurrentProjectId;
model.ProjectName = user.CurrentProjectName;
modelList.Add(model);
}
return View(modelList);
}
#endregion
#region 配置推送
#region 用户推送配置列表
/// <summary>
/// 用户推送配置列表
/// </summary>
/// <param name="projId"></param>
/// <param name="page"></param>
/// <returns></returns>
public ActionResult ConfigList(string projId, int page = 1)
{
PushConfigBLL bll = new PushConfigBLL();
PageListModel<PushConfigResult> pageList = bll.GetPushConfigByPage(page, projId);
ViewData["IS_ADMIN"] = false;
ViewData["PAGE_LIST"] = pageList.Data;
ViewData["PAGE_COUNT"] = pageList.TotalPageCount + 1;
ViewData["CURRENT_PAGE"] = pageList.CurrentPage;
ViewData["PROJ_ID"] = projId;
return View();
}
#endregion
#region
public ActionResult EditConfig(string projId, string id, bool isNew = true)
{
if (isNew && string.IsNullOrEmpty(projId))
throw new Exception("没有项目id,将无法绑定推送任务到项目");
PushConfigBLL bll = new PushConfigBLL();
SetDataSource(isNew, false);
PushConfigResult pushConfig = new PushConfigResult() { Project_Id = projId };
if (!isNew)
{
if (string.IsNullOrEmpty(id)) throw new Exception("未提供推送任务Id");
pushConfig = bll.GetConfigById(id);
}
return View("Edit", pushConfig);
}
#endregion
#endregion
[NonAction]
private void SetDataSource(bool isNew, bool isAdmin)
{
PushConfigBLL bll = new PushConfigBLL();
List<PushInfo.Act.Models.QueryResults.SelectItemDetail> list = bll.GetCycleDetailList().ToList();
list.Sort((x, y) => {
int intx = 0;
int inty = 0;
if (int.TryParse(x.Value, out intx) && int.TryParse(y.Value, out inty))
return intx - inty;
else
return 0;
});
ViewData["MONTH_LIST"] = list.Where(x => x.Select_Type == (int)SelectType.第几月).ToList();
ViewData["DATE_LIST"] = list.Where(x => x.Select_Type == (int)SelectType.第几号).ToList();
ViewData["WEEK_LIST"] = list.Where(x => x.Select_Type == (int)SelectType.第几周).ToList();
ViewData["CONNECTION_LIST"] = list.Where(x => x.Select_Type == (int)SelectType.数据库连接).ToList();
ViewData["IS_ADMIN"] = isAdmin;
ViewData["IS_NEW"] = isNew;
if (!isAdmin)
ViewData["PUSH_LIST"] = bll.GetAllSysPush().ToList();
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!--quartz配置-->
<section name="quartz" type="System.Configuration.NameValueSectionHandler, System, Version=2.6.0.0,Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging"/>
</sectionGroup>
<!--quartz配置结束-->
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<appSettings>
<add key="DB" value="MySql"/>
<add key="pushProjectId" value="8a3babf9-5b85-4bad-afcd-b6d39c1b8555"/>
<add key="smsProjectId" value="8a3babf9-5b85-4bad-afcd-b6d39c1b8555"/>
<add key="SMSMessage" value="【91Trial】您的验证码为:{0}(此验证码15分钟内有效)"/>
<add key="SMSMessageSigna" value="【91Trial】{0}"/>
<add key="TokenId" value="eee3ee56-a04d-11e6-8893-00155d00f055"/>
<add key="activemq" value="192.168.0.211"/>
</appSettings>
<connectionStrings>
<!--<add name="ReadConnStr" connectionString="Server=139.224.119.75;Database=db_edcls;Uid=user;Pwd=Asher1234;" />
<add name="WriteConnStr" connectionString="Server=139.224.119.75;Database=db_edcls;Uid=user;Pwd=Asher1234;" />-->
<add name="ReadConnStr" connectionString="Server=192.168.0.39;Database=db_ashermed_push;Uid=root;Pwd=root;" />
<add name="WriteConnStr" connectionString="Server=192.168.0.39;Database=db_ashermed_push;Uid=root;Pwd=root;" />
<!--<add name="DbEdcDataContext" connectionString="Server=139.224.119.75;Database=db_edcls;Uid=user;Pwd=Asher1234;" />-->
<add name="DbEdcDataContext" connectionString="Server=192.168.0.39;Database=test;Uid=root;Pwd=root;" />
<add name="mongo_edc" connectionString="mongodb://192.168.0.39/db_edc_91trial" />
</connectionStrings>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ISMSService" />
<binding name="PushPfServiceSoap" />
<binding name="EdcMipfServiceSoap" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://tools.ashermed.com/SendMsg/Service/SMSService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISMSService"
contract="SmsService.ISMSService" name="BasicHttpBinding_ISMSService" />
<!--<endpoint address="http://push.91trial.com/PushService/PushPfService.asmx"
binding="basicHttpBinding" bindingConfiguration="PushPfServiceSoap"
contract="pushPfWebserver.PushPfServiceSoap" name="PushPfServiceSoap" />-->
<endpoint address="http://localhost/PushPfWebServer/PushPfService.asmx"
binding="basicHttpBinding" bindingConfiguration="PushPfServiceSoap"
contract="pushPfWebserver.PushPfServiceSoap" name="PushPfServiceSoap" />
<endpoint address="http://xtest.ashermed.cn/MIPFService/EdcMipfService.asmx"
binding="basicHttpBinding" bindingConfiguration="EdcMipfServiceSoap"
contract="MIPFService.EdcMipfServiceSoap" name="EdcMipfServiceSoap" />
</client>
</system.serviceModel>
<common>
<logging>
<factoryAdapter type="Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter, Common.Logging">
<arg key="showLogName" value="true"/>
<arg key="showDataTime" value="true"/>
<arg key="level" value="INFO"/>
<arg key="dateTimeFormat" value="HH:mm:ss:fff"/>
</factoryAdapter>
</logging>
</common>
<quartz>
<add key="quartz.scheduler.instanceName" value="ExampleDefaultQuartzScheduler"/>
<add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz"/>
<add key="quartz.threadPool.threadCount" value="20"/>
<add key="quartz.threadPool.threadPriority" value="2"/>
<add key="quartz.jobStore.misfireThreshold" value="60000"/>
<add key="quartz.jobStore.type" value="Quartz.Simpl.RAMJobStore, Quartz"/>
<!-- sample configuration based db provider -->
<!--<add key="quartz.dbprovider.customProvider.productName" value="Microsoft SQL Server, provider V2.0.0.0 in framework .NET V2.0"/>
<add key="quartz.dbprovider.customProvider.assemblyName" value="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add key="quartz.dbprovider.customProvider.connectionType" value="System.Data.SqlClient.SqlConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add key="quartz.dbprovider.customProvider.commandType" value="System.Data.SqlClient.SqlCommand, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add key="quartz.dbprovider.customProvider.parameterType" value="System.Data.SqlClient.SqlParameter, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add key="quartz.dbprovider.customProvider.commandBuilderType" value="System.Data.SqlClient.SqlCommandBuilder, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add key="quartz.dbprovider.customProvider.parameterDbType" value="System.Data.SqlDbType, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add key="quartz.dbprovider.customProvider.parameterDbTypePropertyName" value="SqlDbType" />
<add key="quartz.dbprovider.customProvider.parameterNamePrefix" value="@" />
<add key="quartz.dbprovider.customProvider.exceptionType" value="System.Data.SqlClient.SqlException, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add key="quartz.dbprovider.customProvider.useParameterNamePrefixInParameterCollection" value="true" />
<add key="quartz.dbprovider.customProvider.bindByName" value="true" />
<add key="quartz.dbprovider.customProvider.dbBinaryTypeName" value="Image" />-->
</quartz>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
using PushInfo.Core.Models.QueryResults;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PushInfo.Core.Common
{
public class PushValueHelp
{
#region 获得推送体数据属性名称
public static List<string> GetValueProperty(string pushBody)
{
List<string> returnModel = new List<string>();
if(string.IsNullOrEmpty(pushBody))
{
}
int indexNums = 0;
int startIndex = pushBody.IndexOf("[");
int endIndex = 0;
while (startIndex > -1)
{
endIndex = pushBody.IndexOf("]", startIndex + 1);
if (endIndex > -1)
{
string attribute = pushBody.Substring(startIndex + 1, endIndex - startIndex - 1);
if(!returnModel.Contains(attribute))
{
returnModel.Add(attribute);
}
}
else
{
break;
}
startIndex = pushBody.IndexOf("[", endIndex);
if (++indexNums > 100) //防止陷入死循环
{
break;
}
}
return returnModel;
}
#endregion
#region row转DataMessage
public static DataMessage RowToDataMessage(DataTable tableValue, DataRow row)
{
DataMessage dataR = new DataMessage();
if (tableValue.Columns.Contains("userId"))
{
dataR.userId = row["userId"].ToString();
}
if (tableValue.Columns.Contains("clientType"))
{
dataR.clientType = row["clientType"].ToString();
}
if (tableValue.Columns.Contains("clientID"))
{
dataR.clientID = row["clientID"].ToString();
}
if (tableValue.Columns.Contains("loginName"))
{
dataR.loginName = row["loginName"].ToString();
}
if (tableValue.Columns.Contains("realName"))
{
dataR.realName = row["realName"].ToString();
}
if (tableValue.Columns.Contains("mobile"))
{
dataR.mobile = row["mobile"].ToString();
}
if (tableValue.Columns.Contains("openId"))
{
dataR.openId = row["openId"].ToString();
}
if (tableValue.Columns.Contains("projectId"))
{
dataR.projectId = row["projectId"].ToString();
}
return dataR;
}
#endregion
#region 根据数据源将模板字符串转换为数字字符串
/// <summary>
/// 数据源是对象
/// </summary>
/// <returns></returns>
public static string TransfOfDataModel(string configStr, DataMessage data)
{
string returnStr = "";
if(string.IsNullOrEmpty(configStr))
{
return configStr;
}
List<string> valueProList = GetValueProperty(configStr);
if(data.dicValue == null)
{
return configStr;
}
foreach (string proStr in valueProList)
{
if (data.dicValue.ContainsKey(proStr))
{
configStr = configStr.Replace("[" + proStr + "]", data.dicValue[proStr]);
}
}
return returnStr;
}
/// <summary>
/// 数据源是DataTable 里面的Row
/// </summary>
/// <returns></returns>
public static string TransfOfDataRow(string configStr,DataColumnCollection tableColumn, DataRow row)
{
if (string.IsNullOrEmpty(configStr))
{
return configStr;
}
List<string> valueProList = GetValueProperty(configStr);
foreach (string proStr in valueProList)
{
if (tableColumn.Contains(proStr))
{
configStr = configStr.Replace("[" + proStr + "]", row[proStr].ToString());
}
}
return configStr;
}
#endregion
}
}
using DapperORM.Common.Models;
using PushInfo.Act.IDAL;
using PushInfo.Act.Models.QueryResults;
using PushInfo.Act.Models.Tables;
using PushInfo.Core.BLL;
using PushPlatform.Common.Util;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PushInfo.Act.BLL
{
public class PushConfigBLL
{
IMapProjectPushDAL iMPPDAL;
ISysPushDAL spDAL;
ISelectItemDAL siDAL;
/// <summary>
/// 构造函数
/// </summary>
public PushConfigBLL()
{
iMPPDAL = DALFactory.CreateMapProjectPushDAL();
spDAL = DALFactory.CreateSysPushDAL();
siDAL = DALFactory.CreateSelectItemDAL();
}
#region Sys_Push相关业务操作
/// <summary>
/// 获取所有Sys_Push
/// </summary>
/// <returns></returns>
public IEnumerable<Sys_Push> GetAllSysPush()
{
ProjectPushBLL projectPushBll = new ProjectPushBLL();
var pushList = projectPushBll.GetSysPush();
List<Sys_Push> list = new List<Sys_Push>();
pushList.ForEach(x => list.Add(new Sys_Push(x)));
return list;
}
/// <summary>
/// 根据Id获取Sys_Push
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public Sys_Push GetSysPushById(string pushId)
{
var result = spDAL.GetSysPush(pushId);
if (result != null)
return result.Data;
else
return null;
}
/// <summary>
/// 根据id获取模板
/// </summary>
/// <param name="pushId"></param>
/// <returns></returns>
public PushConfigResult GetPushTempletById(string pushId)
{
PushConfigResult pushConfig = new PushConfigResult();
var result = spDAL.GetSysPush(pushId);
if (result == null) return null;
ObjectHelper.CopyProperties(result.Data, pushConfig);
return pushConfig;
}
/// <summary>
/// 分页获取syspush列表
/// </summary>
/// <param name="pageIndex"></param>
/// <returns></returns>
public PageListModel<Sys_Push> GetPushByPage(int pageIndex)
{
return spDAL.GetSysPushListByPage(pageIndex);
}
/// <summary>
/// 分页获取推送配置模板列表,并以通用模型返回
/// </summary>
/// <param name="pageIndex"></param>
/// <returns></returns>
public PageListModel<PushConfigResult> GetPushTempletList(int pageIndex)
{
PageListModel<PushConfigResult> result = new PageListModel<PushConfigResult>();
result.Data = new List<PushConfigResult>();
PageListModel<Sys_Push> pageList = GetPushByPage(pageIndex);
ObjectHelper.CopyProperties(pageList, result, new List<string> { "Data" });
pageList.Data.ForEach(x =>
{
PushConfigResult pushConfig = new PushConfigResult();
ObjectHelper.CopyProperties(x, pushConfig);
result.Data.Add(pushConfig);
});
return result;
}
/// <summary>
/// 保存Sys_Push
/// </summary>
/// <param name="pushConfig"></param>
/// <returns></returns>
public ResultModel SaveSysPush(Sys_Push pushConfig)
{
//TODO
pushConfig.Create_Time = DateTime.Now;
return spDAL.SaveSysPush(pushConfig);
}
/// <summary>
/// 修改Sys_Push
/// </summary>
/// <param name="pushConfig"></param>
/// <returns></returns>
public ResultModel UpdateSysPush(Sys_Push pushConfig)
{
//TODO
pushConfig.Update_Time = DateTime.Now;
return spDAL.UpdateSysPush(pushConfig);
}
/// <summary>
/// 逻辑删除Sys_Push
/// </summary>
/// <param name="pushId"></param>
/// <returns></returns>
public ResultModel DeleteSysPush(string pushId)
{
if (!IsPushTempletUsed(pushId))
return new ResultModel(0, "当前模板已被使用,不能删除");
return spDAL.DeleteSysPush(pushId);
}
#endregion
#region MapProjectPush相关业务操作
/// <summary>
/// 根据项目获取Map_Project_Push列表
/// </summary>
/// <param name="projId"></param>
/// <returns></returns>
public IEnumerable<Map_Project_Push> GetMapProjectPushList(string projId)
{
var result = iMPPDAL.GetPushListByProjectId(projId);
if (result != null)
return result.Data;
else
return new List<Map_Project_Push>();
}
/// <summary>
/// 根据id获取Map_Project_Push
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public Map_Project_Push GetMapProjectPushById(string id)
{
var result = iMPPDAL.GetPushById(id);
if (result != null)
return result.Data;
else
return null;
}
/// <summary>
/// 根据id获取用户的推送配置
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public PushConfigResult GetConfigById(string id)
{
PushConfigResult pushConfig = new PushConfigResult();
var result = iMPPDAL.GetPushById(id);
if (result == null) return null;
ObjectHelper.CopyProperties(result.Data, pushConfig);
return pushConfig;
}
/// <summary>
/// 分页获取Map_Project_Push
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="projId"></param>
/// <returns></returns>
public PageListModel<Map_Project_Push> GetMapProjectPushByPage(int pageIndex, string projId)
{
return iMPPDAL.GetPushListByPage(pageIndex, projId);
}
/// <summary>
/// 获取推送配置列表,并以通用结果返回
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="projId"></param>
/// <returns></returns>
public PageListModel<PushConfigResult> GetPushConfigByPage(int pageIndex, string projId)
{
PageListModel<PushConfigResult> result = new PageListModel<PushConfigResult>();
result.Data = new List<PushConfigResult>();
PageListModel<Map_Project_Push> pageList = GetMapProjectPushByPage(pageIndex, projId);
ObjectHelper.CopyProperties(pageList, result, new List<string> { "Data" });
pageList.Data.ForEach(x =>
{
PushConfigResult pushConfig = new PushConfigResult();
ObjectHelper.CopyProperties(x, pushConfig);
result.Data.Add(pushConfig);
});
return result;
}
/// <summary>
/// 保存Map_Project_Push
/// </summary>
/// <param name="mpp"></param>
/// <returns></returns>
public ResultModel SaveMapProjectPush(Map_Project_Push mpp)
{
//TODO 各种判断
return iMPPDAL.SaveMapProjectPush(mpp);
}
/// <summary>
/// 修改Map_Project_Push
/// </summary>
/// <param name="mpp"></param>
/// <returns></returns>
public ResultModel UpdateMapProjectPush(Map_Project_Push mpp)
{
//TODO 各种判断
return iMPPDAL.UpdateMapProjectPush(mpp);
}
/// <summary>
/// 修改Map_Project_Push
/// </summary>
/// <param name="mpp"></param>
/// <returns></returns>
public ResultModel UpdateMapProPushState(string pushCfjId, int state)
{
//TODO 各种判断
Map_Project_Push mpp = new Map_Project_Push();
mpp.Id = pushCfjId;
mpp.Exec_Status = state;
return iMPPDAL.UpdateMapProPushState(mpp);
}
/// <summary>
/// 删除Map_Project_Push
/// </summary>
/// <param name="mppid"></param>
/// <returns></returns>
public ResultModel DeleteMapProjectPushById(string mppid)
{
return iMPPDAL.DeleteMapProjectPushById(mppid);
}
/// <summary>
/// 判断当前模板是否在用
/// </summary>
/// <param name="pushId"></param>
/// <returns></returns>
public bool IsPushTempletUsed(string pushId)
{
var result = iMPPDAL.GetCountByPushId(pushId);
return result != null && result.Result > 0;
}
#endregion
/// <summary>
/// 获取推送配置中动态添加的选项
/// </summary>
/// <returns></returns>
public IEnumerable<SelectItemDetail> GetCycleDetailList()
{
var result = siDAL.GetCycleDetail();
if (result != null)
return result.Data;
else
return new List<SelectItemDetail>();
}
}
}
@{
ViewBag.Title = "Contact";
}
<h2>@ViewBag.Title.</h2>
<h3>@ViewBag.Message</h3>
<address>
One Microsoft Way<br />
Redmond, WA 98052-6399<br />
<abbr title="Phone">P:</abbr>
425.555.0100
</address>
<address>
<strong>Support:</strong> <a href="mailto:Support@example.com">Support@example.com</a><br />
<strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a>
</address>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment