Commit d0ba92a6 by 朱亚洁

音频时长精度

parent 49799711
...@@ -294,7 +294,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz { ...@@ -294,7 +294,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
Long seconds = detailFile.getFilePilotSecond(); Long seconds = detailFile.getFilePilotSecond();
String title = detailFile.getTitle(); String title = detailFile.getTitle();
//总时长 //总时长
Integer duration = null; BigDecimal duration = null;
if (!StringUtil.isEmpty(fileId)) { if (!StringUtil.isEmpty(fileId)) {
//获取转码路径 //获取转码路径
FileUploadInfo fileUploadInfo = convertConsr.getByFileId(fileId); FileUploadInfo fileUploadInfo = convertConsr.getByFileId(fileId);
...@@ -305,7 +305,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz { ...@@ -305,7 +305,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
duration = fileUploadInfo.getDuration(); duration = fileUploadInfo.getDuration();
detailFile.setFileUrl(fileUrl); detailFile.setFileUrl(fileUrl);
if (null != duration) { if (null != duration) {
detailFile.setFileDuration(duration.longValue()); detailFile.setFileDuration(duration);
} }
} }
/* if (StringUtil.isEmpty(fileUrl) && !StringUtil.isEmpty(fileId)) { /* if (StringUtil.isEmpty(fileUrl) && !StringUtil.isEmpty(fileId)) {
...@@ -314,7 +314,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz { ...@@ -314,7 +314,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
advertisingSpace.setAdDetailFileConvertState(0); advertisingSpace.setAdDetailFileConvertState(0);
return advertisingSpace; return advertisingSpace;
}*/ }*/
if (null != duration && null != seconds && seconds >= duration) { if (null != duration && null != seconds && BigDecimal.valueOf(seconds.doubleValue()).compareTo(duration) >= 0) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "资源" + title + "时长" + duration + "s,试听/试看时长超过该时长,请重新设置"); throw new BookBizException(BookBizException.PARAM_IS_ERROR, "资源" + title + "时长" + duration + "s,试听/试看时长超过该时长,请重新设置");
} }
if (!StringUtil.isEmpty(fileUrl)) {//剪切文件 if (!StringUtil.isEmpty(fileUrl)) {//剪切文件
...@@ -655,7 +655,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz { ...@@ -655,7 +655,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
// 获取群信息 // 获取群信息
GroupQrcode groupQrcode = groupQrcodeDao.getById(group.getQrcodeId()); GroupQrcode groupQrcode = groupQrcodeDao.getById(group.getQrcodeId());
String groupId = groupQrcode.getWeixinGroupId(); String groupId = groupQrcode.getWeixinGroupId();
ClassifyDTO classifyDTO = bookGroupClassifyDao.getById(group.getClassifyId());
// 获取机器人微信号 // 获取机器人微信号
String altId = wechatGroupConsr.getSendAdRobotByGroupId(groupId); String altId = wechatGroupConsr.getSendAdRobotByGroupId(groupId);
if (StringUtil.isEmpty(altId)) { if (StringUtil.isEmpty(altId)) {
......
...@@ -3,6 +3,7 @@ package com.pcloud.book.advertising.entity; ...@@ -3,6 +3,7 @@ package com.pcloud.book.advertising.entity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.pcloud.common.entity.BaseEntity; import com.pcloud.common.entity.BaseEntity;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
...@@ -35,7 +36,7 @@ public class AdvertisingDetailFile extends BaseEntity{ ...@@ -35,7 +36,7 @@ public class AdvertisingDetailFile extends BaseEntity{
/** /**
*文件时长 *文件时长
*/ */
private Long fileDuration; private BigDecimal fileDuration;
/** /**
*文件路径 *文件路径
*/ */
...@@ -116,11 +117,11 @@ public class AdvertisingDetailFile extends BaseEntity{ ...@@ -116,11 +117,11 @@ public class AdvertisingDetailFile extends BaseEntity{
this.fileName = fileName == null ? null : fileName.trim(); this.fileName = fileName == null ? null : fileName.trim();
} }
public Long getFileDuration() { public BigDecimal getFileDuration() {
return fileDuration; return fileDuration;
} }
public void setFileDuration(Long fileDuration) { public void setFileDuration(BigDecimal fileDuration) {
this.fileDuration = fileDuration; this.fileDuration = fileDuration;
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<result column="file_convert_state" property="fileConvertState" jdbcType="INTEGER" /> <result column="file_convert_state" property="fileConvertState" jdbcType="INTEGER" />
<result column="file_size" property="fileSize" jdbcType="BIGINT" /> <result column="file_size" property="fileSize" jdbcType="BIGINT" />
<result column="file_name" property="fileName" jdbcType="VARCHAR" /> <result column="file_name" property="fileName" jdbcType="VARCHAR" />
<result column="file_duration" property="fileDuration" jdbcType="BIGINT" /> <result column="file_duration" property="fileDuration" jdbcType="DECIMAL" />
<result column="file_url" property="fileUrl" jdbcType="VARCHAR" /> <result column="file_url" property="fileUrl" jdbcType="VARCHAR" />
<result column="file_pilot_second" property="filePilotSecond" jdbcType="BIGINT" /> <result column="file_pilot_second" property="filePilotSecond" jdbcType="BIGINT" />
<result column="file_pilot_url" property="filePilotUrl" jdbcType="VARCHAR" /> <result column="file_pilot_url" property="filePilotUrl" jdbcType="VARCHAR" />
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
( (
#{item.adId,jdbcType=BIGINT}, #{item.fileId,jdbcType=VARCHAR}, #{item.adId,jdbcType=BIGINT}, #{item.fileId,jdbcType=VARCHAR},
#{item.fileConvertState,jdbcType=INTEGER}, #{item.fileSize,jdbcType=BIGINT}, #{item.fileName,jdbcType=VARCHAR}, #{item.fileConvertState,jdbcType=INTEGER}, #{item.fileSize,jdbcType=BIGINT}, #{item.fileName,jdbcType=VARCHAR},
#{item.fileDuration,jdbcType=BIGINT}, #{item.fileUrl,jdbcType=VARCHAR}, #{item.filePilotSecond,jdbcType=BIGINT}, #{item.fileDuration,jdbcType=DECIMAL}, #{item.fileUrl,jdbcType=VARCHAR}, #{item.filePilotSecond,jdbcType=BIGINT},
#{item.filePilotUrl,jdbcType=VARCHAR}, #{item.filePilotFinishTip,jdbcType=VARCHAR}, #{item.title,jdbcType=VARCHAR}, #{item.filePilotUrl,jdbcType=VARCHAR}, #{item.filePilotFinishTip,jdbcType=VARCHAR}, #{item.title,jdbcType=VARCHAR},
#{item.coverPic,jdbcType=VARCHAR}, NOW(), #{item.cpaId} #{item.coverPic,jdbcType=VARCHAR}, NOW(), #{item.cpaId}
) )
......
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