Browse Source

Merge remote-tracking branch 'origin/dev'

guq 7 years ago
parent
commit
62b1449f53

+ 3 - 3
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/controller/GradeController.java

@@ -28,9 +28,9 @@ public class GradeController {
     * @Author: guq
     * @Date: 2019/1/22
     */
-    @GetMapping("/read/{id}")
-    public Result getSchoolTree(@PathVariable("id") Long id) {
-        TreeNode school = gradeService.getSchoolTree(id);
+    @GetMapping("/read")
+    public Result getSchoolTree() {
+        TreeNode school = gradeService.getSchoolTree();
         return Result.success(school);
     }
 

+ 1 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/GradeService.java

@@ -7,7 +7,7 @@ import com.usoftchina.smartschool.school.po.SysSchool;
 import com.usoftchina.smartschool.school.po.TreeNode;
 
 public interface GradeService {
-    TreeNode getSchoolTree(Long id);
+    TreeNode getSchoolTree();
 
     void saveToFormal(Integer id, boolean update);
 

+ 4 - 8
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/GradeServiceImpl.java

@@ -41,13 +41,9 @@ public class GradeServiceImpl implements GradeService{
     private DataImportMapper dataImportMapper;
 
     @Override
-    public TreeNode getSchoolTree(Long id) {
-        if (null == id || "0".equals(id)) {
-            throw new BizException(BizExceptionCode.USELESS_DATA);
-        }
-        id = 1l;
-
-        SysSchool school = sysSchoolMapper.selectByPrimaryKey(id);
+    public TreeNode getSchoolTree() {
+        Long school_id = BaseContextHolder.getSchoolId();
+        SysSchool school = sysSchoolMapper.selectByPrimaryKey(school_id);
         TreeNode schoolTree = new TreeNode();
         TreeNode gradeNode = null;
         TreeNode classNode = null;
@@ -58,7 +54,7 @@ public class GradeServiceImpl implements GradeService{
         schoolTree.setText(school.getSchool_name());
         schoolTree.setType(SCHOOLTYPE.SCHOOL.name());
 
-        List<SysGrade> grades = sysGradeMapper.selectBySchool(id);
+        List<SysGrade> grades = sysGradeMapper.selectBySchool(school_id);
         if (null != grades && grades.size() > 0) {
 
             for (SysGrade grade : grades) {

+ 1 - 1
applications/school/school-server/src/main/resources/mapper/NotifyMapper.xml

@@ -83,7 +83,7 @@
             <if test="creator != null">
                 creator,
             </if>
-            <if test="creator != null">
+            <if test="accessory != null">
                 accessory,
             </if>
         </trim>