Authored by Lixiaodi

Merge branch 'test6.8.4' of http://git.yoho.cn/ufo/ufo-platform into test6.8.4

@@ -43,7 +43,7 @@ public class QNLiveUtilService { @@ -43,7 +43,7 @@ public class QNLiveUtilService {
43 43
44 private static String FILEKEY_PRE = "ufo/live/m3u8/"; // 码流文件路径 44 private static String FILEKEY_PRE = "ufo/live/m3u8/"; // 码流文件路径
45 45
46 - public static String MP4_FILEKEY_PRE = "ufo/live/mp4/"; // mp4文件路径 46 + public static String MP4_FILEKEY_PRE = QNliveConstants.MP4_FILEKEY_PRE; // mp4文件路径
47 47
48 // private static String FETCH_URL_PRE = "http://yoho-live-down.yohobuy.com/"; // 获取直播流的url 48 // private static String FETCH_URL_PRE = "http://yoho-live-down.yohobuy.com/"; // 获取直播流的url
49 49
@@ -66,7 +66,8 @@ public class QNUploadServiceImpl implements IQNUploadService { @@ -66,7 +66,8 @@ public class QNUploadServiceImpl implements IQNUploadService {
66 66
67 67
68 public static void main(String[] args) throws Exception{ 68 public static void main(String[] args) throws Exception{
69 - fetch("9790249123840_1545555597", "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8", "1545555597", "1545555619"); 69 + //fetch("9790249123840_1545555597", "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8", "1545555597", "1545555619");
  70 + fetch();
70 transfer(); 71 transfer();
71 } 72 }
72 73
@@ -131,7 +132,7 @@ url = "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8?starttime=1545530300&e @@ -131,7 +132,7 @@ url = "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8?starttime=1545530300&e
131 } 132 }
132 } 133 }
133 134
134 - // http://api.qiniu.com/status/get/prefop?id=z0.5c1b4c0138b9f349c8bb9c46 查看文件的状态 135 + // http://api.qiniu.com/status/get/prefop?id=z0.5c208c6a38b9f349c82caca2 查看文件的状态
135 // http://flv01.static.yhbimg.com/ufo/live/mp4/yohotest15.mp4 136 // http://flv01.static.yhbimg.com/ufo/live/mp4/yohotest15.mp4
136 private static void transfer() { 137 private static void transfer() {
137 //String m3u8Address = "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8"; 138 //String m3u8Address = "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8";
@@ -144,7 +145,7 @@ url = "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8?starttime=1545530300&e @@ -144,7 +145,7 @@ url = "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8?starttime=1545530300&e
144 //设置要转码的空间和key,并且这个key在你空间中存在 145 //设置要转码的空间和key,并且这个key在你空间中存在
145 String bucket = "yhbflv"; 146 String bucket = "yhbflv";
146 String key = "ufo/live/m3u8/9790249123840_1545530300.m3u8"; // 14 4 分钟 15 3分钟 147 String key = "ufo/live/m3u8/9790249123840_1545530300.m3u8"; // 14 4 分钟 15 3分钟
147 - key = "ufo/live/m3u8/9790249123840_1545555597.m3u8"; 148 + key = "ufo/live/m3u8/9790249123840_1545530300.m3u8";
148 //设置转码操作参数 1920x1080 1280x720 848x480 149 //设置转码操作参数 1920x1080 1280x720 848x480
149 String fops = "avthumb/mp4/s/1280x720/vb/1m/an/1/hr/0/r/30"; 150 String fops = "avthumb/mp4/s/1280x720/vb/1m/an/1/hr/0/r/30";
150 151
@@ -152,10 +153,10 @@ url = "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8?starttime=1545530300&e @@ -152,10 +153,10 @@ url = "http://yoho-live-down.yohobuy.com/yoho13/yoho.m3u8?starttime=1545530300&e
152 //设置转码的队列 153 //设置转码的队列
153 String pipeline = "yoho-m3u8-to-mp4"; 154 String pipeline = "yoho-m3u8-to-mp4";
154 //可以对转码后的文件进行使用saveas参数自定义命名,当然也可以不指定文件会默认命名并保存在当前空间。 155 //可以对转码后的文件进行使用saveas参数自定义命名,当然也可以不指定文件会默认命名并保存在当前空间。
155 - String urlbase64 = UrlSafeBase64.encodeToString("yhbflv:ufo/live/mp4/9790249123840_1545555597.mp4"); 156 + String urlbase64 = UrlSafeBase64.encodeToString("yhbflv:ufo/live/mp4/9790249123840_1545530300.mp4");
156 String pfops = fops + "|saveas/" + urlbase64; 157 String pfops = fops + "|saveas/" + urlbase64;
157 //设置pipeline参数 http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway/ufoLive/ufo_avthumb_notify 158 //设置pipeline参数 http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway/ufoLive/ufo_avthumb_notify
158 - StringMap params = new StringMap().putWhen("force", 1, true).putNotEmpty("pipeline", pipeline).put("notifyURL", "http://testapi.yohops.com/ufoLive/ufo_avthumb_notify"); 159 + StringMap params = new StringMap().putWhen("force", 1, true).putNotEmpty("pipeline", pipeline).put("notifyURL", "http://2.yohobuy.com/ufoLive/ufo_avthumb_notify");
159 try { 160 try {
160 String persistid = operater.pfop(bucket, key, pfops, params); 161 String persistid = operater.pfop(bucket, key, pfops, params);
161 //打印返回的persistid 162 //打印返回的persistid
@@ -82,4 +82,13 @@ public class UfoLiveController { @@ -82,4 +82,13 @@ public class UfoLiveController {
82 82
83 return new ApiResponse.ApiResponseBuilder().code(200).data(initCameraCode).message("查询成功").build(); 83 return new ApiResponse.ApiResponseBuilder().code(200).data(initCameraCode).message("查询成功").build();
84 } 84 }
  85 +
  86 + @RequestMapping(value = "/queryCurrentTime")
  87 + public ApiResponse queryCurrentTime() {
  88 + LOGGER.info("queryCurrentTime method in.");
  89 +
  90 + Integer currentTime = ufoLiveService.queryCurrentTime();
  91 +
  92 + return new ApiResponse.ApiResponseBuilder().code(200).data(currentTime).message("获取时间成功").build();
  93 + }
85 } 94 }
@@ -153,4 +153,8 @@ public class UfoLiveService implements ApplicationContextAware { @@ -153,4 +153,8 @@ public class UfoLiveService implements ApplicationContextAware {
153 UserCameraRecord userCameraRecord = userCameraRecordMapper.selectUserCameraRecord(new UserHelper().getUserId()); 153 UserCameraRecord userCameraRecord = userCameraRecordMapper.selectUserCameraRecord(new UserHelper().getUserId());
154 return null == userCameraRecord ? null : userCameraRecord.getCameraCode(); 154 return null == userCameraRecord ? null : userCameraRecord.getCameraCode();
155 } 155 }
  156 +
  157 + public Integer queryCurrentTime() {
  158 + return DateUtil.getCurrentTimeSeconds();
  159 + }
156 } 160 }
@@ -723,16 +723,41 @@ function addRecordPage(skup, order_code, id) { @@ -723,16 +723,41 @@ function addRecordPage(skup, order_code, id) {
723 return; 723 return;
724 } 724 }
725 725
726 - 726 + $('#startTime').val(parseInt(new Date().getTime() / 1000));
727 timedCount(); 727 timedCount();
728 $('#recordBtn').linkbutton({text:'结束录制'}); 728 $('#recordBtn').linkbutton({text:'结束录制'});
729 - $('#startTime').val(parseInt(new Date().getTime() / 1000));  
730 - //$("#startTime").textbox('setValue',parseInt(new Date().getTime() / 1000)); 729 +
  730 + $.ajax({
  731 + contentType: "application/json",
  732 + dataType: "json",
  733 + type: "GET",
  734 + url: contextPath + '/live/queryCurrentTime',
  735 + success: function (data) {
  736 + if (data.code != 200) {
  737 + $('#startTime').val(parseInt(new Date().getTime() / 1000));
  738 + } else if (data.data){
  739 + $('#startTime').val(data.data);
  740 + }
  741 + }
  742 + });
  743 +
