|
@@ -1,8 +1,26 @@
|
|
|
package com.huimv.eartag2.process2.service.impl;
|
|
|
|
|
|
+//import cn.hutool.core.date.DateUtil;
|
|
|
+
|
|
|
+import com.huimv.eartag2.common.dao.entity.EartagDeviceOnlineEntity;
|
|
|
+import com.huimv.eartag2.common.dao.entity.EartagDeviceRegisterEntity;
|
|
|
+import com.huimv.eartag2.common.dao.entity.EartarFarmAllStatusEntity;
|
|
|
+import com.huimv.eartag2.common.dao.repo.*;
|
|
|
+import com.huimv.eartag2.common.utils.BizConst;
|
|
|
+import com.huimv.eartag2.common.utils.DateUtil;
|
|
|
import com.huimv.eartag2.process2.service.IDeviceService;
|
|
|
+//import com.huimv.eartag2.process2.utils.DateUtil;
|
|
|
+import com.huimv.eartag2.process2.service.IRedisService;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.sql.Timestamp;
|
|
|
+import java.text.ParseException;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
@@ -14,18 +32,377 @@ import java.util.Map;
|
|
|
* @Create : 2020-12-25
|
|
|
**/
|
|
|
@Service
|
|
|
+@Slf4j
|
|
|
public class DeviceServiceImpl implements IDeviceService {
|
|
|
+ @Autowired
|
|
|
+ private RedisTemplate redisTemplate;
|
|
|
+ @Autowired
|
|
|
+ private EartagDeviceRegisterRepo deviceRegisterRepo;
|
|
|
+ @Autowired
|
|
|
+ private EartagHeartbeatRepo heartbeatRepo;
|
|
|
+ @Autowired
|
|
|
+ private EartagEnvRepo envRepo;
|
|
|
+ // @Value("#{device.register.prefix}")
|
|
|
+// private String deviceRegisterPrefix;
|
|
|
+ @Autowired
|
|
|
+ private EartagDeviceOnlineRepo eartagDeviceOnlineRepo;
|
|
|
+ @Autowired
|
|
|
+ private IRedisService redisService;
|
|
|
+ @Autowired
|
|
|
+ private EartarFarmAllStatusRepo eartagFarmAllStatusRepo;
|
|
|
+ @Autowired
|
|
|
+ private EartagEartagRegisterRepo eartagRegisterRepo;
|
|
|
+ @Autowired
|
|
|
+ private EartagDeviceRegisterRepo eartagDeviceRegisterRepo;
|
|
|
+
|
|
|
|
|
|
// 保存在线数据
|
|
|
@Override
|
|
|
- public void saveDeviceOnline(Map deviceMap){
|
|
|
+ public void saveDeviceOnline(Map deviceMap) {
|
|
|
|
|
|
}
|
|
|
|
|
|
//保存状态数据
|
|
|
@Override
|
|
|
- public void saveDeviceStatus(Map deviceMap){
|
|
|
+ public void saveDeviceStatus(Map deviceMap) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Method : updateDeviceRegister
|
|
|
+ * @Description : 更新设备注册数据
|
|
|
+ * @Params : [deviceCode]
|
|
|
+ * @Return : void
|
|
|
+ * @Author : ZhuoNing
|
|
|
+ * @Date : 2022/2/21
|
|
|
+ * @Time : 15:13
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void updateDeviceRegister(String deviceCode) {
|
|
|
+ System.out.println("updateDeviceRegister");
|
|
|
+ //--更新设备注册表(eartag_device_register.active_status)同时更新对应的Redis
|
|
|
+ updateRegisterActiveStatus(deviceCode);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Method : updateRegisterActiveStatus
|
|
|
+ * @Description : 更新注册表中的心跳状态
|
|
|
+ * @Params : [deviceCode]
|
|
|
+ * @Return : void
|
|
|
+ * @Author : ZhuoNing
|
|
|
+ * @Date : 2022/2/21
|
|
|
+ * @Time : 15:13
|
|
|
+ */
|
|
|
+ void updateRegisterActiveStatus(String deviceCode) {
|
|
|
+ //--更新mysql
|
|
|
+ EartagDeviceRegisterEntity deviceRegisterEntity = deviceRegisterRepo.getDeviceRegister(deviceCode);
|
|
|
+ if (deviceRegisterEntity != null) {
|
|
|
+// if(deviceRegisterEntity.getActiveStatus() == 0){
|
|
|
+ deviceRegisterEntity.setActiveStatus(1);
|
|
|
+ deviceRegisterEntity.setActiveTime(new Timestamp(new Date().getTime()));
|
|
|
+ deviceRegisterRepo.saveAndFlush(deviceRegisterEntity);
|
|
|
+// }
|
|
|
+ }
|
|
|
+ //--更新redis中注册表数据
|
|
|
+ String deviceRegHashKey = BizConst.DEVICE_REGISTER_PREFIX + deviceCode;
|
|
|
+ //将Entity转为Map
|
|
|
+ Map registerMap = RegisterEntityToMap(deviceRegisterEntity);
|
|
|
+ redisTemplate.opsForHash().putAll(deviceRegHashKey, registerMap);
|
|
|
+
|
|
|
+// Object nameObj = redisTemplate.opsForHash().get(deviceRegHashKey,"activeTime");
|
|
|
+// System.out.println("activeTime>>"+nameObj.toString());
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * @Method : RegisterEntityToMap
|
|
|
+ * @Description :
|
|
|
+ * @Params : [deviceRegisterEntity]
|
|
|
+ * @Return : java.util.Map
|
|
|
+ * @Author : ZhuoNing
|
|
|
+ * @Date : 2022/2/21
|
|
|
+ * @Time : 14:03
|
|
|
+ */
|
|
|
+ private Map RegisterEntityToMap(EartagDeviceRegisterEntity deviceRegisterEntity) {
|
|
|
+ Map map = new HashMap();
|
|
|
+ map.put("Id", deviceRegisterEntity.getId());
|
|
|
+ map.put("deviceCode", deviceRegisterEntity.getDeviceCode());
|
|
|
+ map.put("farmId", deviceRegisterEntity.getFarmId());
|
|
|
+ map.put("farmName", deviceRegisterEntity.getFarmName());
|
|
|
+ map.put("typeF", deviceRegisterEntity.getTypeF());
|
|
|
+ map.put("stage", deviceRegisterEntity.getStage());
|
|
|
+ map.put("pigpenId", deviceRegisterEntity.getPigpenId());
|
|
|
+ map.put("unitId", deviceRegisterEntity.getUnitId());
|
|
|
+ map.put("registerTime", deviceRegisterEntity.getRegisterTime());
|
|
|
+ map.put("lastTime", deviceRegisterEntity.getLastTime());
|
|
|
+ map.put("activeStatus", deviceRegisterEntity.getActiveStatus());
|
|
|
+ map.put("activeTime", deviceRegisterEntity.getActiveTime());
|
|
|
+ map.put("deviceStatus", deviceRegisterEntity.getDeviceStatus());
|
|
|
+ map.put("deviceAlias", deviceRegisterEntity.getDeviceAlias());
|
|
|
+ map.put("location", deviceRegisterEntity.getLocation());
|
|
|
+ map.put("remark", deviceRegisterEntity.getRemark());
|
|
|
+ return map;
|
|
|
}
|
|
|
|
|
|
+ //更新设备在线数据
|
|
|
+ @Override
|
|
|
+ public void updateDeviceOnline(String deviceCode) throws ParseException {
|
|
|
+ //设备在线表 eartag_device_online.heartbeat_total
|
|
|
+ //更新mysql
|
|
|
+ //更新redis
|
|
|
+ //# 更新设备在线数据 #
|
|
|
+ updateDeviceOnlineCount(deviceCode);
|
|
|
+
|
|
|
+ //# 更新设备注册表(eartag_device_register.active_status)同时更新对应的Redis #
|
|
|
+// updateRegisterActiveStatus(deviceCode);
|
|
|
+ }
|
|
|
+
|
|
|
+ //更新设备在线Static
|
|
|
+ private void updateDeviceOnlineCount(String deviceCode) throws ParseException {
|
|
|
+ String todayText = new DateUtil().getTodayDateText();
|
|
|
+ //读取在线日期
|
|
|
+ EartagDeviceOnlineEntity eartagDeviceOnlineEntity = eartagDeviceOnlineRepo.getDeviceOnline(deviceCode, todayText);
|
|
|
+ String deviceOnlineHashKey = BizConst.DEVICE_ONLINE_PREFIX + deviceCode;
|
|
|
+ if (eartagDeviceOnlineEntity == null) {
|
|
|
+ //# 新建今天在线记录(1),并将记录同步到redis(2) #
|
|
|
+ //查询别名
|
|
|
+ Object deviceAliasObj = redisTemplate.opsForHash().get(BizConst.DEVICE_REGISTER_PREFIX + deviceCode, "deviceAlias");
|
|
|
+ System.out.println("TEST deviceAliasObj>>" + deviceAliasObj.toString());
|
|
|
+ String deviceAlias = "";
|
|
|
+ if (deviceAliasObj != null) {
|
|
|
+ deviceAlias = deviceAliasObj.toString();
|
|
|
+ } else {
|
|
|
+ //从设备注册表读取设备别名
|
|
|
+ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
+ }
|
|
|
+ //# 查询牧场id #
|
|
|
+// Object farmIdObj = redisTemplate.opsForHash().get(BizConst.DEVICE_REGISTER_PREFIX + deviceCode,"farmId");
|
|
|
+ Object farmIdObj = redisService.getFarmIdByDeviceCode(deviceCode);
|
|
|
+ System.out.println("TEST farmIdObj>>" + farmIdObj.toString());
|
|
|
+ //(1)
|
|
|
+ EartagDeviceOnlineEntity newEartagDeviceOnlineEntity = new EartagDeviceOnlineEntity();
|
|
|
+ newEartagDeviceOnlineEntity.setDeviceCode(deviceCode);
|
|
|
+ newEartagDeviceOnlineEntity.setAlias(deviceAlias);
|
|
|
+ newEartagDeviceOnlineEntity.setHeartbeatTotal(1);
|
|
|
+ newEartagDeviceOnlineEntity.setEnvtempTotal(0);
|
|
|
+ newEartagDeviceOnlineEntity.setEartagTotal(0);
|
|
|
+ newEartagDeviceOnlineEntity.setFirstTime(new Timestamp(new Date().getTime()));
|
|
|
+ newEartagDeviceOnlineEntity.setLastTime(new Timestamp(new Date().getTime()));
|
|
|
+ newEartagDeviceOnlineEntity.setAddDate(new java.sql.Date(new Date().getTime()));
|
|
|
+ newEartagDeviceOnlineEntity.setFarmId(Integer.parseInt(farmIdObj.toString()));
|
|
|
+ eartagDeviceOnlineRepo.saveAndFlush(newEartagDeviceOnlineEntity);
|
|
|
+ //(2)
|
|
|
+ //将onlineEntity转为Map
|
|
|
+ Map onlineMap = fromOnlineEntityToMap(newEartagDeviceOnlineEntity);
|
|
|
+ redisTemplate.opsForHash().putAll(deviceOnlineHashKey, onlineMap);
|
|
|
+ } else {
|
|
|
+ //# 修改今天在线记录(1),并将记录同步到redis(2) #
|
|
|
+ //(1)
|
|
|
+ int total = eartagDeviceOnlineEntity.getHeartbeatTotal();
|
|
|
+ eartagDeviceOnlineEntity.setHeartbeatTotal(total + 1);
|
|
|
+ eartagDeviceOnlineRepo.saveAndFlush(eartagDeviceOnlineEntity);
|
|
|
+ //(2)
|
|
|
+ //将onlineEntity转为Map
|
|
|
+ Map onlineMap = fromOnlineEntityToMap(eartagDeviceOnlineEntity);
|
|
|
+ redisTemplate.opsForHash().putAll(deviceOnlineHashKey, onlineMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //--将onlineEntity转为Map
|
|
|
+ private Map fromOnlineEntityToMap(EartagDeviceOnlineEntity newEartagDeviceOnlineEntity) {
|
|
|
+ Map map = new HashMap();
|
|
|
+ map.put("id", newEartagDeviceOnlineEntity.getId());
|
|
|
+ map.put("deviceCode", newEartagDeviceOnlineEntity.getDeviceCode());
|
|
|
+ map.put("alias", newEartagDeviceOnlineEntity.getAlias());
|
|
|
+ map.put("heartbeatTotal", newEartagDeviceOnlineEntity.getHeartbeatTotal());
|
|
|
+ map.put("envtempTotal", newEartagDeviceOnlineEntity.getEnvtempTotal());
|
|
|
+ map.put("eartagTotal", newEartagDeviceOnlineEntity.getEartagTotal());
|
|
|
+ map.put("firstTime", newEartagDeviceOnlineEntity.getFirstTime());
|
|
|
+ map.put("lastTime", newEartagDeviceOnlineEntity.getLastTime());
|
|
|
+ map.put("lastEnvtemp", newEartagDeviceOnlineEntity.getLastEnvtemp());
|
|
|
+ map.put("lastEartag", newEartagDeviceOnlineEntity.getLastEartag());
|
|
|
+ map.put("addDate", newEartagDeviceOnlineEntity.getAddDate());
|
|
|
+ map.put("farmId", newEartagDeviceOnlineEntity.getFarmId());
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Method : updateDeviceStatus
|
|
|
+ * @Description : 更新设备状态数据
|
|
|
+ * @Params : [deviceCode]
|
|
|
+ * @Return : void
|
|
|
+ * @Author : ZhuoNing
|
|
|
+ * @Date : 2022/2/21
|
|
|
+ * @Time : 16:04
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void updateFarmDeviceStatus(String deviceCode) throws ParseException {
|
|
|
+ System.out.println("updateDeviceStatus 1.deviceCode>>" + deviceCode);
|
|
|
+ String todayDateText = new DateUtil().getTodayDateText();
|
|
|
+ System.out.println("1.todayDateText>>" + todayDateText);
|
|
|
+
|
|
|
+ //(1)判断牧场总状态缓存是否存在
|
|
|
+ Object createDateObj = checkIsExistFarmAllStatusCache(deviceCode);
|
|
|
+ if (createDateObj == null) {
|
|
|
+ log.error("这个设备(" + deviceCode + ")的注册数据不存在,请检查具体原因.");
|
|
|
+ System.out.println("1.");
|
|
|
+ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
+ } else if (createDateObj.toString().equalsIgnoreCase("0")) {
|
|
|
+ System.out.println("牧场总状态缓存记录不存在.");
|
|
|
+ // B流程
|
|
|
+ handleDeviceStatus(deviceCode);
|
|
|
+ System.out.println("2.");
|
|
|
+ }else if (createDateObj.toString().trim().equalsIgnoreCase(todayDateText)) {
|
|
|
+ //计算在线状态,并同步到缓存
|
|
|
+ Object farmIdObj = redisService.getFarmIdByDeviceCode(deviceCode);
|
|
|
+ countDeviceStatus(farmIdObj.toString(),deviceCode,todayDateText);
|
|
|
+ System.out.println("3.");
|
|
|
+ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
+ } else {
|
|
|
+ //缓存日期非当日日期
|
|
|
+ // B流程
|
|
|
+ handleDeviceStatus(deviceCode);
|
|
|
+ System.out.println("4.");
|
|
|
+ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //# 处理设备状态 #
|
|
|
+ private void handleDeviceStatus(String deviceCode) throws ParseException {
|
|
|
+ //(1)判断今天的牧场总状态记录是否存在
|
|
|
+ //从设备注册表读取牧场id
|
|
|
+ EartagDeviceRegisterEntity deviceRegisterEntity = eartagDeviceRegisterRepo.getDeviceRegister(deviceCode);
|
|
|
+ String farmId = "";
|
|
|
+ if(deviceRegisterEntity == null){
|
|
|
+ log.error("这个设备(" + deviceCode + ")的注册数据不存在,请检查具体原因.");
|
|
|
+ }else{
|
|
|
+ farmId = deviceRegisterEntity.getFarmId();
|
|
|
+ }
|
|
|
+ String todayDateText = new DateUtil().getTodayDateText();
|
|
|
+ EartarFarmAllStatusEntity farmAllStatusEntity = eartagFarmAllStatusRepo.getOneByFarmIdAndCreateDate(farmId,todayDateText);
|
|
|
+ if(farmAllStatusEntity == null){
|
|
|
+ //设备注册表信息不存在
|
|
|
+ //创建设备状态记录并更新缓存cache()
|
|
|
+ createFarmAllStatus(deviceCode);
|
|
|
+ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
+ }else{
|
|
|
+ //设备注册表信息存在
|
|
|
+ //计算设备状态并更新缓存cache()
|
|
|
+ countDeviceStatus(farmId,deviceCode,todayDateText);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //# 计算在线状态,并同步到缓存 #
|
|
|
+ private void countDeviceStatus(String farmId,String deviceCode,String todayDateText) throws ParseException {
|
|
|
+ //读取牧场总状态数据
|
|
|
+ EartarFarmAllStatusEntity farmAllStatusEntity = eartagFarmAllStatusRepo.getOneByFarmIdAndCreateDate(farmId,todayDateText);
|
|
|
+ //在线数+1,离线数-1,计算设备在线率
|
|
|
+ int onlineNum = farmAllStatusEntity.getDeviceOnline();
|
|
|
+ int offlineNum = farmAllStatusEntity.getDeviceOffline();
|
|
|
+ int total = farmAllStatusEntity.getDeviceTotal();
|
|
|
+ onlineNum++;
|
|
|
+ offlineNum--;
|
|
|
+ BigDecimal reateBd= new BigDecimal(onlineNum).divide(new BigDecimal(total),1,BigDecimal.ROUND_HALF_UP);
|
|
|
+ farmAllStatusEntity.setDeviceOnline(onlineNum);
|
|
|
+ farmAllStatusEntity.setDeviceOffline(offlineNum);
|
|
|
+ farmAllStatusEntity.setDeviceRate(Float.parseFloat(reateBd.toString()));
|
|
|
+ System.out.println("## farmAllStatusEntity>>"+farmAllStatusEntity);
|
|
|
+ eartagFarmAllStatusRepo.saveAndFlush(farmAllStatusEntity);
|
|
|
+ //# 设置牧场总状态缓存相关字段 #
|
|
|
+ redisService.putFarmAllStatusCache(farmId,farmAllStatusEntity);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //断牧场总状态缓存是否存在
|
|
|
+ private Object checkIsExistFarmAllStatusCache(String deviceCode) {
|
|
|
+ //从缓存中获取farmId
|
|
|
+ Object farmIdObj = redisService.getFarmIdByDeviceCode(deviceCode);
|
|
|
+ System.out.println("22.farmIdObj>>" + farmIdObj);
|
|
|
+ String farmId = "";
|
|
|
+ if (farmIdObj != null) {
|
|
|
+ farmId = farmIdObj.toString();
|
|
|
+ } else {
|
|
|
+ log.info("设备注册缓存里没有设备编号为" + deviceCode + "的设备注册信息");
|
|
|
+ //(2)
|
|
|
+ EartagDeviceRegisterEntity eartagDeviceRegisterEntity = eartagDeviceRegisterRepo.getDeviceRegister(deviceCode);
|
|
|
+ System.out.println("22.eartagDeviceRegisterEntity>>" + eartagDeviceRegisterEntity.toString());
|
|
|
+ if (eartagDeviceRegisterEntity == null) {
|
|
|
+ log.error("设备注册记录不存在设备编号为" + deviceCode + "的设备注册信息.");
|
|
|
+ return null;
|
|
|
+ } else {
|
|
|
+ farmId = eartagDeviceRegisterEntity.getFarmId();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ System.out.println("22.farmId>>" + farmId);
|
|
|
+ //从牧场总状态缓存中获取最近一次日期
|
|
|
+ Object createDateObj = redisService.getCreateDateByFarmId(farmId);
|
|
|
+ System.out.println("22.createDateObj>>" + createDateObj);
|
|
|
+ if (createDateObj == null) {
|
|
|
+ return "0";
|
|
|
+ } else {
|
|
|
+ return createDateObj;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+// public void updateDeviceStatus_old1(String deviceCode) throws ParseException {
|
|
|
+// System.out.println("updateDeviceStatus 1.deviceCode>>" + deviceCode);
|
|
|
+// //# 验证是否存在当天总状态记录
|
|
|
+// //(1)
|
|
|
+// if (redisService.isExistTodayFarmAllStatus(deviceCode)) {
|
|
|
+// //缓存中存在该牧场当当天的总状态记录
|
|
|
+// System.out.println("缓存中存在该记录:Yes");
|
|
|
+// //更新总状态记录
|
|
|
+//// autoUpdateFarmAllStatus(deviceCode);
|
|
|
+// } else {
|
|
|
+// System.out.println("缓存中存在该记录:No");
|
|
|
+// //# 创建总状态记录 #(缓存中没有今天的记录)
|
|
|
+// createFarmAllStatus(deviceCode);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ //# 创建总状态记录 #
|
|
|
+ private void createFarmAllStatus(String deviceCode) {
|
|
|
+ //#从farm_all_status读取最近一天的数据
|
|
|
+ Map lastFarmAllStatusMap = getLastFarmAllStatus(deviceCode);
|
|
|
+
|
|
|
+ //MySQL:farm_all_status
|
|
|
+
|
|
|
+
|
|
|
+ //Redis:farm_all_status_farmId
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //#
|
|
|
+ private Map getLastFarmAllStatus(String deviceCode) {
|
|
|
+// farmAllStatusRepo.getLastFarmAllStatus();
|
|
|
+ //获取farmId,然后用farmId获取最近一天的数据
|
|
|
+ Object farmIdObj = redisService.getFarmIdByDeviceCode(deviceCode);
|
|
|
+ System.out.println("redis.farmIdObj>>" + farmIdObj);
|
|
|
+ if (farmIdObj == null) {
|
|
|
+ //# 初始化MySQL:farm_all_status
|
|
|
+ initFarmAllStatus();
|
|
|
+ }
|
|
|
+
|
|
|
+ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ //# 初始化总状态表
|
|
|
+ private void initFarmAllStatus() {
|
|
|
+ //# 计算设备总数(设备注册表)
|
|
|
+ int deviceTotal = 0;
|
|
|
+// deviceRegisterRepo.countTotal();
|
|
|
+
|
|
|
+ //# 计算耳标总数(耳标注册表)
|
|
|
+ int eartagTotal = 0;
|
|
|
+
|
|
|
+ EartarFarmAllStatusEntity farmAllStatusEntity = new EartarFarmAllStatusEntity();
|
|
|
+ farmAllStatusEntity.setDeviceTotal(deviceTotal);
|
|
|
+ farmAllStatusEntity.setEartagTotal(eartagTotal);
|
|
|
+ eartagFarmAllStatusRepo.saveAndFlush(farmAllStatusEntity);
|
|
|
+
|
|
|
+ //同步更新redis缓存
|
|
|
+
|
|
|
+ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
+ }
|
|
|
}
|