diff --git a/share-api/src/main/java/com/xjy/ai/api/controller/glcc/GlccTutorEvaluationController.java b/share-api/src/main/java/com/xjy/ai/api/controller/glcc/GlccTutorEvaluationController.java new file mode 100644 index 0000000..8f3dd96 --- /dev/null +++ b/share-api/src/main/java/com/xjy/ai/api/controller/glcc/GlccTutorEvaluationController.java @@ -0,0 +1,58 @@ +package com.xjy.ai.api.controller.glcc; + + +import com.xjy.ai.common.response.DataPacketUtil; +import com.xjy.ai.common.response.ResponseData; +import com.xjy.ai.common.utils.ValidatorUtils; +import com.xjy.ai.model.service.glcc.TutorEvaluationService; +import com.xjy.ai.model.service.glcc.vo.TutorEvaluationVo; +import com.xjy.ai.model.service.glcc.vo.UpdateTutorEvaluationVo; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 开源夏令营导师评分表 前端控制器 + *

+ * + * @author + * @since 2022-08-08 + */ +@RestController +@RequestMapping("/api/tutorEvaluation") +public class GlccTutorEvaluationController { + + @Autowired + private TutorEvaluationService tutorEvaluationService; + + @ApiOperation("导师提交中期考核评分") + @PostMapping("/create") + public ResponseEntity create(@Validated @RequestBody TutorEvaluationVo glccTutorEvaluationVo, BindingResult bindingResult) { + String errors = ValidatorUtils.buildValidationdErrorMessage(bindingResult); + if (errors.length() > 1) { + return DataPacketUtil.badRequest(errors); + } + boolean success = tutorEvaluationService.create(glccTutorEvaluationVo); + return success ? DataPacketUtil.ok("success") : DataPacketUtil.badRequest(); + } + + @ApiOperation("导师更新中期考核评分") + @PostMapping("/update") + public ResponseEntity update(@Validated @RequestBody UpdateTutorEvaluationVo updateTutorEvaluationVo, BindingResult bindingResult) { + String errors = ValidatorUtils.buildValidationdErrorMessage(bindingResult); + if (errors.length() > 1) { + return DataPacketUtil.badRequest(errors); + } + boolean success = tutorEvaluationService.update(updateTutorEvaluationVo); + return success ? DataPacketUtil.ok("success") : DataPacketUtil.badRequest(); + } + +} diff --git a/share-model/src/main/java/com/xjy/ai/model/dao/glcc/entity/GlccTutorEvaluation.java b/share-model/src/main/java/com/xjy/ai/model/dao/glcc/entity/GlccTutorEvaluation.java new file mode 100644 index 0000000..218918e --- /dev/null +++ b/share-model/src/main/java/com/xjy/ai/model/dao/glcc/entity/GlccTutorEvaluation.java @@ -0,0 +1,180 @@ +package com.xjy.ai.model.dao.glcc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; + +/** + *

+ * 开源夏令营导师评分表 + *

+ * + * @author + * @since 2022-08-08 + */ +@TableName("glcc_tutor_evaluation") +public class GlccTutorEvaluation implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 导师用户id + */ + @TableField("tutor_user_id") + private Integer tutorUserId; + + /** + * 中期考核材料id + */ + @TableField("medium_term_examine_material_id") + private Integer mediumTermExamineMaterialId; + + /** + * 工作态度评价 + */ + @TableField("work_attitude_evaluation") + private String workAttitudeEvaluation; + + /** + * 开发进度评价 + */ + @TableField("develop_progress_evaluation") + private String developProgressEvaluation; + + /** + * 项目完成质量评价 + */ + @TableField("project_quality_evaluation") + private String projectQualityEvaluation; + + /** + * 总体评分评价 + */ + @TableField("totality_evaluation") + private String totalityEvaluation; + + /** + * 评语 + */ + @TableField("comment") + private String comment; + + /** + * 创建时间 + */ + @TableField("created_on") + private Date createdOn; + + /** + * 更新时间 + */ + @TableField("updated_on") + private Date updatedOn; + + /** + * 0未删除 1删除 + */ + @TableField("is_delete") + private Boolean isDelete; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + public Integer getTutorUserId() { + return tutorUserId; + } + + public void setTutorUserId(Integer tutorUserId) { + this.tutorUserId = tutorUserId; + } + public Integer getMediumTermExamineMaterialId() { + return mediumTermExamineMaterialId; + } + + public void setMediumTermExamineMaterialId(Integer mediumTermExamineMaterialId) { + this.mediumTermExamineMaterialId = mediumTermExamineMaterialId; + } + public String getWorkAttitudeEvaluation() { + return workAttitudeEvaluation; + } + + public void setWorkAttitudeEvaluation(String workAttitudeEvaluation) { + this.workAttitudeEvaluation = workAttitudeEvaluation; + } + public String getDevelopProgressEvaluation() { + return developProgressEvaluation; + } + + public void setDevelopProgressEvaluation(String developProgressEvaluation) { + this.developProgressEvaluation = developProgressEvaluation; + } + public String getProjectQualityEvaluation() { + return projectQualityEvaluation; + } + + public void setProjectQualityEvaluation(String projectQualityEvaluation) { + this.projectQualityEvaluation = projectQualityEvaluation; + } + public String getTotalityEvaluation() { + return totalityEvaluation; + } + + public void setTotalityEvaluation(String totalityEvaluation) { + this.totalityEvaluation = totalityEvaluation; + } + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + public Date getUpdatedOn() { + return updatedOn; + } + + public void setUpdatedOn(Date updatedOn) { + this.updatedOn = updatedOn; + } + public Boolean getIsDelete() { + return isDelete; + } + + public void setIsDelete(Boolean isDelete) { + this.isDelete = isDelete; + } + + @Override + public String toString() { + return "GlccTutorEvaluation{" + + "id=" + id + + ", tutorUserId=" + tutorUserId + + ", mediumTermExamineMaterialId=" + mediumTermExamineMaterialId + + ", workAttitudeEvaluation=" + workAttitudeEvaluation + + ", developProgressEvaluation=" + developProgressEvaluation + + ", projectQualityEvaluation=" + projectQualityEvaluation + + ", totalityEvaluation=" + totalityEvaluation + + ", comment=" + comment + + ", createdOn=" + createdOn + + ", updatedOn=" + updatedOn + + ", isDelete=" + isDelete + + "}"; + } +} diff --git a/share-model/src/main/java/com/xjy/ai/model/dao/glcc/mapper/GlccTutorEvaluationMapper.java b/share-model/src/main/java/com/xjy/ai/model/dao/glcc/mapper/GlccTutorEvaluationMapper.java new file mode 100644 index 0000000..f7b7793 --- /dev/null +++ b/share-model/src/main/java/com/xjy/ai/model/dao/glcc/mapper/GlccTutorEvaluationMapper.java @@ -0,0 +1,16 @@ +package com.xjy.ai.model.dao.glcc.mapper; + +import com.xjy.ai.model.dao.glcc.entity.GlccTutorEvaluation; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 开源夏令营导师评分表 Mapper 接口 + *

