|
|
@@ -2563,7 +2563,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
List<SmartUser> users = smartUserService.getPhoneUsers(isur.getPhone());
|
|
|
if (users != null && users.size() > 0) {
|
|
|
Optional<SmartUser> ownerUser = users.stream().filter(e -> org.springframework.util.StringUtils.hasText(e.getXOpenId())).findFirst();
|
|
|
- if(ownerUser != null && ownerUser.isPresent()){
|
|
|
+ if (ownerUser != null && ownerUser.isPresent()) {
|
|
|
su.setXOpenId(ownerUser.get().getXOpenId());
|
|
|
}
|
|
|
}
|
|
|
@@ -2843,53 +2843,6 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
}
|
|
|
//endregion
|
|
|
} else {
|
|
|
- //region 希沃新增学生信息
|
|
|
- if (useXw == 1) {
|
|
|
- CommonResult<String> insertStudent = SeewoInsertStudent(seewoClient, su.getName(), su.getCardNo(), su.getSexId(), su.getPhone(), classData.getClassUid());
|
|
|
- if (!insertStudent.isSuccess()) {
|
|
|
- return CommonResult.fail(insertStudent.getMessage());
|
|
|
- } else {
|
|
|
- su.setXwStudentUid(insertStudent.getData());
|
|
|
- }
|
|
|
-
|
|
|
- //上传图片
|
|
|
- List<PhotoServiceSavePhotosParam.ThirdSavePhotoQuery> photoList = new ArrayList<>();
|
|
|
- PhotoServiceSavePhotosParam.ThirdSavePhotoQuery photo = new PhotoServiceSavePhotosParam.ThirdSavePhotoQuery();
|
|
|
- photo.setPhotoUrl(su.getHeadImage());
|
|
|
- photo.setUserCode(su.getCardNo());
|
|
|
- photoList.add(photo);
|
|
|
- CommonResult result = SeewoInsertBatchPhoto(seewoClient, photoList, eSeewoUserType.Student.getValue());
|
|
|
- if (!result.isSuccess()) {
|
|
|
- return result;
|
|
|
- }
|
|
|
- }
|
|
|
- //endregion
|
|
|
-
|
|
|
- //region 百胜新增学生信息
|
|
|
- if (useBs == 1) {
|
|
|
- /**
|
|
|
- * 学生数据的有效期是到毕业年份的8月31日
|
|
|
- */
|
|
|
- String startTime = TimeExchange.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss");
|
|
|
- String endTime = queryGraduationYear(gradeData.getGradeNo());
|
|
|
- CommonResult<String> insertBsStudent = bsInsertStudent(su.getName(), su.getCardNo(), su.getSexId(), su.getHeadImage(), su.getTimeGroupId(), classData.getBsClassNo(), startTime, endTime, su.getIdCard());
|
|
|
-
|
|
|
- if (insertBsStudent.isSuccess()) {
|
|
|
- su.setBsStudentNo(insertBsStudent.getData());
|
|
|
- } else {
|
|
|
- //region 希沃删除学生
|
|
|
- //百胜数据插入失败后需要把已插入到希沃的数据删除
|
|
|
- CommonResult deleteStudent = SeewoDeleteStudent(seewoClient, classData.getClassUid(), oldCardNo);
|
|
|
- if (!deleteStudent.isSuccess()) {
|
|
|
- return CommonResult.fail(deleteStudent.getMessage());
|
|
|
- }
|
|
|
- //endregion
|
|
|
-
|
|
|
- return CommonResult.fail("切换身份后," + insertBsStudent.getMessage() + ",百胜无法插入学生数据");
|
|
|
- }
|
|
|
- }
|
|
|
- //endregion
|
|
|
-
|
|
|
if (oldIdentity.intValue() == eIdentityStatu.Parent.getValue()) {
|
|
|
|
|
|
List<SmartUser> studentDatas = smartUserService.getSmartUserIds(Arrays.asList(oldAffiliate.split(",")));
|
|
|
@@ -2938,6 +2891,54 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
}
|
|
|
//endregion
|
|
|
}
|
|
|
+
|
|
|
+ //region 希沃新增学生信息
|
|
|
+ if (useXw == 1) {
|
|
|
+ CommonResult<String> insertStudent = SeewoInsertStudent(seewoClient, su.getName(), su.getCardNo(), su.getSexId(), su.getPhone(), classData.getClassUid());
|
|
|
+ if (!insertStudent.isSuccess()) {
|
|
|
+ return CommonResult.fail(insertStudent.getMessage());
|
|
|
+ } else {
|
|
|
+ su.setXwStudentUid(insertStudent.getData());
|
|
|
+ }
|
|
|
+
|
|
|
+ //上传图片
|
|
|
+ List<PhotoServiceSavePhotosParam.ThirdSavePhotoQuery> photoList = new ArrayList<>();
|
|
|
+ PhotoServiceSavePhotosParam.ThirdSavePhotoQuery photo = new PhotoServiceSavePhotosParam.ThirdSavePhotoQuery();
|
|
|
+ photo.setPhotoUrl(su.getHeadImage());
|
|
|
+ photo.setUserCode(su.getCardNo());
|
|
|
+ photoList.add(photo);
|
|
|
+ CommonResult result = SeewoInsertBatchPhoto(seewoClient, photoList, eSeewoUserType.Student.getValue());
|
|
|
+ if (!result.isSuccess()) {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //endregion
|
|
|
+
|
|
|
+ //region 百胜新增学生信息
|
|
|
+ if (useBs == 1) {
|
|
|
+ /**
|
|
|
+ * 学生数据的有效期是到毕业年份的8月31日
|
|
|
+ */
|
|
|
+ String startTime = TimeExchange.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss");
|
|
|
+ String endTime = queryGraduationYear(gradeData.getGradeNo());
|
|
|
+ CommonResult<String> insertBsStudent = bsInsertStudent(su.getName(), su.getCardNo(), su.getSexId(), su.getHeadImage(), su.getTimeGroupId(), classData.getBsClassNo(), startTime, endTime, su.getIdCard());
|
|
|
+
|
|
|
+ if (insertBsStudent.isSuccess()) {
|
|
|
+ su.setBsStudentNo(insertBsStudent.getData());
|
|
|
+ } else {
|
|
|
+ //region 希沃删除学生
|
|
|
+ //百胜数据插入失败后需要把已插入到希沃的数据删除
|
|
|
+ CommonResult deleteStudent = SeewoDeleteStudent(seewoClient, classData.getClassUid(), oldCardNo);
|
|
|
+ if (!deleteStudent.isSuccess()) {
|
|
|
+ return CommonResult.fail(deleteStudent.getMessage());
|
|
|
+ }
|
|
|
+ //endregion
|
|
|
+
|
|
|
+ return CommonResult.fail("切换身份后," + insertBsStudent.getMessage() + ",百胜无法插入学生数据");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //endregion
|
|
|
+
|
|
|
}
|
|
|
|
|
|
} else if (usur.getIdentityId().intValue() == eIdentityStatu.Teacher.getValue()) {//教师
|
|
|
@@ -4633,7 +4634,15 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
*/
|
|
|
@Override
|
|
|
@DESRespondSecret(validated = false)
|
|
|
- public void smartUserExport(HttpServletResponse response, String userhead, smartUserExportRequest sure) {
|
|
|
+ public CommonResult smartUserExport(HttpServletResponse response, String userhead, smartUserExportRequest sure) {
|
|
|
+ if (sure.getGauageOutfitVos() == null) {
|
|
|
+ return CommonResult.fail("表头数据为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (sure.getGauageOutfitVos().size() <= 0) {
|
|
|
+ return CommonResult.fail("表头数据为空");
|
|
|
+ }
|
|
|
+
|
|
|
//region 角色判断
|
|
|
String userID = AesUtils.decrypt(userhead);
|
|
|
SmartUser operateData = smartUserService.getSmartById(Integer.valueOf(userID));
|
|
|
@@ -4946,7 +4955,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
ExcelUtils.excelDownload(workbook, "用户信息.xlsx", response);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ return CommonResult.ok("导出成功");
|
|
|
}
|
|
|
//endregion
|
|
|
|