Administrator
2023-08-19 b495b133520e49f583a3e03f880d528e13d77117
ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java
@@ -137,14 +137,16 @@
                }
            }else if(cycle.equals("once")){
                String onceBegin = ardAppPatrolplan.getPatroBeginTime();
//                Date onceBeginDate = dateFormat.parse(onceBegin);
                String onceEnd = ardAppPatrolplan.getPatroEndTime();
//                Date onceEndDate = dateFormat.parse(onceEnd);
                int bd = ymd.compareTo(onceBegin);
                int ed = ymd.compareTo(onceEnd);
                if(bd>=0 && ed<=0){
                String onceT = onceBegin.substring(0,10);
                int num = ymd.compareTo(onceT);
                if(num==0){
                    planBoolean = true;
                }
//                Date onceBeginDate = dateFormat.parse(onceBegin);
//                String onceEnd = ardAppPatrolplan.getPatroEndTime();
//                Date onceEndDate = dateFormat.parse(onceEnd);
//                int bd = ymd.compareTo(onceBegin);
//                int ed = ymd.compareTo(onceEnd);
            }
            //匹配打卡时间
            Boolean or = false;
@@ -187,7 +189,7 @@
    @Override
    public Results recordDetails(RecordDetailsParam recordDetailsParam) throws ParseException {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        SimpleDateFormat dateFormatTime = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        SimpleDateFormat dateFormatTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        //获取参数
        String planId = recordDetailsParam.getPlanId();
        String toDay = recordDetailsParam.getToDay();
@@ -238,10 +240,21 @@
                    //小于0是历史
                    recordQueryWrapper.select("max(points_num) pointsNum","user_id","user_name").eq("plan_id", planId).like("record_time", toDay).groupBy("user_id","user_name");
                }else{
                    String u = dateFormatTime.format(new Date());
                    //等于0选中的日期就是今天,需要进一步判断小于当前时分秒的记录
                    recordQueryWrapper.select("max(points_num) pointsNum","user_id","user_name").eq("plan_id", planId).le("record_time", dateFormatTime.format(new Date())).groupBy("user_id","user_name");;
                    recordQueryWrapper.select("max(points_num) pointsNum","user_id","user_name").eq("plan_id", planId).le("record_time", u).groupBy("user_id","user_name");
                }
                List<ArdAppPatrolpointRecord> list = ardAppPatrolpointRecordMapper.selectList(recordQueryWrapper);
//                List<ArdAppPatrolpointRecord> list = new ArrayList<>();
//                RecordDetailsParam detailsParam = new RecordDetailsParam();
//                detailsParam.setPlanId(planId);
//                if(d<0){
//                    detailsParam.setToDay(toDay);
//                    list = ardAppPatrolpointRecordMapper.lt(detailsParam);
//                }else {
//                    detailsParam.setToDay(dateFormatTime.format(new Date()));
//                    list = ardAppPatrolpointRecordMapper.es(detailsParam);
//                }
                //选中这天该计划下没有任何打卡记录
                if(list.size()==0){
                    for (int i = 0; i < users.size(); i++) {