Browse Source

新增校园新闻

Administrator 2 years ago
parent
commit
e2f86d239d

+ 8 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/AppletController.java

@@ -55,4 +55,12 @@ public class AppletController {
         return  appletService.pcStatistics();
     }
 
+    /**
+     * 家长获取下课时间
+     */
+    //@PostMapping("/xiaKeTime")
+    public AjaxResult xiaKeTime(@Validated @RequestBody FormalTeacherClass formalTeacherClass)
+    {
+        return    appletService.xiaKeTime(formalTeacherClass);
+    }
 }

+ 6 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/course/CourseTableController.java

@@ -101,6 +101,12 @@ public class CourseTableController extends BaseController
     }
 
 
+    /**
+     * app查询班级授课老师和名称
+     * @param schoolId
+     * @param classId
+     * @return
+     */
     @GetMapping(value = "/now")
     public AjaxResult now(Long schoolId, Long classId)
     {

+ 0 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/XiaoyuanNoticeController.java

@@ -41,7 +41,6 @@ public class XiaoyuanNoticeController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(XiaoyuanNotice xiaoyuanNotice)
     {
-        startPage();
         List<XiaoyuanNotice> list = xiaoyuanNoticeService.selectXiaoyuanNoticeList(xiaoyuanNotice);
         return getDataTable(list);
     }

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IAppletService.java

@@ -10,6 +10,7 @@ import com.ruoyi.common.core.domain.entity.FormalTeacherClass;
  */
 public interface IAppletService {
     public AjaxResult xiake(FormalTeacherClass formalTeacherClass);
+    public AjaxResult xiaKeTime(FormalTeacherClass formalTeacherClass);
     public AjaxResult index(FormalTeacherClass formalTeacherClass);
     public AjaxResult indexList(FormalTeacherClass formalTeacherClass);
 

+ 17 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AppletServiceImpl.java

@@ -112,6 +112,23 @@ public class AppletServiceImpl implements IAppletService {
         return AjaxResult.success();
     }
 
+    /**
+     * 家长获取下课时间
+     * @param formalTeacherClass
+     * @return
+     */
+    @Override
+    public AjaxResult xiaKeTime(FormalTeacherClass formalTeacherClass) {
+        String key = formalTeacherClass.getSchoolId() + ":" + formalTeacherClass.getClassId();
+        //key = 学校id:班级id
+        //Redis根据key键,查询对应的值
+        String value = redisCache.getCacheObject(key);
+        String[] split = value.split(":");
+        //下课时间
+        String xiakeTime = split[1];
+        return AjaxResult.success(xiakeTime);
+    }
+
     @Override
     public AjaxResult index(FormalTeacherClass formalTeacherClass) {
         Map<String, Object> map = new HashMap<>(3);

+ 13 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CourseTableServiceImpl.java

@@ -6,6 +6,7 @@ import java.util.Map;
 
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
@@ -32,6 +33,9 @@ public class CourseTableServiceImpl implements ICourseTableService
     @Autowired
     private CourseTableTimeMapper courseTableTimeMapper;
 
+    @Autowired
+    private RedisCache redisCache;
+
     /**
      * 查询课程
      * 
@@ -113,6 +117,15 @@ public class CourseTableServiceImpl implements ICourseTableService
         Map<String,Object> map = new HashMap<>();
         map.put("teacher","");
         map.put("subject","");
+        //家长端查询下课时间
+        String key = schoolId + ":" + classId;
+        //key = 学校id:班级id
+        //Redis根据key键,查询对应的值
+        String value = redisCache.getCacheObject(key);
+        String[] split = value.split(":");
+        //下课时间
+        String xiakeTime = split[1];
+        map.put("time",xiakeTime);
         //获取当前时间
         String nowTime = DateUtils.getTime();
         //判断当天是周几

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/XiaoyuanNoticeServiceImpl.java

@@ -22,6 +22,8 @@ import com.ruoyi.system.service.IXiaoyuanNoticeService;
 
 import javax.annotation.Resource;
 
+import static com.ruoyi.common.utils.PageUtils.startPage;
+
 /**
  * 校园新闻Service业务层处理
  *
@@ -85,6 +87,7 @@ public class XiaoyuanNoticeServiceImpl implements IXiaoyuanNoticeService {
         }
         //查询出所有班级id
         xiaoyuanNotice.setSenderDept(classId);
+        startPage();
         return xiaoyuanNoticeMapper.selectXiaoyuanNoticeList(xiaoyuanNotice);
     }