Browse Source

正式环境发版

master
张剑 11 months ago
parent
commit
fe92b2f2d8

+ 3
- 3
XHWK.WKTool/App.config View File

5
   </startup>
5
   </startup>
6
   <appSettings>
6
   <appSettings>
7
     <!--0正式 1测试-->
7
     <!--0正式 1测试-->
8
-    <add key="IsDebug" value="1" />
8
+    <add key="IsDebug" value="0" />
9
     <!--版本号-->
9
     <!--版本号-->
10
-    <add key="VersionCode" value="132" />
11
-    <add key="VersionName" value="3.13.5" />
10
+    <add key="VersionCode" value="133" />
11
+    <add key="VersionName" value="3.13.6" />
12
     <!--皮肤样式 0白 1蓝 2黑色 -->
12
     <!--皮肤样式 0白 1蓝 2黑色 -->
13
     <add key="SkinStyle" value="0" />
13
     <add key="SkinStyle" value="0" />
14
     <!--是否输出视频记录日志:0否-->
14
     <!--是否输出视频记录日志:0否-->

+ 110
- 130
XHWK.WKTool/DAL/DalUpload.cs View File

14
     using system;
14
     using system;
15
 
15
 
16
     /// <summary>
16
     /// <summary>
17
-    /// 上传相关方法 创建人:赵耀 创建时间:2020年9月4日
17
+    ///     上传相关方法 创建人:赵耀 创建时间:2020年9月4日
18
     /// </summary>
18
     /// </summary>
19
     public class DalUpload
19
     public class DalUpload
20
     {
20
     {
22
 
22
 
23
         //private string schoolfileRequestAddress = APP.showImageUrl;
23
         //private string schoolfileRequestAddress = APP.showImageUrl;
24
         /// <summary>
24
         /// <summary>
25
-        /// 文件是否允许上传
25
+        ///     文件是否允许上传
26
         /// </summary>
26
         /// </summary>
27
         /// <param name="md5">
27
         /// <param name="md5">
28
-        /// MD5
28
+        ///     MD5
29
         /// </param>
29
         /// </param>
30
         /// <param name="message">
30
         /// <param name="message">
31
-        /// 错误消息
31
+        ///     错误消息
32
         /// </param>
32
         /// </param>
33
         /// <returns>
33
         /// <returns>
34
         /// </returns>
34
         /// </returns>
65
                     Thread.Sleep(1000);
65
                     Thread.Sleep(1000);
66
                 }
66
                 }
67
             }
67
             }
68
-
69
             string errMessage = "【文件是否存在】(IsUploaded):请求失败。" + message;
68
             string errMessage = "【文件是否存在】(IsUploaded):请求失败。" + message;
70
             LogHelper.Logerror.Error(errMessage, ex);
69
             LogHelper.Logerror.Error(errMessage, ex);
71
             return false;
70
             return false;
72
         }
71
         }
73
 
72
 
74
         /// <summary>
73
         /// <summary>
75
-        /// 上报文件合并指令
74
+        ///     上报文件合并指令
76
         /// </summary>
75
         /// </summary>
77
         /// <param name="savefolder">
76
         /// <param name="savefolder">
78
-        /// 保存文件位置 学校id/resource
77
+        ///     保存文件位置 学校id/resource
79
         /// </param>
78
         /// </param>
80
         /// <param name="fileCode">
79
         /// <param name="fileCode">
81
-        /// 文件唯一编号 Guid
80
+        ///     文件唯一编号 Guid
82
         /// </param>
81
         /// </param>
83
         /// <param name="message">
82
         /// <param name="message">
84
-        /// 错误信息
83
+        ///     错误信息
85
         /// </param>
84
         /// </param>
86
         /// <returns>
85
         /// <returns>
87
         /// </returns>
86
         /// </returns>
88
-        public bool ReportFileMerge(string savefolder, string fileCode, out string message)
87
+        public bool ReportFileMerge
88
+        (
89
+            string savefolder,
90
+            string fileCode,
91
+            out string message
92
+        )
89
         {
93
         {
90
             Exception ex = null;
94
             Exception ex = null;
91
             message = ""; //请求重试5次 共5秒
95
             message = ""; //请求重试5次 共5秒
119
                     Thread.Sleep(1000);
123
                     Thread.Sleep(1000);
120
                 }
124
                 }
