|
|
@ -31,6 +31,7 @@ import com.techsor.datacenter.sender.entitiy.*; |
|
|
import com.techsor.datacenter.sender.entitiy.bastatus.BaStatusEntity; |
|
|
import com.techsor.datacenter.sender.entitiy.bastatus.BaStatusEntity; |
|
|
import com.techsor.datacenter.sender.entitiy.bastatus.BaStatusHistoryEntity; |
|
|
import com.techsor.datacenter.sender.entitiy.bastatus.BaStatusHistoryEntity; |
|
|
import com.techsor.datacenter.sender.entitiy.bastatus.BaStatusThirdReqEntity; |
|
|
import com.techsor.datacenter.sender.entitiy.bastatus.BaStatusThirdReqEntity; |
|
|
|
|
|
import com.techsor.datacenter.sender.entitiy.bastatus.LatestValueBO; |
|
|
import com.techsor.datacenter.sender.entitiy.company.CompanyEntity; |
|
|
import com.techsor.datacenter.sender.entitiy.company.CompanyEntity; |
|
|
import com.techsor.datacenter.sender.entitiy.delta.DeltaNumEntity; |
|
|
import com.techsor.datacenter.sender.entitiy.delta.DeltaNumEntity; |
|
|
import com.techsor.datacenter.sender.entitiy.kingio.KingIODataItemEntity; |
|
|
import com.techsor.datacenter.sender.entitiy.kingio.KingIODataItemEntity; |
|
|
@ -1479,6 +1480,14 @@ public class DataProcessServiceImpl implements IDataProcessService { |
|
|
}catch (Exception e){ |
|
|
}catch (Exception e){ |
|
|
log.error("Insert ba_status_history Error:",e.getMessage(),e.fillInStackTrace()); |
|
|
log.error("Insert ba_status_history Error:",e.getMessage(),e.fillInStackTrace()); |
|
|
} |
|
|
} |
|
|
|
|
|
// 缓存redis
|
|
|
|
|
|
LatestValueBO latestValueBO = new LatestValueBO(); |
|
|
|
|
|
latestValueBO.setUpdateTs(update_ts); |
|
|
|
|
|
latestValueBO.setValue(value); |
|
|
|
|
|
String redisKey = Constants.REDIS_BA_STATUS_LATEST_VALUE + DateUtils.getCurrentDate(update_ts); |
|
|
|
|
|
this.redisTemplate.opsForHash().put(redisKey, deviceId.toLowerCase(), JSONObject.toJSONString(latestValueBO)); |
|
|
|
|
|
this.redisTemplate.expire(redisKey, 2, TimeUnit.DAYS); |
|
|
|
|
|
|
|
|
//Update Or insert to mysql [ba_status_statistics]
|
|
|
//Update Or insert to mysql [ba_status_statistics]
|
|
|
if (historyData==null){ |
|
|
if (historyData==null){ |
|
|
//insert
|
|
|
//insert
|
|
|
|