Browse Source

Merge branch 'master' of ssh://10.10.100.21/source/smartschool-platform

koul 7 years ago
parent
commit
eacdee2523

+ 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>

+ 1 - 0
frontend/pc-web/app/view/Interaction/homework/ReleaseController.js

@@ -26,6 +26,7 @@ Ext.define('school.view.interaction.homework.ReleaseController', {
         id = viewModel.data.task_id;
         view.setLoading(true);
         school.util.BaseUtil.request({
+            // url: 'http://10.1.80.180:9520/api/school/homework/publish/' + id,
             url: '/api/school/homework/publish/' + id,
             method: 'POST'
         })

+ 0 - 1
frontend/pc-web/app/view/Interaction/notice/SchoolNotice.js

@@ -59,7 +59,6 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
                 fieldLabel: '发布时间',
                 readOnly: true,
                 format: 'Y-m-d H:i:s',
-                defaultValue: new Date(),
                 readOnly: true
             }, {
                 xtype: "textfield",

+ 1 - 0
frontend/pc-web/app/view/Interaction/notice/SchoolNoticeController.js

@@ -26,6 +26,7 @@ Ext.define('school.view.interaction.notice.SchoolNoticeController', {
         id = viewModel.data.notify_id;
         view.setLoading(true);
         school.util.BaseUtil.request({
+            // url: 'http://10.1.80.180:9520/api/school/notice/publish/' + id,
             url: '/api/school/notice/publish/' + id,
             method: 'POST'
         })

+ 2 - 9
frontend/pc-web/app/view/basic/student/StudentDetailModel.js

@@ -18,20 +18,13 @@ Ext.define('school.view.basic.student.StudentDetailModel', {
                 
                 var age = 0;
 
-                if(nYear < vYear) {
+                if(nYear > vYear) {
                     age = nYear - vYear;
-                }else {
-                    age = nYear - vYear;
-                    if(nMonth < vMonth) {
+                    if((nMonth < vMonth) || (nMonth == vMonth && nDay < vDay)) {
                         age--;
-                    }else if(nMonth == vMonth){
-                        if(nDay < vDay) {
-                            age--;
-                        }
                     }
                 }
 
-                
                 this.set('stu_age', age);
                 return v;
             }

+ 2 - 2
frontend/pc-web/app/view/viewport/ViewportModel.js

@@ -34,8 +34,8 @@ Ext.define('school.view.viewport.ViewportModel', {
             }],
             proxy: {
                 type: 'ajax',
-                // url: 'http://10.1.80.47:9560/grade/read/1',
-                url: '/api/school/grade/read/' + school.util.BaseUtil.getCurrentUser().school_id,
+                // url: 'http://10.1.80.47:9560/grade/read',
+                url: '/api/school/grade/read',
                 reader: {
                     transform: {
                         fn: function(data) {