zhangjinli 3 years ago
parent 8dc993b81a
commit 5a2b5e6688

@ -95,13 +95,15 @@ public class UtilsController {
String filePath = path + "/" + newFileName;
File dest = new File(filePath);
// if (compress != null && compress &&fileTypeNum ==2&& file.getSize() >= picSizeLimit) {
if (fileTypeNum ==2&&file.getSize() >= picSizeLimit) {
if (fileTypeNum ==2) {
String filePathSmall = path + "/" + newFileNameSmall;
File beforeFile = new File(filePathSmall);
//生成目标图片
Thumbnails.of(file.getInputStream()).scale(1f).toFile(beforeFile);
//压缩图片至指定大小下
if(file.getSize() >= picSizeLimit){
commpressPicCycle(filePathSmall, picSizeLimit, 0.8);
}
res.put("fileUrlSmall", "/upload/" + newFileNameSmall);
}
if (!dest.getParentFile().exists()) {

@ -133,13 +133,13 @@ public class TaskController {
String url = e.getUrl();
if (url != null && e.getUrl().lastIndexOf(".") != -1) {
l.add(new Reference().setTitle(task.getTitle()).setCoverUrl(task.getCoverUrl()).setDuration(e.getDuration()).setCreatAt(LocalDateTime.now()).setUpdateAt(LocalDateTime.now())
.setFileUrl(url).setType(FileTypeUtil.getcontentTypeNum(url.substring(url.lastIndexOf(".")))));
.setFileUrl(url).setType(FileTypeUtil.getcontentTypeNum(url.substring(url.lastIndexOf(".")))).setIsDeleted(1));
// ta.add(new TopicActivity().setTitle(task.getTitle()).setCover(task.getCoverUrl()).setCreatAt(LocalDateTime.now())
// .setContent(e).setType(FileTypeUtil.getcontentTypeNum(e.substring(e.lastIndexOf(".")))));
}
}
if (l.size() > 0) {
// referenceService.saveBatch(l);
referenceService.saveBatch(l);
// topicActivityService.saveBatch(ta);
List<Integer> reference = new ArrayList<>();
for (Reference r : l) {
@ -616,6 +616,12 @@ public class TaskController {
private String userName;
@Schema(title = "部门名称")
private String departmentName;
@Schema(title = "开始时间(yyyy-MM-dd HH:mm:ss)")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime beginTime;
@Schema(title = "结束时间(yyyy-MM-dd HH:mm:ss)")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;
}
@Operation(summary = "任务传播数据")
@ -626,6 +632,12 @@ public class TaskController {
qw.eq("t2.id", param.getId()).groupBy("t1.userId");
qw.like(param.getUserName() != null, "t3.name", param.getUserName());
qw.like(param.getDepartmentName() != null, "t4.name", param.getDepartmentName());
if(null !=param.getBeginTime()){
qw.ge( "date_format(t1.creatAt, '%Y-%m-%d')", param.getBeginTime());
}
if(null !=param.getEndTime()){
qw.le( "date_format(t1.creatAt, '%Y-%m-%d')", param.getEndTime());
}
qw.orderByDesc("effectResultSum");
return Result.success( taskService.taskEffectDataPage(MybatisPlusUtil.SetNumPage(param.getPageNum(), param.getPageSize()),qw));
}

@ -97,7 +97,7 @@ public interface TaskMapper extends BaseMapper<Task> {
"${ew.customSqlSegment}")
List<Map> taskEffectData(@Param("ew") Wrapper<Task> queryWrapper);
@Select("SELECT SUM(t1.playNum) as playNumSum,SUM(t1.commendNum) as commendNumSum,\n" +
@Select("SELECT IFNULL(SUM(t1.playNum),0) as playNumSum,SUM(t1.commendNum) as commendNumSum,\n" +
"SUM(t1.collectionNum) as collectionNumSum,SUM(t1.commentNum) as commentNumSum,\n" +
"SUM(t1.reSendNum) as reSendNumSum,SUM(t1.recommendNum) as recommendNumSum,SUM(t1.effectResult) as effectResultSum,t1.userId,\n" +
"t2.title as taskTitle,t3.name as userName,t4.name as departmentName from video as t1 INNER JOIN task as t2 on t2.id = t1.taskId\n" +

@ -95,13 +95,13 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements IT
String url = e.getUrl();
if (url != null && e.getUrl().lastIndexOf(".") != -1) {
l.add(new Reference().setTitle(task.getTitle()).setCoverUrl(task.getCoverUrl()).setDuration(e.getDuration()).setCreatAt(LocalDateTime.now()).setUpdateAt(LocalDateTime.now())
.setFileUrl(url).setType(FileTypeUtil.getcontentTypeNum(url.substring(url.lastIndexOf(".")))));
.setFileUrl(url).setType(FileTypeUtil.getcontentTypeNum(url.substring(url.lastIndexOf(".")))).setIsDeleted(1));
// ta.add(new TopicActivity().setTitle(task.getTitle()).setCover(task.getCoverUrl()).setCreatAt(LocalDateTime.now())
// .setContent(e).setType(FileTypeUtil.getcontentTypeNum(e.substring(e.lastIndexOf(".")))));
}
}
if (l.size() > 0) {
// referenceService.saveBatch(l);
referenceService.saveBatch(l);
// topicActivityService.saveBatch(ta);
for (Reference r : l) {
referenceList.add(r.getId());

Loading…
Cancel
Save