liujie
7 天以前 9cec8af0342306d6d3b6480e8d576d18bef58236
限制年龄
1个文件已修改
5 ■■■■■ 已修改文件
cloud-server-competition/src/main/java/com/dsh/competition/service/impl/CompetitionServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-competition/src/main/java/com/dsh/competition/service/impl/CompetitionServiceImpl.java
@@ -286,6 +286,7 @@
        paymentCompetition.setInsertTime(new Date());
        paymentCompetitionService.save(paymentCompetition);
        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy");
        for (int i = 0; i < jsonArray.size(); i++) {
            JSONObject jsonObject = jsonArray.getJSONObject(i);
            Integer id = jsonObject.getInteger("id");
@@ -296,10 +297,10 @@
            }
            if (competition.getStartAge() > (Integer.valueOf(sdf.format(new Date())) - Integer.valueOf(sdf.format(tStudent.getBirthday())))) {
            if (competition.getStartAge() > (Integer.valueOf(sdf1.format(new Date())) - Integer.valueOf(sdf1.format(tStudent.getBirthday())))) {
                return ResultUtil.error("【" + tStudent.getName() + "】年龄不符合要求");
            }
            if (competition.getEndAge() < (Integer.valueOf(sdf.format(new Date())) - Integer.valueOf(sdf.format(tStudent.getBirthday())))) {
            if (competition.getEndAge() < (Integer.valueOf(sdf1.format(new Date())) - Integer.valueOf(sdf1.format(tStudent.getBirthday())))) {
                return ResultUtil.error("【" + tStudent.getName() + "】年龄不符合要求");
            }