+ * + * @author + * @since 2022-08-08 + */ +public interface GlccTutorEvaluationMapper extends BaseMapper { + +} diff --git a/share-model/src/main/java/com/xjy/ai/model/service/glcc/Impl/TutorEvaluationServiceImpl.java b/share-model/src/main/java/com/xjy/ai/model/service/glcc/Impl/TutorEvaluationServiceImpl.java new file mode 100644 index 0000000..8db8dcb --- /dev/null +++ b/share-model/src/main/java/com/xjy/ai/model/service/glcc/Impl/TutorEvaluationServiceImpl.java @@ -0,0 +1,46 @@ +package com.xjy.ai.model.service.glcc.Impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.xjy.ai.common.utils.BeanCopyUtils; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.xjy.ai.model.dao.glcc.entity.GlccTutorEvaluation; +import com.xjy.ai.model.dao.glcc.mapper.GlccTutorEvaluationMapper; +import com.xjy.ai.model.service.glcc.TutorEvaluationService; +import com.xjy.ai.model.service.glcc.vo.TutorEvaluationVo; +import com.xjy.ai.model.service.glcc.vo.UpdateTutorEvaluationVo; +import org.springframework.stereotype.Service; + +import java.util.Date; + +/** + *

+ * 开源夏令营导师评分表 服务实现类 + *

+ * + * @author + * @since 2022-08-08 + */ +@Service +public class TutorEvaluationServiceImpl extends ServiceImpl implements TutorEvaluationService { + + @Override + public boolean create(TutorEvaluationVo glccTutorEvaluationVo) { + GlccTutorEvaluation glccTutorEvaluation = BeanCopyUtils.beanPropertiesCopy(glccTutorEvaluationVo, GlccTutorEvaluation.class); + return baseMapper.insert(glccTutorEvaluation) > 0; + } + + @Override + public boolean update(UpdateTutorEvaluationVo updateTutorEvaluationVo) { + GlccTutorEvaluation glccTutorEvaluation = BeanCopyUtils.beanPropertiesCopy(updateTutorEvaluationVo, GlccTutorEvaluation.class); + glccTutorEvaluation.setUpdatedOn(new Date()); + return baseMapper.updateById(glccTutorEvaluation) > 0; + } + + @Override + public GlccTutorEvaluation getByMediumTermExamineMaterialId(Integer mediumTermExamineMaterialId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("medium_term_examine_material_id", mediumTermExamineMaterialId); + return getOne(queryWrapper); + } +} diff --git a/share-model/src/main/java/com/xjy/ai/model/service/glcc/TutorEvaluationService.java b/share-model/src/main/java/com/xjy/ai/model/service/glcc/TutorEvaluationService.java new file mode 100644 index 0000000..e8f0fa3 --- /dev/null +++ b/share-model/src/main/java/com/xjy/ai/model/service/glcc/TutorEvaluationService.java @@ -0,0 +1,23 @@ +package com.xjy.ai.model.service.glcc; + +import com.xjy.ai.model.dao.glcc.entity.GlccTutorEvaluation; +import com.baomidou.mybatisplus.extension.service.IService; +import com.xjy.ai.model.service.glcc.vo.TutorEvaluationVo; +import com.xjy.ai.model.service.glcc.vo.UpdateTutorEvaluationVo; + +/** + *

+ * 开源夏令营导师评分表 服务类 + *

+ * + * @author + * @since 2022-08-08 + */ +public interface TutorEvaluationService extends IService { + + boolean create(TutorEvaluationVo glccTutorEvaluationVo); + + boolean update(UpdateTutorEvaluationVo updateTutorEvaluationVo); + + GlccTutorEvaluation getByMediumTermExamineMaterialId(Integer mediumTermExamineMaterialId); +} diff --git a/share-model/src/main/java/com/xjy/ai/model/service/glcc/vo/TutorEvaluationVo.java b/share-model/src/main/java/com/xjy/ai/model/service/glcc/vo/TutorEvaluationVo.java new file mode 100644 index 0000000..ee4e444 --- /dev/null +++ b/share-model/src/main/java/com/xjy/ai/model/service/glcc/vo/TutorEvaluationVo.java @@ -0,0 +1,125 @@ +package com.xjy.ai.model.service.glcc.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 开源夏令营导师评分表 + *