121
             }
125
             }
122
-
123
             string errMessage = "【上报合并文件】(ReportFileMerge):请求失败。" + message;
126
             string errMessage = "【上报合并文件】(ReportFileMerge):请求失败。" + message;
124
             LogHelper.Logerror.Error(errMessage, ex);
127
             LogHelper.Logerror.Error(errMessage, ex);
125
             return false;
128
             return false;
126
         }
129
         }
127
 
130
 
128
         /// <summary>
131
         /// <summary>
129
-        /// 上传视频
132
+        ///     上传视频
130
         /// </summary>
133
         /// </summary>
131
         /// <returns>
134
         /// <returns>
132
         /// </returns>
135
         /// </returns>
155
                         break;
158
                         break;
156
                     }
159
                     }
157
                 }
160
                 }
158
-
159
                 if (videoInfo == null)
161
                 if (videoInfo == null)
160
                 {
162
                 {
161
                     errMessage = "未找到课程!";
163
                     errMessage = "未找到课程!";
162
                     return false;
164
                     return false;
163
                 }
165
                 }
164
-
165
                 if (videoInfo.IsUpload)
166
                 if (videoInfo.IsUpload)
166
                 {
167
                 {
167
                     errMessage = "视频已上传";
168
                     errMessage = "视频已上传";
177
         }
178
         }
178
 
179
 
179
         /// <summary>
180
         /// <summary>
180
-        /// 上传视频
181
+        ///     上传视频
181
         /// </summary>
182
         /// </summary>
182
         /// <returns>
183
         /// <returns>
183
         /// </returns>
184
         /// </returns>
206
                         break;
207
                         break;
207
                     }
208
                     }
208
                 }
209
                 }
209
-
210
                 if (videoInfo == null)
210
                 if (videoInfo == null)
211
                 {
211
                 {
212
                     errMessage = "未找到课程!";
212
                     errMessage = "未找到课程!";
218
                     errMessage = "视频已上传";
218
                     errMessage = "视频已上传";
219
                     return false;
219
                     return false;
220
                 }
220
                 }
