|
@@ -91,15 +91,10 @@ public class StudentOuterServiceProvider extends ControllerSupport implements St
|
|
|
studentCodeList.add(req.getStudentCode());
|
|
|
request.setStudentCodeList(studentCodeList);
|
|
|
|
|
|
- return processOuterSaveStudentReq(request, req.getPhotoUrl(), req.getOperator());
|
|
|
- }
|
|
|
-
|
|
|
- private OuterSaveStudentResp processOuterSaveStudentReq(SaveStudentReq saveStudentReq,
|
|
|
- String photoUrl, String operator) {
|
|
|
// 保存学生
|
|
|
- SaveStudentResp response = studentCloudService.saveStudent(saveStudentReq);
|
|
|
+ SaveStudentResp response = studentCloudService.saveStudent(request);
|
|
|
// 处理照片
|
|
|
- processPhotoUrl(saveStudentReq, photoUrl, operator);
|
|
|
+ processPhotoUrl(rootOrgId, req.getIdentityNumber(), req.getPhotoUrl(), req.getOperator());
|
|
|
|
|
|
OuterSaveStudentResp resp = new OuterSaveStudentResp();
|
|
|
resp.setOrgId(response.getOrgId());
|
|
@@ -111,12 +106,15 @@ public class StudentOuterServiceProvider extends ControllerSupport implements St
|
|
|
|
|
|
/**
|
|
|
* 处理照片
|
|
|
- *
|
|
|
- * @param req
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param rootOrgId
|
|
|
+ * @param identityNumber
|
|
|
+ * @param photoUrl
|
|
|
+ * @param operator
|
|
|
*/
|
|
|
- private void processPhotoUrl(SaveStudentReq request, String photoUrl, String operator) {
|
|
|
- Long rootOrgId = request.getRootOrgId();
|
|
|
- String identityNumber = request.getIdentityNumber();
|
|
|
+ private void processPhotoUrl(Long rootOrgId, String identityNumber, String photoUrl,
|
|
|
+ String operator) {
|
|
|
|
|
|
if (StringUtils.isNotBlank(photoUrl)) {
|
|
|
byte[] bs = HttpClientUtil.get(photoUrl);
|
|
@@ -162,9 +160,11 @@ public class StudentOuterServiceProvider extends ControllerSupport implements St
|
|
|
@Override
|
|
|
public OuterBatchSaveStudentResp batchSaveStudent(
|
|
|
@RequestBody @ApiParam(required = true) OuterBatchSaveStudentReq outerBatchSaveStudentReq) {
|
|
|
+
|
|
|
if (!getEnterpriseRootOrgId().equals(outerBatchSaveStudentReq.getRootOrgId())) {
|
|
|
throw new StatusException("1000001", "rootOrgId is wrong");
|
|
|
}
|
|
|
+
|
|
|
List<Student4BatchBean> studentList = outerBatchSaveStudentReq.getStudentList();
|
|
|
|
|
|
List<StudentStatus4BatchBean> successList = Lists.newArrayList();
|
|
@@ -185,10 +185,15 @@ public class StudentOuterServiceProvider extends ControllerSupport implements St
|
|
|
request.setStudentCodeList(studentCodeList);
|
|
|
|
|
|
try {
|
|
|
- OuterSaveStudentResp outerSaveStudentResp = processOuterSaveStudentReq(request,
|
|
|
+
|
|
|
+ // 保存学生
|
|
|
+ SaveStudentResp response = studentCloudService.saveStudent(request);
|
|
|
+ // 处理照片
|
|
|
+ processPhotoUrl(outerBatchSaveStudentReq.getRootOrgId(), req.getIdentityNumber(),
|
|
|
req.getPhotoUrl(), req.getOperator());
|
|
|
+
|
|
|
StudentStatus4BatchBean studentStatus4BatchBeanSuccess = new StudentStatus4BatchBean();
|
|
|
- studentStatus4BatchBeanSuccess.setStudentId(outerSaveStudentResp.getStudentId());
|
|
|
+ studentStatus4BatchBeanSuccess.setStudentId(response.getStudentId());
|
|
|
studentStatus4BatchBeanSuccess.setIdentityNumber(req.getIdentityNumber());
|
|
|
studentStatus4BatchBeanSuccess.setName(req.getName());
|
|
|
studentStatus4BatchBeanSuccess.setStudentCode(req.getStudentCode());
|