记得上下班打卡 | git大法好,push需谨慎

Commit 2d50e1f9 authored by jiangxiulong's avatar jiangxiulong

人体检测-更新redis不全导致的错误

parent 973e81c4
......@@ -85,7 +85,7 @@ public class KylinCameraController {
@RequestBody String requestBody
) {
try {
log.info("接收截图回调请求:[requestBody={}", requestBody);
log.info("接收截图回调请求:[requestBody={}]", requestBody);
// TODO: 2022/1/10 jxltodo 验签
ObjectMapper configure = JsonUtils.OM().configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
......@@ -139,27 +139,30 @@ public class KylinCameraController {
Wrappers.lambdaQuery(KylinCamera.class)
.eq(KylinCamera::getGbId, gbId)
);
KylinCamera camera = KylinCamera.getNew();
camera.setStatus(devicesVo.getStatus());
JsonNode jsonNode = JsonUtils.fromJson(devicesVo.getDescription(), JsonNode.class);
int siteType = jsonNode.get("siteType").asInt();
String fieldId = jsonNode.get("fieldId").asText();
fieldIds.add(fieldId);
camera.setSiteType(siteType);
camera.setFieldId(fieldId);
camera.setGbId(gbId);
if (null == kylinCamera) {
camera.setCameraId(IDGenerator.nextSnowId());
camera.setImgUrl("https://camera.zhengzai.tv/camera/live/".concat(gbId).concat(".jpg"));
cameraMapper.insert(camera);
kylinCamera = KylinCamera.getNew();
kylinCamera.setCameraId(IDGenerator.nextSnowId());
kylinCamera.setGbId(gbId);
kylinCamera.setStatus(devicesVo.getStatus());
kylinCamera.setSiteType(siteType);
kylinCamera.setFieldId(fieldId);
kylinCamera.setImgUrl("https://camera.zhengzai.tv/camera/live/".concat(gbId).concat(".jpg"));
cameraMapper.insert(kylinCamera);
} else {
camera.setUpdatedAt(LocalDateTime.now());
kylinCamera.setStatus(devicesVo.getStatus());
kylinCamera.setSiteType(siteType);
kylinCamera.setFieldId(fieldId);
kylinCamera.setUpdatedAt(LocalDateTime.now());
cameraMapper.update(
camera,
kylinCamera,
Wrappers.lambdaUpdate(KylinCamera.class).eq(KylinCamera::getGbId, gbId)
);
}
dataUtils.setCameraDeviceInfo(camera);
dataUtils.setCameraDeviceInfo(kylinCamera);
}
dataUtils.delCameraDevicesList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment