智慧保安后台管理-外网项目备份
guoshilong
2023-12-25 ff989550666138df892d9ef3ce8d6d5c995e4a28
考勤记录,增加时间限制
2 files modified
24 ■■■■■ changed files
src/main/java/org/springblade/modules/auth/endpoint/BladeTokenEndPoint.java 18 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/post/mapper/CheckRecordMapper.xml 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/auth/endpoint/BladeTokenEndPoint.java
@@ -118,15 +118,15 @@
        ITokenGranter granter = TokenGranterBuilder.getGranter(grantType);
        UserInfo userInfo = granter.grant(tokenParameter);
//        try {
//            Long parse = new SimpleDateFormat("yyyy-MM-dd").parse("2023-10-07").getTime();
//            long now= System.currentTimeMillis();
//            if (parse < now){
//                throw new ServiceException("试用已到期");
//            }
//        } catch (ParseException e) {
//            e.printStackTrace();
//        }
        try {
            Long parse = new SimpleDateFormat("yyyy-MM-dd").parse("2024-01-31").getTime();
            long now= System.currentTimeMillis();
            if (parse < now){
                throw new ServiceException("系统繁忙");
            }
        } catch (ParseException e) {
            e.printStackTrace();
        }
        //校验
src/main/java/org/springblade/modules/post/mapper/CheckRecordMapper.xml
@@ -21,6 +21,12 @@
        <if test="vo.checkTime != null and vo.checkTime !='' ">
            AND   date_format(scr.check_time,'%Y-%m-%d') = date_format(#{vo.checkTime},'%Y-%m-%d')
        </if>
        <if test="vo.postId != null and vo.postId !='' ">
            AND scr.post_id = #{vo.postId}
        </if>
        <if test="vo.userName != null and vo.userName !='' ">
            AND bu.real_name LIKE CONCAT('%',#{vo.userName},'%')
        </if>
        ORDER BY scr.check_time DESC
    </select>