| | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | int planNum = dayNum+onceNum; |
| | | //这天总兴趣点数 |
| | | int wellNum = dayWell+onceWell; |
| | | QueryWrapper<ArdAppPatrolpointRecord> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("user_id",userId).like("record_time",ymd); |
| | | List<ArdAppPatrolpointRecord> list = ardAppPatrolpointRecordMapper.selectList(queryWrapper); |
| | | //已打卡总条数 |
| | | QueryWrapper<ArdAppPatrolpointRecord> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("user_id",userId).like("record_time",ymd).isNull("del"); |
| | | List<ArdAppPatrolpointRecord> list = ardAppPatrolpointRecordMapper.selectList(queryWrapper); |
| | | int num = list.size(); |
| | | //应打卡总条数 |
| | | int record = planNum*wellNum; |
| | | if(num==record){ |
| | | if(num>=record){ |
| | | recordBoolean = true; |
| | | } |
| | | } |
| | |
| | | SysUser user = sysUserMapper.selectById(userId); |
| | | String userName = user.getNickName(); |
| | | //查询该计划的所有兴趣点 |
| | | ArdAlarmpointsWell ardAlarmpointsWell = wellMapper.selectById(wellId); |
| | | ArdAlarmpointsWell ardAlarmpointsWell = wellMapper.getWellById(wellId); |
| | | //没打卡的数据 |
| | | ArdAppPatrolpointRecord record1 = new ArdAppPatrolpointRecord(); |
| | | record1.setAppPatrolpointsId(ardAlarmpointsWell.getId()); |
| | |
| | | |
| | | @Override |
| | | public Results son() { |
| | | SimpleDateFormat dateFormatTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | //获取用户执行人 |
| | | String userId = SecurityUtils.getUserId(); |
| | | // 减少 10 秒 |
| | | LocalDateTime now = LocalDateTime.now(); // 获取当前日期时间 |
| | | LocalDateTime earlier = now.minusSeconds(10); // 减少30秒 |
| | | System.out.println("当前日期时间:" + now); |
| | | System.out.println("减少10秒后的日期时间:" + earlier); |
| | | RecordSonParam recordSonParam = new RecordSonParam(); |
| | | recordSonParam.setUserId(userId); |
| | | recordSonParam.setTime(dateFormatTime.format(now)); |
| | | recordSonParam.setBeforeTime(dateFormatTime.format(earlier)); |
| | | String n = fmt.format(now); |
| | | recordSonParam.setTime(n); |
| | | String e = fmt.format(earlier); |
| | | recordSonParam.setBeforeTime(e); |
| | | //根据姓名ID为执行人获取所有对应的计划名称 |
| | | List<ArdAppPatrolplan> list = patrolplanMapper.planUser(recordSonParam); |
| | | JSONArray jsonArray = new JSONArray(); |