|
@@ -17,6 +17,7 @@ import cn.com.qmth.examcloud.core.print.service.CourseStatisticService;
|
|
|
import cn.com.qmth.examcloud.core.print.service.ExamStructureService;
|
|
|
import cn.com.qmth.examcloud.core.print.service.PrintingProjectService;
|
|
|
import cn.com.qmth.examcloud.core.print.service.bean.common.ExamInfo;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -46,8 +47,10 @@ public class SyncCloudServiceProvider extends ControllerSupport implements Handl
|
|
|
*/
|
|
|
@PostMapping("/syncOrg")
|
|
|
public SyncOrgResp syncOrg(@RequestBody SyncOrgReq req) {
|
|
|
- printingProjectService.syncOrgNameByOrgId(req.getRootId(), req.getName());
|
|
|
- examStructureService.syncOrgNameByOrgId(req.getRootId(), req.getName());
|
|
|
+ if (StringUtils.isNotBlank(req.getName())) {
|
|
|
+ printingProjectService.syncOrgNameByOrgId(req.getRootId(), req.getName());
|
|
|
+ examStructureService.syncOrgNameByOrgId(req.getRootId(), req.getName());
|
|
|
+ }
|
|
|
return new SyncOrgResp();
|
|
|
}
|
|
|
|
|
@@ -56,12 +59,14 @@ public class SyncCloudServiceProvider extends ControllerSupport implements Handl
|
|
|
*/
|
|
|
@PostMapping("syncExam")
|
|
|
public SyncExamResp syncExam(@RequestBody SyncExamReq req) {
|
|
|
- printingProjectService.syncExamNameByExamId(req.getId(), req.getName());
|
|
|
- examStructureService.syncExamNameByExamId(req.getId(), req.getName());
|
|
|
+ if (StringUtils.isNotBlank(req.getName())) {
|
|
|
+ printingProjectService.syncExamNameByExamId(req.getId(), req.getName());
|
|
|
+ examStructureService.syncExamNameByExamId(req.getId(), req.getName());
|
|
|
|
|
|
- if (ExamType.isTradition(req.getExamType())) {
|
|
|
- ExamInfo info = new ExamInfo(req.getRootOrgId(), req.getRootOrgName(), req.getId(), req.getName());
|
|
|
- printingProjectService.syncPrintingProject(info);
|
|
|
+ if (ExamType.isTradition(req.getExamType())) {
|
|
|
+ ExamInfo info = new ExamInfo(req.getRootOrgId(), req.getRootOrgName(), req.getId(), req.getName());
|
|
|
+ printingProjectService.syncPrintingProject(info);
|
|
|
+ }
|
|
|
}
|
|
|
return new SyncExamResp();
|
|
|
}
|
|
@@ -87,8 +92,10 @@ public class SyncCloudServiceProvider extends ControllerSupport implements Handl
|
|
|
*/
|
|
|
@PostMapping("/syncCourse")
|
|
|
public SyncCourseResp syncCourse(@RequestBody SyncCourseReq req) {
|
|
|
- coursePaperService.syncCourseNameByCourseId(req.getId(), req.getName());
|
|
|
- courseStatisticService.syncCourseNameByCourseId(req.getId(), req.getName());
|
|
|
+ if (StringUtils.isNotBlank(req.getName())) {
|
|
|
+ coursePaperService.syncCourseNameByCourseId(req.getId(), req.getName());
|
|
|
+ courseStatisticService.syncCourseNameByCourseId(req.getId(), req.getName());
|
|
|
+ }
|
|
|
return new SyncCourseResp();
|
|
|
}
|
|
|
|
|
@@ -100,4 +107,13 @@ public class SyncCloudServiceProvider extends ControllerSupport implements Handl
|
|
|
return new SyncSpecialtyResp();
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("syncUser")
|
|
|
+ public SyncUserResp syncUser(SyncUserReq req) {
|
|
|
+ if (StringUtils.isNotBlank(req.getName())) {
|
|
|
+ printingProjectService.syncPmNameByPmId(req.getId(), req.getName());
|
|
|
+ printingProjectService.syncSupplierNameBySupplierId(req.getId(), req.getName());
|
|
|
+ }
|
|
|
+ return new SyncUserResp();
|
|
|
+ }
|
|
|
+
|
|
|
}
|