更改
This commit is contained in:
parent
45662b4b00
commit
9bd11e351a
@ -2,9 +2,7 @@ package com.ruoyi.cms.api;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.cms.domain.HitRegistrationStudentInfo;
|
||||
import com.ruoyi.cms.domain.HitRegistrationTeachInfo;
|
||||
import com.ruoyi.cms.domain.vo.HitRegistrationStudentInfoVo;
|
||||
import com.ruoyi.cms.export.HitRegistrationStudentInfoExport;
|
||||
|
||||
import com.ruoyi.cms.service.IHitRegistrationStudentInfoService;
|
||||
import com.ruoyi.cms.service.IHitRegistrationTeachInfoService;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
|
@ -0,0 +1,130 @@
|
||||
package com.ruoyi.cms.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.cms.domain.HitCompetitionStudentInfo;
|
||||
import com.ruoyi.cms.service.IHitCompetitionStudentInfoService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.web.service.SysRegisterService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 大赛学生表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-08-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/hit_stu_info")
|
||||
public class HitCompetitionStudentInfoController extends BaseController {
|
||||
@Autowired
|
||||
private IHitCompetitionStudentInfoService hitCompetitionStudentInfoService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询大赛学生列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:info:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HitCompetitionStudentInfo hitCompetitionStudentInfo)
|
||||
{
|
||||
startPage();
|
||||
List<HitCompetitionStudentInfo> list = hitCompetitionStudentInfoService.selectHitCompetitionStudentInfoList(hitCompetitionStudentInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出大赛学生列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:info:export')")
|
||||
@Log(title = "大赛学生", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HitCompetitionStudentInfo hitCompetitionStudentInfo)
|
||||
{
|
||||
List<HitCompetitionStudentInfo> list = hitCompetitionStudentInfoService.selectHitCompetitionStudentInfoList(hitCompetitionStudentInfo);
|
||||
ExcelUtil<HitCompetitionStudentInfo> util = new ExcelUtil<HitCompetitionStudentInfo>(HitCompetitionStudentInfo.class);
|
||||
util.exportExcel(response, list, "大赛学生数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取大赛学生详细信息
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:info:query')")
|
||||
// @GetMapping(value = "/{id}")
|
||||
// public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
// {
|
||||
// return success(hitCompetitionStudentInfoService.selectHitCompetitionStudentInfoById(id));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 新增大赛学生
|
||||
*/
|
||||
|
||||
@Log(title = "大赛学生", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody HitCompetitionStudentInfo hitCompetitionStudentInfo)
|
||||
{
|
||||
return toAjax(hitCompetitionStudentInfoService.insertHitCompetitionStudentInfo(hitCompetitionStudentInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改大赛学生
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:info:edit')")
|
||||
@Log(title = "大赛学生", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody HitCompetitionStudentInfo hitCompetitionStudentInfo)
|
||||
{
|
||||
return toAjax(hitCompetitionStudentInfoService.updateHitCompetitionStudentInfo(hitCompetitionStudentInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除大赛学生
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:info:remove')")
|
||||
@Log(title = "大赛学生", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(hitCompetitionStudentInfoService.deleteHitCompetitionStudentInfoByIds(ids));
|
||||
}
|
||||
/**
|
||||
* 根据学号查询学生信息
|
||||
* @param studentId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{studentId}")
|
||||
public AjaxResult getStudentInfoByStuId(@PathVariable("studentId") String studentId){
|
||||
return success(hitCompetitionStudentInfoService.selectHitCompetitionStudentInfoByStuId(studentId));
|
||||
}
|
||||
/**
|
||||
* 根据学校及赛区查询队友信息
|
||||
* @param schoolName division
|
||||
*/
|
||||
|
||||
@GetMapping( "/getTeamMateInfo")
|
||||
public AjaxResult getTeamMateBySchoolNameAndDivision(@RequestParam String schoolName,@RequestParam String division) {
|
||||
return success(hitCompetitionStudentInfoService.selectTeamMateBySchoolNameAndDivision(schoolName, division));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前用户是否有队伍
|
||||
* @return teamId
|
||||
* @return teamName
|
||||
* @return teamMateId
|
||||
*/
|
||||
@GetMapping("/getTeam")
|
||||
public AjaxResult getTeamMateInfoByStuId(){
|
||||
return AjaxResult.success(hitCompetitionStudentInfoService.selectTeamMateInfoByStuId());
|
||||
}
|
||||
}
|
@ -4,19 +4,12 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.cms.domain.HitRegistrationTeachInfo;
|
||||
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
|
||||
import com.ruoyi.cms.service.IHitRegistrationTeachInfoService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
@ -101,4 +94,14 @@ public class HitRegistrationTeachInfoController extends BaseController
|
||||
{
|
||||
return toAjax(hitRegistrationTeachInfoService.deleteHitRegistrationTeachInfoByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据学校及赛区查询老师信息
|
||||
*/
|
||||
@GetMapping("getTeacherInfo")
|
||||
public AjaxResult getTeacherInfo(@RequestParam String schoolName,@RequestParam String division){
|
||||
return AjaxResult.success(hitRegistrationTeachInfoService.getTeacherInfo(schoolName,division));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,48 @@
|
||||
package com.ruoyi.cms.controller;
|
||||
|
||||
|
||||
import com.ruoyi.cms.domain.HitTeamMembers;
|
||||
import com.ruoyi.cms.service.IHitTeamMembersService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 大赛团队队员表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-08-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("system/hit-team-members")
|
||||
public class HitTeamMembersController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IHitTeamMembersService hitTeamMembersService;
|
||||
|
||||
/**
|
||||
* 同意加入团队
|
||||
* @param teamId
|
||||
* @param teamMateId
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/agreeTeam")
|
||||
public AjaxResult agree(@RequestParam Long teamId , @RequestParam Long teamMateId){
|
||||
return AjaxResult.success(hitTeamMembersService.agreeTeam(teamId, teamMateId));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 拒绝加入团队
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/refuseTeam")
|
||||
public AjaxResult refuse(@RequestParam Long teamId ){
|
||||
return AjaxResult.success(hitTeamMembersService.refuseTeam(teamId)) ;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.ruoyi.cms.controller;
|
||||
|
||||
|
||||
import com.ruoyi.cms.domain.Preliminary;
|
||||
|
||||
import com.ruoyi.cms.service.IHitTeamsService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 团队表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-08-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("system/hit-teams")
|
||||
public class HitTeamsController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IHitTeamsService hitTeamsService;
|
||||
|
||||
/**
|
||||
* 初赛预报名
|
||||
*/
|
||||
@PostMapping("/pre-register")
|
||||
public AjaxResult preRegister(@RequestBody Preliminary preliminary){
|
||||
return toAjax(hitTeamsService.preRegister(preliminary)) ;
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package com.ruoyi.cms.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 大赛学生表
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-08-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("hit_competition_student_info")
|
||||
@ApiModel(value="HitCompetitionStudentInfo对象", description="大赛学生表")
|
||||
public class HitCompetitionStudentInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "团队报名主键")
|
||||
private String hitRegId;
|
||||
|
||||
@ApiModelProperty(value = "学生姓名")
|
||||
private String stuName;
|
||||
|
||||
@ApiModelProperty(value = "学号")
|
||||
private String studentId;
|
||||
|
||||
@ApiModelProperty(value = "学校名称")
|
||||
private String schoolName;
|
||||
|
||||
@ApiModelProperty(value = "院系名称")
|
||||
private String collegeName;
|
||||
|
||||
@ApiModelProperty(value = "专业")
|
||||
private String major;
|
||||
|
||||
@ApiModelProperty(value = "所属赛区")
|
||||
private String division;
|
||||
|
||||
@ApiModelProperty(value = "手机号")
|
||||
private String phoneNumber;
|
||||
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "学生证")
|
||||
private String studentIdCard;
|
||||
|
||||
@ApiModelProperty(value = "个人选拔赛分数")
|
||||
private BigDecimal trialsScore;
|
||||
|
||||
@ApiModelProperty(value = "是否被选为参加初赛人员 (0: 否, 1: 是)")
|
||||
private Boolean isPreliminary;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "逻辑删除 0未删除 1真删除")
|
||||
private Boolean delFlag;
|
||||
|
||||
@ApiModelProperty(value = "创建时间(默认时间当前)")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty(value = "更新时间(默认时间当前)")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
|
||||
}
|
@ -3,9 +3,8 @@ package com.ruoyi.cms.domain;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
@ -64,7 +63,7 @@ public class HitRegInfo extends BaseEntity
|
||||
/** 逻辑删除0未删除1真删除 */
|
||||
private Long delFlag;
|
||||
@TableField(exist = false)
|
||||
private List<HitRegistrationStudentInfo> studentInfoList;
|
||||
private List<HitCompetitionStudentInfo> studentInfoList;
|
||||
@TableField(exist = false)
|
||||
private List<HitRegistrationTeachInfo> teacherInfoList;
|
||||
|
||||
|
@ -1,156 +0,0 @@
|
||||
package com.ruoyi.cms.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 教师信息对象 hit_registration_teach_info
|
||||
*
|
||||
* @author 点亮信息
|
||||
* @date 2024-08-20
|
||||
*/
|
||||
public class HitRegistrationTeachInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 教师ID */
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 报名主键 */
|
||||
@Excel(name = "报名主键")
|
||||
private Long hitRegId;
|
||||
|
||||
/** 教师姓名 */
|
||||
@Excel(name = "教师姓名")
|
||||
private String teacherName;
|
||||
|
||||
/** 教师职务 */
|
||||
@Excel(name = "教师职务")
|
||||
private String teacherJob;
|
||||
|
||||
/** 教师手机号 */
|
||||
@Excel(name = "教师手机号")
|
||||
private String teacherNumber;
|
||||
|
||||
/** 教师email */
|
||||
@Excel(name = "教师email")
|
||||
private String teacherEmail;
|
||||
|
||||
/** 教师所在系及专业 */
|
||||
@Excel(name = "教师所在系及专业")
|
||||
private String teacherSchool;
|
||||
|
||||
/** 逻辑删除0未删除1真删除 */
|
||||
private Long delFlag;
|
||||
|
||||
/** 0指导老师1领队老师 */
|
||||
@Excel(name = "0指导老师1领队老师")
|
||||
private String type;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setHitRegId(Long hitRegId)
|
||||
{
|
||||
this.hitRegId = hitRegId;
|
||||
}
|
||||
|
||||
public Long getHitRegId()
|
||||
{
|
||||
return hitRegId;
|
||||
}
|
||||
public void setTeacherName(String teacherName)
|
||||
{
|
||||
this.teacherName = teacherName;
|
||||
}
|
||||
|
||||
public String getTeacherName()
|
||||
{
|
||||
return teacherName;
|
||||
}
|
||||
public void setTeacherJob(String teacherJob)
|
||||
{
|
||||
this.teacherJob = teacherJob;
|
||||
}
|
||||
|
||||
public String getTeacherJob()
|
||||
{
|
||||
return teacherJob;
|
||||
}
|
||||
public void setTeacherNumber(String teacherNumber)
|
||||
{
|
||||
this.teacherNumber = teacherNumber;
|
||||
}
|
||||
|
||||
public String getTeacherNumber()
|
||||
{
|
||||
return teacherNumber;
|
||||
}
|
||||
public void setTeacherEmail(String teacherEmail)
|
||||
{
|
||||
this.teacherEmail = teacherEmail;
|
||||
}
|
||||
|
||||
public String getTeacherEmail()
|
||||
{
|
||||
return teacherEmail;
|
||||
}
|
||||
public void setTeacherSchool(String teacherSchool)
|
||||
{
|
||||
this.teacherSchool = teacherSchool;
|
||||
}
|
||||
|
||||
public String getTeacherSchool()
|
||||
{
|
||||
return teacherSchool;
|
||||
}
|
||||
public void setDelFlag(Long delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Long getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("hitRegId", getHitRegId())
|
||||
.append("teacherName", getTeacherName())
|
||||
.append("teacherJob", getTeacherJob())
|
||||
.append("teacherNumber", getTeacherNumber())
|
||||
.append("teacherEmail", getTeacherEmail())
|
||||
.append("teacherSchool", getTeacherSchool())
|
||||
.append("remark", getRemark())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("type", getType())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ruoyi.cms.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 大赛团队队员表
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-08-27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("hit_team_members")
|
||||
@ApiModel(value="HitTeamMembers对象", description="大赛团队队员表")
|
||||
public class HitTeamMembers implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "团队id")
|
||||
private String teamId;
|
||||
|
||||
@ApiModelProperty(value = "队友id")
|
||||
private String teamMemberId;
|
||||
|
||||
@ApiModelProperty(value = "0队员,1领队老师, 2指导老师")
|
||||
private Integer teamResponsibilities;
|
||||
|
||||
@ApiModelProperty(value = "0等待确认,1同意, 2拒绝")
|
||||
private Integer isAgreeWith;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty(value = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
|
||||
}
|
63
ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitTeams.java
Normal file
63
ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitTeams.java
Normal file
@ -0,0 +1,63 @@
|
||||
package com.ruoyi.cms.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 团队表
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-08-27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("hit_teams")
|
||||
@ApiModel(value="HitTeams对象", description="团队表")
|
||||
public class HitTeams implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "团队名称")
|
||||
private String teamName;
|
||||
|
||||
@ApiModelProperty(value = "赛区")
|
||||
private String division;
|
||||
|
||||
@ApiModelProperty(value = "学校")
|
||||
private String schoolName;
|
||||
|
||||
@ApiModelProperty(value = "团队创建者id")
|
||||
private Integer teamCreatorId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty(value = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
|
||||
}
|
107
ruoyi-admin/src/main/java/com/ruoyi/cms/domain/Preliminary.java
Normal file
107
ruoyi-admin/src/main/java/com/ruoyi/cms/domain/Preliminary.java
Normal file
@ -0,0 +1,107 @@
|
||||
package com.ruoyi.cms.domain;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 大赛预报名表 preliminary
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Preliminary {
|
||||
|
||||
/** 队伍名称 */
|
||||
private String teamName;
|
||||
|
||||
/** 赛区 */
|
||||
private String division;
|
||||
|
||||
/** 学校名称 */
|
||||
private String schoolName;
|
||||
|
||||
/** 队员1 */
|
||||
private String TeammateOne;
|
||||
|
||||
/** 队员2 */
|
||||
private String teammateTwo;
|
||||
|
||||
/** 领队老师 */
|
||||
private String LeaderTeacher;
|
||||
|
||||
/** 指导老师1 */
|
||||
private String teacherOne;
|
||||
|
||||
public String getTeamName() {
|
||||
return teamName;
|
||||
}
|
||||
|
||||
public void setTeamName(String teamName) {
|
||||
this.teamName = teamName;
|
||||
}
|
||||
|
||||
public String getDivision() {
|
||||
return division;
|
||||
}
|
||||
|
||||
public void setDivision(String division) {
|
||||
this.division = division;
|
||||
}
|
||||
|
||||
public String getSchoolName() {
|
||||
return schoolName;
|
||||
}
|
||||
|
||||
public void setSchoolName(String schoolName) {
|
||||
this.schoolName = schoolName;
|
||||
}
|
||||
|
||||
public String getTeammateOne() {
|
||||
return TeammateOne;
|
||||
}
|
||||
|
||||
public void setTeammateOne(String teammateOne) {
|
||||
TeammateOne = teammateOne;
|
||||
}
|
||||
|
||||
public String getTeammateTwo() {
|
||||
return teammateTwo;
|
||||
}
|
||||
|
||||
public void setTeammateTwo(String teammateTwo) {
|
||||
this.teammateTwo = teammateTwo;
|
||||
}
|
||||
|
||||
public String getLeaderTeacher() {
|
||||
return LeaderTeacher;
|
||||
}
|
||||
|
||||
public void setLeaderTeacher(String leaderTeacher) {
|
||||
LeaderTeacher = leaderTeacher;
|
||||
}
|
||||
|
||||
public String getTeacherOne() {
|
||||
return teacherOne;
|
||||
}
|
||||
|
||||
public void setTeacherOne(String teacherOne) {
|
||||
this.teacherOne = teacherOne;
|
||||
}
|
||||
|
||||
public String getTeacherTwo() {
|
||||
return teacherTwo;
|
||||
}
|
||||
|
||||
public void setTeacherTwo(String teacherTwo) {
|
||||
this.teacherTwo = teacherTwo;
|
||||
}
|
||||
|
||||
/** 指导老师2 */
|
||||
private String teacherTwo;
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.ruoyi.cms.domain.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 团队信息
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TeamsVo {
|
||||
/** 团队id */
|
||||
private Long teamId;
|
||||
/** 团队名称 */
|
||||
private String teamName;
|
||||
/** 团队成员id */
|
||||
private Long teamMateId;
|
||||
/** 团队成员状态 */
|
||||
private String isAgreeWith;
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ruoyi.cms.mapper;
|
||||
|
||||
import com.ruoyi.cms.domain.HitCompetitionStudentInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 大赛学生表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-08-26
|
||||
*/
|
||||
public interface HitCompetitionStudentInfoMapper extends BaseMapper<HitCompetitionStudentInfo> {
|
||||
/**
|
||||
* 查询大赛学生
|
||||
*
|
||||
* @param id 大赛学生主键
|
||||
* @return 大赛学生
|
||||
*/
|
||||
public HitCompetitionStudentInfo selectHitCompetitionStudentInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询大赛学生列表
|
||||
*
|
||||
* @param hitCompetitionStudentInfo 大赛学生
|
||||
* @return 大赛学生集合
|
||||
*/
|
||||
public List<HitCompetitionStudentInfo> selectHitCompetitionStudentInfoList(HitCompetitionStudentInfo hitCompetitionStudentInfo);
|
||||
|
||||
/**
|
||||
* 新增大赛学生
|
||||
*
|
||||
* @param hitCompetitionStudentInfo 大赛学生
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHitCompetitionStudentInfo(HitCompetitionStudentInfo hitCompetitionStudentInfo);
|
||||
|
||||
/**
|
||||
* 修改大赛学生
|
||||
*
|
||||
* @param hitCompetitionStudentInfo 大赛学生
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHitCompetitionStudentInfo(HitCompetitionStudentInfo hitCompetitionStudentInfo);
|
||||
|
||||
/**
|
||||
* 删除大赛学生
|
||||
*
|
||||
* @param id 大赛学生主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHitCompetitionStudentInfoById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除大赛学生
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHitCompetitionStudentInfoByIds(String[] ids);
|
||||
}
|
@ -4,7 +4,6 @@ import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.cms.domain.HitRegInfo;
|
||||
import com.ruoyi.cms.domain.HitRegistrationTeachInfo;
|
||||
|
||||
/**
|
||||
* 报名信息Mapper接口
|
||||
|
@ -3,8 +3,7 @@ package com.ruoyi.cms.mapper;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.cms.domain.HitRegistrationStudentInfo;
|
||||
import com.ruoyi.cms.domain.HitRegistrationTeachInfo;
|
||||
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
|
||||
|
||||
/**
|
||||
* 教师信息Mapper接口
|
||||
|
@ -0,0 +1,16 @@
|
||||
package com.ruoyi.cms.mapper;
|
||||
|
||||
import com.ruoyi.cms.domain.HitTeamMembers;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 大赛团队队员表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-08-27
|
||||
*/
|
||||
public interface HitTeamMembersMapper extends BaseMapper<HitTeamMembers> {
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.ruoyi.cms.mapper;
|
||||
|
||||
import com.ruoyi.cms.domain.HitTeams;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 团队表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-08-27
|
||||
*/
|
||||
public interface HitTeamsMapper extends BaseMapper<HitTeams> {
|
||||
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package com.ruoyi.cms.service;
|
||||
|
||||
import com.ruoyi.cms.domain.HitCompetitionStudentInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.cms.domain.HitTeamMembers;
|
||||
import com.ruoyi.cms.domain.vo.TeamsVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 大赛学生表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-08-26
|
||||
*/
|
||||
public interface IHitCompetitionStudentInfoService extends IService<HitCompetitionStudentInfo> {
|
||||
/**
|
||||
* 查询大赛学生
|
||||
*
|
||||
* @param id 大赛学生主键
|
||||
* @return 大赛学生
|
||||
*/
|
||||
public HitCompetitionStudentInfo selectHitCompetitionStudentInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询大赛学生列表
|
||||
*
|
||||
* @param hitCompetitionStudentInfo 大赛学生
|
||||
* @return 大赛学生集合
|
||||
*/
|
||||
public List<HitCompetitionStudentInfo> selectHitCompetitionStudentInfoList(HitCompetitionStudentInfo hitCompetitionStudentInfo);
|
||||
|
||||
/**
|
||||
* 新增大赛学生
|
||||
*
|
||||
* @param hitCompetitionStudentInfo 大赛学生
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHitCompetitionStudentInfo(HitCompetitionStudentInfo hitCompetitionStudentInfo);
|
||||
|
||||
/**
|
||||
* 修改大赛学生
|
||||
*
|
||||
* @param hitCompetitionStudentInfo 大赛学生
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHitCompetitionStudentInfo(HitCompetitionStudentInfo hitCompetitionStudentInfo);
|
||||
|
||||
/**
|
||||
* 批量删除大赛学生
|
||||
*
|
||||
* @param ids 需要删除的大赛学生主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHitCompetitionStudentInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除大赛学生信息
|
||||
*
|
||||
* @param id 大赛学生主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHitCompetitionStudentInfoById(String id);
|
||||
|
||||
/**
|
||||
* 根据学号查询大赛学生信息
|
||||
* @param studentId
|
||||
* @return
|
||||
*/
|
||||
HitCompetitionStudentInfo selectHitCompetitionStudentInfoByStuId(String studentId);
|
||||
|
||||
/**
|
||||
* 根据学校名称和组别查询队友信息
|
||||
* @param schoolName
|
||||
* @param division
|
||||
* @return
|
||||
*/
|
||||
List<HitCompetitionStudentInfo> selectTeamMateBySchoolNameAndDivision(String schoolName, String division);
|
||||
|
||||
/**
|
||||
* 根据学号查询队友信息
|
||||
* @return
|
||||
*/
|
||||
TeamsVo selectTeamMateInfoByStuId();
|
||||
}
|
@ -58,4 +58,6 @@ public interface IHitRegInfoService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHitRegInfoById(Long id);
|
||||
|
||||
void createRegInfo(String teamName,Integer teamCreatorId,String teacherId,Long teamId);
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
package com.ruoyi.cms.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.cms.domain.HitRegistrationTeachInfo;
|
||||
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
|
||||
import com.ruoyi.common.core.domain.model.RegisterBody;
|
||||
|
||||
/**
|
||||
* 教师信息Service接口
|
||||
@ -58,4 +59,7 @@ public interface IHitRegistrationTeachInfoService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHitRegistrationTeachInfoById(Long id);
|
||||
|
||||
|
||||
List<HitRegistrationTeachInfo> getTeacherInfo(String schoolName, String division);
|
||||
}
|
||||
|
@ -0,0 +1,38 @@
|
||||
package com.ruoyi.cms.service;
|
||||
|
||||
import com.ruoyi.cms.domain.HitTeamMembers;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.cms.domain.Preliminary;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 大赛团队队员表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-08-27
|
||||
*/
|
||||
public interface IHitTeamMembersService extends IService<HitTeamMembers> {
|
||||
/**
|
||||
* 创建团队队员
|
||||
* @param preliminary
|
||||
* @param teamId
|
||||
*/
|
||||
void createTeamMembers(Preliminary preliminary,Integer teamId);
|
||||
|
||||
/**
|
||||
* 同意加入团队
|
||||
* @param teamId
|
||||
* @param teamMateId
|
||||
* @return
|
||||
*/
|
||||
String agreeTeam( Long teamId , Long teamMateId);
|
||||
|
||||
/**
|
||||
* 拒绝加入团队
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
String refuseTeam(Long teamId);
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.ruoyi.cms.service;
|
||||
|
||||
import com.ruoyi.cms.domain.HitTeams;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.cms.domain.Preliminary;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 团队表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-08-27
|
||||
*/
|
||||
public interface IHitTeamsService extends IService<HitTeams> {
|
||||
|
||||
int preRegister(Preliminary preliminary);
|
||||
}
|
@ -0,0 +1,212 @@
|
||||
package com.ruoyi.cms.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.cms.domain.HitCompetitionStudentInfo;
|
||||
import com.ruoyi.cms.domain.HitTeamMembers;
|
||||
import com.ruoyi.cms.domain.HitTeams;
|
||||
import com.ruoyi.cms.domain.vo.TeamsVo;
|
||||
import com.ruoyi.cms.mapper.HitCompetitionStudentInfoMapper;
|
||||
import com.ruoyi.cms.mapper.HitRegistrationTeachInfoMapper;
|
||||
import com.ruoyi.cms.mapper.HitTeamMembersMapper;
|
||||
import com.ruoyi.cms.mapper.HitTeamsMapper;
|
||||
import com.ruoyi.cms.service.IHitCompetitionStudentInfoService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.cms.service.IHitRegistrationTeachInfoService;
|
||||
import com.ruoyi.cms.service.IHitTeamsService;
|
||||
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 大赛学生表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-08-26
|
||||
*/
|
||||
@Service
|
||||
public class HitCompetitionStudentInfoServiceImpl extends ServiceImpl<HitCompetitionStudentInfoMapper, HitCompetitionStudentInfo> implements IHitCompetitionStudentInfoService {
|
||||
@Autowired
|
||||
private HitCompetitionStudentInfoMapper hitCompetitionStudentInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private HitRegistrationTeachInfoMapper hitRegistrationTeachInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private HitTeamMembersMapper hitTeamMembersMapper;
|
||||
|
||||
@Autowired
|
||||
private HitTeamsMapper hitTeamsMapper;
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询大赛学生
|
||||
*
|
||||
* @param id 大赛学生主键
|
||||
* @return 大赛学生
|
||||
*/
|
||||
@Override
|
||||
public HitCompetitionStudentInfo selectHitCompetitionStudentInfoById(String id)
|
||||
{
|
||||
return hitCompetitionStudentInfoMapper.selectHitCompetitionStudentInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询大赛学生列表
|
||||
*
|
||||
* @param hitCompetitionStudentInfo 大赛学生
|
||||
* @return 大赛学生
|
||||
*/
|
||||
@Override
|
||||
public List<HitCompetitionStudentInfo> selectHitCompetitionStudentInfoList(HitCompetitionStudentInfo hitCompetitionStudentInfo)
|
||||
{
|
||||
return hitCompetitionStudentInfoMapper.selectHitCompetitionStudentInfoList(hitCompetitionStudentInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增大赛学生
|
||||
*
|
||||
* @param hitCompetitionStudentInfo 大赛学生
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertHitCompetitionStudentInfo(HitCompetitionStudentInfo hitCompetitionStudentInfo)
|
||||
{
|
||||
hitCompetitionStudentInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return hitCompetitionStudentInfoMapper.insertHitCompetitionStudentInfo(hitCompetitionStudentInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改大赛学生
|
||||
*
|
||||
* @param hitCompetitionStudentInfo 大赛学生
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateHitCompetitionStudentInfo(HitCompetitionStudentInfo hitCompetitionStudentInfo)
|
||||
{
|
||||
hitCompetitionStudentInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return hitCompetitionStudentInfoMapper.updateHitCompetitionStudentInfo(hitCompetitionStudentInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除大赛学生
|
||||
*
|
||||
* @param ids 需要删除的大赛学生主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHitCompetitionStudentInfoByIds(String[] ids)
|
||||
{
|
||||
return hitCompetitionStudentInfoMapper.deleteHitCompetitionStudentInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除大赛学生信息
|
||||
*
|
||||
* @param id 大赛学生主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHitCompetitionStudentInfoById(String id)
|
||||
{
|
||||
return hitCompetitionStudentInfoMapper.deleteHitCompetitionStudentInfoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HitCompetitionStudentInfo selectHitCompetitionStudentInfoByStuId(String studentId) {
|
||||
LambdaQueryWrapper<HitCompetitionStudentInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(HitCompetitionStudentInfo::getStudentId, studentId);
|
||||
HitCompetitionStudentInfo hitCompetitionStudentInfo = hitCompetitionStudentInfoMapper.selectOne(queryWrapper);
|
||||
if (hitCompetitionStudentInfo == null) {
|
||||
return new HitCompetitionStudentInfo();
|
||||
}
|
||||
return hitCompetitionStudentInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HitCompetitionStudentInfo> selectTeamMateBySchoolNameAndDivision(String schoolName, String division) {
|
||||
//获取当前学生信息信息
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
String userName = user.getUserName();
|
||||
LambdaQueryWrapper<HitCompetitionStudentInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(HitCompetitionStudentInfo::getSchoolName, schoolName);
|
||||
queryWrapper.eq(HitCompetitionStudentInfo::getDivision, division);
|
||||
queryWrapper.eq(HitCompetitionStudentInfo::getIsPreliminary, "1");
|
||||
queryWrapper.ne(HitCompetitionStudentInfo::getStudentId, userName);
|
||||
List<HitCompetitionStudentInfo> hitCompetitionStudentInfoList = hitCompetitionStudentInfoMapper.selectList(queryWrapper);
|
||||
return hitCompetitionStudentInfoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前用户信息
|
||||
* @return TeamsVo
|
||||
*/
|
||||
@Override
|
||||
public TeamsVo selectTeamMateInfoByStuId() {
|
||||
//获取当前用户信息信息
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
String userName = user.getUserName();
|
||||
SysUser sysUser = sysUserMapper.select(userName);
|
||||
String userType = sysUser.getUserType();
|
||||
TeamsVo teamsVo = new TeamsVo();
|
||||
|
||||
//查询个人信息
|
||||
if (userType.equals("01")) {
|
||||
//如果是学生,则查询学生信息
|
||||
LambdaQueryWrapper<HitCompetitionStudentInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(HitCompetitionStudentInfo::getStudentId, userName);
|
||||
//学生报名信息
|
||||
HitCompetitionStudentInfo studentDB = this.getOne(queryWrapper);
|
||||
Integer studentDBId = studentDB.getId();
|
||||
LambdaQueryWrapper<HitTeamMembers> hitTeamsLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
hitTeamsLambdaQueryWrapper.eq(HitTeamMembers::getTeamMemberId, studentDBId);
|
||||
teamsVo= selectTeamMsg(teamsVo, hitTeamsLambdaQueryWrapper);
|
||||
}
|
||||
if (userType.equals("02")) {
|
||||
//如果是老师,则查询老师信息
|
||||
LambdaQueryWrapper<HitRegistrationTeachInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(HitRegistrationTeachInfo::getHitRegId, userName);
|
||||
HitRegistrationTeachInfo teacherDB = hitRegistrationTeachInfoMapper.selectOne(queryWrapper);
|
||||
LambdaQueryWrapper<HitTeamMembers> hitTeamsLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
hitTeamsLambdaQueryWrapper.eq(HitTeamMembers::getTeamMemberId, teacherDB.getId());
|
||||
teamsVo= selectTeamMsg(teamsVo, hitTeamsLambdaQueryWrapper);
|
||||
}
|
||||
return teamsVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询团队信息
|
||||
* @param teamsVo
|
||||
* @param hitTeamsLambdaQueryWrapper
|
||||
* @return
|
||||
*/
|
||||
private TeamsVo selectTeamMsg(TeamsVo teamsVo, LambdaQueryWrapper<HitTeamMembers> hitTeamsLambdaQueryWrapper) {
|
||||
HitTeamMembers hitTeamMembers = hitTeamMembersMapper.selectOne(hitTeamsLambdaQueryWrapper);
|
||||
if (hitTeamMembers != null) {
|
||||
teamsVo.setTeamMateId(Long.valueOf(hitTeamMembers.getTeamMemberId()));
|
||||
teamsVo.setTeamId(Long.valueOf(hitTeamMembers.getTeamId()));
|
||||
teamsVo.setIsAgreeWith(String.valueOf(hitTeamMembers.getIsAgreeWith()));
|
||||
//团队名称
|
||||
LambdaQueryWrapper<HitTeams> hitTeamsQueryWrapper = new LambdaQueryWrapper<>();
|
||||
hitTeamsQueryWrapper.eq(HitTeams::getId, hitTeamMembers.getTeamId());
|
||||
HitTeams hitTeams = hitTeamsMapper.selectOne(hitTeamsQueryWrapper);
|
||||
if (hitTeams != null) {
|
||||
teamsVo.setTeamName(hitTeams.getTeamName());
|
||||
}
|
||||
}
|
||||
return teamsVo;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -5,11 +5,15 @@ import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.cms.controller.CmsContentController;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.ruoyi.cms.domain.*;
|
||||
import com.ruoyi.cms.mapper.*;
|
||||
import com.ruoyi.cms.service.ICmsContentService;
|
||||
import com.ruoyi.cms.service.IHitCompetitionStudentInfoService;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -36,7 +40,12 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
|
||||
private ICmsContentService insertCmsContent;
|
||||
@Autowired
|
||||
private CmsContentMapper cmsContentMapper;
|
||||
|
||||
@Autowired
|
||||
private HitCompetitionStudentInfoMapper competitionStudentInfo;
|
||||
@Autowired
|
||||
private IHitCompetitionStudentInfoService competitionStudentInfoService;
|
||||
@Autowired
|
||||
private HitTeamMembersMapper teamMembersMapper;
|
||||
|
||||
|
||||
/**
|
||||
@ -62,9 +71,9 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
|
||||
{
|
||||
List<HitRegInfo> hitRegInfos = hitRegInfoMapper.selectHitRegInfoList(hitRegInfo);
|
||||
for (HitRegInfo regInfo : hitRegInfos) {
|
||||
LambdaQueryWrapper<HitRegistrationStudentInfo> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(HitRegistrationStudentInfo::getHitRegId,regInfo.getId());
|
||||
List<HitRegistrationStudentInfo> hitRegistrationStudentInfos = studentInfoMapper.selectList(queryWrapper);
|
||||
LambdaQueryWrapper<HitCompetitionStudentInfo> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(HitCompetitionStudentInfo::getHitRegId,regInfo.getId());
|
||||
List<HitCompetitionStudentInfo> hitRegistrationStudentInfos = competitionStudentInfo.selectList(queryWrapper);
|
||||
|
||||
LambdaQueryWrapper<HitRegistrationTeachInfo> queryWrapper2 =new LambdaQueryWrapper<>();
|
||||
queryWrapper2.eq(HitRegistrationTeachInfo::getHitRegId,regInfo.getId()).orderByDesc(HitRegistrationTeachInfo::getType);
|
||||
@ -85,20 +94,19 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertHitRegInfo(HitRegInfo hitRegInfo)
|
||||
{
|
||||
hitRegInfo.setCreateTime(DateUtils.getNowDate());
|
||||
hitRegInfoMapper.insertHitRegInfo(hitRegInfo);
|
||||
for (HitRegistrationStudentInfo hitRegistrationStudentInfo : hitRegInfo.getStudentInfoList()) {
|
||||
hitRegistrationStudentInfo.setHitRegId(hitRegInfo.getId());
|
||||
studentInfoMapper.insert(hitRegistrationStudentInfo);
|
||||
|
||||
}
|
||||
for (HitRegistrationTeachInfo hitRegistrationTeachInfo : hitRegInfo.getTeacherInfoList()) {
|
||||
if (StringUtils.isNotEmpty(hitRegistrationTeachInfo.getTeacherName())){
|
||||
hitRegistrationTeachInfo.setHitRegId(hitRegInfo.getId());
|
||||
teachInfoMapper.insert(hitRegistrationTeachInfo);
|
||||
}
|
||||
|
||||
}
|
||||
// hitRegInfo.setCreateTime(DateUtils.getNowDate());
|
||||
// hitRegInfoMapper.insertHitRegInfo(hitRegInfo);
|
||||
// for (HitCompetitionStudentInfo hitRegistrationStudentInfo : hitRegInfo.getStudentInfoList()) {
|
||||
// hitRegistrationStudentInfo.setHitRegId(hitRegInfo.getId());
|
||||
// studentInfoMapper.insert(hitRegistrationStudentInfo);
|
||||
//
|
||||
// }
|
||||
// for (HitRegistrationTeachInfo hitRegistrationTeachInfo : hitRegInfo.getTeacherInfoList()) {
|
||||
// if (StringUtils.isNotEmpty(hitRegistrationTeachInfo.getTeacherName())){
|
||||
// hitRegistrationTeachInfo.setHitRegId(hitRegInfo.getId());
|
||||
// teachInfoMapper.insert(hitRegistrationTeachInfo);
|
||||
// }
|
||||
// }
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -225,4 +233,58 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
|
||||
{
|
||||
return hitRegInfoMapper.deleteHitRegInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建报名信息
|
||||
* @param teamName
|
||||
* @param teamCreatorId
|
||||
* @param teacherId
|
||||
*/
|
||||
@Override
|
||||
public void createRegInfo(String teamName,Integer teamCreatorId,String teacherId,Long teamId) {
|
||||
HitRegInfo hitRegInfo = new HitRegInfo();
|
||||
HitCompetitionStudentInfo studentInfo = competitionStudentInfo.selectOne(new QueryWrapper<HitCompetitionStudentInfo>().eq("id", teamCreatorId));
|
||||
hitRegInfo.setSchoolName(studentInfo.getSchoolName());
|
||||
hitRegInfo.setCollegeName(studentInfo.getCollegeName());
|
||||
hitRegInfo.setDivision(studentInfo.getDivision());
|
||||
|
||||
HitRegistrationTeachInfo teachInfo = teachInfoMapper.selectOne(new QueryWrapper<HitRegistrationTeachInfo>().eq("id", teacherId));
|
||||
hitRegInfo.setSampleConcat(teachInfo.getTeacherName());
|
||||
hitRegInfo.setSampleNumber(teachInfo.getTeacherNumber());
|
||||
hitRegInfo.setSampleAddress(teachInfo.getSampleAddress());
|
||||
|
||||
hitRegInfo.setTeamName(teamName);
|
||||
hitRegInfo.setCreateTime(DateUtils.getNowDate());
|
||||
hitRegInfoMapper.insert(hitRegInfo);
|
||||
|
||||
Long hitRegInfoId = hitRegInfo.getId();
|
||||
//创建报名信息后,更新队员信息
|
||||
updateTeamMembersInfo(teamId,hitRegInfoId);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新队员信息
|
||||
* @param teamId
|
||||
* @param hitRegInfoId
|
||||
*/
|
||||
private void updateTeamMembersInfo(Long teamId, Long hitRegInfoId){
|
||||
LambdaQueryWrapper<HitTeamMembers> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(HitTeamMembers::getTeamId,teamId);
|
||||
List<HitTeamMembers> teamMembers = teamMembersMapper.selectList(queryWrapper);
|
||||
for (HitTeamMembers teamMember : teamMembers) {
|
||||
if (teamMember.getTeamResponsibilities()==0){
|
||||
LambdaUpdateWrapper<HitCompetitionStudentInfo> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(HitCompetitionStudentInfo::getId,teamMember.getTeamMemberId());
|
||||
updateWrapper.set(HitCompetitionStudentInfo::getHitRegId,hitRegInfoId);
|
||||
competitionStudentInfo.update(null,updateWrapper);
|
||||
}
|
||||
if (teamMember.getTeamResponsibilities()==1 || teamMember.getTeamResponsibilities()==2){
|
||||
LambdaUpdateWrapper<HitRegistrationTeachInfo> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(HitRegistrationTeachInfo::getId,teamMember.getTeamMemberId());
|
||||
updateWrapper.set(HitRegistrationTeachInfo::getHitRegId,hitRegInfoId);
|
||||
teachInfoMapper.update(null,updateWrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,15 @@
|
||||
package com.ruoyi.cms.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.common.core.domain.model.RegisterBody;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.cms.mapper.HitRegistrationTeachInfoMapper;
|
||||
import com.ruoyi.cms.domain.HitRegistrationTeachInfo;
|
||||
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
|
||||
import com.ruoyi.cms.service.IHitRegistrationTeachInfoService;
|
||||
|
||||
/**
|
||||
@ -15,82 +19,91 @@ import com.ruoyi.cms.service.IHitRegistrationTeachInfoService;
|
||||
* @date 2024-08-20
|
||||
*/
|
||||
@Service
|
||||
public class HitRegistrationTeachInfoServiceImpl implements IHitRegistrationTeachInfoService
|
||||
{
|
||||
public class HitRegistrationTeachInfoServiceImpl implements IHitRegistrationTeachInfoService {
|
||||
@Autowired
|
||||
private HitRegistrationTeachInfoMapper hitRegistrationTeachInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询教师信息
|
||||
*
|
||||
*
|
||||
* @param id 教师信息主键
|
||||
* @return 教师信息
|
||||
*/
|
||||
@Override
|
||||
public HitRegistrationTeachInfo selectHitRegistrationTeachInfoById(Long id)
|
||||
{
|
||||
public HitRegistrationTeachInfo selectHitRegistrationTeachInfoById(Long id) {
|
||||
return hitRegistrationTeachInfoMapper.selectHitRegistrationTeachInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询教师信息列表
|
||||
*
|
||||
*
|
||||
* @param hitRegistrationTeachInfo 教师信息
|
||||
* @return 教师信息
|
||||
*/
|
||||
@Override
|
||||
public List<HitRegistrationTeachInfo> selectHitRegistrationTeachInfoList(HitRegistrationTeachInfo hitRegistrationTeachInfo)
|
||||
{
|
||||
public List<HitRegistrationTeachInfo> selectHitRegistrationTeachInfoList(HitRegistrationTeachInfo hitRegistrationTeachInfo) {
|
||||
return hitRegistrationTeachInfoMapper.selectHitRegistrationTeachInfoList(hitRegistrationTeachInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增教师信息
|
||||
*
|
||||
*
|
||||
* @param hitRegistrationTeachInfo 教师信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertHitRegistrationTeachInfo(HitRegistrationTeachInfo hitRegistrationTeachInfo)
|
||||
{
|
||||
public int insertHitRegistrationTeachInfo(HitRegistrationTeachInfo hitRegistrationTeachInfo) {
|
||||
hitRegistrationTeachInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return hitRegistrationTeachInfoMapper.insertHitRegistrationTeachInfo(hitRegistrationTeachInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改教师信息
|
||||
*
|
||||
*
|
||||
* @param hitRegistrationTeachInfo 教师信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateHitRegistrationTeachInfo(HitRegistrationTeachInfo hitRegistrationTeachInfo)
|
||||
{
|
||||
public int updateHitRegistrationTeachInfo(HitRegistrationTeachInfo hitRegistrationTeachInfo) {
|
||||
hitRegistrationTeachInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return hitRegistrationTeachInfoMapper.updateHitRegistrationTeachInfo(hitRegistrationTeachInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除教师信息
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的教师信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHitRegistrationTeachInfoByIds(Long[] ids)
|
||||
{
|
||||
public int deleteHitRegistrationTeachInfoByIds(Long[] ids) {
|
||||
return hitRegistrationTeachInfoMapper.deleteHitRegistrationTeachInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除教师信息信息
|
||||
*
|
||||
*
|
||||
* @param id 教师信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHitRegistrationTeachInfoById(Long id)
|
||||
{
|
||||
public int deleteHitRegistrationTeachInfoById(Long id) {
|
||||
return hitRegistrationTeachInfoMapper.deleteHitRegistrationTeachInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据学校名称和赛区查询教师信息
|
||||
* @param schoolName
|
||||
* @param division
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<HitRegistrationTeachInfo> getTeacherInfo(String schoolName, String division) {
|
||||
LambdaQueryWrapper<HitRegistrationTeachInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(HitRegistrationTeachInfo::getSchoolName, schoolName);
|
||||
queryWrapper.eq(HitRegistrationTeachInfo::getDivision, division);
|
||||
return hitRegistrationTeachInfoMapper.selectList(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,175 @@
|
||||
package com.ruoyi.cms.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.ruoyi.cms.domain.HitCompetitionStudentInfo;
|
||||
import com.ruoyi.cms.domain.HitTeamMembers;
|
||||
import com.ruoyi.cms.domain.HitTeams;
|
||||
import com.ruoyi.cms.domain.Preliminary;
|
||||
import com.ruoyi.cms.mapper.HitRegistrationTeachInfoMapper;
|
||||
import com.ruoyi.cms.mapper.HitTeamMembersMapper;
|
||||
import com.ruoyi.cms.service.*;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 大赛团队队员表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-08-27
|
||||
*/
|
||||
@Service
|
||||
public class HitTeamMembersServiceImpl extends ServiceImpl<HitTeamMembersMapper, HitTeamMembers> implements IHitTeamMembersService {
|
||||
|
||||
@Autowired
|
||||
private IHitCompetitionStudentInfoService hitStudentInfoService;
|
||||
@Autowired
|
||||
private HitRegistrationTeachInfoMapper hitRegistrationTeachInfoMapper;
|
||||
@Autowired
|
||||
private HitTeamMembersMapper hitTeamMembersMapper;
|
||||
@Autowired
|
||||
private IHitTeamsService hitTeamsService;
|
||||
@Autowired
|
||||
private IHitRegInfoService hitRegInfoService;
|
||||
|
||||
|
||||
/**
|
||||
* 创建队员信息
|
||||
* @param preliminary
|
||||
* @param teamId
|
||||
*/
|
||||
@Override
|
||||
public void createTeamMembers(Preliminary preliminary,Integer teamId) {
|
||||
if (preliminary.getTeammateOne() != null) {
|
||||
insertTeamMembers(preliminary.getTeammateOne(),teamId,0);
|
||||
}
|
||||
if (preliminary.getTeammateTwo() != null) {
|
||||
insertTeamMembers(preliminary.getTeammateTwo(),teamId,0);
|
||||
}
|
||||
if (preliminary.getLeaderTeacher() != null) {
|
||||
insertTeacher(preliminary.getLeaderTeacher(),teamId, 1);
|
||||
}
|
||||
if (preliminary.getTeacherOne() != null) {
|
||||
insertTeacher(preliminary.getTeacherOne(),teamId, 2);
|
||||
}
|
||||
if (preliminary.getTeacherTwo() != null) {
|
||||
insertTeacher(preliminary.getTeacherTwo(),teamId,2);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 同意队员加入
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String agreeTeam(Long teamId , Long teamMateId) {
|
||||
//同意入队
|
||||
LambdaUpdateWrapper<HitTeamMembers> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(HitTeamMembers::getTeamId,teamId)
|
||||
.eq(HitTeamMembers::getTeamMemberId,teamMateId)
|
||||
.set(HitTeamMembers::getIsAgreeWith,1);
|
||||
int update = hitTeamMembersMapper.update(null, updateWrapper);
|
||||
//如果修改成功,查询队伍是否全部同意
|
||||
if (update > 0) {
|
||||
LambdaQueryWrapper<HitTeamMembers> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(HitTeamMembers::getTeamId,teamId);
|
||||
List<HitTeamMembers> hitTeamMembers = hitTeamMembersMapper.selectList(queryWrapper);
|
||||
int count = 0;
|
||||
for (HitTeamMembers hitTeamMember : hitTeamMembers) {
|
||||
if (hitTeamMember.getIsAgreeWith() == 1) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
//当队伍全部同意后,创建初赛队伍成功
|
||||
if (count == hitTeamMembers.size()) {
|
||||
//TODO: 创建初赛队伍
|
||||
HitTeams hitTeams = hitTeamsService.getOne(new LambdaQueryWrapper<HitTeams>().eq(HitTeams::getId, teamId));
|
||||
String teamName = hitTeams.getTeamName();
|
||||
Integer teamCreatorId = hitTeams.getTeamCreatorId();
|
||||
HitTeamMembers teamMembers = hitTeamMembersMapper.selectOne(new LambdaQueryWrapper<HitTeamMembers>()
|
||||
.eq(HitTeamMembers::getTeamId, teamId)
|
||||
.eq(HitTeamMembers::getTeamResponsibilities, 1));
|
||||
String teacherId = teamMembers.getTeamMemberId();
|
||||
hitRegInfoService.createRegInfo(teamName,teamCreatorId,teacherId,teamId );
|
||||
}
|
||||
return "同意加入";
|
||||
}
|
||||
return "加入队伍失败";
|
||||
}
|
||||
|
||||
/**
|
||||
* 拒绝加入队伍
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String refuseTeam(Long teamId){
|
||||
//拒绝入队
|
||||
LambdaUpdateWrapper<HitTeamMembers> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(HitTeamMembers::getTeamId,teamId);
|
||||
int update = hitTeamMembersMapper.delete(updateWrapper);
|
||||
if (update > 0) {
|
||||
//删除队伍
|
||||
boolean b = hitTeamsService.removeById(teamId);
|
||||
if (b) {
|
||||
return "已拒绝";
|
||||
}
|
||||
}
|
||||
return "加入队伍失败";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建队员信息
|
||||
* @param TeamMemberId
|
||||
* @return
|
||||
*/
|
||||
|
||||
public void insertTeamMembers(String TeamMemberId, Integer teamId,Integer IsAgreeWith) {
|
||||
//获取当前学生信息
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
|
||||
|
||||
HitTeamMembers hitTeamMembers = new HitTeamMembers();
|
||||
hitTeamMembers.setIsAgreeWith(IsAgreeWith);
|
||||
hitTeamMembers.setTeamId(String.valueOf(teamId));
|
||||
hitTeamMembers.setTeamMemberId(TeamMemberId);
|
||||
hitTeamMembers.setTeamResponsibilities(0);
|
||||
hitTeamMembers.setCreateTime(LocalDateTime.now());
|
||||
hitTeamMembers.setUpdateTime(LocalDateTime.now());
|
||||
hitTeamMembers.setCreateBy(user.getUserId().toString());
|
||||
hitTeamMembers.setUpdateBy(user.getUserId().toString());
|
||||
hitTeamMembersMapper.insert(hitTeamMembers);
|
||||
|
||||
}
|
||||
|
||||
/**insert
|
||||
* 创建教师信息
|
||||
* @param TeacherId
|
||||
* @return
|
||||
*/
|
||||
public void insertTeacher(String TeacherId,Integer teamId,Integer TeamResponsibilities) {
|
||||
//获取当前学生信息
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
|
||||
HitTeamMembers hitTeamMembers = new HitTeamMembers();
|
||||
hitTeamMembers.setTeamId(String.valueOf(teamId));
|
||||
hitTeamMembers.setTeamMemberId(TeacherId);
|
||||
hitTeamMembers.setTeamResponsibilities(TeamResponsibilities);
|
||||
hitTeamMembers.setCreateTime(LocalDateTime.now());
|
||||
hitTeamMembers.setUpdateTime(LocalDateTime.now());
|
||||
hitTeamMembers.setCreateBy(user.getUserId().toString());
|
||||
hitTeamMembers.setUpdateBy(user.getUserId().toString());
|
||||
hitTeamMembersMapper.insert(hitTeamMembers);
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package com.ruoyi.cms.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.cms.domain.HitCompetitionStudentInfo;
|
||||
import com.ruoyi.cms.domain.HitTeams;
|
||||
import com.ruoyi.cms.domain.Preliminary;
|
||||
import com.ruoyi.cms.mapper.HitTeamsMapper;
|
||||
import com.ruoyi.cms.service.IHitCompetitionStudentInfoService;
|
||||
import com.ruoyi.cms.service.IHitTeamMembersService;
|
||||
import com.ruoyi.cms.service.IHitTeamsService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 团队表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-08-27
|
||||
*/
|
||||
@Service
|
||||
public class HitTeamsServiceImpl extends ServiceImpl<HitTeamsMapper, HitTeams> implements IHitTeamsService {
|
||||
|
||||
@Autowired
|
||||
private IHitCompetitionStudentInfoService hitStuService;
|
||||
|
||||
@Autowired
|
||||
private HitTeamsMapper hitTeamsMapper;
|
||||
|
||||
@Autowired
|
||||
private IHitTeamMembersService hitTeamMembersService;
|
||||
|
||||
@Autowired
|
||||
private HitTeamMembersServiceImpl hitTeamMembersServiceImpl;
|
||||
|
||||
/**
|
||||
* 初赛报名
|
||||
* @param preliminary
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int preRegister(Preliminary preliminary) {
|
||||
//获取当前学生信息
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
|
||||
//查询当前学生报名表id
|
||||
LambdaQueryWrapper<HitCompetitionStudentInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(HitCompetitionStudentInfo::getStudentId, user.getUserName());
|
||||
HitCompetitionStudentInfo hitStu = hitStuService.getOne(queryWrapper);
|
||||
Integer teamCreatorId = hitStu.getId();
|
||||
|
||||
HitTeams hitTeams = new HitTeams();
|
||||
hitTeams.setTeamName(preliminary.getTeamName());
|
||||
hitTeams.setDivision(preliminary.getDivision());
|
||||
hitTeams.setSchoolName(preliminary.getSchoolName());
|
||||
hitTeams.setTeamCreatorId(teamCreatorId);
|
||||
hitTeams.setCreateTime(LocalDateTime.now());
|
||||
hitTeams.setUpdateTime(LocalDateTime.now());
|
||||
hitTeams.setCreateBy(user.getUserName());
|
||||
hitTeams.setUpdateBy(user.getUserName());
|
||||
//创建团队
|
||||
int insert = hitTeamsMapper.insert(hitTeams);
|
||||
|
||||
Integer teamId = hitTeams.getId();
|
||||
hitTeamMembersServiceImpl.insertTeamMembers(String.valueOf(teamCreatorId),teamId,1);
|
||||
//创建队友关系等待队友确认
|
||||
hitTeamMembersService.createTeamMembers(preliminary , teamId);
|
||||
return insert;
|
||||
}
|
||||
|
||||
}
|
@ -23,6 +23,8 @@ import com.ruoyi.system.service.ISysUserService;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static net.sf.jsqlparser.util.validation.metadata.NamedObject.user;
|
||||
|
||||
/**
|
||||
* 个人信息 业务处理
|
||||
*
|
||||
@ -148,4 +150,17 @@ public class SysProfileController extends BaseController
|
||||
List<SysMenu> menus = menuService.getHomeShortcuts(sysMenus);
|
||||
return success(menus);
|
||||
}
|
||||
/**
|
||||
* 获取老师或学生信息
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/teacherAndStudentInfo")
|
||||
public AjaxResult getTeacherAndStudent(){
|
||||
LoginUser loginUser = getLoginUser();
|
||||
if (loginUser == null){
|
||||
return success( new SysUser());
|
||||
}
|
||||
AjaxResult profile = profile();
|
||||
return success(profile);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.ruoyi.cms.service.IHitRegistrationTeachInfoService;
|
||||
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@ -25,6 +28,9 @@ public class SysRegisterController extends BaseController
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
@Autowired
|
||||
private IHitRegistrationTeachInfoService hitRegistrationTeachInfoService;
|
||||
|
||||
@PostMapping("/register")
|
||||
public AjaxResult register(@RequestBody RegisterBody user)
|
||||
{
|
||||
@ -33,6 +39,12 @@ public class SysRegisterController extends BaseController
|
||||
return error("当前系统没有开启注册功能!");
|
||||
}
|
||||
String msg = registerService.register(user);
|
||||
|
||||
if (user.getUserType().equals("02")){
|
||||
HitRegistrationTeachInfo teachInfo = user.getHitRegistrationTeachInfo();
|
||||
teachInfo.setRelatedAccounts(user.getUsername());
|
||||
hitRegistrationTeachInfoService.insertHitRegistrationTeachInfo(teachInfo);
|
||||
}
|
||||
return StringUtils.isEmpty(msg) ? success() : error(msg);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.cms.mapper.HitCompetitionStudentInfoMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.cms.domain.HitCompetitionStudentInfo">
|
||||
<id column="id" property="id" />
|
||||
<result property="id" column="id" />
|
||||
<result property="hitRegId" column="hit_reg_id" />
|
||||
<result property="stuName" column="stu_name" />
|
||||
<result property="schoolName" column="school_name" />
|
||||
<result property="collegeName" column="college_name" />
|
||||
<result property="major" column="major" />
|
||||
<result property="division" column="division" />
|
||||
<result property="phoneNumber" column="phone_number" />
|
||||
<result property="email" column="email" />
|
||||
<result property="studentIdCard" column="student_id_card" />
|
||||
<result property="trialsScore" column="trials_score" />
|
||||
<result property="isPreliminary" column="is_preliminary" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, hit_reg_id, stuName, schoolName, collegeName, major, division, phoneNumber, email, studentIdCard, trialsScore, isPreliminary, remark, del_flag, create_time, create_by, update_time, update_by
|
||||
</sql>
|
||||
|
||||
<select id="selectHitCompetitionStudentInfoList" parameterType="HitCompetitionStudentInfo"
|
||||
resultType="com.ruoyi.cms.domain.HitCompetitionStudentInfo">
|
||||
|
||||
<where>
|
||||
<if test="hitRegId != null and hitRegId != ''"> and hit_reg_id = #{hitRegId}</if>
|
||||
<if test="stuName != null and stuName != ''"> and stu_name like concat('%', #{stuName}, '%')</if>
|
||||
<if test="schoolName != null and schoolName != ''"> and school_name like concat('%', #{schoolName}, '%')</if>
|
||||
<if test="collegeName != null and collegeName != ''"> and college_name like concat('%', #{collegeName}, '%')</if>
|
||||
<if test="major != null and major != ''"> and major = #{major}</if>
|
||||
<if test="division != null and division != ''"> and division = #{division}</if>
|
||||
<if test="phoneNumber != null and phoneNumber != ''"> and phone_number = #{phoneNumber}</if>
|
||||
<if test="email != null and email != ''"> and email = #{email}</if>
|
||||
<if test="studentIdCard != null and studentIdCard != ''"> and student_id_card = #{studentIdCard}</if>
|
||||
<if test="trialsScore != null "> and trials_score = #{trialsScore}</if>
|
||||
<if test="isPreliminary != null "> and is_preliminary = #{isPreliminary}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHitCompetitionStudentInfoById" parameterType="String"
|
||||
resultType="com.ruoyi.cms.domain.HitCompetitionStudentInfo">
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertHitCompetitionStudentInfo" parameterType="HitCompetitionStudentInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into hit_competition_student_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="hitRegId != null">hit_reg_id,</if>
|
||||
<if test="stuName != null and stuName != ''">stu_name,</if>
|
||||
<if test="schoolName != null and schoolName != ''">school_name,</if>
|
||||
<if test="collegeName != null and collegeName != ''">college_name,</if>
|
||||
<if test="major != null and major != ''">major,</if>
|
||||
<if test="division != null and division != ''">division,</if>
|
||||
<if test="phoneNumber != null and phoneNumber != ''">phone_number,</if>
|
||||
<if test="email != null">email,</if>
|
||||
<if test="studentIdCard != null">student_id_card,</if>
|
||||
<if test="trialsScore != null">trials_score,</if>
|
||||
<if test="isPreliminary != null">is_preliminary,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="studentId != null">student_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="hitRegId != null">#{hitRegId},</if>
|
||||
<if test="stuName != null and stuName != ''">#{stuName},</if>
|
||||
<if test="schoolName != null and schoolName != ''">#{schoolName},</if>
|
||||
<if test="collegeName != null and collegeName != ''">#{collegeName},</if>
|
||||
<if test="major != null and major != ''">#{major},</if>
|
||||
<if test="division != null and division != ''">#{division},</if>
|
||||
<if test="phoneNumber != null and phoneNumber != ''">#{phoneNumber},</if>
|
||||
<if test="email != null">#{email},</if>
|
||||
<if test="studentIdCard != null">#{studentIdCard},</if>
|
||||
<if test="trialsScore != null">#{trialsScore},</if>
|
||||
<if test="isPreliminary != null">#{isPreliminary},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="studentId != null">#{studentId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHitCompetitionStudentInfo" parameterType="HitCompetitionStudentInfo">
|
||||
update hit_competition_student_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="hitRegId != null">hit_reg_id = #{hitRegId},</if>
|
||||
<if test="stuName != null and stuName != ''">stu_name = #{stuName},</if>
|
||||
<if test="schoolName != null and schoolName != ''">school_name = #{schoolName},</if>
|
||||
<if test="collegeName != null and collegeName != ''">college_name = #{collegeName},</if>
|
||||
<if test="major != null and major != ''">major = #{major},</if>
|
||||
<if test="division != null and division != ''">division = #{division},</if>
|
||||
<if test="phoneNumber != null and phoneNumber != ''">phone_number = #{phoneNumber},</if>
|
||||
<if test="email != null">email = #{email},</if>
|
||||
<if test="studentIdCard != null">student_id_card = #{studentIdCard},</if>
|
||||
<if test="trialsScore != null">trials_score = #{trialsScore},</if>
|
||||
<if test="isPreliminary != null">is_preliminary = #{isPreliminary},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHitCompetitionStudentInfoById" parameterType="String">
|
||||
delete from hit_competition_student_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHitCompetitionStudentInfoByIds" parameterType="String">
|
||||
delete from hit_competition_student_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -19,6 +19,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="type" column="type" />
|
||||
<result property="relatedAccounts" column="related_accounts" />
|
||||
<result property="schoolName" column="school_name" />
|
||||
<result property="division" column="division" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHitRegistrationTeachInfoVo">
|
||||
@ -60,6 +63,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="schoolName != null and schoolName !='' ">school_name,</if>
|
||||
<if test="division != null and division !='' ">division,</if>
|
||||
<if test="relatedAccounts != null and relatedAccounts !='' ">related_accounts,</if>
|
||||
<if test="SampleAddress != null and SampleAddress !='' ">sample_address,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
@ -76,6 +83,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="schoolName != null and schoolName !='' ">#{schoolName},</if>
|
||||
<if test="division != null and division !='' ">#{division},</if>
|
||||
<if test="relatedAccounts != null and relatedAccounts !='' ">#{relatedAccounts},</if>
|
||||
<if test="SampleAddress != null and SampleAddress !='' ">#{SampleAddress},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.cms.mapper.HitTeamMembersMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.cms.domain.HitTeamMembers">
|
||||
<id column="id" property="id" />
|
||||
<result column="team_id" property="teamId" />
|
||||
<result column="team_member_id" property="teamMemberId" />
|
||||
<result column="is_agree_with" property="isAgreeWith" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, team_id, team_member_id, is_agree_with, create_time, create_by, update_time, update_by
|
||||
</sql>
|
||||
|
||||
</mapper>
|
23
ruoyi-admin/src/main/resources/mapper/cms/HitTeamsMapper.xml
Normal file
23
ruoyi-admin/src/main/resources/mapper/cms/HitTeamsMapper.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.cms.mapper.HitTeamsMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.cms.domain.HitTeams">
|
||||
<id column="id" property="id" />
|
||||
<result column="team_name" property="teamName" />
|
||||
<result column="division" property="division" />
|
||||
<result column="school_name" property="schoolName" />
|
||||
<result column="team_creator_id" property="teamCreatorId" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, team_name, division, school_name, team_creator_id, create_time, create_by, update_time, update_by
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,209 @@
|
||||
package com.ruoyi.common.core.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 教师信息对象 hit_registration_teach_info
|
||||
*
|
||||
* @author 点亮信息
|
||||
* @date 2024-08-20
|
||||
*/
|
||||
public class HitRegistrationTeachInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 教师ID */
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 报名主键 */
|
||||
@Excel(name = "报名主键")
|
||||
private Long hitRegId;
|
||||
|
||||
/** 教师姓名 */
|
||||
@Excel(name = "教师姓名")
|
||||
private String teacherName;
|
||||
|
||||
/** 教师职务 */
|
||||
@Excel(name = "教师职务")
|
||||
private String teacherJob;
|
||||
|
||||
/** 教师手机号 */
|
||||
@Excel(name = "教师手机号")
|
||||
private String teacherNumber;
|
||||
|
||||
/** 教师email */
|
||||
@Excel(name = "教师email")
|
||||
private String teacherEmail;
|
||||
|
||||
/** 教师所在系及专业 */
|
||||
@Excel(name = "教师所在系及专业")
|
||||
private String teacherSchool;
|
||||
|
||||
/** 逻辑删除0未删除1真删除 */
|
||||
private Long delFlag;
|
||||
|
||||
/** 0指导老师1领队老师 */
|
||||
@Excel(name = "0指导老师1领队老师")
|
||||
private String type;
|
||||
|
||||
/** 老师所在学校 */
|
||||
@Excel(name = "老师所在学校")
|
||||
private String schoolName;
|
||||
|
||||
/** 老师所在赛区 */
|
||||
@Excel(name = "老师所在赛区")
|
||||
private String division;
|
||||
|
||||
/** 老师关联账号 */
|
||||
@Excel(name = "老师关联账号")
|
||||
private String relatedAccounts;
|
||||
|
||||
/** 盲样邮寄地址 */
|
||||
@Excel(name = "盲样邮寄地址")
|
||||
private String SampleAddress;
|
||||
|
||||
public String getSampleAddress() {
|
||||
return SampleAddress;
|
||||
}
|
||||
|
||||
public void setSampleAddress(String sampleAddress) {
|
||||
SampleAddress = sampleAddress;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getRelatedAccounts() {
|
||||
return relatedAccounts;
|
||||
}
|
||||
|
||||
public void setRelatedAccounts(String relatedAccounts) {
|
||||
this.relatedAccounts = relatedAccounts;
|
||||
}
|
||||
|
||||
public String getDivision() {
|
||||
return division;
|
||||
}
|
||||
|
||||
public void setDivision(String division) {
|
||||
this.division = division;
|
||||
}
|
||||
|
||||
public String getSchoolName() {
|
||||
return schoolName;
|
||||
}
|
||||
|
||||
public void setSchoolName(String schoolName) {
|
||||
this.schoolName = schoolName;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setHitRegId(Long hitRegId)
|
||||
{
|
||||
this.hitRegId = hitRegId;
|
||||
}
|
||||
|
||||
public Long getHitRegId()
|
||||
{
|
||||
return hitRegId;
|
||||
}
|
||||
public void setTeacherName(String teacherName)
|
||||
{
|
||||
this.teacherName = teacherName;
|
||||
}
|
||||
|
||||
public String getTeacherName()
|
||||
{
|
||||
return teacherName;
|
||||
}
|
||||
public void setTeacherJob(String teacherJob)
|
||||
{
|
||||
this.teacherJob = teacherJob;
|
||||
}
|
||||
|
||||
public String getTeacherJob()
|
||||
{
|
||||
return teacherJob;
|
||||
}
|
||||
public void setTeacherNumber(String teacherNumber)
|
||||
{
|
||||
this.teacherNumber = teacherNumber;
|
||||
}
|
||||
|
||||
public String getTeacherNumber()
|
||||
{
|
||||
return teacherNumber;
|
||||
}
|
||||
public void setTeacherEmail(String teacherEmail)
|
||||
{
|
||||
this.teacherEmail = teacherEmail;
|
||||
}
|
||||
|
||||
public String getTeacherEmail()
|
||||
{
|
||||
return teacherEmail;
|
||||
}
|
||||
public void setTeacherSchool(String teacherSchool)
|
||||
{
|
||||
this.teacherSchool = teacherSchool;
|
||||
}
|
||||
|
||||
public String getTeacherSchool()
|
||||
{
|
||||
return teacherSchool;
|
||||
}
|
||||
public void setDelFlag(Long delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Long getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("hitRegId", getHitRegId())
|
||||
.append("teacherName", getTeacherName())
|
||||
.append("teacherJob", getTeacherJob())
|
||||
.append("teacherNumber", getTeacherNumber())
|
||||
.append("teacherEmail", getTeacherEmail())
|
||||
.append("teacherSchool", getTeacherSchool())
|
||||
.append("remark", getRemark())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("type", getType())
|
||||
.append("division", getDivision())
|
||||
.append("schoolName",getSchoolName())
|
||||
.append("relatedAccounts",getRelatedAccounts())
|
||||
.append("sampleAddress",getSampleAddress())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -41,6 +41,11 @@ public class SysUser extends BaseEntity
|
||||
@Excel(name = "用户邮箱")
|
||||
private String email;
|
||||
|
||||
/** 用户类型 */
|
||||
@Excel(name = "用户类型", readConverterExp = "00系统用户,01学生,02老师")
|
||||
private String userType;
|
||||
|
||||
|
||||
/** 手机号码 */
|
||||
@Excel(name = "手机号码", cellType = ColumnType.TEXT)
|
||||
private String phonenumber;
|
||||
@ -129,6 +134,7 @@ public class SysUser extends BaseEntity
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
|
||||
@Xss(message = "用户昵称不能包含脚本字符")
|
||||
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
||||
public String getNickName()
|
||||
@ -297,6 +303,13 @@ public class SysUser extends BaseEntity
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public String getUserType() {
|
||||
return userType;
|
||||
}
|
||||
|
||||
public void setUserType(String userType) {
|
||||
this.userType = userType;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@ -319,6 +332,7 @@ public class SysUser extends BaseEntity
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("dept", getDept())
|
||||
.append("userType", getUserType())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
package com.ruoyi.common.core.domain.model;
|
||||
|
||||
|
||||
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
|
||||
|
||||
/**
|
||||
* 用户注册对象
|
||||
*
|
||||
@ -8,4 +11,25 @@ package com.ruoyi.common.core.domain.model;
|
||||
public class RegisterBody extends LoginBody
|
||||
{
|
||||
|
||||
private String userType ;
|
||||
private HitRegistrationTeachInfo hitRegistrationTeachInfo;
|
||||
|
||||
|
||||
public String getUserType() {
|
||||
return userType;
|
||||
}
|
||||
|
||||
public void setUserType(String userType) {
|
||||
this.userType = userType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public HitRegistrationTeachInfo getHitRegistrationTeachInfo() {
|
||||
return hitRegistrationTeachInfo;
|
||||
}
|
||||
|
||||
public void setHitRegistrationTeachInfo(HitRegistrationTeachInfo hitRegistrationTeachInfo) {
|
||||
this.hitRegistrationTeachInfo = hitRegistrationTeachInfo;
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
|
||||
/**
|
||||
* 获取当前Date型日期
|
||||
*
|
||||
*
|
||||
* @return Date() 当前日期
|
||||
*/
|
||||
public static Date getNowDate()
|
||||
|
@ -23,7 +23,7 @@ import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
|
||||
|
||||
/**
|
||||
* spring security配置
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@EnableMethodSecurity(prePostEnabled = true, securedEnabled = true)
|
||||
@ -35,7 +35,7 @@ public class SecurityConfig
|
||||
*/
|
||||
@Autowired
|
||||
private UserDetailsService userDetailsService;
|
||||
|
||||
|
||||
/**
|
||||
* 认证失败处理类
|
||||
*/
|
||||
@ -53,7 +53,7 @@ public class SecurityConfig
|
||||
*/
|
||||
@Autowired
|
||||
private JwtAuthenticationTokenFilter authenticationTokenFilter;
|
||||
|
||||
|
||||
/**
|
||||
* 跨域过滤器
|
||||
*/
|
||||
@ -117,6 +117,7 @@ public class SecurityConfig
|
||||
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
||||
.antMatchers("/api/**", "/ueditor/**","/system/dict/data/type/sys_user_sex","/system/dict/data/type/imitation_type"
|
||||
,"/system/dict/data/type/school_name").permitAll()
|
||||
.antMatchers("/system/hit_stu_info/*").permitAll()
|
||||
// 除上面外的所有请求全部需要鉴权认证
|
||||
.anyRequest().authenticated();
|
||||
})
|
||||
|
@ -20,12 +20,11 @@ import com.ruoyi.system.service.ISysUserService;
|
||||
|
||||
/**
|
||||
* 注册校验方法
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Component
|
||||
public class SysRegisterService
|
||||
{
|
||||
public class SysRegisterService {
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@ -35,55 +34,44 @@ public class SysRegisterService
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 注册
|
||||
*/
|
||||
public String register(RegisterBody registerBody)
|
||||
{
|
||||
public String register(RegisterBody registerBody) {
|
||||
String msg = "", username = registerBody.getUsername(), password = registerBody.getPassword();
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setUserName(username);
|
||||
|
||||
// 验证码开关
|
||||
boolean captchaEnabled = configService.selectCaptchaEnabled();
|
||||
if (captchaEnabled)
|
||||
{
|
||||
if (captchaEnabled) {
|
||||
validateCaptcha(username, registerBody.getCode(), registerBody.getUuid());
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(username))
|
||||
{
|
||||
if (StringUtils.isEmpty(username)) {
|
||||
msg = "用户名不能为空";
|
||||
}
|
||||
else if (StringUtils.isEmpty(password))
|
||||
{
|
||||
} else if (StringUtils.isEmpty(password)) {
|
||||
msg = "用户密码不能为空";
|
||||
}
|
||||
else if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
|| username.length() > UserConstants.USERNAME_MAX_LENGTH)
|
||||
{
|
||||
} else if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
|| username.length() > UserConstants.USERNAME_MAX_LENGTH) {
|
||||
msg = "账户长度必须在2到20个字符之间";
|
||||
}
|
||||
else if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH)
|
||||
{
|
||||
} else if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
|
||||
msg = "密码长度必须在5到20个字符之间";
|
||||
}
|
||||
else if (!userService.checkUserNameUnique(sysUser))
|
||||
{
|
||||
} else if (!userService.checkUserNameUnique(sysUser)) {
|
||||
msg = "保存用户'" + username + "'失败,注册账号已存在";
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sysUser.setNickName(username);
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
||||
sysUser.setUserType(registerBody.getUserType());
|
||||
boolean regFlag = userService.registerUser(sysUser);
|
||||
if (!regFlag)
|
||||
{
|
||||
if (!regFlag) {
|
||||
msg = "注册失败,请联系系统管理人员";
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.REGISTER, MessageUtils.message("user.register.success")));
|
||||
}
|
||||
}
|
||||
@ -92,24 +80,27 @@ public class SysRegisterService
|
||||
|
||||
/**
|
||||
* 校验验证码
|
||||
*
|
||||
*
|
||||
* @param username 用户名
|
||||
* @param code 验证码
|
||||
* @param uuid 唯一标识
|
||||
* @param code 验证码
|
||||
* @param uuid 唯一标识
|
||||
* @return 结果
|
||||
*/
|
||||
public void validateCaptcha(String username, String code, String uuid)
|
||||
{
|
||||
public void validateCaptcha(String username, String code, String uuid) {
|
||||
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, "");
|
||||
String captcha = redisCache.getCacheObject(verifyKey);
|
||||
redisCache.deleteObject(verifyKey);
|
||||
if (captcha == null)
|
||||
{
|
||||
if (captcha == null) {
|
||||
throw new CaptchaExpireException();
|
||||
}
|
||||
if (!code.equalsIgnoreCase(captcha))
|
||||
{
|
||||
if (!code.equalsIgnoreCase(captcha)) {
|
||||
throw new CaptchaException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 老师注册信息
|
||||
* @Param: HitRegistrationTeachInfo
|
||||
*/
|
||||
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
|
||||
@ -124,4 +126,7 @@ public interface SysUserMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public SysUser checkEmailUnique(String email);
|
||||
|
||||
|
||||
SysUser select(String userName);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
|
||||
/**
|
||||
@ -203,4 +204,6 @@ public interface ISysUserService
|
||||
* @return 结果
|
||||
*/
|
||||
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
|
||||
|
||||
|
||||
}
|
||||
|
@ -65,6 +65,8 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
@Autowired
|
||||
protected Validator validator;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据条件分页查询用户列表
|
||||
*
|
||||
@ -547,4 +549,5 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
}
|
||||
return successMsg.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -141,7 +141,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<select id="select" resultType="com.ruoyi.common.core.domain.entity.SysUser"
|
||||
parameterType="java.lang.String">
|
||||
select * from sys_user where user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user(
|
||||
<if test="userId != null and userId != 0">user_id,</if>
|
||||
@ -156,6 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="userType != null and userType!='' ">user_type,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="userId != null and userId != ''">#{userId},</if>
|
||||
@ -170,11 +175,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="userType != null and userType!='' ">#{userType},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateUser" parameterType="SysUser">
|
||||
|
||||
|
||||
<update id="updateUser" parameterType="SysUser">
|
||||
update sys_user
|
||||
<set>
|
||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
||||
|
@ -141,7 +141,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<select id="select" resultType="com.ruoyi.common.core.domain.entity.SysUser"
|
||||
parameterType="java.lang.String">
|
||||
select * from sys_user where user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user(
|
||||
<if test="userId != null and userId != 0">user_id,</if>
|
||||
@ -156,6 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="userType != null and userType!='' ">user_type,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="userId != null and userId != ''">#{userId},</if>
|
||||
@ -170,11 +175,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="userType != null and userType!='' ">#{userType},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateUser" parameterType="SysUser">
|
||||
|
||||
|
||||
<update id="updateUser" parameterType="SysUser">
|
||||
update sys_user
|
||||
<set>
|
||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
||||
|
@ -102,6 +102,7 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
localStorage.removeItem('isLoggedIn'); // 清空 localStorage 中的登录状态
|
||||
location.href = '/index';
|
||||
})
|
||||
}).catch(() => {});
|
||||
|
@ -91,7 +91,7 @@ export default {
|
||||
// 验证码开关
|
||||
captchaEnabled: true,
|
||||
// 注册开关
|
||||
register: false,
|
||||
register: true,
|
||||
redirect: undefined
|
||||
};
|
||||
},
|
||||
|
@ -1,4 +1,5 @@
|
||||
<template>
|
||||
|
||||
<div class="tab-boxs">
|
||||
<!-- left -->
|
||||
<div class="d-s" @click="toHome">
|
||||
@ -16,7 +17,6 @@
|
||||
<img v-if="item.iconUrl" :src=" imgurl +item.iconUrl " alt="" style="width: 25px;height: 25px">
|
||||
</div>
|
||||
<div class="bsize">{{ item.label }}</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- right -->
|
||||
@ -30,14 +30,134 @@
|
||||
<!-- <i class="el-icon-circle-close" v-if="!show_search" style="margin-left: 10px;"-->
|
||||
<!-- @click="show_search = true"></i>-->
|
||||
</div>
|
||||
<div class="right-box" v-if="!currentUser">
|
||||
<el-button class="login-button" @click="showLoginDialog = true">登录</el-button>
|
||||
<el-button class="register-button" @click="registerDialog = true">注册</el-button>
|
||||
</div>
|
||||
<div class="right-box" v-if="currentUser">
|
||||
<el-dropdown @command="handleCommand">
|
||||
<span class="right-box">
|
||||
{{ currentUser }} <i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="logout" divided @click.native="logout" >退出登录</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<el-dialog title="登录" :visible.sync="showLoginDialog" width="30%" :modal="false">
|
||||
<div>
|
||||
<el-form :model="loginForm" ref="loginForm">
|
||||
<el-form-item prop="username">
|
||||
<el-input placeholder="学号" v-model="loginForm.username" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input placeholder="密码" v-model="loginForm.password" type="password"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="code">
|
||||
<el-input v-model="loginForm.code"
|
||||
auto-complete="off"
|
||||
placeholder="验证码"
|
||||
style="width: 63%"
|
||||
@keyup.enter.native="handleLogin">
|
||||
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
|
||||
</el-input>
|
||||
<div class="login-code">
|
||||
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="showLoginDialog = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitLogin">登 录</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog title="注册" :visible.sync="registerDialog" width="30%" :modal="false">
|
||||
<div>
|
||||
<el-form :model="registerForm" :rules="registerRules" ref="registerForm">
|
||||
<el-form-item label="老师注册">
|
||||
<el-switch v-model="value"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item prop="username">
|
||||
<el-input placeholder="学号" v-model="registerForm.username" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input placeholder="密码" v-model="registerForm.password" type="password"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="confirmPassword">
|
||||
<el-input placeholder="确认密码" v-model="registerForm.confirmPassword" type="password"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="teacherName" v-if="value">
|
||||
<el-input placeholder="姓名" v-model="registerForm.hitRegistrationTeachInfo.teacherName" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="teacherJob" v-if="value">
|
||||
<el-input placeholder="职务" v-model="registerForm.hitRegistrationTeachInfo.teacherJob" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="teacherEmail" v-if="value">
|
||||
<el-input placeholder="邮箱" v-model="registerForm.hitRegistrationTeachInfo.teacherEmail" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="teacherNumber" v-if="value">
|
||||
<el-input placeholder="手机号" v-model="registerForm.hitRegistrationTeachInfo.teacherNumber" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="teacherSchool" v-if="value">
|
||||
<el-input placeholder="所在系及专业" v-model="registerForm.hitRegistrationTeachInfo.teacherSchool" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="SchoolName" v-if="value">
|
||||
<el-input placeholder="所在学校" v-model="registerForm.hitRegistrationTeachInfo.schoolName" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="division" v-if="value">
|
||||
<el-input placeholder="所属赛区" v-model="registerForm.hitRegistrationTeachInfo.division" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="SampleAddress" v-if="value">
|
||||
<el-input placeholder="盲样邮寄地址" v-model="registerForm.hitRegistrationTeachInfo.SampleAddress"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="code" >
|
||||
<el-input v-model="registerForm.code"
|
||||
auto-complete="off"
|
||||
placeholder="验证码"
|
||||
style="width: 63%"
|
||||
@keyup.enter.native="handleLogin">
|
||||
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
|
||||
</el-input>
|
||||
<div class="login-code">
|
||||
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item></el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="showRegisterDialog = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitRegister">注 册</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import { getHomeUserInfo ,getTeacherAndStudentInfo} from "@/api/system/user";
|
||||
import { getBaseInfo, getTab } from '@/api/gw/home'
|
||||
import { getCodeImg ,register} from "@/api/login";
|
||||
import Cookies from "js-cookie";
|
||||
import { encrypt, decrypt } from '@/utils/jsencrypt'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
const equalToPassword = (rule, value, callback) => {
|
||||
if (this.registerForm.password !== value) {
|
||||
callback(new Error("两次输入的密码不一致"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
isLoggedIn: false, // 是否登录
|
||||
value: false,
|
||||
currentUser: '', //当前用户
|
||||
codeUrl: "", //验证码地址
|
||||
showLoginDialog: false, // 是否显示登录对话框
|
||||
registerDialog: false, // 是否显示注册对话框
|
||||
baseInfo:"",
|
||||
imgurl: process.env.VUE_APP_BASE_API,
|
||||
input:'',
|
||||
@ -58,6 +178,49 @@ export default {
|
||||
{name: '合作企业'},
|
||||
{name: '联系我们'},
|
||||
],
|
||||
loginForm: {
|
||||
username: '',
|
||||
password: '',
|
||||
code: '',
|
||||
uuid: '',
|
||||
rememberMe: false
|
||||
|
||||
},
|
||||
registerForm: {
|
||||
username: '',
|
||||
password: '',
|
||||
code: '',
|
||||
confirmPassword: '',
|
||||
uuid: '',
|
||||
userType:'',
|
||||
hitRegistrationTeachInfo:{
|
||||
teacherName: '',
|
||||
teacherJob: '',
|
||||
teacherEmail: '',
|
||||
teacherNumber: '',
|
||||
teacherSchool: '',
|
||||
schoolName: '',
|
||||
division: '',
|
||||
SampleAddress: '',
|
||||
|
||||
}
|
||||
},
|
||||
registerRules: {
|
||||
username: [
|
||||
{ required: true, trigger: "blur", message: "请输入您的账号" },
|
||||
{ message: '学号不能为空', trigger: 'blur' }
|
||||
],
|
||||
password: [
|
||||
{ required: true, trigger: "blur", message: "请输入您的密码" },
|
||||
{ min: 5, max: 20, message: "用户密码长度必须介于 5 和 20 之间", trigger: "blur" },
|
||||
{ pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" }
|
||||
],
|
||||
confirmPassword: [
|
||||
{ required: true, trigger: "blur", message: "请再次输入您的密码" },
|
||||
{ required: true, validator: equalToPassword, trigger: "blur" }
|
||||
],
|
||||
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
|
||||
}
|
||||
}
|
||||
},
|
||||
props: {
|
||||
@ -65,15 +228,126 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.tabindex = this.msg
|
||||
this.getCode();
|
||||
this.getCookie(); // 页面加载完毕调用
|
||||
this.isLoggedIn = localStorage.getItem('isLoggedIn') === 'true'; // 检查 localStorage 中的登录状态
|
||||
if (this.isLoggedIn) {
|
||||
this.loadUserInfo();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.tabindex = this.msg
|
||||
console.log(this.msg)
|
||||
// console.log(this.msg)
|
||||
// 页面加载完毕调用
|
||||
this.tabLsit();
|
||||
this.getWebBaseInfo()
|
||||
this.getWebBaseInfo();
|
||||
|
||||
},
|
||||
|
||||
methods:{
|
||||
|
||||
//用户信息
|
||||
loadUserInfo() {
|
||||
getHomeUserInfo().then(response => {
|
||||
this.currentUser = response.data.userName;
|
||||
console.log('当前用户名:', this.currentUser);
|
||||
if (this.userInfo.avatar && this.userInfo.avatar != '') {
|
||||
this.userInfo.avatar = process.env.VUE_APP_BASE_API + this.userInfo.avatar;
|
||||
}
|
||||
})
|
||||
},
|
||||
//验证码
|
||||
getCode() {
|
||||
getCodeImg().then(res => {
|
||||
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
|
||||
if (this.captchaEnabled) {
|
||||
this.codeUrl = "data:image/gif;base64," + res.img;
|
||||
this.loginForm.uuid = res.uuid;
|
||||
this.registerForm.uuid = res.uuid;
|
||||
}
|
||||
});
|
||||
},
|
||||
getCookie() {
|
||||
const username = Cookies.get("username");
|
||||
const password = Cookies.get("password");
|
||||
const rememberMe = Cookies.get('rememberMe')
|
||||
this.loginForm = {
|
||||
username: username === undefined ? this.loginForm.username : username,
|
||||
password: password === undefined ? this.loginForm.password : decrypt(password),
|
||||
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
|
||||
};
|
||||
},
|
||||
// 登录
|
||||
submitLogin() {
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
if (this.loginForm.rememberMe) {
|
||||
Cookies.set("username", this.loginForm.username, { expires: 30 });
|
||||
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 });
|
||||
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
|
||||
} else {
|
||||
Cookies.remove("username");
|
||||
Cookies.remove("password");
|
||||
Cookies.remove('rememberMe');
|
||||
}
|
||||
this.$store.dispatch("Login", this.loginForm).then(() => {
|
||||
this.isLoggedIn = true; // 登录成功后设置标志
|
||||
this.showLoginDialog = false;
|
||||
this.$router.push("/virtually").catch(()=>{});
|
||||
this.loadUserInfo();
|
||||
localStorage.setItem('isLoggedIn', 'true'); // 将登录状态存储在 localStorage
|
||||
console.log('当前用户名:', this.currentUser);
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
if (this.captchaEnabled) {
|
||||
this.getCode();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
//注册
|
||||
submitRegister() {
|
||||
this.$refs.registerForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
if (this.value) {
|
||||
this.registerForm.userType = '02';
|
||||
}else {
|
||||
this.registerForm.userType = '01';
|
||||
}
|
||||
register(this.registerForm).then(res => {
|
||||
const username = this.registerForm.username;
|
||||
this.$alert("<font color='red'>恭喜你,您的账号 " + username + " 注册成功!</font>", '系统提示', {
|
||||
dangerouslyUseHTMLString: true,
|
||||
type: 'success'
|
||||
}).then(() => {
|
||||
this.$router.push("/virtually");
|
||||
}).catch(() => {});
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
if (this.captchaEnabled) {
|
||||
this.getCode();
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
//退出登录
|
||||
async logout() {
|
||||
this.$confirm('确定注销并退出系统吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
localStorage.removeItem('isLoggedIn'); // 清空 localStorage 中的登录状态
|
||||
location.href = '/index';
|
||||
})
|
||||
}).catch(() => {});
|
||||
},
|
||||
tabClick(url,id,index){
|
||||
this.tabindex = index
|
||||
if (url === 'home') url = "gw";
|
||||
@ -100,11 +374,31 @@ export default {
|
||||
},
|
||||
toHome(){
|
||||
this.$router.push("/virtually")
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.right-box {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 170px;
|
||||
font-size: 20px;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.login-button {
|
||||
background-color: #fff; /* 白色背景 */
|
||||
color: #005375; /* 蓝色文字 */
|
||||
}
|
||||
|
||||
.register-button {
|
||||
background: none; /* 透明背景 */
|
||||
color: #fff; /* 白色文字 */
|
||||
}
|
||||
|
||||
.tab-boxs {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
@ -165,4 +459,20 @@ export default {
|
||||
font-size: 16px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.login-code {
|
||||
width: 33%;
|
||||
height: 38px;
|
||||
float: right;
|
||||
img {
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
.login-code-img {
|
||||
height: 38px;
|
||||
}
|
||||
.el-dialog__title {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user