|
|
@ -27,12 +27,13 @@ import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* 工作人员巡查主记录 |
|
|
@ -217,6 +218,42 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRec |
|
|
|
return dto; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 上传巡查记录 |
|
|
|
* |
|
|
|
* @param tokenDto |
|
|
|
* @param formDTO |
|
|
|
* @return com.epmet.dto.result.PatrolUploadResultDTO |
|
|
|
* @author zhaoqifeng |
|
|
|
* @date 2021/6/9 16:32 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public PatrolUploadResultDTO uploadDetails(TokenDto tokenDto, PatrolUploadDetailFormDTO formDTO) { |
|
|
|
if (CollectionUtils.isNotEmpty(formDTO.getDetails())) { |
|
|
|
List<StaffPatrolDetailEntity> list = formDTO.getDetails().stream().map(detail -> { |
|
|
|
StaffPatrolDetailEntity detailEntity = new StaffPatrolDetailEntity(); |
|
|
|
detailEntity.setStaffPatrolRecId(formDTO.getStaffPatrolRecId()); |
|
|
|
detailEntity.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
detailEntity.setSerialNum(detail.getSerialNum()); |
|
|
|
detailEntity.setUploadTime(new Date()); |
|
|
|
detailEntity.setLatitude(detail.getLatitude()); |
|
|
|
detailEntity.setLongitude(detail.getLongitude()); |
|
|
|
detailEntity.setSpeed(detail.getSpeed()); |
|
|
|
detailEntity.setAccuracy(detail.getAccuracy()); |
|
|
|
detailEntity.setAltitude(detail.getAltitude()); |
|
|
|
detailEntity.setVerticalaccuracy(detail.getVerticalAccuracy()); |
|
|
|
detailEntity.setHorizontalaccuracy(detail.getHorizontalAccuracy()); |
|
|
|
return detailEntity; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
|
staffPatrolDetailService.insertBatch(list); |
|
|
|
} |
|
|
|
|
|
|
|
PatrolUploadResultDTO dto = new PatrolUploadResultDTO(); |
|
|
|
dto.setStaffPatrolRecId(formDTO.getStaffPatrolRecId()); |
|
|
|
return dto; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 查询经纬度 |
|
|
|
* @Param userIds |
|
|
|