731 } else if ($('#endTime').val() == '') { 744 } else if ($('#endTime').val() == '') {
732 $('#endTime').val(parseInt(new Date().getTime() / 1000)); 745 $('#endTime').val(parseInt(new Date().getTime() / 1000));
733 stopCount(); 746 stopCount();
734 - // $("#endTime").textbox('setValue',parseInt(new Date().getTime() / 1000));  
735 $('#recordBtn').linkbutton({text:'上传云端'}); 747 $('#recordBtn').linkbutton({text:'上传云端'});
  748 + $.ajax({
  749 + contentType: "application/json",
  750 + dataType: "json",
  751 + type: "GET",
  752 + url: contextPath + '/live/queryCurrentTime',
  753 + success: function (data) {
  754 + if (data.code != 200) {
  755 + $('#endTime').val(parseInt(new Date().getTime() / 1000));
  756 + } else if (data.data){
  757 + $('#endTime').val(data.data);
  758 + }
  759 + }
  760 + });
736 } else if ($('#startTime').val() != '' && $('#endTime').val() != ''){ 761 } else if ($('#startTime').val() != '' && $('#endTime').val() != ''){
737 $('#recordBtn').linkbutton('disable'); 762 $('#recordBtn').linkbutton('disable');
738 $.post(contextPath + "/live/generateMp4", { 763 $.post(contextPath + "/live/generateMp4", {
@@ -37,11 +37,10 @@ @@ -37,11 +37,10 @@
37 var totalVar; 37 var totalVar;
38 38
39 function stopCount() { 39 function stopCount() {
40 - var endTime = parseInt($('#endTime').val());  
41 - var startTime = parseInt($('#startTime').val());  
42 - var secondVar = parseInt((endTime - startTime) % 60);  
43 - if (endTime - startTime > 60) {  
44 - var minuteVar = parseInt((endTime - startTime) / 60); 40 + var totalTime = parseInt($('#txt').val());
  41 + var secondVar = parseInt(totalTime % 60);
  42 + if (totalTime > 60) {
  43 + var minuteVar = parseInt(totalTime / 60);
45 totalVar = minuteVar + '分' + secondVar + '秒'; 44 totalVar = minuteVar + '分' + secondVar + '秒';
46 } else { 45 } else {
47 totalVar = secondVar + '秒'; 46 totalVar = secondVar + '秒';
@@ -128,14 +128,14 @@ @@ -128,14 +128,14 @@
128 <hr> 128 <hr>
129 <table id="operateRecordTable"></table> 129 <table id="operateRecordTable"></table>
130 </div> 130 </div>
131 - <div title="回访记录" style="overflow:auto;padding:20px;display:none;"> 131 + <div title="服务记录" style="overflow:auto;padding:20px;display:none;">
132 <div class="easyui-layout"> 132 <div class="easyui-layout">
133 <form id="feedbackRecordSubmitForm" method="post"> 133 <form id="feedbackRecordSubmitForm" method="post">
134 <div style="margin-top: 20px;margin-left: 30px;margin-right: 30px"> 134 <div style="margin-top: 20px;margin-left: 30px;margin-right: 30px">
135 <table border="0" style="width:99%;"> 135 <table border="0" style="width:99%;">
136 <tr style="height: 60px"> 136 <tr style="height: 60px">
137 <td width="100%"> 137 <td width="100%">
138 - <input class="easyui-textbox" id="feedbackContent" name="feedbackContent" data-options="prompt:'请输入回访内容...'" style="width: 100%;height: 100%;" /> 138 + <input class="easyui-textbox" id="feedbackContent" name="feedbackContent" data-options="prompt:'请输入服务记录...'" style="width: 100%;height: 100%;" />
139 </td> 139 </td>
140 </tr> 140 </tr>
141 </table> 141 </table>
@@ -201,7 +201,7 @@ $(function() { @@ -201,7 +201,7 @@ $(function() {
201 getFeedbackRecord(orderCode); 201 getFeedbackRecord(orderCode);
202 window.self.$.messager.show({ 202 window.self.$.messager.show({
203 title : "提示", 203 title : "提示",
204 - msg : "提交回访记录成功!" 204 + msg : "提交服务记录成功!"
205 }); 205 });
206 $('#feedbackRecordSubmitForm').form('clear'); 206 $('#feedbackRecordSubmitForm').form('clear');
207 }else { 207 }else {
@@ -630,7 +630,7 @@ function getFeedbackRecord(orderCode){ @@ -630,7 +630,7 @@ function getFeedbackRecord(orderCode){
630 }, 630 },
631 631
632 columns: [[{ 632 columns: [[{
633 - title: "回访内容", 633 + title: "服务记录",
634 field: "content", 634 field: "content",
635 width: 100 635 width: 100
636 }, { 636 }, {
@@ -648,7 +648,7 @@ function getFeedbackRecord(orderCode){ @@ -648,7 +648,7 @@ function getFeedbackRecord(orderCode){
648 singleSelect: true, 648 singleSelect: true,
649 onLoadSuccess: function (data) { 649 onLoadSuccess: function (data) {
650 if (data.total == 0) { 650 if (data.total == 0) {
651 - $(this).datagrid('appendRow', { type: '<div style="text-align:center;color:red">没有数据!</div>' }).datagrid('mergeCells', { index: 0, field: 'id', colspan: 4 }) 651 + $(this).datagrid('appendRow', { type: '<div style="text-align:center;color:red">没有数据!</div>' }).datagrid('mergeCells', { index: 0, field: 'content', colspan: 3 })
652 } 652 }
653 } 653 }
654 }); 654 });