Procházet zdrojové kódy

1、增加学生实习经历模块

rayson před 5 měsíci
rodič
revize
517ad113e7

+ 3 - 0
menduner/menduner-system-api/src/main/java/com/citu/module/menduner/system/enums/ErrorCodeConstants.java

@@ -642,4 +642,7 @@ public interface ErrorCodeConstants {
 
     // ========== 学生信息 1_100_065_000 ==========
     ErrorCode STUDENT_NOT_EXISTS = new ErrorCode(1_100_065_001, "学生信息不存在");
+
+    // ========== 学生实习记录 1_100_066_000 ==========
+    ErrorCode STUDENT_PRACTICE_RECORD_NOT_EXISTS = new ErrorCode(1_100_066_001, "学生实习记录不存在");
 }

+ 54 - 0
menduner/menduner-system-biz/src/main/java/com/citu/module/menduner/system/controller/base/person/student/StudentPracticeRecordPageReqVO.java

@@ -0,0 +1,54 @@
+package com.citu.module.menduner.system.controller.base.person.student;
+
+
+import com.citu.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static com.citu.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 学生实习记录分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class StudentPracticeRecordPageReqVO extends PageParam {
+
+    @Schema(description = "用户id", example = "26596")
+    private Long userId;
+
+    @Schema(description = "人才id", example = "32718")
+    private Long personId;
+
+    @Schema(description = "学生id", example = "29238")
+    private Long studentId;
+
+    @Schema(description = "企业id", example = "14881")
+    private Long enterpriseId;
+
+    @Schema(description = "职位id", example = "17350")
+    private Long jobId;
+
+    @Schema(description = "招聘会id", example = "9371")
+    private Long jobFairId;
+
+    @Schema(description = "实习开始时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] startTime;
+
+    @Schema(description = "实习结束时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] endTime;
+
+    @Schema(description = "状态", example = "2")
+    private Integer status;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 64 - 0
menduner/menduner-system-biz/src/main/java/com/citu/module/menduner/system/controller/base/person/student/StudentPracticeRecordRespVO.java

@@ -0,0 +1,64 @@
+package com.citu.module.menduner.system.controller.base.person.student;
+
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 学生实习记录 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class StudentPracticeRecordRespVO {
+
+    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "2479")
+    @ExcelProperty("id")
+    private Long id;
+
+    @Schema(description = "用户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26596")
+    @ExcelProperty("用户id")
+    private Long userId;
+
+    @Schema(description = "人才id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32718")
+    @ExcelProperty("人才id")
+    private Long personId;
+
+    @Schema(description = "学生id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29238")
+    @ExcelProperty("学生id")
+    private Long studentId;
+
+    @Schema(description = "企业id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14881")
+    @ExcelProperty("企业id")
+    private Long enterpriseId;
+
+    @Schema(description = "职位id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17350")
+    @ExcelProperty("职位id")
+    private Long jobId;
+
+    @Schema(description = "招聘会id", example = "9371")
+    @ExcelProperty("招聘会id")
+    private Long jobFairId;
+
+    @Schema(description = "实习开始时间")
+    @ExcelProperty("实习开始时间")
+    private LocalDateTime startTime;
+
+    @Schema(description = "实习结束时间")
+    @ExcelProperty("实习结束时间")
+    private LocalDateTime endTime;
+
+    @Schema(description = "状态", example = "2")
+    @ExcelProperty("状态")
+    private Integer status;
+
+    @Schema(description = "拒绝原因")
+    @ExcelProperty("拒绝原因")
+    private String refuseMsg;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 52 - 0
menduner/menduner-system-biz/src/main/java/com/citu/module/menduner/system/controller/base/person/student/StudentPracticeRecordSaveReqVO.java

@@ -0,0 +1,52 @@
+package com.citu.module.menduner.system.controller.base.person.student;
+
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 学生实习记录新增/修改 Request VO")
+@Data
+public class StudentPracticeRecordSaveReqVO {
+
+    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "2479")
+    private Long id;
+
+    @Schema(description = "用户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26596")
+    @NotNull(message = "用户id不能为空")
+    private Long userId;
+
+    @Schema(description = "人才id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32718")
+    @NotNull(message = "人才id不能为空")
+    private Long personId;
+
+    @Schema(description = "学生id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29238")
+    @NotNull(message = "学生id不能为空")
+    private Long studentId;
+
+    @Schema(description = "企业id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14881")
+    @NotNull(message = "企业id不能为空")
+    private Long enterpriseId;
+
+    @Schema(description = "职位id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17350")
+    @NotNull(message = "职位id不能为空")
+    private Long jobId;
+
+    @Schema(description = "招聘会id", example = "9371")
+    private Long jobFairId;
+
+    @Schema(description = "实习开始时间")
+    private LocalDateTime startTime;
+
+    @Schema(description = "实习结束时间")
+    private LocalDateTime endTime;
+
+    @Schema(description = "状态", example = "2")
+    private Integer status;
+
+    @Schema(description = "拒绝原因")
+    private String refuseMsg;
+
+}

+ 73 - 0
menduner/menduner-system-biz/src/main/java/com/citu/module/menduner/system/dal/dataobject/person/StudentPracticeRecordDO.java

@@ -0,0 +1,73 @@
+package com.citu.module.menduner.system.dal.dataobject.person;
+
+
+import com.baomidou.mybatisplus.annotation.KeySequence;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.citu.framework.mybatis.core.dataobject.BaseDO;
+import lombok.*;
+
+import java.time.LocalDateTime;
+
+/**
+ * 学生实习记录 DO
+ *
+ * @author Rayson
+ */
+@TableName("mde_student_practice_record")
+@KeySequence("mde_student_practice_record_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class StudentPracticeRecordDO extends BaseDO {
+
+    /**
+     * id
+     */
+    @TableId
+    private Long id;
+    /**
+     * 用户id
+     */
+    private Long userId;
+    /**
+     * 人才id
+     */
+    private Long personId;
+    /**
+     * 学生id
+     */
+    private Long studentId;
+    /**
+     * 企业id
+     */
+    private Long enterpriseId;
+    /**
+     * 职位id
+     */
+    private Long jobId;
+    /**
+     * 招聘会id
+     */
+    private Long jobFairId;
+    /**
+     * 实习开始时间
+     */
+    private LocalDateTime startTime;
+    /**
+     * 实习结束时间
+     */
+    private LocalDateTime endTime;
+    /**
+     * 状态
+     */
+    private Integer status;
+    /**
+     * 拒绝原因
+     */
+    private String refuseMsg;
+
+}

+ 34 - 0
menduner/menduner-system-biz/src/main/java/com/citu/module/menduner/system/dal/mysql/person/StudentPracticeRecordMapper.java

@@ -0,0 +1,34 @@
+package com.citu.module.menduner.system.dal.mysql.person;
+
+
+import com.citu.framework.common.pojo.PageResult;
+import com.citu.framework.mybatis.core.mapper.BaseMapperX;
+import com.citu.framework.mybatis.core.query.LambdaQueryWrapperX;
+import com.citu.module.menduner.system.controller.base.person.student.StudentPracticeRecordPageReqVO;
+import com.citu.module.menduner.system.dal.dataobject.person.StudentPracticeRecordDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 学生实习记录 Mapper
+ *
+ * @author Rayson
+ */
+@Mapper
+public interface StudentPracticeRecordMapper extends BaseMapperX<StudentPracticeRecordDO> {
+
+    default PageResult<StudentPracticeRecordDO> selectPage(StudentPracticeRecordPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<StudentPracticeRecordDO>()
+                .eqIfPresent(StudentPracticeRecordDO::getUserId, reqVO.getUserId())
+                .eqIfPresent(StudentPracticeRecordDO::getPersonId, reqVO.getPersonId())
+                .eqIfPresent(StudentPracticeRecordDO::getStudentId, reqVO.getStudentId())
+                .eqIfPresent(StudentPracticeRecordDO::getEnterpriseId, reqVO.getEnterpriseId())
+                .eqIfPresent(StudentPracticeRecordDO::getJobId, reqVO.getJobId())
+                .eqIfPresent(StudentPracticeRecordDO::getJobFairId, reqVO.getJobFairId())
+                .betweenIfPresent(StudentPracticeRecordDO::getStartTime, reqVO.getStartTime())
+                .betweenIfPresent(StudentPracticeRecordDO::getEndTime, reqVO.getEndTime())
+                .eqIfPresent(StudentPracticeRecordDO::getStatus, reqVO.getStatus())
+                .betweenIfPresent(StudentPracticeRecordDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(StudentPracticeRecordDO::getId));
+    }
+
+}

+ 6 - 2
menduner/menduner-system-biz/src/main/java/com/citu/module/menduner/system/service/job/JobCvRelServiceImpl.java

@@ -6,6 +6,7 @@ import com.citu.framework.common.pojo.PageResult;
 import com.citu.framework.common.util.object.BeanUtils;
 import com.citu.module.menduner.common.util.LoginUserContext;
 import com.citu.module.menduner.system.aop.VipEntitlementCheck;
+import com.citu.module.menduner.system.aop.VipEntitlementCheckAspect;
 import com.citu.module.menduner.system.controller.app.jobhunt.job.hire.AppHireJobCvRelQueryReqVO;
 import com.citu.module.menduner.system.controller.app.jobhunt.job.hire.AppHireJobCvRelReqVO;
 import com.citu.module.menduner.system.controller.app.jobhunt.job.hire.AppHireJobCvRelRespVO;
@@ -69,6 +70,9 @@ public class JobCvRelServiceImpl implements JobCvRelService {
     @Resource
     private MessageUtils messageUtils;
 
+    @Resource
+    private VipEntitlementCheckAspect vipEntitlementCheckAspect;
+
     @Override
     public Long createJobCvRel(JobCvRelSaveReqVO createReqVO) {
         // 插入
@@ -218,7 +222,6 @@ public class JobCvRelServiceImpl implements JobCvRelService {
 
     @Override
     @DSTransactional
-    @VipEntitlementCheck(type = VipEntitlementCheck.OPERATE_LOOK_CV)
     public boolean look(Long id) {
         JobCvRelDO jobCvRel = validateJobCvRelExists(id);
         if (JobCvRelStatusEnum.LOOK.getStatus().equals(jobCvRel.getStatus())) {
@@ -226,7 +229,8 @@ public class JobCvRelServiceImpl implements JobCvRelService {
         }
         jobCvRel.setStatus(JobCvRelStatusEnum.LOOK.getStatus());
         boolean result = jobCvRelMapper.updateById(jobCvRel) == 1;
-
+        // 扣除查看次数
+        vipEntitlementCheckAspect.deductQuota(VipEntitlementCheck.OPERATE_LOOK_CV);
 
         // 构建消息体
         JobAdvertisedDO job = jobAdvertisedService.getJobAdvertised(jobCvRel.getJobId());

+ 56 - 0
menduner/menduner-system-biz/src/main/java/com/citu/module/menduner/system/service/person/student/StudentPracticeRecordService.java

@@ -0,0 +1,56 @@
+package com.citu.module.menduner.system.service.person.student;
+
+
+import com.citu.framework.common.pojo.PageResult;
+import com.citu.module.menduner.system.controller.base.person.student.StudentPracticeRecordPageReqVO;
+import com.citu.module.menduner.system.controller.base.person.student.StudentPracticeRecordSaveReqVO;
+import com.citu.module.menduner.system.dal.dataobject.person.StudentPracticeRecordDO;
+
+import javax.validation.Valid;
+
+/**
+ * 学生实习记录 Service 接口
+ *
+ * @author Rayson
+ */
+public interface StudentPracticeRecordService {
+
+    /**
+     * 创建学生实习记录
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createStudentPracticeRecord(@Valid StudentPracticeRecordSaveReqVO createReqVO);
+
+    /**
+     * 更新学生实习记录
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateStudentPracticeRecord(@Valid StudentPracticeRecordSaveReqVO updateReqVO);
+
+    /**
+     * 删除学生实习记录
+     *
+     * @param id 编号
+     */
+    void deleteStudentPracticeRecord(Long id);
+
+    /**
+     * 获得学生实习记录
+     *
+     * @param id 编号
+     * @return 学生实习记录
+     */
+    StudentPracticeRecordDO getStudentPracticeRecord(Long id);
+
+    /**
+     * 获得学生实习记录分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 学生实习记录分页
+     */
+    PageResult<StudentPracticeRecordDO> getStudentPracticeRecordPage(StudentPracticeRecordPageReqVO pageReqVO);
+
+}

+ 72 - 0
menduner/menduner-system-biz/src/main/java/com/citu/module/menduner/system/service/person/student/StudentPracticeRecordServiceImpl.java

@@ -0,0 +1,72 @@
+package com.citu.module.menduner.system.service.person.student;
+
+
+import com.citu.framework.common.pojo.PageResult;
+import com.citu.framework.common.util.object.BeanUtils;
+import com.citu.module.menduner.system.controller.base.person.student.StudentPracticeRecordPageReqVO;
+import com.citu.module.menduner.system.controller.base.person.student.StudentPracticeRecordSaveReqVO;
+import com.citu.module.menduner.system.dal.dataobject.person.StudentPracticeRecordDO;
+import com.citu.module.menduner.system.dal.mysql.person.StudentPracticeRecordMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+
+import static com.citu.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static com.citu.module.menduner.system.enums.ErrorCodeConstants.STUDENT_PRACTICE_RECORD_NOT_EXISTS;
+
+/**
+ * 学生实习记录 Service 实现类
+ *
+ * @author Rayson
+ */
+@Service
+@Validated
+public class StudentPracticeRecordServiceImpl implements StudentPracticeRecordService {
+
+    @Resource
+    private StudentPracticeRecordMapper studentPracticeRecordMapper;
+
+    @Override
+    public Long createStudentPracticeRecord(StudentPracticeRecordSaveReqVO createReqVO) {
+        // 插入
+        StudentPracticeRecordDO studentPracticeRecord = BeanUtils.toBean(createReqVO, StudentPracticeRecordDO.class);
+        studentPracticeRecordMapper.insert(studentPracticeRecord);
+        // 返回
+        return studentPracticeRecord.getId();
+    }
+
+    @Override
+    public void updateStudentPracticeRecord(StudentPracticeRecordSaveReqVO updateReqVO) {
+        // 校验存在
+        validateStudentPracticeRecordExists(updateReqVO.getId());
+        // 更新
+        StudentPracticeRecordDO updateObj = BeanUtils.toBean(updateReqVO, StudentPracticeRecordDO.class);
+        studentPracticeRecordMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteStudentPracticeRecord(Long id) {
+        // 校验存在
+        validateStudentPracticeRecordExists(id);
+        // 删除
+        studentPracticeRecordMapper.deleteById(id);
+    }
+
+    private void validateStudentPracticeRecordExists(Long id) {
+        if (studentPracticeRecordMapper.selectById(id) == null) {
+            throw exception(STUDENT_PRACTICE_RECORD_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public StudentPracticeRecordDO getStudentPracticeRecord(Long id) {
+        return studentPracticeRecordMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<StudentPracticeRecordDO> getStudentPracticeRecordPage(StudentPracticeRecordPageReqVO pageReqVO) {
+        return studentPracticeRecordMapper.selectPage(pageReqVO);
+    }
+
+}