增加报名年龄限制、离退休颜色标记

This commit is contained in:
TS-QD1 2023-03-08 15:21:50 +08:00
parent cdc22399c4
commit 1ba98952ac
14 changed files with 424 additions and 288 deletions

View 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";
}

View File

@ -1,6 +1,7 @@
package cn.com.tenlion.controller.api.apply;
import cn.com.tenlion.pojo.vos.apply.ApplyAuditVO;
import cn.com.tenlion.util.SignUpUtil;
import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.interfaces.consts.ISystemConstant;
@ -38,37 +39,28 @@ public class ApplyController extends DefaultBaseController {
@ApiOperation(value = "报名信息报道", notes = "报名信息报道接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),
})
@ApiImplicitParams({@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("updateInstitutionId/{targetId}")
@CheckRequestBodyAnnotation
public SuccessResult updateInstitutionId(@PathVariable("targetId") String targetId,
@RequestBody Map<String, Object> params) {
public SuccessResult updateInstitutionId(@PathVariable("targetId") String targetId, @RequestBody Map<String, Object> params) {
String sourceIds = params.get("sourceIds").toString();
applyService.updateInstitutionId(targetId, Arrays.asList(sourceIds.split(",")));
return new SuccessResult();
}
@ApiOperation(value = "自定义新增报名信息", notes = "自定义新增报名信息")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("save-relation")
@CheckRequestBodyAnnotation
public SuccessResult saveRelation(@RequestBody ApplyVO applyVO) {
SignUpUtil.checkIdCardAge(applyVO.getApplyLeiBie(), applyVO.getApplyCardNumber());
applyService.saveRelationReturnId(applyVO);
return new SuccessResult();
}
@ApiOperation(value = "报名信息撤回", notes = "报名信息撤回接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),
})
@ApiImplicitParams({@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("updateAuditStateRecall/{applyId}")
@CheckRequestBodyAnnotation
@ -81,11 +73,8 @@ public class ApplyController extends DefaultBaseController {
return new SuccessResult();
}
@ApiOperation(value = "报名信息报道", notes = "报名信息报道接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),
})
@ApiImplicitParams({@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("updateAuditStateReport/{applyId}")
@CheckRequestBodyAnnotation
@ -100,9 +89,7 @@ public class ApplyController extends DefaultBaseController {
@ApiOperation(value = "报名信息审核", notes = "报名信息审核接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),
})
@ApiImplicitParams({@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("updateAuditStateAudit")
@CheckRequestBodyAnnotation
@ -122,9 +109,7 @@ public class ApplyController extends DefaultBaseController {
}
@ApiOperation(value = "删除报名信息", notes = "删除报名信息接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "ids", value = "ID列表用下划线分隔", paramType = "path", example = "1_2_3")
})
@ApiImplicitParams({@ApiImplicitParam(name = "ids", value = "ID列表用下划线分隔", paramType = "path", example = "1_2_3")})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@DeleteMapping("remove/{ids}")
public SuccessResult remove(@PathVariable("ids") String ids) {
@ -133,9 +118,7 @@ public class ApplyController extends DefaultBaseController {
}
@ApiOperation(value = "修改报名信息", notes = "修改报名信息接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path")
})
@ApiImplicitParams({@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path")})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update/{applyId}")
@CheckRequestBodyAnnotation
@ -148,14 +131,13 @@ public class ApplyController extends DefaultBaseController {
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update-user-register/{applyId}")
public SuccessResult updateUserRegister(@PathVariable("applyId") String applyId, @RequestBody ApplyVO applyVO) {
SignUpUtil.checkIdCardAge(applyVO.getApplyLeiBie(), applyVO.getApplyCardNumber());
applyService.updateUserRegister(applyId, applyVO);
return new SuccessResult();
}
@ApiOperation(value = "报名信息详情", notes = "报名信息详情接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path")
})
@ApiImplicitParams({@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path")})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("get/{applyId}")
public ApplyDTO get(@PathVariable("applyId") String applyId) {
@ -171,13 +153,7 @@ public class ApplyController extends DefaultBaseController {
}
@ApiOperation(value = "报名信息分页列表", notes = "报名信息分页列表接口")
@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")
})
@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")})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listpage")
public SuccessResultList<List<ApplyDTO>> listPage(ListPage page) {

View File

@ -58,7 +58,6 @@ public class ApplyStudentsController extends DefaultBaseController {
}
@ApiOperation(value = "新增班级学生表", notes = "新增班级学生表接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("save")
@ -69,9 +68,7 @@ public class ApplyStudentsController extends DefaultBaseController {
}
@ApiOperation(value = "删除班级学生表", notes = "删除班级学生表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "ids", value = "ID列表用下划线分隔", paramType = "path", example = "1_2_3")
})
@ApiImplicitParams({@ApiImplicitParam(name = "ids", value = "ID列表用下划线分隔", paramType = "path", example = "1_2_3")})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@DeleteMapping("remove/{ids}")
public SuccessResult remove(@PathVariable("ids") String ids) {
@ -80,9 +77,7 @@ public class ApplyStudentsController extends DefaultBaseController {
}
@ApiOperation(value = "修改班级学生表", notes = "修改班级学生表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "applyStudentsId", value = "班级学生表ID", paramType = "path")
})
@ApiImplicitParams({@ApiImplicitParam(name = "applyStudentsId", value = "班级学生表ID", paramType = "path")})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update/{applyStudentsId}")
@CheckRequestBodyAnnotation
@ -92,9 +87,7 @@ public class ApplyStudentsController extends DefaultBaseController {
}
@ApiOperation(value = "班级学生表详情", notes = "班级学生表详情接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "applyStudentsId", value = "班级学生表ID", paramType = "path")
})
@ApiImplicitParams({@ApiImplicitParam(name = "applyStudentsId", value = "班级学生表ID", paramType = "path")})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("get/{applyStudentsId}")
public ApplyStudentsDTO get(@PathVariable("applyStudentsId") String applyStudentsId) {
@ -116,13 +109,7 @@ public class ApplyStudentsController extends DefaultBaseController {
}
@ApiOperation(value = "班级学生表分页列表", notes = "班级学生表分页列表接口")
@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")
})
@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")})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listpage")
public SuccessResultList<List<ApplyStudentsDTO>> listPage(ListPage page) {

View File

@ -158,4 +158,10 @@ public class ApplyDTO {
private String modifier;
@ApiModelProperty(name = "gmtModified", value = "修改时间")
private String gmtModified;
@ApiModelProperty(name = "age", value = "年龄")
private Integer age;
@ApiModelProperty(name = "maxAge", value = "年龄")
private Integer maxAge;
}

View File

@ -157,6 +157,10 @@ public class ApplyStudentsDTO {
private ClassPlanDTO classPlanDTO;
@ApiModelProperty(name = "joinExam", value = "是否参加考试")
private String joinExam;
@ApiModelProperty(name = "age", value = "年龄")
private Integer age;
@ApiModelProperty(name = "maxAge", value = "年龄")
private Integer maxAge;
public String getApplyInstitutionId() {
return applyInstitutionId == null ? "" : applyInstitutionId;
@ -685,4 +689,20 @@ public class ApplyStudentsDTO {
public void setJoinExam(String 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;
}
}

View File

@ -104,6 +104,8 @@ public class ApplyVO {
private String idCardBackPhoto;
@ApiModelProperty(name = "educationPhoto", value = "学历证书")
private String educationPhoto;
@ApiModelProperty(name = "isTzzy", value = "是否特种作业")
private Boolean isTzzy;
public String getApplyInstitutionId() {
return applyInstitutionId;
@ -448,4 +450,12 @@ public class ApplyVO {
public void setExamScoreHandsOn(String examScoreHandsOn) {
this.examScoreHandsOn = examScoreHandsOn;
}
public Boolean getTzzy() {
return isTzzy;
}
public void setTzzy(Boolean tzzy) {
isTzzy = tzzy;
}
}

View File

@ -28,6 +28,8 @@ import cn.com.tenlion.service.traininginstitutionserviceuser.ITrainingInstitutio
import cn.com.tenlion.service.traininginstitutionuser.ITrainingInstitutionUserService;
import cn.com.tenlion.service.traininginstitutionworktype.ITrainingInstitutionWorkTypeService;
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.PageInfo;
import ink.wgink.common.base.DefaultBaseService;
@ -121,6 +123,7 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
/**
* 修改报名机构
*
* @param targetId 目标id
* @param sourceIds 源id
*/
@ -159,7 +162,6 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
}
@Override
public String saveRelationReturnId(ApplyVO applyVO) {
String applyId = UUIDUtil.getUUID();
@ -261,7 +263,6 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
}
public void audit(String token, ApplyAuditVO applyAuditVO) {
ApplyDTO applyDTO = this.get(applyAuditVO.getApplyId());
if (applyDTO == null) {
@ -342,8 +343,6 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
}
public SuccessResultList<List<ApplyWorkTypeInstitutionDTO>> listPageApplyWorkType(String token, ListPage page) throws Exception {
AppTokenUser appTokenUser = getAppTokenUser(token);
List<ApplyWorkTypeInstitutionDTO> list = new ArrayList<>();
@ -399,10 +398,6 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
}
public List<ApplyDTO> listByClassId(String classId) {
if (StringUtils.isBlank(classId)) {
throw new SearchException("获取失败");
@ -461,12 +456,10 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
String applyInstitutionId = applyVO.getApplyInstitutionId();
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) {
throw new SaveException(applyVO.getApplyName() + "[" + applyVO.getApplyPhone() +
"]: 已报名其他培训机构,请勿重复报名");
throw new SaveException(applyVO.getApplyName() + "[" + applyVO.getApplyPhone() + "]: 已报名其他培训机构,请勿重复报名");
}
if (!examCheckService.getExamCheckFailOrBack(applyWorkTypeId, applyInstitutionId)) {
throw new SaveException("已经提交开班计划,无法在审核过程中添加学员");
@ -512,7 +505,6 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
// }
}
@ -554,8 +546,6 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
}
@Override
public void remove(List<String> ids) {
remove(null, ids);
@ -685,8 +675,7 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
@Override
public SuccessResultList<List<ApplyDTO>> listPage(ListPage page) {
if(page.getParams().get("applyInstitutionId") == null
|| "".equals(page.getParams().get("applyInstitutionId").toString())){
if (page.getParams().get("applyInstitutionId") == null || "".equals(page.getParams().get("applyInstitutionId").toString())) {
throw new SearchException("机构信息丢失,无法查看人员列表");
}
PageHelper.startPage(page.getPage(), page.getRows());
@ -698,6 +687,12 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
WorkTypeDTO workTypeDTO = workTypeService.get(item.getApplyWorkTypeId());
item.setApplyParentWorkTypeId(workTypeDTO.getWorkTypeParentId());
item.setApplyParentWorkTypeName(workTypeDTO.getWorkTypeParentName());
item.setMaxAge(SignUpUtil.getMaxAge(item.getApplyLeiBie(), item.getApplyCardNumber()));
if (IdCardVerifyUtil.isIDCard(item.getApplyCardNumber())) {
item.setAge(IdCardVerifyUtil.getIdCardAge(item.getApplyCardNumber()));
} else {
item.setAge(-1);
}
}
PageInfo<ApplyDTO> pageInfo = new PageInfo<>(applyDTOs);
return new SuccessResultList<>(applyDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
@ -759,6 +754,7 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
params.put("applyAuditStates", applyAuditStates);
return count(params);
}
/**
* 检查当前报名人的工种和培训机构是否唯一不包括审核未通过撤回状态
*/
@ -800,6 +796,7 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
/**
* 给学历证书添加签名水印
*
* @param dto
* @return String 返回添加完成水印的fileId 如果出错返回 null
*/
@ -812,13 +809,11 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
File originFile = new File(originPO.getFilePath());
// 原图
Image srcImg = ImageIO.read(originFile);
BufferedImage buffImg = new BufferedImage(srcImg.getWidth(null),
srcImg.getHeight(null), BufferedImage.TYPE_INT_RGB);
BufferedImage buffImg = new BufferedImage(srcImg.getWidth(null), srcImg.getHeight(null), BufferedImage.TYPE_INT_RGB);
Graphics2D graphics = buffImg.createGraphics();
graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
graphics.drawImage(srcImg.getScaledInstance(srcImg.getWidth(null),
srcImg.getHeight(null), Image.SCALE_SMOOTH), 0, 0, null);
graphics.drawImage(srcImg.getScaledInstance(srcImg.getWidth(null), srcImg.getHeight(null), Image.SCALE_SMOOTH), 0, 0, null);
int srcWidth = srcImg.getWidth(null);
int srcHeight = srcImg.getHeight(null);
// 水印
@ -873,6 +868,7 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
/**
* 统计培训机构全部计划报名人数
*
* @param applyInstitutionId 机构ID
* @param applyAuditStates 机构状态
* @return

View File

@ -17,6 +17,8 @@ import cn.com.tenlion.service.applystudentsnew.IApplyStudentsNewService;
import cn.com.tenlion.service.classplan.IClassPlanService;
import cn.com.tenlion.service.examapply.IExamApplyService;
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.PageInfo;
import ink.wgink.common.base.DefaultBaseService;
@ -271,6 +273,12 @@ public class ApplyStudentsServiceImpl extends DefaultBaseService implements IApp
Iterator<ApplyStudentsDTO> applyStudentsDTOIterator = list.iterator();
while (applyStudentsDTOIterator.hasNext()) {
ApplyStudentsDTO applyStudentsDTO = applyStudentsDTOIterator.next();
applyStudentsDTO.setMaxAge(SignUpUtil.getMaxAge(applyStudentsDTO.getApplyLeiBie(), applyStudentsDTO.getApplyCardNumber()));
if (IdCardVerifyUtil.isIDCard(applyStudentsDTO.getApplyCardNumber())) {
applyStudentsDTO.setAge(IdCardVerifyUtil.getIdCardAge(applyStudentsDTO.getApplyCardNumber()));
} else {
applyStudentsDTO.setAge(-1);
}
if(null != searchClassPlanDto) {
if(!searchClassPlanDto.getClassPlanId().equals(applyStudentsDTO.getApplyClassId())) {
applyStudentsDTOIterator.remove();
@ -344,4 +352,8 @@ public class ApplyStudentsServiceImpl extends DefaultBaseService implements IApp
return count == null ? 0 : count;
}
private void setMarkAge(List<ApplyStudentsDTO> applyStudentsDTOS) {
}
}

View File

@ -1,5 +1,14 @@
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.Years;
import org.joda.time.format.DateTimeFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@ -9,11 +18,13 @@ import java.util.Map;
/**
* 1518位身份证号验证工具类
*
* @author renpc
*/
public class IdCardVerifyUtil {
final static Map<Integer, String> zoneNum = new HashMap<Integer, String>();
static {
zoneNum.put(11, "北京");
zoneNum.put(12, "天津");
@ -60,6 +71,7 @@ public class IdCardVerifyUtil {
/**
* 身份证验证
*
* @param certNo 号码内容
* @return 是否有效 null和"" 都是false
*/
@ -137,6 +149,7 @@ public class IdCardVerifyUtil {
/**
* 获取身份证号中的出生日期
*
* @param cardNo 身份证号
* @return xxxx-xx-xx
*/
@ -158,16 +171,27 @@ public class IdCardVerifyUtil {
sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(date);
}
} catch (Exception e){}
return "";
} catch (Exception e) {
throw new SystemException(e);
}
throw new SystemException("身份证格式异常");
}
public static Integer getIdCardAge(String cardNo) {
String birthday = getIdCardBirthday(cardNo);
DateTime nowDateTime = DateTime.now();
DateTime birthdayDateTime = DateTime.parse(birthday, DateTimeFormat.forPattern(ISystemConstant.DATE_FORMATTER_YYYY_MM_DD));
return Years.yearsBetween(birthdayDateTime, nowDateTime).getYears();
}
/**
* 获取身份证号中的性别
*
* @param cardNo
* @return -1 无法获取 1男性0女性
*/
public static String getIdCardGender(String cardNo) {
try {
if (cardNo == null || cardNo.length() == 0) {
return "-1";
@ -190,14 +214,9 @@ public class IdCardVerifyUtil {
return "1";
}
}
} catch (Exception e){}
} catch (Exception e) {
}
return "-1";
}
public static void main(String[] args) {
boolean isTrue = isIDCard("612701198410267049");
System.out.println(isTrue);
System.out.println(getIdCardGender("152822199310146919"));
}
}

View 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.isIDCard(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.isIDCard(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);
}
}
}

View File

@ -75,6 +75,25 @@
$('#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() {
table.render({
@ -106,8 +125,8 @@
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
return setColumnColor(row.age, row.maxAge, rowData);
},
},
{field: 'applyCardNumber', width: 180, title: '证件号码', align:'center',
templet: function(row) {
@ -115,8 +134,8 @@
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
return setColumnColor(row.age, row.maxAge, rowData);
},
},
{field: 'applyPhone', width: 140, title: '联系方式', align:'center',
templet: function(row) {
@ -124,8 +143,8 @@
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
return setColumnColor(row.age, row.maxAge, rowData);
},
},
{field: 'applyWorkTypeName', width: 140, title: '准操项目', align:'center',
templet: function(row) {
@ -134,7 +153,7 @@
return '-';
}
return rowData;
}
},
},
{field: 'applyFenLei', width: 120, title: '初训复训', align:'center',
templet: function(row) {
@ -149,7 +168,7 @@
return '<span style="color: #9900a6">换证</span>';
}
return '-';
}
},
},
{field: 'examScore', width: 100, title: '知识成绩', align:'center',
templet: function(row) {
@ -158,7 +177,7 @@
return '-';
}
return rowData + '分';
}
},
},
{field: 'examScoreHandsOn', width: 100, title: '实操成绩', align:'center',
templet: function(row) {
@ -167,14 +186,14 @@
return '-';
}
return rowData + '分';
}
},
{field: 'cz', width: 180, title: '操作', align:'center', fixed: 'right',
},
{field: 'cz', width: 140, title: '操作', align:'center', fixed: 'right',
templet: function(row) {
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>'
return rowData;
}
},
},
]
],
@ -267,8 +286,10 @@
}
var url = '';
if(parentWorkType == '530279c5-32a9-44db-bbf0-a04ef1cdae66') {
// 企业负责人及安全管理人员
url = top.restAjax.path('route/classplan/save-user-register2.html?orgId={arg}&workerCatalog={arg1}', [orgId, workerCatalog]);
} else {
// 特种作业
url = top.restAjax.path('route/classplan/save-user-register1.html?orgId={arg}&workerCatalog={arg1}', [orgId, workerCatalog]);
}
parent.layer.open({

View File

@ -394,8 +394,9 @@
var laytpl = layui.laytpl;
var laydate = layui.laydate;
var viewerObj = {};
var orgId = top.restAjax.params(window.location.href).orgId;
var workerCatalog = top.restAjax.params(window.location.href).workerCatalog;
var queryParams = top.restAjax.params(window.location.href);
var orgId = queryParams.orgId;
var workerCatalog = queryParams.workerCatalog;
$('.layui-card').height($(window).height());
@ -879,6 +880,7 @@
form.on('submit(submitForm)', function(formData) {
formData.field.applyWorkTypeId = workerCatalog;
formData.field.applyInstitutionId = orgId;
formData.field.workType = true;
top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index);
var loadLayerIndex;

View File

@ -926,6 +926,7 @@
form.on('submit(submitForm)', function(formData) {
formData.field.applyWorkTypeId = workerCatalog;
formData.field.applyInstitutionId = orgId;
formData.field.workType = false;
top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index);
var loadLayerIndex;

View File

@ -236,7 +236,7 @@
return chargePerson + '(' + chargePhone + ')';
}
},
{field: 'checkStatus', width: 150, title: '当前状态', align:'center',fixed: 'right',
{field: 'checkStatus', width: 150, title: '当前状态', align:'center',
templet: function(row) {
var rowData = row[this.field];
var point = row['point'];
@ -255,7 +255,7 @@
return rowData + '[ ' + point + ' ]';
}
},
{field: 'teacher', fixed: 'right', width: 250, title: '操作按钮', align:'left',
{field: 'teacher', fixed: 'right', width: 270, title: '操作按钮', align:'left',
templet: function(row) {
var rowData = '';
rowData += '<div class="layui-btn-group">'