Browse Source

用户管理

夏文涛 2 năm trước cách đây
mục cha
commit
e4025839dd
37 tập tin đã thay đổi với 2108 bổ sung324 xóa
  1. 331 303
      .idea/workspace.xml
  2. 3 3
      src/main/java/com/template/AutoCode.java
  3. 35 0
      src/main/java/com/template/api/SmartAttendanceControllerAPI.java
  4. 35 0
      src/main/java/com/template/api/SmartClassControllerAPI.java
  5. 8 2
      src/main/java/com/template/api/SmartDepartmentControllerAPI.java
  6. 35 0
      src/main/java/com/template/api/SmartGradeControllerAPI.java
  7. 56 2
      src/main/java/com/template/controller/ScheduleController.java
  8. 43 0
      src/main/java/com/template/controller/SmartAttendanceController.java
  9. 42 0
      src/main/java/com/template/controller/SmartClassController.java
  10. 111 12
      src/main/java/com/template/controller/SmartDepartmentController.java
  11. 44 0
      src/main/java/com/template/controller/SmartGradeController.java
  12. 4 0
      src/main/java/com/template/controller/SmartUserController.java
  13. 18 0
      src/main/java/com/template/mapper/SmartAttendanceMapper.java
  14. 18 0
      src/main/java/com/template/mapper/SmartClassMapper.java
  15. 18 0
      src/main/java/com/template/mapper/SmartGradeMapper.java
  16. 308 0
      src/main/java/com/template/model/pojo/AttendanceRuleListSchoolAttendRuleParam.java
  17. 35 0
      src/main/java/com/template/model/pojo/AttendanceRuleListSchoolAttendRuleRequest.java
  18. 218 0
      src/main/java/com/template/model/pojo/AttendanceRuleListSchoolAttendRuleResult.java
  19. 121 0
      src/main/java/com/template/model/pojo/OrgClassOpenSeewoUcOpenV1ClassFullParam.java
  20. 35 0
      src/main/java/com/template/model/pojo/OrgClassOpenSeewoUcOpenV1ClassFullRequest.java
  21. 126 0
      src/main/java/com/template/model/pojo/OrgClassOpenSeewoUcOpenV1ClassFullResult.java
  22. 71 0
      src/main/java/com/template/model/pojo/SmartAttendance.java
  23. 71 0
      src/main/java/com/template/model/pojo/SmartClass.java
  24. 65 0
      src/main/java/com/template/model/pojo/SmartGrade.java
  25. 30 0
      src/main/java/com/template/model/request/insertDepartmentRequest.java
  26. 35 0
      src/main/java/com/template/model/request/updateDepartmentRequest.java
  27. 38 0
      src/main/java/com/template/model/vo/DepartmentTreeVo.java
  28. 16 0
      src/main/java/com/template/services/SmartAttendanceService.java
  29. 16 0
      src/main/java/com/template/services/SmartClassService.java
  30. 8 0
      src/main/java/com/template/services/SmartDepartmentService.java
  31. 16 0
      src/main/java/com/template/services/SmartGradeService.java
  32. 20 0
      src/main/java/com/template/services/impl/SmartAttendanceServiceImpl.java
  33. 20 0
      src/main/java/com/template/services/impl/SmartClassServiceImpl.java
  34. 32 0
      src/main/java/com/template/services/impl/SmartDepartmentServiceImpl.java
  35. 20 0
      src/main/java/com/template/services/impl/SmartGradeServiceImpl.java
  36. 3 1
      src/main/resources/application-dev.yml
  37. 3 1
      target/classes/application-dev.yml

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 331 - 303
.idea/workspace.xml


+ 3 - 3
src/main/java/com/template/AutoCode.java