221
-                else
221
+                if (string.IsNullOrWhiteSpace(videoInfo.FileMD5))
222
                 {
222
                 {
223
-                    if (string.IsNullOrWhiteSpace(videoInfo.FileMD5))
224
-                    {
225
-                        videoInfo.FileMD5 = AesHelper.AesEncrypt(FileToolsCommon.ReadBigFileStr(videoInfo.VideoPath, 1024));
226
-                    }
223
+                    videoInfo.FileMD5 = AesHelper.AesEncrypt(FileToolsCommon.ReadBigFileStr(videoInfo.VideoPath, 1024));
224
+                }
227
 
225
 
228
-                    //视频长度
229
-                    long filelen = FileToolsCommon.GetFileSize(videoInfo.VideoPath);
230
-                    //每片的长度
231
-                    double uploadSliceLenMb = double.Parse(FileToolsCommon.GetConfigValue("UploadSliceLen"));
232
-                    string fileName = FileToolsCommon.GetFileName(videoInfo.VideoPath);
233
-                    //是否续传
234
-                    //分块数为0时 从未上传过
235
-                    if (videoInfo.Block > 0)
226
+                //视频长度
227
+                long filelen = FileToolsCommon.GetFileSize(videoInfo.VideoPath);
228
+                //每片的长度
229
+                double uploadSliceLenMb = double.Parse(FileToolsCommon.GetConfigValue("UploadSliceLen"));
230
+                string fileName = FileToolsCommon.GetFileName(videoInfo.VideoPath);
231
+                //是否续传
232
+                //分块数为0时 从未上传过
233
+                if (videoInfo.Block > 0)
234
+                {
235
+                    //是否已上传所有分块
236
+                    if (videoInfo.Block > videoInfo.Uploaded)
236
                     {
237
                     {
237
-                        //是否已上传所有分块
238
-                        if (videoInfo.Block > videoInfo.Uploaded)
239
-                        {
240
-                            //已上传,未上传完
241
-                        }
242
-                        else
243
-                        {
244
-                            //上传完,未合并
245
-
246
-                            #region 合并文件
247
-
248
-                            //合并文件
249
-                            bool isres = ReportFileMerge
250
-                            (
251
-                                App.UserInfo.cloudcode + "/" + App.UserInfo.Schoolid.ToString() + "/resource",
252
-                                videoInfo.FileGuid,
253
-                                out errMessage
254
-                            );
255
-                            if (isres)
256
-                            {
257
-                                videoInfo.IsUpload = true;
258
-                                return true;
259
-                            }
260
-                            else
261
-                            {
262
-                                return false;
263
-                            }
264
-
265
-                            #endregion 合并文件
266
-                        }
238
+                        //已上传,未上传完
267
                     }
239
                     }
268
                     else
240
                     else
269
                     {
241
                     {
270
-                        //是否允许上传
271
-                        if (IsAllowUploaded(videoInfo.FileMD5, out errMessage))
272
-                        {
273
-                            if (videoInfo.SliceLen == 0)
274
-                            {
275
-                                videoInfo.SliceLen = (long)(uploadSliceLenMb * 1024 * 1024);
276
-                                videoInfo.Block = (int)(filelen / videoInfo.SliceLen +
277
-                                                        (filelen % videoInfo.SliceLen > 0 ? 1 : 0));
278
-                            }
279
-                        }
280
-                        else
281
-                        {
282
-                            //文件在服务器上已存在  空间是否存在未知 若增加空间是否存在判断在此处添加
283
-                            videoInfo.Block = 1;
284
-                            videoInfo.Uploaded = 1;
285
-
286
-                            videoInfo.IsUpload = true;
287
-                            return true;
288
-                        }
289
-                    }
290
-
291
-                    ////临时修改 没有断点续传,每次上传都重新上传。
292
-                    //VideoInfo.Uploaded = 0;
293
-                    {
294
-                        //已上传长度
295
-                        long len;
296
-
297
-                        //分块
298
-                        do
299
-                        {
300
-                            len = videoInfo.Uploaded * videoInfo.SliceLen;
301
-                            //取指定长度的流
302
-                            byte[] byteArray = FileToolsCommon.ReadBigFileSpecifyLength(videoInfo.VideoPath, len,
303
-                                (int)videoInfo.SliceLen);
304
-                            //参数
305
-                            NameValueCollection formFields = new NameValueCollection
306
-                            {
307
-                                { "identifier", videoInfo.FileGuid },
308
-                                { "chunkNumber", (videoInfo.Uploaded + 1).ToString() },
309
-                                { "filename", fileName },
310
-                                { "totalchunk", videoInfo.Block.ToString() },
311
-                                { "md5", videoInfo.FileMD5 }
312
-                            };
313
-                            //formFields.Add();///教材
314
-                            //if()//章节若没选不传
315
-                            //{
316
-                            //    formFields.Add();
317
-                            //}
318
-                            JObject jo = ZHttpUtil.UploadFile(
319
-                                uploadUrl,
320
-                                byteArray,
321
-                                fileName,
322
-                                formFields
323
-                            );
324
-                            //0成功,1失败
325
-                            if (jo["code"]?.ToString() != "0")
326
-                            {
327
-                                errMessage = jo["msg"]?.ToString();
328
-                                return false;
329
-                            }
330
-                            else
331
-                            {
332
-                                videoInfo.Uploaded++;
333
-                            }
334
-                        } while (len + videoInfo.SliceLen < filelen);
242
+                        //上传完,未合并
335
 
243
 
336
                         #region 合并文件
244
                         #region 合并文件
337
 
245
 
338
                         //合并文件
246
                         //合并文件
339
-                        bool isres = ReportFileMerge
340
-                        (
247
+                        bool isres = ReportFileMerge(
341
                             App.UserInfo.cloudcode + "/" + App.UserInfo.Schoolid.ToString() + "/resource",
248
                             App.UserInfo.cloudcode + "/" + App.UserInfo.Schoolid.ToString() + "/resource",
342
                             videoInfo.FileGuid,
249
                             videoInfo.FileGuid,
343
                             out errMessage
250
                             out errMessage
344
                         );
251
                         );
345
                         if (isres)
252
                         if (isres)
346
                         {
253
                         {
347
-                            //VideoInfo.IsUpload = true;
348
                             return true;
254
                             return true;
349
                         }
255
                         }
350
-                        else
256
+                        return false;
257
+
258
+                        #endregion 合并文件
259
+                    }
260
+                }
261
+                else
262
+                {
263
+                    //是否允许上传
264
+                    if (IsAllowUploaded(videoInfo.FileMD5, out errMessage))
265
+                    {
266
+                        if (videoInfo.SliceLen == 0)
267
+                        {
268
+                            videoInfo.SliceLen = (long)(uploadSliceLenMb * 1024 * 1024);
269
+                            videoInfo.Block = (int)(filelen / videoInfo.SliceLen + (filelen % videoInfo.SliceLen > 0 ? 1 : 0));
270
+                        }
271
+                    }
272
+                    else
273
+                    {
274
+                        //文件在服务器上已存在  空间是否存在未知 若增加空间是否存在判断在此处添加
275
+                        videoInfo.Block = 1;
276
+                        videoInfo.Uploaded = 1;
277
+                        return true;
278
+                    }
279
+                }
280
+
281
+                ////临时修改 没有断点续传,每次上传都重新上传。
282
+                //VideoInfo.Uploaded = 0;
283
+                {
284
+                    //已上传长度
285
+                    long len;
286
+
287
+                    //分块
288
+                    do
289
+                    {
290
+                        len = videoInfo.Uploaded * videoInfo.SliceLen;
291
+                        //取指定长度的流
292
+                        byte[] byteArray = FileToolsCommon.ReadBigFileSpecifyLength(
293
+                            videoInfo.VideoPath,
294
+                            len,
295
+                            (int)videoInfo.SliceLen
296
+                        );
297
+                        //参数
298
+                        NameValueCollection formFields = new NameValueCollection
299
+                        {
300
+                            { "identifier", videoInfo.FileGuid },
301
+                            { "chunkNumber", (videoInfo.Uploaded + 1).ToString() },
302
+                            { "filename", fileName },
303
+                            { "totalchunk", videoInfo.Block.ToString() },
304
+                            { "md5", videoInfo.FileMD5 }
305
+                        };
306
+                        JObject jo = ZHttpUtil.UploadFile(
307
+                            uploadUrl,
308
+                            byteArray,
309
+                            fileName,
310
+                            formFields
311
+                        );
312
+                        //0成功,1失败
313
+                        if (jo["code"]?.ToString() != "0")
351
                         {
314
                         {
315
+                            errMessage = jo["msg"]?.ToString();
352
                             return false;
316
                             return false;
353
                         }
317
                         }
318
+                        videoInfo.Uploaded++;
319
+                    }
320
+                    while (len + videoInfo.SliceLen < filelen);
354
 
321
 
355
-                        #endregion 合并文件
322
+                    #region 合并文件
323
+
324
+                    //合并文件
325
+                    bool isres = ReportFileMerge(
326
+                        App.UserInfo.cloudcode + "/" + App.UserInfo.Schoolid + "/resource",
327
+                        videoInfo.FileGuid,
328
+                        out errMessage
329
+                    );
330
+                    if (isres)
331
+                    {
332
+                        return true;
356
                     }
333
                     }
334
+                    return false;
335
+
336
+                    #endregion 合并文件
357
                 }
337
                 }
358
             }
338
             }
359
             catch (Exception ex)
339
             catch (Exception ex)
363
             return false;
343
             return false;
364
         }
344
         }
365
     }
345
     }
366
-}
346
+}

+ 3
- 3
XHWK.WKTool/UploadWindow.xaml.cs View File

50
         private string _guid = string.Empty;
50
         private string _guid = string.Empty;
51
 
51
 
52
         //定义事件
52
         //定义事件
53
-        public event ChangeTextHandlers ChangeTextEvents;
53
+        public event ChangeTextHandlers ResultEvents;
54
 
54
 
55
         /// <summary>
55
         /// <summary>
56
         /// 当前视频的下标
56
         /// 当前视频的下标
374
                                 Hide();
374
                                 Hide();
375
                                 tip_outer.Visibility = Visibility.Collapsed;
375
                                 tip_outer.Visibility = Visibility.Collapsed;
376
                                 MessageWindow.Show("视频上传成功!");
376
                                 MessageWindow.Show("视频上传成功!");
377
-                                if (ChangeTextEvents != null)
377
+                                if (ResultEvents != null)
378
                                 {
378
                                 {
379
-                                    ChangeTextEvents("上传成功", _i);
379
+                                    ResultEvents("上传成功", _i);
380
                                 }
380
                                 }
