报名增加修改报名机构接口

This commit is contained in:
ly19960718 2021-05-15 21:45:48 +08:00
parent c2f39a2b57
commit 60485f797e
2 changed files with 54 additions and 3 deletions

View File

@ -89,6 +89,15 @@ public class ApplyDTO {
@ApiModelProperty(name = "准考证码", value = "准考证码") @ApiModelProperty(name = "准考证码", value = "准考证码")
private String distributionCardCode; private String distributionCardCode;
@ApiModelProperty(name = "applyUserNum1", value = "预计报名人数")
private Integer applyUserNum1;
@ApiModelProperty(name = "applyUserNum2", value = "已报名人数")
private Integer applyUserNum2;
@ApiModelProperty(name = "applyUserNum3", value = "已通过审核人数")
private Integer applyUserNum3;
public String getApplyInstitutionId() { public String getApplyInstitutionId() {
return applyInstitutionId; return applyInstitutionId;
@ -354,4 +363,29 @@ public class ApplyDTO {
public void setApplyWorkTypeName(String applyWorkTypeName) { public void setApplyWorkTypeName(String applyWorkTypeName) {
this.applyWorkTypeName = applyWorkTypeName; this.applyWorkTypeName = applyWorkTypeName;
} }
public Integer getApplyUserNum1() {
return applyUserNum1;
}
public void setApplyUserNum1(Integer applyUserNum1) {
this.applyUserNum1 = applyUserNum1;
}
public Integer getApplyUserNum2() {
return applyUserNum2;
}
public void setApplyUserNum2(Integer applyUserNum2) {
this.applyUserNum2 = applyUserNum2;
}
public Integer getApplyUserNum3() {
return applyUserNum3;
}
public void setApplyUserNum3(Integer applyUserNum3) {
this.applyUserNum3 = applyUserNum3;
}
} }

View File

@ -172,6 +172,23 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
} }
PageHelper.startPage(page.getPage(), page.getRows()); PageHelper.startPage(page.getPage(), page.getRows());
List<ApplyDTO> applyDTOs = list(page.getParams()); List<ApplyDTO> applyDTOs = list(page.getParams());
for (ApplyDTO applyDTO : applyDTOs) {
//统计机构报名数量
List<String> states = new ArrayList<>();
states.add("0");
states.add("1");
states.add("2");
states.add("-1");
Integer num2 = countApplyNum(applyDTO.getApplyWorkTypeId(),applyDTO.getApplyInstitutionId(),states);
//统计机构报名审核通过数量
states.clear();
states.add("2");
Integer num3 = countApplyNum(applyDTO.getApplyWorkTypeId(),applyDTO.getApplyInstitutionId(),states);
Object applyClassPlanUserNum = ConfigManager.getInstance().getConfig().get("applyClassPlanUserNum");
applyDTO.setApplyUserNum1(applyClassPlanUserNum == null ? 0:Integer.valueOf(applyClassPlanUserNum.toString()));
applyDTO.setApplyUserNum2(num2);
applyDTO.setApplyUserNum3(num3);
}
PageInfo<ApplyDTO> pageInfo = new PageInfo<>(applyDTOs); PageInfo<ApplyDTO> pageInfo = new PageInfo<>(applyDTOs);
return new SuccessResultList<>(applyDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); return new SuccessResultList<>(applyDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
} }
@ -401,9 +418,9 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
if(!(applyDTO.getApplyAuditState() == -1 || applyDTO.getApplyAuditState() == 1)){ if(!(applyDTO.getApplyAuditState() == -1 || applyDTO.getApplyAuditState() == 1)){
throw new SearchException("暂不能修改信息"); throw new SearchException("暂不能修改信息");
} }
if(checkApplyIsFirst(creator,applyWorkTypeId,null) != 0){ // if(checkApplyIsFirst(creator,applyWorkTypeId,null) != 0){
throw new SaveException("您选择的工种已报名过其他培训机构"); // throw new SaveException("您选择的工种已报名过其他培训机构");
} // }
if(!examCheckService.getExamCheckFailOrBack(applyWorkTypeId,applyInstitutionId)){ if(!examCheckService.getExamCheckFailOrBack(applyWorkTypeId,applyInstitutionId)){
throw new SaveException("该机构以截止报名"); throw new SaveException("该机构以截止报名");