@@ -39,10 +39,10 @@ public class AutoCode {
         mpg.setGlobalConfig(gc);
 //2、设置数据源
         DataSourceConfig dsc = new DataSourceConfig();
-        dsc.setUrl("jdbc:mysql://192.168.1.34:3306/smart_middle?useUnicode=tru&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true&allowPublicKeyRetrieval=true&allowMultiQueries=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai");
+        dsc.setUrl("jdbc:mysql://111.231.169.217:3306/smart_middle?useUnicode=tru&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true&allowPublicKeyRetrieval=true&allowMultiQueries=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai");
         dsc.setDriverName("com.mysql.cj.jdbc.Driver");
         dsc.setUsername("root");
-        dsc.setPassword("Ro0!ot_369!");
+        dsc.setPassword("Chuanghai2023.");
         dsc.setDbType(DbType.MYSQL);
         mpg.setDataSource(dsc);
         //3、包的配置
@@ -56,7 +56,7 @@ public class AutoCode {
         mpg.setPackageInfo(pc);
         //4、策略配置
         StrategyConfig strategy = new StrategyConfig();
-        strategy.setInclude("smart_data_class","smart_data_source","smart_data_source_log"); // 设置要映射的表名
+        strategy.setInclude("smart_class","smart_grade","smart_attendance"); // 设置要映射的表名
         strategy.setNaming(NamingStrategy.underline_to_camel);//下划线转驼峰
         strategy.setColumnNaming(NamingStrategy.underline_to_camel);//下划线转驼峰
         strategy.setEntityLombokModel(true); // 自动lombok;

+ 35 - 0
src/main/java/com/template/api/SmartAttendanceControllerAPI.java

@@ -0,0 +1,35 @@
+package com.template.api;
+
+import com.template.model.pojo.SmartAttendance;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/3/30 星期四 17:28
+ * @Description: com.video.api
+ * @Version: 1.0
+ */
+@RequestMapping("/api/smartAttendance")
+@Api(tags = {"SmartAttendanceControllerAPI"}, value = "考勤")
+public interface SmartAttendanceControllerAPI {
+    @PostMapping(value = "/insertSmartAttendance")
+    @ApiOperation(value = "添加考勤", notes = "添加考勤数据", httpMethod = "POST")
+    CommonResult insertSmartAttendance(@Validated @RequestBody SmartAttendance smartApply, BindingResult bindingResult);
+
+    @PostMapping(value = "/updateSmartAttendanceById")
+    @ApiOperation(value = "编辑考勤数据", notes = "编辑考勤数据", httpMethod = "POST")
+    CommonResult updateSmartAttendanceById(@Validated @RequestBody SmartAttendance ra, BindingResult bindingResult);
+
+    @GetMapping(value = "/queryPageSmartAttendance")
+    @ApiOperation(value = "考勤分页数据", notes = "考勤分页数据", httpMethod = "GET")
+    CommonResult queryPageSmartAttendances(@RequestParam int currentPage, @RequestParam int pageCount, String name);
+
+    @GetMapping(value = "/deleteSmartAttendanceById")
+    @ApiOperation(value = "根据ID删除指定考勤", notes = "根据ID删除指定考勤", httpMethod = "GET")
+    CommonResult deleteSmartAttendanceById(@RequestParam int id);
+}

+ 35 - 0
src/main/java/com/template/api/SmartClassControllerAPI.java

@@ -0,0 +1,35 @@
+package com.template.api;
+
+import com.template.model.pojo.SmartClass;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/3/30 星期四 17:28
+ * @Description: com.video.api
+ * @Version: 1.0
+ */
+@RequestMapping("/api/smartClass")
+@Api(tags = {"SmartClassControllerAPI"}, value = "班级")
+public interface SmartClassControllerAPI {
+    @PostMapping(value = "/insertSmartClass")
+    @ApiOperation(value = "添加班级", notes = "添加班级数据", httpMethod = "POST")
+    CommonResult insertSmartClass(@Validated @RequestBody SmartClass smartApply, BindingResult bindingResult);
+
+    @PostMapping(value = "/updateSmartClassById")
+    @ApiOperation(value = "编辑班级数据", notes = "编辑班级数据", httpMethod = "POST")
+    CommonResult updateSmartClassById(@Validated @RequestBody SmartClass ra, BindingResult bindingResult);
+
+    @GetMapping(value = "/queryPageSmartClass")
+    @ApiOperation(value = "班级分页数据", notes = "班级分页数据", httpMethod = "GET")
+    CommonResult queryPageSmartClasss(@RequestParam int currentPage, @RequestParam int pageCount, String name);
+
+    @GetMapping(value = "/deleteSmartClassById")
+    @ApiOperation(value = "根据ID删除指定班级", notes = "根据ID删除指定班级", httpMethod = "GET")
+    CommonResult deleteSmartClassById(@RequestParam int id);
+}

+ 8 - 2
src/main/java/com/template/api/SmartDepartmentControllerAPI.java

@@ -1,6 +1,8 @@
 package com.template.api;
 
 import com.template.model.pojo.SmartDepartment;
+import com.template.model.request.insertDepartmentRequest;
+import com.template.model.request.updateDepartmentRequest;
 import com.template.model.result.CommonResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -19,11 +21,11 @@ import org.springframework.web.bind.annotation.*;
 public interface SmartDepartmentControllerAPI {
     @PostMapping(value = "/insertSmartDepartment")
     @ApiOperation(value = "添加部门", notes = "添加部门数据", httpMethod = "POST")
-    CommonResult insertSmartDepartment(@Validated @RequestBody SmartDepartment smartApply, BindingResult bindingResult);
+    CommonResult insertSmartDepartment(@Validated @RequestBody insertDepartmentRequest smartApply, BindingResult bindingResult);
 
     @PostMapping(value = "/updateSmartDepartmentById")
     @ApiOperation(value = "编辑部门数据", notes = "编辑部门数据", httpMethod = "POST")
-    CommonResult updateSmartDepartmentById(@Validated @RequestBody SmartDepartment ra, BindingResult bindingResult);
+    CommonResult updateSmartDepartmentById(@Validated @RequestBody updateDepartmentRequest udr, BindingResult bindingResult);
 
     @GetMapping(value = "/queryPageSmartDepartment")
     @ApiOperation(value = "部门分页数据", notes = "部门分页数据", httpMethod = "GET")
@@ -32,4 +34,8 @@ public interface SmartDepartmentControllerAPI {
     @GetMapping(value = "/deleteSmartDepartmentById")
     @ApiOperation(value = "根据ID删除指定部门", notes = "根据ID删除指定部门", httpMethod = "GET")
     CommonResult deleteSmartDepartmentById(@RequestParam int id);
+
+    @GetMapping(value = "/queryDepartmentTree")
+    @ApiOperation(value = "查询部门树形结构数据", notes = "查询部门树形结构数据", httpMethod = "GET")
+    CommonResult queryDepartmentTree(String name);
 }

+ 35 - 0
src/main/java/com/template/api/SmartGradeControllerAPI.java

@@ -0,0 +1,35 @@
+package com.template.api;
+
+import com.template.model.pojo.SmartGrade;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/3/30 星期四 17:28
+ * @Description: com.video.api
+ * @Version: 1.0
+ */
+@RequestMapping("/api/smartGrade")
+@Api(tags = {"SmartGradeControllerAPI"}, value = "年级")
+public interface SmartGradeControllerAPI {
+    @PostMapping(value = "/insertSmartGrade")
+    @ApiOperation(value = "添加年级", notes = "添加年级数据", httpMethod = "POST")
+    CommonResult insertSmartGrade(@Validated @RequestBody SmartGrade smartApply, BindingResult bindingResult);
+
+    @PostMapping(value = "/updateSmartGradeById")
+    @ApiOperation(value = "编辑年级数据", notes = "编辑年级数据", httpMethod = "POST")
+    CommonResult updateSmartGradeById(@Validated @RequestBody SmartGrade ra, BindingResult bindingResult);
+
+    @GetMapping(value = "/queryPageSmartGrade")
+    @ApiOperation(value = "年级分页数据", notes = "年级分页数据", httpMethod = "GET")
+    CommonResult queryPageSmartGrades(@RequestParam int currentPage, @RequestParam int pageCount, String name);
+
+    @GetMapping(value = "/deleteSmartGradeById")
+    @ApiOperation(value = "根据ID删除指定年级", notes = "根据ID删除指定年级", httpMethod = "GET")
+    CommonResult deleteSmartGradeById(@RequestParam int id);
+}

+ 56 - 2
src/main/java/com/template/controller/ScheduleController.java

@@ -1,16 +1,33 @@
 package com.template.controller;
 
+import com.seewo.open.sdk.DefaultSeewoClient;
+import com.seewo.open.sdk.SeewoClient;
+import com.seewo.open.sdk.auth.Account;
+import com.template.common.utils.TimeExchange;
+import com.template.config.ParkConfig;
+import com.template.config.ScheduleConfig;
+import com.template.config.SeewoConfig;
+import com.template.model.pojo.AttendanceServiceListAttendClassRecordsParam;
+import com.template.model.pojo.AttendanceServiceListAttendClassRecordsRequest;
+import com.template.model.pojo.AttendanceServiceListAttendClassRecordsResult;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.Resource;
 
 
 @Component
 //@EnableAsync
 public class ScheduleController {
 
+    @Resource
+    private SeewoConfig seewoConfig;
+
+    @Resource
+    private ScheduleConfig scheduleConfig;
+
     /**
      * @Scheduled注解会在默认情况下以单线程的方式执行定时任务。 这个“单线程”指两个方面:
      * 如果一个定时任务执行时间大于其任务间隔时间,那么下一次将会等待上一次执行结束后再继续执行。
@@ -37,7 +54,44 @@ public class ScheduleController {
     @Scheduled(cron = "0 */1 * * * ? ")
     @Transactional(rollbackFor = {Exception.class})
     public void autoDispatch() throws Exception {
-        String sdsds = "";
-        System.out.println("");
+
+        if(scheduleConfig.getIsOpen().equals("1")){
+
+            //循环班级的classUid
+
+
+            /**
+             * 定时获取考勤
+             */
+            //初始化客户端
+            SeewoClient seewoClient = new DefaultSeewoClient(new Account(seewoConfig.getAppId(), seewoConfig.getAppSecret()));
+            AttendanceServiceListAttendClassRecordsParam param = new AttendanceServiceListAttendClassRecordsParam();
+            //响应体,MimeType为 application/json
+            AttendanceServiceListAttendClassRecordsParam.RequestBody requestBody = AttendanceServiceListAttendClassRecordsParam.RequestBody.builder()
+                    .build();
+            param.setRequestBody(requestBody);
+            //query
+            AttendanceServiceListAttendClassRecordsParam.Query query = AttendanceServiceListAttendClassRecordsParam.Query.builder()
+                    .eventId("1316302749783220225")//考勤事件ID 固定写死
+                    .attendDate(TimeExchange.getDate())//考勤日期
+                    .appId(seewoConfig.getAppId())//appid
+                    .grade(1)//年级序号
+                    .classUid("123456789")//班级uid 班级uid与年级序号、班级序号二选一确定具体的班级,如果都填以classUid为准
+                    .clazz(1)//班级序号
+                    .schoolUid(seewoConfig.getSchoolId())//学校uid
+                    .attendType(1)//考勤类型 时间考勤(默认):1  课程考勤:2
+                    .build();
+            requestBody.setQuery(query);
+            param.setRequestBody(requestBody);
+            AttendanceServiceListAttendClassRecordsRequest request = new AttendanceServiceListAttendClassRecordsRequest(param);
+            System.out.println("入参:" +request);
+            //如果想要调用沙箱环境,请通过设置 request 对象的 serverUrl 属性,如:
+            //request.setServerUrl("https://openapi.test.seewo.com")
+            //执行请求,如果想获取到com.seewo.open.sdk.HttpResponse对象,请调用 seewoClient.execute 方法
+            AttendanceServiceListAttendClassRecordsResult result = seewoClient.invoke(request);
+            System.out.println("出参:" +result);
+
+
+        }
     }
 }

+ 43 - 0
src/main/java/com/template/controller/SmartAttendanceController.java

@@ -0,0 +1,43 @@
+package com.template.controller;
+
+
+import com.template.api.SmartAttendanceControllerAPI;
+import com.template.model.pojo.SmartAttendance;
+import com.template.model.result.CommonResult;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 楼栋表 前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-25
+ */
+@RestController
+public class SmartAttendanceController implements SmartAttendanceControllerAPI {
+
+    @Override
+    public CommonResult insertSmartAttendance(SmartAttendance smartApply, BindingResult bindingResult) {
+        return null;
+    }
+
+    @Override
+    public CommonResult updateSmartAttendanceById(SmartAttendance ra, BindingResult bindingResult) {
+        return null;
+    }
+
+    @Override
+    public CommonResult queryPageSmartAttendances(int currentPage, int pageCount, String name) {
+        return null;
+    }
+
+    @Override
+    public CommonResult deleteSmartAttendanceById(int id) {
+        return null;
+    }
+}
+

+ 42 - 0
src/main/java/com/template/controller/SmartClassController.java

@@ -0,0 +1,42 @@
+package com.template.controller;
+
+
+import com.template.api.SmartClassControllerAPI;
+import com.template.model.pojo.SmartClass;
+import com.template.model.result.CommonResult;
+import org.springframework.validation.BindingResult;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 楼栋表 前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-25
+ */
+@RestController
+public class SmartClassController implements SmartClassControllerAPI {
+
+    @Override
+    public CommonResult insertSmartClass(SmartClass smartApply, BindingResult bindingResult) {
+        return null;
+    }
+
+    @Override
+    public CommonResult updateSmartClassById(SmartClass ra, BindingResult bindingResult) {
+        return null;
+    }
+
+    @Override
+    public CommonResult queryPageSmartClasss(int currentPage, int pageCount, String name) {
+        return null;
+    }
+
+    @Override
+    public CommonResult deleteSmartClassById(int id) {
+        return null;
+    }
+}
+

+ 111 - 12
src/main/java/com/template/controller/SmartDepartmentController.java

@@ -1,22 +1,28 @@
 package com.template.controller;
 
 
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.template.api.SmartDepartmentControllerAPI;
 import com.template.common.utils.paramUtils;
 import com.template.model.pojo.SmartDepartment;
-import com.template.model.pojo.SmartDepartment;
+import com.template.model.request.insertDepartmentRequest;
+import com.template.model.request.updateDepartmentRequest;
 import com.template.model.result.CommonResult;
 import com.template.model.result.PageUtils;
+import com.template.model.vo.DepartmentTreeVo;
 import com.template.services.SmartDepartmentService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
 /**
  * <p>
- *  前端控制器
+ * 前端控制器
  * </p>
  *
  * @author ceshi
@@ -30,44 +36,68 @@ public class SmartDepartmentController implements SmartDepartmentControllerAPI {
 
     /**
      * 新增部门
-     * @param smartApply 部门数据
+     *
+     * @param smartDepartment    部门数据
      * @param bindingResult
      * @return
      */
     @Override
-    public CommonResult insertSmartDepartment(SmartDepartment smartApply, BindingResult bindingResult) {
+    public CommonResult insertSmartDepartment(insertDepartmentRequest smartDepartment, BindingResult bindingResult) {
         if (bindingResult.hasErrors()) {
             String st = paramUtils.getParamError(bindingResult);
             return CommonResult.fail(st);
         }
 
-        int result = smartDepartmentService.insertSmartDepartment(smartApply);
+        //新增的时候判断是否存在重复部门名称数据
+        int exist = smartDepartmentService.existDataByName(smartDepartment.getName());
+        if (exist > 0) {
+
+            return CommonResult.fail(smartDepartment.getName() + "部门名称数据已存在,请勿重复添加!");
+        }
+
+        SmartDepartment sd = new SmartDepartment();
+        sd.setParentId(smartDepartment.getParentId());
+        sd.setName(smartDepartment.getName());
+
+        int result = smartDepartmentService.insertSmartDepartment(sd);
 
         return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
     }
 
     /**
      * 更新部门
-     * @param sa 部门数据
+     *
+     * @param udr            部门数据
      * @param bindingResult
      * @return
      */
     @Override
-    public CommonResult updateSmartDepartmentById(SmartDepartment sa, BindingResult bindingResult) {
+    public CommonResult updateSmartDepartmentById(updateDepartmentRequest udr, BindingResult bindingResult) {
         if (bindingResult.hasErrors()) {
             String st = paramUtils.getParamError(bindingResult);
             return CommonResult.fail(st);
         }
 
-        int result = smartDepartmentService.updateSmartDepartment(sa);
+        SmartDepartment exist = smartDepartmentService.getSmartByName(udr.getName());
+        if (exist != null && !exist.getId().equals(udr.getId())) {
+            return CommonResult.fail(udr.getName() + "部门名称数据已存在,请勿重复添加!");
+        }
+
+        SmartDepartment sd = new SmartDepartment();
+        sd.setId(udr.getId());
+        sd.setParentId(udr.getParentId());
+        sd.setName(udr.getName());
+
+        int result = smartDepartmentService.updateSmartDepartment(sd);
         return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
     }
 
     /**
      * 部门分页数据查询
+     *
      * @param currentPage 当前页数
-     * @param pageCount 一页数据条数
-     * @param name 查询名称
+     * @param pageCount   一页数据条数
+     * @param name        查询名称
      * @return
      */
     @Override
@@ -83,7 +113,7 @@ public class SmartDepartmentController implements SmartDepartmentControllerAPI {
 
         SmartDepartment data = smartDepartmentService.getSmartById(id);
 
-        if(data == null){
+        if (data == null) {
             return CommonResult.fail("当前数据不存在,删除失败!");
         }
 
@@ -91,5 +121,74 @@ public class SmartDepartmentController implements SmartDepartmentControllerAPI {
 
         return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
     }
+
+    /**
+     * 根据部门名称查询部门树形图结构数据
+     *
+     * @param name 部门名称
+     * @return
+     */
+    @Override
+    public CommonResult queryDepartmentTree(String name) {
+        List<SmartDepartment> result = smartDepartmentService.getSmartsByName(name);
+
+        List<SmartDepartment> zeroResult = result.stream().filter(e -> e.getParentId().intValue() == 0).collect(Collectors.toList());
+        List<DepartmentTreeVo> departments = new ArrayList<>();
+        if (ObjectUtils.isEmpty(name)) {
+            for (SmartDepartment data : zeroResult) {
+                DepartmentTreeVo newData = new DepartmentTreeVo().builder()
+                        .id(data.getId())
+                        .name(data.getName())
+                        .parentId(data.getParentId())
+                        .build();
+
+                List<DepartmentTreeVo> departmentTrees = QueryDepartmentTreeRecords(newData.getId(), result);
+                newData.setChildren(departmentTrees);
+                departments.add(newData);
+            }
+        } else {
+            for (SmartDepartment data : result) {
+                DepartmentTreeVo newData = new DepartmentTreeVo().builder()
+                        .id(data.getId())
+                        .name(data.getName())
+                        .parentId(data.getParentId())
+                        .build();
+                departments.add(newData);
+            }
+        }
+
+        return CommonResult.ok(departments);
+    }
+
+    /**
+     * 根据父级ID获取树形数据
+     *
+     * @param parentID 父级ID
+     * @param lists    数据集合
+     * @return
+     */
+    private List<DepartmentTreeVo> QueryDepartmentTreeRecords(Integer parentID, List<SmartDepartment> lists) {
+        List<DepartmentTreeVo> newTrees = new ArrayList<>();
+
+        List<SmartDepartment> datas = lists.stream().filter(e -> e.getParentId().equals(parentID)).collect(Collectors.toList());
+
+        for (SmartDepartment data : datas) {
+            DepartmentTreeVo item = DepartmentTreeVo.builder()
+                    .id(data.getId())
+                    .parentId(parentID)
+                    .name(data.getName())
+                    .build();
+            List<DepartmentTreeVo> news = QueryDepartmentTreeRecords(item.getId(), lists);
+            if (news == null || news.size() == 0) {
+                newTrees.add(item);
+                continue;
+            } else {
+                item.setChildren(news);
+                newTrees.add(item);
+            }
+        }
+
+        return newTrees;
+    }
 }
 

+ 44 - 0
src/main/java/com/template/controller/SmartGradeController.java

@@ -0,0 +1,44 @@
+package com.template.controller;
+
+
+import com.template.api.SmartAttendanceControllerAPI;
+import com.template.api.SmartGradeControllerAPI;
+import com.template.model.pojo.SmartGrade;
+import com.template.model.result.CommonResult;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 楼栋表 前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-25
+ */
+@RestController
+public class SmartGradeController implements SmartGradeControllerAPI {
+
+    @Override
+    public CommonResult insertSmartGrade(SmartGrade smartApply, BindingResult bindingResult) {
+        return null;
+    }
+
+    @Override
+    public CommonResult updateSmartGradeById(SmartGrade ra, BindingResult bindingResult) {
+        return null;
+    }
+
+    @Override
+    public CommonResult queryPageSmartGrades(int currentPage, int pageCount, String name) {
+        return null;
+    }
+
+    @Override
+    public CommonResult deleteSmartGradeById(int id) {
+        return null;
+    }
+}
+

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

@@ -45,6 +45,8 @@ public class SmartUserController implements SmartUserControllerAPI {
 
         int result = smartUserService.insertSmartUser(smartApply);
 
+        //新增用户得将用户信息通过接口推送到希沃、百胜
+
         return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
     }
 
@@ -61,6 +63,8 @@ public class SmartUserController implements SmartUserControllerAPI {
             return CommonResult.fail(st);
         }
 
+        //更新的同时将百胜用户信息同步过去或者同步过来?
+
         int result = smartUserService.updateSmartUser(sa);
         return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
     }

+ 18 - 0
src/main/java/com/template/mapper/SmartAttendanceMapper.java

@@ -0,0 +1,18 @@
+package com.template.mapper;
+
+import com.template.model.pojo.SmartAttendance;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * <p>
+ * 楼栋表 Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-25
+ */
+@Repository
+public interface SmartAttendanceMapper extends BaseMapper<SmartAttendance> {
+
+}

+ 18 - 0
src/main/java/com/template/mapper/SmartClassMapper.java

@@ -0,0 +1,18 @@
+package com.template.mapper;
+
+import com.template.model.pojo.SmartClass;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * <p>
+ * 楼栋表 Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-25
+ */
+@Repository
+public interface SmartClassMapper extends BaseMapper<SmartClass> {
+
+}

+ 18 - 0
src/main/java/com/template/mapper/SmartGradeMapper.java

@@ -0,0 +1,18 @@
+package com.template.mapper;
+
+import com.template.model.pojo.SmartGrade;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * <p>
+ * 楼栋表 Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-25
+ */
+@Repository
+public interface SmartGradeMapper extends BaseMapper<SmartGrade> {
+
+}

+ 308 - 0
src/main/java/com/template/model/pojo/AttendanceRuleListSchoolAttendRuleParam.java

@@ -0,0 +1,308 @@
+package com.template.model.pojo;
+
+import java.util.*;
+import com.seewo.open.sdk.OpenApiParam;
+import com.seewo.open.sdk.ParameterPosition;
+
+/**
+ * seewo-open API: 【事件|课程】分页查询学校考勤规则信息
+ *
+ *
+ * @author auto create
+ * @since 2.0.1 2023-12-19
+ */
+public class AttendanceRuleListSchoolAttendRuleParam extends OpenApiParam {
+
+
+    /**
+     * 响应体,MimeType为 application/json
+     */
+
+    private RequestBody requestBody;
+
+
+    public RequestBody getRequestBody() {
+        return this.requestBody;
+    }
+
+    public void setRequestBody(RequestBody requestBody) {
+        this.requestBody = requestBody;
+    }
+
+    public static AttendanceRuleListSchoolAttendRuleParamBuilder builder(){
+        return new AttendanceRuleListSchoolAttendRuleParamBuilder();
+    }
+
+    public static class AttendanceRuleListSchoolAttendRuleParamBuilder{
+        private RequestBody requestBody;
+
+        public AttendanceRuleListSchoolAttendRuleParamBuilder requestBody(RequestBody requestBody){
+            this.requestBody = requestBody;
+            return this;
+        }
+
+        public AttendanceRuleListSchoolAttendRuleParam build(){
+            AttendanceRuleListSchoolAttendRuleParam param = new AttendanceRuleListSchoolAttendRuleParam();
+            param.setRequestBody(requestBody);
+            return param;
+        }
+    }
+
+    public static class RequestBody {
+        /**
+         * query
+         */
+        private Query query;
+
+        public Query getQuery() {
+            return this.query;
+        }
+
+        public void setQuery(Query query) {
+            this.query = query;
+        }
+
+
+        public static RequestBodyBuilder builder(){
+            return new RequestBodyBuilder();
+        }
+
+        public static class RequestBodyBuilder{
+            private Query query;
+
+            public RequestBodyBuilder query(Query query){
+                this.query = query;
+                return this;
+            }
+
+            public RequestBody build(){
+                RequestBody param = new RequestBody();
+                param.setQuery(query);
+                return param;
+            }
+        }
+    }
+
+    public static class Query {
+        /**
+         * appId
+         */
+        private String appId;
+        /**
+         * 学校uid
+         */
+        private String schoolUid;
+        /**
+         * 考勤日期(默认当天)
+         */
+        private String date;
+        /**
+         * 考勤类型
+1-事件(默认),2-课程
+         */
+        private Integer attendType;
+        /**
+         * 班级Uid
+         */
+        private String classUid;
+        /**
+         * 年级序号
+年级序号+班级序号唯一确定班级信息(几年级几班)
+年级序号+班级序号 与 班级Uid只取一个,以班级Uid为准
+         */
+        private Integer grade;
+        /**
+         * 班级序号
+年级序号+班级序号唯一确定班级信息(几年级几班)
+年级序号+班级序号 与 班级Uid只取一个,以班级Uid为准
+         */
+        private Integer clazz;
+        /**
+         * 场地标识
+         */
+        private String roomNum;
+        /**
+         * 场地标识类型
+0 - 第三方ID,1 - 希沃场地ID(默认),2 - 房间编号,3 - 行政班ID
+         */
+        private Integer roomNumType;
+        /**
+         * 页号,默认1
+         */
+        private Integer page;
+        /**
+         * 每页大小,默认20
+         */
+        private Integer pageSize;
+
+        public String getAppId() {
+            return this.appId;
+        }
+
+        public void setAppId(String appId) {
+            this.appId = appId;
+        }
+
+        public String getSchoolUid() {
+            return this.schoolUid;
+        }
+
+        public void setSchoolUid(String schoolUid) {
+            this.schoolUid = schoolUid;
+        }
+
+        public String getDate() {
+            return this.date;
+        }
+
+        public void setDate(String date) {
+            this.date = date;
+        }
+
+        public Integer getAttendType() {
+            return this.attendType;
+        }
+
+        public void setAttendType(Integer attendType) {
+            this.attendType = attendType;
+        }
+
+        public String getClassUid() {
+            return this.classUid;
+        }
+
+        public void setClassUid(String classUid) {
+            this.classUid = classUid;
+        }
+
+        public Integer getGrade() {
+            return this.grade;
+        }
+
+        public void setGrade(Integer grade) {
+            this.grade = grade;
+        }
+
+        public Integer getClazz() {
+            return this.clazz;
+        }
+
+        public void setClazz(Integer clazz) {
+            this.clazz = clazz;
+        }
+
+        public String getRoomNum() {
+            return this.roomNum;
+        }
+
+        public void setRoomNum(String roomNum) {
+            this.roomNum = roomNum;
+        }
+
+        public Integer getRoomNumType() {
+            return this.roomNumType;
+        }
+
+        public void setRoomNumType(Integer roomNumType) {
+            this.roomNumType = roomNumType;
+        }
+
+        public Integer getPage() {
+            return this.page;
+        }
+
+        public void setPage(Integer page) {
+            this.page = page;
+        }
+
+        public Integer getPageSize() {
+            return this.pageSize;
+        }
+
+        public void setPageSize(Integer pageSize) {
+            this.pageSize = pageSize;
+        }
+
+
+        public static QueryBuilder builder(){
+            return new QueryBuilder();
+        }
+
+        public static class QueryBuilder{
+            private String appId;
+            private String schoolUid;
+            private String date;
+            private Integer attendType;
+            private String classUid;
+            private Integer grade;
+            private Integer clazz;
+            private String roomNum;
+            private Integer roomNumType;
+            private Integer page;
+            private Integer pageSize;
+
+            public QueryBuilder appId(String appId){
+                this.appId = appId;
+                return this;
+            }
+            public QueryBuilder schoolUid(String schoolUid){
+                this.schoolUid = schoolUid;
+                return this;
+            }
+            public QueryBuilder date(String date){
+                this.date = date;
+                return this;
+            }
+            public QueryBuilder attendType(Integer attendType){
+                this.attendType = attendType;
+                return this;
+            }
+            public QueryBuilder classUid(String classUid){
+                this.classUid = classUid;
+                return this;
+            }
+            public QueryBuilder grade(Integer grade){
+                this.grade = grade;
+                return this;
+            }
+            public QueryBuilder clazz(Integer clazz){
+                this.clazz = clazz;
+                return this;
+            }
+            public QueryBuilder roomNum(String roomNum){
+                this.roomNum = roomNum;
+                return this;
+            }
+            public QueryBuilder roomNumType(Integer roomNumType){
+                this.roomNumType = roomNumType;
+                return this;
+            }
+            public QueryBuilder page(Integer page){
+                this.page = page;
+                return this;
+            }
+            public QueryBuilder pageSize(Integer pageSize){
+                this.pageSize = pageSize;
+                return this;
+            }
+
+            public Query build(){
+                Query param = new Query();
+                param.setAppId(appId);
+                param.setSchoolUid(schoolUid);
+                param.setDate(date);
+                param.setAttendType(attendType);
+                param.setClassUid(classUid);
+                param.setGrade(grade);
+                param.setClazz(clazz);
+                param.setRoomNum(roomNum);
+                param.setRoomNumType(roomNumType);
+                param.setPage(page);
+                param.setPageSize(pageSize);
+                return param;
+            }
+        }
+    }
+
+
+}

+ 35 - 0
src/main/java/com/template/model/pojo/AttendanceRuleListSchoolAttendRuleRequest.java

@@ -0,0 +1,35 @@
+package com.template.model.pojo;
+
+import java.util.*;
+import com.seewo.open.sdk.OpenApiParam;
+import com.seewo.open.sdk.OpenApiRequest;
+
+/**
+ * seewo-open API: 【事件|课程】分页查询学校考勤规则信息
+ *
+ *
+ * @author auto create
+ * @since 2.0.1 2023-12-19
+ */
+public class AttendanceRuleListSchoolAttendRuleRequest extends OpenApiRequest<AttendanceRuleListSchoolAttendRuleParam, AttendanceRuleListSchoolAttendRuleResult> {
+
+    public AttendanceRuleListSchoolAttendRuleRequest(AttendanceRuleListSchoolAttendRuleParam param) {
+        this();
+        setBizModel(param);
+    }
+
+    public AttendanceRuleListSchoolAttendRuleRequest() {
+        setServerUrl("https://openapi.seewo.com");
+        setPath("/seewo-yunban-api/attendance-rule/list-school-attend-rule");
+        setHttpMethod("POST");
+    }
+
+    public Class<AttendanceRuleListSchoolAttendRuleResult> getResponseClass() {
+        return AttendanceRuleListSchoolAttendRuleResult.class;
+    }
+
+    public Class<AttendanceRuleListSchoolAttendRuleParam> getDomainClass() {
+        return AttendanceRuleListSchoolAttendRuleParam.class;
+    }
+}
+

+ 218 - 0
src/main/java/com/template/model/pojo/AttendanceRuleListSchoolAttendRuleResult.java

@@ -0,0 +1,218 @@
+package com.template.model.pojo;
+
+import java.util.*;
+import com.seewo.open.sdk.OpenApiResult;
+import com.seewo.open.sdk.HttpResponse;
+
+/**
+ * seewo-open API: 【事件|课程】分页查询学校考勤规则信息
+ *
+ *
+ * @author auto create
+ * @since 2.0.1 2023-12-19
+ */
+public class AttendanceRuleListSchoolAttendRuleResult extends OpenApiResult {
+
+    public AttendanceRuleListSchoolAttendRuleResult(HttpResponse response) {
+        super(response);
+    }
+
+
+    /**
+     * 响应体,MimeType为 application/json
+     */
+
+    private ResponseBody responseBody;
+
+
+    public ResponseBody getResponseBody() {
+        return this.responseBody;
+    }
+
+    public void setResponseBody(ResponseBody responseBody) {
+        this.responseBody = responseBody;
+    }
+
+    public static class ResponseBody {
+        /**
+         * code
+         */
+        private String code;
+        /**
+         * message
+         */
+        private String message;
+        /**
+         * data
+         */
+        private Data data;
+
+        public String getCode() {
+            return this.code;
+        }
+
+        public void setCode(String code) {
+            this.code = code;
+        }
+
+        public String getMessage() {
+            return this.message;
+        }
+
+        public void setMessage(String message) {
+            this.message = message;
+        }
+
+        public Data getData() {
+            return this.data;
+        }
+
+        public void setData(Data data) {
+            this.data = data;
+        }
+
+    }
+
+    public static class Data {
+        /**
+         * 页号
+         */
+        private Integer page;
+        /**
+         * 每页大小
+         */
+        private Integer pageSize;
+        /**
+         * 数据总量
+         */
+        private Integer totalCount;
+        /**
+         * Result
+         */
+        private List<Result> result;
+
+        public Integer getPage() {
+            return this.page;
+        }
+
+        public void setPage(Integer page) {
+            this.page = page;
+        }
+
+        public Integer getPageSize() {
+            return this.pageSize;
+        }
+
+        public void setPageSize(Integer pageSize) {
+            this.pageSize = pageSize;
+        }
+
+        public Integer getTotalCount() {
+            return this.totalCount;
+        }
+
+        public void setTotalCount(Integer totalCount) {
+            this.totalCount = totalCount;
+        }
+
+        public List<Result> getResult() {
+            return this.result;
+        }
+
+        public void setResult(List<Result> result) {
+            this.result = result;
+        }
+
+    }
+
+    public static class Result {
+        /**
+         * 考勤规则id
+         */
+        private String ruleId;
+        /**
+         * 考勤名称
+         */
+        private String name;
+        /**
+         * 考勤类型    10-循环考勤、11-单次考勤、12-上学考勤、13-放学考勤、2-课程考勤
+         */
+        private Integer attendType;
+        /**
+         * 考勤日期
+         */
+        private String attendDate;
+        /**
+         * 考勤开始时间
+         */
+        private String attendStartTime;
+        /**
+         * 考勤迟到时间
+         */
+        private String attendLateTime;
+        /**
+         * 考勤结束时间
+         */
+        private String attendEndTime;
+
+        public String getRuleId() {
+            return this.ruleId;
+        }
+
+        public void setRuleId(String ruleId) {
+            this.ruleId = ruleId;
+        }
+
+        public String getName() {
+            return this.name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public Integer getAttendType() {
+            return this.attendType;
+        }
+
+        public void setAttendType(Integer attendType) {
+            this.attendType = attendType;
+        }
+
+        public String getAttendDate() {
+            return this.attendDate;
+        }
+
+        public void setAttendDate(String attendDate) {
+            this.attendDate = attendDate;
+        }
+
+        public String getAttendStartTime() {
+            return this.attendStartTime;
+        }
+
+        public void setAttendStartTime(String attendStartTime) {
+            this.attendStartTime = attendStartTime;
+        }
+
+        public String getAttendLateTime() {
+            return this.attendLateTime;
+        }
+
+        public void setAttendLateTime(String attendLateTime) {
+            this.attendLateTime = attendLateTime;
+        }
+
+        public String getAttendEndTime() {
+            return this.attendEndTime;
+        }
+
+        public void setAttendEndTime(String attendEndTime) {
+            this.attendEndTime = attendEndTime;
+        }
+
+    }
+
+
+}
+

+ 121 - 0
src/main/java/com/template/model/pojo/OrgClassOpenSeewoUcOpenV1ClassFullParam.java

@@ -0,0 +1,121 @@
+package com.template.model.pojo;
+
+import com.seewo.open.sdk.OpenApiParam;
+
+/**
+ * seewo-open API: 全量班级信息
+ * 全量班级信息
+ *
+ * @author auto create
+ * @since 2.0.1 2023-12-25
+ */
+public class OrgClassOpenSeewoUcOpenV1ClassFullParam extends OpenApiParam {
+
+
+    /**
+     * 请求体,MimeType为 application/json
+     */
+
+    private JSONRequestBody requestBody;
+
+
+    public JSONRequestBody getRequestBody() {
+        return this.requestBody;
+    }
+
+    public void setRequestBody(JSONRequestBody requestBody) {
+        this.requestBody = requestBody;
+    }
+
+    public static OrgClassOpenSeewoUcOpenV1ClassFullParamBuilder builder(){
+        return new OrgClassOpenSeewoUcOpenV1ClassFullParamBuilder();
+    }
+
+    public static class OrgClassOpenSeewoUcOpenV1ClassFullParamBuilder{
+        private JSONRequestBody requestBody;
+
+        public OrgClassOpenSeewoUcOpenV1ClassFullParamBuilder requestBody(JSONRequestBody requestBody){
+            this.requestBody = requestBody;
+            return this;
+        }
+
+        public OrgClassOpenSeewoUcOpenV1ClassFullParam build(){
+            OrgClassOpenSeewoUcOpenV1ClassFullParam param = new OrgClassOpenSeewoUcOpenV1ClassFullParam();
+            param.setRequestBody(requestBody);
+            return param;
+        }
+    }
+
+    public static class JSONRequestBody {
+        /**
+         * 学校uid
+         */
+        private String schoolUid;
+        /**
+         * 页码,默认1
+         */
+        private Integer pageNo;
+        /**
+         * 页大小,默认300
+         */
+        private Integer pageSize;
+
+        public String getSchoolUid() {
+            return this.schoolUid;
+        }
+
+        public void setSchoolUid(String schoolUid) {
+            this.schoolUid = schoolUid;
+        }
+
+        public Integer getPageNo() {
+            return this.pageNo;
+        }
+
+        public void setPageNo(Integer pageNo) {
+            this.pageNo = pageNo;
+        }
+
+        public Integer getPageSize() {
+            return this.pageSize;
+        }
+
+        public void setPageSize(Integer pageSize) {
+            this.pageSize = pageSize;
+        }
+
+
+        public static JSONRequestBodyBuilder builder(){
+            return new JSONRequestBodyBuilder();
+        }
+
+        public static class JSONRequestBodyBuilder{
+            private String schoolUid;
+            private Integer pageNo;
+            private Integer pageSize;
+
+            public JSONRequestBodyBuilder schoolUid(String schoolUid){
+                this.schoolUid = schoolUid;
+                return this;
+            }
+            public JSONRequestBodyBuilder pageNo(Integer pageNo){
+                this.pageNo = pageNo;
+                return this;
+            }
+            public JSONRequestBodyBuilder pageSize(Integer pageSize){
+                this.pageSize = pageSize;
+                return this;
+            }
+
+            public JSONRequestBody build(){
+                JSONRequestBody param = new JSONRequestBody();
+                param.setSchoolUid(schoolUid);
+                param.setPageNo(pageNo);
+                param.setPageSize(pageSize);
+                return param;
+            }
+        }
+    }
+
+
+}

+ 35 - 0
src/main/java/com/template/model/pojo/OrgClassOpenSeewoUcOpenV1ClassFullRequest.java

@@ -0,0 +1,35 @@
+package com.template.model.pojo;
+
+import java.util.*;
+import com.seewo.open.sdk.OpenApiParam;
+import com.seewo.open.sdk.OpenApiRequest;
+
+/**
+ * seewo-open API: 全量班级信息
+ * 全量班级信息
+ *
+ * @author auto create
+ * @since 2.0.1 2023-12-25
+ */
+public class OrgClassOpenSeewoUcOpenV1ClassFullRequest extends OpenApiRequest<OrgClassOpenSeewoUcOpenV1ClassFullParam, OrgClassOpenSeewoUcOpenV1ClassFullResult> {
+
+    public OrgClassOpenSeewoUcOpenV1ClassFullRequest(OrgClassOpenSeewoUcOpenV1ClassFullParam param) {
+        this();
+        setBizModel(param);
+    }
+
+    public OrgClassOpenSeewoUcOpenV1ClassFullRequest() {
+        setServerUrl("https://openapi.seewo.com");
+        setPath("/organization/org-class-open/seewo/uc/open/v1/class/full");
+        setHttpMethod("POST");
+    }
+
+    public Class<OrgClassOpenSeewoUcOpenV1ClassFullResult> getResponseClass() {
+        return OrgClassOpenSeewoUcOpenV1ClassFullResult.class;
+    }
+
+    public Class<OrgClassOpenSeewoUcOpenV1ClassFullParam> getDomainClass() {
+        return OrgClassOpenSeewoUcOpenV1ClassFullParam.class;
+    }
+}
+

+ 126 - 0
src/main/java/com/template/model/pojo/OrgClassOpenSeewoUcOpenV1ClassFullResult.java

@@ -0,0 +1,126 @@
+package com.template.model.pojo;
+
+import java.util.*;
+import com.seewo.open.sdk.OpenApiResult;
+import com.seewo.open.sdk.HttpResponse;
+
+/**
+ * seewo-open API: 全量班级信息
+ * 全量班级信息
+ *
+ * @author auto create
+ * @since 2.0.1 2023-12-25
+ */
+public class OrgClassOpenSeewoUcOpenV1ClassFullResult extends OpenApiResult {
+
+    public OrgClassOpenSeewoUcOpenV1ClassFullResult(HttpResponse response) {
+        super(response);
+    }
+
+
+    /**
+     * 响应体,MimeType为 application/json
+     */
+
+    private JSONResponseBody responseBody;
+
+
+    public JSONResponseBody getResponseBody() {
+        return this.responseBody;
+    }
+
+    public void setResponseBody(JSONResponseBody responseBody) {
+        this.responseBody = responseBody;
+    }
+
+    public static class JSONResponseBody {
+        /**
+         * 班级uid
+         */
+        private String classUid;
+        /**
+         * 班级名称
+         */
+        private String className;
+        /**
+         * 班级类型,1-行政班/2-教学班
+         */
+        private Integer classType;
+        /**
+         * 年级,如9(九年级)
+         */
+        private Integer classGrade;
+        /**
+         * 学段,如CodeSchoolStage_0(小学)
+         */
+        private String stage;
+        /**
+         * 班级,如高(一)1班中的1
+         */
+        private Integer classNum;
+        /**
+         * 第几界班级
+         */
+        private Integer gradeYear;
+
+        public String getClassUid() {
+            return this.classUid;
+        }
+
+        public void setClassUid(String classUid) {
+            this.classUid = classUid;
+        }
+
+        public String getClassName() {
+            return this.className;
+        }
+
+        public void setClassName(String className) {
+            this.className = className;
+        }
+
+        public Integer getClassType() {
+            return this.classType;
+        }
+
+        public void setClassType(Integer classType) {
+            this.classType = classType;
+        }
+
+        public Integer getClassGrade() {
+            return this.classGrade;
+        }
+
+        public void setClassGrade(Integer classGrade) {
+            this.classGrade = classGrade;
+        }
+
+        public String getStage() {
+            return this.stage;
+        }
+
+        public void setStage(String stage) {
+            this.stage = stage;
+        }
+
+        public Integer getClassNum() {
+            return this.classNum;
+        }
+
+        public void setClassNum(Integer classNum) {
+            this.classNum = classNum;
+        }
+
+        public Integer getGradeYear() {
+            return this.gradeYear;
+        }
+
+        public void setGradeYear(Integer gradeYear) {
+            this.gradeYear = gradeYear;
+        }
+
+    }
+
+
+}
+

+ 71 - 0
src/main/java/com/template/model/pojo/SmartAttendance.java

@@ -0,0 +1,71 @@
+package com.template.model.pojo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.Version;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 楼栋表
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-25
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="SmartAttendance对象", description="楼栋表")
+public class SmartAttendance implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "主键ID")
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "用户ID")
+    private Integer userId;
+
+    @ApiModelProperty(value = "班级ID")
+    private Integer classId;
+
+    @ApiModelProperty(value = "签到时间")
+    private Date attendTime;
+
+    @ApiModelProperty(value = "考勤状态 准时:0 迟到:1 缺卡:3 请假:6 超时打卡:7")
+    private Integer status;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新时间")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+
+    @ApiModelProperty(value = "创建人员")
+    @TableField(fill = FieldFill.INSERT)
+    private String createUser;
+
+    @ApiModelProperty(value = "更新人员")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateUser;
+
+    @ApiModelProperty(value = "逻辑删除 未删除:0;删除:1")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleted;
+
+
+}

+ 71 - 0
src/main/java/com/template/model/pojo/SmartClass.java

@@ -0,0 +1,71 @@
+package com.template.model.pojo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.Version;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 楼栋表
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-25
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="SmartClass对象", description="楼栋表")
+public class SmartClass implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "主键ID")
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "年级ID")
+    private Integer gradeId;
+
+    @ApiModelProperty(value = "班级uid")
+    private String classUid;
+
+    @ApiModelProperty(value = "班级名称")
+    private String name;
+
+    @ApiModelProperty(value = "班级序号")
+    private Integer classNo;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新时间")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+
+    @ApiModelProperty(value = "创建人员")
+    @TableField(fill = FieldFill.INSERT)
+    private String createUser;
+
+    @ApiModelProperty(value = "更新人员")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateUser;
+
+    @ApiModelProperty(value = "逻辑删除 未删除:0;删除:1")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleted;
+
+
+}

