|
|
@@ -2347,10 +2347,12 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
int useBs = 1;
|
|
|
int useXw = 1;
|
|
|
|
|
|
- //重复性判断
|
|
|
- int existCount = smartUserService.querySmartUserByCardNo(isur.getCardNo());
|
|
|
- if (existCount > 0) {
|
|
|
- return CommonResult.fail("当前学号已存在,请勿重复添加");
|
|
|
+ if(org.springframework.util.StringUtils.hasText(isur.getCardNo())){
|
|
|
+ //重复性判断
|
|
|
+ int existCount = smartUserService.querySmartUserByCardNo(isur.getCardNo());
|
|
|
+ if (existCount > 0) {
|
|
|
+ return CommonResult.fail("当前学号已存在,请勿重复添加");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
SeewoClient seewoClient = new DefaultSeewoClient(new Account(seewoConfig.getAppId(), seewoConfig.getAppSecret()));
|
|
|
@@ -2924,6 +2926,22 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
+ if (su.getDuties().intValue() == eDuties.ClassTeacher.getValue()) {
|
|
|
+ //获取班级Uid
|
|
|
+ SmartClass classData = smartClassService.getSmartClassById(su.getSchoolClass());
|
|
|
+ if (classData == null) {
|
|
|
+ return CommonResult.fail("班级数据无效,新增失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ //region 将班主任推送到希沃
|
|
|
+ if (useXw == 1) {
|
|
|
+ CommonResult pushMaster = SeewoPushMaster(seewoClient, su.getPhone(), classData.getClassUid());
|
|
|
+ if (!pushMaster.isSuccess()) {
|
|
|
+ return CommonResult.fail(pushMaster.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //endregion
|
|
|
+ }
|
|
|
//endregion
|
|
|
|
|
|
SmartDepartment departmentData = smartDepartmentService.getSmartById(su.getDepartmentId());
|
|
|
@@ -4916,6 +4934,8 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
|
|
|
//部门数据集合
|
|
|
List<SmartDepartment> departments = smartDepartmentService.list(null);
|
|
|
+ //年级数据
|
|
|
+ List<SmartGrade> grades = smartGradeService.list(null);
|
|
|
|
|
|
WechatUserVo userData = new WechatUserVo();
|
|
|
userData.setId(su.getId());
|
|
|
@@ -4934,7 +4954,12 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
}
|
|
|
|
|
|
userData.setHeadImage(su.getHeadImage());
|
|
|
- userData.setGrade(su.getGrade());
|
|
|
+ if(org.springframework.util.StringUtils.hasText(su.getGrade())){
|
|
|
+ Optional<SmartGrade> oGrade = grades.stream().filter(e -> String.valueOf(e.getId()).equals(su.getGrade())).findFirst();
|
|
|
+ if(oGrade != null && oGrade.isPresent()){
|
|
|
+ userData.setGrade(oGrade.get().getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
userData.setCollege(su.getCollege());
|
|
|
userData.setSpeciality(su.getSpeciality());
|
|
|
userData.setSchoolClass(su.getSchoolClass());
|