| | |
| | | monthZero = String.valueOf(month); |
| | | } |
| | | JSONArray jsonArray = new JSONArray(); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | for (int i = 1; i <= day; i++) { |
| | | String di; |
| | | if(i<10){ |
| | |
| | | Boolean planBoolean = false; |
| | | //循环每一天 |
| | | String ymd = year+"-"+monthZero+"-"+di; |
| | | // Date ymdDate = dateFormat.parse(ymd); |
| | | //匹配计划时间 |
| | | String cycle = ardAppPatrolplan.getCycle(); |
| | | if(cycle.equals("day")){ |
| | | String createTime = ardAppPatrolplan.getCreateTime(); |
| | | // Date beginCreateDate = dateFormat.parse(createTime); |
| | | int d = ymd.compareTo(createTime); |
| | | String st = createTime.substring(0,10); |
| | | int d = ymd.compareTo(st); |
| | | if(d>=0){ |
| | | planBoolean = true; |
| | | } |
| | |
| | | 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; |
| | | if(planBoolean){ |
| | | for (int j = 0; j < list.size(); j++) { |
| | | //打卡时间拆分 |
| | | String recordTime = list.get(j).getRecordTime(); |
| | | String[] part = recordTime.split("[-\\s:]"); |
| | | int recordYear = Integer.parseInt(part[0]); |
| | | int recordMonth = Integer.parseInt(part[1]); |
| | | String recordMonthZero; |
| | | if(recordMonth<10){ |
| | | recordMonthZero = String.format("%02d", recordMonth); |
| | | }else { |
| | | recordMonthZero = String.valueOf(recordMonth); |
| | | } |
| | | int recordDay = Integer.parseInt(part[2]); |
| | | String recordDayZero; |
| | | if(recordDay<10){ |
| | | recordDayZero = String.format("%02d", recordDay); |
| | | }else { |
| | | recordDayZero = String.valueOf(recordDay); |
| | | } |
| | | String recordDate = recordYear+"-"+recordMonthZero+"-"+recordDayZero; |
| | | //如果相等说明这天有打卡记录记录 |
| | | if(ymd.equals(recordDate)){ |
| | | or = true; |
| | | break; |
| | | } |
| | | //查询该计划的所有兴趣点 |
| | | List<ArdAlarmpointsWell> wellList = wellMapper.wellByPlanId(planId); |
| | | //查询该计划的所有执行人 |
| | | List<SysUser> userList = sysUserMapper.userByPlanId(planId); |
| | | //满勤多少条打卡记录 |
| | | int maxNum = wellList.size()*userList.size(); |
| | | //对比应打卡记录相等则true |
| | | if(list.size()==maxNum){ |
| | | or = true; |
| | | } |
| | | // for (int j = 0; j < list.size(); j++) { |
| | | // //打卡时间拆分 |
| | | // String recordTime = list.get(j).getRecordTime(); |
| | | // String[] part = recordTime.split("[-\\s:]"); |
| | | // int recordYear = Integer.parseInt(part[0]); |
| | | // int recordMonth = Integer.parseInt(part[1]); |
| | | // String recordMonthZero; |
| | | // if(recordMonth<10){ |
| | | // recordMonthZero = String.format("%02d", recordMonth); |
| | | // }else { |
| | | // recordMonthZero = String.valueOf(recordMonth); |
| | | // } |
| | | // int recordDay = Integer.parseInt(part[2]); |
| | | // String recordDayZero; |
| | | // if(recordDay<10){ |
| | | // recordDayZero = String.format("%02d", recordDay); |
| | | // }else { |
| | | // recordDayZero = String.valueOf(recordDay); |
| | | // } |
| | | // String recordDate = recordYear+"-"+recordMonthZero+"-"+recordDayZero; |
| | | // //如果相等说明这天有打卡记录记录 |
| | | // if(ymd.equals(recordDate)){ |
| | | // or = true; |
| | | // break; |
| | | // } |
| | | // } |
| | | } |
| | | jsonObject.put("toDay",ymd ); |
| | | jsonObject.put("plan",planBoolean); |
| | |
| | | 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++) { |