+ 65 - 0
src/main/java/com/template/model/pojo/SmartGrade.java

@@ -0,0 +1,65 @@
+package com.template.model.pojo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.Version;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 楼栋表
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-25
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="SmartGrade对象", description="楼栋表")
+public class SmartGrade implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "主键ID")
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "年级名称")
+    private String name;
+
+    @ApiModelProperty(value = "年级序号")
+    private Integer gradeNo;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新时间")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+
+    @ApiModelProperty(value = "创建人员")
+    @TableField(fill = FieldFill.INSERT)
+    private String createUser;
+
+    @ApiModelProperty(value = "更新人员")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateUser;
+
+    @ApiModelProperty(value = "逻辑删除 未删除:0;删除:1")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleted;
+
+
+}

+ 30 - 0
src/main/java/com/template/model/request/insertDepartmentRequest.java

@@ -0,0 +1,30 @@
+package com.template.model.request;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-04
+ */
+@Data
+public class insertDepartmentRequest {
+
+    /**
+     * 父级ID
+     */
+    @NotNull(message = "父级ID不能为空")
+    private Integer parentId;
+
+    /**
+     * 部门名称
+     */
+    @NotBlank(message = "部门名称不能为空")
+    private String name;
+}

+ 35 - 0
src/main/java/com/template/model/request/updateDepartmentRequest.java

