2 Commits 996adb4e58 ... 14db710c73

Author SHA1 Message Date
  jiangjc 14db710c73 Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop 2 months ago
  jiangjc ae5b93e7a1 APNs_Step1 2 months ago

+ 12 - 0
OASystem/OASystem.Api/Controllers/PersonnelModuleController.cs

@@ -2,6 +2,7 @@
 using FluentValidation;
 using Microsoft.AspNetCore.SignalR;
 using OASystem.API.OAMethodLib;
+using OASystem.API.OAMethodLib.APNs;
 using OASystem.API.OAMethodLib.Hub.HubClients;
 using OASystem.API.OAMethodLib.Hub.Hubs;
 using OASystem.API.OAMethodLib.QiYeWeChatAPI;
@@ -2331,6 +2332,17 @@ OPTION (MAXRECURSION 0); -- 允许无限递归      ";
             return Ok(jw);
         }
 
+        [HttpPost]
+        public IActionResult TempTest(QueryAssessmentSettingListOffsetAsyncDto Dto)
+        {
+            var jw = JsonView(false);
+
+
+            APNsLib.pushMsg("com.panamerican.oa2024", "db151df1d25823f84323c4597c5672460a983d49ba039c7ff54c4c8e36edd5c6", NotificationType.Alert, "测试", "测试字标题", "测试内容");
+
+            return Ok(jw);
+        }
+
         #endregion
     }
 }

+ 15 - 0
OASystem/OASystem.Api/OAMethodLib/APNs/APNsLib.cs

@@ -0,0 +1,15 @@
+
+namespace OASystem.API.OAMethodLib.APNs
+{
+    public static class APNsLib
+    {
+        private static readonly IAPNsService _APNsService = AutofacIocManager.Instance.GetService<IAPNsService>();
+
+        public static bool pushMsg(string apnsTopic, string deviceToken, NotificationType type, string title, string subtitle, string body)
+        {
+            _APNsService.PushNotification(apnsTopic, deviceToken, type, title, subtitle, body);
+
+            return true;
+        }
+    }
+}

+ 185 - 0
OASystem/OASystem.Api/OAMethodLib/APNs/APNsService.cs

