设备支持自定义标定区域

This commit is contained in:
2025-06-06 15:09:27 +08:00
parent f9fcb06355
commit e32f231a8f
3 changed files with 10 additions and 1 deletions

View File

@ -61,4 +61,5 @@ public class DeviceConfigEntity {
private Integer imageFree;
private Integer videoFree;
private Long pairDevice;
private String videoCrop;
}

View File

@ -23,6 +23,7 @@ import com.ycwl.basic.utils.SnowFlakeUtil;
import com.ycwl.basic.utils.VideoReUploader;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
@ -288,6 +289,9 @@ public class VideoPieceGetter {
sourceEntity.setUrl(imgSource.getUrl());
sourceEntity.setPosJson(imgSource.getPosJson());
}
if (StringUtils.isNotBlank(config.getVideoCrop())) {
sourceEntity.setPosJson(config.getVideoCrop());
}
sourceEntity.setVideoUrl(url);
sourceEntity.setFaceSampleId(faceSampleId);
sourceEntity.setScenicId(device.getScenicId());
@ -314,6 +318,9 @@ public class VideoPieceGetter {
videoReUploader.addTask(sourceEntity.getId());
} else {
source.setVideoUrl(url);
if (StringUtils.isNotBlank(config.getVideoCrop())) {
source.setPosJson(config.getVideoCrop());
}
sourceMapper.update(source);
videoReUploader.addTask(source.getId());
}

View File

@ -40,7 +40,8 @@
enable_pre_book = #{enablePreBook},
image_free = #{imageFree},
video_free = #{videoFree},
pair_device = #{pairDevice}
pair_device = #{pairDevice},
video_crop = #{videoCrop}
where id = #{id}
</update>
<update id="updateEntity">