@@ -0,0 +1,35 @@
+package com.template.model.request;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/7/7 星期五 14:27
+ * @Description: com.repair.model.request
+ * @Version: 1.0
+ */
+@Data
+public class updateDepartmentRequest {
+    /**
+     * 数据ID
+     */
+    @NotNull(message = "数据ID不能为空")
+    private Integer id;
+
+    /**
+     * 父级ID
+     */
+    @NotNull(message = "父级ID不能为空")
+    private Integer parentId;
+
+    /**
+     * 部门名称
+     */
+    @NotBlank(message = "部门名称不能为空")
+    private String name;
+}

+ 38 - 0
src/main/java/com/template/model/vo/DepartmentTreeVo.java

@@ -0,0 +1,38 @@
+package com.template.model.vo;
+
+import lombok.*;
+
+import java.util.List;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/12/14 星期四 9:20
+ * @Description: com.template.model.vo
+ * @Version: 1.0
+ */
+@Data
+@Builder
+@ToString
+@AllArgsConstructor
+@NoArgsConstructor
+public class DepartmentTreeVo {
+    /**
+     * 数据ID
+     */
+    private int id;
+
+    /**
+     * 父级ID
+     */
+    private int parentId;
+
+    /**
+     * 部门名称
+     */
+    private String name;
+
+    /**
+     * 子级部门
+     */
+    private List<DepartmentTreeVo> children;
+}

