|
@@ -1,6 +1,7 @@
|
|
|
package com.sckw.slope.detection.service;
|
|
package com.sckw.slope.detection.service;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.sckw.core.exception.BusinessException;
|
|
import com.sckw.core.exception.BusinessException;
|
|
@@ -11,6 +12,7 @@ import com.sckw.core.model.enums.MessageLogEnum;
|
|
|
import com.sckw.core.model.page.PageRes;
|
|
import com.sckw.core.model.page.PageRes;
|
|
|
import com.sckw.core.utils.IdWorker;
|
|
import com.sckw.core.utils.IdWorker;
|
|
|
import com.sckw.core.web.response.PhpResult;
|
|
import com.sckw.core.web.response.PhpResult;
|
|
|
|
|
+import com.sckw.slope.detection.dao.mysql.KwsDeviceReferenceMapper;
|
|
|
import com.sckw.slope.detection.dao.mysql.KwsDictMapper;
|
|
import com.sckw.slope.detection.dao.mysql.KwsDictMapper;
|
|
|
import com.sckw.slope.detection.dao.mysql.KwsLogMapper;
|
|
import com.sckw.slope.detection.dao.mysql.KwsLogMapper;
|
|
|
import com.sckw.slope.detection.model.dos.mysql.KwsDeviceReference;
|
|
import com.sckw.slope.detection.model.dos.mysql.KwsDeviceReference;
|
|
@@ -107,8 +109,12 @@ public class CommonService {
|
|
|
|
|
|
|
|
private static final Long equatorial_circumference = 40075020000L;
|
|
private static final Long equatorial_circumference = 40075020000L;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ KwsDeviceReferenceMapper deviceReferenceMapper;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 计算xyz值的偏移量 当前只用于计算偏移数据的offset
|
|
* 计算xyz值的偏移量 当前只用于计算偏移数据的offset
|
|
|
|
|
+ *
|
|
|
* @param value
|
|
* @param value
|
|
|
* @param itemName
|
|
* @param itemName
|
|
|
* @param deviceRelation
|
|
* @param deviceRelation
|
|
@@ -125,6 +131,15 @@ public class CommonService {
|
|
|
}
|
|
}
|
|
|
double angleInRadians = 0;
|
|
double angleInRadians = 0;
|
|
|
if (DictItemEnum.LONGITUDE_X.getValue().equals(itemName)) {
|
|
if (DictItemEnum.LONGITUDE_X.getValue().equals(itemName)) {
|
|
|
|
|
+ KwsDeviceReference deviceReference = deviceReferenceMapper.selectOne(new LambdaQueryWrapper<KwsDeviceReference>()
|
|
|
|
|
+ .eq(KwsDeviceReference::getDeviceId, deviceRelation.getDeviceId())
|
|
|
|
|
+ .eq(KwsDeviceReference::getType, NumberConstant.ONE)
|
|
|
|
|
+ .eq(KwsDeviceReference::getDelFlag, NumberConstant.ZERO)
|
|
|
|
|
+ .eq(KwsDeviceReference::getItem, DictItemEnum.LATITUDE_Y.getValue())
|
|
|
|
|
+ );
|
|
|
|
|
+ if (deviceReference != null) {
|
|
|
|
|
+ angleInRadians = deviceReference.getCurrentValue().doubleValue();
|
|
|
|
|
+ }
|
|
|
double cosValue = Math.cos(angleInRadians);
|
|
double cosValue = Math.cos(angleInRadians);
|
|
|
double doubleValue = subtract.divide(new BigDecimal("360"), 9, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
double doubleValue = subtract.divide(new BigDecimal("360"), 9, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
offsetValue = new BigDecimal(equatorial_circumference).multiply(new BigDecimal(cosValue)).multiply(new BigDecimal(doubleValue));
|
|
offsetValue = new BigDecimal(equatorial_circumference).multiply(new BigDecimal(cosValue)).multiply(new BigDecimal(doubleValue));
|