更新10.8
This commit is contained in:
parent
61e7098b6c
commit
b8d21aff62
@ -1,9 +1,16 @@
|
||||
package com.ruoyi.cms.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
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.common.core.domain.HitRegistrationTeachInfo;
|
||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -33,6 +40,8 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
@RequestMapping("/system/hit_reg_info")
|
||||
public class HitRegInfoController extends BaseController
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(HitRegInfoController.class);
|
||||
|
||||
@Autowired
|
||||
private IHitRegInfoService hitRegInfoService;
|
||||
|
||||
@ -67,9 +76,32 @@ public class HitRegInfoController extends BaseController
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HitRegInfo hitRegInfo)
|
||||
{
|
||||
List<HitRegInfo> list = hitRegInfoService.selectHitRegInfoList(hitRegInfo);
|
||||
ExcelUtil<HitRegInfo> util = new ExcelUtil<HitRegInfo>(HitRegInfo.class);
|
||||
util.exportExcel(response, list, "报名信息数据");
|
||||
List<HitRegInfo> list = hitRegInfoService.selectHitRegInfoListExport(hitRegInfo);
|
||||
List<HitRegInfoExportVo> list1 = new ArrayList<>();
|
||||
for (HitRegInfo hitRegInfo1 : list) {
|
||||
try {
|
||||
|
||||
//查询指导老师
|
||||
List<HitRegistrationTeachInfo> zdTeacher = hitRegInfo1.getZdTeacher();
|
||||
HitRegInfoExportVo hitRegInfoExportVo = BeanUtil.copyProperties(hitRegInfo1, HitRegInfoExportVo.class);
|
||||
//设置领队老师
|
||||
hitRegInfoExportVo.setLdTeacher(hitRegInfo1.getLdTeacher().getTeacherName());
|
||||
//设置指导老师
|
||||
hitRegInfoExportVo.setZdlTeacher0(zdTeacher.get(0).getTeacherName());
|
||||
if (zdTeacher.size() > 1) {
|
||||
hitRegInfoExportVo.setZdlTeacher1(zdTeacher.get(1).getTeacherName());
|
||||
}
|
||||
hitRegInfoExportVo.setStudent1(hitRegInfo1.getStudentUserss().get(0).getStuName());
|
||||
hitRegInfoExportVo.setStudent2(hitRegInfo1.getStudentUserss().get(1).getStuName());
|
||||
hitRegInfoExportVo.setStudent3(hitRegInfo1.getStudentUserss().get(2).getStuName());
|
||||
list1.add(hitRegInfoExportVo);
|
||||
}catch (Exception e) {
|
||||
log.error("导出错误,团队信息:{}", hitRegInfo1);
|
||||
}
|
||||
}
|
||||
|
||||
ExcelUtil<HitRegInfoExportVo> util = new ExcelUtil<HitRegInfoExportVo>(HitRegInfoExportVo.class);
|
||||
util.exportExcel(response, list1, "报名信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.cms.domain.vo;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class HitRegInfoExportVo {
|
||||
/** 所属赛区 */
|
||||
@Excel(name = "所属赛区")
|
||||
private String division;
|
||||
|
||||
/** 学校 */
|
||||
@Excel(name = "学校名称")
|
||||
private String schoolName;
|
||||
|
||||
/** 学院 */
|
||||
@Excel(name = "院系名称")
|
||||
private String collegeName;
|
||||
|
||||
/** 团队名称 */
|
||||
@Excel(name = "团队名称")
|
||||
private String teamName;
|
||||
|
||||
/** 盲样邮寄地址 */
|
||||
@Excel(name = "盲样邮寄地址")
|
||||
private String sampleAddress;
|
||||
|
||||
/** 盲样联系人 */
|
||||
@Excel(name = "盲样联系人")
|
||||
private String sampleConcat;
|
||||
|
||||
/** 盲样联第人电话 */
|
||||
@Excel(name = "联系人电话")
|
||||
private String sampleNumber;
|
||||
|
||||
@Excel(name = "审核状态", readConverterExp = "0=未审核,1=审核通过,2=审核不通过,9=待确认")
|
||||
private String auditStatus;
|
||||
|
||||
@Excel(name = "赛事", readConverterExp = "1=化验赛,2=虚拟赛")
|
||||
private String competition;
|
||||
|
||||
@Excel(name = "领队老师")
|
||||
private String ldTeacher;
|
||||
|
||||
@Excel(name = "指导老师0")
|
||||
private String zdlTeacher0;
|
||||
|
||||
@Excel(name = "指导老师1")
|
||||
private String zdlTeacher1;
|
||||
|
||||
@Excel(name = "学生1")
|
||||
private String student1;
|
||||
|
||||
@Excel(name = "学生2")
|
||||
private String student2;
|
||||
|
||||
@Excel(name = "学生3")
|
||||
private String student3;
|
||||
}
|
@ -27,6 +27,13 @@ public interface IHitRegInfoService
|
||||
* @return 报名信息集合
|
||||
*/
|
||||
public List<HitRegInfo> selectHitRegInfoList(HitRegInfo hitRegInfo);
|
||||
/**
|
||||
* 导出报名信息列表
|
||||
*
|
||||
* @param hitRegInfo 报名信息
|
||||
* @return 报名信息集合
|
||||
*/
|
||||
public List<HitRegInfo> selectHitRegInfoListExport(HitRegInfo hitRegInfo);
|
||||
|
||||
/**
|
||||
* 新增报名信息
|
||||
|
@ -115,6 +115,48 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
|
||||
}
|
||||
return hitRegInfos;
|
||||
}
|
||||
/**
|
||||
* 查询报名信息列表
|
||||
*
|
||||
* @param hitRegInfo 报名信息
|
||||
* @return 报名信息
|
||||
*/
|
||||
@Override
|
||||
public List<HitRegInfo> selectHitRegInfoListExport(HitRegInfo hitRegInfo)
|
||||
{
|
||||
Long userId = SecurityUtils.getLoginUser().getUserId();
|
||||
//判断当前登陆人是否是领队老师,如果是查询该老师学校下的战队
|
||||
HitRegistrationTeachInfo teacherInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(userId);
|
||||
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.setRegId(regInfo.getId());
|
||||
List<HitRegInfoUser> hitRegInfoUsers = regInfoUserService.selectHitRegInfoUserList(hitRegInfoUser);
|
||||
for (HitRegInfoUser regInfoUser : hitRegInfoUsers) {
|
||||
switch (regInfoUser.getType()) {
|
||||
case "3": {
|
||||
HitRegistrationTeachInfo hitRegistrationTeachInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(regInfoUser.getUserId());
|
||||
regInfo.setLdTeacher(hitRegistrationTeachInfo);
|
||||
break;
|
||||
}
|
||||
case "2": {
|
||||
HitRegistrationTeachInfo hitRegistrationTeachInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(regInfoUser.getUserId());
|
||||
regInfo.getZdTeacher().add(hitRegistrationTeachInfo);
|
||||
break;
|
||||
}
|
||||
case "1":
|
||||
HitCompetitionStudentInfo studentInfo = hitCompetitionStudentInfoMapper.selectHitCompetitionStudentInfoByUserId(regInfoUser.getUserId());
|
||||
regInfo.getStudentUserss().add(studentInfo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return hitRegInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增报名信息
|
||||
|
@ -8,6 +8,14 @@ export function listHitRegistrationStudentInfo(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 导出报名信息列表
|
||||
export function listHitRegistrationStudentInfoExport(query) {
|
||||
return request({
|
||||
url: '/system/hit_reg_info/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 查询报名信息列表学生
|
||||
export function listHitRegistrationStudentInfoStudent(query) {
|
||||
return request({
|
||||
|
@ -17,7 +17,7 @@ const service = axios.create({
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
// 超时 30s
|
||||
timeout: 30000
|
||||
timeout: 120000
|
||||
})
|
||||
|
||||
// request拦截器
|
||||
|
@ -37,7 +37,8 @@
|
||||
<!-- v-hasPermi="['hit:hitRegistrationStudentInfo:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5"> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
@ -46,7 +47,7 @@
|
||||
@click="handleExport"
|
||||
v-hasPermi="['hit:hitRegistrationStudentInfo:export']"
|
||||
>导出</el-button>
|
||||
</el-col>-->
|
||||
</el-col>
|
||||
<!-- <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="关闭报名" >-->
|
||||
@ -182,6 +183,7 @@ import {
|
||||
delHitRegistrationStudentInfo,
|
||||
addHitRegistrationStudentInfo,
|
||||
updateHitRegistrationStudentInfo,
|
||||
listHitRegistrationStudentInfoExport,
|
||||
getTeachInfoByIds
|
||||
} from "@/api/hit/registrationStudentInfo";
|
||||
import { selectBaseInfo, editStatus } from '@/api/cms/baseInfo'
|
||||
@ -467,7 +469,7 @@ export default {
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('hit/hitRegistrationStudentInfo/export', {
|
||||
this.download('system/hit_reg_info/export', {
|
||||
...this.queryParams
|
||||
}, `HitRegistrationStudentInfo_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
@ -237,7 +237,7 @@
|
||||
</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>
|
||||
<div>
|
||||
|
Loading…
Reference in New Issue
Block a user