@@ -0,0 +1,185 @@
+using System.Security.Claims;
+using System.Security.Cryptography;
+using Microsoft.IdentityModel.Tokens;
+using System.IdentityModel.Tokens.Jwt;
+using static System.Net.Mime.MediaTypeNames;
+using Microsoft.Net.Http.Headers;
+using Microsoft.Extensions.Configuration;
+using NPOI.SS.Formula.Functions;
+
+namespace OASystem.API.OAMethodLib.APNs
+{
+    public enum NotificationType : int
+    {
+        Alert = 0,
+        Sound = 1,
+        Badge = 2,
+        Silent = 3
+    }
+
+    /// <summary>
+    /// APNs 生成 JWT token,添加服务的时候,使用单利
+    /// </summary>
+    public class APNsService : IAPNsService
+    {
+        static string token = null;
+        static string baseUrl = null;
+
+        private readonly IConfiguration _configuration;
+        private readonly IHttpClientFactory _httpClientFactory;
+        public APNsService(IConfiguration configuration, IHttpClientFactory httpClientFactory)
+        {
+            this._configuration = configuration;
+            this._httpClientFactory = httpClientFactory;
+
+            //APNsService.baseUrl = this._configuration["apple:pushNotificationServer"];
+            APNsService.baseUrl = this._configuration["apple:pushNotificationServer_Production"];
+        }
+
+        /// <summary>
+        /// 生成 APNs JWT token
+        /// </summary>
+        /// <returns></returns>
+        public string GetnerateAPNsJWTToken()
+        {
+            return this.GetnerateAPNsJWTToken(APNsService.token);
+        }
+
+        /// <summary>
+        /// 生成 APNs JWT token
+        /// </summary>
+        /// <returns></returns>
+        private string GetnerateAPNsJWTToken(string oldToken)
+        {
+            var tokenHandler = new JwtSecurityTokenHandler();
+            var iat = ((DateTime.UtcNow.Ticks - new DateTime(1970, 1, 1).Ticks) / TimeSpan.TicksPerSecond);
+
+            // 判断原 token 是否超过 50 分钟,如果未超过,直接返回
+            if (string.IsNullOrWhiteSpace(oldToken) == false)
+            {
+                JwtPayload oldPayload = tokenHandler.ReadJwtToken(oldToken).Payload;
+                var oldIat = oldPayload.Claims.FirstOrDefault(c => c.Type == "iat");
+                if (oldIat != null)
+                {
+                    if (long.TryParse(oldIat.Value, out long oldIatValue) == true)
+                    {
+                        // 两次间隔小于 50 分钟,使用原 token
+                        if ((iat - oldIatValue) < (50 * 60))
+                        {
+                            return oldToken;
+                        }
+                    }
+                }
+            }
+
+            var kid = _configuration["apple:kid"];
+            var securityKey = _configuration["apple:securityKey"].Replace("\n", "");
+            var iss = _configuration["apple:iss"];
+
+            var claims = new Claim[]
+            {
+            new Claim("iss", iss),
+            new Claim("iat", iat.ToString())
+            };
+
+            var eCDsa = ECDsa.Create();
+
+            eCDsa.ImportPkcs8PrivateKey(Convert.FromBase64String(securityKey), out _);
+
+            var key = new ECDsaSecurityKey(eCDsa);
+
+            key.KeyId = kid;
+
+            var signingCredentials = new SigningCredentials(key, SecurityAlgorithms.EcdsaSha256);
+            var jwtHeader = new JwtHeader(signingCredentials);
+            var jwtPayload = new JwtPayload(claims);
+
+            var jwtSecurityToken = new JwtSecurityToken(jwtHeader, jwtPayload);
+
+            APNsService.token = tokenHandler.WriteToken(jwtSecurityToken);
+
+            return APNsService.token;
+        }
+
+        /// <summary>
+        /// 发送推送通知
+        /// </summary>
+        /// <param name="apnsTopic">APP Id</param>
+        /// <param name="deviceToken">设备标识</param>
+        /// <param name="type">通知类型</param>
+        /// <param name="title">标题</param>
+        /// <param name="subtitle">子标题</param>
+        /// <param name="body">通知内容</param>
+        /// <returns></returns>
+        public async Task<string> PushNotification(string apnsTopic, string deviceToken, NotificationType type, string title, string subtitle, string body)
+        {
+            var responseData = FailedAPNsReponseData();
+            var token = this.GetnerateAPNsJWTToken();
+            var httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, APNsService.baseUrl + deviceToken)
+            {
+                Headers =
+            {
+                { HeaderNames.Authorization, "bearer " +  token },
+                { "apns-topic", apnsTopic },
+                { "apns-expiration", "0" }
+            },
+                Version = new Version(2, 0)
+            };
+
+            var notContent = new
+            {
+                aps = new
+                {
+                    alert = new
+                    {
+                        title = title,
+                        subtitle = subtitle,
+                        body = body
+                    }
+                }
+            };
+            //var content = new StringContent(JsonSerializerTool.SerializeDefault(notContent), System.Text.Encoding.UTF8, Application.Json);
+
+            var content = new StringContent(System.Text.Json.JsonSerializer.Serialize(notContent));
+
+            httpRequestMessage.Content = content;
+
+            var httpClient = _httpClientFactory.CreateClient();
+            try
+            {
+                var httpResponseMessage = await httpClient.SendAsync(httpRequestMessage);
+
+                if (httpResponseMessage.IsSuccessStatusCode)
+                {
+                    responseData.Code = 200;
+                    return System.Text.Json.JsonSerializer.Serialize(responseData);
+                }
+                else
+                {
+                    responseData.Data = httpResponseMessage.StatusCode;
+                    return System.Text.Json.JsonSerializer.Serialize(responseData);
+                }
+            }
+            catch (Exception e)
+            {
+                responseData.Data = e.Message;
+                return System.Text.Json.JsonSerializer.Serialize(responseData);
+            }
+        }
+
+        public APNsReponseData FailedAPNsReponseData()
+        {
+            return new APNsReponseData() { Code = 400, Data = "" };
+        }
+    }
+
+    public class APNsReponseData
+    {
+        public int Code { get; set; } = 0;
+
+        public object Data { get; set; } = "";
+
+    }
+
+   
+}

