|
@@ -52,6 +52,8 @@ import cn.com.qmth.examcloud.core.basic.dao.entity.CourseSpeciatlyRelationEntity
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.enums.CourseLevel;
|
|
|
import cn.com.qmth.examcloud.core.basic.service.CourseService;
|
|
|
import cn.com.qmth.examcloud.core.basic.service.bean.CourseInfo;
|
|
|
+import cn.com.qmth.examcloud.task.api.DataSyncCloudService;
|
|
|
+import cn.com.qmth.examcloud.task.api.request.SyncCourseReq;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
|
|
@@ -71,6 +73,9 @@ public class CourseController extends ControllerSupport {
|
|
|
@Autowired
|
|
|
CourseCloudService courseCloudService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ DataSyncCloudService dataSyncCloudService;
|
|
|
+
|
|
|
private static final String[] EXCEL_HEADER = new String[]{"课程名称", "课程代码", "层次(ZSB,GQZ,ALL)"};
|
|
|
|
|
|
|
|
@@ -452,6 +457,19 @@ public class CourseController extends ControllerSupport {
|
|
|
courseRepo.save(course);
|
|
|
}
|
|
|
|
|
|
+ for (Long courseId : courseIds) {
|
|
|
+ CourseEntity ce = courseRepo.findOne(courseId);
|
|
|
+ SyncCourseReq req = new SyncCourseReq();
|
|
|
+ req.setCode(ce.getCode());
|
|
|
+ req.setEnable(ce.getEnable());
|
|
|
+ req.setId(ce.getId());
|
|
|
+ req.setLevel(ce.getLevel().name());
|
|
|
+ req.setName(ce.getName());
|
|
|
+ req.setRootOrgId(ce.getRootOrgId());
|
|
|
+ req.setSyncType("update");
|
|
|
+ dataSyncCloudService.syncCourse(req);
|
|
|
+ }
|
|
|
+
|
|
|
return courseIds;
|
|
|
}
|
|
|
|
|
@@ -474,6 +492,19 @@ public class CourseController extends ControllerSupport {
|
|
|
courseRepo.save(course);
|
|
|
}
|
|
|
|
|
|
+ for (Long courseId : courseIds) {
|
|
|
+ CourseEntity ce = courseRepo.findOne(courseId);
|
|
|
+ SyncCourseReq req = new SyncCourseReq();
|
|
|
+ req.setCode(ce.getCode());
|
|
|
+ req.setEnable(ce.getEnable());
|
|
|
+ req.setId(ce.getId());
|
|
|
+ req.setLevel(ce.getLevel().name());
|
|
|
+ req.setName(ce.getName());
|
|
|
+ req.setRootOrgId(ce.getRootOrgId());
|
|
|
+ req.setSyncType("update");
|
|
|
+ dataSyncCloudService.syncCourse(req);
|
|
|
+ }
|
|
|
+
|
|
|
return courseIds;
|
|
|
}
|
|
|
}
|