|
@@ -4,12 +4,14 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.huimv.receiver.farm.dao.entity.SysCameraAreaEntity;
|
|
|
import com.huimv.receiver.farm.dao.repo.SysCameraAreaRepo;
|
|
|
import com.huimv.receiver.farm.service.INetIPService;
|
|
|
+import com.huimv.receiver.utils.DateUtil;
|
|
|
import com.huimv.receiver.utils.TextUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
+import java.text.ParseException;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -27,9 +29,11 @@ public class NetIPServiceImpl implements INetIPService {
|
|
|
private TextUtil textUtil;
|
|
|
@Autowired
|
|
|
private SysCameraAreaRepo cameraAreaRepo;
|
|
|
+ @Autowired
|
|
|
+ private DateUtil dateUtil;
|
|
|
|
|
|
@Override
|
|
|
- public void updateNetIP(String data) throws UnsupportedEncodingException {
|
|
|
+ public void updateNetIP(String data) throws UnsupportedEncodingException, ParseException {
|
|
|
JSONObject netIPJo = JSONObject.parseObject(textUtil.translateSymbol(data));
|
|
|
log.info("接收牧场端发送的公网信息>>"+netIPJo);
|
|
|
String farmId = netIPJo.getString("farmId");
|
|
@@ -42,7 +46,8 @@ public class NetIPServiceImpl implements INetIPService {
|
|
|
cameraAreaEntity.setPublicUrl(netIp);
|
|
|
}
|
|
|
cameraAreaRepo.saveAll(cameraAreaEntityList);
|
|
|
- log.info("已经完成牧场公网IP更新>>"+netIp);
|
|
|
+
|
|
|
+ log.info(dateUtil.getTodayMissionText()+",已经完成牧场公网IP更新>>"+netIp);
|
|
|
}
|
|
|
}
|
|
|
}
|