|
|
|
@ -82,6 +82,7 @@ public class TaskController {
|
|
|
|
|
if (LocalDateTime.now().isAfter(task.getStart())) {
|
|
|
|
|
task.setStatus(1);
|
|
|
|
|
}
|
|
|
|
|
task.setCreatAt(LocalDateTime.now());
|
|
|
|
|
taskService.save(task);
|
|
|
|
|
int id = task.getId();
|
|
|
|
|
List tagList = task.getTagList();
|
|
|
|
@ -373,6 +374,47 @@ public class TaskController {
|
|
|
|
|
return Result.success(res);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "任务传播数据")
|
|
|
|
|
@PostMapping("taskEffect")
|
|
|
|
|
@adminTokenValid
|
|
|
|
|
public Result taskEffect(@Validated @RequestBody DetTaskParam param) {
|
|
|
|
|
List<Map> maps = taskService.taskEffectData(new QueryWrapper<>());
|
|
|
|
|
JSONObject res = (JSONObject) JSONObject.toJSON(maps);
|
|
|
|
|
if(maps!=null) {
|
|
|
|
|
QueryWrapper<Task> qw = new QueryWrapper<>();
|
|
|
|
|
qw.groupBy("t1.userId");
|
|
|
|
|
res.put("userEffect", taskService.taskEffectData(qw));
|
|
|
|
|
}
|
|
|
|
|
return Result.success(res);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Data
|
|
|
|
|
static class TaskUserParam {
|
|
|
|
|
@NotNull(message = "id不能为空")
|
|
|
|
|
@Min(value = 1, message = "id最小值为1")
|
|
|
|
|
@Schema(title = "任务id")
|
|
|
|
|
private Integer id;
|
|
|
|
|
@NotNull(message = "用户id不能为空")
|
|
|
|
|
@Schema(title = "用户id")
|
|
|
|
|
private Integer userId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "任务内员工传播数据")
|
|
|
|
|
@PostMapping("taskUserEffect")
|
|
|
|
|
@adminTokenValid
|
|
|
|
|
public Result taskUserEffect(@Validated @RequestBody TaskUserParam param) {
|
|
|
|
|
QueryWrapper<Task> qw = new QueryWrapper<>();
|
|
|
|
|
qw.eq("userId",param.getUserId()).groupBy("t1.userId");
|
|
|
|
|
List<Map> maps = taskService.taskEffectData(qw);
|
|
|
|
|
JSONObject res = (JSONObject) JSONObject.toJSON(maps);
|
|
|
|
|
if(maps!=null) {
|
|
|
|
|
QueryWrapper<Video> qw2 = new QueryWrapper<>();
|
|
|
|
|
qw2.eq("taskId",param.getId()).eq("userId",param.getUserId());
|
|
|
|
|
res.put("userEffect", videoService.list(qw2));
|
|
|
|
|
}
|
|
|
|
|
return Result.success(res);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Data
|
|
|
|
|
static class CNListParam {
|
|
|
|
|
@Schema(title = "姓名")
|
|
|
|
|