|
@@ -23,6 +23,8 @@ import cn.com.qmth.examcloud.web.redis.RedisClient;
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
+
|
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONException;
|
|
import org.json.JSONException;
|
|
@@ -32,7 +34,6 @@ import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.domain.Example;
|
|
import org.springframework.data.domain.Example;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
-import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -733,6 +734,7 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
for (ExamCaptureBean bean : examCaptures) {
|
|
for (ExamCaptureBean bean : examCaptures) {
|
|
ExamCaptureEntity examCaptureEntity = copyExamCaptureFrom(bean, examRecordDataId);
|
|
ExamCaptureEntity examCaptureEntity = copyExamCaptureFrom(bean, examRecordDataId);
|
|
saveExamCaptureCameraInfo(examCaptureEntity);
|
|
saveExamCaptureCameraInfo(examCaptureEntity);
|
|
|
|
+ examCaptureEntity.setCameraInfos(null);
|
|
examCaptureRepo.saveAndFlush(examCaptureEntity);
|
|
examCaptureRepo.saveAndFlush(examCaptureEntity);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -755,7 +757,10 @@ public class SyncExamDataCloudServiceProvider extends ControllerSupport implemen
|
|
}else {
|
|
}else {
|
|
ci.setVirtualCamera(false);
|
|
ci.setVirtualCamera(false);
|
|
}
|
|
}
|
|
- examCaptureCameraInfoRepo.saveAndFlush(ci);
|
|
|
|
|
|
+ List<ExamCaptureCameraInfoEntity> olds=examCaptureCameraInfoRepo.findByExamRecordDataIdAndPidAndVidAndName(examCaptureEntity.getExamRecordDataId(),ci.getPid(),ci.getVid(),ci.getName());
|
|
|
|
+ if(CollectionUtils.isEmpty(olds)) {
|
|
|
|
+ examCaptureCameraInfoRepo.saveAndFlush(ci);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
LOG.error("保存摄像信息失败:"+examCaptureEntity.getExamRecordDataId()+" "+examCaptureEntity.getCameraInfos(), e);
|
|
LOG.error("保存摄像信息失败:"+examCaptureEntity.getExamRecordDataId()+" "+examCaptureEntity.getCameraInfos(), e);
|