This commit is contained in:
许允枞 2025-02-18 17:12:16 +08:00
parent ff6d7cb24f
commit c1ad3f3580
24 changed files with 1459 additions and 661 deletions

View File

@ -6,8 +6,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.cms.domain.vo.HitRegInfoExportVo;
import com.ruoyi.cms.domain.vo.HitRegInfoVo;
import com.ruoyi.cms.domain.vo.*;
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
import com.ruoyi.common.utils.bean.BeanUtils;
import org.slf4j.Logger;
@ -30,6 +29,7 @@ import com.ruoyi.cms.domain.HitRegInfo;
import com.ruoyi.cms.service.IHitRegInfoService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* 报名信息Controller
@ -60,7 +60,6 @@ public class HitRegInfoController extends BaseController
/**
* 学生查询报名信息列表
*/
@GetMapping("/studentList")
public TableDataInfo studentList(HitRegInfo hitRegInfo)
{
@ -185,4 +184,54 @@ public class HitRegInfoController extends BaseController
{
return toAjax(hitRegInfoService.deleteHitRegInfoByIds(ids));
}
/**
* 导入个人分数数据模板
*
* @param response
*/
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) {
ExcelUtil<HitRegInfoUserImportVo> util = new ExcelUtil<>(HitRegInfoUserImportVo.class);
util.importTemplateExcel(response, "用户数据");
}
/**
* 导入个人分数数据
* @param file
* @return
* @throws Exception
*/
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file) throws Exception {
ExcelUtil<HitRegInfoUserImportVo> util = new ExcelUtil<>(HitRegInfoUserImportVo.class);
List<HitRegInfoUserImportVo> hitList = util.importExcel(file.getInputStream());
String message = hitRegInfoService.importData(hitList);
return success(message);
}
/**
* 导入团队分数数据模板
*
* @param response
*/
@PostMapping("/importTeamTemplate")
public void importTeamTemplate(HttpServletResponse response) {
ExcelUtil<HitRegInfoTeamImportVo> util = new ExcelUtil<>(HitRegInfoTeamImportVo.class);
util.importTemplateExcel(response, "用户数据");
}
/**
* 导入团队分数数据
* @param file
* @return
* @throws Exception
*/
@PostMapping("/importTeamData")
public AjaxResult importTeamData(MultipartFile file) throws Exception {
ExcelUtil<HitRegInfoTeamImportVo> util = new ExcelUtil<>(HitRegInfoTeamImportVo.class);
List<HitRegInfoTeamImportVo> hitList = util.importExcel(file.getInputStream());
String message = hitRegInfoService.importTeamData(hitList);
return success(message);
}
}

View File

@ -135,5 +135,23 @@ public class HitCompetitionStudentInfo implements Serializable {
private HitRegInfo hitRegInfo;
@TableField(exist = false)
private String zdTeacherStr;
@TableField(exist = false)
private boolean isSignUp;
/**
* 虚拟分
*/
@TableField(exist = false)
private BigDecimal virtualScore;
/**
* 化验分
*/
@TableField(exist = false)
private BigDecimal assayScore;
/**
* 团队分
*/
@TableField(exist = false)
private BigDecimal teamScore;
}

View File

@ -9,6 +9,7 @@ import lombok.Data;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -68,6 +69,9 @@ public class HitRegInfo extends BaseEntity
//0未审核1审核通过2审核拒绝
private String auditStatus;
//团队分
private BigDecimal score;
/** 逻辑删除0未删除1真删除 */
private Long delFlag;
@TableField(exist = false)

View File

@ -9,6 +9,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.math.BigDecimal;
/**
* 报名相关人员信息对象 hit_reg_info_user
*
@ -40,6 +42,18 @@ public class HitRegInfoUser extends BaseEntity
@Excel(name = "类型 1 学生 2 指导老师 3领队老师")
private String type;
/**
* 虚拟分
*/
@Excel(name = "虚拟分")
private BigDecimal virtualScore;
/**
* 化验分
*/
@Excel(name = "化验分")
private BigDecimal assayScore;
/** 状态0待确认 1已同意 2拒绝 */
@Excel(name = "状态0待确认 1已同意 2拒绝")
private String status;

View File

@ -0,0 +1,28 @@
package com.ruoyi.cms.domain.vo;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.math.BigDecimal;
/**
* 报名相关人员信息对象 hit_reg_info_user
*
* @author ruoyi
* @date 2024-09-01
*/
@Data
public class HitRegInfoTeamImportVo extends BaseEntity
{
@Excel(name = "团队名称")
private String teamName;
/**
* 虚拟分
*/
@Excel(name = "团队分")
private BigDecimal score;
private Long userId;
}

View File

@ -0,0 +1,36 @@
package com.ruoyi.cms.domain.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.math.BigDecimal;
/**
* 报名相关人员信息对象 hit_reg_info_user
*
* @author ruoyi
* @date 2024-09-01
*/
@Data
public class HitRegInfoUserImportVo extends BaseEntity
{
@Excel(name = "手机号")
private String mobile;
/**
* 虚拟分
*/
@Excel(name = "虚拟分")
private BigDecimal virtualScore;
/**
* 化验分
*/
@Excel(name = "化验分")
private BigDecimal assayScore;
private Long userId;
}

View File

@ -1,7 +1,10 @@
package com.ruoyi.cms.service;
import java.util.List;
import com.ruoyi.cms.domain.HitRegInfo;
import com.ruoyi.cms.domain.vo.HitRegInfoTeamImportVo;
import com.ruoyi.cms.domain.vo.HitRegInfoUserImportVo;
import com.ruoyi.cms.domain.vo.HitRegInfoVo;
/**
@ -10,8 +13,7 @@ import com.ruoyi.cms.domain.vo.HitRegInfoVo;
* @author zcy
* @date 2024-08-20
*/
public interface IHitRegInfoService
{
public interface IHitRegInfoService {
/**
* 查询报名信息
*
@ -27,6 +29,7 @@ public interface IHitRegInfoService
* @return 报名信息集合
*/
public List<HitRegInfo> selectHitRegInfoList(HitRegInfo hitRegInfo);
/**
* 导出报名信息列表
*
@ -50,6 +53,7 @@ public interface IHitRegInfoService
* @return 结果
*/
public int updateHitRegInfo(HitRegInfo hitRegInfo);
public int updateHitRegInfo2(HitRegInfo hitRegInfo);
/**
@ -61,7 +65,7 @@ public interface IHitRegInfoService
public int deleteHitRegInfoByIds(Long[] ids);
void createRegInfo(String teamName,Integer teamCreatorId,String teacherId,Long teamId);
void createRegInfo(String teamName, Integer teamCreatorId, String teacherId, Long teamId);
/**
* 查询报名信息
@ -69,7 +73,8 @@ public interface IHitRegInfoService
* @param
* @return 报名信息
*/
HitRegInfo selectHitByUserId(Long userId,String status);
HitRegInfo selectHitByUserId(Long userId, String status);
HitRegInfo selectHitByUserId2(Long userId);
@ -84,4 +89,20 @@ public interface IHitRegInfoService
* @return 修改结果
*/
int editTeam(HitRegInfo hitRegInfo);
/**
* 导入个人成绩信息
*
* @param hitList
* @return
*/
String importData(List<HitRegInfoUserImportVo> hitList);
/**
* 导入团队成绩信息
*
* @param hitList
* @return
*/
String importTeamData(List<HitRegInfoTeamImportVo> hitList);
}

View File

@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.cms.domain.*;
import com.ruoyi.cms.domain.vo.HitCompetitionStudentInfoImportVo;
@ -15,6 +17,7 @@ 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.IHitRegInfoService;
import com.ruoyi.cms.service.IHitRegInfoUserService;
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
@ -25,6 +28,7 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysDictDataService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -63,6 +67,8 @@ public class HitCompetitionStudentInfoServiceImpl extends ServiceImpl<HitCompeti
private ISysDictDataService sysDictDataService;
@Autowired
private IHitRegInfoService regInfoService;
@Autowired
private IHitRegInfoUserService hitRegInfoUserService;
private static final Logger log = LoggerFactory.getLogger(HitCompetitionStudentInfoServiceImpl.class);
@ -176,6 +182,12 @@ public class HitCompetitionStudentInfoServiceImpl extends ServiceImpl<HitCompeti
*/
@Override
public int updateHitCompetitionStudentInfoUpdate(HitCompetitionStudentInfo hitCompetitionStudentInfo) {
if (ObjectUtil.isNotEmpty(hitCompetitionStudentInfo.getPhoneNumber())) {
//校验手机号
if (!Validator.isMobile(hitCompetitionStudentInfo.getPhoneNumber())) {
throw new RuntimeException("手机号格式不正确");
}
}
LambdaQueryWrapper<HitCompetitionStudentInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(HitCompetitionStudentInfo::getSchoolName, hitCompetitionStudentInfo.getSchoolName());
queryWrapper.eq(HitCompetitionStudentInfo::getIsPreliminary, true);
@ -241,11 +253,23 @@ public class HitCompetitionStudentInfoServiceImpl extends ServiceImpl<HitCompeti
//// hitCompetitionStudentInfo.setCompetition(hitTeams.getCompetition());
// }
if (ObjectUtils.isEmpty(hitCompetitionStudentInfo)) {
hitCompetitionStudentInfo = new HitCompetitionStudentInfo();
hitCompetitionStudentInfo.setSignUp(false);
return new HitCompetitionStudentInfo();
}
//查询化验赛和虚拟赛成绩
List<HitRegInfoUser> hitRegInfoUsers = hitRegInfoUserService.selectByUserId(user.getUserId());
if (CollectionUtils.isNotEmpty(hitRegInfoUsers)) {
hitCompetitionStudentInfo.setAssayScore(hitRegInfoUsers.get(0).getAssayScore());
hitCompetitionStudentInfo.setVirtualScore(hitRegInfoUsers.get(0).getVirtualScore());
}
hitCompetitionStudentInfo.setSignUp(true);
String com_region = sysDictDataService.selectDictLabel("com_region", hitCompetitionStudentInfo.getDivision());
hitCompetitionStudentInfo.setDivisionLabel(com_region);
//根据学校查询领队老师
// TODO 不需要非得今年的老师
LambdaQueryWrapper<HitRegistrationTeachInfo> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(HitRegistrationTeachInfo::getSchoolName, hitCompetitionStudentInfo.getSchoolName())
.likeRight(HitRegistrationTeachInfo::getCreateTime, year).eq(HitRegistrationTeachInfo::getType, 1).eq(HitRegistrationTeachInfo::getStatus, 1);
@ -283,7 +307,8 @@ public class HitCompetitionStudentInfoServiceImpl extends ServiceImpl<HitCompeti
tmpStr = teacher.getUserName() + ",";
}
hitCompetitionStudentInfo.setZdTeacherStr(tmpStr.substring(0, tmpStr.length() - 1));
hitCompetitionStudentInfo.setHitRegInfo(hitRegInfos1);
hitCompetitionStudentInfo.setTeamScore(hitRegInfos1.getScore());
} else {
//查询是否存在已确认团队 审核中
HitRegInfo hitRegInfos2 = regInfoService.selectHitByUserId(user.getUserId(), "0");
@ -298,6 +323,8 @@ public class HitCompetitionStudentInfoServiceImpl extends ServiceImpl<HitCompeti
tmpStr = teacher.getUserName() + ",";
}
hitCompetitionStudentInfo.setZdTeacherStr(tmpStr.substring(0, tmpStr.length() - 1));
hitCompetitionStudentInfo.setHitRegInfo(hitRegInfos2);
hitCompetitionStudentInfo.setTeamScore(hitRegInfos2.getScore());
} else {
//查询是否存在待确认团队
HitRegInfo hitRegInfos3 = regInfoService.selectHitByUserId(user.getUserId(), "9");
@ -312,6 +339,7 @@ public class HitCompetitionStudentInfoServiceImpl extends ServiceImpl<HitCompeti
tmpStr = tmpStr + teacher.getUserName() + ",";
}
hitCompetitionStudentInfo.setZdTeacherStr(tmpStr.substring(0, tmpStr.length() - 1));
hitCompetitionStudentInfo.setHitRegInfo(hitRegInfos3);
}
}
}

View File

