修改报名审核逻辑

This commit is contained in:
ly19960718 2021-05-12 09:39:36 +08:00
parent a0d2f355fc
commit 328d4fef5a
4 changed files with 31 additions and 6 deletions

View File

@ -234,7 +234,7 @@ public interface IApplyService {
/** /**
* 统计机构星期的报名信息 * 统计机构星期的报名信息
* @param week * @param weekTime
* @param applyInstitutionId * @param applyInstitutionId
* @param applyClassId * @param applyClassId
* @return * @return

View File

@ -175,7 +175,7 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
@Override @Override
public String saveReturnId(String token, ApplyVO applyVO) { public String saveReturnId(String token, ApplyVO applyVO) {
//检查报名数据 //检查报名数据
checkSaveData(applyVO.getApplyCardNumber(),applyVO.getApplyClassId()); checkSaveData(token,applyVO.getApplyCardNumber(),applyVO.getApplyClassId());
String applyId = UUIDUtil.getUUID(); String applyId = UUIDUtil.getUUID();
Map<String, Object> params = HashMapUtil.beanToMap(applyVO); Map<String, Object> params = HashMapUtil.beanToMap(applyVO);
params.put("applyId", applyId); params.put("applyId", applyId);
@ -196,11 +196,16 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
return applyId; return applyId;
} }
public void checkSaveData(String applyCardNumber,String ApplyClassId){ public void checkSaveData(String token,String applyCardNumber,String ApplyClassId){
if(countApplyCardNumber(applyCardNumber,ApplyClassId) != 0){ // if(countApplyCardNumber(applyCardNumber,ApplyClassId) != 0){
// throw new SaveException("您以报名过该项目");
// }
if(countApplyCreator(token,ApplyClassId) != 0){
throw new SaveException("您以报名过该项目"); throw new SaveException("您以报名过该项目");
} }
ClassPlanDTO classPlanDTO = classPlanService.get(ApplyClassId); ClassPlanDTO classPlanDTO = classPlanService.get(ApplyClassId);
if(classPlanDTO == null){ if(classPlanDTO == null){
throw new ParamsException("未查询到计划信息"); throw new ParamsException("未查询到计划信息");
@ -352,6 +357,25 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
return new SuccessResultList<>(applyDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); return new SuccessResultList<>(applyDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
} }
/**
* 统计当前登录账号 报名的培训计划的次数不包括撤回
*/
public Integer countApplyCreator(String creator,String applyClassId){
Map<String, Object> params = new HashMap<>();
params.put("creator",creator);
params.put("applyClassId",applyClassId);
List<String> applyAuditStates = new ArrayList<>();
applyAuditStates.add("0");
applyAuditStates.add("2");
applyAuditStates.add("3");
applyAuditStates.add("-1");
params.put("applyAuditStates",applyAuditStates);
return count(params);
}
/** /**
* 统计证件号码 报名的培训计划的次数不包括撤回 * 统计证件号码 报名的培训计划的次数不包括撤回
*/ */

View File

@ -614,6 +614,9 @@
<if test="applyInstitutionId != null and applyInstitutionId != ''"> <if test="applyInstitutionId != null and applyInstitutionId != ''">
AND t1.apply_institution_id = #{applyInstitutionId} AND t1.apply_institution_id = #{applyInstitutionId}
</if> </if>
<if test="creator != null and creator != ''">
AND t1.creator = #{creator}
</if>
<if test="applyAuditStates != null and applyAuditStates != ''"> <if test="applyAuditStates != null and applyAuditStates != ''">
AND t1.apply_audit_state IN AND t1.apply_audit_state IN
<foreach collection="applyAuditStates" index="index" open="(" separator="," close=")"> <foreach collection="applyAuditStates" index="index" open="(" separator="," close=")">

View File

@ -273,8 +273,6 @@
}); });
}, },
initTeacherEChart: function(){ initTeacherEChart: function(){
top.restAjax.get('api/indexcount/count-teacher-num', {}, null, function(code, data) { top.restAjax.get('api/indexcount/count-teacher-num', {}, null, function(code, data) {
var dataList = []; var dataList = [];