扬尘躁声风向修改
This commit is contained in:
parent
bd38907f72
commit
93465924e0
@ -1,6 +1,7 @@
|
|||||||
package com.zhgd.xmgl.modules.worker.service.impl;
|
package com.zhgd.xmgl.modules.worker.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
|
import cn.xuyanwu.spring.file.storage.FileInfo;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.arcsoft.face.FaceFeature;
|
import com.arcsoft.face.FaceFeature;
|
||||||
import com.arcsoft.face.FaceInfo;
|
import com.arcsoft.face.FaceInfo;
|
||||||
@ -14,6 +15,7 @@ import com.zhgd.jeecg.common.mybatis.EntityMap;
|
|||||||
import com.zhgd.xmgl.async.AsyncSendAttendance;
|
import com.zhgd.xmgl.async.AsyncSendAttendance;
|
||||||
import com.zhgd.xmgl.modules.basicdata.service.ICompanyService;
|
import com.zhgd.xmgl.modules.basicdata.service.ICompanyService;
|
||||||
import com.zhgd.xmgl.modules.basicdata.service.UploadFileService;
|
import com.zhgd.xmgl.modules.basicdata.service.UploadFileService;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.service.impl.UploadFileServiceImpl;
|
||||||
import com.zhgd.xmgl.modules.govtapi.GovtOpenApiService;
|
import com.zhgd.xmgl.modules.govtapi.GovtOpenApiService;
|
||||||
import com.zhgd.xmgl.modules.project.entity.ProjectUfaceConfig;
|
import com.zhgd.xmgl.modules.project.entity.ProjectUfaceConfig;
|
||||||
import com.zhgd.xmgl.modules.project.mapper.ProjectUfaceConfigMapper;
|
import com.zhgd.xmgl.modules.project.mapper.ProjectUfaceConfigMapper;
|
||||||
@ -727,6 +729,11 @@ public class WorkerAttendanceServiceImpl extends ServiceImpl<WorkerAttendanceMap
|
|||||||
WorkerInfo info = workerInfoMapper.selectWorkWorkerInfoWithIDCard(idCard, projectSn);
|
WorkerInfo info = workerInfoMapper.selectWorkWorkerInfoWithIDCard(idCard, projectSn);
|
||||||
if (info != null) {
|
if (info != null) {
|
||||||
WorkerAttendance workerAttendance = new WorkerAttendance();
|
WorkerAttendance workerAttendance = new WorkerAttendance();
|
||||||
|
String imageBase64 = MapUtils.getString(map, "imageBase64");
|
||||||
|
if (StringUtils.isNotEmpty(imageBase64)) {
|
||||||
|
FileInfo fileInfo = uploadFileService.uploadFileBase64Image(imageBase64);
|
||||||
|
workerAttendance.setImageUrl(fileInfo.getFilename());
|
||||||
|
}
|
||||||
workerAttendance.setPersonSn(info.getPersonSn());
|
workerAttendance.setPersonSn(info.getPersonSn());
|
||||||
workerAttendance.setCreateTime(MapUtils.getString(map, "snapTime"));
|
workerAttendance.setCreateTime(MapUtils.getString(map, "snapTime"));
|
||||||
workerAttendance.setProjectSn(projectSn);
|
workerAttendance.setProjectSn(projectSn);
|
||||||
|
|||||||
@ -9,67 +9,86 @@ package com.zhgd.xmgl.util;
|
|||||||
|
|
||||||
public class WindDirectionUtils {
|
public class WindDirectionUtils {
|
||||||
|
|
||||||
public static String getWindDirectionName(String winddirection){
|
public static String getWindDirectionName(String winddirection) {
|
||||||
String winddirectionName="";
|
String winddirectionName = "";
|
||||||
try {
|
try {
|
||||||
if(winddirection.indexOf("S")!=-1||winddirection.indexOf("E")!=-1||winddirection.indexOf("N")!=-1||winddirection.indexOf("W")!=-1){
|
if (winddirection.indexOf("S") != -1 || winddirection.indexOf("E") != -1 || winddirection.indexOf("N") != -1 || winddirection.indexOf("W") != -1) {
|
||||||
if("NNE".equals(winddirection)){
|
if ("NNE".equals(winddirection)) {
|
||||||
winddirectionName="东北偏北";
|
winddirectionName = "东北偏北";
|
||||||
}else if("NE".equals(winddirection)){
|
} else if ("NE".equals(winddirection)) {
|
||||||
winddirectionName="东北";
|
winddirectionName = "东北";
|
||||||
}else if("ENE".equals(winddirection)){
|
} else if ("ENE".equals(winddirection)) {
|
||||||
winddirectionName="东北偏东";
|
winddirectionName = "东北偏东";
|
||||||
}else if("E".equals(winddirection)){
|
} else if ("E".equals(winddirection)) {
|
||||||
winddirectionName="正东";
|
winddirectionName = "正东";
|
||||||
}else if("ESE".equals(winddirection)){
|
} else if ("ESE".equals(winddirection)) {
|
||||||
winddirectionName="东南偏东";
|
winddirectionName = "东南偏东";
|
||||||
}else if("SE".equals(winddirection)){
|
} else if ("SE".equals(winddirection)) {
|
||||||
winddirectionName="东南";
|
winddirectionName = "东南";
|
||||||
}else if("SSE".equals(winddirection)){
|
} else if ("SSE".equals(winddirection)) {
|
||||||
winddirectionName="东南偏南";
|
winddirectionName = "东南偏南";
|
||||||
}else if("S".equals(winddirection)){
|
} else if ("S".equals(winddirection)) {
|
||||||
winddirectionName="正南";
|
winddirectionName = "正南";
|
||||||
}else if("SSW".equals(winddirection)){
|
} else if ("SSW".equals(winddirection)) {
|
||||||
winddirectionName="正南偏南";
|
winddirectionName = "正南偏南";
|
||||||
}else if("SW".equals(winddirection)){
|
} else if ("SW".equals(winddirection)) {
|
||||||
winddirectionName="西南";
|
winddirectionName = "西南";
|
||||||
}else if("WSW".equals(winddirection)){
|
} else if ("WSW".equals(winddirection)) {
|
||||||
winddirectionName="西南偏西";
|
winddirectionName = "西南偏西";
|
||||||
}else if("W".equals(winddirection)){
|
} else if ("W".equals(winddirection)) {
|
||||||
winddirectionName="正西";
|
winddirectionName = "正西";
|
||||||
}else if("WNW".equals(winddirection)){
|
} else if ("WNW".equals(winddirection)) {
|
||||||
winddirectionName="西北偏西";
|
winddirectionName = "西北偏西";
|
||||||
}else if("NW".equals(winddirection)){
|
} else if ("NW".equals(winddirection)) {
|
||||||
winddirectionName="西北";
|
winddirectionName = "西北";
|
||||||
}else if("NNW".equals(winddirection)){
|
} else if ("NNW".equals(winddirection)) {
|
||||||
winddirectionName="西北偏北";
|
winddirectionName = "西北偏北";
|
||||||
}else if("N".equals(winddirection)){
|
} else if ("N".equals(winddirection)) {
|
||||||
winddirectionName="正北";
|
winddirectionName = "正北";
|
||||||
}
|
}
|
||||||
}else{
|
} else if (isChinese(winddirection)) {
|
||||||
|
winddirectionName = winddirection;
|
||||||
|
} else {
|
||||||
double winddirections = Double.parseDouble(winddirection);
|
double winddirections = Double.parseDouble(winddirection);
|
||||||
if(337.5 < winddirections || winddirections <= 22.5){
|
if (337.5 < winddirections || winddirections <= 22.5) {
|
||||||
winddirectionName="北";
|
winddirectionName = "北";
|
||||||
}else if(22.5 < winddirections && winddirections <= 67.5){
|
} else if (22.5 < winddirections && winddirections <= 67.5) {
|
||||||
winddirectionName="东北";
|
winddirectionName = "东北";
|
||||||
}else if(67.5 < winddirections && winddirections <= 112.5){
|
} else if (67.5 < winddirections && winddirections <= 112.5) {
|
||||||
winddirectionName="东";
|
winddirectionName = "东";
|
||||||
}else if(112.5 < winddirections && winddirections <= 157.5){
|
} else if (112.5 < winddirections && winddirections <= 157.5) {
|
||||||
winddirectionName="东南";
|
winddirectionName = "东南";
|
||||||
}else if(157.5 < winddirections && winddirections <= 202.5){
|
} else if (157.5 < winddirections && winddirections <= 202.5) {
|
||||||
winddirectionName="南";
|
winddirectionName = "南";
|
||||||
}else if(202.5 < winddirections && winddirections <= 247.5){
|
} else if (202.5 < winddirections && winddirections <= 247.5) {
|
||||||
winddirectionName="西南";
|
winddirectionName = "西南";
|
||||||
}else if(247.5 < winddirections && winddirections <= 292.5){
|
} else if (247.5 < winddirections && winddirections <= 292.5) {
|
||||||
winddirectionName="西";
|
winddirectionName = "西";
|
||||||
}else if(292.5 < winddirections && winddirections <= 337.5){
|
} else if (292.5 < winddirections && winddirections <= 337.5) {
|
||||||
winddirectionName="西北";
|
winddirectionName = "西北";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
return winddirectionName;
|
return winddirectionName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断该字符串是否为中文
|
||||||
|
*
|
||||||
|
* @param string
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean isChinese(String string) {
|
||||||
|
int n = 0;
|
||||||
|
for (int i = 0; i < string.length(); i++) {
|
||||||
|
n = (int) string.charAt(i);
|
||||||
|
if (!(19968 <= n && n < 40869)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user