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 c970d1d..68f3d77 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 @@ -5,6 +5,7 @@ import cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO import cn.com.tenlion.institutionmanagement.service.institution.IInstitutionService; import cn.com.tenlion.pojo.dtos.classplan.ClassPlanDTO; import cn.com.tenlion.pojo.dtos.examapply.ExamApplyDTO; +import cn.com.tenlion.pojo.dtos.traininginstitutionworktype.TrainingInstitutionWorkTypeDTO; import cn.com.tenlion.service.apply.IApplyService; import cn.com.tenlion.service.classplan.IClassPlanService; import cn.com.tenlion.service.examapply.IExamApplyService; @@ -13,6 +14,8 @@ import cn.com.tenlion.service.examinationuser.IExaminationService; import cn.com.tenlion.service.lessons.ILessonsService; import cn.com.tenlion.service.teacher.ITeacherService; import cn.com.tenlion.service.traininginstitutionuser.ITrainingInstitutionUserService; +import cn.com.tenlion.service.traininginstitutionworktype.ITrainingInstitutionWorkTypeService; +import cn.com.tenlion.service.worktype.IWorkTypeService; import ink.wgink.common.base.DefaultBaseController; import ink.wgink.common.component.SecurityComponent; import ink.wgink.interfaces.consts.ISystemConstant; @@ -65,6 +68,8 @@ public class IndexCountController extends DefaultBaseController { private IExamCheckService examCheckService; @Autowired private IExamApplyService examApplyService; + @Autowired + private ITrainingInstitutionWorkTypeService TrainingInstitutionWorkTypeService; @ApiOperation(value = "统计当前登录机构报名数量", notes = "统计当前登录机构报名数量接口") @@ -213,10 +218,10 @@ public class IndexCountController extends DefaultBaseController { } - @ApiOperation(value = "统计当前机构计划报名人数", notes = "统计当前机构计划报名人数") + @ApiOperation(value = "统计培训机构绑定工种的报名情况", notes = "统计培训机构绑定工种的报名情况") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) - @GetMapping("count-plan-apply-user-num") - public SuccessResultData> countPlanApplyUserNum(){ + @GetMapping("count-work-type-apply-user-num") + public SuccessResultData> countWorkTypeApplyUserNum(){ Map map = new HashMap<>(); List title = new ArrayList<>();//计划名称 List data0 = new ArrayList<>();//待审核 @@ -226,11 +231,11 @@ public class IndexCountController extends DefaultBaseController { 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()); + map.put("institutionId",institutionId); + List trainingInstitutionWorkTypeDTOS = TrainingInstitutionWorkTypeService.list(map); + for (TrainingInstitutionWorkTypeDTO trainingInstitutionWorkTypeDTO : trainingInstitutionWorkTypeDTOS) { + Map planMap = applyService.countWeekNum("",institutionId,trainingInstitutionWorkTypeDTO.getWorkTypeId()); + title.add(trainingInstitutionWorkTypeDTO.getWorkTypeName()); data0.add(planMap.get("0").toString()); data1.add(planMap.get("1").toString()); data2.add(planMap.get("2").toString()); diff --git a/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java b/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java index 70d851d..029c31f 100644 --- a/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java @@ -118,7 +118,7 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic if(sourceInstitutionDTO == null){ throw new SearchException("未查询到源机构信息"); } - auditLogVO.setApplyAuditExplain("【因报名人数不足】 报名培训机构 由原【"+sourceInstitutionDTO.getInstitutionName()+"】培训机构 调整到【"+institutionDTO.getInstitutionName()+"】培训机构"); + auditLogVO.setApplyAuditExplain("【因报名人数不足,无法开班】 报名培训机构 由原【"+sourceInstitutionDTO.getInstitutionName()+"】培训机构 调整到【"+institutionDTO.getInstitutionName()+"】培训机构"); applyAuditLogService.save(null,auditLogVO); } } @@ -374,7 +374,7 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic throw new SaveException("您已报名过该机构"); } if(checkApplyIsFirst(creator,applyWorkTypeId,null) != 0){ - throw new SaveException("您选择的工种已报名过其他培训机构"); + throw new SaveException("您选择的工种已经报名过其他培训机构!请勿重复报名"); } if(!examCheckService.getExamCheckFailOrBack(applyWorkTypeId,applyInstitutionId)){ throw new SaveException("该机构暂时不能报名"); @@ -423,9 +423,12 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic if(!(applyDTO.getApplyAuditState() == -1 || applyDTO.getApplyAuditState() == 1)){ throw new SearchException("暂不能修改信息"); } -// if(checkApplyIsFirst(creator,applyWorkTypeId,null) != 0){ -// throw new SaveException("您选择的工种已报名过其他培训机构"); +// if(!(applyDTO.getApplyInstitutionId().equals(applyInstitutionId) && applyDTO.getApplyWorkTypeId().equals(applyWorkTypeId))){ +// throw new SaveException("您选择的工种已经在其他培训机构报名过!请勿重新报名"); // } + if(checkApplyIsFirst(creator,applyWorkTypeId,null) != 0){ + throw new SaveException("您选择的工种已经在其他培训机构报名过!请勿重新报名"); + } if(!examCheckService.getExamCheckFailOrBack(applyWorkTypeId,applyInstitutionId)){ throw new SaveException("该机构以截止报名"); @@ -620,9 +623,9 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic params.put("creator",creator); List applyAuditStates = new ArrayList<>(); applyAuditStates.add("0"); - applyAuditStates.add("1"); + //applyAuditStates.add("1"); applyAuditStates.add("2"); - applyAuditStates.add("-1"); + //applyAuditStates.add("-1"); params.put("applyAuditStates",applyAuditStates); return count(params); } @@ -668,13 +671,12 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic } - public Map countWeekNum(String weekTime,String applyInstitutionId,String applyClassId) { + public Map countWeekNum(String weekTime,String applyInstitutionId,String applyWorkTypeId) { Map params = new HashMap<>(); params.put("weekTime",weekTime); params.put("applyInstitutionId",applyInstitutionId); - params.put("applyClassId",applyClassId); + params.put("applyWorkTypeId",applyWorkTypeId); Map result = applyDao.countWeekNum(params); - if(result == null){ params.clear(); params.put("0",0); diff --git a/src/main/java/cn/com/tenlion/service/worktype/IWorkTypeService.java b/src/main/java/cn/com/tenlion/service/worktype/IWorkTypeService.java index a34d2ba..1b5b925 100644 --- a/src/main/java/cn/com/tenlion/service/worktype/IWorkTypeService.java +++ b/src/main/java/cn/com/tenlion/service/worktype/IWorkTypeService.java @@ -20,6 +20,14 @@ import java.util.Map; **/ public interface IWorkTypeService { + /** + * 查询报名工种 + * @param workTypeParentId + * @param resultList + * @return + */ + List countListWorkType(String workTypeParentId, List resultList); + /** * 工种类型树形列表 diff --git a/src/main/java/cn/com/tenlion/service/worktype/impl/WorkTypeServiceImpl.java b/src/main/java/cn/com/tenlion/service/worktype/impl/WorkTypeServiceImpl.java index 8d5738b..e0e17f0 100644 --- a/src/main/java/cn/com/tenlion/service/worktype/impl/WorkTypeServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/worktype/impl/WorkTypeServiceImpl.java @@ -35,6 +35,28 @@ public class WorkTypeServiceImpl extends DefaultBaseService implements IWorkType @Autowired private IWorkTypeDao workTypeDao; + public List countListWorkType(String workTypeParentId, List resultList){ + Map params = new HashMap<>(); + params.put("workTypeParentId",workTypeParentId); + List list = workTypeDao.listZTree(params); + for (WorkTypeZTreeDTO workTypeZTreeDTO : list) { + Map data = new HashMap<>(); + data.put("workTypeParentId",workTypeZTreeDTO.getId()); + Integer count = count(data); + if (count > 0){ + this.countListWorkType(workTypeZTreeDTO.getId(),resultList); + }else{ + resultList.add(workTypeZTreeDTO); + } + } + return resultList; + } + + + + + + public List listZTree(Map params){ List list = workTypeDao.listZTree(params); diff --git a/src/main/resources/mybatis/mapper/apply/apply-mapper.xml b/src/main/resources/mybatis/mapper/apply/apply-mapper.xml index 6282ffb..25c672e 100644 --- a/src/main/resources/mybatis/mapper/apply/apply-mapper.xml +++ b/src/main/resources/mybatis/mapper/apply/apply-mapper.xml @@ -693,6 +693,9 @@ AND apply_class_id = #{applyClassId} + + AND apply_work_type_id = #{applyWorkTypeId} + diff --git a/src/main/resources/static/route/apply/audit.html b/src/main/resources/static/route/apply/audit.html index c75e7c5..f361834 100644 --- a/src/main/resources/static/route/apply/audit.html +++ b/src/main/resources/static/route/apply/audit.html @@ -374,10 +374,10 @@ // 提交表单 form.on('submit(submitForm1)', function(formData) { var applyAuditFileId = formData.field.applyAuditFileId; - if(applyAuditFileId == ''){ - top.dialog.msg('请上传交费凭证') - return; - } + // if(applyAuditFileId == ''){ + // top.dialog.msg('请上传交费凭证') + // return; + // } saveDataVal['applyId'] = applyId; saveDataVal['applyAuditExplain'] = formData.field.applyAuditExplain; saveDataVal['applyAuditFileId'] = applyAuditFileId; diff --git a/src/main/resources/static/route/examination/station/list.html b/src/main/resources/static/route/examination/station/list.html index 023fa01..dc45f67 100644 --- a/src/main/resources/static/route/examination/station/list.html +++ b/src/main/resources/static/route/examination/station/list.html @@ -38,23 +38,15 @@ - -
-
-
-
-
-
-
diff --git a/src/main/resources/templates/index1.html b/src/main/resources/templates/index1.html index c555482..6e9700d 100644 --- a/src/main/resources/templates/index1.html +++ b/src/main/resources/templates/index1.html @@ -104,7 +104,7 @@
-
培训计划报名情况
+
工种报名情况
@@ -372,7 +372,8 @@ }) }, initPlanApplyUserNumEChart: function(){ - top.restAjax.get('api/indexcount/count-plan-apply-user-num', {}, null, function(code, data) { + top.restAjax.get('api/indexcount/count-work-type-apply-user-num', {}, null, function(code, data) { + console.log(data.data) self.planApplyUserNumEChart = echarts.init(document.getElementById('planApplyUserNumEChart')); self.planApplyUserNumEChart.setOption( { @@ -393,7 +394,11 @@ }, xAxis: { type: 'category', - data: data.data.title //计划名称 + data: data.data.title, //计划名称 + axisLabel: { + interval: 0, + rotate: 40 + } }, yAxis: { @@ -480,7 +485,6 @@ $('#applyClassId').append(options); setTimeout(function () { $('#applyClassId').on('change', function () { - console.log('123') self.selectedApplyClassId = $(this).value() self.initApplyEChart() })