|
@@ -81,15 +81,19 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
|
|
|
/**
|
|
|
* 单个同步
|
|
|
+ *
|
|
|
* @param printPlanId
|
|
|
*/
|
|
|
@Override
|
|
|
public void syncDataCloud(Long printPlanId) {
|
|
|
ExamPrintPlan examPrintPlan = examPrintPlanService.getById(printPlanId);
|
|
|
- if(examPrintPlan == null){
|
|
|
+ if (examPrintPlan == null) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("印刷计划数据异常");
|
|
|
}
|
|
|
- if(Objects.nonNull(examPrintPlan.getSyncStatus()) && examPrintPlan.getSyncStatus()){
|
|
|
+ if (!PrintPlanStatusEnum.PRINT_FINISH.equals(examPrintPlan.getStatus())) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("印刷计划未结束,不能同步数据");
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(examPrintPlan.getSyncStatus()) && examPrintPlan.getSyncStatus()) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("印刷计划数据同步成功");
|
|
|
}
|
|
|
executors.execute(syncData(examPrintPlan));
|
|
@@ -113,6 +117,9 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
@Transactional
|
|
|
public void doSyncCore(ExamPrintPlan examPrintPlan, TBSyncTask syncTask) {
|
|
|
try {
|
|
|
+ if (!PrintPlanStatusEnum.PRINT_FINISH.equals(examPrintPlan.getStatus())) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("印刷计划未结束,不能同步数据");
|
|
|
+ }
|
|
|
// 校验同步url
|
|
|
validatUrl();
|
|
|
UpdateWrapper<TBSyncTask> tbSyncTaskUpdateWrapper = new UpdateWrapper<>();
|