381
                             }
381
                             }
382
                         );
382
                         );

+ 3
- 3
XHWK.WKTool/View/UControl/Uc_VideoItem.xaml.cs View File

325
                     if (_wUploadWindow == null)
325
                     if (_wUploadWindow == null)
326
                     {
326
                     {
327
                         _wUploadWindow = new UploadWindow { Owner = App.W_XHMicroLessonSystemWindow };
327
                         _wUploadWindow = new UploadWindow { Owner = App.W_XHMicroLessonSystemWindow };
328
-                        _wUploadWindow.ChangeTextEvents += frm_ChangeTextEvents;
328
+                        _wUploadWindow.ResultEvents += FrmResultEvents;
329
                     }
329
                     }
330
 
330
 
331
                     //long size = Convert.ToInt64(FileToolsCommon.GetFileSizeByMB(pageData.menuList[i].FilePath));
331
                     //long size = Convert.ToInt64(FileToolsCommon.GetFileSizeByMB(pageData.menuList[i].FilePath));
346
         }
346
         }
347
 
347
 
348
         /// <summary>
348
         /// <summary>
349
-        /// 上传返回事件
349
+        ///     上传返回事件
350
         /// </summary>
350
         /// </summary>
351
         /// <param name="text"></param>
351
         /// <param name="text"></param>
352
         /// <param name="i"></param>
352
         /// <param name="i"></param>
353
-        private void frm_ChangeTextEvents(string text, int i)
353
+        private void FrmResultEvents(string text, int i)
354
         {
354
         {
355
             if ("上传成功".Equals(text))
355
             if ("上传成功".Equals(text))
356
             {
356
             {

星火微课/微课发包注意项.txt → 打包/微课发包注意项.txt View File


星火微课/星火微课-正式.iss → 打包/星火微课-正式.iss View File

3
 
3
 
4
 #define MyAppName "星火微课"  
4
 #define MyAppName "星火微课"  
5
 #define MyAppDir "xhwk"
5
 #define MyAppDir "xhwk"
6
-#define MyAppVersion "3.9.8"
6
+#define MyAppVersion "3.13.6"
7
 #define MyAppPublisher "河南星火燎原软件科技有限公司"
7
 #define MyAppPublisher "河南星火燎原软件科技有限公司"
8
 #define MyAppURL "http://www.xhkjedu.com/"
8
 #define MyAppURL "http://www.xhkjedu.com/"
9
 #define MySourcePath "D:\Project\CSharp\xh-wkclient\XHWK.WKTool\bin\x86\Debug\"
9
 #define MySourcePath "D:\Project\CSharp\xh-wkclient\XHWK.WKTool\bin\x86\Debug\"

星火微课/星火微课-测试.iss → 打包/星火微课-测试.iss View File

3
 
3
 
4
 #define MyAppName "星火微课测试版"  
4
 #define MyAppName "星火微课测试版"  
5
 #define MyAppDir "xhwk_test"
5
 #define MyAppDir "xhwk_test"
6
-#define MyAppVersion "3.13.5"
6
+#define MyAppVersion "3.13.6"
7
 #define MyAppPublisher "河南星火燎原软件科技有限公司"
7
 #define MyAppPublisher "河南星火燎原软件科技有限公司"
8
 #define MyAppURL "http://www.xhkjedu.com/"
8
 #define MyAppURL "http://www.xhkjedu.com/"
9
 #define MySourcePath "D:\Project\CSharp\xh-wkclient\XHWK.WKTool\bin\x86\Debug\"
9
 #define MySourcePath "D:\Project\CSharp\xh-wkclient\XHWK.WKTool\bin\x86\Debug\"

Loading…
Cancel
Save