From a5fc34f7ea64529dd483f9847d4c08c88e0e4d82 Mon Sep 17 00:00:00 2001 From: sunyugang Date: Fri, 18 Jul 2025 15:33:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA=E8=B0=83?= =?UTF-8?q?=E6=9F=A5=E9=97=AE=E5=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/RuoYiApplication.java | 11 +- .../ruoyi/web/core/config/SwaggerConfig.java | 4 +- ruoyi-dw/pom.xml | 2 +- .../dw/controller/CjStudentController.java | 13 +- .../dw/controller/DwQuestionController.java | 8 +- .../java/com/ruoyi/dw/domain/CjStudent.java | 14 +- .../com/ruoyi/dw/domain/DwIndexConfig.java | 12 +- .../dw/service/IDwIndexConfigService.java | 2 +- .../impl/DwIndexConfigServiceImpl.java | 15 +- .../service/impl/DwQuestionServiceImpl.java | 209 ++++++++++++++++++ .../resources/mapper/dw/CjStudentMapper.xml | 6 +- .../mapper/dw/DwIndexConfigMapper.xml | 29 +-- 12 files changed, 265 insertions(+), 60 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index 32eb6f1..a2e6d47 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -16,15 +16,6 @@ public class RuoYiApplication { // System.setProperty("spring.devtools.restart.enabled", "false"); SpringApplication.run(RuoYiApplication.class, args); - System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + - " .-------. ____ __ \n" + - " | _ _ \\ \\ \\ / / \n" + - " | ( ' ) | \\ _. / ' \n" + - " |(_ o _) / _( )_ .' \n" + - " | (_,_).' __ ___(_ o _)' \n" + - " | |\\ \\ | || |(_,_)' \n" + - " | | \\ `' /| `-' / \n" + - " | | \\ / \\ / \n" + - " ''-' `'-' `-..-' "); + System.out.println("女子学院系统,启动成功"); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java index ae1c3ec..a754bff 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java @@ -113,9 +113,9 @@ public class SwaggerConfig // 用ApiInfoBuilder进行定制 return new ApiInfoBuilder() // 设置标题 - .title("标题:若依管理系统_接口文档") + .title("标题:山东女子学院数据采集系统_接口文档") // 描述 - .description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...") + .description("") // 作者信息 .contact(new Contact(ruoyiConfig.getName(), null, null)) // 版本 diff --git a/ruoyi-dw/pom.xml b/ruoyi-dw/pom.xml index 076198e..b1bd088 100644 --- a/ruoyi-dw/pom.xml +++ b/ruoyi-dw/pom.xml @@ -16,7 +16,7 @@ com.ruoyi - ruoyi-common + ruoyi-system diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/CjStudentController.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/CjStudentController.java index b5a6332..ec8815c 100644 --- a/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/CjStudentController.java +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/CjStudentController.java @@ -3,14 +3,18 @@ package com.ruoyi.dw.controller; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.dw.domain.CjStudent; import com.ruoyi.dw.service.ICjStudentService; +import com.ruoyi.system.service.ISysDeptService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.util.List; @@ -27,6 +31,9 @@ public class CjStudentController extends BaseController @Autowired private ICjStudentService cjStudentService; + @Resource + private ISysDeptService sysDeptService; + /** * 查询采集学生信息列表 */ @@ -34,12 +41,16 @@ public class CjStudentController extends BaseController public TableDataInfo list(CjStudent cjStudent) { startPage(); + Long deptId = SecurityUtils.getLoginUser().getDeptId(); + if (deptId.intValue() != 100){ + SysDept dept = sysDeptService.selectDeptById(deptId); + cjStudent.setXy(dept.getDeptName()); + } List list = cjStudentService.selectCjStudentList(cjStudent); return getDataTable(list); } - /** * 导出采集学生信息列表 */ diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/DwQuestionController.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/DwQuestionController.java index 0d322b7..f339595 100644 --- a/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/DwQuestionController.java +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/controller/DwQuestionController.java @@ -48,10 +48,12 @@ public class DwQuestionController extends BaseController /** * 调查问卷问题列表下拉框选择 */ - @GetMapping("/select") - public AjaxResult select() + @GetMapping("/select/{infoId}") + public AjaxResult select(@PathVariable Long infoId) { - List list = dwQuestionService.selectDwQuestionList(new DwQuestion()); + DwQuestion dwQuestion = new DwQuestion(); + dwQuestion.setInfoId(infoId); + List list = dwQuestionService.selectDwQuestionList(dwQuestion); return AjaxResult.success(list); } diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/domain/CjStudent.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/domain/CjStudent.java index 5881907..75fded1 100644 --- a/ruoyi-dw/src/main/java/com/ruoyi/dw/domain/CjStudent.java +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/domain/CjStudent.java @@ -30,6 +30,10 @@ public class CjStudent extends BaseEntity @Excel(name = "专业") private String zy; + /** 学院 */ + @Excel(name = "学院") + private String xy; + /** 生源地省 */ private String sydsh; @@ -61,7 +65,7 @@ public class CjStudent extends BaseEntity private String zwjb; /** 职务级别 */ - @Excel(name = "职务级别") + @Excel(name = "社会兼职") private String shjz; /** 代表荣誉 */ @@ -285,6 +289,14 @@ public class CjStudent extends BaseEntity this.ry = ry; } + public String getXy() { + return xy; + } + + public void setXy(String xy) { + this.xy = xy; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/domain/DwIndexConfig.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/domain/DwIndexConfig.java index 8115092..d883d3c 100644 --- a/ruoyi-dw/src/main/java/com/ruoyi/dw/domain/DwIndexConfig.java +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/domain/DwIndexConfig.java @@ -1,9 +1,8 @@ package com.ruoyi.dw.domain; +import com.ruoyi.common.annotation.Excel; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseEntity; /** * 调查问卷统计展示对象 dw_index_config @@ -11,7 +10,7 @@ import com.ruoyi.common.core.domain.BaseEntity; * @author sunyg * @date 2025-06-27 */ -public class DwIndexConfig extends BaseEntity +public class DwIndexConfig { private static final long serialVersionUID = 1L; @@ -32,7 +31,7 @@ public class DwIndexConfig extends BaseEntity /** * 展现形式 - * 0-饼状图,2-柱状图,3-折线图 + * 0-饼状图,1-柱状图,2-折线图 * */ @Excel(name = "展现形式") private Long indexType; @@ -95,11 +94,6 @@ public class DwIndexConfig extends BaseEntity .append("questionId", getQuestionId()) .append("infoId", getInfoId()) .append("indexType", getIndexType()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) .toString(); } } diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/service/IDwIndexConfigService.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/service/IDwIndexConfigService.java index a02bfdc..a90348e 100644 --- a/ruoyi-dw/src/main/java/com/ruoyi/dw/service/IDwIndexConfigService.java +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/service/IDwIndexConfigService.java @@ -68,7 +68,7 @@ public interface IDwIndexConfigService * 获取首页的四个展位数据 * @return */ - public Map getIndex(); + public List> getIndex(); /** * 毕业年份折线图统计 diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/service/impl/DwIndexConfigServiceImpl.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/service/impl/DwIndexConfigServiceImpl.java index e5d5975..51dbf0a 100644 --- a/ruoyi-dw/src/main/java/com/ruoyi/dw/service/impl/DwIndexConfigServiceImpl.java +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/service/impl/DwIndexConfigServiceImpl.java @@ -1,9 +1,6 @@ package com.ruoyi.dw.service.impl; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.dw.domain.DwQuestion; @@ -68,7 +65,6 @@ public class DwIndexConfigServiceImpl implements IDwIndexConfigService @Override public int insertDwIndexConfig(DwIndexConfig dwIndexConfig) { - dwIndexConfig.setCreateTime(DateUtils.getNowDate()); return dwIndexConfigMapper.insertDwIndexConfig(dwIndexConfig); } @@ -81,7 +77,6 @@ public class DwIndexConfigServiceImpl implements IDwIndexConfigService @Override public int updateDwIndexConfig(DwIndexConfig dwIndexConfig) { - dwIndexConfig.setUpdateTime(DateUtils.getNowDate()); return dwIndexConfigMapper.updateDwIndexConfig(dwIndexConfig); } @@ -110,19 +105,21 @@ public class DwIndexConfigServiceImpl implements IDwIndexConfigService } @Override - public Map getIndex() + public List> getIndex() { List configs = dwIndexConfigMapper.selectDwIndexConfigList(new DwIndexConfig()); - Map result = new HashMap(); + List> resultList = new ArrayList>(); for (DwIndexConfig config: configs){ + Map result = new HashMap(); result.put("id", config.getId()); result.put("indexType", config.getIndexType()); DwQuestion question = dwQuestionMapper.selectDwQuestionById(Long.valueOf(config.getQuestionId())); result.put("question", question.getQuestion()); List list = dwIndexConfigMapper.selectIndex(Long.valueOf(config.getQuestionId()), config.getInfoId()); result.put("data", list); + resultList.add(result); } - return result; + return resultList; } @Override diff --git a/ruoyi-dw/src/main/java/com/ruoyi/dw/service/impl/DwQuestionServiceImpl.java b/ruoyi-dw/src/main/java/com/ruoyi/dw/service/impl/DwQuestionServiceImpl.java index a9d7aa2..f204eb1 100644 --- a/ruoyi-dw/src/main/java/com/ruoyi/dw/service/impl/DwQuestionServiceImpl.java +++ b/ruoyi-dw/src/main/java/com/ruoyi/dw/service/impl/DwQuestionServiceImpl.java @@ -1654,6 +1654,215 @@ public class DwQuestionServiceImpl implements IDwQuestionService answer22.setInfoId(dwInfo.getId()); answer22.setQuestionId(87L); answers.add(answer22); + }if (dwInfo.getId().intValue() == 4){ + DwAnswer answer1 = new DwAnswer(); + Cell cell15 = row.getCell(15); + answer1.setAnswer(cell15.getStringCellValue()); + answer1.setInfoId(dwInfo.getId()); + answer1.setQuestionId(88L); + answers.add(answer1); + DwAnswer answer2 = new DwAnswer(); + Cell cell16 = row.getCell(16); + answer2.setAnswer(cell16.getStringCellValue()); + answer2.setInfoId(dwInfo.getId()); + answer2.setQuestionId(89L); + answers.add(answer2); + DwAnswer answer3 = new DwAnswer(); + Cell cell17 = row.getCell(17); + Cell cell18 = row.getCell(18); + if (cell18 != null && StringUtils.isNotEmpty(cell17.getStringCellValue())){ + answer3.setAnswer(cell18.getStringCellValue()); + }else { + answer3.setAnswer(cell17.getStringCellValue()); + } + answer3.setInfoId(dwInfo.getId()); + answer3.setQuestionId(90L); + answers.add(answer3); + DwAnswer answer4 = new DwAnswer(); + Cell cell19 = row.getCell(19); + Cell cell20 = row.getCell(20); + if (cell20 != null && StringUtils.isNotEmpty(cell20.getStringCellValue())){ + answer4.setAnswer(cell20.getStringCellValue()); + }else { + answer4.setAnswer(cell19.getStringCellValue()); + } + answer4.setInfoId(dwInfo.getId()); + answer4.setQuestionId(91L); + answers.add(answer4); + Cell cell22 = row.getCell(22); + if (cell22 != null && StringUtils.isNotEmpty(cell22.getStringCellValue())){ + DwAnswer answer51 = new DwAnswer(); + answer51.setAnswer(cell22.getStringCellValue()); + answer51.setInfoId(dwInfo.getId()); + answer51.setQuestionId(92L); + answers.add(answer51); + } + Cell cell23 = row.getCell(23); + if (cell23 != null && StringUtils.isNotEmpty(cell23.getStringCellValue())){ + DwAnswer answer52 = new DwAnswer(); + answer52.setAnswer(cell23.getStringCellValue()); + answer52.setInfoId(dwInfo.getId()); + answer52.setQuestionId(92L); + answers.add(answer52); + } + Cell cell24 = row.getCell(24); + if (cell24 != null && StringUtils.isNotEmpty(cell24.getStringCellValue())){ + DwAnswer answer53 = new DwAnswer(); + answer53.setAnswer(cell24.getStringCellValue()); + answer53.setInfoId(dwInfo.getId()); + answer53.setQuestionId(92L); + answers.add(answer53); + } + Cell cell25 = row.getCell(25); + if (cell25 != null && StringUtils.isNotEmpty(cell25.getStringCellValue())){ + DwAnswer answer54 = new DwAnswer(); + answer54.setAnswer(cell25.getStringCellValue()); + answer54.setInfoId(dwInfo.getId()); + answer54.setQuestionId(92L); + answers.add(answer54); + } + Cell cell26 = row.getCell(26); + if (cell26 != null && StringUtils.isNotEmpty(cell26.getStringCellValue())){ + DwAnswer answer55 = new DwAnswer(); + answer55.setAnswer(cell26.getStringCellValue()); + answer55.setInfoId(dwInfo.getId()); + answer55.setQuestionId(92L); + answers.add(answer55); + } + Cell cell27 = row.getCell(27); + if (cell27 != null && StringUtils.isNotEmpty(cell27.getStringCellValue())){ + DwAnswer answer56 = new DwAnswer(); + answer56.setAnswer(cell27.getStringCellValue()); + answer56.setInfoId(dwInfo.getId()); + answer56.setQuestionId(92L); + answers.add(answer56); + } + Cell cell28 = row.getCell(28); + if (cell28 != null && StringUtils.isNotEmpty(cell28.getStringCellValue())){ + DwAnswer answer57 = new DwAnswer(); + answer57.setAnswer(cell28.getStringCellValue()); + answer57.setInfoId(dwInfo.getId()); + answer57.setQuestionId(92L); + answers.add(answer57); + } + DwAnswer answer6 = new DwAnswer(); + Cell cell29 = row.getCell(29); + answer6.setAnswer(cell29.getStringCellValue()); + answer6.setInfoId(dwInfo.getId()); + answer6.setQuestionId(93L); + answers.add(answer6); + DwAnswer answer7 = new DwAnswer(); + Cell cell30 = row.getCell(30); + answer7.setAnswer(cell30.getStringCellValue()); + answer7.setInfoId(dwInfo.getId()); + answer7.setQuestionId(94L); + answers.add(answer7); + DwAnswer answer8 = new DwAnswer(); + Cell cell31 = row.getCell(31); + answer8.setAnswer(cell31.getStringCellValue()); + answer8.setInfoId(dwInfo.getId()); + answer8.setQuestionId(95L); + answers.add(answer8); + DwAnswer answer9 = new DwAnswer(); + Cell cell32 = row.getCell(32); + answer9.setAnswer(cell32.getStringCellValue()); + answer9.setInfoId(dwInfo.getId()); + answer9.setQuestionId(96L); + answers.add(answer9); + DwAnswer answer10 = new DwAnswer(); + Cell cell33 = row.getCell(33); + answer10.setAnswer(cell33.getStringCellValue()); + answer10.setInfoId(dwInfo.getId()); + answer10.setQuestionId(97L); + answers.add(answer10); + DwAnswer answer11 = new DwAnswer(); + Cell cell34 = row.getCell(34); + answer11.setAnswer(cell34.getStringCellValue()); + answer11.setInfoId(dwInfo.getId()); + answer11.setQuestionId(98L); + answers.add(answer11); + DwAnswer answer12 = new DwAnswer(); + Cell cell35 = row.getCell(35); + Cell cell36 = row.getCell(36); + Cell cell37 = row.getCell(37); + Cell cell38 = row.getCell(38); + Cell cell39 = row.getCell(39); + Cell cell40 = row.getCell(40); + Cell cell41 = row.getCell(41); + Cell cell42 = row.getCell(42); + Cell cell43 = row.getCell(43); + Cell cell44 = row.getCell(44); + Cell cell45 = row.getCell(45); + Cell cell46 = row.getCell(46); + Cell cell47 = row.getCell(47); + Cell cell48 = row.getCell(48); + answer12.setAnswer(cell35.getStringCellValue() + "," + cell36.getStringCellValue() + + "," + cell37.getStringCellValue() + "," + cell38.getStringCellValue() + + "," + cell39.getStringCellValue() + "," + cell40.getStringCellValue() + + "," + cell41.getStringCellValue() + "," + cell42.getStringCellValue() + + "," + cell43.getStringCellValue() + "," + cell44.getStringCellValue() + + "," + cell45.getStringCellValue() + "," + cell46.getStringCellValue() + + "," + cell47.getStringCellValue() + "," + cell48.getStringCellValue()); + answer12.setInfoId(dwInfo.getId()); + answer12.setQuestionId(99L); + answers.add(answer12); + DwAnswer answer13 = new DwAnswer(); + Cell cell49 = row.getCell(49); + Cell cell50 = row.getCell(50); + if (cell50 != null && StringUtils.isNotEmpty(cell50.getStringCellValue())){ + answer13.setAnswer(cell50.getStringCellValue()); + }else { + answer13.setAnswer(cell49.getStringCellValue()); + } + answer13.setInfoId(dwInfo.getId()); + answer13.setQuestionId(100L); + answers.add(answer13); + DwAnswer answer14 = new DwAnswer(); + Cell cell51 = row.getCell(51); + answer14.setAnswer(cell51.getStringCellValue()); + answer14.setInfoId(dwInfo.getId()); + answer14.setQuestionId(101L); + answers.add(answer14); + DwAnswer answer15 = new DwAnswer(); + Cell cell52 = row.getCell(52); + Cell cell53 = row.getCell(53); + if (cell53 != null && StringUtils.isNotEmpty(cell53.getStringCellValue())){ + answer15.setAnswer(cell53.getStringCellValue()); + }else { + answer15.setAnswer(cell52.getStringCellValue()); + } + answer15.setInfoId(dwInfo.getId()); + answer15.setQuestionId(102L); + answers.add(answer15); + DwAnswer answer16 = new DwAnswer(); + Cell cell54 = row.getCell(54); + answer16.setAnswer(cell54.getStringCellValue()); + answer16.setInfoId(dwInfo.getId()); + answer16.setQuestionId(103L); + answers.add(answer16); + DwAnswer answer17 = new DwAnswer(); + Cell cell55 = row.getCell(55); + answer17.setAnswer(cell55.getStringCellValue()); + answer17.setInfoId(dwInfo.getId()); + answer17.setQuestionId(104L); + answers.add(answer17); + DwAnswer answer18 = new DwAnswer(); + Cell cell56 = row.getCell(56); + Cell cell57 = row.getCell(57); + if (cell57 != null && StringUtils.isNotEmpty(cell57.getStringCellValue())){ + answer18.setAnswer(cell57.getStringCellValue()); + }else { + answer18.setAnswer(cell56.getStringCellValue()); + } + answer18.setInfoId(dwInfo.getId()); + answer18.setQuestionId(105L); + answers.add(answer18); + DwAnswer answer19 = new DwAnswer(); + Cell cell58 = row.getCell(58); + answer19.setAnswer(cell58.getStringCellValue()); + answer19.setInfoId(dwInfo.getId()); + answer19.setQuestionId(106L); + answers.add(answer19); }else { return -2; } diff --git a/ruoyi-dw/src/main/resources/mapper/dw/CjStudentMapper.xml b/ruoyi-dw/src/main/resources/mapper/dw/CjStudentMapper.xml index e525822..1c762aa 100644 --- a/ruoyi-dw/src/main/resources/mapper/dw/CjStudentMapper.xml +++ b/ruoyi-dw/src/main/resources/mapper/dw/CjStudentMapper.xml @@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -28,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, xm,sydsh, sydshi, xb, zy, bynf, zgyl, gzdw, dwxz, dwdz, zwjb, shjz, dbry, rysfzs, ry,sj, yx, qt, sfqr from cj_student + select id, xm,sydsh, sydshi, xb, zy,xy, bynf, zgyl, gzdw, dwxz, dwdz, zwjb, shjz, dbry, rysfzs, ry,sj, yx, qt, sfqr from cj_student +