diff --git a/pom.xml b/pom.xml index d015265..b64ab7b 100644 --- a/pom.xml +++ b/pom.xml @@ -141,6 +141,12 @@ + + ink.wgink + register-base + 1.0-SNAPSHOT + + diff --git a/src/main/java/cn/com/tenlion/controller/api/apply/ApplyController.java b/src/main/java/cn/com/tenlion/controller/api/apply/ApplyController.java index bd5df29..45bca16 100644 --- a/src/main/java/cn/com/tenlion/controller/api/apply/ApplyController.java +++ b/src/main/java/cn/com/tenlion/controller/api/apply/ApplyController.java @@ -40,6 +40,33 @@ public class ApplyController extends DefaultBaseController { private IApplyService applyService; + @ApiOperation(value = "报名信息报道", notes = "报名信息报道接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"), + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("updateInstitutionId/{targetId}") + @CheckRequestBodyAnnotation + public SuccessResult updateInstitutionId(@PathVariable("targetId") String targetId) { + Map params = requestParams(); + String sourceIds = params.get("sourceIds").toString(); + applyService.updateInstitutionId(targetId,Arrays.asList(sourceIds.split(","))); + return new SuccessResult(); + } + + + + @ApiOperation(value = "自定义新增报名信息", notes = "自定义新增报名信息") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save-relation") + @CheckRequestBodyAnnotation + public SuccessResult saveRelation(@RequestBody ApplyVO applyVO) { + applyService.saveRelationReturnId(applyVO); + return new SuccessResult(); + } + + + @ApiOperation(value = "报名信息撤回", notes = "报名信息撤回接口") @ApiImplicitParams({ diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java index 9cb2409..881d593 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java @@ -16,6 +16,8 @@ public class ApplyDTO { @ApiModelProperty(name = "applyInstitutionId", value = "报名机构ID") private String applyInstitutionId; + @ApiModelProperty(name = "applyInstitutionName", value = "报名机构中文名称") + private String applyInstitutionName; @ApiModelProperty(name = "applyId", value = "报名信息ID") private String applyId; @ApiModelProperty(name = "applyClassId", value = "报名班级ID") @@ -87,6 +89,15 @@ public class ApplyDTO { @ApiModelProperty(name = "准考证码", value = "准考证码") 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() { return applyInstitutionId; @@ -96,6 +107,14 @@ public class ApplyDTO { this.applyInstitutionId = applyInstitutionId; } + public String getApplyInstitutionName() { + return applyInstitutionName; + } + + public void setApplyInstitutionName(String applyInstitutionName) { + this.applyInstitutionName = applyInstitutionName; + } + public String getApplyId() { return applyId == null ? "" : applyId.trim(); } @@ -344,4 +363,29 @@ public class ApplyDTO { public void setApplyWorkTypeName(String 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; + } } 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 7ea6e10..51fcc6f 100644 --- a/src/main/java/cn/com/tenlion/service/apply/IApplyService.java +++ b/src/main/java/cn/com/tenlion/service/apply/IApplyService.java @@ -22,6 +22,13 @@ import java.util.Map; **/ public interface IApplyService { + /** + * 修改报名机构 + * @param targetId 目标id + * @param sourceIds 源id + */ + void updateInstitutionId(String targetId,List sourceIds); + /** * 自定义新增报名信息 * @param applyVO 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 9abdedc..71ed134 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 @@ -86,12 +86,41 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic @Autowired private ServerProperties serverProperties; + /** + * 修改报名机构 + * @param targetId 目标id + * @param sourceIds 源id + */ + public void updateInstitutionId(String targetId,List sourceIds){ + InstitutionDTO institutionDTO = iInstitutionService.get(targetId); + if(institutionDTO != null){ + throw new SearchException("未查询到目标机构信息"); + } + Map params = new HashMap<>(); + for (String sourceId : sourceIds) { + params.put("applyInstitutionId",sourceId); + List applyDTOList = this.list(params);//查询源报名的人 + for (ApplyDTO applyDTO : applyDTOList) { + Map updateParams = new HashMap<>(); + updateParams.put("applyId",applyDTO.getApplyId()); + updateParams.put("applyInstitutionId",applyDTO.getApplyInstitutionId()); + applyDao.update(params); + //增加操作日志 + ApplyAuditLogVO auditLogVO = new ApplyAuditLogVO(); + auditLogVO.setApplyId(applyDTO.getApplyId()); + auditLogVO.setApplyAuditState(0); + InstitutionDTO sourceInstitutionDTO = iInstitutionService.get(applyDTO.getApplyInstitutionId()); + if(sourceInstitutionDTO != null){ + throw new SearchException("未查询到源机构信息"); + } + auditLogVO.setApplyAuditExplain("【因报名人数不足】 报名培训机构 由原【"+sourceInstitutionDTO.getInstitutionName()+"】培训机构 调整到【"+institutionDTO.getInstitutionName()+"】培训机构"); + applyAuditLogService.save(null,auditLogVO); + } + } + } - private ISystemConfigManager systemConfigManager; - - public String saveRelationReturnId(ApplyVO applyVO){ String applyId = UUIDUtil.getUUID(); @@ -143,6 +172,23 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic } PageHelper.startPage(page.getPage(), page.getRows()); List applyDTOs = list(page.getParams()); + for (ApplyDTO applyDTO : applyDTOs) { + //统计机构报名数量 + List 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 pageInfo = new PageInfo<>(applyDTOs); return new SuccessResultList<>(applyDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); } @@ -372,9 +418,9 @@ 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(checkApplyIsFirst(creator,applyWorkTypeId,null) != 0){ +// throw new SaveException("您选择的工种已报名过其他培训机构"); +// } if(!examCheckService.getExamCheckFailOrBack(applyWorkTypeId,applyInstitutionId)){ throw new SaveException("该机构以截止报名"); diff --git a/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java b/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java index 5ea390a..2acff27 100644 --- a/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java @@ -329,9 +329,9 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist */ Map params = HashMapUtil.beanToMap(distributionVO); if (StringUtils.isBlank(token)) { - setUpdateInfo(params); + setSaveInfo(params); } else { - setAppUpdateInfo(token, params); + setAppSaveInfo(token, params); } params.put("stationId", stationId.length() > 0 ? stationId.substring(1, stationId.length()) : ""); params.put("planId", classPlanId); diff --git a/src/main/resources/mybatis/mapper/apply/apply-mapper.xml b/src/main/resources/mybatis/mapper/apply/apply-mapper.xml index deba6a8..252a506 100644 --- a/src/main/resources/mybatis/mapper/apply/apply-mapper.xml +++ b/src/main/resources/mybatis/mapper/apply/apply-mapper.xml @@ -4,6 +4,7 @@ + @@ -275,6 +276,7 @@ SELECT t1.apply_institution_id, + m1.institution_name AS apply_institution_name, t1.apply_id, t1.apply_class_id, t1.apply_class_name, @@ -451,6 +456,8 @@ ON t1.apply_physical_state = t5.data_id LEFT JOIN e_work_type e1 ON t1.apply_work_type_id = e1.work_type_id + LEFT JOIN m_institution m1 + ON t1.apply_institution_id = m1.institution_id WHERE t1.is_delete = 0 @@ -686,4 +693,7 @@ + + + \ No newline at end of file diff --git a/src/main/resources/static/route/apply/save.html b/src/main/resources/static/route/apply/save.html index d38b3d7..9c2e08f 100644 --- a/src/main/resources/static/route/apply/save.html +++ b/src/main/resources/static/route/apply/save.html @@ -22,126 +22,168 @@
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- -
- -
-
-
- -
- -
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- -
- -
-
-
- -
- -
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
+
- + +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+ +
+ +
+
+
+ +
+ +
- +
- +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
@@ -64,6 +64,7 @@ if(reportType == '2'){ tableUrl = 'api/applystudents/listpage'; } else{ + $('#add-apply-user').show(); tableUrl = 'api/apply/listpage'; } @@ -81,7 +82,6 @@ where :{ applyInstitutionId: orgId, applyWorkTypeId : workerCatalog, - applyWorkTypeId : workerCatalog, applyClassId : reportType == "2" ? classPlanId : '' }, toolbar: false, @@ -149,8 +149,10 @@ keywords: $('#keywords').val(), startTime: $('#startTime').val(), endTime: $('#endTime').val(), + applyInstitutionId: orgId, + applyWorkTypeId : workerCatalog, + applyClassId : reportType == "2" ? classPlanId : '', applyAuditStates:$('#applyAuditStates').val(), - applyClassId : classPlanId }, page: { curr: currentPage diff --git a/src/main/resources/static/route/classplan/list-signup.html b/src/main/resources/static/route/classplan/list-signup.html index 550fbec..a95c4f0 100644 --- a/src/main/resources/static/route/classplan/list-signup.html +++ b/src/main/resources/static/route/classplan/list-signup.html @@ -19,7 +19,7 @@
-
+
已报人员数量 @@ -27,7 +27,7 @@
-
+
已审人员数量 @@ -35,7 +35,7 @@
-
+
总计人数 diff --git a/src/main/resources/static/route/classplan/save.html b/src/main/resources/static/route/classplan/save.html index fe03fa4..7e14324 100644 --- a/src/main/resources/static/route/classplan/save.html +++ b/src/main/resources/static/route/classplan/save.html @@ -443,7 +443,7 @@ shade: 0.3, yes: function(index) { top.dialog.close(index); - window.location.reload(); + closeBox(); }, btn2: function() { closeBox(); diff --git a/src/main/resources/static/route/examination/distribution/show.html b/src/main/resources/static/route/examination/distribution/show.html index 144aa95..5371d42 100644 --- a/src/main/resources/static/route/examination/distribution/show.html +++ b/src/main/resources/static/route/examination/distribution/show.html @@ -17,7 +17,7 @@
@@ -199,10 +199,11 @@ success: function (orgData) { // 回显 , 选中 for (var a = 0; a < orgData.length; a++) { - console.log(dataForm); - for (var j = 0; j < dataForm.distributionFieldList.length; j++) { - if (orgData[a].organizationId == dataForm.distributionFieldList[j].fieldId) { - orgData[a].checked = 'checked="checked"'; + if(dataForm) { + for (var j = 0; j < dataForm.distributionFieldList.length; j++) { + if (orgData[a].organizationId == dataForm.distributionFieldList[j].fieldId) { + orgData[a].checked = 'checked="checked"'; + } } } } diff --git a/src/main/resources/static/route/examination/distribution/update.html b/src/main/resources/static/route/examination/distribution/update.html index 06f2e51..d55c089 100644 --- a/src/main/resources/static/route/examination/distribution/update.html +++ b/src/main/resources/static/route/examination/distribution/update.html @@ -17,7 +17,7 @@