Compare commits
10 Commits
cdc22399c4
...
c1d53c3434
Author | SHA1 | Date | |
---|---|---|---|
|
c1d53c3434 | ||
|
70507b31b8 | ||
|
b059e566f0 | ||
|
22da7c3ee7 | ||
|
6cbc85c437 | ||
|
b2e40491e9 | ||
|
637f850af1 | ||
|
4ded4d64d7 | ||
|
2f2376ca4e | ||
|
1ba98952ac |
69
readme.md
Normal file
69
readme.md
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
# 处理数据
|
||||||
|
|
||||||
|
## 班级人员丢失
|
||||||
|
|
||||||
|
- 条件:班级人员减少,在申请表中有数据
|
||||||
|
- 结果:将申请表中的人员数据,移动到班级表中
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- 查询需要处理的数据
|
||||||
|
SELECT * FROM e_apply WHERE apply_card_number IN ('410402198111305657', '140202197206122553', '15043019960330258X', '152224198607034016', '150102197207014534');
|
||||||
|
|
||||||
|
-- 赋值班级
|
||||||
|
UPDATE
|
||||||
|
e_apply
|
||||||
|
SET
|
||||||
|
apply_class_id = 'eec316b8-28cc-4e94-9d5e-4fd7fde9be5f'
|
||||||
|
WHERE
|
||||||
|
apply_institution_id = 'ca4e762e-04d7-442f-9771-9ed4f2fc8070' AND apply_card_number IN ('410402198111305657', '140202197206122553', '15043019960330258X', '152224198607034016', '150102197207014534');
|
||||||
|
|
||||||
|
-- 移动
|
||||||
|
INSERT INTO `e_apply_students` (`id`, `apply_id`, `apply_institution_id`, `apply_class_id`, `apply_class_name`, `apply_work_type_id`, `apply_name`, `apply_sex`, `apply_data_birth`, `apply_card_type`, `apply_card_number`, `apply_phone`, `apply_address`, `apply_culture_level`, `apply_postcode`, `apply_physical_state`, `apply_unit_name`, `apply_unit_phone`, `apply_unit_address`, `apply_position`, `apply_major_year`, `apply_technical_titles`, `apply_user_card_photo`, `apply_audit_state`, `bind_user_account`, `creator`, `gmt_create`, `modifier`, `gmt_modified`, `is_delete`, `apply_take_card_photo`, `apply_re_pei_xun_photo`, `apply_fen_lei`, `apply_lei_bie`, `apply_zhi_cheng`, `apply_school`, `apply_subject`, `apply_unit_type`, `apply_unit_work`, `apply_unit_belong`, `take_card_time`, `card_time_limit`, `take_card_number`, `re_pei_xun_date`, `pei_xun_date`, `exam_score`, `exam_score_hands_on`, `apply_health`, `id_card_front_photo`, `id_card_back_photo`, `education_photo`, `origin_education_photo`)
|
||||||
|
SELECT
|
||||||
|
`id`, `apply_id`, `apply_institution_id`, `apply_class_id`, `apply_class_name`, `apply_work_type_id`, `apply_name`, `apply_sex`, `apply_data_birth`, `apply_card_type`, `apply_card_number`, `apply_phone`, `apply_address`, `apply_culture_level`, `apply_postcode`, `apply_physical_state`, `apply_unit_name`, `apply_unit_phone`, `apply_unit_address`, `apply_position`, `apply_major_year`, `apply_technical_titles`, `apply_user_card_photo`, `apply_audit_state`, `bind_user_account`, `creator`, `gmt_create`, `modifier`, `gmt_modified`, `is_delete`, `apply_take_card_photo`, `apply_re_pei_xun_photo`, `apply_fen_lei`, `apply_lei_bie`, `apply_zhi_cheng`, `apply_school`, `apply_subject`, `apply_unit_type`, `apply_unit_work`, `apply_unit_belong`, `take_card_time`, `card_time_limit`, `take_card_number`, `re_pei_xun_date`, `pei_xun_date`, `exam_score`, `exam_score_hands_on`, `apply_health`, `id_card_front_photo`, `id_card_back_photo`, `education_photo`, `origin_education_photo`
|
||||||
|
FROM
|
||||||
|
e_apply
|
||||||
|
WHERE apply_institution_id = 'ca4e762e-04d7-442f-9771-9ed4f2fc8070' AND apply_card_number IN ('410402198111305657', '140202197206122553', '15043019960330258X', '152224198607034016', '150102197207014534');
|
||||||
|
|
||||||
|
-- 查询
|
||||||
|
SELECT * FROM e_apply_students WHERE apply_class_id = 'eec316b8-28cc-4e94-9d5e-4fd7fde9be5f';
|
||||||
|
|
||||||
|
-- 移除申请表中数据
|
||||||
|
DELETE FROM e_apply WHERE apply_card_number IN ('410402198111305657', '140202197206122553', '15043019960330258X', '152224198607034016', '150102197207014534');
|
||||||
|
```
|
||||||
|
|
||||||
|
## 重新开班
|
||||||
|
|
||||||
|
- 条件:人员问题需要重新开班
|
||||||
|
- 结果:将现有班级人员清空重新开班
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- 开班计划
|
||||||
|
SELECT * FROM e_class_plan WHERE plan_number LIKE '%2023.3.24%';
|
||||||
|
-- 班级学生
|
||||||
|
SELECT * FROM e_apply_students WHERE apply_class_id = '7601dd43-e3ae-4312-b4e4-bfd81f43f7db';
|
||||||
|
-- 申请人员
|
||||||
|
SELECT * FROM e_apply WHERE apply_institution_id = 'ca4e762e-04d7-442f-9771-9ed4f2fc8070';
|
||||||
|
-- 机构
|
||||||
|
SELECT * FROM m_institution WHERE institution_id = 'ca4e762e-04d7-442f-9771-9ed4f2fc8070';
|
||||||
|
|
||||||
|
-- 移动报名数据
|
||||||
|
INSERT INTO e_apply (`apply_id`, `apply_institution_id`, `apply_class_name`, `apply_work_type_id`, `apply_name`, `apply_sex`, `apply_data_birth`, `apply_card_type`, `apply_card_number`, `apply_phone`, `apply_address`, `apply_culture_level`, `apply_postcode`, `apply_physical_state`, `apply_unit_name`, `apply_unit_phone`, `apply_unit_address`, `apply_position`, `apply_major_year`, `apply_technical_titles`, `apply_user_card_photo`, `apply_audit_state`, `bind_user_account`, `creator`, `gmt_create`, `modifier`, `gmt_modified`, `is_delete`, `apply_take_card_photo`, `apply_re_pei_xun_photo`, `apply_fen_lei`, `apply_lei_bie`, `apply_zhi_cheng`, `apply_school`, `apply_subject`, `apply_unit_type`, `apply_unit_work`, `apply_unit_belong`, `take_card_time`, `card_time_limit`, `take_card_number`, `re_pei_xun_date`, `pei_xun_date`, `exam_score`, `exam_score_hands_on`, `apply_health`, `id_card_front_photo`, `id_card_back_photo`, `education_photo`, `origin_education_photo`)
|
||||||
|
SELECT
|
||||||
|
`apply_id`, `apply_institution_id`, `apply_class_name`, `apply_work_type_id`, `apply_name`, `apply_sex`, `apply_data_birth`, `apply_card_type`, `apply_card_number`, `apply_phone`, `apply_address`, `apply_culture_level`, `apply_postcode`, `apply_physical_state`, `apply_unit_name`, `apply_unit_phone`, `apply_unit_address`, `apply_position`, `apply_major_year`, `apply_technical_titles`, `apply_user_card_photo`, `apply_audit_state`, `bind_user_account`, `creator`, `gmt_create`, `modifier`, `gmt_modified`, `is_delete`, `apply_take_card_photo`, `apply_re_pei_xun_photo`, `apply_fen_lei`, `apply_lei_bie`, `apply_zhi_cheng`, `apply_school`, `apply_subject`, `apply_unit_type`, `apply_unit_work`, `apply_unit_belong`, `take_card_time`, `card_time_limit`, `take_card_number`, `re_pei_xun_date`, `pei_xun_date`, `exam_score`, `exam_score_hands_on`, `apply_health`, `id_card_front_photo`, `id_card_back_photo`, `education_photo`, `origin_education_photo`
|
||||||
|
FROM
|
||||||
|
e_apply_students
|
||||||
|
WHERE
|
||||||
|
apply_institution_id = 'ca4e762e-04d7-442f-9771-9ed4f2fc8070'
|
||||||
|
AND
|
||||||
|
apply_class_id = '7601dd43-e3ae-4312-b4e4-bfd81f43f7db';
|
||||||
|
|
||||||
|
-- 清空报名数据
|
||||||
|
DELETE FROM
|
||||||
|
e_apply_students
|
||||||
|
WHERE
|
||||||
|
apply_institution_id = 'ca4e762e-04d7-442f-9771-9ed4f2fc8070'
|
||||||
|
AND
|
||||||
|
apply_class_id = '7601dd43-e3ae-4312-b4e4-bfd81f43f7db';
|
||||||
|
|
||||||
|
```
|
10
src/main/java/cn/com/tenlion/consts/ISignUpConsts.java
Normal file
10
src/main/java/cn/com/tenlion/consts/ISignUpConsts.java
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package cn.com.tenlion.consts;
|
||||||
|
|
||||||
|
public interface ISignUpConsts {
|
||||||
|
|
||||||
|
String KEY_AQGL_FAMALE_MAX_AGE = "aqglFamaleMaxAge";
|
||||||
|
String KEY_AQGL_MALE_MAX_AGE = "aqglMaleMaxAge";
|
||||||
|
String KEY_TZZY_FAMALE_MAX_AGE = "tzzyFamaleMaxAge";
|
||||||
|
String KEY_TZZY_MALE_MAX_AGE = "tzzyMaleMaxAge";
|
||||||
|
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package cn.com.tenlion.controller.api.apply;
|
package cn.com.tenlion.controller.api.apply;
|
||||||
|
|
||||||
import cn.com.tenlion.pojo.vos.apply.ApplyAuditVO;
|
import cn.com.tenlion.pojo.vos.apply.ApplyAuditVO;
|
||||||
|
import cn.com.tenlion.util.SignUpUtil;
|
||||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||||
import ink.wgink.common.base.DefaultBaseController;
|
import ink.wgink.common.base.DefaultBaseController;
|
||||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||||
@ -38,37 +39,28 @@ public class ApplyController extends DefaultBaseController {
|
|||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "报名信息报道", notes = "报名信息报道接口")
|
@ApiOperation(value = "报名信息报道", notes = "报名信息报道接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),})
|
||||||
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@PutMapping("updateInstitutionId/{targetId}")
|
@PutMapping("updateInstitutionId/{targetId}")
|
||||||
@CheckRequestBodyAnnotation
|
@CheckRequestBodyAnnotation
|
||||||
public SuccessResult updateInstitutionId(@PathVariable("targetId") String targetId,
|
public SuccessResult updateInstitutionId(@PathVariable("targetId") String targetId, @RequestBody Map<String, Object> params) {
|
||||||
@RequestBody Map<String, Object> params) {
|
|
||||||
String sourceIds = params.get("sourceIds").toString();
|
String sourceIds = params.get("sourceIds").toString();
|
||||||
applyService.updateInstitutionId(targetId,Arrays.asList(sourceIds.split(",")));
|
applyService.updateInstitutionId(targetId, Arrays.asList(sourceIds.split(",")));
|
||||||
return new SuccessResult();
|
return new SuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "自定义新增报名信息", notes = "自定义新增报名信息")
|
@ApiOperation(value = "自定义新增报名信息", notes = "自定义新增报名信息")
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@PostMapping("save-relation")
|
@PostMapping("save-relation")
|
||||||
@CheckRequestBodyAnnotation
|
@CheckRequestBodyAnnotation
|
||||||
public SuccessResult saveRelation(@RequestBody ApplyVO applyVO) {
|
public SuccessResult saveRelation(@RequestBody ApplyVO applyVO) {
|
||||||
|
SignUpUtil.checkIdCardAge(applyVO.getApplyLeiBie(), applyVO.getApplyCardNumber());
|
||||||
applyService.saveRelationReturnId(applyVO);
|
applyService.saveRelationReturnId(applyVO);
|
||||||
return new SuccessResult();
|
return new SuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiImplicitParams({@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),})
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "报名信息撤回", notes = "报名信息撤回接口")
|
|
||||||
@ApiImplicitParams({
|
|
||||||
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@PutMapping("updateAuditStateRecall/{applyId}")
|
@PutMapping("updateAuditStateRecall/{applyId}")
|
||||||
@CheckRequestBodyAnnotation
|
@CheckRequestBodyAnnotation
|
||||||
@ -77,15 +69,12 @@ public class ApplyController extends DefaultBaseController {
|
|||||||
applyAuditVO.setApplyId(applyId);
|
applyAuditVO.setApplyId(applyId);
|
||||||
applyAuditVO.setApplyAuditExplain("用户撤回报名");
|
applyAuditVO.setApplyAuditExplain("用户撤回报名");
|
||||||
applyAuditVO.setApplyAuditState(1);
|
applyAuditVO.setApplyAuditState(1);
|
||||||
applyService.updateAuditState(null,applyAuditVO);
|
applyService.updateAuditState(null, applyAuditVO);
|
||||||
return new SuccessResult();
|
return new SuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "报名信息报道", notes = "报名信息报道接口")
|
@ApiOperation(value = "报名信息报道", notes = "报名信息报道接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),})
|
||||||
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@PutMapping("updateAuditStateReport/{applyId}")
|
@PutMapping("updateAuditStateReport/{applyId}")
|
||||||
@CheckRequestBodyAnnotation
|
@CheckRequestBodyAnnotation
|
||||||
@ -94,20 +83,18 @@ public class ApplyController extends DefaultBaseController {
|
|||||||
applyAuditVO.setApplyId(applyId);
|
applyAuditVO.setApplyId(applyId);
|
||||||
applyAuditVO.setApplyAuditExplain("用户进行报道");
|
applyAuditVO.setApplyAuditExplain("用户进行报道");
|
||||||
applyAuditVO.setApplyAuditState(3);
|
applyAuditVO.setApplyAuditState(3);
|
||||||
applyService.updateAuditState(null,applyAuditVO);
|
applyService.updateAuditState(null, applyAuditVO);
|
||||||
return new SuccessResult();
|
return new SuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "报名信息审核", notes = "报名信息审核接口")
|
@ApiOperation(value = "报名信息审核", notes = "报名信息审核接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),})
|
||||||
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@PutMapping("updateAuditStateAudit")
|
@PutMapping("updateAuditStateAudit")
|
||||||
@CheckRequestBodyAnnotation
|
@CheckRequestBodyAnnotation
|
||||||
public SuccessResult updateAuditStateAudit(@RequestBody ApplyAuditVO applyAuditVO) {
|
public SuccessResult updateAuditStateAudit(@RequestBody ApplyAuditVO applyAuditVO) {
|
||||||
applyService.audit(null,applyAuditVO);
|
applyService.audit(null, applyAuditVO);
|
||||||
return new SuccessResult();
|
return new SuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,9 +109,7 @@ public class ApplyController extends DefaultBaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除报名信息", notes = "删除报名信息接口")
|
@ApiOperation(value = "删除报名信息", notes = "删除报名信息接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")})
|
||||||
@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@DeleteMapping("remove/{ids}")
|
@DeleteMapping("remove/{ids}")
|
||||||
public SuccessResult remove(@PathVariable("ids") String ids) {
|
public SuccessResult remove(@PathVariable("ids") String ids) {
|
||||||
@ -133,9 +118,7 @@ public class ApplyController extends DefaultBaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "修改报名信息", notes = "修改报名信息接口")
|
@ApiOperation(value = "修改报名信息", notes = "修改报名信息接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path")})
|
||||||
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path")
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@PutMapping("update/{applyId}")
|
@PutMapping("update/{applyId}")
|
||||||
@CheckRequestBodyAnnotation
|
@CheckRequestBodyAnnotation
|
||||||
@ -148,14 +131,13 @@ public class ApplyController extends DefaultBaseController {
|
|||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@PutMapping("update-user-register/{applyId}")
|
@PutMapping("update-user-register/{applyId}")
|
||||||
public SuccessResult updateUserRegister(@PathVariable("applyId") String applyId, @RequestBody ApplyVO applyVO) {
|
public SuccessResult updateUserRegister(@PathVariable("applyId") String applyId, @RequestBody ApplyVO applyVO) {
|
||||||
|
SignUpUtil.checkIdCardAge(applyVO.getApplyLeiBie(), applyVO.getApplyCardNumber());
|
||||||
applyService.updateUserRegister(applyId, applyVO);
|
applyService.updateUserRegister(applyId, applyVO);
|
||||||
return new SuccessResult();
|
return new SuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "报名信息详情", notes = "报名信息详情接口")
|
@ApiOperation(value = "报名信息详情", notes = "报名信息详情接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path")})
|
||||||
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path")
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("get/{applyId}")
|
@GetMapping("get/{applyId}")
|
||||||
public ApplyDTO get(@PathVariable("applyId") String applyId) {
|
public ApplyDTO get(@PathVariable("applyId") String applyId) {
|
||||||
@ -171,20 +153,14 @@ public class ApplyController extends DefaultBaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "报名信息分页列表", notes = "报名信息分页列表接口")
|
@ApiOperation(value = "报名信息分页列表", notes = "报名信息分页列表接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")})
|
||||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
|
||||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
|
||||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("listpage")
|
@GetMapping("listpage")
|
||||||
public SuccessResultList<List<ApplyDTO>> listPage(ListPage page) {
|
public SuccessResultList<List<ApplyDTO>> listPage(ListPage page) {
|
||||||
Map<String, Object> params = requestParams();
|
Map<String, Object> params = requestParams();
|
||||||
if(null != params.get("applyAuditStates")){
|
if (null != params.get("applyAuditStates")) {
|
||||||
if(!StringUtils.isBlank(params.get("applyAuditStates").toString())){
|
if (!StringUtils.isBlank(params.get("applyAuditStates").toString())) {
|
||||||
params.put("applyAuditStates",Arrays.asList(params.get("applyAuditStates").toString().split(",")));
|
params.put("applyAuditStates", Arrays.asList(params.get("applyAuditStates").toString().split(",")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
page.setParams(params);
|
page.setParams(params);
|
||||||
|
@ -58,7 +58,6 @@ public class ApplyStudentsController extends DefaultBaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "新增班级学生表", notes = "新增班级学生表接口")
|
@ApiOperation(value = "新增班级学生表", notes = "新增班级学生表接口")
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@PostMapping("save")
|
@PostMapping("save")
|
||||||
@ -69,9 +68,7 @@ public class ApplyStudentsController extends DefaultBaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除班级学生表", notes = "删除班级学生表接口")
|
@ApiOperation(value = "删除班级学生表", notes = "删除班级学生表接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")})
|
||||||
@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@DeleteMapping("remove/{ids}")
|
@DeleteMapping("remove/{ids}")
|
||||||
public SuccessResult remove(@PathVariable("ids") String ids) {
|
public SuccessResult remove(@PathVariable("ids") String ids) {
|
||||||
@ -80,9 +77,7 @@ public class ApplyStudentsController extends DefaultBaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "修改班级学生表", notes = "修改班级学生表接口")
|
@ApiOperation(value = "修改班级学生表", notes = "修改班级学生表接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "applyStudentsId", value = "班级学生表ID", paramType = "path")})
|
||||||
@ApiImplicitParam(name = "applyStudentsId", value = "班级学生表ID", paramType = "path")
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@PutMapping("update/{applyStudentsId}")
|
@PutMapping("update/{applyStudentsId}")
|
||||||
@CheckRequestBodyAnnotation
|
@CheckRequestBodyAnnotation
|
||||||
@ -92,12 +87,10 @@ public class ApplyStudentsController extends DefaultBaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "班级学生表详情", notes = "班级学生表详情接口")
|
@ApiOperation(value = "班级学生表详情", notes = "班级学生表详情接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "applyStudentsId", value = "班级学生表ID", paramType = "path")})
|
||||||
@ApiImplicitParam(name = "applyStudentsId", value = "班级学生表ID", paramType = "path")
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("get/{applyStudentsId}")
|
@GetMapping("get/{applyStudentsId}")
|
||||||
public ApplyStudentsDTO get(@PathVariable("applyStudentsId") String applyStudentsId) {
|
public ApplyStudentsDTO get(@PathVariable("applyStudentsId") String applyStudentsId) {
|
||||||
return applyStudentsService.get(applyStudentsId);
|
return applyStudentsService.get(applyStudentsId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,13 +109,7 @@ public class ApplyStudentsController extends DefaultBaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "班级学生表分页列表", notes = "班级学生表分页列表接口")
|
@ApiOperation(value = "班级学生表分页列表", notes = "班级学生表分页列表接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")})
|
||||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
|
||||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
|
||||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("listpage")
|
@GetMapping("listpage")
|
||||||
public SuccessResultList<List<ApplyStudentsDTO>> listPage(ListPage page) {
|
public SuccessResultList<List<ApplyStudentsDTO>> listPage(ListPage page) {
|
||||||
@ -148,7 +135,7 @@ public class ApplyStudentsController extends DefaultBaseController {
|
|||||||
ExcelUtil.readExcel(file, 0, 1, listener, ApplyStudentsModel.class);
|
ExcelUtil.readExcel(file, 0, 1, listener, ApplyStudentsModel.class);
|
||||||
// 错误集
|
// 错误集
|
||||||
List<ImportFailDto> importFailDtoList = listener.getImportFailDtoList();
|
List<ImportFailDto> importFailDtoList = listener.getImportFailDtoList();
|
||||||
if(!importFailDtoList.isEmpty()) {
|
if (!importFailDtoList.isEmpty()) {
|
||||||
failDtoList = importFailDtoList;
|
failDtoList = importFailDtoList;
|
||||||
return new SuccessResultData(importFailDtoList.size());
|
return new SuccessResultData(importFailDtoList.size());
|
||||||
}
|
}
|
||||||
@ -163,9 +150,9 @@ public class ApplyStudentsController extends DefaultBaseController {
|
|||||||
String fileName = URLEncoder.encode(excelName, "UTF-8");
|
String fileName = URLEncoder.encode(excelName, "UTF-8");
|
||||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
|
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
|
||||||
|
|
||||||
String [] headers = {"班号", "姓名", "考生身份证号码", "成绩", "失败原因"};
|
String[] headers = {"班号", "姓名", "考生身份证号码", "成绩", "失败原因"};
|
||||||
List<List<String>> listHeader = new ArrayList<>();
|
List<List<String>> listHeader = new ArrayList<>();
|
||||||
for(String item : headers) {
|
for (String item : headers) {
|
||||||
List<String> title = new ArrayList<>();
|
List<String> title = new ArrayList<>();
|
||||||
title.add(item);
|
title.add(item);
|
||||||
listHeader.add(title);
|
listHeader.add(title);
|
||||||
@ -195,16 +182,16 @@ public class ApplyStudentsController extends DefaultBaseController {
|
|||||||
String fileName = URLEncoder.encode(excelName, "UTF-8");
|
String fileName = URLEncoder.encode(excelName, "UTF-8");
|
||||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
|
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
|
||||||
|
|
||||||
String [] headers = {"班号", "姓名", "考生身份证号码", "考试机构", "考试开始时间", "考试结束时间", "成绩", "失败原因"};
|
String[] headers = {"班号", "姓名", "考生身份证号码", "考试机构", "考试开始时间", "考试结束时间", "成绩", "失败原因"};
|
||||||
List<List<String>> listHeader = new ArrayList<>();
|
List<List<String>> listHeader = new ArrayList<>();
|
||||||
for(String item : headers) {
|
for (String item : headers) {
|
||||||
List<String> title = new ArrayList<>();
|
List<String> title = new ArrayList<>();
|
||||||
title.add(item);
|
title.add(item);
|
||||||
listHeader.add(title);
|
listHeader.add(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ApplyStudentsDTO> applyStudentsDTOS = applyStudentsService.list(params);
|
List<ApplyStudentsDTO> applyStudentsDTOS = applyStudentsService.list(params);
|
||||||
if(null == applyStudentsDTOS || applyStudentsDTOS.size() <= 0) {
|
if (null == applyStudentsDTOS || applyStudentsDTOS.size() <= 0) {
|
||||||
throw new SearchException("暂无数据,导出失败");
|
throw new SearchException("暂无数据,导出失败");
|
||||||
}
|
}
|
||||||
List<List<Object>> listData = new ArrayList<>();
|
List<List<Object>> listData = new ArrayList<>();
|
||||||
|
@ -42,101 +42,67 @@ public class ApplyAppController extends DefaultBaseController {
|
|||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "工种报名培训机构分页列表", notes = "工种报名培训机构分页列表接口")
|
@ApiOperation(value = "工种报名培训机构分页列表", notes = "工种报名培训机构分页列表接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "workTypeId", value = "工种ID", paramType = "query", dataType = "String")})
|
||||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
|
||||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
|
||||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
|
||||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "workTypeId", value = "工种ID", paramType = "query", dataType = "String")
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("list-page-apply-work-type")
|
@GetMapping("list-page-apply-work-type")
|
||||||
public SuccessResultList<List<ApplyWorkTypeInstitutionDTO>> listPageApplyWorkType(@RequestHeader("token") String token, ListPage page) throws Exception{
|
public SuccessResultList<List<ApplyWorkTypeInstitutionDTO>> listPageApplyWorkType(@RequestHeader("token") String token, ListPage page) throws Exception {
|
||||||
Map<String, Object> params = requestParams();
|
Map<String, Object> params = requestParams();
|
||||||
page.setParams(params);
|
page.setParams(params);
|
||||||
return applyService.listPageApplyWorkType(token,page);
|
return applyService.listPageApplyWorkType(token, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "工种报名培训机构列表", notes = "工种报名培训机构列表接口")
|
@ApiOperation(value = "工种报名培训机构列表", notes = "工种报名培训机构列表接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "workTypeId", value = "工种ID", paramType = "query", dataType = "String")})
|
||||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
|
||||||
@ApiImplicitParam(name = "workTypeId", value = "工种ID", paramType = "query", dataType = "String")
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("list-apply-work-type")
|
@GetMapping("list-apply-work-type")
|
||||||
public List<ApplyWorkTypeInstitutionDTO> listApplyWorkType(@RequestHeader("token") String token) throws Exception{
|
public List<ApplyWorkTypeInstitutionDTO> listApplyWorkType(@RequestHeader("token") String token) throws Exception {
|
||||||
Map<String, Object> params = requestParams();
|
Map<String, Object> params = requestParams();
|
||||||
return applyService.listApplyWorkType(token,params);
|
return applyService.listApplyWorkType(token, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "我的报名信息分页列表", notes = "我的报名信息分页列表接口")
|
@ApiOperation(value = "我的报名信息分页列表", notes = "我的报名信息分页列表接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String"),})
|
||||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
|
||||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
|
||||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
|
||||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String"),
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("listPageMyApply")
|
@GetMapping("listPageMyApply")
|
||||||
public SuccessResultList<List<ApplyDTO>> listPageMyApply(@RequestHeader("token") String token, ListPage page) throws Exception{
|
public SuccessResultList<List<ApplyDTO>> listPageMyApply(@RequestHeader("token") String token, ListPage page) throws Exception {
|
||||||
Map<String, Object> params = requestParams();
|
Map<String, Object> params = requestParams();
|
||||||
page.setParams(params);
|
page.setParams(params);
|
||||||
return applyService.listPageMyApply(token,page);
|
return applyService.listPageMyApply(token, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "报名计划分页列表", notes = "报名计划分页列表接口")
|
@ApiOperation(value = "报名计划分页列表", notes = "报名计划分页列表接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "applyCardNumber", value = "报名证件号", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "workerCatalog", value = "报名工种", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "planType", value = "报名类型", paramType = "query", dataType = "String"),})
|
||||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
|
||||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
|
||||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
|
||||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "applyCardNumber", value = "报名证件号", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "workerCatalog", value = "报名工种", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "planType", value = "报名类型", paramType = "query", dataType = "String"),
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("listPageApplyClassPlan")
|
@GetMapping("listPageApplyClassPlan")
|
||||||
public SuccessResultList<List<ApplyClassPlanDTO>> listPageApplyClassPlan(@RequestHeader("token") String token, ListPage page) throws Exception{
|
public SuccessResultList<List<ApplyClassPlanDTO>> listPageApplyClassPlan(@RequestHeader("token") String token, ListPage page) throws Exception {
|
||||||
Map<String, Object> params = requestParams();
|
Map<String, Object> params = requestParams();
|
||||||
page.setParams(params);
|
page.setParams(params);
|
||||||
return applyService.listPageApplyClassPlan(page);
|
return applyService.listPageApplyClassPlan(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "报名信息撤回", notes = "报名信息撤回接口")
|
@ApiOperation(value = "报名信息撤回", notes = "报名信息撤回接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),})
|
||||||
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@PutMapping("updateAuditStateRecall/{applyId}")
|
@PutMapping("updateAuditStateRecall/{applyId}")
|
||||||
@CheckRequestBodyAnnotation
|
@CheckRequestBodyAnnotation
|
||||||
public SuccessResult updateAuditStateRecall(@RequestHeader("token") String token,@PathVariable("applyId") String applyId) {
|
public SuccessResult updateAuditStateRecall(@RequestHeader("token") String token, @PathVariable("applyId") String applyId) {
|
||||||
ApplyDTO applyDTO = applyService.get(applyId);
|
ApplyDTO applyDTO = applyService.get(applyId);
|
||||||
if(applyId == null){
|
if (applyId == null) {
|
||||||
throw new SearchException("未查询到表名信息");
|
throw new SearchException("未查询到表名信息");
|
||||||
}
|
}
|
||||||
List<String> applyIds = new ArrayList<>();
|
List<String> applyIds = new ArrayList<>();
|
||||||
applyIds.add(applyId);
|
applyIds.add(applyId);
|
||||||
applyService.remove(token,applyIds);
|
applyService.remove(token, applyIds);
|
||||||
return new SuccessResult();
|
return new SuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "新增报名信息", notes = "新增报名信息接口")
|
@ApiOperation(value = "新增报名信息", notes = "新增报名信息接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", paramType = "header")})
|
||||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header")
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@PostMapping("save")
|
@PostMapping("save")
|
||||||
@CheckRequestBodyAnnotation
|
@CheckRequestBodyAnnotation
|
||||||
@ -146,10 +112,7 @@ public class ApplyAppController extends DefaultBaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除报名信息(id列表)", notes = "删除报名信息(id列表)接口")
|
@ApiOperation(value = "删除报名信息(id列表)", notes = "删除报名信息(id列表)接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")})
|
||||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
|
||||||
@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@DeleteMapping("remove/{ids}")
|
@DeleteMapping("remove/{ids}")
|
||||||
public SuccessResult remove(@RequestHeader("token") String token, @PathVariable("ids") String ids) {
|
public SuccessResult remove(@RequestHeader("token") String token, @PathVariable("ids") String ids) {
|
||||||
@ -158,10 +121,7 @@ public class ApplyAppController extends DefaultBaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "修改报名信息", notes = "修改报名信息接口")
|
@ApiOperation(value = "修改报名信息", notes = "修改报名信息接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path")})
|
||||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
|
||||||
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path")
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@PutMapping("updateapply/{applyId}")
|
@PutMapping("updateapply/{applyId}")
|
||||||
@CheckRequestBodyAnnotation
|
@CheckRequestBodyAnnotation
|
||||||
@ -171,10 +131,7 @@ public class ApplyAppController extends DefaultBaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "报名信息详情(通过ID)", notes = "报名信息详情(通过ID)接口")
|
@ApiOperation(value = "报名信息详情(通过ID)", notes = "报名信息详情(通过ID)接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path")})
|
||||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
|
||||||
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path")
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("get/{applyId}")
|
@GetMapping("get/{applyId}")
|
||||||
public ApplyDTO get(@RequestHeader("token") String token, @PathVariable("applyId") String applyId) {
|
public ApplyDTO get(@RequestHeader("token") String token, @PathVariable("applyId") String applyId) {
|
||||||
@ -182,9 +139,7 @@ public class ApplyAppController extends DefaultBaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "报名信息列表", notes = "报名信息列表接口")
|
@ApiOperation(value = "报名信息列表", notes = "报名信息列表接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", paramType = "header")})
|
||||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header")
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
public List<ApplyDTO> list(@RequestHeader("token") String token) {
|
public List<ApplyDTO> list(@RequestHeader("token") String token) {
|
||||||
@ -193,14 +148,7 @@ public class ApplyAppController extends DefaultBaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "报名信息分页列表", notes = "报名信息分页列表接口")
|
@ApiOperation(value = "报名信息分页列表", notes = "报名信息分页列表接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")})
|
||||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
|
||||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
|
||||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
|
||||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
|
||||||
})
|
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("listpageapply")
|
@GetMapping("listpageapply")
|
||||||
public SuccessResultList<List<ApplyDTO>> listPage(@RequestHeader("token") String token, ListPage page) {
|
public SuccessResultList<List<ApplyDTO>> listPage(@RequestHeader("token") String token, ListPage page) {
|
||||||
|
@ -140,4 +140,7 @@ public interface IApplyDao {
|
|||||||
Integer countKaoshi(Map<String, Object> query);
|
Integer countKaoshi(Map<String, Object> query);
|
||||||
|
|
||||||
Integer countKaoShiCiShu(Map<String, Object> query);
|
Integer countKaoShiCiShu(Map<String, Object> query);
|
||||||
|
|
||||||
|
List<String> listApplyInstitutionNameByCreator(String creator);
|
||||||
|
|
||||||
}
|
}
|
@ -158,4 +158,10 @@ public class ApplyDTO {
|
|||||||
private String modifier;
|
private String modifier;
|
||||||
@ApiModelProperty(name = "gmtModified", value = "修改时间")
|
@ApiModelProperty(name = "gmtModified", value = "修改时间")
|
||||||
private String gmtModified;
|
private String gmtModified;
|
||||||
|
@ApiModelProperty(name = "age", value = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
@ApiModelProperty(name = "maxAge", value = "年龄")
|
||||||
|
private Integer maxAge;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -157,6 +157,10 @@ public class ApplyStudentsDTO {
|
|||||||
private ClassPlanDTO classPlanDTO;
|
private ClassPlanDTO classPlanDTO;
|
||||||
@ApiModelProperty(name = "joinExam", value = "是否参加考试")
|
@ApiModelProperty(name = "joinExam", value = "是否参加考试")
|
||||||
private String joinExam;
|
private String joinExam;
|
||||||
|
@ApiModelProperty(name = "age", value = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
@ApiModelProperty(name = "maxAge", value = "年龄")
|
||||||
|
private Integer maxAge;
|
||||||
|
|
||||||
public String getApplyInstitutionId() {
|
public String getApplyInstitutionId() {
|
||||||
return applyInstitutionId == null ? "" : applyInstitutionId;
|
return applyInstitutionId == null ? "" : applyInstitutionId;
|
||||||
@ -685,4 +689,20 @@ public class ApplyStudentsDTO {
|
|||||||
public void setJoinExam(String joinExam) {
|
public void setJoinExam(String joinExam) {
|
||||||
this.joinExam = joinExam;
|
this.joinExam = joinExam;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getAge() {
|
||||||
|
return age;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAge(Integer age) {
|
||||||
|
this.age = age;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMaxAge() {
|
||||||
|
return maxAge;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxAge(Integer maxAge) {
|
||||||
|
this.maxAge = maxAge;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,8 @@ public class ApplyVO {
|
|||||||
private String idCardBackPhoto;
|
private String idCardBackPhoto;
|
||||||
@ApiModelProperty(name = "educationPhoto", value = "学历证书")
|
@ApiModelProperty(name = "educationPhoto", value = "学历证书")
|
||||||
private String educationPhoto;
|
private String educationPhoto;
|
||||||
|
@ApiModelProperty(name = "isTzzy", value = "是否特种作业")
|
||||||
|
private Boolean isTzzy;
|
||||||
|
|
||||||
public String getApplyInstitutionId() {
|
public String getApplyInstitutionId() {
|
||||||
return applyInstitutionId;
|
return applyInstitutionId;
|
||||||
@ -448,4 +450,12 @@ public class ApplyVO {
|
|||||||
public void setExamScoreHandsOn(String examScoreHandsOn) {
|
public void setExamScoreHandsOn(String examScoreHandsOn) {
|
||||||
this.examScoreHandsOn = examScoreHandsOn;
|
this.examScoreHandsOn = examScoreHandsOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getTzzy() {
|
||||||
|
return isTzzy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTzzy(Boolean tzzy) {
|
||||||
|
isTzzy = tzzy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,8 @@ import cn.com.tenlion.service.traininginstitutionserviceuser.ITrainingInstitutio
|
|||||||
import cn.com.tenlion.service.traininginstitutionuser.ITrainingInstitutionUserService;
|
import cn.com.tenlion.service.traininginstitutionuser.ITrainingInstitutionUserService;
|
||||||
import cn.com.tenlion.service.traininginstitutionworktype.ITrainingInstitutionWorkTypeService;
|
import cn.com.tenlion.service.traininginstitutionworktype.ITrainingInstitutionWorkTypeService;
|
||||||
import cn.com.tenlion.service.worktype.IWorkTypeService;
|
import cn.com.tenlion.service.worktype.IWorkTypeService;
|
||||||
|
import cn.com.tenlion.util.IdCardVerifyUtil;
|
||||||
|
import cn.com.tenlion.util.SignUpUtil;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import ink.wgink.common.base.DefaultBaseService;
|
import ink.wgink.common.base.DefaultBaseService;
|
||||||
@ -51,6 +53,7 @@ import ink.wgink.properties.FileProperties;
|
|||||||
import ink.wgink.properties.ServerProperties;
|
import ink.wgink.properties.ServerProperties;
|
||||||
import ink.wgink.service.user.pojo.vos.UserVO;
|
import ink.wgink.service.user.pojo.vos.UserVO;
|
||||||
import ink.wgink.service.user.service.IUserService;
|
import ink.wgink.service.user.service.IUserService;
|
||||||
|
import ink.wgink.util.ArrayListUtil;
|
||||||
import ink.wgink.util.QRCodeUtil;
|
import ink.wgink.util.QRCodeUtil;
|
||||||
import ink.wgink.util.UUIDUtil;
|
import ink.wgink.util.UUIDUtil;
|
||||||
import ink.wgink.util.date.DateUtil;
|
import ink.wgink.util.date.DateUtil;
|
||||||
@ -62,6 +65,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.mock.web.MockMultipartFile;
|
import org.springframework.mock.web.MockMultipartFile;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
@ -69,10 +73,8 @@ import javax.swing.*;
|
|||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName: ApplyServiceImpl
|
* @ClassName: ApplyServiceImpl
|
||||||
@ -120,28 +122,29 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
private IFileService fileService;
|
private IFileService fileService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改报名机构
|
* 修改报名机构
|
||||||
* @param targetId 目标id
|
*
|
||||||
|
* @param targetId 目标id
|
||||||
* @param sourceIds 源id
|
* @param sourceIds 源id
|
||||||
*/
|
*/
|
||||||
public void updateInstitutionId(String targetId,List<String> sourceIds){
|
public void updateInstitutionId(String targetId, List<String> sourceIds) {
|
||||||
InstitutionDTO institutionDTO = iInstitutionService.get(targetId);
|
InstitutionDTO institutionDTO = iInstitutionService.get(targetId);
|
||||||
if(institutionDTO == null){
|
if (institutionDTO == null) {
|
||||||
throw new SearchException("未查询到目标机构信息");
|
throw new SearchException("未查询到目标机构信息");
|
||||||
}
|
}
|
||||||
Map<String,Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
for (String sourceId : sourceIds) {
|
for (String sourceId : sourceIds) {
|
||||||
params.put("applyInstitutionId",sourceId);
|
params.put("applyInstitutionId", sourceId);
|
||||||
List<String> applyAuditStates = new ArrayList<>();
|
List<String> applyAuditStates = new ArrayList<>();
|
||||||
applyAuditStates.add("0");
|
applyAuditStates.add("0");
|
||||||
applyAuditStates.add("2");
|
applyAuditStates.add("2");
|
||||||
params.put("applyAuditStates",applyAuditStates);
|
params.put("applyAuditStates", applyAuditStates);
|
||||||
//查询源报名的人
|
//查询源报名的人
|
||||||
List<ApplyDTO> applyDTOList = this.list(params);
|
List<ApplyDTO> applyDTOList = this.list(params);
|
||||||
for (ApplyDTO applyDTO : applyDTOList) {
|
for (ApplyDTO applyDTO : applyDTOList) {
|
||||||
Map<String,Object> updateParams = new HashMap<>(8);
|
Map<String, Object> updateParams = new HashMap<>(8);
|
||||||
updateParams.put("applyId",applyDTO.getApplyId());
|
updateParams.put("applyId", applyDTO.getApplyId());
|
||||||
updateParams.put("applyInstitutionId",targetId);
|
updateParams.put("applyInstitutionId", targetId);
|
||||||
setUpdateInfo(updateParams);
|
setUpdateInfo(updateParams);
|
||||||
applyDao.update(updateParams);
|
applyDao.update(updateParams);
|
||||||
//增加操作日志
|
//增加操作日志
|
||||||
@ -149,19 +152,18 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
auditLogVO.setApplyId(applyDTO.getApplyId());
|
auditLogVO.setApplyId(applyDTO.getApplyId());
|
||||||
auditLogVO.setApplyAuditState(0);
|
auditLogVO.setApplyAuditState(0);
|
||||||
InstitutionDTO sourceInstitutionDTO = iInstitutionService.get(applyDTO.getApplyInstitutionId());
|
InstitutionDTO sourceInstitutionDTO = iInstitutionService.get(applyDTO.getApplyInstitutionId());
|
||||||
if(sourceInstitutionDTO == null){
|
if (sourceInstitutionDTO == null) {
|
||||||
throw new SearchException("未查询到源机构信息");
|
throw new SearchException("未查询到源机构信息");
|
||||||
}
|
}
|
||||||
auditLogVO.setApplyAuditExplain("【因报名人数不足,无法开班】 报名培训机构 由原【"+sourceInstitutionDTO.getInstitutionName()+"】培训机构 调整到【"+institutionDTO.getInstitutionName()+"】培训机构");
|
auditLogVO.setApplyAuditExplain("【因报名人数不足,无法开班】 报名培训机构 由原【" + sourceInstitutionDTO.getInstitutionName() + "】培训机构 调整到【" + institutionDTO.getInstitutionName() + "】培训机构");
|
||||||
applyAuditLogService.save(null,auditLogVO);
|
applyAuditLogService.save(null, auditLogVO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String saveRelationReturnId(ApplyVO applyVO){
|
public String saveRelationReturnId(ApplyVO applyVO) {
|
||||||
String applyId = UUIDUtil.getUUID();
|
String applyId = UUIDUtil.getUUID();
|
||||||
String userId = "";
|
String userId = "";
|
||||||
Map<String, Object> params = HashMapUtil.beanToMap(applyVO);
|
Map<String, Object> params = HashMapUtil.beanToMap(applyVO);
|
||||||
@ -171,14 +173,14 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
params.put("gmtModified", DateUtil.getTime());
|
params.put("gmtModified", DateUtil.getTime());
|
||||||
params.put("isDelete", 0);
|
params.put("isDelete", 0);
|
||||||
UserDTO userDTO = userService.getByUsername(applyVO.getApplyPhone());
|
UserDTO userDTO = userService.getByUsername(applyVO.getApplyPhone());
|
||||||
if(userDTO == null){
|
if (userDTO == null) {
|
||||||
UserVO userVO = new UserVO();
|
UserVO userVO = new UserVO();
|
||||||
userVO.setUserUsername(applyVO.getApplyPhone());
|
userVO.setUserUsername(applyVO.getApplyPhone());
|
||||||
userVO.setUserPassword(defaultPassword);
|
userVO.setUserPassword(defaultPassword);
|
||||||
userVO.setUserName(applyVO.getApplyName());
|
userVO.setUserName(applyVO.getApplyName());
|
||||||
userVO.setUserType(1);
|
userVO.setUserType(1);
|
||||||
userVO.setUserState(0);
|
userVO.setUserState(0);
|
||||||
userId = userService.saveAndReturnId(userVO,false);
|
userId = userService.saveAndReturnId(userVO, false);
|
||||||
Map<String, Object> basic = new HashMap<>();
|
Map<String, Object> basic = new HashMap<>();
|
||||||
basic.put("bindUserAccount", userId);
|
basic.put("bindUserAccount", userId);
|
||||||
basic.put("userPhotoId", applyVO.getApplyUserCardPhoto());
|
basic.put("userPhotoId", applyVO.getApplyUserCardPhoto());
|
||||||
@ -191,17 +193,17 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
basic.put("gmtModified", DateUtil.getTime());
|
basic.put("gmtModified", DateUtil.getTime());
|
||||||
basic.put("isDelete", "0");
|
basic.put("isDelete", "0");
|
||||||
basicUserInfoDao.save(basic);
|
basicUserInfoDao.save(basic);
|
||||||
}else{
|
} else {
|
||||||
userId = userDTO.getUserId();
|
userId = userDTO.getUserId();
|
||||||
}
|
}
|
||||||
params.put("bindUserAccount", userId);
|
params.put("bindUserAccount", userId);
|
||||||
params.put("creator", userId);
|
params.put("creator", userId);
|
||||||
params.put("modifier", userId);
|
params.put("modifier", userId);
|
||||||
// 将健康状况和证件类型填写为默认值
|
// 将健康状况和证件类型填写为默认值
|
||||||
params.put("applyHealth","合格");
|
params.put("applyHealth", "合格");
|
||||||
params.put("applyCardType","b7d74045-d984-4822-b0f3-711b15b933ca");
|
params.put("applyCardType", "b7d74045-d984-4822-b0f3-711b15b933ca");
|
||||||
params.put("originEducationPhoto",applyVO.getEducationPhoto());
|
params.put("originEducationPhoto", applyVO.getEducationPhoto());
|
||||||
checkSaveData(userId,applyVO);
|
checkSaveData(userId, applyVO);
|
||||||
applyDao.save(params);
|
applyDao.save(params);
|
||||||
return applyId;
|
return applyId;
|
||||||
}
|
}
|
||||||
@ -213,23 +215,23 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<ApplyPO> listByInstitutionIdAndWorkTypeId(String institutionId,String workTypeId){
|
public List<ApplyPO> listByInstitutionIdAndWorkTypeId(String institutionId, String workTypeId) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("applyInstitutionId",institutionId);
|
params.put("applyInstitutionId", institutionId);
|
||||||
params.put("applyWorkTypeId",workTypeId);
|
params.put("applyWorkTypeId", workTypeId);
|
||||||
List<Integer> applyAuditStates = new ArrayList<>();
|
List<Integer> applyAuditStates = new ArrayList<>();
|
||||||
applyAuditStates.add(2);
|
applyAuditStates.add(2);
|
||||||
params.put("applyAuditStates",applyAuditStates);
|
params.put("applyAuditStates", applyAuditStates);
|
||||||
return this.listPO(params);
|
return this.listPO(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public SuccessResultList<List<ApplyDTO>> listPageMyApply(String token,ListPage page){
|
public SuccessResultList<List<ApplyDTO>> listPageMyApply(String token, ListPage page) {
|
||||||
if (StringUtils.isBlank(token)) {
|
if (StringUtils.isBlank(token)) {
|
||||||
page.getParams().put("creator",securityComponent.getCurrentUser().getUserId());
|
page.getParams().put("creator", securityComponent.getCurrentUser().getUserId());
|
||||||
} else {
|
} else {
|
||||||
AppTokenUser appTokenUser = getAppTokenUser(token);
|
AppTokenUser appTokenUser = getAppTokenUser(token);
|
||||||
page.getParams().put("creator",appTokenUser.getId());
|
page.getParams().put("creator", appTokenUser.getId());
|
||||||
}
|
}
|
||||||
PageHelper.startPage(page.getPage(), page.getRows());
|
PageHelper.startPage(page.getPage(), page.getRows());
|
||||||
List<ApplyDTO> applyDTOs = list(page.getParams());
|
List<ApplyDTO> applyDTOs = list(page.getParams());
|
||||||
@ -243,13 +245,13 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
states.add("1");
|
states.add("1");
|
||||||
states.add("2");
|
states.add("2");
|
||||||
states.add("-1");
|
states.add("-1");
|
||||||
Integer num2 = countApplyNum(applyDTO.getApplyWorkTypeId(),applyDTO.getApplyInstitutionId(),states);
|
Integer num2 = countApplyNum(applyDTO.getApplyWorkTypeId(), applyDTO.getApplyInstitutionId(), states);
|
||||||
//统计机构报名审核通过数量
|
//统计机构报名审核通过数量
|
||||||
states.clear();
|
states.clear();
|
||||||
states.add("2");
|
states.add("2");
|
||||||
Integer num3 = countApplyNum(applyDTO.getApplyWorkTypeId(),applyDTO.getApplyInstitutionId(),states);
|
Integer num3 = countApplyNum(applyDTO.getApplyWorkTypeId(), applyDTO.getApplyInstitutionId(), states);
|
||||||
Object applyClassPlanUserNum = ConfigManager.getInstance().getConfig().get("applyClassPlanUserNum");
|
Object applyClassPlanUserNum = ConfigManager.getInstance().getConfig().get("applyClassPlanUserNum");
|
||||||
applyDTO.setApplyUserNum1(applyClassPlanUserNum == null ? 0:Integer.valueOf(applyClassPlanUserNum.toString()));
|
applyDTO.setApplyUserNum1(applyClassPlanUserNum == null ? 0 : Integer.valueOf(applyClassPlanUserNum.toString()));
|
||||||
applyDTO.setApplyUserNum2(num2);
|
applyDTO.setApplyUserNum2(num2);
|
||||||
applyDTO.setApplyUserNum3(num3);
|
applyDTO.setApplyUserNum3(num3);
|
||||||
// 返回当前工种父工种
|
// 返回当前工种父工种
|
||||||
@ -261,77 +263,79 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void audit(String token, ApplyAuditVO applyAuditVO) {
|
||||||
public void audit(String token,ApplyAuditVO applyAuditVO){
|
|
||||||
ApplyDTO applyDTO = this.get(applyAuditVO.getApplyId());
|
ApplyDTO applyDTO = this.get(applyAuditVO.getApplyId());
|
||||||
if(applyDTO == null){
|
if (applyDTO == null) {
|
||||||
throw new SearchException("未获取到报名信息");
|
throw new SearchException("未获取到报名信息");
|
||||||
}
|
}
|
||||||
updateAuditState(token,applyAuditVO);
|
updateAuditState(token, applyAuditVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SuccessResultList<List<ApplyClassPlanDTO>> listPageApplyClassPlan(ListPage page) throws Exception{
|
public SuccessResultList<List<ApplyClassPlanDTO>> listPageApplyClassPlan(ListPage page) throws Exception {
|
||||||
List<ApplyClassPlanDTO> list= new ArrayList<>();
|
List<ApplyClassPlanDTO> list = new ArrayList<>();
|
||||||
String applyCardNumber = page.getParams().get("applyCardNumber").toString();
|
String applyCardNumber = page.getParams().get("applyCardNumber").toString();
|
||||||
String workerCatalog = page.getParams().get("workerCatalog").toString();
|
String workerCatalog = page.getParams().get("workerCatalog").toString();
|
||||||
String planType = page.getParams().get("planType").toString();
|
String planType = page.getParams().get("planType").toString();
|
||||||
page.getParams().put("reportType",2);
|
page.getParams().put("reportType", 2);
|
||||||
page.getParams().put("signNowDate",DateUtil.getTime());
|
page.getParams().put("signNowDate", DateUtil.getTime());
|
||||||
if(StringUtils.isBlank(applyCardNumber)){
|
if (StringUtils.isBlank(applyCardNumber)) {
|
||||||
throw new ParamsException("请填写证件号");
|
throw new ParamsException("请填写证件号");
|
||||||
}
|
}
|
||||||
if(StringUtils.isBlank(workerCatalog)){
|
if (StringUtils.isBlank(workerCatalog)) {
|
||||||
throw new ParamsException("请选择报考工种");
|
throw new ParamsException("请选择报考工种");
|
||||||
}
|
}
|
||||||
if(StringUtils.isBlank(planType)){
|
if (StringUtils.isBlank(planType)) {
|
||||||
throw new ParamsException("请选择报考类型");
|
throw new ParamsException("请选择报考类型");
|
||||||
}
|
}
|
||||||
PageHelper.startPage(page.getPage(), page.getRows());
|
PageHelper.startPage(page.getPage(), page.getRows());
|
||||||
SuccessResultList<List<ClassPlanDTO>> classPlanDTOList = classPlanService.listSignUpPage(page);
|
SuccessResultList<List<ClassPlanDTO>> classPlanDTOList = classPlanService.listSignUpPage(page);
|
||||||
for (ClassPlanDTO classPlanDTO : classPlanDTOList.getRows()) {
|
for (ClassPlanDTO classPlanDTO : classPlanDTOList.getRows()) {
|
||||||
ApplyClassPlanDTO applyClassPlanDTO = new ApplyClassPlanDTO();
|
ApplyClassPlanDTO applyClassPlanDTO = new ApplyClassPlanDTO();
|
||||||
int applyClassPlanState = countApplyCardNumber(applyCardNumber,classPlanDTO.getClassPlanId());
|
int applyClassPlanState = countApplyCardNumber(applyCardNumber, classPlanDTO.getClassPlanId());
|
||||||
applyClassPlanDTO.setApplyClassPlanState(applyClassPlanState == 0 ? 0:1);
|
applyClassPlanDTO.setApplyClassPlanState(applyClassPlanState == 0 ? 0 : 1);
|
||||||
applyClassPlanDTO.setApplyClassPlanUserNumber(countApplyClassNumber(classPlanDTO.getClassPlanId()));
|
applyClassPlanDTO.setApplyClassPlanUserNumber(countApplyClassNumber(classPlanDTO.getClassPlanId()));
|
||||||
BeanUtils.copyProperties(applyClassPlanDTO,classPlanDTO);
|
BeanUtils.copyProperties(applyClassPlanDTO, classPlanDTO);
|
||||||
list.add(applyClassPlanDTO);
|
list.add(applyClassPlanDTO);
|
||||||
}
|
}
|
||||||
return new SuccessResultList<>(list, classPlanDTOList.getPage(), classPlanDTOList.getTotal());
|
return new SuccessResultList<>(list, classPlanDTOList.getPage(), classPlanDTOList.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ApplyWorkTypeInstitutionDTO> listApplyWorkType(String token,Map<String,Object> params) throws Exception{
|
public List<ApplyWorkTypeInstitutionDTO> listApplyWorkType(String token, Map<String, Object> params) throws Exception {
|
||||||
String workTypeId = params.get("workTypeId").toString();
|
String workTypeId = params.get("workTypeId").toString();
|
||||||
AppTokenUser appTokenUser = getAppTokenUser(token);
|
AppTokenUser appTokenUser = getAppTokenUser(token);
|
||||||
List<ApplyWorkTypeInstitutionDTO> list= new ArrayList<>();
|
List<ApplyWorkTypeInstitutionDTO> list = new ArrayList<>();
|
||||||
if(StringUtils.isBlank(workTypeId)){
|
if (StringUtils.isBlank(workTypeId)) {
|
||||||
throw new ParamsException("请选择报考的工种");
|
throw new ParamsException("请选择报考的工种");
|
||||||
}
|
}
|
||||||
List<TrainingInstitutionWorkTypeDTO> trainingInstitutionWorkTypeList = trainingInstitutionWorkTypeService.list(params);
|
List<TrainingInstitutionWorkTypeDTO> trainingInstitutionWorkTypeList = trainingInstitutionWorkTypeService.list(params);
|
||||||
for (TrainingInstitutionWorkTypeDTO row : trainingInstitutionWorkTypeList) {
|
for (TrainingInstitutionWorkTypeDTO row : trainingInstitutionWorkTypeList) {
|
||||||
ApplyWorkTypeInstitutionDTO trainingInstitutionWorkTypeDTO = new ApplyWorkTypeInstitutionDTO();
|
ApplyWorkTypeInstitutionDTO trainingInstitutionWorkTypeDTO = new ApplyWorkTypeInstitutionDTO();
|
||||||
InstitutionDTO institutionDTO = iInstitutionService.get(row.getInstitutionId());
|
InstitutionDTO institutionDTO = iInstitutionService.get(row.getInstitutionId());
|
||||||
BeanUtils.copyProperties(trainingInstitutionWorkTypeDTO,institutionDTO);
|
if (institutionDTO == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
BeanUtils.copyProperties(trainingInstitutionWorkTypeDTO, institutionDTO);
|
||||||
//统计机构报名数量
|
//统计机构报名数量
|
||||||
List<String> states = new ArrayList<>();
|
List<String> states = new ArrayList<>();
|
||||||
states.add("0");
|
states.add("0");
|
||||||
states.add("1");
|
states.add("1");
|
||||||
states.add("2");
|
states.add("2");
|
||||||
states.add("-1");
|
states.add("-1");
|
||||||
Integer num2 = countApplyNum(workTypeId,row.getInstitutionId(),states);
|
Integer num2 = countApplyNum(workTypeId, row.getInstitutionId(), states);
|
||||||
//统计机构报名审核通过数量
|
//统计机构报名审核通过数量
|
||||||
states.clear();
|
states.clear();
|
||||||
states.add("2");
|
states.add("2");
|
||||||
Integer num3 = countApplyNum(workTypeId,row.getInstitutionId(),states);
|
Integer num3 = countApplyNum(workTypeId, row.getInstitutionId(), states);
|
||||||
Object applyClassPlanUserNum = ConfigManager.getInstance().getConfig().get("applyClassPlanUserNum");
|
Object applyClassPlanUserNum = ConfigManager.getInstance().getConfig().get("applyClassPlanUserNum");
|
||||||
trainingInstitutionWorkTypeDTO.setApplyUserNum1(applyClassPlanUserNum == null ? 0:Integer.valueOf(applyClassPlanUserNum.toString()));
|
trainingInstitutionWorkTypeDTO.setApplyUserNum1(applyClassPlanUserNum == null ? 0 : Integer.valueOf(applyClassPlanUserNum.toString()));
|
||||||
trainingInstitutionWorkTypeDTO.setApplyUserNum2(num2);
|
trainingInstitutionWorkTypeDTO.setApplyUserNum2(num2);
|
||||||
trainingInstitutionWorkTypeDTO.setApplyUserNum3(num3);
|
trainingInstitutionWorkTypeDTO.setApplyUserNum3(num3);
|
||||||
//判断当前机构是否可以报名
|
//判断当前机构是否可以报名
|
||||||
if(checkApplyIsFirst(appTokenUser.getId(),workTypeId,row.getInstitutionId()) != 0){
|
if (checkApplyIsFirst(appTokenUser.getId(), workTypeId, row.getInstitutionId()) != 0) {
|
||||||
trainingInstitutionWorkTypeDTO.setApplyStatus("applyFalse");
|
trainingInstitutionWorkTypeDTO.setApplyStatus("applyFalse");
|
||||||
}else{
|
} else {
|
||||||
Boolean b = examCheckService.getExamCheckFailOrBack(workTypeId,row.getInstitutionId());
|
Boolean b = examCheckService.getExamCheckFailOrBack(workTypeId, row.getInstitutionId());
|
||||||
trainingInstitutionWorkTypeDTO.setApplyStatus(b == true ? "applyTrue":"examCheckFalse");
|
trainingInstitutionWorkTypeDTO.setApplyStatus(b == true ? "applyTrue" : "examCheckFalse");
|
||||||
}
|
}
|
||||||
TrainingInstitutionServiceUserDTO byByInstitutionId = trainingInstitutionServiceUserService.getByByInstitutionId(row.getInstitutionId());
|
TrainingInstitutionServiceUserDTO byByInstitutionId = trainingInstitutionServiceUserService.getByByInstitutionId(row.getInstitutionId());
|
||||||
trainingInstitutionWorkTypeDTO.setQrCode(byByInstitutionId != null ? byByInstitutionId.getServiceUserCode() : "");
|
trainingInstitutionWorkTypeDTO.setQrCode(byByInstitutionId != null ? byByInstitutionId.getServiceUserCode() : "");
|
||||||
@ -342,13 +346,11 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public SuccessResultList<List<ApplyWorkTypeInstitutionDTO>> listPageApplyWorkType(String token, ListPage page) throws Exception {
|
||||||
|
|
||||||
public SuccessResultList<List<ApplyWorkTypeInstitutionDTO>> listPageApplyWorkType(String token,ListPage page) throws Exception{
|
|
||||||
AppTokenUser appTokenUser = getAppTokenUser(token);
|
AppTokenUser appTokenUser = getAppTokenUser(token);
|
||||||
List<ApplyWorkTypeInstitutionDTO> list= new ArrayList<>();
|
List<ApplyWorkTypeInstitutionDTO> list = new ArrayList<>();
|
||||||
String workTypeId = page.getParams().get("workTypeId").toString();
|
String workTypeId = page.getParams().get("workTypeId").toString();
|
||||||
if(StringUtils.isBlank(workTypeId)){
|
if (StringUtils.isBlank(workTypeId)) {
|
||||||
throw new ParamsException("请选择报考的工种");
|
throw new ParamsException("请选择报考的工种");
|
||||||
}
|
}
|
||||||
PageHelper.startPage(page.getPage(), page.getRows());
|
PageHelper.startPage(page.getPage(), page.getRows());
|
||||||
@ -356,29 +358,29 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
for (TrainingInstitutionWorkTypeDTO row : trainingInstitutionWorkTypeList.getRows()) {
|
for (TrainingInstitutionWorkTypeDTO row : trainingInstitutionWorkTypeList.getRows()) {
|
||||||
ApplyWorkTypeInstitutionDTO trainingInstitutionWorkTypeDTO = new ApplyWorkTypeInstitutionDTO();
|
ApplyWorkTypeInstitutionDTO trainingInstitutionWorkTypeDTO = new ApplyWorkTypeInstitutionDTO();
|
||||||
InstitutionDTO institutionDTO = iInstitutionService.get(row.getInstitutionId());
|
InstitutionDTO institutionDTO = iInstitutionService.get(row.getInstitutionId());
|
||||||
BeanUtils.copyProperties(trainingInstitutionWorkTypeDTO,institutionDTO);
|
BeanUtils.copyProperties(trainingInstitutionWorkTypeDTO, institutionDTO);
|
||||||
//统计机构报名数量
|
//统计机构报名数量
|
||||||
List<String> states = new ArrayList<>();
|
List<String> states = new ArrayList<>();
|
||||||
states.add("0");
|
states.add("0");
|
||||||
states.add("1");
|
states.add("1");
|
||||||
states.add("2");
|
states.add("2");
|
||||||
states.add("-1");
|
states.add("-1");
|
||||||
Integer num2 = countApplyNum(workTypeId,row.getInstitutionId(),states);
|
Integer num2 = countApplyNum(workTypeId, row.getInstitutionId(), states);
|
||||||
//统计机构报名审核通过数量
|
//统计机构报名审核通过数量
|
||||||
states.clear();
|
states.clear();
|
||||||
states.add("2");
|
states.add("2");
|
||||||
Integer num3 = countApplyNum(workTypeId,row.getInstitutionId(),states);
|
Integer num3 = countApplyNum(workTypeId, row.getInstitutionId(), states);
|
||||||
Object applyClassPlanUserNum = ConfigManager.getInstance().getConfig().get("applyClassPlanUserNum");
|
Object applyClassPlanUserNum = ConfigManager.getInstance().getConfig().get("applyClassPlanUserNum");
|
||||||
trainingInstitutionWorkTypeDTO.setApplyUserNum1(applyClassPlanUserNum == null ? 0:Integer.valueOf(applyClassPlanUserNum.toString()));
|
trainingInstitutionWorkTypeDTO.setApplyUserNum1(applyClassPlanUserNum == null ? 0 : Integer.valueOf(applyClassPlanUserNum.toString()));
|
||||||
trainingInstitutionWorkTypeDTO.setApplyUserNum2(num2);
|
trainingInstitutionWorkTypeDTO.setApplyUserNum2(num2);
|
||||||
trainingInstitutionWorkTypeDTO.setApplyUserNum3(num3);
|
trainingInstitutionWorkTypeDTO.setApplyUserNum3(num3);
|
||||||
//判断当前机构是否可以报名
|
//判断当前机构是否可以报名
|
||||||
//判断当前机构是否可以报名
|
//判断当前机构是否可以报名
|
||||||
if(checkApplyIsFirst(appTokenUser.getId(),workTypeId,row.getInstitutionId()) != 0){
|
if (checkApplyIsFirst(appTokenUser.getId(), workTypeId, row.getInstitutionId()) != 0) {
|
||||||
trainingInstitutionWorkTypeDTO.setApplyStatus("applyFalse");
|
trainingInstitutionWorkTypeDTO.setApplyStatus("applyFalse");
|
||||||
}else{
|
} else {
|
||||||
Boolean b = examCheckService.getExamCheckFailOrBack(workTypeId,row.getInstitutionId());
|
Boolean b = examCheckService.getExamCheckFailOrBack(workTypeId, row.getInstitutionId());
|
||||||
trainingInstitutionWorkTypeDTO.setApplyStatus(b == true ? "applyTrue":"examCheckFalse");
|
trainingInstitutionWorkTypeDTO.setApplyStatus(b == true ? "applyTrue" : "examCheckFalse");
|
||||||
}
|
}
|
||||||
|
|
||||||
trainingInstitutionWorkTypeDTO.setQrCode(createQrCode(row.getInstitutionId()));
|
trainingInstitutionWorkTypeDTO.setQrCode(createQrCode(row.getInstitutionId()));
|
||||||
@ -388,30 +390,26 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
return new SuccessResultList<>(list, trainingInstitutionWorkTypeList.getPage(), trainingInstitutionWorkTypeList.getTotal());
|
return new SuccessResultList<>(list, trainingInstitutionWorkTypeList.getPage(), trainingInstitutionWorkTypeList.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String createQrCode(String id) throws Exception{
|
public String createQrCode(String id) throws Exception {
|
||||||
String content = serverProperties.getUrl()+"/approute/traininginstitutionroute/get-qrcode-view/"+id;
|
String content = serverProperties.getUrl() + "/approute/traininginstitutionroute/get-qrcode-view/" + id;
|
||||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
ImageIO.write(QRCodeUtil.createQrCode(150,150,content,null), "png", stream);
|
ImageIO.write(QRCodeUtil.createQrCode(150, 150, content, null), "png", stream);
|
||||||
// 对字节数组Base64编码
|
// 对字节数组Base64编码
|
||||||
Base64 base = new Base64();
|
Base64 base = new Base64();
|
||||||
String base64 = base.encodeToString(stream.toByteArray());
|
String base64 = base.encodeToString(stream.toByteArray());
|
||||||
return base64;
|
return base64;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<ApplyDTO> listByClassId(String classId) {
|
||||||
|
if (StringUtils.isBlank(classId)) {
|
||||||
|
|
||||||
|
|
||||||
public List<ApplyDTO> listByClassId(String classId){
|
|
||||||
if(StringUtils.isBlank(classId)){
|
|
||||||
throw new SearchException("获取失败");
|
throw new SearchException("获取失败");
|
||||||
}
|
}
|
||||||
List<Integer> applyAuditStates = new ArrayList<>();
|
List<Integer> applyAuditStates = new ArrayList<>();
|
||||||
applyAuditStates.add(3);
|
applyAuditStates.add(3);
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("applyClassId",classId);
|
params.put("applyClassId", classId);
|
||||||
params.put("applyAuditStates",applyAuditStates);
|
params.put("applyAuditStates", applyAuditStates);
|
||||||
return this.list(params);
|
return this.list(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,33 +440,32 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
setAppSaveInfo(token, params);
|
setAppSaveInfo(token, params);
|
||||||
}
|
}
|
||||||
//检查报名数据
|
//检查报名数据
|
||||||
checkSaveData(params.get("creator").toString(),applyVO);
|
checkSaveData(params.get("creator").toString(), applyVO);
|
||||||
// 健康状况默认为合格
|
// 健康状况默认为合格
|
||||||
params.put("applyHealth",params.get("applyHealth") == null ? "合格" : params.get("applyHealth"));
|
params.put("applyHealth", params.get("applyHealth") == null ? "合格" : params.get("applyHealth"));
|
||||||
applyDao.save(params);
|
applyDao.save(params);
|
||||||
//增加操作日志
|
//增加操作日志
|
||||||
ApplyAuditLogVO auditLogVO = new ApplyAuditLogVO();
|
ApplyAuditLogVO auditLogVO = new ApplyAuditLogVO();
|
||||||
auditLogVO.setApplyId(applyId);
|
auditLogVO.setApplyId(applyId);
|
||||||
auditLogVO.setApplyAuditState(0);
|
auditLogVO.setApplyAuditState(0);
|
||||||
auditLogVO.setApplyAuditExplain("用户申请报名");
|
auditLogVO.setApplyAuditExplain("用户申请报名");
|
||||||
applyAuditLogService.save(token,auditLogVO);
|
applyAuditLogService.save(token, auditLogVO);
|
||||||
return applyId;
|
return applyId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkSaveData(String creator,ApplyVO applyVO){
|
public void checkSaveData(String creator, ApplyVO applyVO) {
|
||||||
|
|
||||||
String applyWorkTypeId = applyVO.getApplyWorkTypeId();
|
String applyWorkTypeId = applyVO.getApplyWorkTypeId();
|
||||||
String applyInstitutionId = applyVO.getApplyInstitutionId();
|
String applyInstitutionId = applyVO.getApplyInstitutionId();
|
||||||
|
|
||||||
if(checkApplyIsFirst(creator,applyWorkTypeId,applyInstitutionId) != 0){
|
if (checkApplyIsFirst(creator, applyWorkTypeId, applyInstitutionId) != 0) {
|
||||||
throw new SaveException(applyVO.getApplyName() + "[" + applyVO.getApplyPhone() +
|
throw new SaveException(applyVO.getApplyName() + "【" + applyVO.getApplyPhone() + "】: 已经报名,若姓名与手机号不符,可能是手机号被注册,请联系管理人员处理或更换手机号");
|
||||||
"]: 已经报名,若姓名与手机号不符,可能是手机号被注册,请联系管理人员处理或更换手机号");
|
|
||||||
}
|
}
|
||||||
if(checkApplyIsFirst(creator,applyWorkTypeId,null) != 0){
|
if (checkApplyIsFirst(creator, applyWorkTypeId, null) != 0) {
|
||||||
throw new SaveException(applyVO.getApplyName() + "[" + applyVO.getApplyPhone() +
|
List<String> applyInstitutionNames = applyDao.listApplyInstitutionNameByCreator(creator);
|
||||||
"]: 已报名其他培训机构,请勿重复报名");
|
throw new SaveException(applyVO.getApplyName() + "【" + applyVO.getApplyPhone() + "】: 已报名其他培训机构【" + String.join(",", applyInstitutionNames) + "】,请勿重复报名");
|
||||||
}
|
}
|
||||||
if(!examCheckService.getExamCheckFailOrBack(applyWorkTypeId,applyInstitutionId)){
|
if (!examCheckService.getExamCheckFailOrBack(applyWorkTypeId, applyInstitutionId)) {
|
||||||
throw new SaveException("已经提交开班计划,无法在审核过程中添加学员");
|
throw new SaveException("已经提交开班计划,无法在审核过程中添加学员");
|
||||||
}
|
}
|
||||||
//最低学历效验
|
//最低学历效验
|
||||||
@ -512,41 +509,40 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void checkUpdateData(String creator,String applyId,ApplyVO applyVO){
|
public void checkUpdateData(String creator, String applyId, ApplyVO applyVO) {
|
||||||
String applyWorkTypeId = applyVO.getApplyWorkTypeId();
|
String applyWorkTypeId = applyVO.getApplyWorkTypeId();
|
||||||
String applyInstitutionId = applyVO.getApplyInstitutionId();
|
String applyInstitutionId = applyVO.getApplyInstitutionId();
|
||||||
ApplyDTO applyDTO = this.get(applyId);
|
ApplyDTO applyDTO = this.get(applyId);
|
||||||
if(applyDTO == null){
|
if (applyDTO == null) {
|
||||||
throw new SearchException("未获取到报名信息");
|
throw new SearchException("未获取到报名信息");
|
||||||
}
|
}
|
||||||
if(!(applyDTO.getApplyAuditState() == -1 || applyDTO.getApplyAuditState() == 1)){
|
if (!(applyDTO.getApplyAuditState() == -1 || applyDTO.getApplyAuditState() == 1)) {
|
||||||
throw new SearchException("暂不能修改信息");
|
throw new SearchException("暂不能修改信息");
|
||||||
}
|
}
|
||||||
// if(!(applyDTO.getApplyInstitutionId().equals(applyInstitutionId) && applyDTO.getApplyWorkTypeId().equals(applyWorkTypeId))){
|
// if(!(applyDTO.getApplyInstitutionId().equals(applyInstitutionId) && applyDTO.getApplyWorkTypeId().equals(applyWorkTypeId))){
|
||||||
// throw new SaveException("您选择的工种已经在其他培训机构报名过!请勿重新报名");
|
// throw new SaveException("您选择的工种已经在其他培训机构报名过!请勿重新报名");
|
||||||
// }
|
// }
|
||||||
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("该机构以截止报名");
|
||||||
}
|
}
|
||||||
|
|
||||||
//最低学历效验
|
//最低学历效验
|
||||||
WorkTypeDTO workTypeDTO = workTypeService.get(applyWorkTypeId);
|
WorkTypeDTO workTypeDTO = workTypeService.get(applyWorkTypeId);
|
||||||
if(workTypeDTO == null){
|
if (workTypeDTO == null) {
|
||||||
throw new SaveException("未获取到工种信息");
|
throw new SaveException("未获取到工种信息");
|
||||||
}
|
}
|
||||||
String workTypeEducation = workTypeDTO.getWorkTypeEducation();
|
String workTypeEducation = workTypeDTO.getWorkTypeEducation();
|
||||||
if(!StringUtils.isBlank(workTypeEducation)){
|
if (!StringUtils.isBlank(workTypeEducation)) {
|
||||||
DataDTO workTypeEducationDTO = dataService.get(workTypeEducation);//工种配置最低学历
|
DataDTO workTypeEducationDTO = dataService.get(workTypeEducation);//工种配置最低学历
|
||||||
DataDTO applyCultureLevelDTO = dataService.get(applyVO.getApplyCultureLevel());//报名学历
|
DataDTO applyCultureLevelDTO = dataService.get(applyVO.getApplyCultureLevel());//报名学历
|
||||||
if(!(Integer.valueOf(applyCultureLevelDTO.getDataSort()) <= Integer.valueOf(workTypeEducationDTO.getDataSort()))){
|
if (!(Integer.valueOf(applyCultureLevelDTO.getDataSort()) <= Integer.valueOf(workTypeEducationDTO.getDataSort()))) {
|
||||||
throw new SaveException("您不满足报名工种的最低学历");
|
throw new SaveException("您不满足报名工种的最低学历");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -554,8 +550,6 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remove(List<String> ids) {
|
public void remove(List<String> ids) {
|
||||||
remove(null, ids);
|
remove(null, ids);
|
||||||
@ -597,7 +591,7 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
}
|
}
|
||||||
//checkUpdateData(params.get("modifier").toString(),applyId,applyVO);
|
//checkUpdateData(params.get("modifier").toString(),applyId,applyVO);
|
||||||
|
|
||||||
if(!examCheckService.getExamCheckFailOrBack(applyVO.getApplyWorkTypeId(), applyVO.getApplyInstitutionId())){
|
if (!examCheckService.getExamCheckFailOrBack(applyVO.getApplyWorkTypeId(), applyVO.getApplyInstitutionId())) {
|
||||||
throw new SaveException("该机构以截止报名");
|
throw new SaveException("该机构以截止报名");
|
||||||
}
|
}
|
||||||
Map<String, Object> query = new HashMap<>();
|
Map<String, Object> query = new HashMap<>();
|
||||||
@ -613,7 +607,7 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
auditLogVO.setApplyId(applyId);
|
auditLogVO.setApplyId(applyId);
|
||||||
auditLogVO.setApplyAuditState(0);
|
auditLogVO.setApplyAuditState(0);
|
||||||
auditLogVO.setApplyAuditExplain("用户更新报名信息");
|
auditLogVO.setApplyAuditExplain("用户更新报名信息");
|
||||||
applyAuditLogService.save(token,auditLogVO);
|
applyAuditLogService.save(token, auditLogVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -628,7 +622,7 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
@Override
|
@Override
|
||||||
public ApplyDTO get(Map<String, Object> params) {
|
public ApplyDTO get(Map<String, Object> params) {
|
||||||
ApplyDTO applyDTO = applyDao.get(params);
|
ApplyDTO applyDTO = applyDao.get(params);
|
||||||
if(applyDTO == null){
|
if (applyDTO == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
WorkTypeDTO workTypeDTO = workTypeService.get(applyDTO.getApplyWorkTypeId());
|
WorkTypeDTO workTypeDTO = workTypeService.get(applyDTO.getApplyWorkTypeId());
|
||||||
@ -685,19 +679,24 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SuccessResultList<List<ApplyDTO>> listPage(ListPage page) {
|
public SuccessResultList<List<ApplyDTO>> listPage(ListPage page) {
|
||||||
if(page.getParams().get("applyInstitutionId") == null
|
if (page.getParams().get("applyInstitutionId") == null || "".equals(page.getParams().get("applyInstitutionId").toString())) {
|
||||||
|| "".equals(page.getParams().get("applyInstitutionId").toString())){
|
|
||||||
throw new SearchException("机构信息丢失,无法查看人员列表");
|
throw new SearchException("机构信息丢失,无法查看人员列表");
|
||||||
}
|
}
|
||||||
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 item : applyDTOs){
|
for (ApplyDTO item : applyDTOs) {
|
||||||
if(item.getApplyWorkTypeId() == null || "".equals(item.getApplyWorkTypeId())){
|
if (item.getApplyWorkTypeId() == null || "".equals(item.getApplyWorkTypeId())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
WorkTypeDTO workTypeDTO = workTypeService.get(item.getApplyWorkTypeId());
|
WorkTypeDTO workTypeDTO = workTypeService.get(item.getApplyWorkTypeId());
|
||||||
item.setApplyParentWorkTypeId(workTypeDTO.getWorkTypeParentId());
|
item.setApplyParentWorkTypeId(workTypeDTO.getWorkTypeParentId());
|
||||||
item.setApplyParentWorkTypeName(workTypeDTO.getWorkTypeParentName());
|
item.setApplyParentWorkTypeName(workTypeDTO.getWorkTypeParentName());
|
||||||
|
item.setMaxAge(SignUpUtil.getMaxAge(item.getApplyLeiBie(), item.getApplyCardNumber()));
|
||||||
|
if (IdCardVerifyUtil.isValidatedAllIdcard(item.getApplyCardNumber())) {
|
||||||
|
item.setAge(IdCardVerifyUtil.getIdCardAge(item.getApplyCardNumber()));
|
||||||
|
} else {
|
||||||
|
item.setAge(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
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());
|
||||||
@ -707,25 +706,25 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
/**
|
/**
|
||||||
* 统计当前登录账号 报名的培训计划的次数(不包括撤回)
|
* 统计当前登录账号 报名的培训计划的次数(不包括撤回)
|
||||||
*/
|
*/
|
||||||
public Integer countApplyClassIdCreator(String creator,String applyClassId){
|
public Integer countApplyClassIdCreator(String creator, String applyClassId) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("creator",creator);
|
params.put("creator", creator);
|
||||||
params.put("applyClassId",applyClassId);
|
params.put("applyClassId", applyClassId);
|
||||||
List<String> applyAuditStates = new ArrayList<>();
|
List<String> applyAuditStates = new ArrayList<>();
|
||||||
applyAuditStates.add("0");
|
applyAuditStates.add("0");
|
||||||
applyAuditStates.add("2");
|
applyAuditStates.add("2");
|
||||||
applyAuditStates.add("3");
|
applyAuditStates.add("3");
|
||||||
applyAuditStates.add("-1");
|
applyAuditStates.add("-1");
|
||||||
params.put("applyAuditStates",applyAuditStates);
|
params.put("applyAuditStates", applyAuditStates);
|
||||||
return count(params);
|
return count(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Integer countApplyNum(String applyWorkTypeId,String applyInstitutionId,List<String> applyAuditStates){
|
public Integer countApplyNum(String applyWorkTypeId, String applyInstitutionId, List<String> applyAuditStates) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("applyWorkTypeId",applyWorkTypeId);
|
params.put("applyWorkTypeId", applyWorkTypeId);
|
||||||
params.put("applyInstitutionId",applyInstitutionId);
|
params.put("applyInstitutionId", applyInstitutionId);
|
||||||
params.put("applyAuditStates",applyAuditStates);
|
params.put("applyAuditStates", applyAuditStates);
|
||||||
return count(params);
|
return count(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -733,46 +732,47 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
/**
|
/**
|
||||||
* 统计证件号码 报名的培训计划的次数(不包括撤回)
|
* 统计证件号码 报名的培训计划的次数(不包括撤回)
|
||||||
*/
|
*/
|
||||||
public Integer countApplyCardNumber(String applyCardNumber,String applyClassId){
|
public Integer countApplyCardNumber(String applyCardNumber, String applyClassId) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("applyCardNumber",applyCardNumber);
|
params.put("applyCardNumber", applyCardNumber);
|
||||||
params.put("applyClassId",applyClassId);
|
params.put("applyClassId", applyClassId);
|
||||||
List<String> applyAuditStates = new ArrayList<>();
|
List<String> applyAuditStates = new ArrayList<>();
|
||||||
applyAuditStates.add("0");
|
applyAuditStates.add("0");
|
||||||
applyAuditStates.add("2");
|
applyAuditStates.add("2");
|
||||||
applyAuditStates.add("3");
|
applyAuditStates.add("3");
|
||||||
applyAuditStates.add("-1");
|
applyAuditStates.add("-1");
|
||||||
params.put("applyAuditStates",applyAuditStates);
|
params.put("applyAuditStates", applyAuditStates);
|
||||||
return count(params);
|
return count(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计计划报名人数(不包括审核未通过,撤回状态)
|
* 统计计划报名人数(不包括审核未通过,撤回状态)
|
||||||
*/
|
*/
|
||||||
public Integer countApplyClassNumber(String applyClassId){
|
public Integer countApplyClassNumber(String applyClassId) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("applyClassId",applyClassId);
|
params.put("applyClassId", applyClassId);
|
||||||
List<String> applyAuditStates = new ArrayList<>();
|
List<String> applyAuditStates = new ArrayList<>();
|
||||||
applyAuditStates.add("0");
|
applyAuditStates.add("0");
|
||||||
applyAuditStates.add("2");
|
applyAuditStates.add("2");
|
||||||
applyAuditStates.add("3");
|
applyAuditStates.add("3");
|
||||||
params.put("applyAuditStates",applyAuditStates);
|
params.put("applyAuditStates", applyAuditStates);
|
||||||
return count(params);
|
return count(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查当前报名人的工种和培训机构是否唯一(不包括审核未通过,撤回状态)
|
* 检查当前报名人的工种和培训机构是否唯一(不包括审核未通过,撤回状态)
|
||||||
*/
|
*/
|
||||||
public Integer checkApplyIsFirst(String creator,String applyWorkTypeId,String applyInstitutionId){
|
public Integer checkApplyIsFirst(String creator, String applyWorkTypeId, String applyInstitutionId) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("applyWorkTypeId",applyWorkTypeId);
|
params.put("applyWorkTypeId", applyWorkTypeId);
|
||||||
params.put("applyInstitutionId",applyInstitutionId);
|
params.put("applyInstitutionId", applyInstitutionId);
|
||||||
params.put("creator",creator);
|
params.put("creator", creator);
|
||||||
List<String> applyAuditStates = new ArrayList<>();
|
List<String> applyAuditStates = new ArrayList<>();
|
||||||
applyAuditStates.add("0");
|
applyAuditStates.add("0");
|
||||||
//applyAuditStates.add("1");
|
//applyAuditStates.add("1");
|
||||||
applyAuditStates.add("2");
|
applyAuditStates.add("2");
|
||||||
//applyAuditStates.add("-1");
|
//applyAuditStates.add("-1");
|
||||||
params.put("applyAuditStates",applyAuditStates);
|
params.put("applyAuditStates", applyAuditStates);
|
||||||
return count(params);
|
return count(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -783,12 +783,12 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateAuditState(String token, ApplyAuditVO applyAuditVO){
|
public void updateAuditState(String token, ApplyAuditVO applyAuditVO) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("applyId",applyAuditVO.getApplyId());
|
params.put("applyId", applyAuditVO.getApplyId());
|
||||||
ApplyDTO applyDTO = applyDao.get(params);
|
ApplyDTO applyDTO = applyDao.get(params);
|
||||||
params.put("applyAuditState",applyAuditVO.getApplyAuditState());
|
params.put("applyAuditState", applyAuditVO.getApplyAuditState());
|
||||||
if(2 == applyAuditVO.getApplyAuditState()){
|
if (2 == applyAuditVO.getApplyAuditState()) {
|
||||||
String fileId = makeWaterMark(applyDTO);
|
String fileId = makeWaterMark(applyDTO);
|
||||||
params.put("educationPhoto", fileId);
|
params.put("educationPhoto", fileId);
|
||||||
} else {
|
} else {
|
||||||
@ -800,10 +800,11 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 给学历证书添加签名水印
|
* 给学历证书添加签名水印
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return String 返回添加完成水印的fileId 如果出错,返回 null
|
* @return String 返回添加完成水印的fileId 如果出错,返回 null
|
||||||
*/
|
*/
|
||||||
private String makeWaterMark(ApplyDTO dto){
|
private String makeWaterMark(ApplyDTO dto) {
|
||||||
Map<String, Object> params = new HashMap<>(8);
|
Map<String, Object> params = new HashMap<>(8);
|
||||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||||
try {
|
try {
|
||||||
@ -812,13 +813,11 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
File originFile = new File(originPO.getFilePath());
|
File originFile = new File(originPO.getFilePath());
|
||||||
// 原图
|
// 原图
|
||||||
Image srcImg = ImageIO.read(originFile);
|
Image srcImg = ImageIO.read(originFile);
|
||||||
BufferedImage buffImg = new BufferedImage(srcImg.getWidth(null),
|
BufferedImage buffImg = new BufferedImage(srcImg.getWidth(null), srcImg.getHeight(null), BufferedImage.TYPE_INT_RGB);
|
||||||
srcImg.getHeight(null), BufferedImage.TYPE_INT_RGB);
|
|
||||||
|
|
||||||
Graphics2D graphics = buffImg.createGraphics();
|
Graphics2D graphics = buffImg.createGraphics();
|
||||||
graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
|
graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
|
||||||
graphics.drawImage(srcImg.getScaledInstance(srcImg.getWidth(null),
|
graphics.drawImage(srcImg.getScaledInstance(srcImg.getWidth(null), srcImg.getHeight(null), Image.SCALE_SMOOTH), 0, 0, null);
|
||||||
srcImg.getHeight(null), Image.SCALE_SMOOTH), 0, 0, null);
|
|
||||||
int srcWidth = srcImg.getWidth(null);
|
int srcWidth = srcImg.getWidth(null);
|
||||||
int srcHeight = srcImg.getHeight(null);
|
int srcHeight = srcImg.getHeight(null);
|
||||||
// 水印
|
// 水印
|
||||||
@ -830,10 +829,10 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
ImageIcon logoImgIcon = new ImageIcon(ImageIO.read(waterMarFile));
|
ImageIcon logoImgIcon = new ImageIcon(ImageIO.read(waterMarFile));
|
||||||
int logoWidth = logoImgIcon.getIconWidth();
|
int logoWidth = logoImgIcon.getIconWidth();
|
||||||
int logoHeight = logoImgIcon.getIconHeight();
|
int logoHeight = logoImgIcon.getIconHeight();
|
||||||
while (srcWidth * 0.8 < logoWidth){
|
while (srcWidth * 0.8 < logoWidth) {
|
||||||
logoWidth = (int) (logoWidth * 0.9);
|
logoWidth = (int) (logoWidth * 0.9);
|
||||||
}
|
}
|
||||||
while (srcHeight * 0.6 < logoHeight){
|
while (srcHeight * 0.6 < logoHeight) {
|
||||||
logoHeight = (int) (logoHeight * 0.9);
|
logoHeight = (int) (logoHeight * 0.9);
|
||||||
}
|
}
|
||||||
Image logoImg = logoImgIcon.getImage().getScaledInstance(logoWidth, logoHeight, Image.SCALE_SMOOTH);
|
Image logoImg = logoImgIcon.getImage().getScaledInstance(logoWidth, logoHeight, Image.SCALE_SMOOTH);
|
||||||
@ -852,7 +851,7 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
//水印 的位置
|
//水印 的位置
|
||||||
//graphics.drawImage(logoImg, buffImg.getWidth() / 3, buffImg.getHeight() / 2, null);
|
//graphics.drawImage(logoImg, buffImg.getWidth() / 3, buffImg.getHeight() / 2, null);
|
||||||
// 这里默认固定在右上角
|
// 这里默认固定在右上角
|
||||||
graphics.drawImage(logoImg, buffImg.getWidth() - logoWidth , 0, null);
|
graphics.drawImage(logoImg, buffImg.getWidth() - logoWidth, 0, null);
|
||||||
graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER));
|
graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER));
|
||||||
graphics.dispose();
|
graphics.dispose();
|
||||||
|
|
||||||
@ -863,7 +862,7 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
MultipartFile multipartFile = new MockMultipartFile(resultFileName, resultFileName, null, input);
|
MultipartFile multipartFile = new MockMultipartFile(resultFileName, resultFileName, null, input);
|
||||||
params.clear();
|
params.clear();
|
||||||
return fileService.uploadSingleByUserId("1", multipartFile, UploadTypeEnum.IMAGE, params);
|
return fileService.uploadSingleByUserId("1", multipartFile, UploadTypeEnum.IMAGE, params);
|
||||||
} catch (Exception e){
|
} catch (Exception e) {
|
||||||
// 如果出错 返回的水印图片为空
|
// 如果出错 返回的水印图片为空
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
@ -873,35 +872,36 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计培训机构全部计划报名人数
|
* 统计培训机构全部计划报名人数
|
||||||
|
*
|
||||||
* @param applyInstitutionId 机构ID
|
* @param applyInstitutionId 机构ID
|
||||||
* @param applyAuditStates 机构状态
|
* @param applyAuditStates 机构状态
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Integer countAllApplyNum(String applyInstitutionId, List<String> applyAuditStates){
|
public Integer countAllApplyNum(String applyInstitutionId, List<String> applyAuditStates) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("applyInstitutionId",applyInstitutionId);
|
params.put("applyInstitutionId", applyInstitutionId);
|
||||||
params.put("applyAuditStates",applyAuditStates);
|
params.put("applyAuditStates", applyAuditStates);
|
||||||
return count(params);
|
return count(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Map<String, Object> countWeekNum(String weekTime,String applyInstitutionId,String applyWorkTypeId) {
|
public Map<String, Object> countWeekNum(String weekTime, String applyInstitutionId, String applyWorkTypeId) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("weekTime",weekTime);
|
params.put("weekTime", weekTime);
|
||||||
params.put("applyInstitutionId",applyInstitutionId);
|
params.put("applyInstitutionId", applyInstitutionId);
|
||||||
params.put("applyWorkTypeId",applyWorkTypeId);
|
params.put("applyWorkTypeId", applyWorkTypeId);
|
||||||
Map<String, Object> result = applyDao.countWeekNum(params);
|
Map<String, Object> result = applyDao.countWeekNum(params);
|
||||||
if(result == null){
|
if (result == null) {
|
||||||
params.clear();
|
params.clear();
|
||||||
params.put("0",0);
|
params.put("0", 0);
|
||||||
params.put("1",0);
|
params.put("1", 0);
|
||||||
params.put("2",0);
|
params.put("2", 0);
|
||||||
params.put("3",0);
|
params.put("3", 0);
|
||||||
params.put("-1",0);
|
params.put("-1", 0);
|
||||||
params.put("weekTime",weekTime);
|
params.put("weekTime", weekTime);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
result.put("weekTime",weekTime);
|
result.put("weekTime", weekTime);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -17,6 +17,8 @@ import cn.com.tenlion.service.applystudentsnew.IApplyStudentsNewService;
|
|||||||
import cn.com.tenlion.service.classplan.IClassPlanService;
|
import cn.com.tenlion.service.classplan.IClassPlanService;
|
||||||
import cn.com.tenlion.service.examapply.IExamApplyService;
|
import cn.com.tenlion.service.examapply.IExamApplyService;
|
||||||
import cn.com.tenlion.service.worktype.IWorkTypeService;
|
import cn.com.tenlion.service.worktype.IWorkTypeService;
|
||||||
|
import cn.com.tenlion.util.IdCardVerifyUtil;
|
||||||
|
import cn.com.tenlion.util.SignUpUtil;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import ink.wgink.common.base.DefaultBaseService;
|
import ink.wgink.common.base.DefaultBaseService;
|
||||||
@ -271,6 +273,12 @@ public class ApplyStudentsServiceImpl extends DefaultBaseService implements IApp
|
|||||||
Iterator<ApplyStudentsDTO> applyStudentsDTOIterator = list.iterator();
|
Iterator<ApplyStudentsDTO> applyStudentsDTOIterator = list.iterator();
|
||||||
while (applyStudentsDTOIterator.hasNext()) {
|
while (applyStudentsDTOIterator.hasNext()) {
|
||||||
ApplyStudentsDTO applyStudentsDTO = applyStudentsDTOIterator.next();
|
ApplyStudentsDTO applyStudentsDTO = applyStudentsDTOIterator.next();
|
||||||
|
applyStudentsDTO.setMaxAge(SignUpUtil.getMaxAge(applyStudentsDTO.getApplyLeiBie(), applyStudentsDTO.getApplyCardNumber()));
|
||||||
|
if (IdCardVerifyUtil.isValidatedAllIdcard(applyStudentsDTO.getApplyCardNumber())) {
|
||||||
|
applyStudentsDTO.setAge(IdCardVerifyUtil.getIdCardAge(applyStudentsDTO.getApplyCardNumber()));
|
||||||
|
} else {
|
||||||
|
applyStudentsDTO.setAge(-1);
|
||||||
|
}
|
||||||
if(null != searchClassPlanDto) {
|
if(null != searchClassPlanDto) {
|
||||||
if(!searchClassPlanDto.getClassPlanId().equals(applyStudentsDTO.getApplyClassId())) {
|
if(!searchClassPlanDto.getClassPlanId().equals(applyStudentsDTO.getApplyClassId())) {
|
||||||
applyStudentsDTOIterator.remove();
|
applyStudentsDTOIterator.remove();
|
||||||
@ -344,4 +352,8 @@ public class ApplyStudentsServiceImpl extends DefaultBaseService implements IApp
|
|||||||
return count == null ? 0 : count;
|
return count == null ? 0 : count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setMarkAge(List<ApplyStudentsDTO> applyStudentsDTOS) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -52,6 +52,7 @@ import ink.wgink.pojo.result.SuccessResult;
|
|||||||
import ink.wgink.pojo.result.SuccessResultData;
|
import ink.wgink.pojo.result.SuccessResultData;
|
||||||
import ink.wgink.pojo.result.SuccessResultList;
|
import ink.wgink.pojo.result.SuccessResultList;
|
||||||
import ink.wgink.service.department.service.IDepartmentService;
|
import ink.wgink.service.department.service.IDepartmentService;
|
||||||
|
import ink.wgink.util.RegexUtil;
|
||||||
import ink.wgink.util.UUIDUtil;
|
import ink.wgink.util.UUIDUtil;
|
||||||
import ink.wgink.util.date.DateUtil;
|
import ink.wgink.util.date.DateUtil;
|
||||||
import ink.wgink.util.map.HashMapUtil;
|
import ink.wgink.util.map.HashMapUtil;
|
||||||
@ -132,6 +133,10 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
|
|||||||
return saveReturnId(null, classPlanVO);
|
return saveReturnId(null, classPlanVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(RegexUtil.isPasswordMiddle("12345678"));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String saveReturnId(String token, ClassPlanVO classPlanVO) {
|
public String saveReturnId(String token, ClassPlanVO classPlanVO) {
|
||||||
String classPlanId = UUIDUtil.getUUID();
|
String classPlanId = UUIDUtil.getUUID();
|
||||||
@ -217,6 +222,16 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
|
|||||||
@Override
|
@Override
|
||||||
public void updateJson(JSONObject obj) throws Exception {
|
public void updateJson(JSONObject obj) throws Exception {
|
||||||
String classPlanId = obj.getString("classPlanId");
|
String classPlanId = obj.getString("classPlanId");
|
||||||
|
|
||||||
|
String planNumber = obj.getString("planNumber");
|
||||||
|
Map<String, Object> query = getHashMap(2);
|
||||||
|
query.put("planNumber", planNumber);
|
||||||
|
ClassPlanDTO byPlanNumberDTO = classPlanDao.get(query);
|
||||||
|
if (byPlanNumberDTO != null
|
||||||
|
&& !StringUtils.isBlank(byPlanNumberDTO.getClassPlanId())
|
||||||
|
&& !StringUtils.equals(byPlanNumberDTO.getClassPlanId(), classPlanId)) {
|
||||||
|
throw new SaveException("班号: " + planNumber + "已存在!");
|
||||||
|
}
|
||||||
ClassPlanVO classPlanVO = new ClassPlanVO();
|
ClassPlanVO classPlanVO = new ClassPlanVO();
|
||||||
classPlanVO.setClassPlanId(classPlanId);
|
classPlanVO.setClassPlanId(classPlanId);
|
||||||
classPlanVO.setOrgId(obj.getString("orgId"));
|
classPlanVO.setOrgId(obj.getString("orgId"));
|
||||||
@ -468,7 +483,7 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
|
|||||||
classPlanDTOs.parallelStream().forEach(classPlanDTO -> {
|
classPlanDTOs.parallelStream().forEach(classPlanDTO -> {
|
||||||
Map<String, Object> queryMap = getHashMap(4);
|
Map<String, Object> queryMap = getHashMap(4);
|
||||||
// 开班计划中培训工种为多个 ','号分割
|
// 开班计划中培训工种为多个 ','号分割
|
||||||
String workTypeIds[] = classPlanDTO.getWorkerCatalog().split(",");
|
String[] workTypeIds = classPlanDTO.getWorkerCatalog().split(",");
|
||||||
String workTypeNames = "";
|
String workTypeNames = "";
|
||||||
for (int i = 0; i < workTypeIds.length; i++) {
|
for (int i = 0; i < workTypeIds.length; i++) {
|
||||||
WorkTypeDTO workTypeDTO = workTypeService.get(workTypeIds[i]);
|
WorkTypeDTO workTypeDTO = workTypeService.get(workTypeIds[i]);
|
||||||
@ -491,7 +506,7 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
|
|||||||
classPlanDTO.setSignUpUserCount(studentsService.count(params));
|
classPlanDTO.setSignUpUserCount(studentsService.count(params));
|
||||||
} else {
|
} else {
|
||||||
queryMap.put("applyInstitutionId", classPlanDTO.getOrgId());
|
queryMap.put("applyInstitutionId", classPlanDTO.getOrgId());
|
||||||
queryMap.put("applyWorkTypeId", classPlanDTO.getWorkerCatalog());
|
queryMap.put("applyWorkTypeIds", Arrays.asList(workTypeIds));
|
||||||
List<String> applyAuditStates = new ArrayList<>();
|
List<String> applyAuditStates = new ArrayList<>();
|
||||||
applyAuditStates.add("2");
|
applyAuditStates.add("2");
|
||||||
queryMap.put("applyAuditStates", applyAuditStates);
|
queryMap.put("applyAuditStates", applyAuditStates);
|
||||||
@ -555,7 +570,7 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
|
|||||||
item.setWorkerCatalogName(workTypeNames);
|
item.setWorkerCatalogName(workTypeNames);
|
||||||
//查询申考人员
|
//查询申考人员
|
||||||
queryMap.clear();
|
queryMap.clear();
|
||||||
queryMap.put("applyClassId",item.getClassPlanId());
|
queryMap.put("applyClassId", item.getClassPlanId());
|
||||||
queryMap.put("joinExam", "1");
|
queryMap.put("joinExam", "1");
|
||||||
Integer examStudent = studentsService.count(queryMap);
|
Integer examStudent = studentsService.count(queryMap);
|
||||||
item.setSignUpUserCount(examStudent);
|
item.setSignUpUserCount(examStudent);
|
||||||
|
@ -294,7 +294,7 @@ public class ExamCheckServiceImpl extends DefaultBaseService implements IExamChe
|
|||||||
for (ClassPlanDTO classPlanDTO : classPlanDTOS) {
|
for (ClassPlanDTO classPlanDTO : classPlanDTOS) {
|
||||||
if (StringUtils.equals(examCheckDTO.getPlanId(), classPlanDTO.getClassPlanId())) {
|
if (StringUtils.equals(examCheckDTO.getPlanId(), classPlanDTO.getClassPlanId())) {
|
||||||
// 开班计划中培训工种为多个 ','号分割
|
// 开班计划中培训工种为多个 ','号分割
|
||||||
String workTypeIds[] = classPlanDTO.getWorkerCatalog().split(",");
|
String[] workTypeIds = classPlanDTO.getWorkerCatalog().split(",");
|
||||||
String workTypeNames = "";
|
String workTypeNames = "";
|
||||||
for (int i = 0; i < workTypeIds.length; i++) {
|
for (int i = 0; i < workTypeIds.length; i++) {
|
||||||
WorkTypeDTO workTypeDTO = workTypeService.get(workTypeIds[i]);
|
WorkTypeDTO workTypeDTO = workTypeService.get(workTypeIds[i]);
|
||||||
@ -309,7 +309,7 @@ public class ExamCheckServiceImpl extends DefaultBaseService implements IExamChe
|
|||||||
Integer checkStatus = examCheckDTO.getCheckStatus();
|
Integer checkStatus = examCheckDTO.getCheckStatus();
|
||||||
if (0 == checkStatus || -1 == checkStatus) {
|
if (0 == checkStatus || -1 == checkStatus) {
|
||||||
query.put("applyInstitutionId", examCheckDTO.getOrgId());
|
query.put("applyInstitutionId", examCheckDTO.getOrgId());
|
||||||
query.put("applyWorkTypeId", examCheckDTO.getWorkTypeId());
|
query.put("applyWorkTypeIds", Arrays.asList(workTypeIds));
|
||||||
List<String> applyAuditStates = new ArrayList<>();
|
List<String> applyAuditStates = new ArrayList<>();
|
||||||
applyAuditStates.add("2");
|
applyAuditStates.add("2");
|
||||||
query.put("applyAuditStates", applyAuditStates);
|
query.put("applyAuditStates", applyAuditStates);
|
||||||
|
@ -32,7 +32,7 @@ public class ImportExamScoreListener extends AnalysisEventListener<Map<Integer,
|
|||||||
public void invoke(Map<Integer, Object> data, AnalysisContext context) {
|
public void invoke(Map<Integer, Object> data, AnalysisContext context) {
|
||||||
try {
|
try {
|
||||||
Map<String, Object> params = new HashMap<>(8);
|
Map<String, Object> params = new HashMap<>(8);
|
||||||
if(data.size() >= 5 && IdCardVerifyUtil.isIDCard(data.get(4) + "")){
|
if(data.size() >= 5 && IdCardVerifyUtil.isValidatedAllIdcard(data.get(4) + "")){
|
||||||
params.put("classPlanId",classPlanId);
|
params.put("classPlanId",classPlanId);
|
||||||
params.put("applyCardNumber",data.get(4) + "");
|
params.put("applyCardNumber",data.get(4) + "");
|
||||||
int examScore = 0;
|
int examScore = 0;
|
||||||
|
@ -1,5 +1,15 @@
|
|||||||
package cn.com.tenlion.util;
|
package cn.com.tenlion.util;
|
||||||
|
|
||||||
|
import ink.wgink.exceptions.base.SystemException;
|
||||||
|
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||||
|
import net.sf.jsqlparser.expression.DateTimeLiteralExpression;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.joda.time.DateTime;
|
||||||
|
import org.joda.time.Days;
|
||||||
|
import org.joda.time.LocalDateTime;
|
||||||
|
import org.joda.time.Years;
|
||||||
|
import org.joda.time.format.DateTimeFormat;
|
||||||
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
@ -9,11 +19,13 @@ import java.util.Map;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 15、18位身份证号验证工具类
|
* 15、18位身份证号验证工具类
|
||||||
|
*
|
||||||
* @author renpc
|
* @author renpc
|
||||||
*/
|
*/
|
||||||
public class IdCardVerifyUtil {
|
public class IdCardVerifyUtil {
|
||||||
|
|
||||||
final static Map<Integer, String> zoneNum = new HashMap<Integer, String>();
|
final static Map<Integer, String> zoneNum = new HashMap<Integer, String>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
zoneNum.put(11, "北京");
|
zoneNum.put(11, "北京");
|
||||||
zoneNum.put(12, "天津");
|
zoneNum.put(12, "天津");
|
||||||
@ -52,77 +64,500 @@ public class IdCardVerifyUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final static int[] PARITYBIT = {'1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'};
|
final static int[] PARITYBIT = {'1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'};
|
||||||
final static int[] POWER_LIST = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
|
final static int[] POWER_LIST = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
|
||||||
|
|
||||||
public IdCardVerifyUtil() {
|
public IdCardVerifyUtil() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 身份证验证
|
* 身份证验证,废弃,此方法有遗漏
|
||||||
*@param certNo 号码内容
|
*
|
||||||
*@return 是否有效 null和"" 都是false
|
* @param certNo 号码内容
|
||||||
|
* @return 是否有效 null和"" 都是false
|
||||||
*/
|
*/
|
||||||
public static boolean isIDCard(String certNo){
|
@Deprecated
|
||||||
if(certNo == null || (certNo.length() != 15 && certNo.length() != 18)){
|
public static boolean isIDCard(String certNo) {
|
||||||
|
if (certNo == null || (certNo.length() != 15 && certNo.length() != 18)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final char[] cs = certNo.toUpperCase().toCharArray();
|
final char[] cs = certNo.toUpperCase().toCharArray();
|
||||||
//校验位数
|
//校验位数
|
||||||
int power = 0;
|
int power = 0;
|
||||||
for(int i=0; i<cs.length; i++){
|
for (int i = 0; i < cs.length; i++) {
|
||||||
if(i==cs.length-1 && cs[i] == 'X'){
|
if (i == cs.length - 1 && cs[i] == 'X') {
|
||||||
break;//最后一位可以 是X或x
|
break;//最后一位可以 是X或x
|
||||||
}
|
}
|
||||||
if(cs[i]<'0' || cs[i]>'9'){
|
if (cs[i] < '0' || cs[i] > '9') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(i < cs.length -1){
|
if (i < cs.length - 1) {
|
||||||
power += (cs[i] - '0') * POWER_LIST[i];
|
power += (cs[i] - '0') * POWER_LIST[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//校验区位码
|
//校验区位码
|
||||||
if(!zoneNum.containsKey(Integer.valueOf(certNo.substring(0,2)))){
|
if (!zoneNum.containsKey(Integer.valueOf(certNo.substring(0, 2)))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//校验年份
|
//校验年份
|
||||||
String year = null;
|
String year = null;
|
||||||
year = certNo.length() == 15 ? getIdCardCalendar(certNo):certNo.substring(6, 10);
|
year = certNo.length() == 15 ? getIdCardCalendar(certNo) : certNo.substring(6, 10);
|
||||||
|
|
||||||
|
|
||||||
final int iyear = Integer.parseInt(year);
|
final int iyear = Integer.parseInt(year);
|
||||||
if(iyear < 1900 || iyear > Calendar.getInstance().get(Calendar.YEAR)){
|
if (iyear < 1900 || iyear > Calendar.getInstance().get(Calendar.YEAR)) {
|
||||||
//1900年的PASS,超过今年的PASS
|
//1900年的PASS,超过今年的PASS
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//校验月份
|
//校验月份
|
||||||
String month = certNo.length() == 15 ? certNo.substring(8, 10) : certNo.substring(10,12);
|
String month = certNo.length() == 15 ? certNo.substring(8, 10) : certNo.substring(10, 12);
|
||||||
final int imonth = Integer.parseInt(month);
|
final int imonth = Integer.parseInt(month);
|
||||||
if(imonth <1 || imonth >12){
|
if (imonth < 1 || imonth > 12) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//校验天数
|
//校验天数
|
||||||
String day = certNo.length() ==15 ? certNo.substring(10, 12) : certNo.substring(12, 14);
|
String day = certNo.length() == 15 ? certNo.substring(10, 12) : certNo.substring(12, 14);
|
||||||
final int iday = Integer.parseInt(day);
|
final int iday = Integer.parseInt(day);
|
||||||
if(iday < 1 || iday > 31){
|
if (iday < 1 || iday > 31) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//校验"校验码"
|
//校验"校验码"
|
||||||
if(certNo.length() == 15){
|
if (certNo.length() == 15) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return cs[cs.length -1 ] == PARITYBIT[power % 11];
|
return cs[cs.length - 1] == PARITYBIT[power % 11];
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getIdCardCalendar(String certNo){
|
/**
|
||||||
|
* 省、直辖市代码表:
|
||||||
|
* 11 : 北京 12 : 天津 13 : 河北 14 : 山西 15 : 内蒙古
|
||||||
|
* 21 : 辽宁 22 : 吉林 23 : 黑龙江 31 : 上海 32 : 江苏
|
||||||
|
* 33 : 浙江 34 : 安徽 35 : 福建 36 : 江西 37 : 山东
|
||||||
|
* 41 : 河南 42 : 湖北 43 : 湖南 44 : 广东 45 : 广西 46 : 海南
|
||||||
|
* 50 : 重庆 51 : 四川 52 : 贵州 53 : 云南 54 : 西藏
|
||||||
|
* 61 : 陕西 62 : 甘肃 63 : 青海 64 : 宁夏 65 : 新疆
|
||||||
|
* 71 : 台湾
|
||||||
|
* 81 : 香港 82 : 澳门
|
||||||
|
* 91 : 国外
|
||||||
|
*/
|
||||||
|
private static String[] cityCode = {"11", "12", "13", "14", "15", "21",
|
||||||
|
"22", "23", "31", "32", "33", "34", "35", "36", "37", "41", "42",
|
||||||
|
"43", "44", "45", "46", "50", "51", "52", "53", "54", "61", "62",
|
||||||
|
"63", "64", "65", "71", "81", "82", "91"};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每位加权因子
|
||||||
|
*/
|
||||||
|
private static int power[] = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5,
|
||||||
|
8, 4, 2};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证所有的身份证的合法性
|
||||||
|
*
|
||||||
|
* @param idcard 身份证
|
||||||
|
* @return 合法返回true,否则返回false
|
||||||
|
*/
|
||||||
|
public static boolean isValidatedAllIdcard(String idcard) {
|
||||||
|
if (idcard == null || "".equals(idcard)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
int s = 15;
|
||||||
|
if (idcard.length() == s) {
|
||||||
|
return validate15IDCard(idcard);
|
||||||
|
}
|
||||||
|
int s1 = 18;
|
||||||
|
if (idcard.length() == s1) {
|
||||||
|
return validate18Idcard(idcard);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断18位身份证的合法性
|
||||||
|
* 根据〖中华人民共和国国家标准GB11643-1999〗中有关公民身份号码的规定,公民身份号码是特征组合码,由十七位数字本体码和一位数字校验码组成。
|
||||||
|
* 排列顺序从左至右依次为:六位数字地址码,八位数字出生日期码,三位数字顺序码和一位数字校验码。
|
||||||
|
* <p>
|
||||||
|
* 顺序码: 表示在同一地址码所标识的区域范围内,对同年、同月、同 日出生的人编定的顺序号,顺序码的奇数分配给男性,偶数分配 给女性。
|
||||||
|
* <p>
|
||||||
|
* <p>
|
||||||
|
* 1.前1、2位数字表示:所在省份的代码; 2.第3、4位数字表示:所在城市的代码; 3.第5、6位数字表示:所在区县的代码;
|
||||||
|
* 4.第7~14位数字表示:出生年、月、日; 5.第15、16位数字表示:所在地的派出所的代码;
|
||||||
|
* 6.第17位数字表示性别:奇数表示男性,偶数表示女性;
|
||||||
|
* 7.第18位数字是校检码:也有的说是个人信息码,一般是随计算机的随机产生,用来检验身份证的正确性。校检码可以是0~9的数字,有时也用x表示。
|
||||||
|
* <p>
|
||||||
|
* <p>
|
||||||
|
* 第十八位数字(校验码)的计算方法为: 1.将前面的身份证号码17位数分别乘以不同的系数。从第一位到第十七位的系数分别为:7 9 10 5 8 4
|
||||||
|
* 2 1 6 3 7 9 10 5 8 4 2
|
||||||
|
* <p>
|
||||||
|
* <p>
|
||||||
|
* 2.将这17位数字和系数相乘的结果相加。
|
||||||
|
* <p>
|
||||||
|
* <p>
|
||||||
|
* 3.用加出来和除以11,看余数是多少
|
||||||
|
* <p>
|
||||||
|
* 4.余数只可能有0 1 2 3 4 5 6 7 8 9 10这11个数字。其分别对应的最后一位身份证的号码为1 0 X 9 8 7 6 5 4 3
|
||||||
|
* 2。
|
||||||
|
* <p>
|
||||||
|
* 5.通过上面得知如果余数是2,就会在身份证的第18位数字上出现罗马数字的Ⅹ。如果余数是10,身份证的最后一位号码就是2。
|
||||||
|
*
|
||||||
|
* @param idcard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean validate18Idcard(String idcard) {
|
||||||
|
if (idcard == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 非18位为假
|
||||||
|
int s = 18;
|
||||||
|
if (idcard.length() != s) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 获取前17位
|
||||||
|
String idcard17 = idcard.substring(0, 17);
|
||||||
|
|
||||||
|
// 前17位全部为数字
|
||||||
|
if (!isDigital(idcard17)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
String provinceid = idcard.substring(0, 2);
|
||||||
|
// 校验省份
|
||||||
|
if (!checkProvinceid(provinceid)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验出生日期
|
||||||
|
String birthday = idcard.substring(6, 14);
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
||||||
|
|
||||||
|
try {
|
||||||
|
Date birthDate = sdf.parse(birthday);
|
||||||
|
String tmpDate = sdf.format(birthDate);
|
||||||
|
// 出生年月日不正确
|
||||||
|
if (!tmpDate.equals(birthday)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (ParseException e1) {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取第18位
|
||||||
|
String idcard18Code = idcard.substring(17, 18);
|
||||||
|
|
||||||
|
char c[] = idcard17.toCharArray();
|
||||||
|
|
||||||
|
int bit[] = converCharToInt(c);
|
||||||
|
|
||||||
|
int sum17 = 0;
|
||||||
|
|
||||||
|
sum17 = getPowerSum(bit);
|
||||||
|
|
||||||
|
// 将和值与11取模得到余数进行校验码判断
|
||||||
|
String checkCode = getCheckCodeBySum(sum17);
|
||||||
|
if (null == checkCode) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 将身份证的第18位与算出来的校码进行匹配,不相等就为假
|
||||||
|
if (!idcard18Code.equalsIgnoreCase(checkCode)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//System.out.println("正确");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验15位身份证
|
||||||
|
* <p>
|
||||||
|
* 只校验省份和出生年月日
|
||||||
|
*
|
||||||
|
* @param idcard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean validate15IDCard(String idcard) {
|
||||||
|
if (idcard == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 非15位为假
|
||||||
|
int s = 15;
|
||||||
|
if (idcard.length() != s) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 15全部为数字
|
||||||
|
if (!isDigital(idcard)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
String provinceid = idcard.substring(0, 2);
|
||||||
|
// 校验省份
|
||||||
|
if (!checkProvinceid(provinceid)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
String birthday = idcard.substring(6, 12);
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
|
||||||
|
|
||||||
|
try {
|
||||||
|
Date birthDate = sdf.parse(birthday);
|
||||||
|
String tmpDate = sdf.format(birthDate);
|
||||||
|
// 身份证日期错误
|
||||||
|
if (!tmpDate.equals(birthday)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (ParseException e1) {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将15位的身份证转成18位身份证
|
||||||
|
*
|
||||||
|
* @param idcard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String convertIdcarBy15bit(String idcard) {
|
||||||
|
if (idcard == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 非15位身份证
|
||||||
|
int s = 15;
|
||||||
|
if (idcard.length() != s) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 15全部为数字
|
||||||
|
if (!isDigital(idcard)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String provinceid = idcard.substring(0, 2);
|
||||||
|
// 校验省份
|
||||||
|
if (!checkProvinceid(provinceid)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String birthday = idcard.substring(6, 12);
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
|
||||||
|
|
||||||
|
Date birthdate = null;
|
||||||
|
try {
|
||||||
|
birthdate = sdf.parse(birthday);
|
||||||
|
String tmpDate = sdf.format(birthdate);
|
||||||
|
// 身份证日期错误
|
||||||
|
if (!tmpDate.equals(birthday)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (ParseException e1) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Calendar cday = Calendar.getInstance();
|
||||||
|
cday.setTime(birthdate);
|
||||||
|
String year = String.valueOf(cday.get(Calendar.YEAR));
|
||||||
|
|
||||||
|
String idcard17 = idcard.substring(0, 6) + year + idcard.substring(8);
|
||||||
|
|
||||||
|
char c[] = idcard17.toCharArray();
|
||||||
|
String checkCode = "";
|
||||||
|
|
||||||
|
// 将字符数组转为整型数组
|
||||||
|
int bit[] = converCharToInt(c);
|
||||||
|
|
||||||
|
int sum17 = 0;
|
||||||
|
sum17 = getPowerSum(bit);
|
||||||
|
|
||||||
|
// 获取和值与11取模得到余数进行校验码
|
||||||
|
checkCode = getCheckCodeBySum(sum17);
|
||||||
|
|
||||||
|
// 获取不到校验位
|
||||||
|
if (null == checkCode) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// 将前17位与第18位校验码拼接
|
||||||
|
idcard17 += checkCode;
|
||||||
|
return idcard17;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验省份
|
||||||
|
*
|
||||||
|
* @param provinceid
|
||||||
|
* @return 合法返回TRUE,否则返回FALSE
|
||||||
|
*/
|
||||||
|
private static boolean checkProvinceid(String provinceid) {
|
||||||
|
for (String id : cityCode) {
|
||||||
|
if (id.equals(provinceid)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数字验证
|
||||||
|
*
|
||||||
|
* @param str
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static boolean isDigital(String str) {
|
||||||
|
return str.matches("^[0-9]*$");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将身份证的每位和对应位的加权因子相乘之后,再得到和值
|
||||||
|
*
|
||||||
|
* @param bit
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static int getPowerSum(int[] bit) {
|
||||||
|
|
||||||
|
int sum = 0;
|
||||||
|
|
||||||
|
if (power.length != bit.length) {
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < bit.length; i++) {
|
||||||
|
for (int j = 0; j < power.length; j++) {
|
||||||
|
if (i == j) {
|
||||||
|
sum = sum + bit[i] * power[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将和值与11取模得到余数进行校验码判断
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @param sum17
|
||||||
|
* @return 校验位
|
||||||
|
*/
|
||||||
|
private static String getCheckCodeBySum(int sum17) {
|
||||||
|
String checkCode = null;
|
||||||
|
switch (sum17 % 11) {
|
||||||
|
case 10:
|
||||||
|
checkCode = "2";
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
checkCode = "3";
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
checkCode = "4";
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
checkCode = "5";
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
checkCode = "6";
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
checkCode = "7";
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
checkCode = "8";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
checkCode = "9";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
checkCode = "x";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
checkCode = "0";
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
checkCode = "1";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
return checkCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将字符数组转为整型数组
|
||||||
|
*
|
||||||
|
* @param c
|
||||||
|
* @return
|
||||||
|
* @throws NumberFormatException
|
||||||
|
*/
|
||||||
|
private static int[] converCharToInt(char[] c) throws NumberFormatException {
|
||||||
|
int[] a = new int[c.length];
|
||||||
|
int k = 0;
|
||||||
|
for (char temp : c) {
|
||||||
|
a[k++] = Integer.parseInt(String.valueOf(temp));
|
||||||
|
}
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过身份证号码获取出生日期、性别、年龄
|
||||||
|
*
|
||||||
|
* @param certificateNo
|
||||||
|
* @return 返回的出生日期格式:1990-01-01 性别格式:F-女,M-男
|
||||||
|
*/
|
||||||
|
public static Map<String, String> getBirAgeSex(String certificateNo) {
|
||||||
|
String birthday = "";
|
||||||
|
String age = "";
|
||||||
|
String sexCode = "";
|
||||||
|
|
||||||
|
int year = Calendar.getInstance().get(Calendar.YEAR);
|
||||||
|
char[] number = certificateNo.toCharArray();
|
||||||
|
boolean flag = true;
|
||||||
|
if (number.length == 15) {
|
||||||
|
for (int x = 0; x < number.length; x++) {
|
||||||
|
if (!flag) return new HashMap<String, String>();
|
||||||
|
flag = Character.isDigit(number[x]);
|
||||||
|
}
|
||||||
|
} else if (number.length == 18) {
|
||||||
|
for (int x = 0; x < number.length - 1; x++) {
|
||||||
|
if (!flag) return new HashMap<String, String>();
|
||||||
|
flag = Character.isDigit(number[x]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (flag && certificateNo.length() == 15) {
|
||||||
|
birthday = "19" + certificateNo.substring(6, 8) + "-"
|
||||||
|
+ certificateNo.substring(8, 10) + "-"
|
||||||
|
+ certificateNo.substring(10, 12);
|
||||||
|
sexCode = Integer.parseInt(certificateNo.substring(certificateNo.length() - 3, certificateNo.length())) % 2 == 0 ? "F" : "M";
|
||||||
|
age = (year - Integer.parseInt("19" + certificateNo.substring(6, 8))) + "";
|
||||||
|
} else if (flag && certificateNo.length() == 18) {
|
||||||
|
birthday = certificateNo.substring(6, 10) + "-"
|
||||||
|
+ certificateNo.substring(10, 12) + "-"
|
||||||
|
+ certificateNo.substring(12, 14);
|
||||||
|
sexCode = Integer.parseInt(certificateNo.substring(certificateNo.length() - 4, certificateNo.length() - 1)) % 2 == 0 ? "F" : "M";
|
||||||
|
age = (year - Integer.parseInt(certificateNo.substring(6, 10))) + "";
|
||||||
|
}
|
||||||
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
|
map.put("birthday", birthday);
|
||||||
|
map.put("age", age);
|
||||||
|
map.put("sexCode", sexCode);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getIdCardCalendar(String certNo) {
|
||||||
// 获取出生年月日
|
// 获取出生年月日
|
||||||
String birthday = certNo.substring(6, 12);
|
String birthday = certNo.substring(6, 12);
|
||||||
SimpleDateFormat ft = new SimpleDateFormat("yyMMdd");
|
SimpleDateFormat ft = new SimpleDateFormat("yyMMdd");
|
||||||
Date birthdate = null;
|
Date birthdate = null;
|
||||||
try {
|
try {
|
||||||
birthdate = ft.parse(birthday);
|
birthdate = ft.parse(birthday);
|
||||||
@ -137,67 +572,74 @@ public class IdCardVerifyUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取身份证号中的出生日期
|
* 获取身份证号中的出生日期
|
||||||
|
*
|
||||||
* @param cardNo 身份证号
|
* @param cardNo 身份证号
|
||||||
* @return xxxx-xx-xx
|
* @return xxxx-xx-xx
|
||||||
*/
|
*/
|
||||||
public static String getIdCardBirthday(String cardNo) {
|
public static String getIdCardBirthday(String cardNo) {
|
||||||
try {
|
try {
|
||||||
if(cardNo == null || cardNo.length() == 0){
|
if (cardNo == null || cardNo.length() == 0) {
|
||||||
return "身份证号为空";
|
return "身份证号为空";
|
||||||
}
|
}
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
||||||
if(cardNo.length() == 15){
|
if (cardNo.length() == 15) {
|
||||||
String birthday = "19" + cardNo.substring(6,12);
|
String birthday = "19" + cardNo.substring(6, 12);
|
||||||
Date date = sdf.parse(birthday);
|
Date date = sdf.parse(birthday);
|
||||||
sdf = new SimpleDateFormat("yyyy-MM-dd");
|
sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
return sdf.format(date);
|
return sdf.format(date);
|
||||||
}
|
}
|
||||||
if(cardNo.length() == 18){
|
if (cardNo.length() == 18) {
|
||||||
String birthday = cardNo.substring(6,14);
|
String birthday = cardNo.substring(6, 14);
|
||||||
Date date = sdf.parse(birthday);
|
Date date = sdf.parse(birthday);
|
||||||
sdf = new SimpleDateFormat("yyyy-MM-dd");
|
sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
return sdf.format(date);
|
return sdf.format(date);
|
||||||
}
|
}
|
||||||
} catch (Exception e){}
|
} catch (Exception e) {
|
||||||
return "";
|
throw new SystemException(e);
|
||||||
|
}
|
||||||
|
throw new SystemException("身份证格式异常");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer getIdCardAge(String cardNo) {
|
||||||
|
String birthday = getIdCardBirthday(cardNo);
|
||||||
|
LocalDateTime nowDateTime = LocalDateTime.now();
|
||||||
|
LocalDateTime birthdayDateTime = LocalDateTime.parse(birthday, DateTimeFormat.forPattern(ISystemConstant.DATE_FORMATTER_YYYY_MM_DD));
|
||||||
|
return Years.yearsBetween(birthdayDateTime, nowDateTime).getYears();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取身份证号中的性别
|
* 获取身份证号中的性别
|
||||||
|
*
|
||||||
* @param cardNo
|
* @param cardNo
|
||||||
* @return -1 无法获取 1男性0女性
|
* @return -1 无法获取 1男性0女性
|
||||||
*/
|
*/
|
||||||
public static String getIdCardGender(String cardNo){
|
public static String getIdCardGender(String cardNo) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(cardNo == null || cardNo.length() == 0){
|
if (cardNo == null || cardNo.length() == 0) {
|
||||||
return "-1";
|
return "-1";
|
||||||
}
|
}
|
||||||
if(cardNo.length() == 15){
|
if (cardNo.length() == 15) {
|
||||||
String genderCode = cardNo.substring(cardNo.length() - 1);
|
String genderCode = cardNo.substring(cardNo.length() - 1);
|
||||||
int res = Integer.parseInt(genderCode);
|
int res = Integer.parseInt(genderCode);
|
||||||
if(res % 2 == 0){
|
if (res % 2 == 0) {
|
||||||
return "0";
|
return "0";
|
||||||
} else {
|
} else {
|
||||||
return "1";
|
return "1";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cardNo.length() == 18){
|
if (cardNo.length() == 18) {
|
||||||
String genderCode = cardNo.substring(cardNo.length() - 2, cardNo.length() - 1);
|
String genderCode = cardNo.substring(cardNo.length() - 2, cardNo.length() - 1);
|
||||||
int res = Integer.parseInt(genderCode);
|
int res = Integer.parseInt(genderCode);
|
||||||
if(res % 2 == 0){
|
if (res % 2 == 0) {
|
||||||
return "0";
|
return "0";
|
||||||
} else {
|
} else {
|
||||||
return "1";
|
return "1";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e){}
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
return "-1";
|
return "-1";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
boolean isTrue = isIDCard("612701198410267049");
|
|
||||||
System.out.println(isTrue);
|
|
||||||
System.out.println(getIdCardGender("152822199310146919"));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
76
src/main/java/cn/com/tenlion/util/SignUpUtil.java
Normal file
76
src/main/java/cn/com/tenlion/util/SignUpUtil.java
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
package cn.com.tenlion.util;
|
||||||
|
|
||||||
|
import cn.com.tenlion.consts.ISignUpConsts;
|
||||||
|
import ink.wgink.common.manager.env.EnvManager;
|
||||||
|
import ink.wgink.common.pojo.Env;
|
||||||
|
import ink.wgink.exceptions.ParamsException;
|
||||||
|
import ink.wgink.exceptions.base.SystemException;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
public class SignUpUtil {
|
||||||
|
|
||||||
|
public static Integer getMaxAge(String type, String idCard) {
|
||||||
|
if (!StringUtils.equals("安全管理人员", type) && !StringUtils.isBlank(type)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (!IdCardVerifyUtil.isValidatedAllIdcard(idCard)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
String gender = IdCardVerifyUtil.getIdCardGender(idCard);
|
||||||
|
Env env = EnvManager.getInstance().getEnv();
|
||||||
|
String maxAge = null;
|
||||||
|
// 安全管理
|
||||||
|
if (StringUtils.equals("安全管理人员", type)) {
|
||||||
|
// 女
|
||||||
|
if (StringUtils.equals("0", gender)) {
|
||||||
|
maxAge = env.get(ISignUpConsts.KEY_AQGL_FAMALE_MAX_AGE);
|
||||||
|
}
|
||||||
|
// 男
|
||||||
|
if (StringUtils.equals("1", gender)) {
|
||||||
|
maxAge = env.get(ISignUpConsts.KEY_AQGL_MALE_MAX_AGE);
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(maxAge)) {
|
||||||
|
throw new SystemException("年龄校验失败请检查aqglFamaleMaxAge和aqglMaleMaxAge配置");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 特种作业
|
||||||
|
if (StringUtils.isBlank(type)) {
|
||||||
|
// 女
|
||||||
|
if (StringUtils.equals("0", gender)) {
|
||||||
|
maxAge = env.get(ISignUpConsts.KEY_TZZY_FAMALE_MAX_AGE);
|
||||||
|
}
|
||||||
|
// 男
|
||||||
|
if (StringUtils.equals("1", gender)) {
|
||||||
|
maxAge = env.get(ISignUpConsts.KEY_TZZY_MALE_MAX_AGE);
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(maxAge)) {
|
||||||
|
throw new SystemException("年龄校验失败请检查tzzyFamaleMaxAge和tzzyMaleMaxAge配置");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Integer.parseInt(maxAge);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查身份证年龄
|
||||||
|
*
|
||||||
|
* @param type
|
||||||
|
* @param idCard
|
||||||
|
*/
|
||||||
|
public static void checkIdCardAge(String type, String idCard) {
|
||||||
|
if (!StringUtils.equals("安全管理人员", type) && !StringUtils.isBlank(type)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!IdCardVerifyUtil.isValidatedAllIdcard(idCard)) {
|
||||||
|
throw new ParamsException("身份证格式错误");
|
||||||
|
}
|
||||||
|
Integer age = IdCardVerifyUtil.getIdCardAge(idCard);
|
||||||
|
Integer maxAge = getMaxAge(type, idCard);
|
||||||
|
if (maxAge == -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (age >= maxAge) {
|
||||||
|
throw new ParamsException("身份证年龄大于或等于退休年龄:" + maxAge);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -97,4 +97,15 @@ logging:
|
|||||||
level:
|
level:
|
||||||
root: error
|
root: error
|
||||||
ink.wgink: debug
|
ink.wgink: debug
|
||||||
cn.com.tenlion: debug
|
cn.com.tenlion: debug
|
||||||
|
|
||||||
|
# 短信服务
|
||||||
|
sms:
|
||||||
|
active: false
|
||||||
|
type: default
|
||||||
|
default-sms:
|
||||||
|
account: yjkaoshi
|
||||||
|
password: yjkaoshi123
|
||||||
|
sign: 【包头安全生产报名】
|
||||||
|
template:
|
||||||
|
verification-code: '{sign} 您的验证码为 {content}, 有效时间为120秒,若非本人操作,请忽略。'
|
@ -1,102 +0,0 @@
|
|||||||
server:
|
|
||||||
port: 7009
|
|
||||||
url: http://192.168.0.115:7009/signup
|
|
||||||
system-title: 考试报名系统
|
|
||||||
system-sub-title: 考试报名系统
|
|
||||||
default-home-page: indexweb
|
|
||||||
servlet:
|
|
||||||
context-path: /signup
|
|
||||||
|
|
||||||
spring:
|
|
||||||
login-url: /oauth/login
|
|
||||||
login-failure: /oauth/login?error
|
|
||||||
login-process: /userlogin
|
|
||||||
assets-matchers: /assets/**
|
|
||||||
thymeleaf:
|
|
||||||
prefix: classpath:/templates/
|
|
||||||
suffix: .html
|
|
||||||
mode: HTML5
|
|
||||||
encoding: UTF-8
|
|
||||||
cache: false
|
|
||||||
main:
|
|
||||||
allow-bean-definition-overriding: true
|
|
||||||
servlet:
|
|
||||||
multipart:
|
|
||||||
max-file-size: 1GB
|
|
||||||
max-request-size: 1GB
|
|
||||||
datasource:
|
|
||||||
druid:
|
|
||||||
url: jdbc:mysql://192.168.0.151:3306/db_baotou_signup?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC
|
|
||||||
db-type: mysql
|
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
||||||
username: root
|
|
||||||
password: root
|
|
||||||
initial-size: 2
|
|
||||||
min-idle: 2
|
|
||||||
max-active: 5
|
|
||||||
max-wait: 60000
|
|
||||||
time-between-eviction-runs-millis: 60000
|
|
||||||
min-evictable-idle-time-millis: 300000
|
|
||||||
validation-query: SELECT 1 FROM DUAL
|
|
||||||
test-while-idle: true
|
|
||||||
test-on-borrow: false
|
|
||||||
test-on-return: false
|
|
||||||
pool-prepared-statements: true
|
|
||||||
max-pool-prepared-statement-per-connection-size: 10
|
|
||||||
filter:
|
|
||||||
commons-log:
|
|
||||||
connection-logger-name: stat,wall,log4j
|
|
||||||
stat:
|
|
||||||
log-slow-sql: true
|
|
||||||
slow-sql-millis: 2000
|
|
||||||
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
|
|
||||||
use-global-data-source-stat: true
|
|
||||||
|
|
||||||
# 数据库
|
|
||||||
mybatis:
|
|
||||||
config-location: classpath:mybatis/mybatis-config.xml
|
|
||||||
mapper-locations: classpath*:mybatis/mapper/**/*.xml
|
|
||||||
|
|
||||||
# 文档
|
|
||||||
swagger:
|
|
||||||
base-package-list: ink.wgink,cn.com.tenlion
|
|
||||||
|
|
||||||
# 文件
|
|
||||||
file:
|
|
||||||
# 文件的保存路径
|
|
||||||
upload-path: /Users/wanggeng/Desktop/UploadFiles/
|
|
||||||
# 图片类型
|
|
||||||
image-types: png,jpg,jpeg,gif,blob
|
|
||||||
# 视频类型
|
|
||||||
video-types: mp4,rmvb
|
|
||||||
# 音频类型
|
|
||||||
audio-types: mp3,wmv,amr
|
|
||||||
# 文件类型
|
|
||||||
file-types: doc,docx,xls,xlsx,ppt,pptx,txt,zip,rar,apk,pdf
|
|
||||||
# 同时上传最大支持数
|
|
||||||
max-file-count: 6
|
|
||||||
# 图片输出压缩质量,大于0,默认0.4
|
|
||||||
image-output-quality: 0.4
|
|
||||||
# 媒体最大时长(单位:秒)
|
|
||||||
media-max-duration:
|
|
||||||
# 后台
|
|
||||||
backend:
|
|
||||||
video: 10
|
|
||||||
audio: 60
|
|
||||||
# 微信
|
|
||||||
wechat:
|
|
||||||
video: 10
|
|
||||||
audio: 60
|
|
||||||
# app
|
|
||||||
app:
|
|
||||||
video: 10
|
|
||||||
audio: 60
|
|
||||||
|
|
||||||
# 日志
|
|
||||||
logging:
|
|
||||||
file:
|
|
||||||
name: /projects/logs/e/systemstudy-logs.log
|
|
||||||
level:
|
|
||||||
root: error
|
|
||||||
ink.wgink: debug
|
|
||||||
cn.com.tenlion: debug
|
|
@ -712,6 +712,12 @@
|
|||||||
<if test="applyWorkTypeId != null and applyWorkTypeId != ''">
|
<if test="applyWorkTypeId != null and applyWorkTypeId != ''">
|
||||||
AND t1.apply_work_type_id = #{applyWorkTypeId}
|
AND t1.apply_work_type_id = #{applyWorkTypeId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="applyWorkTypeIds != null and applyWorkTypeIds.size > 0">
|
||||||
|
AND t1.apply_work_type_id IN
|
||||||
|
<foreach collection="applyWorkTypeIds" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
<if test="creator != null and creator != ''">
|
<if test="creator != null and creator != ''">
|
||||||
AND t1.creator = #{creator}
|
AND t1.creator = #{creator}
|
||||||
</if>
|
</if>
|
||||||
@ -840,4 +846,17 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="listApplyInstitutionNameByCreator" parameterType="java.lang.String" resultType="java.lang.String">
|
||||||
|
SELECT
|
||||||
|
mi.institution_name
|
||||||
|
FROM
|
||||||
|
e_apply ea
|
||||||
|
INNER JOIN
|
||||||
|
m_institution mi
|
||||||
|
ON
|
||||||
|
ea.apply_institution_id = mi.institution_id
|
||||||
|
WHERE
|
||||||
|
ea.creator = #{_parameter}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -75,6 +75,25 @@
|
|||||||
$('#add-apply-user').show();
|
$('#add-apply-user').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setColumnColor(age, maxAge, rowData) {
|
||||||
|
if(age === -1) {
|
||||||
|
return rowData;
|
||||||
|
}
|
||||||
|
if(maxAge === -1) {
|
||||||
|
return rowData;
|
||||||
|
}
|
||||||
|
if(maxAge - age <= 1) {
|
||||||
|
return `<div style="color: #FFFFFF; background-color: #FF0000; font-weight: bold; border-radius: 15px;">${rowData}</div>`;
|
||||||
|
}
|
||||||
|
if(maxAge - age <= 2) {
|
||||||
|
return `<div style="background-color: #FFFF00; font-weight: bold; border-radius: 15px;">${rowData}</div>`;
|
||||||
|
}
|
||||||
|
if(maxAge - age <= 3) {
|
||||||
|
return `<div style="background-color: #00FF00; font-weight: bold; border-radius: 15px;">${rowData}</div>`;
|
||||||
|
}
|
||||||
|
return rowData;
|
||||||
|
}
|
||||||
|
|
||||||
// 初始化表格
|
// 初始化表格
|
||||||
function initTable() {
|
function initTable() {
|
||||||
table.render({
|
table.render({
|
||||||
@ -106,8 +125,8 @@
|
|||||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||||
return '-';
|
return '-';
|
||||||
}
|
}
|
||||||
return rowData;
|
return setColumnColor(row.age, row.maxAge, rowData);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{field: 'applyCardNumber', width: 180, title: '证件号码', align:'center',
|
{field: 'applyCardNumber', width: 180, title: '证件号码', align:'center',
|
||||||
templet: function(row) {
|
templet: function(row) {
|
||||||
@ -115,8 +134,8 @@
|
|||||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||||
return '-';
|
return '-';
|
||||||
}
|
}
|
||||||
return rowData;
|
return setColumnColor(row.age, row.maxAge, rowData);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{field: 'applyPhone', width: 140, title: '联系方式', align:'center',
|
{field: 'applyPhone', width: 140, title: '联系方式', align:'center',
|
||||||
templet: function(row) {
|
templet: function(row) {
|
||||||
@ -124,8 +143,8 @@
|
|||||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||||
return '-';
|
return '-';
|
||||||
}
|
}
|
||||||
return rowData;
|
return setColumnColor(row.age, row.maxAge, rowData);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{field: 'applyWorkTypeName', width: 140, title: '准操项目', align:'center',
|
{field: 'applyWorkTypeName', width: 140, title: '准操项目', align:'center',
|
||||||
templet: function(row) {
|
templet: function(row) {
|
||||||
@ -134,7 +153,7 @@
|
|||||||
return '-';
|
return '-';
|
||||||
}
|
}
|
||||||
return rowData;
|
return rowData;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{field: 'applyFenLei', width: 120, title: '初训复训', align:'center',
|
{field: 'applyFenLei', width: 120, title: '初训复训', align:'center',
|
||||||
templet: function(row) {
|
templet: function(row) {
|
||||||
@ -149,7 +168,7 @@
|
|||||||
return '<span style="color: #9900a6">换证</span>';
|
return '<span style="color: #9900a6">换证</span>';
|
||||||
}
|
}
|
||||||
return '-';
|
return '-';
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{field: 'examScore', width: 100, title: '知识成绩', align:'center',
|
{field: 'examScore', width: 100, title: '知识成绩', align:'center',
|
||||||
templet: function(row) {
|
templet: function(row) {
|
||||||
@ -158,7 +177,7 @@
|
|||||||
return '-';
|
return '-';
|
||||||
}
|
}
|
||||||
return rowData + '分';
|
return rowData + '分';
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{field: 'examScoreHandsOn', width: 100, title: '实操成绩', align:'center',
|
{field: 'examScoreHandsOn', width: 100, title: '实操成绩', align:'center',
|
||||||
templet: function(row) {
|
templet: function(row) {
|
||||||
@ -167,14 +186,14 @@
|
|||||||
return '-';
|
return '-';
|
||||||
}
|
}
|
||||||
return rowData + '分';
|
return rowData + '分';
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{field: 'cz', width: 180, title: '操作', align:'center', fixed: 'right',
|
{field: 'cz', width: 140, title: '操作', align:'center', fixed: 'right',
|
||||||
templet: function(row) {
|
templet: function(row) {
|
||||||
var rowData ='<button type="button" class="layui-btn layui-btn-xs" lay-event="show">详情</button>';
|
var rowData ='<button type="button" class="layui-btn layui-btn-xs" lay-event="show">详情</button>';
|
||||||
rowData +='<button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="archivesEvent">存档表</button>'
|
rowData +='<button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="archivesEvent">存档表</button>'
|
||||||
return rowData;
|
return rowData;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@ -266,10 +285,12 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var url = '';
|
var url = '';
|
||||||
if(parentWorkType == '530279c5-32a9-44db-bbf0-a04ef1cdae66'){
|
if(parentWorkType == '530279c5-32a9-44db-bbf0-a04ef1cdae66') {
|
||||||
url = top.restAjax.path('route/classplan/save-user-register2.html?orgId={arg}&workerCatalog={arg1}', [orgId,workerCatalog]);
|
// 企业负责人及安全管理人员
|
||||||
|
url = top.restAjax.path('route/classplan/save-user-register2.html?orgId={arg}&workerCatalog={arg1}', [orgId, workerCatalog]);
|
||||||
} else {
|
} else {
|
||||||
url = top.restAjax.path('route/classplan/save-user-register1.html?orgId={arg}&workerCatalog={arg1}', [orgId,workerCatalog]);
|
// 特种作业
|
||||||
|
url = top.restAjax.path('route/classplan/save-user-register1.html?orgId={arg}&workerCatalog={arg1}', [orgId, workerCatalog]);
|
||||||
}
|
}
|
||||||
parent.layer.open({
|
parent.layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
|
@ -394,8 +394,9 @@
|
|||||||
var laytpl = layui.laytpl;
|
var laytpl = layui.laytpl;
|
||||||
var laydate = layui.laydate;
|
var laydate = layui.laydate;
|
||||||
var viewerObj = {};
|
var viewerObj = {};
|
||||||
var orgId = top.restAjax.params(window.location.href).orgId;
|
var queryParams = top.restAjax.params(window.location.href);
|
||||||
var workerCatalog = top.restAjax.params(window.location.href).workerCatalog;
|
var orgId = queryParams.orgId;
|
||||||
|
var workerCatalog = queryParams.workerCatalog;
|
||||||
|
|
||||||
$('.layui-card').height($(window).height());
|
$('.layui-card').height($(window).height());
|
||||||
|
|
||||||
@ -879,6 +880,7 @@
|
|||||||
form.on('submit(submitForm)', function(formData) {
|
form.on('submit(submitForm)', function(formData) {
|
||||||
formData.field.applyWorkTypeId = workerCatalog;
|
formData.field.applyWorkTypeId = workerCatalog;
|
||||||
formData.field.applyInstitutionId = orgId;
|
formData.field.applyInstitutionId = orgId;
|
||||||
|
formData.field.workType = true;
|
||||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||||
top.dialog.close(index);
|
top.dialog.close(index);
|
||||||
var loadLayerIndex;
|
var loadLayerIndex;
|
||||||
|
@ -926,6 +926,7 @@
|
|||||||
form.on('submit(submitForm)', function(formData) {
|
form.on('submit(submitForm)', function(formData) {
|
||||||
formData.field.applyWorkTypeId = workerCatalog;
|
formData.field.applyWorkTypeId = workerCatalog;
|
||||||
formData.field.applyInstitutionId = orgId;
|
formData.field.applyInstitutionId = orgId;
|
||||||
|
formData.field.workType = false;
|
||||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||||
top.dialog.close(index);
|
top.dialog.close(index);
|
||||||
var loadLayerIndex;
|
var loadLayerIndex;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<label class="layui-form-label"><span style="color: red">*</span>班号</label>
|
<label class="layui-form-label"><span style="color: red">*</span>班号</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" id="planNumber" name="planNumber" class="layui-input" value=""
|
<input type="text" id="planNumber" name="planNumber" class="layui-input" value=""
|
||||||
autocomplete="off" placeholder="班号不可重复" lay-verify="required" maxlength="100" readonly="readonly">
|
autocomplete="off" placeholder="班号不可重复" lay-verify="required" maxlength="100">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -236,7 +236,7 @@
|
|||||||
return chargePerson + '(' + chargePhone + ')';
|
return chargePerson + '(' + chargePhone + ')';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{field: 'checkStatus', width: 150, title: '当前状态', align:'center',fixed: 'right',
|
{field: 'checkStatus', width: 150, title: '当前状态', align:'center',
|
||||||
templet: function(row) {
|
templet: function(row) {
|
||||||
var rowData = row[this.field];
|
var rowData = row[this.field];
|
||||||
var point = row['point'];
|
var point = row['point'];
|
||||||
@ -255,7 +255,7 @@
|
|||||||
return rowData + '[ ' + point + ' ]';
|
return rowData + '[ ' + point + ' ]';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{field: 'teacher', fixed: 'right', width: 250, title: '操作按钮', align:'left',
|
{field: 'teacher', fixed: 'right', width: 270, title: '操作按钮', align:'left',
|
||||||
templet: function(row) {
|
templet: function(row) {
|
||||||
var rowData = '';
|
var rowData = '';
|
||||||
rowData += '<div class="layui-btn-group">'
|
rowData += '<div class="layui-btn-group">'
|
||||||
|
Loading…
Reference in New Issue
Block a user