+ 16 - 0
src/main/java/com/template/services/SmartAttendanceService.java

@@ -0,0 +1,16 @@
+package com.template.services;
+
+import com.template.model.pojo.SmartAttendance;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 楼栋表 服务类
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-25
+ */
+public interface SmartAttendanceService extends IService<SmartAttendance> {
+
+}

+ 16 - 0
src/main/java/com/template/services/SmartClassService.java

@@ -0,0 +1,16 @@
+package com.template.services;
+
+import com.template.model.pojo.SmartClass;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 楼栋表 服务类
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-25
+ */
+public interface SmartClassService extends IService<SmartClass> {
+
+}

+ 8 - 0
src/main/java/com/template/services/SmartDepartmentService.java

@@ -5,6 +5,8 @@ import com.template.model.pojo.SmartDepartment;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.template.model.result.PageUtils;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务类
@@ -23,4 +25,10 @@ public interface SmartDepartmentService extends IService<SmartDepartment> {
     int deleteSmartDepartmentById(int id);
 
     SmartDepartment getSmartById(int id);
+
+    SmartDepartment getSmartByName(String name);
+
+    List<SmartDepartment> getSmartsByName(String name);
+
+    int existDataByName(String name);
 }

+ 16 - 0
src/main/java/com/template/services/SmartGradeService.java

