| | |
| | | .eq("user_id",ardAppPatrolpointRecord.getUserId()); |
| | | List<ArdAppPatrolpointRecord> recordList = ardAppPatrolpointRecordMapper.selectList(recordQueryWrapper); |
| | | ardAppPatrolpointRecord.setPointsNum(recordList.size()+1); |
| | | int num = ardAppPatrolpointRecordMapper.insert(ardAppPatrolpointRecord); |
| | | // int num = ardAppPatrolpointRecordMapper.insert(ardAppPatrolpointRecord); |
| | | int num = ardAppPatrolpointRecordMapper.insertArdAppPatrolpointRecord(ardAppPatrolpointRecord); |
| | | List<String> list = ardAppPatrolpointRecord.getImg(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | ArdAppPatrolpointRecordImg recordImg = new ArdAppPatrolpointRecordImg(); |
| | |
| | | recordImg.setId(imgId); |
| | | recordImg.setAppPatrolponitRecordId(id); |
| | | recordImg.setImg(list.get(i)); |
| | | recordImgMapper.insert(recordImg); |
| | | recordImgMapper.insertArdAppPatrolpointRecordImg(recordImg); |
| | | } |
| | | if(num>0){ |
| | | return Results.succeed("打卡成功!"); |
| | |
| | | } |
| | | return Results.succeed(jsonArray); |
| | | } |
| | | |
| | | @Override |
| | | public Results recordBefore(RecordBeforeParam recordBeforeParam) { |
| | | String planId = recordBeforeParam.getPlanId(); |
| | | String wellId = recordBeforeParam.getWellId(); |
| | | String toDay = recordBeforeParam.getToDay(); |
| | | String userId = SecurityUtils.getUserId(); |
| | | JSONArray jsonArray = new JSONArray(); |
| | | ArdAppPatrolplan plan = patrolplanMapper.selectById(planId); |
| | | jsonArray.add(plan); |
| | | QueryWrapper<ArdAppPatrolpointRecord> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("plan_id",planId).eq("app_patrolpoints_id",wellId).eq("user_id",userId).like("record_time",toDay); |
| | | ArdAppPatrolpointRecord record = ardAppPatrolpointRecordMapper.selectOne(queryWrapper); |
| | | //根据姓名ID查询计划制定人的姓名 |
| | | String planUserId = plan.getUserId(); |
| | | SysUser sysUser = sysUserMapper.selectById(planUserId); |
| | | String nikeName = sysUser.getNickName(); |
| | | if(record==null){ |
| | | //根据姓名ID查询执行人姓名 |
| | | SysUser user = sysUserMapper.selectById(userId); |
| | | String userName = user.getNickName(); |
| | | //查询该计划的所有兴趣点 |
| | | ArdAlarmpointsWell ardAlarmpointsWell = wellMapper.selectById(wellId); |
| | | //没打卡的数据 |
| | | ArdAppPatrolpointRecord record1 = new ArdAppPatrolpointRecord(); |
| | | record1.setAppPatrolpointsId(ardAlarmpointsWell.getId()); |
| | | record1.setAppPatrolpointsName(ardAlarmpointsWell.getWellId()); |
| | | record1.setPlanId(planId); |
| | | record1.setPlanName(plan.getPlanName()); |
| | | record1.setUserId(userId); |
| | | record1.setUserName(userName); |
| | | record1.setLatitude(String.valueOf(ardAlarmpointsWell.getLatitude())); |
| | | record1.setLongitude(String.valueOf(ardAlarmpointsWell.getLongitude().toString())); |
| | | record1.setPlanUserName(nikeName); |
| | | jsonArray.add(record1); |
| | | }else { |
| | | jsonArray.add(record); |
| | | } |
| | | return Results.succeed(jsonArray); |
| | | } |
| | | |
| | | @Override |
| | | public Results son() { |
| | | |
| | | return null; |
| | | } |
| | | } |