Authored by mali

客服生成视频的功能

@@ -142,4 +142,8 @@ public class BuyerOrderReq extends PageRequestBO{ @@ -142,4 +142,8 @@ public class BuyerOrderReq extends PageRequestBO{
142 private String detectionNotPassReason;//商品检测不通过原因 142 private String detectionNotPassReason;//商品检测不通过原因
143 143
144 private Integer sellerGoodsAttributes; 144 private Integer sellerGoodsAttributes;
  145 +
  146 + private String startTimeStr;
  147 +
  148 + private String endTimeStr;
145 } 149 }
1 package com.yoho.ufo.order.controller; 1 package com.yoho.ufo.order.controller;
2 2
  3 +import java.util.ArrayList;
3 import java.util.List; 4 import java.util.List;
4 5
  6 +import com.alibaba.fastjson.JSONObject;
5 import com.yoho.ufo.order.service.impl.*; 7 import com.yoho.ufo.order.service.impl.*;
  8 +import com.yoho.ufo.util.DateUtil;
6 import com.yohobuy.ufo.model.order.resp.ManualInputPermissionVo; 9 import com.yohobuy.ufo.model.order.resp.ManualInputPermissionVo;
7 import org.apache.commons.lang3.StringUtils; 10 import org.apache.commons.lang3.StringUtils;
8 import org.slf4j.Logger; 11 import org.slf4j.Logger;
@@ -59,6 +62,15 @@ public class UfoLiveController { @@ -59,6 +62,15 @@ public class UfoLiveController {
59 } 62 }
60 63
61 64
  65 + @RequestMapping(value = "/generateMp4VedioEx")
  66 + public ApiResponse generateMp4VedioEx(BuyerOrderReq req) {
  67 + LOGGER.info("generateMp4VedioEx in. req is {}", req);
  68 + req.setStartTime(DateUtil.getTimeSecondsFromStr(req.getStartTimeStr(), DateUtil.DATE_TIME_FORMAT));
  69 + req.setEndTime(DateUtil.getTimeSecondsFromStr(req.getEndTimeStr(), DateUtil.DATE_TIME_FORMAT));
  70 + generateMp4Vedio(req);
  71 + return new ApiResponse.ApiResponseBuilder().code(200).data(null).message("查询成功").build();
  72 + }
  73 +