@@ -0,0 +1,16 @@
+package com.template.services;
+
+import com.template.model.pojo.SmartGrade;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 楼栋表 服务类
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-25
+ */
+public interface SmartGradeService extends IService<SmartGrade> {
+
+}

+ 20 - 0
src/main/java/com/template/services/impl/SmartAttendanceServiceImpl.java

@@ -0,0 +1,20 @@
+package com.template.services.impl;
+
+import com.template.model.pojo.SmartAttendance;
+import com.template.mapper.SmartAttendanceMapper;
+import com.template.services.SmartAttendanceService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 楼栋表 服务实现类
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-25
+ */
+@Service
+public class SmartAttendanceServiceImpl extends ServiceImpl<SmartAttendanceMapper, SmartAttendance> implements SmartAttendanceService {
+
+}

+ 20 - 0
src/main/java/com/template/services/impl/SmartClassServiceImpl.java

@@ -0,0 +1,20 @@
+package com.template.services.impl;
+
+import com.template.model.pojo.SmartClass;
+import com.template.mapper.SmartClassMapper;
+import com.template.services.SmartClassService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 楼栋表 服务实现类
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-25
+ */
+@Service
+public class SmartClassServiceImpl extends ServiceImpl<SmartClassMapper, SmartClass> implements SmartClassService {
+
+}

