yuanrf 16 小時之前
父節點
當前提交
8d52e58589

+ 7 - 6
OASystem/OASystem.Api/Controllers/TaskController.cs

@@ -11,6 +11,7 @@ using OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice;
 using Dm.util;
 using OASystem.API.OAMethodLib.DoubaoAPI;
 using OASystem.API.OAMethodLib.QiYeWeChatAPI;
+using OASystem.Domain.Dtos.QiYeWeChat;
 
 namespace OASystem.API.Controllers
 {
@@ -1122,15 +1123,15 @@ namespace OASystem.API.Controllers
         }
 
         [HttpPost]
-        public async Task<IActionResult> TestQiYeWeChat()
+        public async Task<IActionResult> TestQiYeWeChat(DateTime startDt, DateTime endDt, int cursor = 0, int limit = 10)
         {
             var jw = JsonView(false);
-            DateTime now = DateTime.Now;
-            DateTime startDt = now.AddMonths(-1);
-            long starttime = (long)(startDt.ToUniversalTime().Ticks - 621355968000000000) / 10000000;
-            long endtime = (long)(now.ToUniversalTime().Ticks - 621355968000000000) / 10000000;
+            List<JournalFilter> filters = new List<JournalFilter>()
+            {
+                new JournalFilter() { key = JournalFilterKey.template_id, value = "C4Rby4W2jqwk9mfiN3fZbQZHaawzwNZgn8vdt4g8y" }
+            };
 
-            var result = await _qiYeWeChatApiService.GetJournalRecordListAsync(starttime, endtime);
+            var result = await _qiYeWeChatApiService.GetJournalRecordListAsync(startDt, endDt, cursor, limit, filters);
             jw.Code = 200;
             jw.Msg = "SUCCESS!";
             jw.Data = result;

+ 3 - 3
OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/IQiYeWeChatApiService.cs

@@ -181,13 +181,13 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI
         /// <summary>
         /// 批量获取汇报记录单号
         /// </summary>
-        /// <param name="starttime">开始时间</param>
-        /// <param name="endtime">结束时间</param>
+        /// <param name="startTime">开始时间</param>
+        /// <param name="endTime">结束时间</param>
         /// <param name="cursor">游标</param>
         /// <param name="limit">拉取条数</param>
         /// <param name="filters">过滤条件</param>
         /// <returns></returns>
-        Task<JournalRecordListView> GetJournalRecordListAsync(long starttime, long endtime, int cursor = 0, int limit = 10, List<JournalFilter> filters = null);
+        Task<JournalRecordListView> GetJournalRecordListAsync(DateTime startTime, DateTime endTime, int cursor = 0, int limit = 10, List<JournalFilter> filters = null);
 
         /// <summary>
         /// 获取汇报记录详情

+ 6 - 3
OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/QiYeWeChatApiService.cs

@@ -1669,16 +1669,19 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI
         /// <summary>
         /// 批量获取汇报记录单号
         /// </summary>
-        /// <param name="starttime"></param>
-        /// <param name="endtime"></param>
+        /// <param name="startTime">开始时间</param>
+        /// <param name="endTime">结束时间</param>
         /// <param name="cursor"></param>
         /// <param name="limit"></param>
         /// <param name="filters"></param>
         /// <returns></returns>
-        public async Task<JournalRecordListView> GetJournalRecordListAsync(long starttime, long endtime, int cursor = 0, int limit = 10, List<JournalFilter> filters = null)
+        public async Task<JournalRecordListView> GetJournalRecordListAsync(DateTime startTime, DateTime endTime, int cursor = 0, int limit = 10, List<JournalFilter> filters = null)
         {
             JournalRecordListView result = new JournalRecordListView();
 
+            long starttime = (long)(startTime - _1970).TotalSeconds;
+            long endtime = (long)(endTime - _1970).TotalSeconds;
+
             //获取汇报数据 token (Type = 7)
             Access_TokenView access_Token = await GetTokenAsync(7);
             if (access_Token.errcode != 0)