@ -2,18 +2,23 @@ package com.ruoyi.cms.service.impl;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.util.ObjectUtil;
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.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.cms.domain.*;
import com.ruoyi.cms.domain.vo.HitRegInfoTeamImportVo;
import com.ruoyi.cms.domain.vo.HitRegInfoUserImportVo;
import com.ruoyi.cms.domain.vo.HitRegInfoVo;
import com.ruoyi.cms.mapper.*;
import com.ruoyi.cms.service.ICmsContentService;
@ -25,7 +30,10 @@ import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cms.service.IHitRegInfoService;
@ -38,14 +46,13 @@ import org.springframework.transaction.annotation.Transactional;
* @date 2024-08-20
*/
@Service
public class HitRegInfoServiceImpl implements IHitRegInfoService
{
public class HitRegInfoServiceImpl implements IHitRegInfoService {
@Autowired
private HitRegInfoMapper hitRegInfoMapper;
@Autowired
private HitRegistrationTeachInfoMapper teachInfoMapper;
@Autowired
private ICmsContentService insertCmsContent;
private ICmsContentService insertCmsContent;
@Autowired
private CmsContentMapper cmsContentMapper;
@Autowired
@ -61,6 +68,7 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
@Autowired
private HitRegInfoUserMapper hitRegInfoUserMapper;
private static final Logger log = LoggerFactory.getLogger(HitRegInfoServiceImpl.class);
/**
@ -70,8 +78,7 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
* @return 报名信息
*/
@Override
public HitRegInfo selectHitRegInfoById(Long id)
{
public HitRegInfo selectHitRegInfoById(Long id) {
return hitRegInfoMapper.selectHitRegInfoById(id);
}
@ -82,46 +89,46 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
* @return 报名信息
*/
@Override
public List<HitRegInfo> selectHitRegInfoList(HitRegInfo hitRegInfo)
{
public List<HitRegInfo> selectHitRegInfoList(HitRegInfo hitRegInfo) {
if (ObjectUtil.isEmpty(hitRegInfo.getYear())) {
//获取当前年
hitRegInfo.setYear(DateUtil.format(new Date(), "yyyy"));
}
Long userId = SecurityUtils.getLoginUser().getUserId();
//判断当前登陆人是否是领队老师如果是查询该老师学校下的战队
HitRegistrationTeachInfo teacherInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(userId,hitRegInfo.getYear());
HitRegistrationTeachInfo teacherInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(userId, hitRegInfo.getYear());
if (teacherInfo != null && teacherInfo.getType().equals("1")) {
hitRegInfo.setSchoolName(teacherInfo.getSchoolName());
}
PageUtils.startPage();
List<HitRegInfo> hitRegInfos = hitRegInfoMapper.selectHitRegInfoList(hitRegInfo);
for (HitRegInfo regInfo : hitRegInfos) {
HitRegInfoUser hitRegInfoUser =new HitRegInfoUser();
HitRegInfoUser hitRegInfoUser = new HitRegInfoUser();
hitRegInfoUser.setRegId(regInfo.getId());
List<HitRegInfoUser> hitRegInfoUsers = regInfoUserService.selectHitRegInfoUserList(hitRegInfoUser);
for (HitRegInfoUser regInfoUser : hitRegInfoUsers) {
switch (regInfoUser.getType()) {
case "3": {
HitRegistrationTeachInfo hitRegistrationTeachInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(regInfoUser.getUserId(),hitRegInfo.getYear());
HitRegistrationTeachInfo hitRegistrationTeachInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(regInfoUser.getUserId(), hitRegInfo.getYear());
regInfo.setLdTeacher(hitRegistrationTeachInfo);
break;
}
case "2": {
HitRegistrationTeachInfo hitRegistrationTeachInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(regInfoUser.getUserId(),hitRegInfo.getYear());
HitRegistrationTeachInfo hitRegistrationTeachInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(regInfoUser.getUserId(), hitRegInfo.getYear());
regInfo.getZdTeacher().add(hitRegistrationTeachInfo);
break;
}
case "1":
HitCompetitionStudentInfo studentInfo = hitCompetitionStudentInfoMapper.selectHitCompetitionStudentInfoByUserId(regInfoUser.getUserId(),hitRegInfo.getYear());
HitCompetitionStudentInfo studentInfo = hitCompetitionStudentInfoMapper.selectHitCompetitionStudentInfoByUserId(regInfoUser.getUserId(), hitRegInfo.getYear());
regInfo.getStudentUserss().add(studentInfo);
break;
}
}
}
return hitRegInfos;
return hitRegInfos;
}
/**
* 查询报名信息列表
*
@ -129,44 +136,43 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
* @return 报名信息
*/
@Override
public List<HitRegInfo> selectHitRegInfoListExport(HitRegInfo hitRegInfo)
{
public List<HitRegInfo> selectHitRegInfoListExport(HitRegInfo hitRegInfo) {
if (ObjectUtil.isEmpty(hitRegInfo.getYear())) {
//获取当前年
hitRegInfo.setYear(DateUtil.format(new Date(), "yyyy"));
}
Long userId = SecurityUtils.getLoginUser().getUserId();
//判断当前登陆人是否是领队老师如果是查询该老师学校下的战队
HitRegistrationTeachInfo teacherInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(userId,hitRegInfo.getYear());
HitRegistrationTeachInfo teacherInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(userId, hitRegInfo.getYear());
if (teacherInfo != null && teacherInfo.getType().equals("1")) {
hitRegInfo.setSchoolName(teacherInfo.getSchoolName());
}
List<HitRegInfo> hitRegInfos = hitRegInfoMapper.selectHitRegInfoList(hitRegInfo);
for (HitRegInfo regInfo : hitRegInfos) {
HitRegInfoUser hitRegInfoUser =new HitRegInfoUser();
HitRegInfoUser hitRegInfoUser = new HitRegInfoUser();
hitRegInfoUser.setRegId(regInfo.getId());
List<HitRegInfoUser> hitRegInfoUsers = regInfoUserService.selectHitRegInfoUserList(hitRegInfoUser);
for (HitRegInfoUser regInfoUser : hitRegInfoUsers) {
switch (regInfoUser.getType()) {
case "3": {
HitRegistrationTeachInfo hitRegistrationTeachInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(regInfoUser.getUserId(),hitRegInfo.getYear());
HitRegistrationTeachInfo hitRegistrationTeachInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(regInfoUser.getUserId(), hitRegInfo.getYear());
regInfo.setLdTeacher(hitRegistrationTeachInfo);
break;
}
case "2": {
HitRegistrationTeachInfo hitRegistrationTeachInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(regInfoUser.getUserId(),hitRegInfo.getYear());
HitRegistrationTeachInfo hitRegistrationTeachInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(regInfoUser.getUserId(), hitRegInfo.getYear());
regInfo.getZdTeacher().add(hitRegistrationTeachInfo);
break;
}
case "1":
HitCompetitionStudentInfo studentInfo = hitCompetitionStudentInfoMapper.selectHitCompetitionStudentInfoByUserId(regInfoUser.getUserId(),hitRegInfo.getYear());
HitCompetitionStudentInfo studentInfo = hitCompetitionStudentInfoMapper.selectHitCompetitionStudentInfoByUserId(regInfoUser.getUserId(), hitRegInfo.getYear());
regInfo.getStudentUserss().add(studentInfo);
break;
}
}
}
return hitRegInfos;
return hitRegInfos;
}
/**
@ -177,8 +183,7 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int insertHitRegInfo(HitRegInfo hitRegInfo)
{
public int insertHitRegInfo(HitRegInfo hitRegInfo) {
// hitRegInfo.setCreateTime(DateUtils.getNowDate());
// hitRegInfoMapper.insertHitRegInfo(hitRegInfo);
// for (HitCompetitionStudentInfo hitRegistrationStudentInfo : hitRegInfo.getStudentInfoList()) {
@ -202,8 +207,7 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
* @return 结果
*/
@Override
public int updateHitRegInfo(HitRegInfo hitRegInfo)
{
public int updateHitRegInfo(HitRegInfo hitRegInfo) {
hitRegInfo.setUpdateTime(DateUtils.getNowDate());
//获取当前年份
@ -216,11 +220,11 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
//查询数据库是否存在当前年份赛事
CmsContent contentDB = cmsContentMapper.selectCmsContentByContentTitle(contentTitle);
//查询赛事通过列表
LambdaQueryWrapper<HitRegInfo> queryWrapper =new LambdaQueryWrapper();
queryWrapper.eq(HitRegInfo::getAuditStatus,"1").likeRight(BaseEntity::getCreateTime,currentYear)
LambdaQueryWrapper<HitRegInfo> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(HitRegInfo::getAuditStatus, "1").likeRight(BaseEntity::getCreateTime, currentYear)
.orderByAsc(HitRegInfo::getDivision).orderByAsc(BaseEntity::getCreateTime);
List<HitRegInfo> hitRegInfos = hitRegInfoMapper.selectList(queryWrapper);
if ( contentDB == null) {
if (contentDB == null) {
CmsContent content = new CmsContent();
content.setCategoryId(1819701569722126336L);
content.setContentType("0");
@ -236,7 +240,7 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
CmsContent content = cmsContentMapper.selectCmsContentByContentTitle(contentTitle);
//内容头部
String contentHeader = "<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; text-align: center;\">\n" +
" <span style=\"box-sizing: border-box;font-size: 24px\"><span style=\"box-sizing: border-box;font-weight: bolder\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "+contentTitle+"</span></span>\n" +
" <span style=\"box-sizing: border-box;font-size: 24px\"><span style=\"box-sizing: border-box;font-weight: bolder\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; " + contentTitle + "</span></span>\n" +
"</p>\n" +
"<table width=\"1232\" style=\"width: 1185px; margin: 0px auto;\">\n" +
" <tbody style=\"box-sizing: border-box\">\n" +
@ -264,41 +268,41 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
" </tr>";
//内容尾部
String contentFooter = " </tbody>\n" +
"</table>" ;
"</table>";
//内容主体
String contentDetail = "";
for (HitRegInfo regInfo : hitRegInfos) {
contentDetail = contentDetail + "<tr style=\"box-sizing: border-box;height: 24px\" class=\"firstRow\">\n" +
" <td width=\"100\" style=\"box-sizing: border-box;border-style: solid;border-color: rgb(0, 112, 192);padding: 0px 7px\">\n" +
" <p style=\"box-sizing: border-box; text-align: center;\">\n" +
" <span style=\"box-sizing: border-box;font-size: 13px;font-family: 宋体\">"+regInfo.getDivision()+"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n" +
" </p>\n" +
" </td>\n" +
" <td width=\"100\" style=\"box-sizing: border-box;border-style: solid;border-color: rgb(0, 112, 192);padding: 0px 7px\">\n" +
" <p style=\"box-sizing: border-box; text-align: center;\">\n" +
" <span style=\"box-sizing: border-box;font-size: 13px;font-family: 宋体\">"+regInfo.getSchoolName()+"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n" +
" </p>\n" +
" </td>\n" +
" <td width=\"100\" style=\"box-sizing: border-box;border-style: solid;border-color: rgb(0, 112, 192);padding: 0px 7px\">\n" +
" <p style=\"box-sizing: border-box; text-align: center;\">\n" +
" <span style=\"box-sizing: border-box;font-size: 13px;font-family: 宋体\">"+regInfo.getCollegeName()+"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n" +
" </p>\n" +
" </td>\n" +
" <td width=\"100\" style=\"box-sizing: border-box;border-style: solid;border-color: rgb(0, 112, 192);padding: 0px 7px\">\n" +
" <p style=\"box-sizing: border-box; text-align: center;\">\n" +
" <span style=\"box-sizing: border-box;font-size: 13px;font-family: 宋体\">"+regInfo.getTeamName()+"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n" +
" </p>\n" +
" </td>\n" +
" </tr>";
contentDetail = contentDetail + "<tr style=\"box-sizing: border-box;height: 24px\" class=\"firstRow\">\n" +
" <td width=\"100\" style=\"box-sizing: border-box;border-style: solid;border-color: rgb(0, 112, 192);padding: 0px 7px\">\n" +
" <p style=\"box-sizing: border-box; text-align: center;\">\n" +
" <span style=\"box-sizing: border-box;font-size: 13px;font-family: 宋体\">" + regInfo.getDivision() + "</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n" +
" </p>\n" +
" </td>\n" +
" <td width=\"100\" style=\"box-sizing: border-box;border-style: solid;border-color: rgb(0, 112, 192);padding: 0px 7px\">\n" +
" <p style=\"box-sizing: border-box; text-align: center;\">\n" +
" <span style=\"box-sizing: border-box;font-size: 13px;font-family: 宋体\">" + regInfo.getSchoolName() + "</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n" +
" </p>\n" +
" </td>\n" +
" <td width=\"100\" style=\"box-sizing: border-box;border-style: solid;border-color: rgb(0, 112, 192);padding: 0px 7px\">\n" +
" <p style=\"box-sizing: border-box; text-align: center;\">\n" +
" <span style=\"box-sizing: border-box;font-size: 13px;font-family: 宋体\">" + regInfo.getCollegeName() + "</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n" +
" </p>\n" +
" </td>\n" +
" <td width=\"100\" style=\"box-sizing: border-box;border-style: solid;border-color: rgb(0, 112, 192);padding: 0px 7px\">\n" +
" <p style=\"box-sizing: border-box; text-align: center;\">\n" +
" <span style=\"box-sizing: border-box;font-size: 13px;font-family: 宋体\">" + regInfo.getTeamName() + "</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n" +
" </p>\n" +
" </td>\n" +
" </tr>";
}
content.setContentDetail(contentHeader + contentDetail + contentFooter);
insertCmsContent.updateCmsContent(content);
if (hitRegInfo.getAuditStatus().equals("2")){
if (hitRegInfo.getAuditStatus().equals("2")) {
//拒绝就要把信息删掉
regInfoUserService.deleteHitRegInfoUserByRegId(hitRegInfo.getId());
return hitRegInfoMapper.deleteHitRegInfoById(hitRegInfo.getId());
return hitRegInfoMapper.deleteHitRegInfoById(hitRegInfo.getId());
}else{
} else {
return hitRegInfoMapper.updateHitRegInfo(hitRegInfo);
}
@ -316,19 +320,19 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
* @return 结果
*/
@Override
public int deleteHitRegInfoByIds(Long[] ids)
{
public int deleteHitRegInfoByIds(Long[] ids) {
return hitRegInfoMapper.deleteHitRegInfoByIds(ids);
}
/**
* 创建报名信息
*
* @param teamName
* @param teamCreatorId
* @param teacherId
*/
@Override
public void createRegInfo(String teamName,Integer teamCreatorId,String teacherId,Long teamId) {
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());
@ -346,7 +350,7 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
Long hitRegInfoId = hitRegInfo.getId();
//创建报名信息后更新队员信息
updateTeamMembersInfo(teamId,hitRegInfoId);
updateTeamMembersInfo(teamId, hitRegInfoId);
}
@ -356,8 +360,8 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
SysUser user = SecurityUtils.getLoginUser().getUser();
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
HitRegInfo hitRegInfo = hitRegInfoMapper.selectHitByUserId(userId, status,String.valueOf(year));
if (ObjectUtils.isNotEmpty(hitRegInfo)){
HitRegInfo hitRegInfo = hitRegInfoMapper.selectHitByUserId(userId, status, String.valueOf(year));
if (ObjectUtils.isNotEmpty(hitRegInfo)) {
HitRegInfoUser hitRegInfoUser = new HitRegInfoUser();
hitRegInfoUser.setRegId(hitRegInfo.getId());
List<HitRegInfoUser> hitRegInfoUsers = regInfoUserService.selectHitRegInfoUserList(hitRegInfoUser);
@ -366,9 +370,9 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
return it.getType().equals("1");
}).collect(Collectors.toList());
for (HitRegInfoUser regInfoUser : collect) {
if (regInfoUser.getUserId().equals(user.getUserId())){
if (regInfoUser.getUserId().equals(user.getUserId())) {
regInfoUser.setIsOwn("1");
}else {
} else {
regInfoUser.setIsOwn("0");
}
}
@ -381,7 +385,7 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
public HitRegInfo selectHitByUserId2(Long userId) {
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
HitRegInfo hitRegInfo = hitRegInfoMapper.selectHitByUserId2(userId,String.valueOf(year));
HitRegInfo hitRegInfo = hitRegInfoMapper.selectHitByUserId2(userId, String.valueOf(year));
if (ObjectUtils.isNotEmpty(hitRegInfo)) {
HitRegInfoUser hitRegInfoUser = new HitRegInfoUser();
hitRegInfoUser.setRegId(hitRegInfo.getId());
@ -397,18 +401,18 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
//获取当前年
hitRegInfo.setYear(DateUtil.format(new Date(), "yyyy"));
}
Long userId = SecurityUtils.getLoginUser().getUserId();
//判断当前登陆人是否是领队老师如果是查询该老师学校下的战队
//查询当前学生所在的战队信息
HitRegInfoUser hitRegInfoUser1 = hitRegInfoUserMapper.selectOne(new LambdaQueryWrapper<HitRegInfoUser>()
.eq(HitRegInfoUser::getUserId, userId)
.last("limit 1"));
if (ObjectUtils.isEmpty(hitRegInfoUser1)) {
throw new RuntimeException("您并未参加战队");
}
if (ObjectUtil.isNotEmpty(hitRegInfoUser1.getType()) && !hitRegInfoUser1.getType().equals("1")) {
throw new RuntimeException("请由学生修改");
}
Long userId = SecurityUtils.getLoginUser().getUserId();
//判断当前登陆人是否是领队老师如果是查询该老师学校下的战队
//查询当前学生所在的战队信息
HitRegInfoUser hitRegInfoUser1 = hitRegInfoUserMapper.selectOne(new LambdaQueryWrapper<HitRegInfoUser>()
.eq(HitRegInfoUser::getUserId, userId)
.last("limit 1"));
if (ObjectUtils.isEmpty(hitRegInfoUser1)) {
throw new RuntimeException("您并未参加战队");
}
if (ObjectUtil.isNotEmpty(hitRegInfoUser1.getType()) && !hitRegInfoUser1.getType().equals("1")) {
throw new RuntimeException("请由学生修改");
}
// HitRegInfo hitRegInfo1 = hitRegInfoMapper.selectOne(new LambdaQueryWrapper<HitRegInfo>()
// .eq(HitRegInfo::getId, hitRegInfoUser1.getRegId())
@ -423,7 +427,7 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
List<HitRegInfo> hitRegInfos = hitRegInfoMapper.selectList(new LambdaQueryWrapper<HitRegInfo>()
.eq(HitRegInfo::getId, hitRegInfoUser1.getRegId()));
for (HitRegInfo regInfo : hitRegInfos) {
HitRegInfoUser hitRegInfoUser =new HitRegInfoUser();
HitRegInfoUser hitRegInfoUser = new HitRegInfoUser();
hitRegInfoUser.setRegId(regInfo.getId());
List<HitRegInfoUser> hitRegInfoUsers = regInfoUserService.selectHitRegInfoUserList(hitRegInfoUser);
for (HitRegInfoUser regInfoUser : hitRegInfoUsers) {
@ -446,29 +450,33 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
}
}
return hitRegInfos;
return hitRegInfos;
}
@Override
public int studentEdit(HitRegInfo hitRegInfo) {
HitRegInfo hitRegInfo1 = new HitRegInfo();
hitRegInfo1.setId(hitRegInfo.getId());
if (ObjectUtil.isNotEmpty(hitRegInfo.getCompetition())) {
hitRegInfo1.setCompetition(hitRegInfo.getCompetition());
//获取团队信息
HitRegInfo hitRegInfo1 = hitRegInfoMapper.selectOne(Wrappers.<HitRegInfo>lambdaQuery().eq(HitRegInfo::getId, hitRegInfo.getId()));
if (ObjectUtil.isNull(hitRegInfo1)) {
throw new RuntimeException("当前团队不存在");
}
if (ObjectUtil.isNotEmpty(hitRegInfo.getSampleNumber())) {
hitRegInfo1.setSampleNumber(hitRegInfo.getSampleNumber());
//判断创建时间距离现在是否超过七天
if (DateUtil.between(hitRegInfo1.getCreateTime(), new Date(), DateUnit.DAY) > 7) {
throw new RuntimeException("当前团队组队已超过七天,无法修改");
}
hitRegInfo1.setSampleAddress(hitRegInfo.getSampleAddress());
//判断hitRegInfo.getCompetition()是否包含1
if (!hitRegInfo.getCompetition().contains("1")) {
hitRegInfo1.setSampleAddress("");
hitRegInfo.setSampleAddress("");
}
if (ObjectUtil.isNotEmpty(hitRegInfo.getSampleConcat())) {
hitRegInfo1.setSampleConcat(hitRegInfo.getSampleConcat());
//如果手机号不为空校验手机号
if (!StringUtils.isEmpty(hitRegInfo.getSampleNumber())) {
if (!Validator.isMobile(hitRegInfo.getSampleNumber())) {
throw new RuntimeException("请输入正确的手机号");
}
}
int i = hitRegInfoMapper.updateById(hitRegInfo1);
hitRegInfo.setCreateTime(null);
hitRegInfo.setAuditStatus(null);
hitRegInfo.setCreateTime(new Date());
int i = hitRegInfoMapper.updateById(hitRegInfo);
return i;
}
@ -484,27 +492,107 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
return hitRegInfoMapper.updateById(hitRegInfo);
}
/**
* 导入个人成绩信息
*
* @param hitList
* @return
*/
@Override
public String importData(List<HitRegInfoUserImportVo> hitList) {
//获取当前时间
DateTime now = DateUtil.date();
//根据手机号查询用户id集合
List<String> mobileList = hitList.stream().map(HitRegInfoUserImportVo::getMobile).collect(Collectors.toList());
List<HitCompetitionStudentInfo> hitCompetitionStudentInfos = hitCompetitionStudentInfoMapper.selectList(Wrappers.<HitCompetitionStudentInfo>lambdaQuery()
.in(HitCompetitionStudentInfo::getPhoneNumber, mobileList)
.between(HitCompetitionStudentInfo::getCreateTime, DateUtil.beginOfYear(now), DateUtil.endOfYear(now)));
//根据手机号将userId赋值给hitList
// 创建一个手机号到userId的映射
Map<String, Long> mobileToUserIdMap = hitCompetitionStudentInfos.stream()
.collect(Collectors.toMap(
HitCompetitionStudentInfo::getPhoneNumber,
HitCompetitionStudentInfo::getUserId
));
// 根据手机号将userId赋值给hitList
hitList.forEach(hit -> {
Long userId = mobileToUserIdMap.get(hit.getMobile());
if (userId != null) {
hit.setUserId(userId);
}
});
//更新成绩
hitList.stream().forEach(item -> {
if (!StringUtils.isEmpty(item.getMobile())) {
try {
HitRegInfoUser hitRegInfoUser = BeanUtil.copyProperties(item, HitRegInfoUser.class);
hitRegInfoUserMapper.update(hitRegInfoUser, new LambdaUpdateWrapper<HitRegInfoUser>()
.eq(HitRegInfoUser::getUserId, item.getUserId())
.between(HitRegInfoUser::getCreateTime, DateUtil.beginOfYear(now), DateUtil.endOfYear(now)));
} catch (Exception e) {
log.error("更新学生信息失败phoneNumber: " + item.getMobile(), e);
}
}
});
return "导入完成";
}
/**
* 导入团队成绩信息
*
* @param hitList
* @return
*/
@Override
public String importTeamData(List<HitRegInfoTeamImportVo> hitList) {
if (CollUtil.isEmpty(hitList)) {
return "导入内容不能为空";
}
//获取当前时间
DateTime now = DateUtil.date();
hitList.stream().forEach(item -> {
if (!StringUtils.isEmpty(item.getTeamName())) {
try {
HitRegInfo hitRegInfo = BeanUtil.copyProperties(item, HitRegInfo.class);
hitRegInfoMapper.update(hitRegInfo, new LambdaUpdateWrapper<HitRegInfo>()
.eq(HitRegInfo::getTeamName, item.getTeamName())
.between(HitRegInfo::getCreateTime, DateUtil.beginOfYear(now), DateUtil.endOfYear(now)));
} catch (Exception e) {
log.error("更新学生信息失败teamName: " + item.getTeamName(), e);
}
}
});
return "导入完成";
}
/**
* 更新队员信息
*
* @param teamId
* @param hitRegInfoId
*/
private void updateTeamMembersInfo(Long teamId, Long hitRegInfoId){
private void updateTeamMembersInfo(Long teamId, Long hitRegInfoId) {
LambdaQueryWrapper<HitTeamMembers> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(HitTeamMembers::getTeamId,teamId);
queryWrapper.eq(HitTeamMembers::getTeamId, teamId);
List<HitTeamMembers> teamMembers = teamMembersMapper.selectList(queryWrapper);
for (HitTeamMembers teamMember : teamMembers) {
if (teamMember.getTeamResponsibilities()==0){
if (teamMember.getTeamResponsibilities() == 0) {
LambdaUpdateWrapper<HitCompetitionStudentInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(HitCompetitionStudentInfo::getId,teamMember.getTeamMemberId());
updateWrapper.set(HitCompetitionStudentInfo::getHitRegId,hitRegInfoId);
competitionStudentInfo.update(null,updateWrapper);
updateWrapper.eq(HitCompetitionStudentInfo::getId, teamMember.getTeamMemberId());
updateWrapper.set(HitCompetitionStudentInfo::getHitRegId, hitRegInfoId);
competitionStudentInfo.update(null, updateWrapper);
}
if (teamMember.getTeamResponsibilities()==1 || teamMember.getTeamResponsibilities()==2){
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);
updateWrapper.eq(HitRegistrationTeachInfo::getId, teamMember.getTeamMemberId());
updateWrapper.set(HitRegistrationTeachInfo::getHitRegId, hitRegInfoId);
teachInfoMapper.update(null, updateWrapper);
}
}
}

View File

@ -5,6 +5,8 @@ import java.util.List;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.cms.domain.HitRegInfo;
import com.ruoyi.cms.domain.HitRegInfoUser;
@ -163,8 +165,10 @@ public class HitRegInfoUserServiceImpl implements IHitRegInfoUserService
*/
@Override
public List<HitRegInfoUser> selectByUserId(Long id) {
DateTime now = DateUtil.date();
LambdaQueryWrapper<HitRegInfoUser> queryWrapper =new LambdaQueryWrapper<>();
queryWrapper.eq(HitRegInfoUser::getUserId,id);
queryWrapper.between(HitRegInfoUser::getCreateTime, DateUtil.beginOfYear(now), DateUtil.endOfYear(now));
return hitRegInfoUserMapper.selectList(queryWrapper);
}
}

View File

@ -240,6 +240,7 @@ public class HitRegistrationTeachInfoServiceImpl implements IHitRegistrationTeac
teachInfo.setRelatedAccounts(user.getUsername());
teachInfo.setStatus("0");
teachInfo.setType("1");
teachInfo.setFile(user.getHitRegistrationTeachInfo().getFile());
teachInfo.setTeacherName(user.getNickName());
teachInfo.setUserId(sysUser.getUserId());
this.insertHitRegistrationTeachInfo(teachInfo);

View File

@ -1,6 +1,10 @@
package com.ruoyi.cms.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.cms.domain.*;
import com.ruoyi.cms.mapper.HitCompetitionStudentInfoMapper;
import com.ruoyi.cms.mapper.HitRegInfoMapper;
@ -24,6 +28,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
/**
* <p>
@ -51,24 +56,34 @@ public class HitTeamsServiceImpl extends ServiceImpl<HitTeamsMapper, HitTeams> i
/**
* 初赛报名
*
* @param preliminary
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int preRegister(Preliminary preliminary) throws Exception {
public int preRegister(Preliminary preliminary) throws Exception {
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
DateTime now = DateUtil.date();
//查询当前团队名今年是否存在
List<HitRegInfo> hitRegInfos = hitRegInfoMapper.selectList(Wrappers.lambdaQuery(HitRegInfo.class)
.between(HitRegInfo::getCreateTime, DateUtil.beginOfYear(now), DateUtil.endOfYear(now)));
if (CollUtil.isNotEmpty(hitRegInfos)) {
throw new Exception("当前团队名已存在,请修改团队名");
}
//判断所选三个队员是否存在待确认
if (preliminary.getTeammateOne().equals(preliminary.getTeammateTwo())){
if (preliminary.getTeammateOne().equals(preliminary.getTeammateTwo())) {
throw new Exception("队员不可重复");
}
HitRegInfo hitRegInfo1 = regInfoService.selectHitByUserId2(preliminary.getTeammateOne());
if (ObjectUtils.isNotEmpty(hitRegInfo1)){
if (ObjectUtils.isNotEmpty(hitRegInfo1)) {
throw new Exception("队员1已存在组队信息不可重复组队");
}
HitRegInfo hitRegInfo2 = regInfoService.selectHitByUserId2(preliminary.getTeammateTwo());
if (ObjectUtils.isNotEmpty(hitRegInfo2)){
if (ObjectUtils.isNotEmpty(hitRegInfo2)) {
throw new Exception("队员2已存在组队信息不可重复组队");
}
//获取当前用户信息信息
@ -77,7 +92,7 @@ public class HitTeamsServiceImpl extends ServiceImpl<HitTeamsMapper, HitTeams> i
queryWrapper.eq(HitCompetitionStudentInfo::getUserId, user.getUserId());
queryWrapper.likeRight(HitCompetitionStudentInfo::getCreateTime, year);
HitCompetitionStudentInfo hitStu = hitCompetitionStudentInfoMapper.selectOne(queryWrapper);
HitRegInfo hitRegInfo =new HitRegInfo();
HitRegInfo hitRegInfo = new HitRegInfo();
hitRegInfo.setSchoolName(preliminary.getSchoolName());
hitRegInfo.setCollegeName(hitStu.getCollegeName());
hitRegInfo.setDivision(preliminary.getDivision());
@ -88,11 +103,11 @@ public class HitTeamsServiceImpl extends ServiceImpl<HitTeamsMapper, HitTeams> i
hitRegInfo.setUploadFile(preliminary.getUploadFile());
hitRegInfo.setAuditStatus("9");
hitRegInfo.setCreateTime(new Date());
log.info("插入数据:"+hitRegInfo);
log.info("插入数据:" + hitRegInfo);
hitRegInfo.setCompetition(preliminary.getCompetition());
int insert = hitRegInfoMapper.insert(hitRegInfo);
//插入人员信息
HitRegInfoUser hitRegInfoUser1 =new HitRegInfoUser();
HitRegInfoUser hitRegInfoUser1 = new HitRegInfoUser();
hitRegInfoUser1.setRegId(hitRegInfo.getId());
hitRegInfoUser1.setUserId(user.getUserId());
hitRegInfoUser1.setUserName(user.getNickName());
@ -102,7 +117,7 @@ public class HitTeamsServiceImpl extends ServiceImpl<HitTeamsMapper, HitTeams> i
regInfoUserMapper.insertHitRegInfoUser(hitRegInfoUser1);
//插入人员信息
HitRegInfoUser hitRegInfoUser2 =new HitRegInfoUser();
HitRegInfoUser hitRegInfoUser2 = new HitRegInfoUser();
hitRegInfoUser2.setRegId(hitRegInfo.getId());
hitRegInfoUser2.setUserId(preliminary.getTeammateOne());
SysUser sysUser = userService.selectUserById(preliminary.getTeammateOne());
@ -113,7 +128,7 @@ public class HitTeamsServiceImpl extends ServiceImpl<HitTeamsMapper, HitTeams> i
regInfoUserMapper.insertHitRegInfoUser(hitRegInfoUser2);
//插入人员信息
HitRegInfoUser hitRegInfoUser3 =new HitRegInfoUser();
HitRegInfoUser hitRegInfoUser3 = new HitRegInfoUser();
hitRegInfoUser3.setRegId(hitRegInfo.getId());
hitRegInfoUser3.setUserId(preliminary.getTeammateTwo());
SysUser sysUser1 = userService.selectUserById(preliminary.getTeammateTwo());
@ -123,7 +138,7 @@ public class HitTeamsServiceImpl extends ServiceImpl<HitTeamsMapper, HitTeams> i
hitRegInfoUser3.setCreateTime(new Date());
regInfoUserMapper.insertHitRegInfoUser(hitRegInfoUser3);
HitRegInfoUser hitRegInfoUser4 =new HitRegInfoUser();
HitRegInfoUser hitRegInfoUser4 = new HitRegInfoUser();
hitRegInfoUser4.setRegId(hitRegInfo.getId());
hitRegInfoUser4.setUserId(preliminary.getLeaderTeacher());
SysUser sysUser2 = userService.selectUserById(preliminary.getLeaderTeacher());
@ -133,7 +148,7 @@ public class HitTeamsServiceImpl extends ServiceImpl<HitTeamsMapper, HitTeams> i
hitRegInfoUser4.setCreateTime(new Date());
regInfoUserMapper.insertHitRegInfoUser(hitRegInfoUser4);
HitRegInfoUser hitRegInfoUser5 =new HitRegInfoUser();
HitRegInfoUser hitRegInfoUser5 = new HitRegInfoUser();
hitRegInfoUser5.setRegId(hitRegInfo.getId());
hitRegInfoUser5.setUserId(preliminary.getTeacherOne());
SysUser sysUser3 = userService.selectUserById(preliminary.getTeacherOne());
@ -142,8 +157,8 @@ public class HitTeamsServiceImpl extends ServiceImpl<HitTeamsMapper, HitTeams> i
hitRegInfoUser5.setStatus("0");
hitRegInfoUser5.setCreateTime(new Date());
regInfoUserMapper.insertHitRegInfoUser(hitRegInfoUser5);
if (ObjectUtils.isNotEmpty(preliminary.getTeacherTwo())){
HitRegInfoUser hitRegInfoUser6 =new HitRegInfoUser();
if (ObjectUtils.isNotEmpty(preliminary.getTeacherTwo())) {
HitRegInfoUser hitRegInfoUser6 = new HitRegInfoUser();
hitRegInfoUser6.setRegId(hitRegInfo.getId());
hitRegInfoUser6.setUserId(preliminary.getTeacherTwo());
SysUser sysUser4 = userService.selectUserById(preliminary.getTeacherTwo());

View File

@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.annotation.Anonymous;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -72,6 +74,7 @@ public class CommonController
/**
* 通用上传请求单个
*/
@Anonymous
@PostMapping("/upload")
public AjaxResult uploadFile(MultipartFile file) throws Exception
{

View File

@ -60,8 +60,15 @@
</select>
<select id="selectHitCompetitionStudentInfoByUserId"
resultType="com.ruoyi.cms.domain.HitCompetitionStudentInfo" >
select * from hit_competition_student_info
where user_id = #{userId} and create_time like concat(#{year},'%')
SELECT
hcsi.*,hu.virtual_score,hu.assay_score
FROM
hit_competition_student_info hcsi
LEFT JOIN hit_reg_info_user hu ON hu.user_id = hcsi.user_id
WHERE
hcsi.user_id = #{userId}
AND hcsi.create_time LIKE concat(#{year}, '%')
AND hu.create_time LIKE concat(#{year}, '%')
</select>
<insert id="insertHitCompetitionStudentInfo" parameterType="HitCompetitionStudentInfo" useGeneratedKeys="true" keyProperty="id">

View File

@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectHitRegInfoVo">
select id, school_name, college_name, division, team_name, sample_concat, sample_number,audit_status, sample_address, remark, upload_file,ds_file, del_flag, create_time, create_by, update_time, update_by,competition from hit_reg_info
select id, school_name, college_name, division, team_name, sample_concat, sample_number,audit_status, sample_address, remark, upload_file,ds_file,score, del_flag, create_time, create_by, update_time, update_by,competition from hit_reg_info
</sql>
<select id="selectHitRegInfoList" parameterType="HitRegInfo" resultMap="HitRegInfoResult">

View File

@ -92,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="division != null and division !='' ">division,</if>
<if test="relatedAccounts != null and relatedAccounts !='' ">related_accounts,</if>
<if test="userId != null ">user_id,</if>
<if test="file != null">file,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -114,6 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="division != null and division !='' ">#{division},</if>
<if test="relatedAccounts != null and relatedAccounts !='' ">#{relatedAccounts},</if>
<if test="userId != null">#{userId},</if>
<if test="file != null">#{file},</if>
</trim>
</insert>

View File

@ -74,6 +74,17 @@ public class HitRegistrationTeachInfo extends BaseEntity
@TableField(exist = false)
private String year;
public String getFile() {
return file;
}
public void setFile(String file) {
this.file = file;
}
/** 文件 */
private String file;
public String getSampleAddress() {
return SampleAddress;
}

View File

@ -105,3 +105,17 @@ export function editRegInfo(data){
})
}
export function editCompetitionStudentInfo(data) {
return request({
url: '/system/hit_stu_info/editInfo',
method: 'put',
data: data
})
}
export function updateRegInfo(data) {
return request({
url: '/system/hit_reg_info/studentEdit',
method: 'put',
data: data
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -2,30 +2,39 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="110px">
<el-form-item label="学校名称" prop="schoolName">
<el-input v-model="queryParams.schoolName" placeholder="请输入学校名称" clearable @keyup.enter.native="handleQuery" />
<el-input v-model="queryParams.schoolName" placeholder="请输入学校名称" clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="学院名称" prop="collegeName">
<el-input v-model="queryParams.collegeName" placeholder="请输入学院名称" clearable @keyup.enter.native="handleQuery" />
<el-input v-model="queryParams.collegeName" placeholder="请输入学院名称" clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属赛区" prop="division">
<el-input v-model="queryParams.division" placeholder="请输入所属赛区" clearable @keyup.enter.native="handleQuery" />
<el-input v-model="queryParams.division" placeholder="请输入所属赛区" clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="团队名称" prop="teamName">
<el-input v-model="queryParams.teamName" placeholder="请输入团队名称" clearable @keyup.enter.native="handleQuery" />
<el-input v-model="queryParams.teamName" placeholder="请输入团队名称" clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="年份" prop="year">
<el-date-picker
v-model="queryParams.year"
type="year"
placeholder="选择年份">
placeholder="选择年份"
>
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="大赛年份" prop="competitionYear">-->
<!-- <el-select v-model="queryParams.createTime" placeholder="请选择">-->
<!-- <el-option v-for="item in yearList" :key="item.value" :label="item.label" :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="大赛年份" prop="competitionYear">-->
<!-- <el-select v-model="queryParams.createTime" placeholder="请选择">-->
<!-- <el-option v-for="item in yearList" :key="item.value" :label="item.label" :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置刷新</el-button>
@ -33,6 +42,28 @@
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport('student')"
v-hasPermi="['hit:hitRegInfoUser:import']"
>导入学生成绩
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport('team')"
v-hasPermi="['hit:hitRegInfoTeam:import']"
>导入团队成绩
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
@ -41,18 +72,21 @@
size="mini"
@click="handleExport"
v-hasPermi="['hit:hitRegistrationStudentInfo:export']"
>导出</el-button>
>导出
</el-button>
</el-col>
<el-col :span="1.5" v-hasPermi="['hit:open']">
<el-col :span="1.5" v-hasPermi="['hit:open']">
<el-switch v-model="registerStatus" @change="updateRegisterStatus" active-value="1" inactive-value="0"
active-text="开启报名" inactive-text="关闭报名" >
active-text="开启报名" inactive-text="关闭报名"
>
</el-switch>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table style="width: 100%; table-layout: auto" v-loading="loading" :data="HitRegistrationStudentInfoList"
@selection-change="handleSelectionChange">
@selection-change="handleSelectionChange"
>
<el-table-column type="expand">
<template slot-scope="props">
@ -61,10 +95,14 @@
<el-descriptions-item label="老师职务">{{ props.row.ldTeacher.teacherJob }}</el-descriptions-item>
<el-descriptions-item label="老师手机号">{{ props.row.ldTeacher.teacherNumber }}</el-descriptions-item>
<el-descriptions-item label="老师邮箱">{{ props.row.ldTeacher.teacherEmail }}</el-descriptions-item>
<el-descriptions-item label="老师所在系及专业">{{ props.row.ldTeacher.teacherSchool }}</el-descriptions-item>
<el-descriptions-item label="老师所在系及专业">{{
props.row.ldTeacher.teacherSchool
}}
</el-descriptions-item>
</el-descriptions>
<el-descriptions :title="'指导老师' + (index)" v-for="(item, index) in props.row.zdTeacher"
style="margin-left: 10%">
style="margin-left: 10%"
>
<el-descriptions-item label="老师姓名">{{ item.teacherName }}</el-descriptions-item>
<el-descriptions-item label="老师职务">{{ item.teacherJob }}</el-descriptions-item>
<el-descriptions-item label="老师手机号">{{ item.teacherNumber }}</el-descriptions-item>
@ -72,12 +110,17 @@
<el-descriptions-item label="老师所在系及专业">{{ item.teacherSchool }}</el-descriptions-item>
</el-descriptions>
<el-descriptions :title="'学生信息' + (index + 1)" v-for="(item, index) in props.row.studentUserss"
style="margin-left: 10%">
style="margin-left: 10%"
>
<!-- <el-descriptions-item label="比赛名称">{{props.row.competitionName}}</el-descriptions-item>-->
<el-descriptions-item label="学生姓名">{{ item.stuName }}</el-descriptions-item>
<el-descriptions-item label="学生性别">{{ item.sex }}</el-descriptions-item>
<el-descriptions-item label="学生专业">{{ item.major }}</el-descriptions-item>
<el-descriptions-item label="学生手机号">{{ item.phoneNumber }}</el-descriptions-item>
<el-descriptions-item label="虚拟赛成绩"><span style="color:red;">{{ item.virtualScore }}</span>
</el-descriptions-item>
<el-descriptions-item label="化验赛成绩"><span style="color:red;">{{ item.assayScore }}</span>
</el-descriptions-item>
<el-descriptions-item label="附件" v-if="item.dsFile">
<el-link :href="`${baseUrl}${item.dsFile}`" type="primary" :underline="false" target="_blank">
<span class="el-icon-document"> 下载 </span>
@ -93,13 +136,14 @@
{{ props.row.createTime.substring(0, 4) }}
</template>
</el-table-column>
<el-table-column label="所属赛区" align="center" prop="division" />
<el-table-column label="学校名称" align="center" prop="schoolName" />
<el-table-column label="院系名称" align="center" prop="collegeName" />
<el-table-column label="团队名称" align="center" prop="teamName" />
<el-table-column label="盲样邮寄地址" align="center" prop="sampleAddress" />
<el-table-column label="收件人" align="center" prop="sampleConcat" />
<el-table-column label="联系电话" align="center" prop="sampleNumber" />
<el-table-column label="所属赛区" align="center" prop="division"/>
<el-table-column label="学校名称" align="center" prop="schoolName"/>
<el-table-column label="院系名称" align="center" prop="collegeName"/>
<el-table-column label="团队名称" align="center" prop="teamName"/>
<el-table-column label="盲样邮寄地址" align="center" prop="sampleAddress"/>
<el-table-column label="收件人" align="center" prop="sampleConcat"/>
<el-table-column label="联系电话" align="center" prop="sampleNumber"/>
<el-table-column label="分数" align="center" prop="score"/>
<el-table-column label="附件" align="center" prop="uploadFile">
<template slot-scope="props">
<el-link :href="`${baseUrl}${props.row.uploadFile}`" type="primary" :underline="false" target="_blank">
@ -113,15 +157,27 @@
</template>
</el-table-column>
<el-table-column label="审核状态" align="center" prop="auditStatus" >
<el-table-column label="审核状态" align="center" prop="auditStatus">
<template slot-scope="props">
<div v-if="props.row.auditStatus == '0' " style="color:#007bff;"> 待审核</div>
<div v-if="props.row.auditStatus == '1' " style="color:green;"> 通过</div>
<div v-if="props.row.auditStatus == '2' " style="color:red;"> 拒绝</div>
<div v-if="props.row.registrationInformation && props.row.registrationInformation.status == '0' && props.row.zdTeacherList.includes(userId) && techerType == '0' && props.row.auditStatus == '9'" style="color:#007bff;"> 待确认</div>
<div v-if="props.row.registrationInformation && props.row.registrationInformation.status == '1' && props.row.zdTeacherList.includes(userId) && techerType == '0' && props.row.auditStatus == '9'" style="color:green;"> 已同意</div>
<div v-if="props.row.registrationInformation && props.row.registrationInformation.status == '2' && props.row.zdTeacherList.includes(userId) && techerType == '0' && props.row.auditStatus == '9'" style="color:red;"> 已拒绝</div>
<!--&& props.row.zdTeacherList.includes(userId)-->
<div
v-if="props.row.registrationInformation && props.row.registrationInformation.status == '0' && props.row.zdTeacherList.includes(userId) && techerType == '0' && props.row.auditStatus == '9'"
style="color:#007bff;"
> 待确认
</div>
<div
v-if="props.row.registrationInformation && props.row.registrationInformation.status == '1' && props.row.zdTeacherList.includes(userId) && techerType == '0' && props.row.auditStatus == '9'"
style="color:green;"
> 已同意
</div>
<div
v-if="props.row.registrationInformation && props.row.registrationInformation.status == '2' && props.row.zdTeacherList.includes(userId) && techerType == '0' && props.row.auditStatus == '9'"
style="color:red;"
> 已拒绝
</div>
<!--&& props.row.zdTeacherList.includes(userId)-->
</template>
</el-table-column>
@ -136,13 +192,15 @@
<template slot-scope="scope">
<el-popconfirm title="确定当前操作?"
v-if="techerType != '0' && (scope.row.auditStatus == '0' || scope.row.auditStatus == '2')"
@confirm="auditData(scope.row, '1')">
@confirm="auditData(scope.row, '1')"
>
<el-button size="mini" type="text" slot="reference">通过</el-button>
</el-popconfirm>
<el-popconfirm title="确定当前操作?" style="margin-left: 10px"
v-if="techerType != '0' && (scope.row.auditStatus == '0' || scope.row.auditStatus == '1')"
@confirm="auditData(scope.row, '2')">
@confirm="auditData(scope.row, '2')"
>
<el-button size="mini" type="text" slot="reference">拒绝</el-button>
</el-popconfirm>
@ -150,14 +208,16 @@
<!---->
<el-popconfirm title="确定当前操作"
@confirm="submitData(scope.row.registrationInformation,1)"
v-if="techerType == '0' && (scope.row.zdTeacherList) && scope.row.zdTeacherList.includes(userId) && scope.row.auditStatus == '9'">
v-if="techerType == '0' && (scope.row.zdTeacherList) && scope.row.zdTeacherList.includes(userId) && scope.row.auditStatus == '9'"
>
<el-button size="mini" type="text" slot="reference">同意</el-button>
</el-popconfirm>
<!---->
<!---->
<el-popconfirm title="确定当前操作?" style="margin-left: 10px"
v-if="techerType == '0' && (scope.row.zdTeacherList ) && scope.row.zdTeacherList.includes(userId) && scope.row.auditStatus == '9'"
@confirm="submitData(scope.row.registrationInformation,2)">
@confirm="submitData(scope.row.registrationInformation,2)"
>
<el-button size="mini" type="text" slot="reference">拒绝</el-button>
</el-popconfirm>
@ -192,8 +252,8 @@
<el-form-item label="联系电话">
<el-input v-model="currentRow.sampleNumber"></el-input>
</el-form-item>
<el-form-item labe l="附件">
<FileUpload :file-type="['doc','zip', 'docx', 'pdf']" v-model="currentRow.uploadFile" ></FileUpload>
<el-form-item labe l="附件">
<FileUpload :file-type="['doc','zip', 'docx', 'pdf']" v-model="currentRow.uploadFile"></FileUpload>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@ -202,8 +262,43 @@
</span>
</el-dialog>
<!-- 用户导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport"/>
是否更新已经存在的用户数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
@click="importTemplate"
>下载模板
</el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
@pagination="getList"
/>
<!-- Existing pagination -->
</div>
</template>
@ -218,20 +313,21 @@ import {
listHitRegistrationStudentInfoExport,
getTeachInfoByIds,
adminUpdateTeamInformation
} from "@/api/hit/registrationStudentInfo";
} from '@/api/hit/registrationStudentInfo'
import { selectBaseInfo, editStatus } from '@/api/cms/baseInfo'
import { getHitRegistrationTeachInfoByUserId, selectByUserId } from '@/api/hit/teacherInfo'
import { editRegUser } from '@/api/officialWebsite/registerStudent'
import {mapState} from "vuex";
import { mapState } from 'vuex'
import { getToken } from '@/utils/auth'
export default {
name: "HitRegistrationStudentInfo",
name: 'HitRegistrationStudentInfo',
dicts: ['sys_user_sex', 'competition_type'],
data() {
return {
yearList: [],
baseUrl: process.env.VUE_APP_BASE_API,
registerStatus: "",
registerStatus: '',
leaderTeachList: [],
guideTeachList: [],
//
@ -253,7 +349,7 @@ export default {
//
HitRegistrationStudentInfoList: [],
//
title: "",
title: '',
//
open: false,
zdTeacherList: [],
@ -262,6 +358,21 @@ export default {
//
editDialogVisible: false,
currentRow: {},
upload: {
//
open: false,
//
title: '',
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: 'Bearer ' + getToken() },
//
url: process.env.VUE_APP_BASE_API + '/system/hit_reg_info/importData'
},
importType:"student",
//
queryParams: {
@ -286,38 +397,38 @@ export default {
//
rules: {
competitionId: [
{ required: true, message: "大赛ID不能为空", trigger: "blur" }
{ required: true, message: '大赛ID不能为空', trigger: 'blur' }
],
stuName: [
{ required: true, message: "学生姓名不能为空", trigger: "blur" }
{ required: true, message: '学生姓名不能为空', trigger: 'blur' }
],
stuGender: [
{ required: true, message: "学生性别不能为空", trigger: "blur" }
{ required: true, message: '学生性别不能为空', trigger: 'blur' }
],
stuMajor: [
{ required: true, message: "学生专业不能为空", trigger: "blur" }
{ required: true, message: '学生专业不能为空', trigger: 'blur' }
],
stuNumber: [
{ required: true, message: "学生手机号不能为空", trigger: "blur" }
{ required: true, message: '学生手机号不能为空', trigger: 'blur' }
],
schoolName: [
{ required: true, message: "学校及院系名称不能为空", trigger: "blur" }
{ required: true, message: '学校及院系名称不能为空', trigger: 'blur' }
],
division: [
{ required: true, message: "所属赛区不能为空", trigger: "blur" }
{ required: true, message: '所属赛区不能为空', trigger: 'blur' }
],
delFlag: [
{ required: true, message: "逻辑删除0未删除1真删除不能为空", trigger: "blur" }
],
{ required: true, message: '逻辑删除0未删除1真删除不能为空', trigger: 'blur' }
]
}
};
}
},
created() {
this.getList();
this.getList()
selectBaseInfo().then(res => {
this.registerStatus = res.data.registerStatus
})
this.yearList = this.years();
this.yearList = this.years()
// id
this.userId = this.$store.state.user.id
this.getTeachInfoByIds(this.userId)
@ -327,15 +438,15 @@ export default {
methods: {
/** 查询报名信息列表 */
getList() {
this.loading = true;
this.loading = true
this.queryParams.year = new Date(this.queryParams.year).getFullYear().toString()
listHitRegistrationStudentInfo(this.queryParams).then(response => {
this.HitRegistrationStudentInfoList = response.rows;
this.HitRegistrationStudentInfoList = response.rows
//
if (this.HitRegistrationStudentInfoList.length == 0) {
this.loading = false;
this.loading = false
}
console.log("报名信息", this.HitRegistrationStudentInfoList);
console.log('报名信息', this.HitRegistrationStudentInfoList)
//forthis.HitRegistrationStudentInfoList
if (this.HitRegistrationStudentInfoList.length != 0) {
for (let i = 0; i < this.HitRegistrationStudentInfoList.length; i++) {
@ -349,7 +460,7 @@ export default {
this.HitRegistrationStudentInfoList[i].registrationInformation = this.registrationInformation[j]
}
}
this.HitRegistrationStudentInfoList[i].competitionName = ""
this.HitRegistrationStudentInfoList[i].competitionName = ''
//this.HitRegistrationStudentInfoList[i].competition
if (this.HitRegistrationStudentInfoList[i].competition != null) {
@ -358,52 +469,95 @@ export default {
// arr
for (let k = 0; k < arr.length; k++) {
//
if (arr[k] == "1") {
if (arr[k] == '1') {
arr2.push('化验赛')
// this.HitRegistrationStudentInfoList[0].competitionName += ""
} else if (arr[k] == "2") {
} else if (arr[k] == '2') {
arr2.push('虚拟赛')
// this.HitRegistrationStudentInfoList[0].competitionName += ","
}
}
this.HitRegistrationStudentInfoList[i].competitionName = this.arrayToString(arr2);
this.HitRegistrationStudentInfoList[i].competitionName = this.arrayToString(arr2)
}
}
}
}
this.total = response.total;
this.loading = false;
});
this.total = response.total
this.loading = false
})
},
/** 导入按钮操作 */
handleImport(e) {
this.upload.title = '用户导入'
this.upload.open = true
if (e === 'team') {
//
this.upload.url = process.env.VUE_APP_BASE_API + '/system/hit_reg_info/importTeamData'
this.importType = 'team'
} else if (e === 'student') {
//
this.upload.url = process.env.VUE_APP_BASE_API + '/system/hit_reg_info/importData'
this.importType = 'student'
}
},
//
submitFileForm() {
this.$refs.upload.submit()
},
//
getTeachInfoByIds(id) {
getHitRegistrationTeachInfoByUserId(id).then(res => {
if (res.data) {
console.log('当前老师类型', res.data.type);
console.log('当前老师类型', res.data.type)
this.techerType = res.data.type
}
}).catch(err => {
console.log('查询当前老师的类型失败', err);
console.log('查询当前老师的类型失败', err)
})
this.fetchRegistrationInformation()
},
splitStringToArray(str) {
return str.split(',').map(item => item.trim());
return str.split(',').map(item => item.trim())
},
/** 下载模板操作 */
importTemplate() {
let url = 'system/hit_reg_info/importTemplate'
let filename = '学生成绩模板_'
if (this.importType === 'student') {
url = 'system/hit_reg_info/importTemplate'
filename = '学生成绩模板_'
} else if (this.importType === 'team') {
url = 'system/hit_reg_info/importTeamTemplate'
filename = '团队成绩模板_'
}
this.download(url, {}, filename + new Date().getTime() + '.xlsx')
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles()
this.$alert('<div style=\'overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;\'>' + response.msg + '</div>', '导入结果', { dangerouslyUseHTMLString: true })
this.getList()
},
//
arrayToString(arr) {
return arr.join(',');
return arr.join(',')
},
//
submitData(data,status) {
submitData(data, status) {
data.status = status
console.log("这是提交的信息", data)
editRegUser(data).then(res => {
this.$modal.msgSuccess("成功")
this.fetchRegistrationInformation()
console.log('这是提交的信息', data)
editRegUser(data).then(res => {
this.$modal.msgSuccess('成功')
this.fetchRegistrationInformation()
})
this.getList();
this.getList()
},
//
@ -411,14 +565,14 @@ export default {
selectByUserId(this.userId).then(res => {
if (res.data) {
this.registrationInformation = res.data
console.log("这是获取的信息", this.registrationInformation)
console.log('这是获取的信息', this.registrationInformation)
}
})
},
//
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
//
reset() {
@ -440,19 +594,19 @@ export default {
updateTime: null,
updateBy: null,
createTime: null
};
this.resetForm("form");
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.resetForm('queryForm')
this.queryParams.createTime = null
this.handleQuery();
this.handleQuery()
},
//
handleSelectionChange(selection) {
@ -462,57 +616,58 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加报名信息";
this.reset()
this.open = true
this.title = '添加报名信息'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
const id = row.id || this.ids
getHitRegistrationStudentInfo(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改报名信息";
});
this.form = response.data
this.open = true
this.title = '修改报名信息'
})
},
auditData(data, status) {
data.auditStatus = status
updateHitRegistrationStudentInfo(data).then(response => {
this.$modal.msgSuccess("成功");
this.$modal.msgSuccess('成功')
this.getList();
});
this.getList()
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateHitRegistrationStudentInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addHitRegistrationStudentInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除报名信息编号为"' + ids + '"的数据项?').then(function () {
return delHitRegistrationStudentInfo(ids);
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除报名信息编号为"' + ids + '"的数据项?').then(function() {
return delHitRegistrationStudentInfo(ids)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {
})
},
/** 导出按钮操作 */
handleExport() {
@ -535,40 +690,40 @@ export default {
updateRegisterStatus() {
editStatus(this.registerStatus).then(res => {
if (res.code === 200) {
this.$modal.msgSuccess(this.registerStatus === "1" ? "报名已开启" : "报名已关闭")
this.$modal.msgSuccess(this.registerStatus === '1' ? '报名已开启' : '报名已关闭')
}
})
},
years() {
const currentYear = new Date().getFullYear();
const startYear = currentYear - 40; // 20
const endYear = currentYear;
const years = [];
const currentYear = new Date().getFullYear()
const startYear = currentYear - 40 // 20
const endYear = currentYear
const years = []
for (let year = startYear; year <= endYear; year++) {
years.push({
label: year,
value: year + "-01-01",
});
value: year + '-01-01'
})
}
return years.sort((a, b) => b.label - a.label);
return years.sort((a, b) => b.label - a.label)
},
editData(row) {
this.currentRow = { ...row };
this.editDialogVisible = true;
this.currentRow = { ...row }
this.editDialogVisible = true
},
saveData() {
console.log('保存数据', this.currentRow);
console.log('保存数据', this.currentRow)
adminUpdateTeamInformation(this.currentRow).then(response => {
this.$modal.msgSuccess("团队信息修改成功");
this.editDialogVisible = false;
this.getList();
this.$modal.msgSuccess('团队信息修改成功')
this.editDialogVisible = false
this.getList()
}).catch(error => {
this.$modal.msgError("团队信息修改失败");
});
},
},
this.$modal.msgError('团队信息修改失败')
})
}
}
};
}
</script>

View File

@ -90,6 +90,13 @@
<div style="color:red" v-else>审核拒绝</div>
</template>
</el-table-column>
<el-table-column label="附件" align="center" prop="file" >
<template slot-scope="scope">
<el-link :href="`${baseUrl}${scope.row.file}`" type="primary" :underline="false" target="_blank" v-if="scope.row.file">
<span class="el-icon-document"> 下载 </span>
</el-link>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -171,6 +178,7 @@ export default {
multiple: true,
//
showSearch: true,
baseUrl: process.env.VUE_APP_BASE_API,
//
total: 0,
//

View File

@ -4,7 +4,7 @@
<!-- left -->
<div class="d-s" style="width: 20%" @click="toHome">
<div class="logo-box">
<img :src="baseInfo.webImg" />
<img :src="baseInfo.webImg"/>
</div>
<div class="logo-size">
{{ this.baseInfo.webName }}
@ -12,7 +12,9 @@
</div>
<!-- tab -->
<div class="d-s" style="width: 68%;justify-content: space-between">
<div class="x-x" :class="{'active' :tabindex == index }" v-for="(item, index) in tablist " :key="index" @click="tabClick(item.jumpUrl, item.id,index)" >
<div class="x-x" :class="{'active' :tabindex == index }" v-for="(item, index) in tablist " :key="index"
@click="tabClick(item.jumpUrl, item.id,index)"
>
<div>
<img v-if="item.iconUrl" :src=" imgurl +item.iconUrl " alt="" style="width: 25px;height: 25px">
</div>
@ -20,182 +22,207 @@
</div>
</div>
<!-- right -->
<!-- <div class="d-s" style="font-size: 20px; color: #fff;cursor: pointer;width: 170px;justify-content: flex-end">-->
<!-- <i class="el-icon-search" v-if="show_search"></i>-->
<!-- <div style="font-size: 18px; margin-left: 15px; " v-if="show_search" @click="show_search = !show_search">搜索-->
<!-- </div>-->
<!-- <el-input placeholder="输入关键词" v-model="input" style="width: 150px;height: 35px" v-if="!show_search">-->
<!-- <i slot="prefix" class="el-input__icon el-icon-search"></i>-->
<!-- </el-input>-->
<!-- <i class="el-icon-circle-close" v-if="!show_search" style="margin-left: 10px;"-->
<!-- @click="show_search = true"></i>-->
<!-- </div>-->
<!-- <div class="d-s" style="font-size: 20px; color: #fff;cursor: pointer;width: 170px;justify-content: flex-end">-->
<!-- <i class="el-icon-search" v-if="show_search"></i>-->
<!-- <div style="font-size: 18px; margin-left: 15px; " v-if="show_search" @click="show_search = !show_search">搜索-->
<!-- </div>-->
<!-- <el-input placeholder="输入关键词" v-model="input" style="width: 150px;height: 35px" v-if="!show_search">-->
<!-- <i slot="prefix" class="el-input__icon el-icon-search"></i>-->
<!-- </el-input>-->
<!-- <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="!isLoggedIn">
<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="isLoggedIn">
<el-dropdown @command="handleCommand">
<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="goBack" >进入后台</el-dropdown-item>
<el-dropdown-item command="logout" divided @click.native="logout" >退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="logout" divided @click.native="goBack">进入后台</el-dropdown-item>
<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>
<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="注册" :close-on-click-modal="false" :visible.sync="registerDialog" width="30%" :modal="false">
<el-dialog title="注册" :close-on-click-modal="false" :visible.sync="registerDialog" width="30%" :modal="false">
<div>
<el-form :model="registerForm" :rules="registerRules" ref="registerForm">
<el-form-item prop="userType">
<el-radio-group v-model="registerForm.userType">
<el-radio label="01">学生</el-radio>
<el-radio label="02">指导老师</el-radio>
<el-radio label="03">领队老师</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="nickName" >
<el-input placeholder="姓名" v-model="registerForm.nickName" type="text"></el-input>
</el-form-item>
<el-form-item prop="username">
<el-input placeholder="手机号(登录账号)" v-model="registerForm.username" type="text"></el-input>
</el-form-item>
<el-form :model="registerForm" :rules="registerRules" ref="registerForm">
<el-form-item prop="userType">
<el-radio-group v-model="registerForm.userType">
<el-radio label="01">学生</el-radio>
<el-radio label="02">指导老师</el-radio>
<el-radio label="03">领队老师</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="nickName">
<el-input placeholder="姓名" v-model="registerForm.nickName" type="text"></el-input>
</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="hitRegistrationTeachInfo.teacherEmail" v-if="registerForm.userType=='03'||registerForm.userType=='02'">
<el-input placeholder="邮箱" v-model="registerForm.hitRegistrationTeachInfo.teacherEmail" type="text"></el-input>
</el-form-item>
<!-- <el-form-item prop="hitRegistrationTeachInfo.teacherNumber" v-if="registerForm.userType=='03'||registerForm.userType=='02'">-->
<!-- <el-input placeholder="手机号" v-model="registerForm.hitRegistrationTeachInfo.teacherNumber" type="text"></el-input>-->
<!-- </el-form-item>-->
<el-form-item prop="hitRegistrationTeachInfo.division" v-if="registerForm.userType=='03'||registerForm.userType=='02'">
<el-select v-model="registerForm.hitRegistrationTeachInfo.division" filterable allow-create default-first-option
placeholder="请选择赛区">
<el-option v-for="item in dict.type.com_region" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="hitRegistrationTeachInfo.schoolName" v-if="registerForm.userType=='03'||registerForm.userType=='02'">
<el-select v-model="registerForm.hitRegistrationTeachInfo.schoolName" filterable allow-create default-first-option
placeholder="请选择学校名称">
<el-option v-for="item in dict.type.school_name" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
<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="hitRegistrationTeachInfo.teacherEmail"
v-if="registerForm.userType=='03'||registerForm.userType=='02'"
>
<el-input placeholder="邮箱" v-model="registerForm.hitRegistrationTeachInfo.teacherEmail" type="text"
></el-input>
</el-form-item>
<!-- <el-form-item prop="hitRegistrationTeachInfo.teacherNumber" v-if="registerForm.userType=='03'||registerForm.userType=='02'">-->
<!-- <el-input placeholder="手机号" v-model="registerForm.hitRegistrationTeachInfo.teacherNumber" type="text"></el-input>-->
<!-- </el-form-item>-->
<el-form-item prop="hitRegistrationTeachInfo.division"
v-if="registerForm.userType=='03'||registerForm.userType=='02'"
>
<el-select v-model="registerForm.hitRegistrationTeachInfo.division" filterable allow-create
default-first-option
placeholder="请选择赛区"
>
<el-option v-for="item in dict.type.com_region" :key="item.value" :label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="hitRegistrationTeachInfo.schoolName"
v-if="registerForm.userType=='03'||registerForm.userType=='02'"
>
<el-select v-model="registerForm.hitRegistrationTeachInfo.schoolName" filterable allow-create
default-first-option
placeholder="请选择学校名称"
>
<el-option v-for="item in dict.type.school_name" :key="item.value" :label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="hitRegistrationTeachInfo.teacherSchool" v-if="registerForm.userType=='03'||registerForm.userType=='02'">
<el-input placeholder="所在系及专业" v-model="registerForm.hitRegistrationTeachInfo.teacherSchool" type="text"></el-input>
</el-form-item>
<el-form-item prop="hitRegistrationTeachInfo.teacherJob" v-if="registerForm.userType=='03'||registerForm.userType=='02'">
<el-input placeholder="职务" v-model="registerForm.hitRegistrationTeachInfo.teacherJob" type="text"></el-input>
</el-form-item>
</el-form-item>
<el-form-item prop="hitRegistrationTeachInfo.teacherSchool"
v-if="registerForm.userType=='03'||registerForm.userType=='02'"
>
<el-input placeholder="所在系及专业" v-model="registerForm.hitRegistrationTeachInfo.teacherSchool"
type="text"
></el-input>
</el-form-item>
<el-form-item prop="hitRegistrationTeachInfo.teacherJob"
v-if="registerForm.userType=='03'||registerForm.userType=='02'"
>
<el-input placeholder="职务" v-model="registerForm.hitRegistrationTeachInfo.teacherJob" type="text"
></el-input>
</el-form-item>
<el-form-item label="批准盖章文件" prop="hitRegistrationTeachInfo.file" label-width="130px" v-if="registerForm.userType === '03'">
<image-upload :limit="1" v-model="registerForm.hitRegistrationTeachInfo.file"></image-upload>
</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-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>
</el-dialog>
</div>
</template>
<script>
import { getHomeUserInfo ,getTeacherAndStudentInfo} from "@/api/system/user";
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 { getCodeImg, register } from '@/api/login'
import Cookies from 'js-cookie'
import { encrypt, decrypt } from '@/utils/jsencrypt'
import { getToken } from "@/utils/auth";
import { getToken } from '@/utils/auth'
export default {
dicts: ["sys_user_sex", "school_name","com_region"],
dicts: ['sys_user_sex', 'school_name', 'com_region'],
data() {
const equalToPassword = (rule, value, callback) => {
if (this.registerForm.password !== value) {
callback(new Error("两次输入的密码不一致"));
callback(new Error('两次输入的密码不一致'))
} else {
callback();
callback()
}
};
}
return {
isLoggedIn: false, //
value: false,
currentUser: '', //
codeUrl: "", //
codeUrl: '', //
showLoginDialog: false, //
registerDialog: false, //
baseInfo:"",
baseInfo: '',
imgurl: process.env.VUE_APP_BASE_API,
input:'',
input: '',
show_search: true,
categoryQuery:{},
tabindex:0,
categoryQuery: {},
tabindex: 0,
tablist: [
{name: '首页'},
{name: '中心概括'},
{name: '教学资源'},
{name: '教学平台'},
{name: '教学团队'},
{name: '专业委员会'},
{name: '教学研讨活动'},
{name: '虚仿专业频道'},
{name: '大赛风采'},
{name: '实践平台'},
{name: '合作企业'},
{name: '联系我们'},
{ name: '首页' },
{ name: '中心概括' },
{ name: '教学资源' },
{ name: '教学平台' },
{ name: '教学团队' },
{ name: '专业委员会' },
{ name: '教学研讨活动' },
{ name: '虚仿专业频道' },
{ name: '大赛风采' },
{ name: '实践平台' },
{ name: '合作企业' },
{ name: '联系我们' }
],
loginForm: {
username: '',
@ -211,56 +238,61 @@ export default {
code: '',
confirmPassword: '',
uuid: '',
userType:'01',
hitRegistrationTeachInfo:{
teacherName: '',
teacherJob: '',
teacherEmail: '',
teacherNumber: '',
teacherSchool: '',
schoolName: '',
division: '',
SampleAddress: '',
userType: '01',
hitRegistrationTeachInfo: {
teacherName: '',
teacherJob: '',
teacherEmail: '',
teacherNumber: '',
teacherSchool: '',
schoolName: '',
division: '',
SampleAddress: '',
file:''
}
},
registerRules: {
username: [
{ required: true, trigger: "blur", message: "请输入您的账号" },
{ required: true, trigger: 'blur', message: '请输入您的账号' },
{ message: '学号不能为空', trigger: 'blur' }
],
nickName: [
{ required: true, trigger: "blur", message: "请输入您的姓名" },
{ 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" }
{ 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" }
{ required: true, trigger: 'blur', message: '请再次输入您的密码' },
{ required: true, validator: equalToPassword, trigger: 'blur' }
],
code: [{ required: true, trigger: "change", message: "请输入验证码" }],
code: [{ required: true, trigger: 'change', message: '请输入验证码' }],
'hitRegistrationTeachInfo.teacherEmail': [
{ required: true, trigger: "blur", message: "请输入您的邮箱" },
{ required: true, trigger: 'blur', message: '请输入您的邮箱' }
],
'hitRegistrationTeachInfo.teacherNumber': [
{ required: true, trigger: "blur", message: "请输入您的手机号" },
{ required: true, trigger: 'blur', message: '请输入您的手机号' }
],
'hitRegistrationTeachInfo.division': [
{ required: true, trigger: "blur", message: "请选择赛区" },
{ required: true, trigger: 'blur', message: '请选择赛区' }
],
'hitRegistrationTeachInfo.schoolName': [
{ required: true, trigger: "blur", message: "请选择学校名称" },
{ required: true, trigger: 'blur', message: '请选择学校名称' }
],
'hitRegistrationTeachInfo.teacherSchool': [
{ required: true, trigger: "blur", message: "请输入所在系及专业" },
{ required: true, trigger: 'blur', message: '请输入所在系及专业' }
],
'hitRegistrationTeachInfo.teacherJob': [
{ required: true, trigger: "blur", message: "请输入您的职务" },
{ required: true, trigger: 'blur', message: '请输入您的职务' }
],
'hitRegistrationTeachInfo.file': [
//
{ required: true, trigger: 'blur', message: '请上传您的批准盖章文件' }
]
}
}
},
@ -269,126 +301,128 @@ export default {
},
created() {
this.tabindex = this.msg
this.getCode();
this.getCookie(); //
this.isLoggedIn = getToken()?true:false; // localStorage
this.getCode()
this.getCookie() //
this.isLoggedIn = getToken() ? true : false // localStorage
if (this.isLoggedIn) {
this.loadUserInfo();
this.loadUserInfo()
}
},
mounted() {
this.tabindex = this.msg
// console.log(this.msg)
//
this.tabLsit();
this.getWebBaseInfo();
this.tabLsit()
this.getWebBaseInfo()
//
window.addEventListener('beforeunload', this.handleBeforeUnload);
window.addEventListener('beforeunload', this.handleBeforeUnload)
},
beforeDestroy() {
//
window.removeEventListener('beforeunload', this.handleBeforeUnload);
window.removeEventListener('beforeunload', this.handleBeforeUnload)
},
methods:{
methods: {
//
loadUserInfo() {
getHomeUserInfo().then(response => {
this.currentUser = response.data.userName;
console.log('当前用户名:', this.currentUser);
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;
this.userInfo.avatar = process.env.VUE_APP_BASE_API + this.userInfo.avatar
}
})
},
//
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
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;
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 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();
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) {
//
const phoneRegex = /^1[3-9]\d{9}$/;
const phoneRegex = /^1[3-9]\d{9}$/
if (!phoneRegex.test(this.registerForm.username)) {
this.$alert("<font color='red'>请输入有效的手机号。</font>", '系统提示', {
this.$alert('<font color=\'red\'>请输入有效的手机号。</font>', '系统提示', {
dangerouslyUseHTMLString: true,
type: 'error'
});
return;
})
return
}
if (this.registerForm.hitRegistrationTeachInfo){
this.registerForm.hitRegistrationTeachInfo.teacherNumber = this.registerForm.username;
if (this.registerForm.hitRegistrationTeachInfo) {
this.registerForm.hitRegistrationTeachInfo.teacherNumber = this.registerForm.username
}
this.loading = true;
this.loading = true
register(this.registerForm).then(res => {
const username = this.registerForm.username;
this.registerDialog = false;
this.$alert("<font color='red'>恭喜你,您的账号 " + username + " 注册成功!</font>", '系统提示', {
const username = this.registerForm.username
this.registerDialog = false
this.$alert('<font color=\'red\'>恭喜你,您的账号 ' + username + ' 注册成功!</font>', '系统提示', {
dangerouslyUseHTMLString: true,
type: 'success'
}).then(() => {
this.$router.push("/virtually");
}).catch(() => { });
this.$router.push('/virtually')
}).catch(() => {
})
}).catch(() => {
this.loading = false;
this.loading = false
if (this.captchaEnabled) {
this.getCode();
this.getCode()
}
});
})
}
});
})
},
//退
async logout() {
@ -398,32 +432,33 @@ export default {
type: 'warning'
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
localStorage.removeItem('isLoggedIn'); // localStorage
location.href = '/index';
localStorage.removeItem('isLoggedIn') // localStorage
location.href = '/index'
})
}).catch(() => {});
}).catch(() => {
})
},
goBack(){
this.$router.push("/index")
goBack() {
this.$router.push('/index')
},
//
handleBeforeUnload() {
//
handleBeforeUnload() {
// localStorageisLoggedIn
localStorage.removeItem('isLoggedIn');
localStorage.removeItem('isLoggedIn')
},
tabClick(url,id,index){
tabClick(url, id, index) {
this.tabindex = index
if (url === 'home') url = "gw";
this.$router.push({
name: url,
query:{ id: id }
});
if (url === 'home') url = 'gw'
this.$router.push({
name: url,
query: { id: id }
})
},
tabLsit() {
getTab().then(response => {
if (response.code == 200) {
this.tablist = response.data;
this.tablist = response.data
this.categoryQuery.categoryId = this.tablist[0].id
}
@ -435,9 +470,9 @@ export default {
this.baseInfo.webImg = process.env.VUE_APP_BASE_API + this.baseInfo.webImg
})
},
toHome(){
this.$router.push("/virtually")
},
toHome() {
this.$router.push('/virtually')
}
}
}
</script>
@ -483,12 +518,14 @@ export default {
align-items: center;
cursor: pointer;
}
.logo-box {
width: 50px;
height: 50px;
//background: #fff;
}
.logo-box img{
.logo-box img {
width: 50px;
height: 50px;
}
@ -500,6 +537,7 @@ export default {
margin-left: 20px;
}
.x-x {
cursor: pointer;
height: 90px;
@ -507,31 +545,38 @@ export default {
box-sizing: border-box;
padding-top: 25px;
}
.x-x:hover{
background: linear-gradient( 360deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
.x-x:hover {
background: linear-gradient(360deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
//border-bottom: 2px solid #fff;
}
.active{
background: linear-gradient( 360deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
.active {
background: linear-gradient(360deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
border-bottom: 2px solid #fff !important;
}
.bsize{
.bsize {
font-weight: 500;
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;
}

View File

@ -1,7 +1,7 @@
<template>
<div class="container" style="background: #f6f6f6">
<div class="top-box">
<headers :msg='msg'></headers>
<headers :msg="msg"></headers>
<div class="ny-banner">
<img src="../../assets/gw/dssj.png" alt="">
@ -16,7 +16,8 @@
<!-- </div>-->
<div class="right">
<div class="nav-item" v-for="(item, index) in nav" v-bind:class="[index === currentActive ? 'active' : '']"
@click="getCurrentActive(index)">
@click="getCurrentActive(index)"
>
{{ item.categoryName }}
</div>
</div>
@ -36,13 +37,15 @@
<div class="step-box-title">
<el-form label-width="80px" :model="signUpForm" :rules="rules" ref="form">
<el-form-item label="学号" prop="studentId">
<el-input v-model="signUpForm.studentId" ></el-input>
<el-input v-model="signUpForm.studentId"></el-input>
</el-form-item>
<el-form-item label="姓名" prop="stuName">
<el-input v-model="signUpForm.stuName"></el-input>
</el-form-item>
<el-form-item label="性别" prop="stuName">
<el-select v-model="signUpForm.sex" filterable allow-create default-first-option placeholder="请选择性别">
<el-select v-model="signUpForm.sex" filterable allow-create default-first-option
placeholder="请选择性别"
>
<el-option key="男" label="男" value="男">
</el-option>
<el-option key="女" label="女" value="女">
@ -51,17 +54,21 @@
</el-form-item>
<el-form-item label="所属赛区" prop="division">
<el-select v-model="signUpForm.division" filterable allow-create default-first-option
placeholder="请选择学校名称">
placeholder="请选择学校名称"
>
<el-option v-for="item in dict.type.com_region" :key="item.value" :label="item.label"
:value="item.value">
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="学校" label-width="80px" prop="schoolName">
<el-select v-model="signUpForm.schoolName" filterable allow-create default-first-option
placeholder="请选择学校名称">
placeholder="请选择学校名称"
>
<el-option v-for="item in dict.type.school_name" :key="item.value" :label="item.label"
:value="item.value">
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
@ -99,8 +106,10 @@
</div>
<!-- <div class="step-box-title" style="font-size: 20px;margin-top: 8%" v-if="signUpForm.trialsScore == null">成绩仅供参考最终选择由指导老师和领队老师做决定</div> -->
<div class="step-box-title" style="font-size: 20px;margin-top: 8%"
v-if="signUpForm.trialsScore != null && signUpForm.isPreliminary == false">
等待领队老师确认您的个人成绩为 : {{ signUpForm.trialsScore }}</div>
v-if="signUpForm.trialsScore != null && signUpForm.isPreliminary == false"
>
等待领队老师确认您的个人成绩为 : {{ signUpForm.trialsScore }}
</div>
<div style="position: absolute;left: 15%; top: 30%" v-if="signUpForm.trialsScore">
<div style="font-size: 24px">
个人选拔赛成绩
@ -132,7 +141,7 @@
</div>
<div class="d-s">
<el-form-item label="领队老师" prop="ldTeacherInfo.teacherName">
<el-input v-model="preliminaryForm.ldTeacherInfo.teacherName"></el-input>
<el-input v-model="preliminaryForm.ldTeacherInfo.teacherName" disabled></el-input>
</el-form-item>
<el-form-item label="团队名称" prop="teamName">
@ -143,14 +152,16 @@
<el-form-item label="队员1" prop="teammateOne">
<el-select v-model="preliminaryForm.teammateOne" placeholder="第一个队友">
<el-option v-for="item in preliminaryForm.tdStudentList" :key="item.userId" :label="item.stuName"
:value="item.userId">
:value="item.userId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="队员2" prop="teammateTwo">
<el-select v-model="preliminaryForm.teammateTwo" placeholder="第二个队友">
<el-option v-for="item in preliminaryForm.tdStudentList" :key="item.userId" :label="item.stuName"
:value="item.userId">
:value="item.userId"
>
</el-option>
</el-select>
</el-form-item>
@ -160,14 +171,16 @@
<el-form-item label="指导老师1" prop="teacherOne">
<el-select v-model="preliminaryForm.teacherOne" placeholder="指导老师1">
<el-option v-for="item in preliminaryForm.zdTeacherList" :key="item.userId"
:label="item.teacherName" :value="item.userId">
:label="item.teacherName" :value="item.userId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="指导老师2" prop="teacherTwo">
<el-select v-model="preliminaryForm.teacherTwo" placeholder="指导老师2">
<el-option v-for="item in preliminaryForm.zdTeacherList" :key="item.userId"
:label="item.teacherName" :value="item.userId">
:label="item.teacherName" :value="item.userId"
>
</el-option>
</el-select>
</el-form-item>
@ -181,7 +194,9 @@
</el-form-item>
</div>
<el-form-item v-if="preliminaryForm.competition.includes('1')" label="盲样邮寄地址" prop="sampleAddress">
<el-form-item v-if="preliminaryForm.competition.includes('1')" label="盲样邮寄地址"
prop="sampleAddress"
>
<el-input v-model="preliminaryForm.sampleAddress"></el-input>
</el-form-item>
<el-form-item label="附件(纸质报名表盖章)" prop="uploadFile" label-width="180px">
@ -199,11 +214,23 @@
<el-descriptions class="margin-top" title="团队信息" border>
<el-descriptions-item label="赛区">{{ preliminaryForm.divisionLabel }}</el-descriptions-item>
<el-descriptions-item label="学校">{{ preliminaryForm.hitRegInfo.schoolName }}</el-descriptions-item>
<el-descriptions-item label="领队老师">{{ preliminaryForm.ldTeacherInfo.teacherName }}</el-descriptions-item>
<el-descriptions-item label="领队老师">{{
preliminaryForm.ldTeacherInfo.teacherName
}}
</el-descriptions-item>
<el-descriptions-item label="指导老师">{{ preliminaryForm.zdTeacherStr }}</el-descriptions-item>
<el-descriptions-item label="样品联系人">{{ preliminaryForm.hitRegInfo.sampleConcat }}</el-descriptions-item>
<el-descriptions-item label="联系人手机号">{{ preliminaryForm.hitRegInfo.sampleNumber }}</el-descriptions-item>
<el-descriptions-item label="样品邮寄地址">{{ preliminaryForm.hitRegInfo.sampleAddress }}</el-descriptions-item>
<el-descriptions-item label="样品联系人">{{
preliminaryForm.hitRegInfo.sampleConcat
}}
</el-descriptions-item>
<el-descriptions-item label="联系人手机号">{{
preliminaryForm.hitRegInfo.sampleNumber
}}
</el-descriptions-item>
<el-descriptions-item label="样品邮寄地址">{{
preliminaryForm.hitRegInfo.sampleAddress
}}
</el-descriptions-item>
</el-descriptions>
<el-table :data="preliminaryForm.hitRegInfo.studentUser" border style="width: 100%">
@ -220,9 +247,13 @@
<template slot-scope="scope">
<div v-if="scope.row.isOwn == '1'">
<el-button size="mini" type="text" icon="el-icon-check"
@click="regChoose(scope.row, 1)">同意</el-button>
@click="regChoose(scope.row, 1)"
>同意
</el-button>
<el-button size="mini" type="text" icon="el-icon-close"
@click="regChoose(scope.row, 2)">拒绝</el-button>
@click="regChoose(scope.row, 2)"
>拒绝
</el-button>
</div>
</template>
@ -232,20 +263,151 @@
</div>
</div>
<div class="step-box" v-if="active == 3">
<div class="step-box-title" style="font-size: 20px;margin-top: 8%">地区选拔赛报名提交成功请通过大赛通知获取通过信息</div>
<div class="step-box-title" style="font-size: 20px;margin-top: 8%">
地区选拔赛报名提交成功请通过大赛通知获取通过信息
</div>
</div>
</div>
<div class="step-box" v-if="active == 4">
<div class="step-box-title" style="font-size: 18px;margin-top: 8%;color: red">地区选拔赛前无需上传资料</div>
<file-upload style="margin-top: 5%" :fileSize="200" :fileType="['zip', 'rar', '7z']"
v-model="preliminaryForm.hitRegInfo.dsFile"></file-upload>
v-model="preliminaryForm.hitRegInfo.dsFile"
></file-upload>
<div>
<el-button style="margin-top: 8%" type="primary" @click="fileSubmit">提交</el-button>
</div>
</div>
</div>
<!-- 成绩查询 -->
<div class="tabber-box" v-if="currentActive == 7">
<el-tabs v-model="activeTab">
<el-tab-pane label="成绩" name="scores">
<h3>个人选拔赛成绩</h3>
<p style="color: red">{{ studentForm.trialsScore }}</p>
<h3 v-if="studentForm.virtualScore">虚拟赛成绩</h3>
<p style="color: red" v-if="studentForm.virtualScore">{{ studentForm.virtualScore }}</p>
<h3 v-if="studentForm.assayScore">化验赛成绩</h3>
<p style="color: red" v-if="studentForm.assayScore">{{ studentForm.assayScore }}</p>
<h3 v-if="studentForm.teameScore">团队成绩</h3>
<p style="color: red" v-if="studentForm.teameScore">{{ studentForm.teameScore }}</p>
</el-tab-pane>
<el-tab-pane label="个人信息" name="edit-student">
<el-form :model="studentForm" label-width="80px" :rules="rules">
<h3>修改学生信息</h3>
<el-form-item label="学号" prop="studentId">
<el-input v-model="studentForm.studentId"></el-input>
</el-form-item>
<el-form-item label="姓名" prop="stuName">
<el-input v-model="studentForm.stuName"></el-input>
</el-form-item>
<el-form-item label="性别" prop="stuName">
<el-select v-model="studentForm.sex" filterable allow-create default-first-option
placeholder="请选择性别"
>
<el-option key="男" label="男" value="男">
</el-option>
<el-option key="女" label="女" value="女">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属赛区" prop="division">
<el-select v-model="studentForm.division" filterable allow-create default-first-option
placeholder="请选择学校名称"
>
<el-option v-for="item in dict.type.com_region" :key="item.value" :label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="学校" label-width="80px" prop="schoolName">
<el-select v-model="studentForm.schoolName" filterable allow-create default-first-option
placeholder="请选择学校名称"
>
<el-option v-for="item in dict.type.school_name" :key="item.value" :label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="院系名称" prop="collegeName">
<el-input v-model="studentForm.collegeName"></el-input>
</el-form-item>
<el-form-item label="专业名称" prop="major">
<el-input v-model="studentForm.major"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="phoneNumber">
<el-input v-model="studentForm.phoneNumber">
</el-input>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="studentForm.email"></el-input>
</el-form-item>
<el-form-item label="学生证/学生卡" prop="studentIdCard" label-width="130px">
<image-upload :limit="1" v-model="studentForm.studentIdCard"></image-upload>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="editStudentInfo">修改</el-button>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="团队信息" name="edit-team" v-if="teamForm">
<el-form :model="teamForm" label-width="80px" :rules="preliminaryFormRules">
<h3>修改团队信息</h3>
<el-form-item label="团队名称">
<el-input v-model="teamForm.teamName"></el-input>
</el-form-item>
<el-form-item label="所属赛区" prop="division">
<el-select v-model="teamForm.division" filterable allow-create default-first-option
placeholder="请选择学校名称"
>
<el-option v-for="item in dict.type.com_region" :key="item.value" :label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="学校" label-width="80px" prop="schoolName">
<el-select v-model="teamForm.schoolName" filterable allow-create default-first-option
placeholder="请选择学校名称"
>
<el-option v-for="item in dict.type.school_name" :key="item.value" :label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="赛事" prop="competition">
<el-checkbox-group v-model="teamForm.competition">
<el-checkbox label="1">化验赛</el-checkbox>
<el-checkbox label="2">虚拟赛</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="盲样联系人" prop="sampleConcat">
<el-input v-model="teamForm.sampleConcat"></el-input>
</el-form-item>
<el-form-item label="盲样联系人手机号" prop="sampleNumber">
<el-input v-model="teamForm.sampleNumber"></el-input>
</el-form-item>
<el-form-item v-if="teamForm.competition && teamForm.competition.includes('1')" label="盲样邮寄地址"
prop="sampleAddress"
>
<el-input v-model="teamForm.sampleAddress"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="updateTeamInfo">修改</el-button>
</el-form-item>
</el-form>
</el-tab-pane>
</el-tabs>
</div>
<!-- main -->
<div v-show="currentActive == 0 || currentActive == 1" v-html="pageContext"></div>
@ -270,10 +432,13 @@
</div>
<div v-show="currentActive == 2 || currentActive == 4 || currentActive === 3 || currentActive == 5">
<page-util :category-id="categoryId" @event-message="handleDataFromPage" />
<page-util :category-id="categoryId" @event-message="handleDataFromPage"/>
</div>
<div class="anniu" v-show="registerStatus == 1 && currentActive == 0" @click="toRegister">
<img src="../../assets/images/bhuaa.png" style="width: 140px;height: 88px">
<div class="anniu" v-show=" registerStatus == 1 &&currentActive == 0" @click="toRegister">
<img src="../../assets/images/bhuaa.png" style="width:140px;height: 88px">
</div>
<div class="anniu2" v-show="registerStatus == 1 && currentActive == 0 && studentForm.signUp" @click="toQuery">
<img src="../../assets/images/cha_kan_geng_duo.png" style="width: 140px;height: 58px">
</div>
</div>
@ -283,10 +448,10 @@
</template>
<script>
import { getHomeUserInfo } from "@/api/system/user";
import { Swiper, SwiperSlide } from "vue-awesome-swiper";
import "swiper/css/swiper.min.css";
import { getPageData, getCategoryByParentId, getbaseInfo } from "@/api/officialWebsite/getPageData";
import { getHomeUserInfo } from '@/api/system/user'
import { Swiper, SwiperSlide } from 'vue-awesome-swiper'
import 'swiper/css/swiper.min.css'
import { getPageData, getCategoryByParentId, getbaseInfo } from '@/api/officialWebsite/getPageData'
import footers from '@/views/officialWebsite/Components/footer.vue'
import headers from '@/views/officialWebsite/Components/header.vue'
import PageUtil from '@/views/officialWebsite/Components/page'
@ -300,161 +465,172 @@ import {
getTeamMate,
agreeTeam,
refuseTeam,
editRegInfo
editRegInfo, editCompetitionStudentInfo, updateRegInfo
} from '@/api/officialWebsite/registerStudent'
import { getTab, getbanner } from '@/api/gw/home'
import { getToken } from "@/utils/auth";
import { getToken } from '@/utils/auth'
export default {
components: {
headers,
footers,
Swiper,
SwiperSlide,
"page-util": PageUtil
'page-util': PageUtil
},
dicts: ["sys_user_sex", "school_name", "com_region"],
dicts: ['sys_user_sex', 'school_name', 'com_region'],
name: 'HelloWorld',
data() {
return {
currentUser: "",
currentUser: '',
// tab
activeTab: 'scores',
active: 0,//tab
msg: 8,
registerStatus: 0,
imgurl: process.env.VUE_APP_BASE_API,
//
studentForm: {},
//
teamForm: {
competition: []
},
//
signUpForm: {
stuName: "",
schoolName: "",
division: "",
collegeName: "",
phoneNumber: "",
email: "",
studentId: "",
major: "",
hitRegId: "",
trialsScore: "",
isPreliminary: "",
stuName: '',
schoolName: '',
division: '',
collegeName: '',
phoneNumber: '',
email: '',
studentId: '',
major: '',
hitRegId: '',
trialsScore: '',
isPreliminary: ''
},
//
preliminaryForm: {
teamName: "",
division: "",
schoolName: "",
teammateOne: "",
teammateTwo: "",
leaderTeacher: "",
teacherOne: "",
teacherTwo: "",
competition: [],
teamName: '',
division: '',
schoolName: '',
teammateOne: '',
teammateTwo: '',
leaderTeacher: '',
teacherOne: '',
teacherTwo: '',
competition: []
},
//
teammateInfo: {
teamId: "",
teamName: "",
teamMateId: "",
isAgreeWith: "",
teamId: '',
teamName: '',
teamMateId: '',
isAgreeWith: ''
},
teammateList: [], //
teacherList: [], //
rules: {
stuName: [
{ required: true, message: "姓名不能为空", trigger: "blur" }
{ required: true, message: '姓名不能为空', trigger: 'blur' }
],
schoolName: [
{ required: true, message: "学校名称不能为空", trigger: "blur" }
{ required: true, message: '学校名称不能为空', trigger: 'blur' }
],
studentId: [
{ required: true, message: "学号不能为空", trigger: "blur" }
{ required: true, message: '学号不能为空', trigger: 'blur' }
],
collegeName: [
{ required: true, message: "院系名称不能为空", trigger: "blur" }
{ required: true, message: '院系名称不能为空', trigger: 'blur' }
],
division: [
{ required: true, message: "所属赛区不能为空", trigger: "blur" }
{ required: true, message: '所属赛区不能为空', trigger: 'blur' }
],
major: [
{ required: true, message: "专业名称不能为空", trigger: "blur" }
{ required: true, message: '专业名称不能为空', trigger: 'blur' }
],
studentIdCard: [
{ required: true, message: "学生证/学生卡不能为空", trigger: "blur" }
{ required: true, message: '学生证/学生卡不能为空', trigger: 'blur' }
],
phoneNumber: [
{ required: true, message: "手机号不能为空", trigger: "blur" }
{ required: true, message: '手机号不能为空', trigger: 'blur' },
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' }
],
email: [
{ required: true, message: "邮箱不能为空", trigger: "blur" }
{ required: true, message: '邮箱不能为空', trigger: 'blur' }
],
competition: [
{ required: true, message: "赛事不能为空", trigger: "blur" }
{ required: true, message: '赛事不能为空', trigger: 'blur' }
]
},
preliminaryFormRules: {
divisionLabel: [
{ required: true, message: "不能为空", trigger: "blur" }
{ required: true, message: '不能为空', trigger: 'blur' }
],
schoolName: [
{ required: true, message: "不能为空", trigger: "blur" }
{ required: true, message: '不能为空', trigger: 'blur' }
],
'ldTeacherInfo.teacherName': [
{ required: true, message: "不能为空", trigger: "blur" }
{ required: true, message: '不能为空', trigger: 'blur' }
],
teamName: [
{ required: true, message: "不能为空", trigger: "blur" }
{ required: true, message: '不能为空', trigger: 'blur' }
],
teammateOne: [
{ required: true, message: "不能为空", trigger: "blur" }
{ required: true, message: '不能为空', trigger: 'blur' }
],
teammateTwo: [
{ required: true, message: "不能为空", trigger: "blur" }
{ required: true, message: '不能为空', trigger: 'blur' }
],
teacherOne: [
{ required: true, message: "不能为空", trigger: "blur" }
{ required: true, message: '不能为空', trigger: 'blur' }
],
// teacherTwo: [
// { required: true, message: "", trigger: "blur" }
// ],
sampleConcat: [
{ required: true, message: "不能为空", trigger: "blur" }
{ required: true, message: '不能为空', trigger: 'blur' }
],
sampleNumber: [
{ required: true, message: "不能为空", trigger: "blur" }
//
{ required: true, message: '不能为空', trigger: 'blur' },
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' }
],
sampleAddress: [
{ required: true, message: "不能为空", trigger: "blur" }
{ required: true, message: '不能为空', trigger: 'blur' }
],
uploadFile: [
{ required: true, message: "不能为空", trigger: "blur" }
],
{ required: true, message: '不能为空', trigger: 'blur' }
]
},
pageContext: '',
nav: [
],
nav: [],
currentActive: 0,
isMounted: false,
input4: "",
categoryId: "",
input4: '',
categoryId: '',
noticeList: [],
routeParam: {
"categoryId": this.$route.query.id,
"pageNum": 1,
"pageSize": 10
'categoryId': this.$route.query.id,
'pageNum': 1,
'pageSize': 10
},
otherList: [],
otherList: []
}
},
mounted() {
console.log('组件创建');
console.log('组件创建')
//
this.initPageData();
},
computed: {
this.initPageData()
},
computed: {},
created() {
console.log('组件创建');
this.loadUserInfo();
console.log('组件创建')
this.loadUserInfo()
},
methods: {
@ -462,27 +638,27 @@ export default {
data.status = status
console.log(data)
editRegUser(data).then(res => {
this.$modal.msgSuccess("成功")
this.$modal.msgSuccess('成功')
this.fetchRegistrationInformation()
})
},
fileSubmit() {
editRegInfo(this.preliminaryForm.hitRegInfo).then(res => {
this.$modal.msgSuccess("成功")
this.$modal.msgSuccess('成功')
this.fetchRegistrationInformation()
})
},
//
arrayToString(arr) {
console.log("执行了")
return arr.join(',');
console.log('执行了')
return arr.join(',')
},
//
loadUserInfo() {
if (getToken()) {
getHomeUserInfo().then(response => {
// this.signUpForm.studentId = response.data.userName;
this.preliminaryForm = response.data;
this.preliminaryForm = response.data
this.fetchRegistrationInformation()
})
@ -493,54 +669,58 @@ export default {
fetchRegistrationInformation() {
getStudentInfoByStuId(this.signUpForm.studentId)
.then(response => {
this.preliminaryForm = response.data;
this.preliminaryForm.competition = ["1"]
this.preliminaryForm = response.data
this.preliminaryForm.competition = ['1']
this.teamForm.competition = ['1']
this.updateSignUpForm(response.data);
this.updateSignUpForm(response.data)
this.studentForm = response.data
this.teamForm = response.data.hitRegInfo
if (this.teamForm) {
//
this.teamForm.competition = this.teamForm.competition.split(',')
}
console.log('报名信息:', this.signUpForm);
console.log('报名信息:', this.signUpForm)
})
},
updateSignUpForm(data) {
this.preliminaryForm.division = data.division;
this.preliminaryForm.divisionLabel = data.divisionLabel;
this.preliminaryForm.ldTeacherInfo = data.ldTeacherInfo;
this.preliminaryForm.division = data.division
this.preliminaryForm.divisionLabel = data.divisionLabel
this.preliminaryForm.ldTeacherInfo = data.ldTeacherInfo
if (data.ldTeacherInfo) {
this.preliminaryForm.leaderTeacher = data.ldTeacherInfo.userId;
this.preliminaryForm.leaderTeacher = data.ldTeacherInfo.userId
} else {
this.preliminaryForm.ldTeacherInfo = {}
}
this.preliminaryForm.schoolName = data.schoolName;
this.preliminaryForm.zdTeacherList = data.zdTeacherList;
this.preliminaryForm.tdStudentList = data.tdStudentList;
this.preliminaryForm.zdTeacherStr = data.zdTeacherStr;
this.active = 1;
this.preliminaryForm.schoolName = data.schoolName
this.preliminaryForm.zdTeacherList = data.zdTeacherList
this.preliminaryForm.tdStudentList = data.tdStudentList
this.preliminaryForm.zdTeacherStr = data.zdTeacherStr
this.active = 1
if (data.zdStatus == '0') {
this.active = 3;
this.active = 3
this.preliminaryForm.hitRegInfo = data.hitRegInfo
}
else if (data.zdStatus == '1') {
this.active = 4;
} else if (data.zdStatus == '1') {
this.active = 4
this.preliminaryForm.hitRegInfo = data.hitRegInfo
if (data.hitRegInfo.dsFile) {
this.active = 5;
this.active = 5
}
} else if (data.zdStatus == '9') {
this.active = 2;
this.active = 2
this.preliminaryForm.hitRegInfo = data.hitRegInfo
} else if (data.id == null) {
this.active = 0;
this.active = 0
} else {
this.signUpForm = data;
this.signUpForm = data
}
console.log(data, 433, this.preliminaryForm)
},
//
getCurrentActive(value) {
if (this.currentActive == value) {
@ -548,14 +728,14 @@ export default {
}
this.currentActive = value
this.categoryId = ""
this.categoryId = ''
if (value === 0 || value === 1) {
this.pageContext = ""
this.pageContext = ''
this.getContentDetail()
} else {
this.otherList = []
this.categoryId = this.nav[value].id;
this.categoryId = this.nav[value].id
}
},
initPageData() {
@ -577,9 +757,9 @@ export default {
getNoticeId() {
getTab().then(res => {
const query = {
"categoryId": res.data[0].id,
"pageNum": 1,
"pageSize": 10
'categoryId': res.data[0].id,
'pageNum': 1,
'pageSize': 10
}
getCategoryByParentId(query.categoryId).then(res => {
this.categoryId = res.data[1].id
@ -587,7 +767,7 @@ export default {
})
},
handleDataFromPage(data) {
if (this.currentActive === 3 ) {
if (this.currentActive === 3) {
this.otherList = data
}
if (this.currentActive === 2 || this.currentActive == 5 || this.currentActive == 4) {
@ -596,75 +776,112 @@ export default {
},
toRegister() {
if (!getToken()) {
this.$modal.msgWarning("报名请先登录系统!")
this.$modal.msgWarning('报名请先登录系统!')
} else {
if (this.registerStatus === '1') this.currentActive = 6;
if (this.registerStatus === '1') this.currentActive = 6
}
},
toQuery() {
if (!getToken()) {
this.$modal.msgWarning('报名请先登录系统!')
} else {
this.currentActive = 7
}
},
downloadFile(fileName) {
console.log("尝试下载文件...");
const attachmentUrl = "/static/" + fileName;
console.log('尝试下载文件...')
const attachmentUrl = '/static/' + fileName
},
//
trialsSubmitForm() {
this.$refs["form"].validate(valid => {
this.$refs['form'].validate(valid => {
if (valid) {
register(this.signUpForm).then(res => {
if (res.code === 200) {
this.reset();
this.$modal.msgSuccess("个人选拔赛报名提交成功")
this.next();
} else (
this.$modal.msgError("报名失败")
)
this.reset()
this.$modal.msgSuccess('个人选拔赛报名提交成功')
this.next()
} else {
(
this.$modal.msgError('报名失败')
)
}
})
} else {
this.$modal.msgError("信息未填完整")
this.$modal.msgError('信息未填完整')
}
})
},
//
editStudentInfo() {
this.studentForm.competition = null
this.studentForm.hitRegInfo = null
//
editCompetitionStudentInfo(this.studentForm).then(res => {
if (res.code === 200) {
this.$modal.msgSuccess('修改成功')
} else {
this.$modal.msgError('修改失败')
}
})
},
//
preliminarySubmit() {
const data = JSON.parse(JSON.stringify(this.preliminaryForm));
data.competition = this.arrayToString(data.competition);
console.log("个人选拔赛报名",data);
this.$refs["form"].validate(valid => {
const data = JSON.parse(JSON.stringify(this.preliminaryForm))
data.competition = this.arrayToString(data.competition)
console.log('个人选拔赛报名', data)
this.$refs['form'].validate(valid => {
if (valid) {
PreliminaryRegistration(data).then(res => {
if (res.code === 200) {
this.$modal.msgSuccess("地区选拔赛报名提交成功")
this.$modal.msgSuccess('地区选拔赛报名提交成功')
this.fetchRegistrationInformation()
} else {
this.$modal.msgError("报名失败")
this.$modal.msgError('报名失败')
}
})
}
})
},
updateTeamInfo() {
const data = JSON.parse(JSON.stringify(this.teamForm))
data.competition = this.arrayToString(data.competition)
updateRegInfo(data).then(res => {
if (res.code === 200) {
this.$modal.msgSuccess('团队成功')
this.fetchRegistrationInformation()
} else {
this.$modal.msgError('报名失败')
}
})
},
reset() {
this.signUpForm = {
stuName: "",
schoolName: "",
division: "",
collegeName: "",
phoneNumber: "",
email: "",
studentId: "",
major: "",
stuName: '',
schoolName: '',
division: '',
collegeName: '',
phoneNumber: '',
email: '',
studentId: '',
major: ''
},
this.resetForm("form");
this.resetForm('form')
},
//
next() {
if (this.active++ > 2) this.active = 0;
if (this.active++ > 2) this.active = 0
}
},
}
}
</script>
@ -683,6 +900,20 @@ export default {
cursor: pointer;
}
.anniu2 {
display: flex;
align-items: center;
justify-content: center;
color: #fff;
position: fixed;
right: 25px;
bottom: 200px;
border-radius: 8px;
cursor: pointer;
}
/* .container {
background: #F5F5F5;
} */
@ -1014,7 +1245,8 @@ export default {
/* align-items: center; */
}
.index-footer .footer .logo .footer-contact {}
.index-footer .footer .logo .footer-contact {
}
.index-footer .footer .logo .footer-contact .p {
display: inline-block;
@ -1254,4 +1486,19 @@ export default {
float: left;
}
/* 成绩查询样式 */
h3 {
margin-bottom: 20px;
}
.tabber-box1 {
box-sizing: border-box;
padding: 15px;
text-align: center;
//border: 1px solid #ccc;
width: 50%;
border-radius: 5px;
}
</style>