zhangjinli 3 years ago
parent 02bb0cc84c
commit 6855aea89d

@ -89,11 +89,14 @@ public class UtilsController {
try {
file.transferTo(dest);
JSONObject res = new JSONObject();
int fileTypeNum = FileTypeUtil.getcontentTypeNum((fileName.substring(fileName.lastIndexOf("."))));
res.put("fileName", fileName);
res.put("fileUrl", "/upload/" + newFileName);
res.put("duration",new MultimediaObject(dest).getInfo().getDuration());
res.put("fileType", FileTypeUtil.getcontentType((fileName.substring(fileName.lastIndexOf(".")))));
res.put("fileTypeNum", FileTypeUtil.getcontentTypeNum((fileName.substring(fileName.lastIndexOf(".")))));
res.put("fileTypeNum",fileTypeNum);
if(fileTypeNum == 1){
res.put("fileUrl", "/upload/" + newFileName);
}
return Result.success(res, "上传完成");
} catch (Exception e) {
e.printStackTrace();
@ -137,7 +140,6 @@ public class UtilsController {
res.replace("errno", 0);
JSONObject obj = new JSONObject();
obj.put("alt", fileName);
obj.put("duration",new MultimediaObject(dest).getInfo().getDuration());
obj.put("url", cdn + "/upload/" + newFileName);
res.put("data", obj);
return res;
@ -166,6 +168,7 @@ public class UtilsController {
queryWrapper.groupBy("u.id");
queryWrapper.orderByDesc("value");
List<RankListVo> rankUserList = qywxDepartmentUserLinkMapper.getUserRankList(queryWrapper);
// rankMapper.addGroup(rankUserList);
return Result.success(rankUserList);
}

@ -132,10 +132,10 @@ public class AdminController {
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "未找到该用户!");
}
up.set(param.getName() != null, "name", param.getName());
up.set(param.getName() != null, "tel", param.getName());
up.set(param.getName() != null, "password", param.getName());
up.set(param.getName() != null, "roleIds", param.getName());
up.set(param.getName() != null, "realName", param.getName());
up.set(param.getTel() != null, "tel", param.getTel());
up.set(param.getPassword() != null, "password", param.getPassword());
up.set(param.getRoleIds() != null, "roleIds", param.getRoleIds());
up.set(param.getRealName() != null, "realName", param.getRealName());
up.set("updateAt", LocalDateTime.now());
return Result.success(adminService.update(up));
}

@ -65,6 +65,8 @@ public class ReferenceController {
private List<String> fileUrlList;
@Schema(title = "封面图片地址", description = "视频文件请上传封面图片")
private String coverUrl;
@Schema(title = "时长", description = "视频文件请上传时长")
private Integer duration;
@Schema(title = "标签id列表")
private List<Integer> tagList;
@Schema(title = "品牌id列表")
@ -84,7 +86,7 @@ public class ReferenceController {
for (String e : list) {
if (e.lastIndexOf(".") != -1) {
l.add(new Reference().setTitle(param.getTitle()).setGroupId(param.getGroupId()).setCoverUrl(param.getCoverUrl()).setCreatAt(LocalDateTime.now())
.setFileUrl(e).setType(FileTypeUtil.getcontentTypeNum(e.substring(e.lastIndexOf(".")))));
.setFileUrl(e).setType(FileTypeUtil.getcontentTypeNum(e.substring(e.lastIndexOf(".")))).setDuration(param.getDuration()));
// ta.add(new TopicActivity().setTitle(param.getTitle()).setCover(param.getCoverUrl()).setCreatAt(LocalDateTime.now())
// .setContent(e).setType(FileTypeUtil.getcontentTypeNum(e.substring(e.lastIndexOf(".")))));
}

@ -50,6 +50,8 @@ public class TeachingRefeController {
@NotNull(message = "教程文件地址不能为空")
@Schema(title = "教程文件地址")
private String fileUrl;
@Schema(title = "时长", description = "视频文件请上传时长")
private Integer duration;
}
@Operation(summary = "创建")
@ -62,7 +64,7 @@ public class TeachingRefeController {
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "文件错误");
}
teachingRefeService.addTeachingRefe(new TeachingRefe().setFileUrl(fileUrl).setType(FileTypeUtil.getcontentTypeNum(fileUrl.substring(fileUrl.lastIndexOf("."))))
.setTitle(param.getTitle()).setCreatAt(LocalDateTime.now()));
.setTitle(param.getTitle()).setCreatAt(LocalDateTime.now()).setDuration(param.getDuration()));
return Result.success("添加完成");
}

@ -55,6 +55,8 @@ public class TopicActivityController {
private Integer type;
@NotNull(message = "content不能为空")
private String content;
@Schema(title = "时长", description = "视频文件请上传时长")
private Integer duration;
@Schema(title = "封面")
private String cover;
@Schema(title = "是否首页显示",description = "0否1是")
@ -67,7 +69,7 @@ public class TopicActivityController {
@AdminCheckAuthorityAnnotation(jurisdictionId = "4")
public Result add(@Validated @RequestBody AddTopicParam param) {
TopicActivity topicActivity = new TopicActivity().setTitle(param.getTitle()).setSubtitle(param.getSubtitle())
.setType(param.getType()).setContent(param.getContent()).setCover(param.getCover()).setCreatAt(LocalDateTime.now());
.setType(param.getType()).setContent(param.getContent()).setDuration(param.getDuration()).setCover(param.getCover()).setCreatAt(LocalDateTime.now());
if(param.getShowAtIndex() !=null && param.getShowAtIndex() == 1){
topicActivity.setShowAtIndex(1);
}

@ -2,6 +2,18 @@ package com.zh.project0512.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zh.project0512.model.Rank;
import org.apache.ibatis.annotations.Insert;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
public interface RankMapper extends BaseMapper<Rank> {
@Insert("<script> " +
"insert into rank (linkId,type,title,subtitle,value,dataStart,dataEnd,createDate) values\n"+
" <foreach collection= 'rankList' item= 'item' separator=','>\n" +
"(#{item.linkId},#{item.type},#{item.title},#{item.subtitle},#{item.value},#{item.dataStart},#{item.dataEnd},#{item.createDate})\n"+
"</foreach> \n"+
"</script>")
void addGroup(List<Map> rankList);
}

@ -61,6 +61,13 @@ public class Reference extends Model {
@TableField("fileUrl")
private String fileUrl;
/**
* ()
*/
@Schema(title = "时长(视频需要)")
@TableField("duration")
private Integer duration;
/**
*
*/

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@ -43,6 +44,13 @@ public class TaskTeachRefe extends Model {
@TableField("fileUrl")
private String fileUrl;
/**
* ()
*/
@Schema(title = "时长(视频需要)")
@TableField("duration")
private Integer duration;
/**
* 12
*/

@ -36,6 +36,13 @@ public class TeachingRefe extends Model {
@TableField("fileUrl")
private String fileUrl;
/**
* ()
*/
@Schema(title = "时长(视频需要)")
@TableField("duration")
private Integer duration;
/**
* 12
*/

@ -49,6 +49,13 @@ public class TopicActivity extends Model {
@Schema(title = "内容")
private String content;
/**
* ()
*/
@Schema(title = "时长(视频需要)")
@TableField("duration")
private Integer duration;
/**
*
*/

@ -43,7 +43,7 @@
</if>
${ew.SqlSegment}
</if>
ORDER BY dat DESC,updateAt DESC,creatAt DESC
ORDER BY updateAt DESC,creatAt DESC
</select>
<resultMap id="referenceDateMap" type="java.util.Map" autoMapping="false">

Loading…
Cancel
Save