Authored by mali

客服生成视频的功能

... ... @@ -142,4 +142,8 @@ public class BuyerOrderReq extends PageRequestBO{
private String detectionNotPassReason;//商品检测不通过原因
private Integer sellerGoodsAttributes;
private String startTimeStr;
private String endTimeStr;
}
... ...
package com.yoho.ufo.order.controller;
import java.util.ArrayList;
import java.util.List;
import com.alibaba.fastjson.JSONObject;
import com.yoho.ufo.order.service.impl.*;
import com.yoho.ufo.util.DateUtil;
import com.yohobuy.ufo.model.order.resp.ManualInputPermissionVo;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
... ... @@ -59,6 +62,15 @@ public class UfoLiveController {
}
@RequestMapping(value = "/generateMp4VedioEx")
public ApiResponse generateMp4VedioEx(BuyerOrderReq req) {
LOGGER.info("generateMp4VedioEx in. req is {}", req);
req.setStartTime(DateUtil.getTimeSecondsFromStr(req.getStartTimeStr(), DateUtil.DATE_TIME_FORMAT));
req.setEndTime(DateUtil.getTimeSecondsFromStr(req.getEndTimeStr(), DateUtil.DATE_TIME_FORMAT));
generateMp4Vedio(req);
return new ApiResponse.ApiResponseBuilder().code(200).data(null).message("查询成功").build();
}
@RequestMapping(value = "/queryMp4Vedio")
public ApiResponse queryMp4Vedio(QNliveReq req) {
LOGGER.info("queryMp4Vedio in. req is {}", req);
... ...
... ... @@ -58,7 +58,11 @@
<tr>
<td><label>订单类型:</label><span id="preSellOrNormal"></span></td>
<td><label>促销活动:</label><span id="activityType"></span></td>
<td><label>鉴定视频:</label><a href="javascript:void(0)" vedioUrl="" onclick="queryVedioUrl();" id="vedioUrl">查看视频</a></td>
<td>
<label>鉴定视频:</label>
<a href="javascript:void(0)" vedioUrl="" onclick="queryVedioUrl();" id="vedioUrl">查看视频</a>
<a href="javascript:void(0)" vedioUrl="" onclick="generateVedioUrl();" id="vedioUrl">重新生成</a>
</td>
</tr>
</table>
... ... @@ -222,9 +226,11 @@
</div>
</div>
<script>
var orderCodeEx;
$(function() {
var param=window.location.search;
var orderCode = getQueryString(param, "orderCode");
orderCodeEx = orderCode;
var skup = getQueryString(param, "skup");
$("#returnBtn").linkbutton({
... ... @@ -602,6 +608,67 @@ function queryVedioUrl() {
window.open($('#vedioUrl').attr('vedioUrl') + "?ver=" + new Date().getTime())
}
function generateVedioUrl() {
var div = $("<div>").appendTo($(document.body));
var title = "重新生成视频";
var message = "确认重新生成视频吗?";
$(div).myDialog({
width: "550px",
height: "450px",
title: title,
href: contextPath + "/html/orderManage/generateVedio.html?time_version=" + new Date().getTime(),
queryParams: {
},
modal: true,
collapsible: true,
cache: false,
buttons: [{
id: "saveBtn",
text: "重新生成",
handler: function () {
$.messager.confirm("确认", message, function (flag) {
if (flag) {
var url = contextPath + "/live/generateMp4VedioEx";
$("#vedioEditForm").form("submit", {
url: url,
onSubmit: function () {
if (!$("#vedioEditForm").form("validate")) {
return false;
}
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后..."
});
return true;
},
success: function (data) {
$.messager.progress("close");
data = JSON.parse(data);
if (data.code == 200) {
$(div).dialog("close");
$.messager.show({
title: "提示",
msg: title + "成功!",
height: 120
});
} else {
$.messager.alert("失败", data.message, "error");
}
}
});
}
});
}
}, {
text: "关闭",
iconCls: "icon-cancel",
handler: function () {
$(div).dialog("close");
}
}]
});
}
function initAreaDropDown(areaCode){
var firstId = areaCode.substr(0,2);
var secondId = areaCode.substr(0,4);
... ...
<!DOCTYPE html>
<div id="tt" class="easyui-layout" fit="true" style="overflow-y: scroll">
<form name="vedioEditForm" id="vedioEditForm" method="post" enctype="multipart/form-data">
<input type="hidden" name="orderCode" id="orderCodeId"/>
<div style="margin-top: 20px;margin-left: 30px">
<table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab">
<tr style="height: 60px">
<td width="15%"><span style="color:red">*</span>摄像头设备</td>
<td width="50%">
<input id="cameraCodeID" name="cameraCode" class="easyui-textbox" style="width: 380px;"/>
</td>
</tr>
<tr style="height: 60px" >
<td width="15%"><span style="color:red">*</span><label>视频时间</label></td>
<td colspan="3">
<input class="easyui-datetimebox" name="startTimeStr" id="startTime" data-options="required:true,showSeconds:true" style="width:200px"> ~
<input class="easyui-datetimebox" name="endTimeStr" id="endTime" data-options="required:true,showSeconds:true" style="width:200px">
</td>
</tr>
</table>
</div>
</form>
</div>
<script>
$(function () {
$('#vedioEditForm #orderCodeId').val(orderCodeEx);
$("#vedioEditForm #startTime").datetimebox({
required: true,
missingMessage: "开始时间不能为空",
prompt: "开始时间",
showSeconds : true
});
$("#vedioEditForm #endTime").datetimebox({
required: true,
missingMessage: "结束时间不能为空",
prompt: "结束时间",
showSeconds : true
});
$.ajax({
contentType: "application/json",
dataType: "json",
type: "GET",
async:false,
url: contextPath + '/live/queryCameraRecord',
success: function (data) {
if (data.code != 200 || !data.data || data.data.length == 0) {
return;
}
$("#cameraCodeID").myCombobox({
prompt: "选择摄像头",
width: 200,
data: data.data,
valueField: "cameraCode",
textField: "cameraName"
});
}
});
});
</script>
\ No newline at end of file
... ...