From 328d4fef5ae7ed09a63c99dd975dfac37037ae8a Mon Sep 17 00:00:00 2001 From: ly19960718 <1622779752@qq.com> Date: Wed, 12 May 2021 09:39:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8A=A5=E5=90=8D=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tenlion/service/apply/IApplyService.java | 2 +- .../service/apply/impl/ApplyServiceImpl.java | 30 +++++++++++++++++-- .../mybatis/mapper/apply/apply-mapper.xml | 3 ++ src/main/resources/templates/index1.html | 2 -- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/main/java/cn/com/tenlion/service/apply/IApplyService.java b/src/main/java/cn/com/tenlion/service/apply/IApplyService.java index 631e472..27e2fa6 100644 --- a/src/main/java/cn/com/tenlion/service/apply/IApplyService.java +++ b/src/main/java/cn/com/tenlion/service/apply/IApplyService.java @@ -234,7 +234,7 @@ public interface IApplyService { /** * 统计机构星期的报名信息 - * @param week + * @param weekTime * @param applyInstitutionId * @param applyClassId * @return 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 0b3d38a..13ba66f 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 @@ -175,7 +175,7 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic @Override public String saveReturnId(String token, ApplyVO applyVO) { //检查报名数据 - checkSaveData(applyVO.getApplyCardNumber(),applyVO.getApplyClassId()); + checkSaveData(token,applyVO.getApplyCardNumber(),applyVO.getApplyClassId()); String applyId = UUIDUtil.getUUID(); Map params = HashMapUtil.beanToMap(applyVO); params.put("applyId", applyId); @@ -196,11 +196,16 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic return applyId; } - public void checkSaveData(String applyCardNumber,String ApplyClassId){ - if(countApplyCardNumber(applyCardNumber,ApplyClassId) != 0){ + public void checkSaveData(String token,String applyCardNumber,String ApplyClassId){ +// if(countApplyCardNumber(applyCardNumber,ApplyClassId) != 0){ +// throw new SaveException("您以报名过该项目"); +// } + + if(countApplyCreator(token,ApplyClassId) != 0){ throw new SaveException("您以报名过该项目"); } + ClassPlanDTO classPlanDTO = classPlanService.get(ApplyClassId); if(classPlanDTO == null){ throw new ParamsException("未查询到计划信息"); @@ -352,6 +357,25 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic return new SuccessResultList<>(applyDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); } + + /** + * 统计当前登录账号 报名的培训计划的次数(不包括撤回) + */ + public Integer countApplyCreator(String creator,String applyClassId){ + Map params = new HashMap<>(); + params.put("creator",creator); + params.put("applyClassId",applyClassId); + List applyAuditStates = new ArrayList<>(); + applyAuditStates.add("0"); + applyAuditStates.add("2"); + applyAuditStates.add("3"); + applyAuditStates.add("-1"); + params.put("applyAuditStates",applyAuditStates); + return count(params); + } + + + /** * 统计证件号码 报名的培训计划的次数(不包括撤回) */ diff --git a/src/main/resources/mybatis/mapper/apply/apply-mapper.xml b/src/main/resources/mybatis/mapper/apply/apply-mapper.xml index bb61ada..e6c6d41 100644 --- a/src/main/resources/mybatis/mapper/apply/apply-mapper.xml +++ b/src/main/resources/mybatis/mapper/apply/apply-mapper.xml @@ -614,6 +614,9 @@ AND t1.apply_institution_id = #{applyInstitutionId} + + AND t1.creator = #{creator} + AND t1.apply_audit_state IN diff --git a/src/main/resources/templates/index1.html b/src/main/resources/templates/index1.html index 8bc073a..4bab272 100644 --- a/src/main/resources/templates/index1.html +++ b/src/main/resources/templates/index1.html @@ -273,8 +273,6 @@ }); }, - - initTeacherEChart: function(){ top.restAjax.get('api/indexcount/count-teacher-num', {}, null, function(code, data) { var dataList = [];