From b8d21aff623d83195b80c0f598c5aed69bd69417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=85=81=E6=9E=9E?= <3422692813@qq.com> Date: Tue, 8 Oct 2024 10:54:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B010.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cms/controller/HitRegInfoController.java | 38 +++++++++++- .../cms/domain/vo/HitRegInfoExportVo.java | 61 +++++++++++++++++++ .../ruoyi/cms/service/IHitRegInfoService.java | 7 +++ .../service/impl/HitRegInfoServiceImpl.java | 42 +++++++++++++ .../src/api/hit/registrationStudentInfo.js | 8 +++ ruoyi-ui/src/utils/request.js | 2 +- .../hit/registrationStudentInfo/index.vue | 8 ++- .../src/views/officialWebsite/competition.vue | 2 +- 8 files changed, 160 insertions(+), 8 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/cms/domain/vo/HitRegInfoExportVo.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegInfoController.java index 3d45c27..0e9edce 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegInfoController.java @@ -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 list = hitRegInfoService.selectHitRegInfoList(hitRegInfo); - ExcelUtil util = new ExcelUtil(HitRegInfo.class); - util.exportExcel(response, list, "报名信息数据"); + List list = hitRegInfoService.selectHitRegInfoListExport(hitRegInfo); + List list1 = new ArrayList<>(); + for (HitRegInfo hitRegInfo1 : list) { + try { + + //查询指导老师 + List 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 util = new ExcelUtil(HitRegInfoExportVo.class); + util.exportExcel(response, list1, "报名信息数据"); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/vo/HitRegInfoExportVo.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/vo/HitRegInfoExportVo.java new file mode 100644 index 0000000..92972f8 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/vo/HitRegInfoExportVo.java @@ -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; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoService.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoService.java index e80fe4f..25f1fcd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoService.java @@ -27,6 +27,13 @@ public interface IHitRegInfoService * @return 报名信息集合 */ public List selectHitRegInfoList(HitRegInfo hitRegInfo); + /** + * 导出报名信息列表 + * + * @param hitRegInfo 报名信息 + * @return 报名信息集合 + */ + public List selectHitRegInfoListExport(HitRegInfo hitRegInfo); /** * 新增报名信息 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoServiceImpl.java index b900d2a..dd48cf3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoServiceImpl.java @@ -115,6 +115,48 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService } return hitRegInfos; } + /** + * 查询报名信息列表 + * + * @param hitRegInfo 报名信息 + * @return 报名信息 + */ + @Override + public List 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 hitRegInfos = hitRegInfoMapper.selectHitRegInfoList(hitRegInfo); + for (HitRegInfo regInfo : hitRegInfos) { + HitRegInfoUser hitRegInfoUser =new HitRegInfoUser(); + hitRegInfoUser.setRegId(regInfo.getId()); + List 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; + } /** * 新增报名信息 diff --git a/ruoyi-ui/src/api/hit/registrationStudentInfo.js b/ruoyi-ui/src/api/hit/registrationStudentInfo.js index cf9d084..c193042 100644 --- a/ruoyi-ui/src/api/hit/registrationStudentInfo.js +++ b/ruoyi-ui/src/api/hit/registrationStudentInfo.js @@ -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({ diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js index 688af1e..c1a7d14 100644 --- a/ruoyi-ui/src/utils/request.js +++ b/ruoyi-ui/src/utils/request.js @@ -17,7 +17,7 @@ const service = axios.create({ // axios中请求配置有baseURL选项,表示请求URL公共部分 baseURL: process.env.VUE_APP_BASE_API, // 超时 30s - timeout: 30000 + timeout: 120000 }) // request拦截器 diff --git a/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue b/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue index f7a9cb6..f5cae20 100644 --- a/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue +++ b/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue @@ -37,7 +37,8 @@ - + 导出 - --> + @@ -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`) }, diff --git a/ruoyi-ui/src/views/officialWebsite/competition.vue b/ruoyi-ui/src/views/officialWebsite/competition.vue index ebb464f..4ef4d5b 100644 --- a/ruoyi-ui/src/views/officialWebsite/competition.vue +++ b/ruoyi-ui/src/views/officialWebsite/competition.vue @@ -237,7 +237,7 @@
- +
(地区选拔赛前无需上传资料)