|
|
@@ -828,37 +828,39 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //初始化客户端
|
|
|
- SeewoClient seewoClient = new DefaultSeewoClient(new Account(seewoConfig.getAppId(), seewoConfig.getAppSecret()));
|
|
|
- ParentServiceBatchSaveOrUpdateParentsParam param = new ParentServiceBatchSaveOrUpdateParentsParam();
|
|
|
- //响应体,MimeType为 application/json
|
|
|
- ParentServiceBatchSaveOrUpdateParentsParam.RequestBody requestBody = ParentServiceBatchSaveOrUpdateParentsParam.RequestBody.builder()
|
|
|
- .build();
|
|
|
- param.setRequestBody(requestBody);
|
|
|
- //query
|
|
|
- ParentServiceBatchSaveOrUpdateParentsParam.Query query = ParentServiceBatchSaveOrUpdateParentsParam.Query.builder()
|
|
|
- .appId(seewoConfig.getAppId())
|
|
|
- .schoolUid(seewoConfig.getSchoolId())
|
|
|
- .build();
|
|
|
- requestBody.setQuery(query);
|
|
|
- query.setStudentParents(studentParents);
|
|
|
- param.setRequestBody(requestBody);
|
|
|
- ParentServiceBatchSaveOrUpdateParentsRequest request = new ParentServiceBatchSaveOrUpdateParentsRequest(param);
|
|
|
- String jsonString = JSON.toJSONString(request);
|
|
|
- logger.info("入参:" + request);
|
|
|
- //如果想要调用沙箱环境,请通过设置 request 对象的 serverUrl 属性,如:
|
|
|
- //request.setServerUrl("https://openapi.test.seewo.com")
|
|
|
- //执行请求,如果想获取到com.seewo.open.sdk.HttpResponse对象,请调用 seewoClient.execute 方法
|
|
|
- ParentServiceBatchSaveOrUpdateParentsResult parentResult = seewoClient.invoke(request);
|
|
|
- logger.info("出参:" + parentResult);
|
|
|
+ if(studentParents != null && studentParents.size() > 0){
|
|
|
+ //初始化客户端
|
|
|
+ SeewoClient seewoClient = new DefaultSeewoClient(new Account(seewoConfig.getAppId(), seewoConfig.getAppSecret()));
|
|
|
+ ParentServiceBatchSaveOrUpdateParentsParam param = new ParentServiceBatchSaveOrUpdateParentsParam();
|
|
|
+ //响应体,MimeType为 application/json
|
|
|
+ ParentServiceBatchSaveOrUpdateParentsParam.RequestBody requestBody = ParentServiceBatchSaveOrUpdateParentsParam.RequestBody.builder()
|
|
|
+ .build();
|
|
|
+ param.setRequestBody(requestBody);
|
|
|
+ //query
|
|
|
+ ParentServiceBatchSaveOrUpdateParentsParam.Query query = ParentServiceBatchSaveOrUpdateParentsParam.Query.builder()
|
|
|
+ .appId(seewoConfig.getAppId())
|
|
|
+ .schoolUid(seewoConfig.getSchoolId())
|
|
|
+ .build();
|
|
|
+ requestBody.setQuery(query);
|
|
|
+ query.setStudentParents(studentParents);
|
|
|
+ param.setRequestBody(requestBody);
|
|
|
+ ParentServiceBatchSaveOrUpdateParentsRequest request = new ParentServiceBatchSaveOrUpdateParentsRequest(param);
|
|
|
+ String jsonString = JSON.toJSONString(request);
|
|
|
+ logger.info("入参:" + request);
|
|
|
+ //如果想要调用沙箱环境,请通过设置 request 对象的 serverUrl 属性,如:
|
|
|
+ //request.setServerUrl("https://openapi.test.seewo.com")
|
|
|
+ //执行请求,如果想获取到com.seewo.open.sdk.HttpResponse对象,请调用 seewoClient.execute 方法
|
|
|
+ ParentServiceBatchSaveOrUpdateParentsResult parentResult = seewoClient.invoke(request);
|
|
|
+ logger.info("出参:" + parentResult);
|
|
|
|
|
|
|
|
|
- if (parentResult == null) {
|
|
|
- return CommonResult.fail("希沃学生家长数据添加失败!");
|
|
|
- }
|
|
|
+ if (parentResult == null) {
|
|
|
+ return CommonResult.fail("希沃学生家长数据添加失败!");
|
|
|
+ }
|
|
|
|
|
|
- if (!parentResult.getResponseBody().getCode().equals("000000")) {
|
|
|
- return CommonResult.fail("希沃平台:" + parentResult.getResponseBody().getMessage());
|
|
|
+ if (!parentResult.getResponseBody().getCode().equals("000000")) {
|
|
|
+ return CommonResult.fail("希沃平台:" + parentResult.getResponseBody().getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|