修复部署施 stackoverflow的bug
parent
302472473f
commit
9c1c903018
File diff suppressed because it is too large
Load Diff
@ -1,22 +1,22 @@
|
|||||||
|
//
|
||||||
package com.shxy.xyhkcamera.alarm;
|
//package com.shxy.xyhkcamera.alarm;
|
||||||
|
//
|
||||||
import com.shxy.xyhkcamera.hk.HCNetSDK;
|
//import com.shxy.xyhkcamera.hk.HCNetSDK;
|
||||||
import com.sun.jna.Pointer;
|
//import com.sun.jna.Pointer;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
public class FMSGCallBack_V31 implements HCNetSDK.FMSGCallBack_V31 {
|
//public class FMSGCallBack_V31 implements HCNetSDK.FMSGCallBack_V31 {
|
||||||
//报警信息回调函数
|
// //报警信息回调函数
|
||||||
public boolean invoke(int lCommand, HCNetSDK.NET_DVR_ALARMER pAlarmer, Pointer pAlarmInfo, int dwBufLen, Pointer pUser) {
|
// public boolean invoke(int lCommand, HCNetSDK.NET_DVR_ALARMER pAlarmer, Pointer pAlarmInfo, int dwBufLen, Pointer pUser) {
|
||||||
AlarmDataParse.alarmDataHandle(lCommand, pAlarmer, pAlarmInfo, dwBufLen, pUser);
|
// AlarmDataParse.alarmDataHandle(lCommand, pAlarmer, pAlarmInfo, dwBufLen, pUser);
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
package com.shxy.xyhkcamera.hk;
|
|
||||||
|
|
||||||
public enum erew {
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
package com.shxy.xyhkcamera.interfacesss;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.shxy.xyhkcamera.entity.DataEaifHEntity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* 红外区域测温数据表 服务类
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @author jingjing
|
|
||||||
* @since 2024-05-20
|
|
||||||
*/
|
|
||||||
public interface Testint{
|
|
||||||
|
|
||||||
void test(DataEaifHEntity entity);
|
|
||||||
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
package com.shxy.xyhkcamera.interfacesss;
|
|
||||||
|
|
||||||
import com.shxy.xyhkcamera.entity.DataEaifHEntity;
|
|
||||||
import com.shxy.xyhkcamera.service.DataEaifHService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class Testintimpl implements Testint {
|
|
||||||
@Autowired
|
|
||||||
DataEaifHService dataEaifHService;
|
|
||||||
@Override
|
|
||||||
public void test(DataEaifHEntity entity) {
|
|
||||||
dataEaifHService.save(entity);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +1,75 @@
|
|||||||
package com.shxy.xyhkcamera.service;
|
package com.shxy.xyhkcamera.service;
|
||||||
|
|
||||||
import com.shxy.xyhkcamera.entity.DataEaifHEntity;
|
import com.shxy.xyhkcamera.entity.DataEaifHEntity;
|
||||||
|
import com.shxy.xyhkcamera.hk.HCNetSDK;
|
||||||
|
import com.shxy.xyhkcamera.hk.HKConfigEnum;
|
||||||
|
import com.shxy.xyhkcamera.hk.HcNetSdkUtil;
|
||||||
|
import com.sun.jna.Pointer;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class AsyncService {
|
public class AsyncService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
DataEaifHService dataEaifHService;
|
DataEaifHService dataEaifHService;
|
||||||
|
|
||||||
@Async("syncExecutorPool")
|
@Async("syncExecutorPool")
|
||||||
public void executeAsyncTask(DataEaifHEntity eaifHEntity) {
|
public void executeAsyncTask(Pointer lpBuffer, Integer id) {
|
||||||
|
HCNetSDK.NET_DVR_THERMOMETRY_UPLOAD data = new HCNetSDK.NET_DVR_THERMOMETRY_UPLOAD();
|
||||||
|
// data.write();
|
||||||
|
Pointer pointer = data.getPointer();
|
||||||
|
pointer.write(0, lpBuffer.getByteArray(0, data.size()), 0, data.size());
|
||||||
|
data.read();
|
||||||
|
log.info("返回的数据:" + data.toString());
|
||||||
|
log.info("开始数据整理");
|
||||||
|
byte byRuleCalibType = data.byRuleCalibType;
|
||||||
|
byte byThermometryUnit = data.byThermometryUnit;
|
||||||
|
DataEaifHEntity entity = new DataEaifHEntity();
|
||||||
|
entity.setEqmid(id);
|
||||||
|
entity.setAreaid(1);
|
||||||
|
if (byThermometryUnit == HKConfigEnum.SSD) {
|
||||||
|
entity.setUnit((byte) HKConfigEnum.MYSQLSSD);
|
||||||
|
} else if (byThermometryUnit == HKConfigEnum.HSD) {
|
||||||
|
entity.setUnit((byte) HKConfigEnum.MYSQLHSD);
|
||||||
|
} else if (byThermometryUnit == HKConfigEnum.KEW) {
|
||||||
|
entity.setUnit((byte) HKConfigEnum.MYSQLKEW);
|
||||||
|
}
|
||||||
|
//数据库中1->点2->线3->框
|
||||||
|
if (byRuleCalibType == HKConfigEnum.POINT) {
|
||||||
|
float fTemperature = data.struPointThermCfg.fTemperature;
|
||||||
|
double maxtemp = new BigDecimal(fTemperature).setScale(4, BigDecimal.ROUND_DOWN).doubleValue();
|
||||||
|
entity.setMaxtemp(maxtemp);
|
||||||
|
entity.setMintemp(maxtemp);
|
||||||
|
entity.setAvgtemp(maxtemp);
|
||||||
|
entity.setType((byte) HKConfigEnum.MYSQLPOINT);
|
||||||
|
entity.setMid(Double.valueOf(0));
|
||||||
|
} else if (byRuleCalibType == HKConfigEnum.FRAME || byRuleCalibType == HKConfigEnum.LINE) {
|
||||||
|
HCNetSDK.NET_DVR_LINEPOLYGON_THERM_CFG struLinePolygonThermCfg = data.struLinePolygonThermCfg;
|
||||||
|
float fAverageTemperature = struLinePolygonThermCfg.fAverageTemperature;//平均温度
|
||||||
|
float fMinTemperature = struLinePolygonThermCfg.fMinTemperature;
|
||||||
|
float fMaxTemperature = struLinePolygonThermCfg.fMaxTemperature;
|
||||||
|
float fTemperatureDiff = struLinePolygonThermCfg.fTemperatureDiff;
|
||||||
|
entity.setMaxtemp(new BigDecimal(fMaxTemperature).setScale(4, BigDecimal.ROUND_DOWN).doubleValue());
|
||||||
|
entity.setMintemp(new BigDecimal(fMinTemperature).setScale(4, BigDecimal.ROUND_DOWN).doubleValue());
|
||||||
|
entity.setAvgtemp(new BigDecimal(fAverageTemperature).setScale(4, BigDecimal.ROUND_DOWN).doubleValue());
|
||||||
|
entity.setMid(new BigDecimal(fTemperatureDiff).setScale(4, BigDecimal.ROUND_DOWN).doubleValue());
|
||||||
|
if (byRuleCalibType == HKConfigEnum.FRAME) {
|
||||||
|
entity.setType((byte) HKConfigEnum.MYSQLFRAME);
|
||||||
|
} else if (byRuleCalibType == HKConfigEnum.LINE) {
|
||||||
|
entity.setType((byte) HKConfigEnum.MYSQLLINE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
entity.setStd(Double.valueOf(0));
|
||||||
|
entity.setCapturetime(LocalDateTime.now());
|
||||||
|
log.info("数据是:" + entity.toString());
|
||||||
// 异步执行的任务
|
// 异步执行的任务
|
||||||
dataEaifHService.save(eaifHEntity);
|
dataEaifHService.save(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue