参赛用户大赛任务调整
parent
193e64ada1
commit
53fd3bf6b9
@ -0,0 +1,9 @@
|
||||
package com.tz.platform.common.core.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CompetitionNews {
|
||||
private String img;
|
||||
private String content;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.tz.platform.common.core.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TaskQuestion {
|
||||
private Integer groupId;
|
||||
private List<Long> questionIds;
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.tz.platform.competitiion.pc;
|
||||
|
||||
import com.tz.platform.common.core.base.Result;
|
||||
import com.tz.platform.competitiion.pc.biz.PCTaskBiz;
|
||||
import com.tz.platform.competitiion.pc.dto.ListTaskDTO;
|
||||
import com.tz.platform.competitiion.pc.dto.TaskDTO;
|
||||
import com.tz.platform.competitiion.pc.vo.TaskVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/pc/competition/task")
|
||||
public class CompetitionTaskController {
|
||||
|
||||
@Autowired
|
||||
private PCTaskBiz biz;
|
||||
|
||||
@PostMapping(value = "add")
|
||||
public Result<Integer> add(TaskVO vo){
|
||||
return biz.save(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = "update")
|
||||
public Result<Integer> update(TaskVO vo){
|
||||
return biz.save(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = "list")
|
||||
public Result<ListTaskDTO> list(TaskVO vo){
|
||||
return biz.list(vo);
|
||||
}
|
||||
|
||||
@PostMapping(value = "get")
|
||||
public Result<TaskDTO> get(TaskVO vo){
|
||||
return biz.get(vo);
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.tz.platform.competitiion.pc.biz;
|
||||
|
||||
import com.tz.platform.common.core.base.Result;
|
||||
import com.tz.platform.competitiion.pc.dto.ListTaskDTO;
|
||||
import com.tz.platform.competitiion.pc.dto.TaskDTO;
|
||||
import com.tz.platform.competitiion.pc.vo.TaskVO;
|
||||
import com.tz.platform.entity.CompetitionTask;
|
||||
import com.tz.platform.repository.CompetitionTaskDao;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class PCTaskBiz {
|
||||
@Autowired
|
||||
private CompetitionTaskDao taskDao;
|
||||
|
||||
public Result<Integer> save(TaskVO vo){
|
||||
if(vo.getCompetitionId()==null|| vo.getCompetitionId() <=0){
|
||||
return Result.error("没有大赛信息");
|
||||
}
|
||||
if(vo.getStageId()==null||vo.getStageId() <=0){
|
||||
return Result.error("没有指定赛段");
|
||||
}
|
||||
|
||||
CompetitionTask task = new CompetitionTask();
|
||||
BeanUtils.copyProperties(vo,task);
|
||||
task = taskDao.save(task);
|
||||
return Result.success(task.getId());
|
||||
}
|
||||
|
||||
public Result<TaskDTO> get(TaskVO vo){
|
||||
CompetitionTask task = taskDao.getById(vo.getId());
|
||||
TaskDTO dto = new TaskDTO();
|
||||
BeanUtils.copyProperties(task,dto);
|
||||
return Result.success(dto);
|
||||
}
|
||||
public Result<ListTaskDTO> list(TaskVO vo){
|
||||
List<CompetitionTask> taskList = taskDao.findAllByCompetitionId(vo.getCompetitionId());
|
||||
ListTaskDTO dto = new ListTaskDTO();
|
||||
dto.setList(taskList);
|
||||
return Result.success(dto);
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.tz.platform.competitiion.pc.dto;
|
||||
|
||||
import com.tz.platform.entity.CompetitionTask;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ListTaskDTO implements Serializable {
|
||||
List<CompetitionTask> list;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.tz.platform.competitiion.pc.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class TaskDTO implements Serializable {
|
||||
private Integer id;
|
||||
private Long competitionId;
|
||||
private Integer stageId;
|
||||
private Long financePower;
|
||||
private Long examPower;
|
||||
private Date operationStartTime;
|
||||
private Date operationEndTime;
|
||||
private Date examStartTime;
|
||||
private Date examEndTime;
|
||||
private Integer tradeType;
|
||||
private Long initCapital;
|
||||
private String operationLogo;
|
||||
private Long financeBasePower;
|
||||
private Long financeProfitPower;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.tz.platform.competitiion.pc.vo;
|
||||
|
||||
import com.tz.platform.common.core.bo.TaskQuestion;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TaskVO implements Serializable {
|
||||
private Integer id;
|
||||
private Long competitionId;
|
||||
private Integer stageId;
|
||||
private Long financePower;
|
||||
private Long examPower;
|
||||
private Date operationStartTime;
|
||||
private Date operationEndTime;
|
||||
private Date examStartTime;
|
||||
private Date examEndTime;
|
||||
private Integer tradeType;
|
||||
private Long initCapital;
|
||||
private String operationLogo;
|
||||
private Long financeBasePower;
|
||||
private Long financeProfitPower;
|
||||
private List<TaskQuestion> questionList;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.tz.platform.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
public class CompetitionTeam {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer id;
|
||||
private Long competitionId;
|
||||
private Integer stageId;
|
||||
private String teamName;
|
||||
private String teacherName;
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.tz.platform.entity;
|
||||
|
||||
import com.tz.platform.common.core.bo.Answer;
|
||||
import com.tz.platform.common.core.bo.SubQuestionVO;
|
||||
import com.vladmihalcea.hibernate.type.json.JsonStringType;
|
||||
import lombok.Data;
|
||||
import org.hibernate.annotations.Type;
|
||||
import org.hibernate.annotations.TypeDef;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@TypeDef(name = "json", typeClass = JsonStringType.class)
|
||||
public class ExamQuestion {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private Long competitionId;
|
||||
private Integer stageId;
|
||||
private Integer groupId;
|
||||
private Long questionType;
|
||||
private Long score;
|
||||
private Integer type;
|
||||
@Column(columnDefinition = "text")
|
||||
private String stem;
|
||||
@Column(columnDefinition = "text")
|
||||
private String content;
|
||||
private String stemImg;
|
||||
@Type(type = "json")
|
||||
@Column(columnDefinition = "json" )
|
||||
List<Answer> answerList;
|
||||
@Column( columnDefinition = "text")
|
||||
private String analysis;
|
||||
@Type(type = "json")
|
||||
@Column(columnDefinition = "json")
|
||||
private List<Integer> answerId;
|
||||
@Type(type = "json")
|
||||
@Column(columnDefinition = "json")
|
||||
private List<SubQuestionVO> children;
|
||||
}
|
Loading…
Reference in New Issue