62 @RequestMapping(value = "/queryMp4Vedio") 74 @RequestMapping(value = "/queryMp4Vedio")
63 public ApiResponse queryMp4Vedio(QNliveReq req) { 75 public ApiResponse queryMp4Vedio(QNliveReq req) {
64 LOGGER.info("queryMp4Vedio in. req is {}", req); 76 LOGGER.info("queryMp4Vedio in. req is {}", req);
@@ -58,7 +58,11 @@ @@ -58,7 +58,11 @@
58 <tr> 58 <tr>
59 <td><label>订单类型:</label><span id="preSellOrNormal"></span></td> 59 <td><label>订单类型:</label><span id="preSellOrNormal"></span></td>
60 <td><label>促销活动:</label><span id="activityType"></span></td> 60 <td><label>促销活动:</label><span id="activityType"></span></td>
61 - <td><label>鉴定视频:</label><a href="javascript:void(0)" vedioUrl="" onclick="queryVedioUrl();" id="vedioUrl">查看视频</a></td> 61 + <td>
  62 + <label>鉴定视频:</label>
  63 + <a href="javascript:void(0)" vedioUrl="" onclick="queryVedioUrl();" id="vedioUrl">查看视频</a>
  64 + <a href="javascript:void(0)" vedioUrl="" onclick="generateVedioUrl();" id="vedioUrl">重新生成</a>
  65 + </td>
62 </tr> 66 </tr>
63 </table> 67 </table>
64 68
@@ -222,9 +226,11 @@ @@ -222,9 +226,11 @@
222 </div> 226 </div>
223 </div> 227 </div>
224 <script> 228 <script>
  229 +var orderCodeEx;
225 $(function() { 230 $(function() {
226 var param=window.location.search; 231 var param=window.location.search;
227 var orderCode = getQueryString(param, "orderCode"); 232 var orderCode = getQueryString(param, "orderCode");
  233 + orderCodeEx = orderCode;
228 var skup = getQueryString(param, "skup"); 234 var skup = getQueryString(param, "skup");
229 235
230 $("#returnBtn").linkbutton({ 236 $("#returnBtn").linkbutton({
@@ -602,6 +608,67 @@ function queryVedioUrl() { @@ -602,6 +608,67 @@ function queryVedioUrl() {
602 window.open($('#vedioUrl').attr('vedioUrl') + "?ver=" + new Date().getTime()) 608 window.open($('#vedioUrl').attr('vedioUrl') + "?ver=" + new Date().getTime())
603 } 609 }
604 610
  611 +function generateVedioUrl() {
  612 + var div = $("<div>").appendTo($(document.body));
  613 + var title = "重新生成视频";
  614 + var message = "确认重新生成视频吗?";
  615 + $(div).myDialog({
  616 + width: "550px",
  617 + height: "450px",
  618 + title: title,
  619 + href: contextPath + "/html/orderManage/generateVedio.html?time_version=" + new Date().getTime(),
  620 + queryParams: {
  621 + },
  622 + modal: true,
  623 + collapsible: true,
  624 + cache: false,
  625 + buttons: [{
  626 + id: "saveBtn",
  627 + text: "重新生成",
  628 + handler: function () {
  629 + $.messager.confirm("确认", message, function (flag) {
  630 + if (flag) {
  631 + var url = contextPath + "/live/generateMp4VedioEx";
  632 + $("#vedioEditForm").form("submit", {
  633 + url: url,
  634 + onSubmit: function () {
  635 + if (!$("#vedioEditForm").form("validate")) {
  636 + return false;
  637 + }
  638 + $.messager.progress({
  639 + title: "正在执行",
  640 + msg: "正在执行,请稍后..."
  641 + });
  642 + return true;
  643 + },
  644 + success: function (data) {
  645 + $.messager.progress("close");
  646 + data = JSON.parse(data);
  647 + if (data.code == 200) {
  648 + $(div).dialog("close");
  649 + $.messager.show({
  650 + title: "提示",
  651 + msg: title + "成功!",
  652 + height: 120
  653 + });
  654 + } else {
  655 + $.messager.alert("失败", data.message, "error");
  656 + }
  657 + }
  658 + });
  659 + }
  660 + });
  661 + }
  662 + }, {
  663 + text: "关闭",
  664 + iconCls: "icon-cancel",
  665 + handler: function () {
  666 + $(div).dialog("close");
  667 + }
  668 + }]
  669 + });
  670 +}
  671 +
605 function initAreaDropDown(areaCode){ 672 function initAreaDropDown(areaCode){
606 var firstId = areaCode.substr(0,2); 673 var firstId = areaCode.substr(0,2);
607 var secondId = areaCode.substr(0,4); 674 var secondId = areaCode.substr(0,4);
  1 +<!DOCTYPE html>
  2 +<div id="tt" class="easyui-layout" fit="true" style="overflow-y: scroll">
  3 + <form name="vedioEditForm" id="vedioEditForm" method="post" enctype="multipart/form-data">
  4 + <input type="hidden" name="orderCode" id="orderCodeId"/>
  5 + <div style="margin-top: 20px;margin-left: 30px">
  6 + <table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab">
  7 + <tr style="height: 60px">
  8 + <td width="15%"><span style="color:red">*</span>摄像头设备</td>
  9 + <td width="50%">
  10 + <input id="cameraCodeID" name="cameraCode" class="easyui-textbox" style="width: 380px;"/>
  11 + </td>
  12 + </tr>
  13 +
  14 + <tr style="height: 60px" >
  15 + <td width="15%"><span style="color:red">*</span><label>视频时间</label></td>
  16 + <td colspan="3">
  17 + <input class="easyui-datetimebox" name="startTimeStr" id="startTime" data-options="required:true,showSeconds:true" style="width:200px"> ~
  18 + <input class="easyui-datetimebox" name="endTimeStr" id="endTime" data-options="required:true,showSeconds:true" style="width:200px">
  19 + </td>
  20 + </tr>
  21 +
  22 + </table>
  23 + </div>
  24 + </form>
  25 +</div>
  26 +<script>
  27 +
  28 + $(function () {
  29 + $('#vedioEditForm #orderCodeId').val(orderCodeEx);
  30 + $("#vedioEditForm #startTime").datetimebox({
  31 + required: true,
  32 + missingMessage: "开始时间不能为空",
  33 + prompt: "开始时间",
  34 + showSeconds : true
  35 + });
  36 +
  37 + $("#vedioEditForm #endTime").datetimebox({
  38 + required: true,
  39 + missingMessage: "结束时间不能为空",
  40 + prompt: "结束时间",
  41 + showSeconds : true
  42 + });
  43 +
  44 + $.ajax({
  45 + contentType: "application/json",
  46 + dataType: "json",
  47 + type: "GET",
  48 + async:false,
  49 + url: contextPath + '/live/queryCameraRecord',
  50 + success: function (data) {
  51 + if (data.code != 200 || !data.data || data.data.length == 0) {
  52 + return;
  53 + }
  54 + $("#cameraCodeID").myCombobox({
  55 + prompt: "选择摄像头",
  56 + width: 200,
  57 + data: data.data,
  58 + valueField: "cameraCode",
  59 + textField: "cameraName"
  60 + });
  61 + }
  62 + });
  63 + });
  64 +</script>