+ 23 - 0
OASystem/OASystem.Api/OAMethodLib/APNs/IAPNsService.cs

@@ -0,0 +1,23 @@
+namespace OASystem.API.OAMethodLib.APNs
+{
+    public interface IAPNsService
+    {
+        /// <summary>
+        /// 生成 APNs JWT token
+        /// </summary>
+        /// <returns></returns>
+        string GetnerateAPNsJWTToken();
+
+        /// <summary>
+        /// 发送推送通知
+        /// </summary>
+        /// <param name="apnsTopic">APP Id</param>
+        /// <param name="deviceToken">设备标识</param>
+        /// <param name="type">通知类型</param>
+        /// <param name="title">标题</param>
+        /// <param name="subtitle">子标题</param>
+        /// <param name="body">通知内容</param>
+        /// <returns></returns>
+        Task<string> PushNotification(string apnsTopic, string deviceToken, NotificationType type, string title, string subtitle, string body);
+    }
+}

+ 3 - 0
OASystem/OASystem.Api/Program.cs

@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core;
 using Microsoft.Extensions.DependencyInjection.Extensions;
 using OASystem.API.Middlewares;
 using OASystem.API.OAMethodLib;
+using OASystem.API.OAMethodLib.APNs;
 using OASystem.API.OAMethodLib.Hub.Hubs;
 using OASystem.API.OAMethodLib.JuHeAPI;
 using OASystem.API.OAMethodLib.QiYeWeChatAPI;
@@ -339,6 +340,8 @@ builder.Services.AddSingleton<IJobFactory, IOCJobFactory>();
 
 #endregion
 