+ * + * @author + * @since 2022-08-08 + */ +public class TutorEvaluationVo { + + /** + * 导师用户id + */ + @NotNull(message = "导师用户id不能为空") + private Integer tutorUserId; + + /** + * 中期考核材料id + */ + @NotNull(message = "中期考核材料id不能为空") + private Integer mediumTermExamineMaterialId; + + /** + * 工作态度评价 eg:S,A,B,C,D + */ + @NotEmpty(message = "工作态度评价不能为空") + @Pattern(regexp = "(S|A|B|C|D)") + private String workAttitudeEvaluation; + + /** + * 开发进度评价 eg:S,A,B,C,D + */ + @NotEmpty(message = "开发进度评价不能为空") + @Pattern(regexp = "(S|A|B|C|D)") + private String developProgressEvaluation; + + /** + * 项目完成质量评价 eg:S,A,B,C,D + */ + @NotEmpty(message = "项目完成质量评价不能为空") + @Pattern(regexp = "(S|A|B|C|D)") + private String projectQualityEvaluation; + + /** + * 总体评分评价 eg:S,A,B,C,D + */ + @Pattern(regexp = "(S|A|B|C|D)") + @NotEmpty(message = "总体评分评价不能为空") + private String totalityEvaluation; + + /** + * 评语 + */ + @NotEmpty(message = "评语不能为空") + private String comment; + + public Integer getTutorUserId() { + return tutorUserId; + } + + public void setTutorUserId(Integer tutorUserId) { + this.tutorUserId = tutorUserId; + } + + public Integer getMediumTermExamineMaterialId() { + return mediumTermExamineMaterialId; + } + + public void setMediumTermExamineMaterialId(Integer mediumTermExamineMaterialId) { + this.mediumTermExamineMaterialId = mediumTermExamineMaterialId; + } + + public String getWorkAttitudeEvaluation() { + return workAttitudeEvaluation; + } + + public void setWorkAttitudeEvaluation(String workAttitudeEvaluation) { + this.workAttitudeEvaluation = workAttitudeEvaluation; + } + + public String getDevelopProgressEvaluation() { + return developProgressEvaluation; + } + + public void setDevelopProgressEvaluation(String developProgressEvaluation) { + this.developProgressEvaluation = developProgressEvaluation; + } + + public String getProjectQualityEvaluation() { + return projectQualityEvaluation; + } + + public void setProjectQualityEvaluation(String projectQualityEvaluation) { + this.projectQualityEvaluation = projectQualityEvaluation; + } + + public String getTotalityEvaluation() { + return totalityEvaluation; + } + + public void setTotalityEvaluation(String totalityEvaluation) { + this.totalityEvaluation = totalityEvaluation; + } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } +} diff --git a/share-model/src/main/java/com/xjy/ai/model/service/glcc/vo/UpdateTutorEvaluationVo.java b/share-model/src/main/java/com/xjy/ai/model/service/glcc/vo/UpdateTutorEvaluationVo.java new file mode 100644 index 0000000..1c45680 --- /dev/null +++ b/share-model/src/main/java/com/xjy/ai/model/service/glcc/vo/UpdateTutorEvaluationVo.java @@ -0,0 +1,128 @@ +package com.xjy.ai.model.service.glcc.vo; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; + +/** + *

+ * 开源夏令营导师评分表 + *

+ * + * @author + * @since 2022-08-08 + */ +public class UpdateTutorEvaluationVo { + + @NotNull(message = "ID") + private Integer id; + /** + * 导师用户id + */ + @NotNull(message = "导师用户id不能为空") + private Integer tutorUserId; + + /** + * 中期考核材料id + */ + @NotNull(message = "中期考核材料id不能为空") + private Integer mediumTermExamineMaterialId; + + /** + * 工作态度评价 eg:S,A,B,C,D + */ + @NotEmpty(message = "工作态度评价不能为空") + @Pattern(regexp = "(S|A|B|C|D)") + private String workAttitudeEvaluation; + + /** + * 开发进度评价 eg:S,A,B,C,D + */ + @NotEmpty(message = "开发进度评价不能为空") + @Pattern(regexp = "(S|A|B|C|D)") + private String developProgressEvaluation; + + /** + * 项目完成质量评价 eg:S,A,B,C,D + */ + @NotEmpty(message = "项目完成质量评价不能为空") + @Pattern(regexp = "(S|A|B|C|D)") + private String projectQualityEvaluation; + + /** + * 总体评分评价 eg:S,A,B,C,D + */ + @Pattern(regexp = "(S|A|B|C|D)") + @NotEmpty(message = "总体评分评价不能为空") + private String totalityEvaluation; + + /** + * 评语 + */ + @NotEmpty(message = "评语不能为空") + private String comment; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getTutorUserId() { + return tutorUserId; + } + + public void setTutorUserId(Integer tutorUserId) { + this.tutorUserId = tutorUserId; + } + + public Integer getMediumTermExamineMaterialId() { + return mediumTermExamineMaterialId; + } + + public void setMediumTermExamineMaterialId(Integer mediumTermExamineMaterialId) { + this.mediumTermExamineMaterialId = mediumTermExamineMaterialId; + } + + public String getWorkAttitudeEvaluation() { + return workAttitudeEvaluation; + } + + public void setWorkAttitudeEvaluation(String workAttitudeEvaluation) { + this.workAttitudeEvaluation = workAttitudeEvaluation; + } + + public String getDevelopProgressEvaluation() { + return developProgressEvaluation; + } + + public void setDevelopProgressEvaluation(String developProgressEvaluation) { + this.developProgressEvaluation = developProgressEvaluation; + } + + public String getProjectQualityEvaluation() { + return projectQualityEvaluation; + } + + public void setProjectQualityEvaluation(String projectQualityEvaluation) { + this.projectQualityEvaluation = projectQualityEvaluation; + } + + public String getTotalityEvaluation() { + return totalityEvaluation; + } + + public void setTotalityEvaluation(String totalityEvaluation) { + this.totalityEvaluation = totalityEvaluation; + } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } +} diff --git a/share-model/src/main/resources/mapper/glcc/GlccTutorEvaluationMapper.xml b/share-model/src/main/resources/mapper/glcc/GlccTutorEvaluationMapper.xml new file mode 100644 index 0000000..608a1b5 --- /dev/null +++ b/share-model/src/main/resources/mapper/glcc/GlccTutorEvaluationMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + id, tutor_user_id, medium_term_examine_material_id, work_attitude_evaluation, develop_progress_evaluation, project_quality_evaluation, totality_evaluation, comment, created_on, updated_on, is_delete + + +