浏览代码

fix(app):修复设备信息查询空指针异常

- 在查询设备信息时增加空值判断,避免空指针异常
- 调整定时任务执行间隔,从10分钟调整为20分钟
- 开放课程详情接口访问权限,用于审核使用
SheepHy 1 周之前
父节点
当前提交
2bc99fbbf3

+ 2 - 1
national-motion-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java

@@ -121,7 +121,8 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/app/detail/getAllCourseCategory", "anon");
         filterChainDefinitionMap.put("/app/detail/getPlaceInfoNoFixation", "anon");
         filterChainDefinitionMap.put("/app/game/findById", "anon");
-//        filterChainDefinitionMap.put("/app/detail/getCourseInfo", "anon");
+        //todo 用于审核开放
+        filterChainDefinitionMap.put("/app/detail/getCourseInfo", "anon");
         filterChainDefinitionMap.put("/app/stadium/getPlaceInfo", "anon");
         filterChainDefinitionMap.put("/test/**", "anon");//测试
         filterChainDefinitionMap.put("/profitSharing/**", "anon");//测试

+ 3 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/AppHomeServiceImpl.java

@@ -171,6 +171,9 @@ public class AppHomeServiceImpl implements IAppHomeService {
                 for (PlaceVO placeVO : records) {
                     if (placeVO.getId() != null) {
                         placeIds.add(placeVO.getId());
+                        if(null != placeVO.getCover()){
+                            placeVO.setCover(placeVO.getCover().split(",")[0]);
+                        }
                     }
                 }
                 Map<String, List<AppSitePlace>> sitePlacesMap = Collections.emptyMap();

+ 7 - 3
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/quartz/job/OrTeachingJobService.java

@@ -238,15 +238,19 @@ public class OrTeachingJobService {
      * @Param
      * @return
      **/
-    @Scheduled(fixedDelay = 600000)
+    @Scheduled(fixedDelay = 1200000)
 //    @Scheduled(cron = "0 0 23 * * ?")
     public void synchronousDoorOpeningAndClosingRecords(){
         try {
             List<DoorRecordDTO> allRecords = fetchAllDoorRecords();
             for (DoorRecordDTO data : allRecords) {
                 if(null == appGmtInfoMapper.selectOne(Wrappers.<AppGmtInfo>lambdaQuery().eq(AppGmtInfo::getOriginId, data.getOriginId()).last("LIMIT 1"))){
-                    String siteId = appDeviceMapper.selectOne(Wrappers.<AppDevice>lambdaQuery()
-                            .eq(AppDevice::getDeviceSerial, data.getDeviceSerial().split("-")[0])).getSiteId();
+                    AppDevice appDevice = appDeviceMapper.selectOne(Wrappers.<AppDevice>lambdaQuery().eq(AppDevice::getDeviceSerial, data.getDeviceSerial().split("-")[0]));
+                    if(null == appDevice){
+                        log.error("未找到设备:{}", data.getDeviceSerial());
+                        continue;
+                    }
+                    String siteId = appDevice.getSiteId();
                     appGmtInfoMapper.insert(new AppGmtInfo()
                             .setFamilyId(data.getEmployeeNo())
                             .setSiteId(siteId)