bug
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
package org.dromara.common.utils;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import org.dromara.common.constant.GeoJsonConstant;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
@ -355,4 +357,16 @@ public class JSTUtil {
|
||||
return geometryFactory.createPolygon(ring, null);
|
||||
}
|
||||
|
||||
|
||||
public static String getLocationName(String lat, String lng){
|
||||
String a = lng+","+lat;
|
||||
String s = HttpUtil.get("https://restapi.amap.com/v3/geocode/regeo?location=" + a + "&Key=2a769e5362ac9a7d7db12e85b640124c");
|
||||
JSONObject jsonObject = JSONUtil.parseObj(s);
|
||||
String address = null;
|
||||
if(jsonObject.getInt("status") == 1){
|
||||
address = jsonObject.getJSONObject("regeocode").getStr("formatted_address");
|
||||
}
|
||||
return address;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -317,7 +317,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
// 记录打卡坐标
|
||||
attendance.setLat(req.getLat());
|
||||
attendance.setLng(req.getLng());
|
||||
attendance.setClockLocation(req.getLocationName());
|
||||
attendance.setClockLocation(JSTUtil.getLocationName(req.getLat(), req.getLng()));
|
||||
// 上传人脸照
|
||||
SysOssVo upload = ossService.upload(file);
|
||||
attendance.setFacePic(upload.getOssId().toString());
|
||||
@ -370,7 +370,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
// 记录打卡坐标
|
||||
attendance.setLat(req.getLat());
|
||||
attendance.setLng(req.getLng());
|
||||
attendance.setClockLocation(req.getLocationName());
|
||||
attendance.setClockLocation(JSTUtil.getLocationName(req.getLat(), req.getLng()));
|
||||
// 上传人脸照
|
||||
SysOssVo upload = ossService.upload(file);
|
||||
attendance.setFacePic(upload.getOssId().toString());
|
||||
|
||||
@ -351,6 +351,7 @@ public class QltQualityInspectionServiceImpl extends ServiceImpl<QltQualityInspe
|
||||
Long rectificationId = req.getRectificationId();
|
||||
// 精确查询
|
||||
lqw.orderByDesc(QltQualityInspection::getCreateTime);
|
||||
lqw.orderByDesc(QltQualityInspection::getVersion);
|
||||
lqw.eq(StringUtils.isNotBlank(inspectionType), QltQualityInspection::getInspectionType, inspectionType);
|
||||
lqw.eq(StringUtils.isNotBlank(rectificationUnit), QltQualityInspection::getRectificationUnit, rectificationUnit);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(projectId), QltQualityInspection::getProjectId, projectId);
|
||||
|
||||
@ -355,6 +355,7 @@ public class HseSafetyInspectionServiceImpl extends ServiceImpl<HseSafetyInspect
|
||||
}
|
||||
}
|
||||
lqw.orderByDesc(HseSafetyInspection::getCreateTime);
|
||||
lqw.orderByDesc(HseSafetyInspection::getVersion);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user