diff --git a/src/main/java/cn/com/tenlion/controller/api/indexcount/IndexCountController.java b/src/main/java/cn/com/tenlion/controller/api/indexcount/IndexCountController.java index fbf2982..9fece04 100644 --- a/src/main/java/cn/com/tenlion/controller/api/indexcount/IndexCountController.java +++ b/src/main/java/cn/com/tenlion/controller/api/indexcount/IndexCountController.java @@ -3,6 +3,7 @@ package cn.com.tenlion.controller.api.indexcount; import cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO; import cn.com.tenlion.pojo.dtos.apply.ApplyDTO; +import cn.com.tenlion.pojo.dtos.classplan.ClassPlanDTO; import cn.com.tenlion.service.apply.IApplyService; import cn.com.tenlion.service.classplan.IClassPlanService; import cn.com.tenlion.service.lessons.ILessonsService; @@ -54,6 +55,7 @@ public class IndexCountController extends DefaultBaseController { private ITeacherService teacherService; + @ApiOperation(value = "统计当前登录机构报名数量", notes = "统计当前登录机构报名数量接口") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("count-apply-all-num") @@ -128,11 +130,11 @@ public class IndexCountController extends DefaultBaseController { @ApiOperation(value = "统计当前登录机构报名情况", notes = "统计当前登录机构报名情况接口") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) - @GetMapping("count-one-weeks-apply-num") - public SuccessResultData> countOneWeeksApplyNum(){ + @GetMapping("count-one-weeks-apply-num/{applyClassId}") + public SuccessResultData> countOneWeeksApplyNum(@PathVariable("applyClassId") String applyClassId){ Map params = requestParams(); String institutionId = this.getInstitutionId(); - String classId = "";//params.get("applyClassId").toString(); + String classId = "99".equals(applyClassId) ? "":applyClassId; if(!StringUtils.isBlank(institutionId)) { String states0Time = DateUtil.getDay(); String states1Time = DateUtil.getBeforeDate(1,"yyyy-MM-dd"); @@ -175,8 +177,65 @@ public class IndexCountController extends DefaultBaseController { + @ApiOperation(value = "获取当前机构的培训计划列表", notes = "获取当前机构的培训计划列表") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list-plan-class") + public SuccessResultData> listPlanClass(){ + Map params = new HashMap<>(); + params.put("orgId",this.getInstitutionId()); + List list = classPlanService.list(params); + return new SuccessResultData<>(list); + } + @ApiOperation(value = "统计当前机构计划分类占比", notes = "统计当前机构计划分类占比") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count-plan-type") + public SuccessResultData> countPlanType(){ + Map map = new HashMap<>(); + String institutionId = this.getInstitutionId(); + if(!StringUtils.isBlank(institutionId)){ + map.put("orgId",institutionId); + map= classPlanService.countPlanType(institutionId); + } + return new SuccessResultData<>(map); + } + + + @ApiOperation(value = "统计当前机构计划报名人数", notes = "统计当前机构计划报名人数") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count-plan-apply-user-num") + public SuccessResultData> countPlanApplyUserNum(){ + Map map = new HashMap<>(); + List title = new ArrayList<>();//计划名称 + List data0 = new ArrayList<>();//待审核 + List data1 = new ArrayList<>();//用户撤回 + List data2 = new ArrayList<>();//审核通过 + List data3 = new ArrayList<>();//报名完成 + List data4 = new ArrayList<>();//审核不通过 + String institutionId = this.getInstitutionId(); + if(!StringUtils.isBlank(institutionId)){ + map.put("orgId",institutionId); + List list = classPlanService.list(map); + for (ClassPlanDTO classPlanDTO : list) { + Map planMap = applyService.countWeekNum("",institutionId,classPlanDTO.getClassPlanId()); + title.add(classPlanDTO.getPlanName()); + data0.add(planMap.get("0").toString()); + data1.add(planMap.get("1").toString()); + data2.add(planMap.get("2").toString()); + data3.add(planMap.get("3").toString()); + data4.add(planMap.get("-1").toString()); + } + map.put("title",title); + map.put("data0",data0); + map.put("data1",data1); + map.put("data2",data2); + map.put("data3",data3); + map.put("data4",data4); + } + return new SuccessResultData<>(map); + } + diff --git a/src/main/java/cn/com/tenlion/dao/classplan/IClassPlanDao.java b/src/main/java/cn/com/tenlion/dao/classplan/IClassPlanDao.java index 29b0500..f8ca14a 100644 --- a/src/main/java/cn/com/tenlion/dao/classplan/IClassPlanDao.java +++ b/src/main/java/cn/com/tenlion/dao/classplan/IClassPlanDao.java @@ -135,4 +135,11 @@ public interface IClassPlanDao { * @param params */ void deleteClassPlanLessons(Map params); + + /** + * 根据机构id统计计划的分类数量 + * @param params + * @return + */ + Map countPlanType(Map params); } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java b/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java index 4df7754..d2a0f8e 100644 --- a/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java +++ b/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java @@ -22,6 +22,13 @@ import java.util.Map; **/ public interface IClassPlanService { + /** + * 根据机构id统计计划的分类数量 + * @param orgId + * @return + */ + Map countPlanType(String orgId); + /** * 新增 * diff --git a/src/main/java/cn/com/tenlion/service/classplan/impl/ClassPlanServiceImpl.java b/src/main/java/cn/com/tenlion/service/classplan/impl/ClassPlanServiceImpl.java index 4fbcdc5..3f16187 100644 --- a/src/main/java/cn/com/tenlion/service/classplan/impl/ClassPlanServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/classplan/impl/ClassPlanServiceImpl.java @@ -36,6 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -459,4 +460,13 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl } return list; } + + + + public Map countPlanType(String orgId){ + Map parmas = new HashMap<>(); + parmas.put("orgId",orgId); + return classPlanDao.countPlanType(parmas); + } + } \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/apply/apply-mapper.xml b/src/main/resources/mybatis/mapper/apply/apply-mapper.xml index de55404..8c99428 100644 --- a/src/main/resources/mybatis/mapper/apply/apply-mapper.xml +++ b/src/main/resources/mybatis/mapper/apply/apply-mapper.xml @@ -636,9 +636,12 @@ sum(case when apply_audit_state = 3 then 1 else 0 end) as '3', sum(case when apply_audit_state = -1 then 1 else 0 end) as '-1' from e_apply - WHERE is_delete = 0 AND DATE_FORMAT(gmt_create,'%Y-%m-%d') = #{weekTime} AND apply_institution_id = #{applyInstitutionId} + WHERE is_delete = 0 AND apply_institution_id = #{applyInstitutionId} + + AND DATE_FORMAT(gmt_create,'%Y-%m-%d') = #{weekTime} + - AND t1.apply_class_id = #{applyClassId} + AND apply_class_id = #{applyClassId} diff --git a/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml b/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml index 7e2736d..6bf24c0 100644 --- a/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml +++ b/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml @@ -400,7 +400,18 @@ WHERE 1 = 1 - + + + + + INSERT INTO e_class_plan_lesson (class_plan_id,lesson_id,teacher_id,is_delete) diff --git a/src/main/resources/mybatis/mapper/examapply/exam-apply-mapper.xml b/src/main/resources/mybatis/mapper/examapply/exam-apply-mapper.xml index eaf5b22..8c0b978 100644 --- a/src/main/resources/mybatis/mapper/examapply/exam-apply-mapper.xml +++ b/src/main/resources/mybatis/mapper/examapply/exam-apply-mapper.xml @@ -169,16 +169,16 @@ exam_apply_num = #{examApplyNum}, - + status = #{status}, - + user_status = #{userStatus}, - + check_status = #{checkStatus}, - + exam_type = #{examType}, diff --git a/src/main/resources/static/route/traininginstitution/list.html b/src/main/resources/static/route/traininginstitution/list.html index 1f820ee..fc825ba 100644 --- a/src/main/resources/static/route/traininginstitution/list.html +++ b/src/main/resources/static/route/traininginstitution/list.html @@ -165,7 +165,7 @@ return rowData; } }, - {field: 'cz', width: 180, title: '操作', align:'center', fixed: 'right', + {field: 'cz', width: 100, title: '操作', align:'center', fixed: 'right', templet: function(row) { var rowData = '
'; rowData +=''; diff --git a/src/main/resources/templates/index1.html b/src/main/resources/templates/index1.html index 4bab272..c555482 100644 --- a/src/main/resources/templates/index1.html +++ b/src/main/resources/templates/index1.html @@ -72,12 +72,12 @@
-
近七天报名情况 -
- -
+
近七天机构报名情况 + + + + +
@@ -96,7 +96,7 @@
-
培训计划占比
+
培训计划类型占比
@@ -104,9 +104,9 @@
-
培训课程占比
+
培训计划报名情况
-
+
@@ -130,13 +130,14 @@ teacherEChart:null, applyEChart:null, planEChart:null, - classEChart:null, + planApplyUserNumEChart:null, resizeTimeout: null, applyAllNum: 0, classPlanNum: 0, lessonsNum: 0, teacherNum: 0, - + selectedApplyClassId: '99', + optionsList: [] }, methods: { initApplyAllNum: function(){ @@ -185,7 +186,8 @@ }); }, initApplyEChart: function(){ - top.restAjax.get('api/indexcount/count-one-weeks-apply-num', {}, null, function(code, data) { + var self = this; + top.restAjax.get(top.restAjax.path('api/indexcount/count-one-weeks-apply-num/{applyClassId}', [self.selectedApplyClassId]), {}, null, function(code, data) { var status0 = []; var status1 = []; var status2 = []; @@ -269,7 +271,7 @@ ] } ) - form.render(); + }); }, @@ -290,7 +292,6 @@ datajson['value'] = data.data[i+""] dataList.push(datajson) } - console.log(dataList) self.teacherEChart = echarts.init(document.getElementById('teacherEChart')); self.teacherEChart.setOption( { @@ -323,75 +324,171 @@ }, initPlanEChart: function(){ - self.planEChart = echarts.init(document.getElementById('planEChart')); - self.planEChart.setOption( - { - title: { - text: '世界人口总量', - subtext: '数据来自网络' - }, - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'shadow' - } - }, - legend: { - data: ['2011年', '2012年'] - }, - grid: { - left: '3%', - right: '4%', - bottom: '3%', - containLabel: true - }, - xAxis: { - type: 'value', - boundaryGap: [0, 0.01] - }, - yAxis: { - type: 'category', - data: ['巴西', '印尼', '美国', '印度', '中国', '世界人口(万)'] - }, - series: [ - { - name: '2011年', - type: 'bar', - data: [18203, 23489, 29034, 104970, 131744, 630230] + top.restAjax.get('api/indexcount/count-plan-type', {}, null, function(code, data) { + var dataList = []; + for(var i= 1;i<=3;i++){ + var datajson = {}; + if(i === 1){ + datajson['name'] = "初训" + } + if(i === 2){ + datajson['name'] = "复训" + } + if(i === 3){ + datajson['name'] = "换证" + } + datajson['value'] = data.data[i+""] + dataList.push(datajson) + } + console.log(dataList) + self.teacherEChart = echarts.init(document.getElementById('planEChart')); + self.teacherEChart.setOption( + { + tooltip: { + trigger: 'item' }, - { - name: '2012年', - type: 'bar', - data: [19325, 23438, 31000, 121594, 134141, 681807] - } - ] - } - ) - }, - initClassEChart: function(){ - self.classEChart = echarts.init(document.getElementById('classEChart')); - self.classEChart.setOption( - { - legend: {}, - tooltip: {}, - dataset: { - source: [ - ['product', '2015', '2016', '2017'], - ['Matcha Latte', 43.3, 85.8, 93.7], - ['Milk Tea', 83.1, 73.4, 55.1], - ['Cheese Cocoa', 86.4, 65.2, 82.5], - ['Walnut Brownie', 72.4, 53.9, 39.1] + legend: { + orient: 'vertical', + left: 'left', + }, + series: [ + { + name: '访问来源', + type: 'pie', + radius: '70%', + data: dataList, + emphasis: { + itemStyle: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + } + } ] - }, - xAxis: {type: 'category'}, - yAxis: {}, - series: [ - {type: 'bar'}, - {type: 'bar'}, - {type: 'bar'} - ] + } + ) + + }) + }, + initPlanApplyUserNumEChart: function(){ + top.restAjax.get('api/indexcount/count-plan-apply-user-num', {}, null, function(code, data) { + self.planApplyUserNumEChart = echarts.init(document.getElementById('planApplyUserNumEChart')); + self.planApplyUserNumEChart.setOption( + { + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow' + } + }, + legend: { + data: ['待审核', '用户撤回', '审核通过', '报名完成', '审核不通过'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + xAxis: { + type: 'category', + data: data.data.title //计划名称 + + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '待审核', + type: 'bar', + stack: 'total', + label: { + show: true + }, + emphasis: { + focus: 'series' + }, + data: data.data.data0 + }, + { + name: '用户撤回', + type: 'bar', + stack: 'total', + label: { + show: true + }, + emphasis: { + focus: 'series' + }, + data: data.data.data1 + }, + { + name: '审核通过', + type: 'bar', + stack: 'total', + label: { + show: true + }, + emphasis: { + focus: 'series' + }, + data: data.data.data2 + }, + { + name: '报名完成', + type: 'bar', + stack: 'total', + label: { + show: true + }, + emphasis: { + focus: 'series' + }, + data: data.data.data3 + }, + { + name: '审核不通过', + type: 'bar', + stack: 'total', + label: { + show: true + }, + emphasis: { + focus: 'series' + }, + data: data.data.data4 + } + ] + } + ) + }); + + + + + }, + initPlanList: function(){ + var self = this + top.restAjax.get('api/indexcount/list-plan-class', {}, null, function(code, data) { + // self.optionsList = data.data + var options = ''; + for (var i = 0; i < data.data.length; i++) { + options += '' } - ) + $('#applyClassId').append(options); + setTimeout(function () { + $('#applyClassId').on('change', function () { + console.log('123') + self.selectedApplyClassId = $(this).value() + self.initApplyEChart() + }) + }, 50) + form.render() + }, function(code, data) { + top.dialog.msg(data.msg); + }); } }, mounted: function() { @@ -403,7 +500,8 @@ self.initTeacherEChart(); self.initApplyEChart(); self.initPlanEChart(); - self.initClassEChart(); + self.initPlanApplyUserNumEChart(); + //self.initPlanList(); // 事件 - 页面变化 $win.on('resize', function() { if(self.resizeTimeout) { @@ -416,6 +514,11 @@ }); } }) + + + + + }); diff --git a/src/main/resources/templates/index2.html b/src/main/resources/templates/index2.html new file mode 100644 index 0000000..decd7be --- /dev/null +++ b/src/main/resources/templates/index2.html @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + +
+ +
+
+
+
+
+
+ 报名数量 + +
+
+

0

+
+
+
+
+
+
+ 培训计划数量 + +
+
+

0

+
+
+
+
+
+
+ 课程数量 + +
+
+

0

+
+
+
+
+
+
+ 讲师 + +
+
+

0

+
+
+
+
+
+
+
+
+
+
近七天报名情况 + + + + + +
+
+
+
+
+
+
+
+
讲师占比
+
+
+
+
+
+
+
+
+
+
培训计划类型占比
+
+
+
+
+
+
+
+
培训课程占比
+
+
+
+
+
+
+
+ + + + + + \ No newline at end of file