Selaa lähdekoodia

学生通讯录

liu 2 vuotta sitten
vanhempi
commit
ebd16016aa

+ 4 - 0
src/main/java/com/template/api/SmartUserControllerAPI.java

@@ -260,4 +260,8 @@ public interface SmartUserControllerAPI {
     @ApiOperation(value = "在校统计", notes = "在校统计", httpMethod = "GET")
     CommonResult statisticsCampus(@RequestParam Integer classId,@RequestParam String dateTime);
 
+    @GetMapping(value = "/addressBook")
+    @ApiOperation(value = "个人通讯录", notes = "个人通讯录", httpMethod = "GET")
+    CommonResult addressBook(@RequestParam Integer userId);
+
 }

+ 16 - 0
src/main/java/com/template/controller/SmartUserController.java

@@ -4958,6 +4958,22 @@ public class SmartUserController implements SmartUserControllerAPI {
 
         return CommonResult.ok(jsonObject);
     }
+
+    @Override
+    @DESRespondSecret(validated = true)
+    public CommonResult addressBook(Integer userId) {
+//        获取学生信息
+        SmartUser smartById = smartUserService.getSmartById(userId);
+//        获取家长信息
+        List<SmartUser> list=smartUserService.getAddressBook(userId);
+
+        HashMap<String, Object> map = new HashMap<>();
+        map.put("student",smartById);
+
+        map.put("patriarch",list);
+
+        return CommonResult.ok(map);
+    }
     //endregion
 
     //region 用户导出

+ 2 - 0
src/main/java/com/template/services/SmartUserService.java

@@ -157,4 +157,6 @@ public interface SmartUserService extends IService<SmartUser> {
     List<StatisticsCampusVo> getClassStudent(Integer classId);
 
     List<SmartUser> queryTeachers();
+
+    List<SmartUser> getAddressBook(Integer userId);
 }

+ 9 - 0
src/main/java/com/template/services/impl/SmartUserServiceImpl.java

@@ -409,5 +409,14 @@ public class SmartUserServiceImpl extends ServiceImpl<SmartUserMapper, SmartUser
         return result;
     }
 
+    @Override
+    public List<SmartUser> getAddressBook(Integer userId) {
+        LambdaQueryWrapper<SmartUser> wrapper=new LambdaQueryWrapper<>();
+        wrapper.eq(SmartUser::getAffiliate,userId);
+        wrapper.eq(SmartUser::getIsCancel,0);
+        List<SmartUser> list = this.list(wrapper);
+        return list;
+    }
+
 
 }