+ 32 - 0
src/main/java/com/template/services/impl/SmartDepartmentServiceImpl.java

@@ -14,6 +14,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务实现类
@@ -59,4 +61,34 @@ public class SmartDepartmentServiceImpl extends ServiceImpl<SmartDepartmentMappe
         SmartDepartment result = smartDepartmentMapper.selectById(id);
         return result;
     }
+
+    @Override
+    public SmartDepartment getSmartByName(String name) {
+        QueryWrapper<SmartDepartment> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(StringUtils.hasText(name),"name", name);
+
+        SmartDepartment result = smartDepartmentMapper.selectOne(queryWrapper);
+
+        return result;
+    }
+
+    @Override
+    public List<SmartDepartment> getSmartsByName(String name) {
+        QueryWrapper<SmartDepartment> queryWrapper = new QueryWrapper<>();
+        queryWrapper.like(StringUtils.hasText(name),"name", name);
+
+        List<SmartDepartment> result = smartDepartmentMapper.selectList(queryWrapper);
+
+        return result;
+    }
+
+    @Override
+    public int existDataByName(String name) {
+        QueryWrapper<SmartDepartment> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(StringUtils.hasText(name),"name", name);
+
+        int existCount = smartDepartmentMapper.selectCount(queryWrapper);
+
+        return existCount;
+    }
 }

+ 20 - 0
src/main/java/com/template/services/impl/SmartGradeServiceImpl.java

@@ -0,0 +1,20 @@
+package com.template.services.impl;
+
+import com.template.model.pojo.SmartGrade;
+import com.template.mapper.SmartGradeMapper;
+import com.template.services.SmartGradeService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 楼栋表 服务实现类
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-25
+ */
+@Service
+public class SmartGradeServiceImpl extends ServiceImpl<SmartGradeMapper, SmartGrade> implements SmartGradeService {
+
+}

+ 3 - 1
src/main/resources/application-dev.yml

@@ -76,8 +76,10 @@ tencentcloud:
   smsMin: 1
 
 #是否开启定时
+#1:开启
+#0:关闭
 schedule:
-  isOpen: 1
+  isOpen: 0
 
 # 项目公钥私钥
 my-security:

+ 3 - 1
target/classes/application-dev.yml

@@ -76,8 +76,10 @@ tencentcloud:
   smsMin: 1
 
 #是否开启定时
+#1:开启
+#0:关闭
 schedule:
-  isOpen: 1
+  isOpen: 0
 
 # 项目公钥私钥
 my-security: