‘liusuyi’
2023-08-14 e94cb6da040c03cbb33d96c0fb438c76bc20c6ac
ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java
@@ -359,4 +359,55 @@
        }
    }
    @Override
    public Results recordSolo(ArdAppPatrolpointRecordParam ardAppPatrolpointRecordParam) {
        String toDay = ardAppPatrolpointRecordParam.getToDay();
        String planId = ardAppPatrolpointRecordParam.getPlanId();
        String userId = ardAppPatrolpointRecordParam.getUserId();
        String planName = ardAppPatrolpointRecordParam.getPlanName();
        String userName = ardAppPatrolpointRecordParam.getUserName();
        QueryWrapper<ArdAppPatrolpointRecord> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("plan_id", planId).eq("user_id",userId).like("record_time", toDay);
        //当前计划选中时间里此用户的打卡记录
        List<ArdAppPatrolpointRecord> list = ardAppPatrolpointRecordMapper.selectList(queryWrapper);
        if(list.size()==0){
        }
        for (ArdAppPatrolpointRecord appPatrolpointRecord : list) {
            QueryWrapper<ArdAppPatrolpointRecordImg> queryWrapper1 = new QueryWrapper<>();
            queryWrapper1.eq("app_patrolponit_record_id", appPatrolpointRecord.getId());
            List<ArdAppPatrolpointRecordImg> list1 = recordImgMapper.selectList(queryWrapper1);
            List<String> strings = new ArrayList<>();
            for (ArdAppPatrolpointRecordImg ardAppPatrolpointRecordImg : list1) {
                strings.add(ardAppPatrolpointRecordImg.getImg());
            }
            appPatrolpointRecord.setImg(strings);
        }
        //打过卡的地点
        List<String> pointList = new ArrayList<>();
        for (ArdAppPatrolpointRecord appPatrolpointRecord : list) {
            pointList.add(appPatrolpointRecord.getAppPatrolpointsId());
        }
        //查询该计划的所有兴趣点
        List<ArdAlarmpointsWell> wellList = wellMapper.wellByPlanId(planId);
        for (ArdAlarmpointsWell ardAlarmpointsWell : wellList) {
            //所有应该打卡的地点ID
            String well = ardAlarmpointsWell.getId();
            //如果打开地点不包含应打卡地点,那说名这块儿没打卡
            if (!pointList.contains(well)) {
                ArdAppPatrolpointRecord ardAppPatrolpointRecord = new ArdAppPatrolpointRecord();
                ardAppPatrolpointRecord.setAppPatrolpointsId(well);
                ardAppPatrolpointRecord.setAppPatrolpointsName(ardAlarmpointsWell.getWellId());
                ardAppPatrolpointRecord.setPlanId(planId);
                ardAppPatrolpointRecord.setPlanName(planName);
                ardAppPatrolpointRecord.setUserId(userId);
                ardAppPatrolpointRecord.setUserName(userName);
                ardAppPatrolpointRecord.setLatitude(String.valueOf(ardAlarmpointsWell.getLatitude()));
                ardAppPatrolpointRecord.setLongitude(String.valueOf(ardAlarmpointsWell.getLongitude().toString()));
                list.add(ardAppPatrolpointRecord);
            }
        }
        return Results.succeed(list);
    }
}