Commit d91d97bb authored by m1991's avatar m1991

资讯模块数据——视频功能修复

parent d163b1dd
...@@ -6,7 +6,7 @@ import java.awt.image.BufferedImage; ...@@ -6,7 +6,7 @@ import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import org.bytedeco.javacpp.opencv_core;
import org.bytedeco.javacv.FFmpegFrameGrabber; import org.bytedeco.javacv.FFmpegFrameGrabber;
import org.bytedeco.javacv.Frame; import org.bytedeco.javacv.Frame;
import org.bytedeco.javacv.Java2DFrameConverter; import org.bytedeco.javacv.Java2DFrameConverter;
...@@ -44,7 +44,7 @@ public class FrameGrabberKit { ...@@ -44,7 +44,7 @@ public class FrameGrabberKit {
* 获取指定视频的帧并保存为图片至指定目录 * 获取指定视频的帧并保存为图片至指定目录
* *
* @param videofile 源视频文件路径 * @param videofile 源视频文件路径
* @param framefile 截取帧的图片存放路径 例:F:/hfkjrecorder/target/4.jpg * @param framefile 截取帧的图片存放路径 例:F:\hfkjrecorder\target\4.jpg
* @throws Exception * @throws Exception
*/ */
public static void fetchFrame(String videofile, String framefile) throws Exception { public static void fetchFrame(String videofile, String framefile) throws Exception {
...@@ -82,5 +82,4 @@ public class FrameGrabberKit { ...@@ -82,5 +82,4 @@ public class FrameGrabberKit {
//ff.flush(); //ff.flush();
ff.stop(); ff.stop();
} }
} }
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.math.BigInteger;
import java.util.List; import java.util.List;
...@@ -20,7 +21,7 @@ public interface ShopZxMapper extends BaseMapper<shopZx> { ...@@ -20,7 +21,7 @@ public interface ShopZxMapper extends BaseMapper<shopZx> {
* @param * @param
* @return 1 * @return 1
*/ */
int zxadd(@Param("zxUrl") String zxUrl,@Param("zxField") String zxField,@Param("zxAddress") String zxAddress,@Param("inviteCode") String inviteCode,@Param("zxDate") String zxDate); int zxadd(@Param("zxUrl") String zxUrl,@Param("zxField") String zxField,@Param("zxAddress") String zxAddress,@Param("inviteCode") String inviteCode,@Param("zxDate") Long zxDate);
/** /**
* 查询资讯数据 * 查询资讯数据
......
...@@ -16,12 +16,12 @@ ...@@ -16,12 +16,12 @@
</sql> </sql>
<sql id="cols_all"> <sql id="cols_all">
zxid, zx_id as zxid,
<include refid="cols_exclude_id"/> <include refid="cols_exclude_id"/>
</sql> </sql>
<sql id="cols_exclude_id"> <sql id="cols_exclude_id">
zxUrl,zxField,zxAddress,inviteCode,zxDate zx_url,zx_field,zx_address,invite_code,zx_date
</sql> </sql>
<sql id="vals"> <sql id="vals">
......
...@@ -65,7 +65,7 @@ public class shopZx extends Model<shopZx> implements Serializable { ...@@ -65,7 +65,7 @@ public class shopZx extends Model<shopZx> implements Serializable {
* 资讯数据创建时间 * 资讯数据创建时间
*/ */
@ApiModelProperty(name = "zx_date", value = "资讯数据创建时间") @ApiModelProperty(name = "zx_date", value = "资讯数据创建时间")
private BigInteger zxDate; private Long zxDate;
......
...@@ -12,7 +12,6 @@ import org.springframework.util.StringUtils; ...@@ -12,7 +12,6 @@ import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.IOException; import java.io.IOException;
import java.math.BigInteger;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
...@@ -20,16 +19,12 @@ import java.nio.file.Paths; ...@@ -20,16 +19,12 @@ import java.nio.file.Paths;
import java.nio.file.StandardCopyOption; import java.nio.file.StandardCopyOption;
import cn.wisenergy.service.app.UploadService; import cn.wisenergy.service.app.UploadService;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.*; import java.util.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import cn.wisenergy.mapper.ShopZxMapper; import cn.wisenergy.mapper.ShopZxMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ClassUtils;
/** /**
...@@ -93,8 +88,8 @@ public class UploadServiceImpl implements UploadService { ...@@ -93,8 +88,8 @@ public class UploadServiceImpl implements UploadService {
/** /**
* 生成当前时间戳 * 生成当前时间戳
*/ */
BigInteger zxDate= BigInteger.valueOf(System.currentTimeMillis()); Long zxDate= System.currentTimeMillis();
shopZxMapper.zxadd(zxUrl,zxField,zxAddress,inviteCode, String.valueOf(zxDate)); shopZxMapper.zxadd(zxUrl,zxField,zxAddress,inviteCode, zxDate);
return resultMap; return resultMap;
} }
...@@ -108,7 +103,7 @@ public class UploadServiceImpl implements UploadService { ...@@ -108,7 +103,7 @@ public class UploadServiceImpl implements UploadService {
/** /**
* 生成当前时间戳 * 生成当前时间戳
*/ */
BigInteger zxDate= BigInteger.valueOf(System.currentTimeMillis()); Long zxDate= Long.valueOf(System.currentTimeMillis());
String basePath = request.getScheme() + "://" + request.getServerName() String basePath = request.getScheme() + "://" + request.getServerName()
+ ":" + request.getServerPort()+"/mimi/upload/images/"; + ":" + request.getServerPort()+"/mimi/upload/images/";
...@@ -136,7 +131,7 @@ public class UploadServiceImpl implements UploadService { ...@@ -136,7 +131,7 @@ public class UploadServiceImpl implements UploadService {
resultMap.put("zxUrl", zxUrl); resultMap.put("zxUrl", zxUrl);
resultMap.put("returnCode", 0); resultMap.put("returnCode", 0);
shopZxMapper.zxadd(zxUrl,zxField,zxAddress,inviteCode, String.valueOf(zxDate)); shopZxMapper.zxadd(zxUrl,zxField,zxAddress,inviteCode, zxDate);
return resultMap; return resultMap;
} }
...@@ -146,7 +141,7 @@ public class UploadServiceImpl implements UploadService { ...@@ -146,7 +141,7 @@ public class UploadServiceImpl implements UploadService {
/** /**
* 生成当前时间戳 * 生成当前时间戳
*/ */
BigInteger zxDate= BigInteger.valueOf(System.currentTimeMillis()); Long zxDate= Long.valueOf(System.currentTimeMillis());
//获取上传图片数量,打印在控制台 //获取上传图片数量,打印在控制台
System.out.println("上传图片数量" + files.length); System.out.println("上传图片数量" + files.length);
//创建集合 //创建集合
...@@ -199,7 +194,7 @@ public class UploadServiceImpl implements UploadService { ...@@ -199,7 +194,7 @@ public class UploadServiceImpl implements UploadService {
String root_json = JSON.toJSONString(root); String root_json = JSON.toJSONString(root);
System.out.println(root_json); System.out.println(root_json);
result.put("returnCode", 0); result.put("returnCode", 0);
shopZxMapper.zxadd(zxUrl,zxField,zxAddress,inviteCode, String.valueOf(zxDate)); shopZxMapper.zxadd(zxUrl,zxField,zxAddress,inviteCode, zxDate);
return root; return root;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment