diff --git a/.gitignore b/.gitignore index 5d05004..528334e 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,5 @@ os_del_doc.cmd derby.log application-local.yml + +applicationTemp \ No newline at end of file diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/blStuAnswer/controller/BlStuAnswerController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/blStuAnswer/controller/BlStuAnswerController.java index 77e3bd1..1518213 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/blStuAnswer/controller/BlStuAnswerController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/blStuAnswer/controller/BlStuAnswerController.java @@ -13,8 +13,8 @@ import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.modules.demo.blStuAnswer.entity.BlStuAnswer; import org.jeecg.modules.demo.blStuAnswer.service.IBlStuAnswerService; -import org.jeecg.modules.demo.blStuInfo.entity.BlStuInfo; import org.jeecg.modules.demo.blStuInfo.service.IBlStuInfoService; +import org.jeecg.modules.demo.blStuInfo.entity.BlStuInfo; import org.jeecg.modules.tools.word.ExportWord; import org.jeecg.modules.tools.word.WordOperator; import org.jeecgframework.poi.excel.ExcelImportUtil; @@ -191,17 +191,6 @@ public class BlStuAnswerController extends JeecgController(); -// updateWp.lambda().eq(BlStuInfo::getId, id); -// updateWp.lambda().set() -// blStuInfoService.update(updateWp); - - //update-end-author:taoyan date:20190528 for:批量插入数据 return Result.ok("文件导入成功!数据行数:" + list.size()); } catch (Exception e) { @@ -235,4 +224,21 @@ public class BlStuAnswerController extends JeecgController createWord(@RequestParam(name="id",required=true) String id) throws Exception { + //直接导出附件 + WordOperator wo = service.createWordTjfx(id); + BlStuInfo blStuInfo = blStuInfoService.getById(id); + //保存到本地附件里 + String exportWordPath = ExportWord.wordPathToLocalFile(wo,"["+blStuInfo.getSchoolName()+"]-"+blStuInfo.getPgrq()+"-问卷分析情况.docx", "exportWords"); + //保存到主表里 + var updateWp = new UpdateWrapper(); + updateWp.lambda().eq(BlStuInfo::getId, id); + updateWp.lambda().set(BlStuInfo::getFilePath,exportWordPath); + blStuInfoService.update(updateWp); + return Result.OK("生成成功"); + } + + } diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/blStuAnswer/mapper/xml/BlStuAnswerMapper.xml b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/blStuAnswer/mapper/xml/BlStuAnswerMapper.xml index 1082948..09fc645 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/blStuAnswer/mapper/xml/BlStuAnswerMapper.xml +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/blStuAnswer/mapper/xml/BlStuAnswerMapper.xml @@ -6,13 +6,13 @@ - select a.sex as 'key',a.sex_cnt as '01',round(round(a.sex_cnt/b.total_cnt,2)*100) as '02' from (select sex,count('x') as sex_cnt from bl_stu_answer where main_id = #{id} GROUP BY sex order by sex) a, (select count('x') as total_cnt from bl_stu_answer where main_id = #{id}) b - select '大一' as 'key',b.d1_cnt as '01',round(round(b.d1_cnt/a.tot_cnt,2)*100) as '02' from (select count('x') as tot_cnt from bl_stu_answer where main_id = #{id})a, @@ -34,18 +34,18 @@ (select count('x') as d1_cnt from bl_stu_answer where NIANJI = '大四' and main_id = #{id})b - select a.POLITICS as 'key',a.POLITICS_cnt as '01',round(round(a.POLITICS_cnt/b.total_cnt,2)*100) as '02' from (select POLITICS,count('x') as POLITICS_cnt from bl_stu_answer where main_id = #{id} GROUP BY POLITICS order by POLITICS) a, (select count('x') as total_cnt from bl_stu_answer where main_id = #{id}) b where POLITICS is not null and POLITICS != '' - select CONCAT(dep,'-',major_maj) as 'key', dep as '01', major_maj as '02', maj_cnt as '03', `round((b.maj_cnt/a.dep_cnt)*100)` as '04' from view_bl_major_static - select '课前运用网络课程平台、教材或资料进行自主预学,梳理知识并发现问题' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常符合', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较符合', @@ -115,7 +115,7 @@ select round(sum(AFTER_CLASS_READ2)/count('x'),2) from bl_stu_answer where main_id = #{id} - select 'key' as 'key', round(sum(PRE_CLASS_PREVIEW2)/count('x'),2) as '课前运用网络课程平台、教材或资料进行自主预学,梳理知识并发现问题', @@ -125,7 +125,7 @@ from bl_stu_answer where main_id = #{id} - select '课前运用网络课程平台、教材或资料进行自主预学,梳理知识并发现问题' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04' from (select round(sum(PRE_CLASS_PREVIEW2)/count('x'),2)as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, @@ -155,7 +155,7 @@ (select round(sum(AFTER_CLASS_READ2)/count('x'),2)as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select major as 'key', round(sum(PRE_CLASS_PREVIEW2)/count('x'),2) as '01', @@ -181,7 +181,7 @@ select round(sum(STUDYTIME_ONLINE)/count('x')) from bl_stu_answer where main_id = #{id} - select '完成作业' as 'key',e.d5 as '01',a.d1 as '02',b.d2 as '03',c.d3 as '04',d.d4 as '05' from (select round(round(sum(STUDYTIME_HOMEWORK)/count('x'),2))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, @@ -215,7 +215,7 @@ (select round(round(sum(STUDYTIME_ONLINE)/count('x'),2))as d5 from bl_stu_answer where main_id = #{id} )e - select major as 'key', round(sum(STUDYTIME_HOMEWORK)/count('x')) as '01', @@ -241,7 +241,7 @@ select round(sum(STUDYTIME_OTHER)/count('x')) from bl_stu_answer where main_id = #{id} - select '做实验/科研项目' as 'key',e.d5 as '01',a.d1 as '02',b.d2 as '03',c.d3 as '04',d.d4 as '05' from (select round(round(sum(STUDYTIME_EXPERIMENT)/count('x'),2))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, @@ -275,7 +275,7 @@ (select round(round(sum(STUDYTIME_OTHER)/count('x'),2))as d5 from bl_stu_answer where main_id = #{id} )e - select major as 'key', round(sum(STUDYTIME_EXPERIMENT)/count('x')) as '01', @@ -301,7 +301,7 @@ select concat(round(round(sum(INTERACT_RESEARCH1)/count('x'),2)*100)) from bl_stu_answer where main_id = #{id} - select '和同学合作完成课程任务或作业' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '总是', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '经常', @@ -347,7 +347,7 @@ (select count('x') as tot_cnt from bl_stu_answer where main_id = #{id})f - select '和同学合作完成课程任务或作业' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04' from (select round(round(sum(INTERACT_TASK1)/count('x'),2)*100)as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, @@ -377,7 +377,7 @@ (select round(round(sum(INTERACT_RESEARCH1)/count('x'),2)*100)as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select major as 'key', round(round(sum(INTERACT_TASK1)/count('x'),2)*100) as '01', @@ -399,7 +399,7 @@ (select count('x') as tot_cnt from bl_stu_answer where main_id = #{id})b - select a as 'key',c as '01' from (select a.EXCHANGE_FREQ as a,a.EXCHANGE_FREQ_cnt as b,round(round(a.EXCHANGE_FREQ_cnt/b.total_cnt,2)*100) as c from (select EXCHANGE_FREQ,count('x') as EXCHANGE_FREQ_cnt from bl_stu_answer where main_id = #{id} GROUP BY EXCHANGE_FREQ order by EXCHANGE_FREQ) a, @@ -407,7 +407,7 @@ order by 3 desc)e - select '大一' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '每周至少一次', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '每月至少一次', @@ -453,7 +453,7 @@ (select count('x') as tot_cnt from bl_stu_answer where main_id = #{id} and NIANJI = '大四')f - select z.major as 'key',round(round(z.z_cnt/t.tot_cnt,2)*100) as '01',round(round(y.y_cnt/t.tot_cnt,2)*100) as '02',round(round(x.x_cnt/t.tot_cnt,2)*100) as '03',round(round(n.n_cnt/t.tot_cnt,2)*100) as '04' from (select major,count('x') as z_cnt from bl_stu_answer where main_id = #{id} and EXCHANGE_FREQ = '每周至少一次' GROUP BY major)z, @@ -493,7 +493,7 @@ (select count('x') as tot_cnt from bl_stu_answer where main_id = #{id})b - select '思政课程总体满意度' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常满意', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较满意', @@ -511,11 +511,11 @@ select concat(round(sum(SXZZK_SATI2)/count(*))) from bl_stu_answer where main_id = #{id} - select '思政课程总体满意度' as 'key',concat(round(sum(SXZZK_SATI2)/count(*))) as '01' from bl_stu_answer where main_id = #{id} - select '思政课程总体满意度' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04' from (select round(sum(SXZZK_SATI2)/count(*))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, @@ -524,14 +524,14 @@ (select round(sum(SXZZK_SATI2)/count(*))as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select major as 'key', round(sum(SXZZK_SATI2)/count(*)) as '01' from bl_stu_answer where main_id = #{id} GROUP BY MAJOR - select '教学形式' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常满意', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较满意', @@ -593,7 +593,7 @@ select concat(round(round(sum(SXZZK_XIAOGUO2)/count('x'),2))) from bl_stu_answer where main_id = #{id} - select '思政课程各分项满意度' as 'key', round(round(sum(SXZZK_NEIRONG2)/count('x'),2)) as '教学内容', @@ -603,7 +603,7 @@ from bl_stu_answer where main_id = #{id} - select '教学内容' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04' from (select round(round(sum(SXZZK_NEIRONG2)/count('x'),2))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, @@ -633,7 +633,7 @@ (select round(round(sum(SXZZK_XIAOGUO2)/count('x'),2))as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select '课程将知识、能力、素养进行了有机融合' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常符合', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较符合', @@ -737,7 +737,7 @@ select round(sum(ZYK_EFFORT2)/count('x'),2) from bl_stu_answer where main_id = #{id}; - select '学生对专业课“两性一度”评价' as 'key', round(sum(ZYK_SKILL2)/count('x'),2) as '课程将知识、能力、素养进行了有机融合', @@ -749,7 +749,7 @@ from bl_stu_answer where main_id = #{id} - select '高阶性' as 'key','课程将知识、能力、素养进行了有机融合' as '01',a.d1 as '02',b.d2 as '03',c.d3 as '04',d.d4 as '05' from (select round(sum(ZYK_SKILL2)/count('x'),2)as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, (select round(sum(ZYK_SKILL2)/count('x'),2)as d2 from bl_stu_answer where main_id = #{id} and nianji = '大二' )b, @@ -787,7 +787,7 @@ (select round(sum(ZYK_EFFORT2)/count('x'),2)as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select major as 'key', round(sum(ZYK_SKILL2)/count('x'),2) as '01', @@ -799,7 +799,7 @@ from bl_stu_answer GROUP BY major order by major; - select '提供案例或实例讨论' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常符合', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较符合', @@ -869,7 +869,7 @@ select round(sum(METHOD_XIANGMU2)/count('x'),2) from bl_stu_answer where main_id = #{id} - select '学生对专业课教学方式评价' as 'key', round(sum(METHOD_JIANGSHOU2)/count('x'),2) as '课程以传统的教师讲授为主', @@ -879,7 +879,7 @@ from bl_stu_answer where main_id = #{id} - select '课程以传统的教师讲授为主' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04' from (select round(sum(METHOD_JIANGSHOU2)/count('x'),2)as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, @@ -909,7 +909,7 @@ (select round(sum(METHOD_XIANGMU2)/count('x'),2)as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select major as 'key', round(sum(METHOD_JIANGSHOU2)/count('x'),2) as '01', @@ -943,7 +943,7 @@ select concat(round(round(sum(EVALUATE_LUNWEN)/count('x'),2)*100)) from bl_stu_answer where main_id = #{id} - select '卷面考试' as 'key' ,round(round(b.no_cnt/a.tot_cnt,2)*100) as '01' from (select count('x') as tot_cnt from bl_stu_answer where main_id = #{id})a,(select count('x') as no_cnt from bl_stu_answer where main_id = #{id} and EVALUATE_JUANMIAN = #{id})b union all select '随堂提问或测试' as 'key' ,round(round(b.no_cnt/a.tot_cnt,2)*100) as '01' from (select count('x') as tot_cnt from bl_stu_answer where main_id = #{id})a,(select count('x') as no_cnt from bl_stu_answer where main_id = #{id} and EVALUATE_TIWEN = #{id})b @@ -957,7 +957,7 @@ select '过课程论文或实验报告' as 'key' ,round(round(b.no_cnt/a.tot_cnt,2)*100) as '01' from (select count('x') as tot_cnt from bl_stu_answer where main_id = #{id})a,(select count('x') as no_cnt from bl_stu_answer where main_id = #{id} and EVALUATE_LUNWEN = #{id})b - select '体育教育' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常满意', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较满意', @@ -1016,7 +1016,7 @@ from bl_stu_answer where main_id = #{id} - select '体美劳教育满意度' as 'key', round(sum(EDUSATI_TI2)/count('x')) as '体育教育', @@ -1025,7 +1025,7 @@ from bl_stu_answer where main_id = #{id} - select '体育教育' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04' from (select round(round(sum(EDUSATI_TI2)/count('x'),2))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, @@ -1048,7 +1048,7 @@ (select round(round(sum(EDUSATI_LAO2)/count('x'),2))as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select major as 'key', round(sum(EDUSATI_TI2)/count('x')) as '01', @@ -1077,7 +1077,7 @@ select concat(round(round(sum(ACTIVITY_GLOBAL)/count('x'),2)*100)) from bl_stu_answer where main_id = #{id} - select '学生社团活动' as 'key' ,round(round(sum(ACTIVITY_SOCIETY)/count('x'),2)*100) as '01' from bl_stu_answer where main_id = #{id} UNION all select '校园文化活动' as 'key' ,round(round(sum(ACTIVITY_CULTURE)/count('x'),2)*100) as '01' from bl_stu_answer where main_id = #{id} @@ -1089,7 +1089,7 @@ select '国际交流活动' as 'key' ,round(round(sum(ACTIVITY_GLOBAL)/count('x'),2)*100) as '01' from bl_stu_answer where main_id = #{id} - select '国际交流活动' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常满意', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较满意', @@ -1166,7 +1166,7 @@ select concat(round(avg(ACTISATI_INTERN2))) from bl_stu_answer where main_id = #{id} and ACTISATI_INTERN2 + 0 > 0 - select '各项学生发展活动满意度' as 'key', a.a as '学生社团活动',b.b as '校园文化活动',c.c as '创新创业活动',d.d as '国际交流活动',e.e as '社会实践活动' from (select round(avg(ACTISATI_SOCIETY2)) as a from bl_stu_answer where main_id = #{id} and ACTISATI_SOCIETY2 + 0 > 0)a, (select round(avg(ACTISATI_CULTURE2)) as b from bl_stu_answer where main_id = #{id} and ACTISATI_CULTURE2 + 0 > 0)b, @@ -1175,7 +1175,7 @@ (select round(avg(ACTISATI_INTERN2)) as e from bl_stu_answer where main_id = #{id} and ACTISATI_INTERN2 + 0 > 0)e - select '学生社团活动' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '07' from (select round(avg(ACTISATI_SOCIETY2)) as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' and ACTISATI_SOCIETY2 + 0 > 0)a, @@ -1212,7 +1212,7 @@ (select round(avg(ACTISATI_INTERN2)) as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' and ACTISATI_INTERN2 + 0 > 0 )d - select a.MAJOR as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04',e.d5 as '05' from (select major,round(avg(ACTISATI_SOCIETY2)) as d1 from bl_stu_answer where main_id = #{id} and ACTISATI_SOCIETY2 + 0 > 0 GROUP BY MAJOR)a, (select major,round(avg(ACTISATI_CULTURE2)) as d2 from bl_stu_answer where main_id = #{id} and ACTISATI_CULTURE2 + 0 > 0 GROUP BY MAJOR)b, @@ -1225,7 +1225,7 @@ and a.major = e.major - select '实习实践指导情况' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常满意', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较满意', @@ -1295,7 +1295,7 @@ select concat(round(round(sum(INTERN_EQUIP_SATIS2)/count('x'),2))) from bl_stu_answer where main_id = #{id} - select '本校实习实践各方面满意度' as 'key', round(round(sum(INTERN_CONTENT_SATIS2)/count('x'),2)) as '实习实践内容', @@ -1305,7 +1305,7 @@ from bl_stu_answer where main_id = #{id} - select major as 'key', round(sum(INTERN_CONTENT_SATIS2)/count('x')) as '01', @@ -1315,7 +1315,7 @@ from bl_stu_answer where main_id = #{id} GROUP BY major order by major - select '自主学习能力提升' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常符合', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较符合', @@ -1402,7 +1402,7 @@ select round(sum(ABILITY_PLAN2)/count('x'),2) from bl_stu_answer where main_id = #{id} - select '学生对学习收获的评价' as 'key', round(sum(ABILITY_ANALYSE2)/count('x'),2) as '分析问题、解决问题能力提升', @@ -1413,7 +1413,7 @@ from bl_stu_answer where main_id = #{id} - select '分析问题、解决问题能力提升' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04' from (select round(sum(ABILITY_ANALYSE2)/count('x'),2)as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, @@ -1450,7 +1450,7 @@ (select round(sum(ABILITY_PLAN2)/count('x'),2)as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select major as 'key', round(sum(ABILITY_ANALYSE2)/count('x'),2) as '01', @@ -1461,7 +1461,7 @@ from bl_stu_answer where main_id = #{id} GROUP BY major order by major - select '责任担当' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常满意', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较满意', @@ -1582,7 +1582,7 @@ select concat(round(round(sum(SUYANG_TISHENG2)/count('x'),2))) from bl_stu_answer where main_id = #{id} - select '学生评价核心素养满意度' as 'key', round(round(sum(SUYANG_RENWEN2)/count('x'),2)) as '人文底蕴', @@ -1595,7 +1595,7 @@ from bl_stu_answer where main_id = #{id} - select '人文底蕴' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04' from (select round(round(sum(SUYANG_RENWEN2)/count('x'),2))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, @@ -1646,7 +1646,7 @@ (select round(round(sum(SUYANG_TISHENG2)/count('x'),2))as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select major as 'key', round(sum(SUYANG_RENWEN2)/count('x')) as '01', round(sum(SUYANG_KEXUE2)/count('x')) as '02', @@ -1658,7 +1658,7 @@ from bl_stu_answer where main_id = #{id} GROUP BY major order by major - select '依法依规,履行教师职责' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常满意', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较满意', @@ -1728,7 +1728,7 @@ select concat(round(round(sum(TEACHERSATI_CARE2)/count('x'),2))) from bl_stu_answer where main_id = #{id} - select '教学工作各方面满意度' as 'key', concat(round(round(sum(TEACHERSATI_MORAL2)/count('x'),2))) as '师德师风及精神面貌', @@ -1738,7 +1738,7 @@ from bl_stu_answer where main_id = #{id} - select '师德师风及精神面貌' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04' from (select round(round(sum(TEACHERSATI_MORAL2)/count('x'),2))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, @@ -1768,7 +1768,7 @@ (select round(round(sum(TEACHERSATI_CARE2)/count('x'),2))as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select major as 'key', round(sum(TEACHERSATI_MORAL2)/count('x')) as '01', round(sum(TEACHERSATI_INPUT2)/count('x')) as '02', @@ -1801,7 +1801,7 @@ (select count('x') as tot_cnt from bl_stu_answer where main_id = #{id})b - select '教学满意度' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常满意', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较满意', @@ -1819,11 +1819,11 @@ select concat(round(sum(TEACHERSATI_ZONGTI2)/count(*))) from bl_stu_answer where main_id = #{id} - select '教学满意度' as 'key',concat(round(sum(TEACHERSATI_ZONGTI2)/count(*))) as '01' from bl_stu_answer where main_id = #{id} - select '教学满意度' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04' from (select round(sum(TEACHERSATI_ZONGTI2)/count(*))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, @@ -1832,11 +1832,11 @@ (select round(sum(TEACHERSATI_ZONGTI2)/count(*))as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select major as 'key',round(sum(TEACHERSATI_ZONGTI2)/count(*))as '01' from bl_stu_answer where main_id = #{id} GROUP BY MAJOR - select '清楚地向学生解释了所学课程的目标和要求' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常符合', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较符合', @@ -1923,7 +1923,7 @@ select round(sum(TEACHER_AFTER2)/count('x'),2) from bl_stu_answer where main_id = #{id} - select '教师各方面教学行为评价' as 'key', round(sum(TEACHER_YUREN2)/count('x'),2) as '重视立德树人,注重发挥课程育人的作用', @@ -1934,7 +1934,7 @@ from bl_stu_answer where main_id = #{id}; - select '重视立德树人,注重发挥课程育人的作用' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04' from (select round(sum(TEACHER_YUREN2)/count('x'),2)as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, (select round(sum(TEACHER_YUREN2)/count('x'),2)as d2 from bl_stu_answer where main_id = #{id} and nianji = '大二' )b, @@ -1966,7 +1966,7 @@ (select round(sum(TEACHER_AFTER2)/count('x'),2)as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select major as 'key', round(sum(TEACHER_YUREN2)/count('x'),2) as '01', round(sum(TEACHER_OBJECT2)/count('x'),2) as '02', @@ -1976,7 +1976,7 @@ from bl_stu_answer where main_id = #{id} GROUP BY major order by major - select '校内学术讲座报告活动多' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常符合', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较符合', @@ -2046,7 +2046,7 @@ select round(sum(STUDENTCENTER_LECTURE2)/count('x'),2) from bl_stu_answer where main_id = #{id} - select '本校体现“学生中心”和安全管理评价各项占比' as 'key', round(sum(STUDENTCENTER_STUDENT2)/count('x'),2) as '学生服务能够做到“一站式”的服务与解决,体现了对学生的关怀', @@ -2056,7 +2056,7 @@ from bl_stu_answer where main_id = #{id} - select '学生服务能够做到“一站式”的服务与解决,体现了对学生的关怀' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04' from (select round(sum(STUDENTCENTER_STUDENT2)/count('x'),2)as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, (select round(sum(STUDENTCENTER_STUDENT2)/count('x'),2)as d2 from bl_stu_answer where main_id = #{id} and nianji = '大二' )b, @@ -2082,7 +2082,7 @@ (select round(sum(STUDENTCENTER_LECTURE2)/count('x'),2)as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select major as 'key', round(sum(STUDENTCENTER_STUDENT2)/count('x'),2) as '01', round(sum(STUDENTCENTER_EXPERIMENT2)/count('x'),2) as '02', @@ -2115,7 +2115,7 @@ select concat(round(round(b.no_cnt/a.tot_cnt,2)*100)) from (select count('x') as tot_cnt from bl_stu_answer where main_id = #{id})a,(select count('x') as no_cnt from bl_stu_answer where main_id = #{id} and XYZD_NO = #{id})b - select '学校或学院提供的辅导课程或相关活动' as 'key' ,round(round(b.no_cnt/a.tot_cnt,2)*100) as '01' from (select count('x') as tot_cnt from bl_stu_answer where main_id = #{id})a,(select count('x') as no_cnt from bl_stu_answer where main_id = #{id} and XYZD_KECHENG = #{id})b union all select '任课教师帮助解决相关问题' as 'key' ,round(round(b.no_cnt/a.tot_cnt,2)*100) as '01' from (select count('x') as tot_cnt from bl_stu_answer where main_id = #{id})a,(select count('x') as no_cnt from bl_stu_answer where main_id = #{id} and XYZD_JIAOSHI = #{id})b @@ -2129,7 +2129,7 @@ select '没有接受过本校提供的学业指导服务' as 'key' ,round(round(b.no_cnt/a.tot_cnt,2)*100) as '01' from (select count('x') as tot_cnt from bl_stu_answer where main_id = #{id})a,(select count('x') as no_cnt from bl_stu_answer where main_id = #{id} and XYZD_NO = #{id})b - select '学校或学院提供的辅导课程或相关活动' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04' from (select round(round(sum(XYZD_KECHENG)/count('x'),2)*100)as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, (select round(round(sum(XYZD_KECHENG)/count('x'),2)*100)as d2 from bl_stu_answer where main_id = #{id} and nianji = '大二' )b, @@ -2167,7 +2167,7 @@ (select round(round(sum(XYZD_NO)/count('x'),2)*100)as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select major as 'key', round(round(sum(XYZD_KECHENG)/count('x'),2)*100) as '01', round(round(sum(XYZD_WANGZHAN)/count('x'),2)*100) as '02', @@ -2178,7 +2178,7 @@ from bl_stu_answer where main_id = #{id} GROUP BY major order by major - select '班主任、辅导员工作' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常满意', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较满意', @@ -2265,7 +2265,7 @@ select concat(round(round(sum(STUSATI_ZZ2)/count('x'),2))) from bl_stu_answer where main_id = #{id} - select '各项学生工作满意度' as 'key', round(round(sum(STUSATI_PHYCHO2)/count('x'),2)) as '心理健康教育/咨询', @@ -2276,7 +2276,7 @@ from bl_stu_answer where main_id = #{id} - select '心理健康教育/咨询' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04' from (select round(round(sum(STUSATI_PHYCHO2)/count('x'),2))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, (select round(round(sum(STUSATI_PHYCHO2)/count('x'),2))as d2 from bl_stu_answer where main_id = #{id} and nianji = '大二' )b, @@ -2308,7 +2308,7 @@ (select round(round(sum(STUSATI_ZZ2)/count('x'),2))as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select major as 'key', round(sum(STUSATI_PHYCHO2)/count('x')) as '01', round(sum(STUSATI_PLAN2)/count('x')) as '02', @@ -2318,7 +2318,7 @@ from bl_stu_answer where main_id = #{id} GROUP BY major order by major - select '图书馆资源' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常满意', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较满意', @@ -2422,7 +2422,7 @@ select concat(round(round(sum(CAMPUS_RESIDENCE2)/count('x'),2))) from bl_stu_answer where main_id = #{id} - select 'key' as 'key', round(round(sum(CAMPUS_EQUIPMENT2)/count('x'),2)) as '教室及教学设备', @@ -2434,7 +2434,7 @@ from bl_stu_answer where main_id = #{id} - select '教室及教学设备' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04' from (select round(round(sum(CAMPUS_EQUIPMENT2)/count('x'),2))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, (select round(round(sum(CAMPUS_EQUIPMENT2)/count('x'),2))as d2 from bl_stu_answer where main_id = #{id} and nianji = '大二' )b, @@ -2472,7 +2472,7 @@ (select round(round(sum(CAMPUS_RESIDENCE2)/count('x'),2))as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select major as 'key', round(sum(CAMPUS_EQUIPMENT2)/count('x')) as '01', round(sum(CAMPUS_LAB2)/count('x')) as '02', @@ -2507,7 +2507,7 @@ (select count('x') as tot_cnt from bl_stu_answer where main_id = #{id})b - select '教学满意度' as 'key', round(round(a.fc_cnt/f.tot_cnt,2)*100) as '非常满意', round(round(b.bj_cnt/f.tot_cnt,2)*100) as '比较满意', @@ -2525,11 +2525,11 @@ select concat(round(sum(SATI_ZONGTI2)/count(*))) from bl_stu_answer where main_id = #{id} - select '总体满意度',round(sum(SATI_ZONGTI2)/count(*)) as '01' from bl_stu_answer where main_id = #{id} - select '对学校的总体满意度' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04' from (select round(sum(SATI_ZONGTI2)/count(*))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a, @@ -2538,7 +2538,7 @@ (select round(sum(SATI_ZONGTI2)/count(*))as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d - select major as 'key',round(sum(SATI_ZONGTI2)/count(*)) as '01' from bl_stu_answer where main_id = #{id} GROUP BY MAJOR diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/blStuAnswer/service/impl/BlStuAnswerServiceImpl.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/blStuAnswer/service/impl/BlStuAnswerServiceImpl.java index b8c424f..cee203e 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/blStuAnswer/service/impl/BlStuAnswerServiceImpl.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/blStuAnswer/service/impl/BlStuAnswerServiceImpl.java @@ -10,6 +10,7 @@ import com.google.common.collect.Sets; import lombok.extern.slf4j.Slf4j; import org.apache.commons.compress.utils.Lists; import org.apache.commons.lang3.StringUtils; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.modules.demo.blStuAnswer.entity.BlStuAnswer; import org.jeecg.modules.demo.blStuAnswer.mapper.BlStuAnswerMapper; import org.jeecg.modules.demo.blStuAnswer.service.IBlStuAnswerService; @@ -22,6 +23,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.List; import java.util.Map; import java.util.Set; @@ -29,6 +31,7 @@ import java.util.concurrent.Callable; import java.util.concurrent.CompletionService; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; import java.util.function.Function; @@ -56,478 +59,504 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result = Maps.newHashMap(); - result.put("schoolName", blStuMain.getSchoolName());//学校名称 - result.put("pgdw", blStuMain.getPgdw());//评估单位 - result.put("pgrq", blStuMain.getPgrq());//评估日期 - result.put("xuenian", blStuMain.getXuenian());//学年 - result.put("dysd", blStuMain.getDysd());//调研时点 - result.put("stuSumno", stuSumno);//学校名称 - result.put("dtsl", dtsl);//答题数量 - result.put("dtl", dtl);//答题率 - //尝试异步加快导出速度 - log.info("多线程主线程开始执行"); - //多线程执行 - CompletionService threadService = ThreadUtil.newCompletionService(Executors.newFixedThreadPool(100)); - List> calls = com.google.common.collect.Lists.newArrayList(); - calls.add(() -> { - t1_1(wo, result, id); - return true; - }); - calls.add(() -> { - i1_1(wo, result, id); - return true; - }); - calls.add(() -> { - b1_1(wo, result, id); - return true; - }); - calls.add(() -> { - i1_2(wo, result, id); - return true; - }); - calls.add(() -> { - t1_3(wo, result, id); - return true; - }); - calls.add(() -> { - t1_4(wo, result, id); - return true; - }); - calls.add(() -> { - b1_2(wo, result, id); - return true; - }); - calls.add(() -> { - t1_5(wo, result, id); - return true; - }); - calls.add(() -> { - t1_6(wo, result, id); - return true; - }); - calls.add(() -> { - b1_2_5(wo, result, id); - return true; - }); - calls.add(() -> { - t1_7(wo, result, id); - return true; - }); - calls.add(() -> { - t1_8(wo, result, id); - return true; - }); - calls.add(() -> { - b1_3(wo, result, id); - return true; - }); - calls.add(() -> { - i1_9(wo, result, id); - return true; - }); - calls.add(() -> { - t1_10(wo, result, id); - return true; - }); - calls.add(() -> { - t1_11(wo, result, id); - return true; - }); - calls.add(() -> { - b1_4(wo, result, id); - return true; - }); - calls.add(() -> { - i1_12(wo, result, id); - return true; - }); - calls.add(() -> { - i1_13(wo, result, id); - return true; - }); - calls.add(() -> { - t1_14(wo, result, id); - return true; - }); - calls.add(() -> { - b2_1(wo, result, id); - return true; - }); - calls.add(() -> { - i2_1(wo, result, id); - return true; - }); - calls.add(() -> { - b2_1_5(wo, result, id); - return true; - }); - calls.add(() -> { - i2_2(wo, result, id); - return true; - }); - calls.add(() -> { - t2_3(wo, result, id); - return true; - }); - calls.add(() -> { - t2_4(wo, result, id); - return true; - }); - calls.add(() -> { - i2_5(wo, result, id); - return true; - }); - calls.add(() -> { - b2_1_6(wo, result, id); - return true; - }); - calls.add(() -> { - i2_6(wo, result, id); - return true; - }); - calls.add(() -> { - t2_7(wo, result, id); - return true; - }); - calls.add(() -> { - i2_8(wo, result, id); - return true; - }); - calls.add(() -> { - b2_2_1(wo, result, id); - return true; - }); - calls.add(() -> { - i2_9(wo, result, id); - return true; - }); - calls.add(() -> { - t2_10(wo, result, id); - return true; - }); - calls.add(() -> { - t2_11(wo, result, id); - return true; - }); - calls.add(() -> { - i2_12(wo, result, id); - return true; - }); - calls.add(() -> { - b2_3_1(wo, result, id); - return true; - }); - calls.add(() -> { - i2_13(wo, result, id); - return true; - }); - calls.add(() -> { - t2_14(wo, result, id); - return true; - }); - calls.add(() -> { - t2_15(wo, result, id); - return true; - }); - calls.add(() -> { - b2_4_1(wo, result, id); - return true; - }); - calls.add(() -> { - i2_16(wo, result, id); - return true; - }); - calls.add(() -> { - i2_17(wo, result, id); - return true; - }); - calls.add(() -> { - b2_5_1(wo, result, id); - return true; - }); - calls.add(() -> { - i2_18(wo, result, id); - return true; - }); - calls.add(() -> { - t2_19(wo, result, id); - return true; - }); - calls.add(() -> { - t2_20(wo, result, id); - return true; - }); - calls.add(() -> { - b2_6_1(wo, result, id); - return true; - }); - calls.add(() -> { - i2_21(wo, result, id); - return true; - }); - calls.add(() -> { - i2_22(wo, result, id); - return true; - }); - calls.add(() -> { - b2_6_6(wo, result, id); - return true; - }); - calls.add(() -> { - i2_23(wo, result, id); - return true; - }); - calls.add(() -> { - t2_24(wo, result, id); - return true; - }); - calls.add(() -> { - t2_25(wo, result, id); - return true; - }); - calls.add(() -> { - i2_26(wo, result, id); - return true; - }); - calls.add(() -> { - b2_7_1(wo, result, id); - return true; - }); - calls.add(() -> { - i2_27(wo, result, id); - return true; - }); - calls.add(() -> { - t2_28(wo, result, id); - return true; - }); - calls.add(() -> { - i2_29(wo, result, id); - return true; - }); - calls.add(() -> { - b2_8_1(wo, result, id); - return true; - }); - calls.add(() -> { - i2_30(wo, result, id); - return true; - }); - calls.add(() -> { - t2_31(wo, result, id); - return true; - }); - calls.add(() -> { - t2_32(wo, result, id); - return true; - }); - calls.add(() -> { - i2_33(wo, result, id); - return true; - }); - calls.add(() -> { - b2_9_1(wo, result, id); - return true; - }); - calls.add(() -> { - i2_34(wo, result, id); - return true; - }); - calls.add(() -> { - t2_35(wo, result, id); - return true; - }); - calls.add(() -> { - t2_36(wo, result, id); - return true; - }); - calls.add(() -> { - i3_1(wo, result, id); - return true; - }); - calls.add(() -> { - b3_1_1(wo, result, id); - return true; - }); - calls.add(() -> { - i3_2(wo, result, id); - return true; - }); - calls.add(() -> { - t3_3(wo, result, id); - return true; - }); - calls.add(() -> { - t3_4(wo, result, id); - return true; - }); - calls.add(() -> { - b3_2_1(wo, result, id); - return true; - }); - calls.add(() -> { - i3_5(wo, result, id); - return true; - }); - calls.add(() -> { - b3_2_5(wo, result, id); - return true; - }); - calls.add(() -> { - i3_6(wo, result, id); - return true; - }); - calls.add(() -> { - t3_7(wo, result, id); - return true; - }); - calls.add(() -> { - t3_8(wo, result, id); - return true; - }); - calls.add(() -> { - i3_9(wo, result, id); - return true; - }); - calls.add(() -> { - b3_3_1(wo, result, id); - return true; - }); - calls.add(() -> { - i3_10(wo, result, id); - return true; - }); - calls.add(() -> { - t3_11(wo, result, id); - return true; - }); - calls.add(() -> { - t3_12(wo, result, id); - return true; - }); - calls.add(() -> { - i4_1(wo, result, id); - return true; - }); - calls.add(() -> { - b4_1_1(wo, result, id); - return true; - }); - calls.add(() -> { - i4_2(wo, result, id); - return true; - }); - calls.add(() -> { - t4_3(wo, result, id); - return true; - }); - calls.add(() -> { - t4_4(wo, result, id); - return true; - }); - calls.add(() -> { - b4_2_1(wo, result, id); - return true; - }); - calls.add(() -> { - i4_5(wo, result, id); - return true; - }); - calls.add(() -> { - t4_6(wo, result, id); - return true; - }); - calls.add(() -> { - t4_7(wo, result, id); - return true; - }); - calls.add(() -> { - i4_8(wo, result, id); - return true; - }); - calls.add(() -> { - b4_3_1(wo, result, id); - return true; - }); - calls.add(() -> { - i4_9(wo, result, id); - return true; - }); - calls.add(() -> { - t4_10(wo, result, id); - return true; - }); - calls.add(() -> { - t4_11(wo, result, id); - return true; - }); - calls.add(() -> { - i4_12(wo, result, id); - return true; - }); - calls.add(() -> { - b4_4_1(wo, result, id); - return true; - }); - calls.add(() -> { - i4_13(wo, result, id); - return true; - }); - calls.add(() -> { - t4_14(wo, result, id); - return true; - }); - calls.add(() -> { - t4_15(wo, result, id); - return true; - }); - calls.add(() -> { - b5_1_1(wo, result, id); - return true; - }); - calls.add(() -> { - i5_1(wo, result, id); - return true; - }); - calls.add(() -> { - b5_1_5(wo, result, id); - return true; - }); - calls.add(() -> { - i5_2(wo, result, id); - return true; - }); - calls.add(() -> { - t5_3(wo, result, id); - return true; - }); - calls.add(() -> { - t5_4(wo, result, id); - return true; - }); + return createWordTjfxB(id); + } - calls.forEach(threadService::submit); - calls.forEach(fn -> { - try { - threadService.take(); - } catch (Exception e) { - log.error(e.getMessage(),e); + public WordOperator createWordTjfxA(String id) { + String templateName = "exp1\\student-tjfx.docx"; + try { + final WordOperator wo = ExportWord.getWordOperator(templateName); + BlStuInfo blStuMain = blStuInfoMapper.selectById(id); + String stuSumno = blStuMain.getStuSumno(); + if (StringUtils.isBlank(stuSumno)) { + stuSumno = "26765"; } - }); - log.info("多线程主线程结束执行"); - WordOperator wo2 = WordOperator.twoReplaceWord(wo); - wo2.replaceTextPlus(result); - return wo2; + String dtsl = baseMapper.selectDtsl(id);//答题数量 + String dtl = String.format("%.2f", Double.parseDouble(dtsl) / Double.parseDouble(stuSumno) * 100);//答题率 + Map result = Maps.newHashMap(); + result.put("schoolName", blStuMain.getSchoolName());//学校名称 + result.put("pgdw", blStuMain.getPgdw());//评估单位 + result.put("pgrq", blStuMain.getPgrq());//评估日期 + result.put("xuenian", blStuMain.getXuenian());//学年 + result.put("dysd", blStuMain.getDysd());//调研时点 + result.put("stuSumno", stuSumno);//学校名称 + result.put("dtsl", dtsl);//答题数量 + result.put("dtl", dtl);//答题率 + //尝试异步加快导出速度 + log.info("多线程主线程开始执行"); + //多线程执行 + CompletionService threadService = ThreadUtil.newCompletionService(Executors.newFixedThreadPool(100)); + List> calls = com.google.common.collect.Lists.newArrayList(); + calls.add(() -> { + t1_1(wo, result, id); + return true; + }); + calls.add(() -> { + i1_1(wo, result, id); + return true; + }); + calls.add(() -> { + b1_1(wo, result, id); + return true; + }); + calls.add(() -> { + i1_2(wo, result, id); + return true; + }); + calls.add(() -> { + t1_3(wo, result, id); + return true; + }); + calls.add(() -> { + t1_4(wo, result, id); + return true; + }); + calls.add(() -> { + b1_2(wo, result, id); + return true; + }); + calls.add(() -> { + t1_5(wo, result, id); + return true; + }); + calls.add(() -> { + t1_6(wo, result, id); + return true; + }); + calls.add(() -> { + b1_2_5(wo, result, id); + return true; + }); + calls.add(() -> { + t1_7(wo, result, id); + return true; + }); + calls.add(() -> { + t1_8(wo, result, id); + return true; + }); + calls.add(() -> { + b1_3(wo, result, id); + return true; + }); + calls.add(() -> { + i1_9(wo, result, id); + return true; + }); + calls.add(() -> { + t1_10(wo, result, id); + return true; + }); + calls.add(() -> { + t1_11(wo, result, id); + return true; + }); + calls.add(() -> { + b1_4(wo, result, id); + return true; + }); + calls.add(() -> { + i1_12(wo, result, id); + return true; + }); + calls.add(() -> { + i1_13(wo, result, id); + return true; + }); + calls.add(() -> { + t1_14(wo, result, id); + return true; + }); + calls.add(() -> { + b2_1(wo, result, id); + return true; + }); + calls.add(() -> { + i2_1(wo, result, id); + return true; + }); + calls.add(() -> { + b2_1_5(wo, result, id); + return true; + }); + calls.add(() -> { + i2_2(wo, result, id); + return true; + }); + calls.add(() -> { + t2_3(wo, result, id); + return true; + }); + calls.add(() -> { + t2_4(wo, result, id); + return true; + }); + calls.add(() -> { + i2_5(wo, result, id); + return true; + }); + calls.add(() -> { + b2_1_6(wo, result, id); + return true; + }); + calls.add(() -> { + i2_6(wo, result, id); + return true; + }); + calls.add(() -> { + t2_7(wo, result, id); + return true; + }); + calls.add(() -> { + i2_8(wo, result, id); + return true; + }); + calls.add(() -> { + b2_2_1(wo, result, id); + return true; + }); + calls.add(() -> { + i2_9(wo, result, id); + return true; + }); + calls.add(() -> { + t2_10(wo, result, id); + return true; + }); + calls.add(() -> { + t2_11(wo, result, id); + return true; + }); + calls.add(() -> { + i2_12(wo, result, id); + return true; + }); + calls.add(() -> { + b2_3_1(wo, result, id); + return true; + }); + calls.add(() -> { + i2_13(wo, result, id); + return true; + }); + calls.add(() -> { + t2_14(wo, result, id); + return true; + }); + calls.add(() -> { + t2_15(wo, result, id); + return true; + }); + calls.add(() -> { + b2_4_1(wo, result, id); + return true; + }); + calls.add(() -> { + i2_16(wo, result, id); + return true; + }); + calls.add(() -> { + i2_17(wo, result, id); + return true; + }); + calls.add(() -> { + b2_5_1(wo, result, id); + return true; + }); + calls.add(() -> { + i2_18(wo, result, id); + return true; + }); + calls.add(() -> { + t2_19(wo, result, id); + return true; + }); + calls.add(() -> { + t2_20(wo, result, id); + return true; + }); + calls.add(() -> { + b2_6_1(wo, result, id); + return true; + }); + calls.add(() -> { + i2_21(wo, result, id); + return true; + }); + calls.add(() -> { + i2_22(wo, result, id); + return true; + }); + calls.add(() -> { + b2_6_6(wo, result, id); + return true; + }); + calls.add(() -> { + i2_23(wo, result, id); + return true; + }); + calls.add(() -> { + t2_24(wo, result, id); + return true; + }); + calls.add(() -> { + t2_25(wo, result, id); + return true; + }); + calls.add(() -> { + i2_26(wo, result, id); + return true; + }); + calls.add(() -> { + b2_7_1(wo, result, id); + return true; + }); + calls.add(() -> { + i2_27(wo, result, id); + return true; + }); + calls.add(() -> { + t2_28(wo, result, id); + return true; + }); + calls.add(() -> { + i2_29(wo, result, id); + return true; + }); + calls.add(() -> { + b2_8_1(wo, result, id); + return true; + }); + calls.add(() -> { + i2_30(wo, result, id); + return true; + }); + calls.add(() -> { + t2_31(wo, result, id); + return true; + }); + calls.add(() -> { + t2_32(wo, result, id); + return true; + }); + calls.add(() -> { + i2_33(wo, result, id); + return true; + }); + calls.add(() -> { + b2_9_1(wo, result, id); + return true; + }); + calls.add(() -> { + i2_34(wo, result, id); + return true; + }); + calls.add(() -> { + t2_35(wo, result, id); + return true; + }); + calls.add(() -> { + t2_36(wo, result, id); + return true; + }); + calls.add(() -> { + i3_1(wo, result, id); + return true; + }); + calls.add(() -> { + b3_1_1(wo, result, id); + return true; + }); + calls.add(() -> { + i3_2(wo, result, id); + return true; + }); + calls.add(() -> { + t3_3(wo, result, id); + return true; + }); + calls.add(() -> { + t3_4(wo, result, id); + return true; + }); + calls.add(() -> { + b3_2_1(wo, result, id); + return true; + }); + calls.add(() -> { + i3_5(wo, result, id); + return true; + }); + calls.add(() -> { + b3_2_5(wo, result, id); + return true; + }); + calls.add(() -> { + i3_6(wo, result, id); + return true; + }); + calls.add(() -> { + t3_7(wo, result, id); + return true; + }); + calls.add(() -> { + t3_8(wo, result, id); + return true; + }); + calls.add(() -> { + i3_9(wo, result, id); + return true; + }); + calls.add(() -> { + b3_3_1(wo, result, id); + return true; + }); + calls.add(() -> { + i3_10(wo, result, id); + return true; + }); + calls.add(() -> { + t3_11(wo, result, id); + return true; + }); + calls.add(() -> { + t3_12(wo, result, id); + return true; + }); + calls.add(() -> { + i4_1(wo, result, id); + return true; + }); + calls.add(() -> { + b4_1_1(wo, result, id); + return true; + }); + calls.add(() -> { + i4_2(wo, result, id); + return true; + }); + calls.add(() -> { + t4_3(wo, result, id); + return true; + }); + calls.add(() -> { + t4_4(wo, result, id); + return true; + }); + calls.add(() -> { + b4_2_1(wo, result, id); + return true; + }); + calls.add(() -> { + i4_5(wo, result, id); + return true; + }); + calls.add(() -> { + t4_6(wo, result, id); + return true; + }); + calls.add(() -> { + t4_7(wo, result, id); + return true; + }); + calls.add(() -> { + i4_8(wo, result, id); + return true; + }); + calls.add(() -> { + b4_3_1(wo, result, id); + return true; + }); + calls.add(() -> { + i4_9(wo, result, id); + return true; + }); + calls.add(() -> { + t4_10(wo, result, id); + return true; + }); + calls.add(() -> { + t4_11(wo, result, id); + return true; + }); + calls.add(() -> { + i4_12(wo, result, id); + return true; + }); + calls.add(() -> { + b4_4_1(wo, result, id); + return true; + }); + calls.add(() -> { + i4_13(wo, result, id); + return true; + }); + calls.add(() -> { + t4_14(wo, result, id); + return true; + }); + calls.add(() -> { + t4_15(wo, result, id); + return true; + }); + calls.add(() -> { + b5_1_1(wo, result, id); + return true; + }); + calls.add(() -> { + i5_1(wo, result, id); + return true; + }); + calls.add(() -> { + b5_1_5(wo, result, id); + return true; + }); + calls.add(() -> { + i5_2(wo, result, id); + return true; + }); + calls.add(() -> { + t5_3(wo, result, id); + return true; + }); + calls.add(() -> { + t5_4(wo, result, id); + return true; + }); + + calls.forEach(threadService::submit); + calls.forEach(fn -> { + try { + threadService.take(); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + }); + log.info("多线程主线程结束执行"); + WordOperator wo2 = WordOperator.twoReplaceWord(wo); + wo2.replaceTextPlus(result); + return wo2; + } catch (Exception e) { + log.error(e.getMessage(), e); + throw new JeecgBootException(e); + } + } + + public WordOperator createWordTjfxB(String id) { + String templateName = "exp1\\student-tjfx.docx"; + try { + final WordOperator wo = ExportWord.getWordOperator(templateName); + Map result = Maps.newHashMap(); + + i1_13(wo, result, id); + + WordOperator wo2 = WordOperator.twoReplaceWord(wo); + wo2.replaceTextPlus(result); + return wo2; + } catch (Exception e) { + log.error(e.getMessage(), e); + throw new JeecgBootException(e); + } } /** @@ -536,18 +565,34 @@ public class BlStuAnswerServiceImpl extends ServiceImpl dataList, int i) { + var data = dataList.get(i); + if(Integer.parseInt(data) == 0){ + return getNotZeroData(dataList, --i); + } else { + return i; + } + } + /** * 堆叠横向柱状图 * @param list * @return */ public String getStackHistogram(List> list) { - var colorList = List.of("#0f447f","#2350a0", "#008ac8", "#57b8e7", "beedf8"); + return getStackHistogram(list, true); + } + + /** + * 堆叠横向柱状图 + * @param list + * @return + */ + public String getStackHistogram(List> list, boolean isAutoCompletionPercentage ) { + var colorList = List.of("#0f447f","#2350a0", "#008ac8", "#57b8e7", "#beedf8"); AtomicInteger i = new AtomicInteger(0); Function getColor = _i -> { if(colorList.size() - 1 < _i.get()) { @@ -608,6 +672,37 @@ public class BlStuAnswerServiceImpl extends ServiceImpl data = list.get(0); Set nameSet = Sets.filter(data.keySet(), key -> !KEY.equals(key)); nameList.addAll(nameSet); + + //先计算是否100 + if(isAutoCompletionPercentage) { + list.forEach(map -> { + List keys = Lists.newArrayList(); + List __l = Lists.newArrayList(); + //清洗数据,不足100最后一个补n,超过100最后一个-1,减后为负数返还,找前一个减,同理,直到第0个 + var sumAtom = new AtomicReference<>(new BigDecimal("0")); + map.keySet().forEach(key -> { + if (!StringUtils.equals(KEY, key)) { + keys.add(key); + __l.add(getMapStr(map.get(key))); + sumAtom.set(sumAtom.get().add(new BigDecimal(getMapStr(map.get(key))))); + } + }); + var sumi = Integer.parseInt(NumberUtil.decimalFormat("#", sumAtom.get())); + var diffi = sumi - 100; + //计算差值 + if(diffi != 0){ + //大了,减一减 + var index = getNotZeroData(__l,__l.size()-1); + var lastNumStr = __l.get(index); + //加上﹣的差值 + var outNum = new BigDecimal(lastNumStr).add(new BigDecimal(diffi).negate()); + var key = keys.get(index); + //返还过去 + map.put(key, NumberUtil.decimalFormat("#", outNum)); + } + }); + } + Map> valueListMap = Maps.newHashMap(); //组装数据 list.forEach(x -> { @@ -622,6 +717,8 @@ public class BlStuAnswerServiceImpl extends ServiceImpl { if(valueListMap.containsKey(x)) { @@ -632,9 +729,6 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b1_1_1", baseMapper.b1_1_1(id)); - result.put("b1_1_2", baseMapper.b1_1_2(id)); - result.put("b1_1_3", baseMapper.b1_1_3(id)); - result.put("b1_1_4", baseMapper.b1_1_4(id)); + result.put("b1_1_1", getMapStr(baseMapper.b1_1_1(id))); + result.put("b1_1_2", getMapStr(baseMapper.b1_1_2(id))); + result.put("b1_1_3", getMapStr(baseMapper.b1_1_3(id))); + result.put("b1_1_4", getMapStr(baseMapper.b1_1_4(id))); } //图片i1_2 @@ -939,10 +1033,10 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b1_2_1", baseMapper.b1_2_1(id)); - result.put("b1_2_2", baseMapper.b1_2_2(id)); - result.put("b1_2_3", baseMapper.b1_2_3(id)); - result.put("b1_2_4", baseMapper.b1_2_4(id)); + result.put("b1_2_1", getMapStr(baseMapper.b1_2_1(id))); + result.put("b1_2_2", getMapStr(baseMapper.b1_2_2(id))); + result.put("b1_2_3", getMapStr(baseMapper.b1_2_3(id))); + result.put("b1_2_4", getMapStr(baseMapper.b1_2_4(id))); } //表格 t1_5 @@ -981,10 +1075,10 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b1_2_5", baseMapper.b1_2_5(id)); - result.put("b1_2_6", baseMapper.b1_2_6(id)); - result.put("b1_2_7", baseMapper.b1_2_7(id)); - result.put("b1_2_8", baseMapper.b1_2_8(id)); + result.put("b1_2_5", getMapStr(baseMapper.b1_2_5(id))); + result.put("b1_2_6", getMapStr(baseMapper.b1_2_6(id))); + result.put("b1_2_7", getMapStr(baseMapper.b1_2_7(id))); + result.put("b1_2_8", getMapStr(baseMapper.b1_2_8(id))); } //表格 t1_7 @@ -1024,10 +1118,10 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b1_3_1", baseMapper.b1_3_1(id)); - result.put("b1_3_2", baseMapper.b1_3_2(id)); - result.put("b1_3_3", baseMapper.b1_3_3(id)); - result.put("b1_3_4", baseMapper.b1_3_4(id)); + result.put("b1_3_1", getMapStr(baseMapper.b1_3_1(id))); + result.put("b1_3_2", getMapStr(baseMapper.b1_3_2(id))); + result.put("b1_3_3", getMapStr(baseMapper.b1_3_3(id))); + result.put("b1_3_4", getMapStr(baseMapper.b1_3_4(id))); } //图片i1_9 @@ -1073,8 +1167,8 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b1_4_1", baseMapper.b1_4_1(id)); - result.put("b1_4_2", baseMapper.b1_4_2(id)); + result.put("b1_4_1", getMapStr(baseMapper.b1_4_1(id))); + result.put("b1_4_2", getMapStr(baseMapper.b1_4_2(id))); } //图片i1_12 @@ -1110,10 +1204,10 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b2_1_1", baseMapper.b2_1_1(id)); - result.put("b2_1_2", baseMapper.b2_1_2(id)); - result.put("b2_1_3", baseMapper.b2_1_3(id)); - result.put("b2_1_4", baseMapper.b2_1_4(id)); + result.put("b2_1_1", getMapStr(baseMapper.b2_1_1(id))); + result.put("b2_1_2", getMapStr(baseMapper.b2_1_2(id))); + result.put("b2_1_3", getMapStr(baseMapper.b2_1_3(id))); + result.put("b2_1_4", getMapStr(baseMapper.b2_1_4(id))); } //图片i2_1 @@ -1124,7 +1218,7 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b2_1_5", baseMapper.b2_1_5(id)); + result.put("b2_1_5", getMapStr(baseMapper.b2_1_5(id))); } //图片i2_2 public void i2_2(WordOperator wo, Map result, String id) { @@ -1171,10 +1265,10 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b2_1_6", baseMapper.b2_1_6(id)); - result.put("b2_1_7", baseMapper.b2_1_7(id)); - result.put("b2_1_8", baseMapper.b2_1_8(id)); - result.put("b2_1_9", baseMapper.b2_1_9(id)); + result.put("b2_1_6", getMapStr(baseMapper.b2_1_6(id))); + result.put("b2_1_7", getMapStr(baseMapper.b2_1_7(id))); + result.put("b2_1_8", getMapStr(baseMapper.b2_1_8(id))); + result.put("b2_1_9", getMapStr(baseMapper.b2_1_9(id))); } //图片i2_6 @@ -1211,12 +1305,12 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b2_2_1", baseMapper.b2_2_1(id)); - result.put("b2_2_2", baseMapper.b2_2_2(id)); - result.put("b2_2_3", baseMapper.b2_2_3(id)); - result.put("b2_2_4", baseMapper.b2_2_4(id)); - result.put("b2_2_5", baseMapper.b2_2_5(id)); - result.put("b2_2_6", baseMapper.b2_2_6(id)); + result.put("b2_2_1", getMapStr(baseMapper.b2_2_1(id))); + result.put("b2_2_2", getMapStr(baseMapper.b2_2_2(id))); + result.put("b2_2_3", getMapStr(baseMapper.b2_2_3(id))); + result.put("b2_2_4", getMapStr(baseMapper.b2_2_4(id))); + result.put("b2_2_5", getMapStr(baseMapper.b2_2_5(id))); + result.put("b2_2_6", getMapStr(baseMapper.b2_2_6(id))); } //图片i2_9 @@ -1272,10 +1366,10 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b2_3_1", baseMapper.b2_3_1(id)); - result.put("b2_3_2", baseMapper.b2_3_2(id)); - result.put("b2_3_3", baseMapper.b2_3_3(id)); - result.put("b2_3_4", baseMapper.b2_3_4(id)); + result.put("b2_3_1", getMapStr(baseMapper.b2_3_1(id))); + result.put("b2_3_2", getMapStr(baseMapper.b2_3_2(id))); + result.put("b2_3_3", getMapStr(baseMapper.b2_3_3(id))); + result.put("b2_3_4", getMapStr(baseMapper.b2_3_4(id))); } //图片i2_13 public void i2_13(WordOperator wo, Map result, String id) { @@ -1321,12 +1415,12 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b2_4_1", baseMapper.b2_4_1(id)); - result.put("b2_4_2", baseMapper.b2_4_2(id)); - result.put("b2_4_3", baseMapper.b2_4_3(id)); - result.put("b2_4_4", baseMapper.b2_4_4(id)); - result.put("b2_4_5", baseMapper.b2_4_5(id)); - result.put("b2_4_6", baseMapper.b2_4_6(id)); + result.put("b2_4_1", getMapStr(baseMapper.b2_4_1(id))); + result.put("b2_4_2", getMapStr(baseMapper.b2_4_2(id))); + result.put("b2_4_3", getMapStr(baseMapper.b2_4_3(id))); + result.put("b2_4_4", getMapStr(baseMapper.b2_4_4(id))); + result.put("b2_4_5", getMapStr(baseMapper.b2_4_5(id))); + result.put("b2_4_6", getMapStr(baseMapper.b2_4_6(id))); } //图片i2_16 @@ -1345,9 +1439,9 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b2_5_1", baseMapper.b2_5_1(id)); - result.put("b2_5_2", baseMapper.b2_5_2(id)); - result.put("b2_5_3", baseMapper.b2_5_3(id)); + result.put("b2_5_1", getMapStr(baseMapper.b2_5_1(id))); + result.put("b2_5_2", getMapStr(baseMapper.b2_5_2(id))); + result.put("b2_5_3", getMapStr(baseMapper.b2_5_3(id))); } //图片i2_18 public void i2_18(WordOperator wo, Map result, String id) { @@ -1390,11 +1484,11 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b2_6_1", baseMapper.b2_6_1(id)); - result.put("b2_6_2", baseMapper.b2_6_2(id)); - result.put("b2_6_3", baseMapper.b2_6_3(id)); - result.put("b2_6_4", baseMapper.b2_6_4(id)); - result.put("b2_6_5", baseMapper.b2_6_5(id)); + result.put("b2_6_1", getMapStr(baseMapper.b2_6_1(id))); + result.put("b2_6_2", getMapStr(baseMapper.b2_6_2(id))); + result.put("b2_6_3", getMapStr(baseMapper.b2_6_3(id))); + result.put("b2_6_4", getMapStr(baseMapper.b2_6_4(id))); + result.put("b2_6_5", getMapStr(baseMapper.b2_6_5(id))); } //图片i2_21 @@ -1413,11 +1507,11 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b2_6_6", baseMapper.b2_6_6(id)); - result.put("b2_6_7", baseMapper.b2_6_7(id)); - result.put("b2_6_8", baseMapper.b2_6_8(id)); - result.put("b2_6_9", baseMapper.b2_6_9(id)); - result.put("b2_6_10", baseMapper.b2_6_10(id)); + result.put("b2_6_6", getMapStr(baseMapper.b2_6_6(id))); + result.put("b2_6_7", getMapStr(baseMapper.b2_6_7(id))); + result.put("b2_6_8", getMapStr(baseMapper.b2_6_8(id))); + result.put("b2_6_9", getMapStr(baseMapper.b2_6_9(id))); + result.put("b2_6_10", getMapStr(baseMapper.b2_6_10(id))); } //图片i2_23 @@ -1473,10 +1567,10 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b2_7_1", baseMapper.b2_7_1(id)); - result.put("b2_7_2", baseMapper.b2_7_2(id)); - result.put("b2_7_3", baseMapper.b2_7_3(id)); - result.put("b2_7_4", baseMapper.b2_7_4(id)); + result.put("b2_7_1", getMapStr(baseMapper.b2_7_1(id))); + result.put("b2_7_2", getMapStr(baseMapper.b2_7_2(id))); + result.put("b2_7_3", getMapStr(baseMapper.b2_7_3(id))); + result.put("b2_7_4", getMapStr(baseMapper.b2_7_4(id))); } //图片i2_27 public void i2_27(WordOperator wo, Map result, String id) { @@ -1509,11 +1603,11 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b2_8_1", baseMapper.b2_8_1(id)); - result.put("b2_8_2", baseMapper.b2_8_2(id)); - result.put("b2_8_3", baseMapper.b2_8_3(id)); - result.put("b2_8_4", baseMapper.b2_8_4(id)); - result.put("b2_8_5", baseMapper.b2_8_5(id)); + result.put("b2_8_1", getMapStr(baseMapper.b2_8_1(id))); + result.put("b2_8_2", getMapStr(baseMapper.b2_8_2(id))); + result.put("b2_8_3", getMapStr(baseMapper.b2_8_3(id))); + result.put("b2_8_4", getMapStr(baseMapper.b2_8_4(id))); + result.put("b2_8_5", getMapStr(baseMapper.b2_8_5(id))); } //图片i2_30 public void i2_30(WordOperator wo, Map result, String id) { @@ -1564,13 +1658,13 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b2_9_1", baseMapper.b2_9_1(id)); - result.put("b2_9_2", baseMapper.b2_9_2(id)); - result.put("b2_9_3", baseMapper.b2_9_3(id)); - result.put("b2_9_4", baseMapper.b2_9_4(id)); - result.put("b2_9_5", baseMapper.b2_9_5(id)); - result.put("b2_9_6", baseMapper.b2_9_6(id)); - result.put("b2_9_7", baseMapper.b2_9_7(id)); + result.put("b2_9_1", getMapStr(baseMapper.b2_9_1(id))); + result.put("b2_9_2", getMapStr(baseMapper.b2_9_2(id))); + result.put("b2_9_3", getMapStr(baseMapper.b2_9_3(id))); + result.put("b2_9_4", getMapStr(baseMapper.b2_9_4(id))); + result.put("b2_9_5", getMapStr(baseMapper.b2_9_5(id))); + result.put("b2_9_6", getMapStr(baseMapper.b2_9_6(id))); + result.put("b2_9_7", getMapStr(baseMapper.b2_9_7(id))); } //图片i2_34 public void i2_34(WordOperator wo, Map result, String id) { @@ -1623,10 +1717,10 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b3_1_1", baseMapper.b3_1_1(id)); - result.put("b3_1_2", baseMapper.b3_1_2(id)); - result.put("b3_1_3", baseMapper.b3_1_3(id)); - result.put("b3_1_4", baseMapper.b3_1_4(id)); + result.put("b3_1_1", getMapStr(baseMapper.b3_1_1(id))); + result.put("b3_1_2", getMapStr(baseMapper.b3_1_2(id))); + result.put("b3_1_3", getMapStr(baseMapper.b3_1_3(id))); + result.put("b3_1_4", getMapStr(baseMapper.b3_1_4(id))); } //图片i3_2 public void i3_2(WordOperator wo, Map result, String id) { @@ -1670,10 +1764,10 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b3_2_1", baseMapper.b3_2_1(id)); - result.put("b3_2_2", baseMapper.b3_2_2(id)); - result.put("b3_2_3", baseMapper.b3_2_3(id)); - result.put("b3_2_4", baseMapper.b3_2_4(id)); + result.put("b3_2_1", getMapStr(baseMapper.b3_2_1(id))); + result.put("b3_2_2", getMapStr(baseMapper.b3_2_2(id))); + result.put("b3_2_3", getMapStr(baseMapper.b3_2_3(id))); + result.put("b3_2_4", getMapStr(baseMapper.b3_2_4(id))); } //图片i3_5 public void i3_5(WordOperator wo, Map result, String id) { @@ -1684,7 +1778,7 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b3_2_5", baseMapper.b3_2_5(id)); + result.put("b3_2_5", getMapStr(baseMapper.b3_2_5(id))); } //图片i3_6 public void i3_6(WordOperator wo, Map result, String id) { @@ -1730,11 +1824,11 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b3_3_1", baseMapper.b3_3_1(id)); - result.put("b3_3_2", baseMapper.b3_3_2(id)); - result.put("b3_3_3", baseMapper.b3_3_3(id)); - result.put("b3_3_4", baseMapper.b3_3_4(id)); - result.put("b3_3_5", baseMapper.b3_3_5(id)); + result.put("b3_3_1", getMapStr(baseMapper.b3_3_1(id))); + result.put("b3_3_2", getMapStr(baseMapper.b3_3_2(id))); + result.put("b3_3_3", getMapStr(baseMapper.b3_3_3(id))); + result.put("b3_3_4", getMapStr(baseMapper.b3_3_4(id))); + result.put("b3_3_5", getMapStr(baseMapper.b3_3_5(id))); } //图片i3_10 public void i3_10(WordOperator wo, Map result, String id) { @@ -1785,10 +1879,10 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b4_1_1", baseMapper.b4_1_1(id)); - result.put("b4_1_2", baseMapper.b4_1_2(id)); - result.put("b4_1_3", baseMapper.b4_1_3(id)); - result.put("b4_1_4", baseMapper.b4_1_4(id)); + result.put("b4_1_1", getMapStr(baseMapper.b4_1_1(id))); + result.put("b4_1_2", getMapStr(baseMapper.b4_1_2(id))); + result.put("b4_1_3", getMapStr(baseMapper.b4_1_3(id))); + result.put("b4_1_4", getMapStr(baseMapper.b4_1_4(id))); } //图片i4_2 public void i4_2(WordOperator wo, Map result, String id) { @@ -1833,12 +1927,12 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b4_2_1", baseMapper.b4_2_1(id)); - result.put("b4_2_2", baseMapper.b4_2_2(id)); - result.put("b4_2_3", baseMapper.b4_2_3(id)); - result.put("b4_2_4", baseMapper.b4_2_4(id)); - result.put("b4_2_5", baseMapper.b4_2_5(id)); - result.put("b4_2_6", baseMapper.b4_2_6(id)); + result.put("b4_2_1", getMapStr(baseMapper.b4_2_1(id))); + result.put("b4_2_2", getMapStr(baseMapper.b4_2_2(id))); + result.put("b4_2_3", getMapStr(baseMapper.b4_2_3(id))); + result.put("b4_2_4", getMapStr(baseMapper.b4_2_4(id))); + result.put("b4_2_5", getMapStr(baseMapper.b4_2_5(id))); + result.put("b4_2_6", getMapStr(baseMapper.b4_2_6(id))); } //图片i4_5 public void i4_5(WordOperator wo, Map result, String id) { @@ -1892,11 +1986,11 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b4_3_1", baseMapper.b4_3_1(id)); - result.put("b4_3_2", baseMapper.b4_3_2(id)); - result.put("b4_3_3", baseMapper.b4_3_3(id)); - result.put("b4_3_4", baseMapper.b4_3_4(id)); - result.put("b4_3_5", baseMapper.b4_3_5(id)); + result.put("b4_3_1", getMapStr(baseMapper.b4_3_1(id))); + result.put("b4_3_2", getMapStr(baseMapper.b4_3_2(id))); + result.put("b4_3_3", getMapStr(baseMapper.b4_3_3(id))); + result.put("b4_3_4", getMapStr(baseMapper.b4_3_4(id))); + result.put("b4_3_5", getMapStr(baseMapper.b4_3_5(id))); } //图片i4_9 @@ -1952,12 +2046,12 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b4_4_1", baseMapper.b4_4_1(id)); - result.put("b4_4_2", baseMapper.b4_4_2(id)); - result.put("b4_4_3", baseMapper.b4_4_3(id)); - result.put("b4_4_4", baseMapper.b4_4_4(id)); - result.put("b4_4_5", baseMapper.b4_4_5(id)); - result.put("b4_4_6", baseMapper.b4_4_6(id)); + result.put("b4_4_1", getMapStr(baseMapper.b4_4_1(id))); + result.put("b4_4_2", getMapStr(baseMapper.b4_4_2(id))); + result.put("b4_4_3", getMapStr(baseMapper.b4_4_3(id))); + result.put("b4_4_4", getMapStr(baseMapper.b4_4_4(id))); + result.put("b4_4_5", getMapStr(baseMapper.b4_4_5(id))); + result.put("b4_4_6", getMapStr(baseMapper.b4_4_6(id))); } //图片i4_13 @@ -2007,10 +2101,10 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b5_1_1", baseMapper.b5_1_1(id)); - result.put("b5_1_2", baseMapper.b5_1_2(id)); - result.put("b5_1_3", baseMapper.b5_1_3(id)); - result.put("b5_1_4", baseMapper.b5_1_4(id)); + result.put("b5_1_1", getMapStr(baseMapper.b5_1_1(id))); + result.put("b5_1_2", getMapStr(baseMapper.b5_1_2(id))); + result.put("b5_1_3", getMapStr(baseMapper.b5_1_3(id))); + result.put("b5_1_4", getMapStr(baseMapper.b5_1_4(id))); } //图片i5_1 @@ -2022,7 +2116,7 @@ public class BlStuAnswerServiceImpl extends ServiceImpl result, String id) { - result.put("b5_1_5", baseMapper.b5_1_5(id)); + result.put("b5_1_5", getMapStr(baseMapper.b5_1_5(id))); } //图片i5_2 diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/blStuInfo/entity/BlStuInfo.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/blStuInfo/entity/BlStuInfo.java index 41907b9..cdbf936 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/blStuInfo/entity/BlStuInfo.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/blStuInfo/entity/BlStuInfo.java @@ -76,4 +76,15 @@ public class BlStuInfo implements Serializable { @Excel(name = "教师总人数", width = 15) @ApiModelProperty(value = "学生总人数") private java.lang.String stuSumno; + + /**最小样本数*/ + @Excel(name = "最小样有效本数", width = 15) + @ApiModelProperty(value = "最小样有效本数") + private Integer minNum; + + /**附件*/ + @Excel(name = "附件", width = 15) + @ApiModelProperty(value = "附件") + private java.lang.String filePath; + } diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/tools/WebDriverUtil.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/tools/WebDriverUtil.java index a0c2710..8ffd2f6 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/tools/WebDriverUtil.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/tools/WebDriverUtil.java @@ -74,12 +74,14 @@ public class WebDriverUtil { var file = new File(currentDir + File.separator + "applicationTemp"); var tempFile = new File(file.getPath() + File.separator + path); if(!tempFile.exists()){ + log.info("往缓存写入jar包里的资源:{}",tempFile.getPath()); var is = ResourceUtil.getStream(path); var out = FileUtil.getOutputStream(tempFile); IoUtil.copy(is, out); - IoUtil.close(is); IoUtil.close(out); + } else { + log.info("缓存文件【{}】已存在资源,如果源码中有变更,请删除“applicationTemp文件夹”",tempFile.getPath()); } return tempFile; } @@ -109,7 +111,7 @@ public class WebDriverUtil { try { driver = getWebDriver(); //访问网址 - log.info("往缓存写入jar包里的资源"); + //往缓存写入jar包里的资源 //把js拉过来 getUrl(global.getConfig("webDriver.webHTMLPath") + "/echarts.min.js"); if(StringUtils.isNotBlank(path)){ diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/tools/word/WordOperator.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/tools/word/WordOperator.java index 678d5dc..7be4f4a 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/tools/word/WordOperator.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/tools/word/WordOperator.java @@ -172,12 +172,10 @@ public class WordOperator { // run.addPicture(is,res,picPath,width, height); IoUtil.close(is); } catch (InvalidFormatException e) { - logger.error(e.toString()); - e.printStackTrace(); + logger.error(e.getMessage(),e); } catch (IOException e) { logger.error("没有找到相应的文件!"); - logger.error(e.toString()); - e.printStackTrace(); + logger.error(e.getMessage(),e); } } @@ -944,7 +942,7 @@ public class WordOperator { //染上背景色 // r.getCTR().addNewRPr().addNewHighlight().setVal(STHighlightColor.YELLOW); } catch (Exception e) { - e.printStackTrace(); + logger.error(e.getMessage(),e); r.setText("", 0); } return; @@ -970,7 +968,7 @@ public class WordOperator { //染上背景色 // r.getCTR().addNewRPr().addNewHighlight().setVal(STHighlightColor.YELLOW); } catch (Exception e) { - e.printStackTrace(); + logger.error(e.getMessage(),e); r.setText("", 0); } return; @@ -1018,6 +1016,7 @@ public class WordOperator { //染上背景色 // r.getCTR().addNewRPr().addNewHighlight().setVal(STHighlightColor.YELLOW); } catch (Exception e) { + logger.error(e.getMessage(),e); r.setText("", 0); } @@ -1243,7 +1242,7 @@ public class WordOperator { w2o = twoReplaceWord(wo); w2o.replaceTextPlus(result); } catch (Exception e) { - e.printStackTrace(); + logger.error(e.getMessage(),e); } //再次替换 return w2o;