+builder.Services.AddSingleton<IAPNsService,APNsService>();
+
 #region SignalR
 builder.Services.AddSignalR()
                 .AddJsonProtocol(options =>

+ 356 - 351
OASystem/OASystem.Api/appsettings.json

@@ -1,364 +1,369 @@
 {
-  "ConnectionStrings": {
-    "OA2023DB": "server=132.232.92.186;uid=sa;pwd=Yjx@158291;database=OA2023DB;MultipleActiveResultSets=True;",
-    "OA2014DB": "server=132.232.92.186;uid=sa;pwd=Yjx@158291;database=OA2014;MultipleActiveResultSets=True;"
-  },
-  "JwtSecurityKey": "48d3f4fe770940a1068052f581536b81", //jwt密钥
-  "UseSwagger": "true", //启用Swagger
-  "GroupsConfig": {
-    "AutoCreate": "4",
-    "Leader": "149",
-    "ExBeginDays": "3",
-    "ExEndDays": "30",
-    "DefaultUser": "51",
-    "Boss": "21",
-    "FilterUser": "51,180"
-  },
-  "DeleReminderConfig": {
-    "PhoneNumber": "17380669807,13683474118,18780121225",
-    "Test": "18477317582"
-  },
-  "RateCurrency": [
-    {
-      "CurrencyName": "人民币",
-      "CurrencyCode": "CNY"
-    },
-    {
-      "CurrencyName": "美元",
-      "CurrencyCode": "USD"
-    },
-    {
-      "CurrencyName": "欧元",
-      "CurrencyCode": "EUR"
-    },
-    {
-      "CurrencyName": "港币",
-      "CurrencyCode": "HKD"
-    },
-    {
-      "CurrencyName": "日元",
-      "CurrencyCode": "JPY"
-    },
-    {
-      "CurrencyName": "英镑",
-      "CurrencyCode": "GBP"
-    },
-    {
-      "CurrencyName": "澳大利亚元",
-      "CurrencyCode": "AUD"
-    },
-    {
-      "CurrencyName": "加拿大元",
-      "CurrencyCode": "CAD"
-    },
-    {
-      "CurrencyName": "泰国铢",
-      "CurrencyCode": "THB"
-    },
-    {
-      "CurrencyName": "新加坡元",
-      "CurrencyCode": "SGD"
-    },
-    {
-      "CurrencyName": "瑞士法郎",
-      "CurrencyCode": "CHK"
-    },
-    {
-      "CurrencyName": "丹麦克朗",
-      "CurrencyCode": "DKK"
-    },
-    {
-      "CurrencyName": "澳门元",
-      "CurrencyCode": "MOP"
-    },
-    {
-      "CurrencyName": "林吉特",
-      "CurrencyCode": "MYR"
-    },
-    {
-      "CurrencyName": "挪威克朗",
-      "CurrencyCode": "NOK"
-    },
-    {
-      "CurrencyName": "新西兰元",
-      "CurrencyCode": "NZD"
-    },
-    {
-      "CurrencyName": "卢布",
-      "CurrencyCode": "RUB"
-    },
-    {
-      "CurrencyName": "瑞典克朗",
-      "CurrencyCode": "SEK"
-    },
-    {
-      "CurrencyName": "菲律宾比索",
-      "CurrencyCode": "PHP"
-    },
-    {
-      "CurrencyName": "新台币",
-      "CurrencyCode": "TWD"
-    },
-    {
-      "CurrencyName": "巴西雷亚尔",
-      "CurrencyCode": "BRL"
-    },
-    {
-      "CurrencyName": "韩国元",
-      "CurrencyCode": "ZAR"
-    }
-  ],
-  "ExcelBaseUrl": "http://132.232.92.186:24/",
-  "ExcelBasePath": "D:/FTP/File/OA2023/Office/Excel/",
-  "ExcelFtpPath": "Office/Excel/",
-  "OfficeBaseUrl": "http://132.232.92.186:24/",
-  "OfficeTempBasePath": "D:/FTP/File/OA2023/Office/",
+    "ConnectionStrings": {
+        "OA2023DB": "server=132.232.92.186;uid=sa;pwd=Yjx@158291;database=OA2023DB;MultipleActiveResultSets=True;",
+        "OA2014DB": "server=132.232.92.186;uid=sa;pwd=Yjx@158291;database=OA2014;MultipleActiveResultSets=True;"
+    },
+    "JwtSecurityKey": "48d3f4fe770940a1068052f581536b81", //jwt密钥
+    "UseSwagger": "true", //启用Swagger
+    "GroupsConfig": {
+        "AutoCreate": "4",
+        "Leader": "149",
+        "ExBeginDays": "3",
+        "ExEndDays": "30",
+        "DefaultUser": "51",
+        "Boss": "21",
+        "FilterUser": "51,180"
+    },
+    "apple:securityKey": "MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQglyUl7hjI75YJUVMbZLN6TpkiFzuTXUN+UIjuJA7+y8ugCgYIKoZIzj0DAQehRANCAAS8GR7lKNst4KENCp45OXCMyiytvzK0qdRBrx0l+bMaHjiU+Upfox82G+Xy4wd8hI+0wMDh341aNelqEdYUUx3O",
+    "apple:kid": "RMV7Y4KM9V",
+    "apple:iss": "HKF372JSMK",
+    "apple:pushNotificationServer": "https://api.sandbox.push.apple.com:443/3/device/",
+    "apple:pushNotificationServer_Production": "https://api.push.apple.com:443/3/device/",
+    "DeleReminderConfig": {
+        "PhoneNumber": "17380669807,13683474118,18780121225",
+        "Test": "18477317582"
+    },
+    "RateCurrency": [
+        {
+            "CurrencyName": "人民币",
+            "CurrencyCode": "CNY"
+        },
+        {
+            "CurrencyName": "美元",
+            "CurrencyCode": "USD"
+        },
+        {
+            "CurrencyName": "欧元",
+            "CurrencyCode": "EUR"
+        },
+        {
+            "CurrencyName": "港币",
+            "CurrencyCode": "HKD"
+        },
+        {
+            "CurrencyName": "日元",
+            "CurrencyCode": "JPY"
+        },
+        {
+            "CurrencyName": "英镑",
+            "CurrencyCode": "GBP"
+        },
+        {
+            "CurrencyName": "澳大利亚元",
+            "CurrencyCode": "AUD"
+        },
+        {
+            "CurrencyName": "加拿大元",
+            "CurrencyCode": "CAD"
+        },
+        {
+            "CurrencyName": "泰国铢",
+            "CurrencyCode": "THB"
+        },
+        {
+            "CurrencyName": "新加坡元",
+            "CurrencyCode": "SGD"
+        },
+        {
+            "CurrencyName": "瑞士法郎",
+            "CurrencyCode": "CHK"
+        },
+        {
+            "CurrencyName": "丹麦克朗",
+            "CurrencyCode": "DKK"
+        },
+        {
+            "CurrencyName": "澳门元",
+            "CurrencyCode": "MOP"
+        },
+        {
+            "CurrencyName": "林吉特",
+            "CurrencyCode": "MYR"
+        },
+        {
+            "CurrencyName": "挪威克朗",
+            "CurrencyCode": "NOK"
+        },
+        {
+            "CurrencyName": "新西兰元",
+            "CurrencyCode": "NZD"
+        },
+        {
+            "CurrencyName": "卢布",
+            "CurrencyCode": "RUB"
+        },
+        {
+            "CurrencyName": "瑞典克朗",
+            "CurrencyCode": "SEK"
+        },
+        {
+            "CurrencyName": "菲律宾比索",
+            "CurrencyCode": "PHP"
+        },
+        {
+            "CurrencyName": "新台币",
+            "CurrencyCode": "TWD"
+        },
+        {
+            "CurrencyName": "巴西雷亚尔",
+            "CurrencyCode": "BRL"
+        },
+        {
+            "CurrencyName": "韩国元",
+            "CurrencyCode": "ZAR"
+        }
+    ],
+    "ExcelBaseUrl": "http://132.232.92.186:24/",
+    "ExcelBasePath": "D:/FTP/File/OA2023/Office/Excel/",
+    "ExcelFtpPath": "Office/Excel/",
+    "OfficeBaseUrl": "http://132.232.92.186:24/",
+    "OfficeTempBasePath": "D:/FTP/File/OA2023/Office/",
 
-  "WordBaseUrl": "http://132.232.92.186:24/",
-  "WordBasePath": "D:/FTP/File/OA2023/Office/Word/",
-  "WordFtpPath": "Office/Word/",
+    "WordBaseUrl": "http://132.232.92.186:24/",
+    "WordBasePath": "D:/FTP/File/OA2023/Office/Word/",
+    "WordFtpPath": "Office/Word/",
 
-  "GrpFileBaseUrl": "http://132.232.92.186:24/",
-  "GrpFileBasePath": "D:/FTP/File/OA2023/Office/GrpFile/",
-  "GrpFileFtpPath": "Office/GrpFile/",
+    "GrpFileBaseUrl": "http://132.232.92.186:24/",
+    "GrpFileBasePath": "D:/FTP/File/OA2023/Office/GrpFile/",
+    "GrpFileFtpPath": "Office/GrpFile/",
 
-  "ExcelTempPath": "D:/FTP/File/OA2023/Office/Excel/Template/",
-  "GrpListFileBasePath": "D:/FTP/File/OA2023/Office/GrpFile/GroupList/",
-  "GrpListFileFtpPath": "Office/GrpFile/GroupList/",
-  //D:\FTP\File\OA2023\Office\GrpFile
-  "VisaProgressImageBaseUrl": "http://132.232.92.186:24/",
-  "VisaProgressImageBasePath": "D:/FTP/File/OA2023/Image/Visa/",
-  "VisaProgressImageFtpPath": "Image/Visa/",
+    "ExcelTempPath": "D:/FTP/File/OA2023/Office/Excel/Template/",
+    "GrpListFileBasePath": "D:/FTP/File/OA2023/Office/GrpFile/GroupList/",
+    "GrpListFileFtpPath": "Office/GrpFile/GroupList/",
+    //D:\FTP\File\OA2023\Office\GrpFile
+    "VisaProgressImageBaseUrl": "http://132.232.92.186:24/",
+    "VisaProgressImageBasePath": "D:/FTP/File/OA2023/Image/Visa/",
+    "VisaProgressImageFtpPath": "Image/Visa/",
 
-  "WageSheetExcelBaseUrl": "http://132.232.92.186:24/",
-  "WageSheetExcelFptPath": "D:/FTP/File/OA2023/Office/WageSheetFile/",
+    "WageSheetExcelBaseUrl": "http://132.232.92.186:24/",
+    "WageSheetExcelFptPath": "D:/FTP/File/OA2023/Office/WageSheetFile/",
 
-  "WageSheetTaxExcelBaseUrl": "http://132.232.92.186:24/",
-  "WageSheetTaxExcelFptPath": "D:/FTP/File/OA2023/Office/Excel/WageSheetTaxFile/",
+    "WageSheetTaxExcelBaseUrl": "http://132.232.92.186:24/",
+    "WageSheetTaxExcelFptPath": "D:/FTP/File/OA2023/Office/Excel/WageSheetTaxFile/",
 
-  "CTableCorrelationPageDatas": [
-    {
-      "CTableId": 76, //CtableId 酒店预订
-      "PageIdDatas": [ //页面Ids
-        28
-      ]
-    },
-    {
-      "CTableId": 77, //CtableId  行程
-      "PageIdDatas": [ //页面Id
-      ]
-    },
-    {
-      "CTableId": 79, //CtableId 车/导游地接
-      "PageIdDatas": [ //页面Id
-        30
-      ]
-    },
-    {
-      "CTableId": 80, //CtableId  签证
-      "PageIdDatas": [ //页面Id
-      ]
-    },
-    {
-      "CTableId": 81, //CtableId 邀请/公务活动
-      "PageIdDatas": [ //页面Id
-      ]
-    },
-    {
-      "CTableId": 82, //CtableId 团组客户保险
-      "PageIdDatas": [ //页面Id
-      ]
-    },
-    {
-      "CTableId": 85, //CtableId 机票预订
-      "PageIdDatas": [ //页面Id
-      ]
-    },
-    {
-      "CTableId": 98, //CtableId 其他款项
-      "PageIdDatas": [ //页面Id
-        69
-      ]
-    },
-    {
-      "CTableId": 285, //CtableId 其他款项与收款退还
-      "PageIdDatas": [ //页面Id
-        //69
-      ]
-    },
-    {
-      "CTableId": 751, //CtableId 酒店早餐
-      "PageIdDatas": [ //页面Id
-      ]
-    },
-    {
-      "CTableId": 1015, //CtableId 超支费用
-      "PageIdDatas": [ //页面Id
-        174
-      ]
-    }
-  ],
+    "CTableCorrelationPageDatas": [
+        {
+            "CTableId": 76, //CtableId 酒店预订
+            "PageIdDatas": [ //页面Ids
+                28
+            ]
+        },
+        {
+            "CTableId": 77, //CtableId  行程
+            "PageIdDatas": [ //页面Id
+            ]
+        },
+        {
+            "CTableId": 79, //CtableId 车/导游地接
+            "PageIdDatas": [ //页面Id
+                30
+            ]
+        },
+        {
+            "CTableId": 80, //CtableId  签证
+            "PageIdDatas": [ //页面Id
+            ]
+        },
+        {
+            "CTableId": 81, //CtableId 邀请/公务活动
+            "PageIdDatas": [ //页面Id
+            ]
+        },
+        {
+            "CTableId": 82, //CtableId 团组客户保险
+            "PageIdDatas": [ //页面Id
+            ]
+        },
+        {
+            "CTableId": 85, //CtableId 机票预订
+            "PageIdDatas": [ //页面Id
+            ]
+        },
+        {
+            "CTableId": 98, //CtableId 其他款项
+            "PageIdDatas": [ //页面Id
+                69
+            ]
+        },
+        {
+            "CTableId": 285, //CtableId 其他款项与收款退还
+            "PageIdDatas": [ //页面Id
+                //69
+            ]
+        },
+        {
+            "CTableId": 751, //CtableId 酒店早餐
+            "PageIdDatas": [ //页面Id
+            ]
+        },
+        {
+            "CTableId": 1015, //CtableId 超支费用
+            "PageIdDatas": [ //页面Id
+                174
+            ]
+        }
+    ],
 
-  //消息通知类型
-  "MessageNotificationType": [
-    {
-      "TypeId": 1022, //系统公告
-      "MsgTypeIds": [
-        1 // 公告消息
-      ]
-    },
-    {
-      "TypeId": 1021, //操作通知
-      "MsgTypeIds": [
-        2, // 团组流程管控消息
-        3, // 团组业务操作消息
-        4, // 团组费用审核消息
-        5 // 团组签证进度更新消息
-      ]
-    },
-    {
-      "TypeId": 1020, //任务通知
-      "MsgTypeIds": [
-        6 //任务进度更新消息
-      ]
-    }
-  ],
+    //消息通知类型
+    "MessageNotificationType": [
+        {
+            "TypeId": 1022, //系统公告
+            "MsgTypeIds": [
+                1 // 公告消息
+            ]
+        },
+        {
+            "TypeId": 1021, //操作通知
+            "MsgTypeIds": [
+                2, // 团组流程管控消息
+                3, // 团组业务操作消息
+                4, // 团组费用审核消息
+                5 // 团组签证进度更新消息
+            ]
+        },
+        {
+            "TypeId": 1020, //任务通知
+            "MsgTypeIds": [
+                6 //任务进度更新消息
+            ]
+        }
+    ],
 
 
-  //职位默认页面权限
-  "DefaultPostPageData": [
-    {
-      "DepId": -1, //部门: 公司公共页面
-      "PostPageAuths": [
-        {
-          "PostId": -1,
-          "PageIds": [
-            42 //Page: 日常费用付款申请
-            //16 //Page: 员工资料列表
-          ]
-        }
-      ]
-    },
-    {
-      "DepId": 0, //部门:人事部,信息部,策划部(部门页面一致归类在一起)
-      "PostPageAuths": [
-        {
-          "PostId": 0, //职位:普通员工(除经理主管外/公共页面)
-          "PageIds": [
-            149 //Page: 主页(员工)
-          ]
-        }
-      ]
-    },
-    {
-      "DepId": 1, //部门: 总经办
-      "PostPageAuths": [
-        {
-          "PostId": 3, //职位: 总经理助理
-          "PageIds": [
-            150 //Page: 主页(总助)
-          ]
-        }
-      ]
-    },
-    {
-      "DepId": 6, //部门:市场部
-      "PostPageAuths": [
-        {
-          "PostId": 21, //职位:普通员工(除经理主管外)
-          "PageIds": [
-            //153, //Page: 主页(市场部)
-            149, //Page: 主页(员工)
-            118, //Page: 出入境费用明细
-            168, //Page: 出入境国家三公费用标准
-            89 //Page: 公司客户资料
-          ]
-        }
-      ]
-    },
-    {
-      "DepId": 3, //部门:财务部
-      "PostPageAuths": [
-        {
-          "PostId": 10, //职位:会计
-          "PageIds": [
-            151 //Page: 主页(财务)
-          ]
-        }
-      ]
-    },
-    {
-      "DepId": 7, //国交部
-      "PostPageAuths": [
-        {
-          "PostId": -1, //职位:部门公共页面
-          "PageIds": [
-            //154, //Page: 主页(国交)
-            40, //Page: 其他款项
-            174 //Page: 超支费用
-          ]
-        },
-        {
-          "PostId": 0, //职位:经理/主管
-          "PageIds": [
-            154, //Page: 主页(国交)
-            27, //Page: 团组操作
-            104, //Page: 接团客户名单
-            118, //Page: 出入境费用明细
-            168 //Page: 出入境国家三公费用标准
-          ]
-        },
-        {
-          "PostId": 26, //职位:签证
-          "PageIds": [
-            149, //Page: 主页(员工)
-            31, //Page: 签证费用录入
-            158, //Page: OCR识别
-            32 //Page: 保险录入
-          ]
-        },
-        {
-          "PostId": 27, //职位:商邀
-          "PageIds": [
-            149, //Page: 主页(员工)
-            25, //Page: 邀请资料
-            29, //Page: 邀请公务费用
-            166, //Page: 公务出访
-            167 //Page:导出邀请函
-          ]
-        },
-        {
-          "PostId": 28, //职位:OP
-          "PageIds": [
-            149, //Page: 主页(员工)
-            24, //Page: 导游地接资料
-            30, //Page: 地接费用录入
-            122, //Page: OP行程单
-            111 //Page: 车公司资料
-          ]
-        },
-        {
-          "PostId": 24, //职位:机票
-          "PageIds": [
-            149, //Page: 主页(员工)
-            114, //Page: 机票行程代码录
-            120, //Page: 三字码资料表
-            160, //Page: 代理出票合作方
-            161 //Page: 机票费用录入
-          ]
-        },
-        {
-          "PostId": 25, //职位:酒店
-          "PageIds": [
-            149, //Page: 主页(员工)
-            23, //Page: 酒店资料 
-            28 //Page: 酒店预订
-          ]
+    //职位默认页面权限
+    "DefaultPostPageData": [
+        {
+            "DepId": -1, //部门: 公司公共页面
+            "PostPageAuths": [
+                {
+                    "PostId": -1,
+                    "PageIds": [
+                        42 //Page: 日常费用付款申请
+                        //16 //Page: 员工资料列表
+                    ]
+                }
+            ]
+        },
+        {
+            "DepId": 0, //部门:人事部,信息部,策划部(部门页面一致归类在一起)
+            "PostPageAuths": [
+                {
+                    "PostId": 0, //职位:普通员工(除经理主管外/公共页面)
+                    "PageIds": [
+                        149 //Page: 主页(员工)
+                    ]
+                }
+            ]
+        },
+        {
+            "DepId": 1, //部门: 总经办
+            "PostPageAuths": [
+                {
+                    "PostId": 3, //职位: 总经理助理
+                    "PageIds": [
+                        150 //Page: 主页(总助)
+                    ]
+                }
+            ]
+        },
+        {
+            "DepId": 6, //部门:市场部
+            "PostPageAuths": [
+                {
+                    "PostId": 21, //职位:普通员工(除经理主管外)
+                    "PageIds": [
+                        //153, //Page: 主页(市场部)
+                        149, //Page: 主页(员工)
+                        118, //Page: 出入境费用明细
+                        168, //Page: 出入境国家三公费用标准
+                        89 //Page: 公司客户资料
+                    ]
+                }
+            ]
+        },
+        {
+            "DepId": 3, //部门:财务部
+            "PostPageAuths": [
+                {
+                    "PostId": 10, //职位:会计
+                    "PageIds": [
+                        151 //Page: 主页(财务)
+                    ]
+                }
+            ]
+        },
+        {
+            "DepId": 7, //国交部
+            "PostPageAuths": [
+                {
+                    "PostId": -1, //职位:部门公共页面
+                    "PageIds": [
+                        //154, //Page: 主页(国交)
+                        40, //Page: 其他款项
+                        174 //Page: 超支费用
+                    ]
+                },
+                {
+                    "PostId": 0, //职位:经理/主管
+                    "PageIds": [
+                        154, //Page: 主页(国交)
+                        27, //Page: 团组操作
+                        104, //Page: 接团客户名单
+                        118, //Page: 出入境费用明细
+                        168 //Page: 出入境国家三公费用标准
+                    ]
+                },
+                {
+                    "PostId": 26, //职位:签证
+                    "PageIds": [
+                        149, //Page: 主页(员工)
+                        31, //Page: 签证费用录入
+                        158, //Page: OCR识别
+                        32 //Page: 保险录入
+                    ]
+                },
+                {
+                    "PostId": 27, //职位:商邀
+                    "PageIds": [
+                        149, //Page: 主页(员工)
+                        25, //Page: 邀请资料
+                        29, //Page: 邀请公务费用
+                        166, //Page: 公务出访
+                        167 //Page:导出邀请函
+                    ]
+                },
+                {
+                    "PostId": 28, //职位:OP
+                    "PageIds": [
+                        149, //Page: 主页(员工)
+                        24, //Page: 导游地接资料
+                        30, //Page: 地接费用录入
+                        122, //Page: OP行程单
+                        111 //Page: 车公司资料
+                    ]
+                },
+                {
+                    "PostId": 24, //职位:机票
+                    "PageIds": [
+                        149, //Page: 主页(员工)
+                        114, //Page: 机票行程代码录
+                        120, //Page: 三字码资料表
+                        160, //Page: 代理出票合作方
+                        161 //Page: 机票费用录入
+                    ]
+                },
+                {
+                    "PostId": 25, //职位:酒店
+                    "PageIds": [
+                        149, //Page: 主页(员工)
+                        23, //Page: 酒店资料 
+                        28 //Page: 酒店预订
+                    ]
+                }
+            ]
         }
-      ]
-    }
-  ],
+    ],
 
-  //日付类型Data
-  "Dailypayment": "666,667"
+    //日付类型Data
+    "Dailypayment": "666,667"
 }