瀏覽代碼

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_scrm_java

caoliqin 3 周之前
父節點
當前提交
95df95b2f6

+ 2 - 2
fs-service-system/src/main/java/com/fs/course/service/impl/TencentCloudCosService.java

@@ -45,10 +45,10 @@ public class TencentCloudCosService implements ITencentCloudCosService {
 
     private static final String YL_SECRET_ID = "AKIDiMq9lDf2EOM9lIfqqfKo7FNgM5meD0sT";
     private static final String YL_SECRET_KEY = "u5SuS80342xzx8FRBukza9lVNHKNMSaB";
-    private static final String YL_BUCKET = "hylj-1323137866";
+    private static final String YL_BUCKET = "fby-1323137866";
     private static final String YL_APP_ID = "1323137866";
     private static final String YL_REGION = "ap-chongqing";
-    private static final String YL_PROXY = "hylj";
+    private static final String YL_PROXY = "fby";
     @Override
     public R getTmpSecretKey() {
         TreeMap<String, Object> config = new TreeMap<String, Object>();

+ 16 - 5
fs-service-system/src/main/java/com/fs/sop/service/impl/QwSopTempServiceImpl.java

@@ -7,6 +7,7 @@ import com.fs.common.annotation.DataSource;
 import com.fs.common.enums.DataSourceType;
 import com.fs.common.exception.base.BaseException;
 import com.fs.common.utils.PubFun;
+import com.fs.common.utils.StringUtils;
 import com.fs.course.config.CourseConfig;
 import com.fs.course.domain.FsUserCourse;
 import com.fs.course.domain.FsUserCourseVideo;
@@ -32,6 +33,7 @@ import com.fs.sop.vo.VoiceVo;
 import com.fs.system.domain.SysConfig;
 import com.fs.system.service.ISysConfigService;
 import lombok.AllArgsConstructor;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.rocketmq.spring.core.RocketMQTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -286,10 +288,14 @@ public class QwSopTempServiceImpl implements IQwSopTempService
     @Override
     public List<QwSopTempRedPackageVo> redList(String id) {
         List<QwSopTempDay> dayList = qwSopTempRulesService.listByTempIdAll(id);
-        if(dayList.isEmpty()){
+        if(CollectionUtils.isEmpty(dayList)){
             return Collections.emptyList();
         }
-        List<QwSopTempRules> rules = dayList.stream().flatMap(e -> e.getList().stream()).collect(Collectors.toList());
+        List<QwSopTempRules> rules = dayList.stream()
+                .filter(e->e!= null && e.getList()!=null)
+                .flatMap(e -> e.getList().stream())
+                .filter(Objects::nonNull)
+                .collect(Collectors.toList());
         if(rules.isEmpty()){
             return Collections.emptyList();
         }
@@ -297,7 +303,8 @@ public class QwSopTempServiceImpl implements IQwSopTempService
         Map<Long, FsUserCourseVideoRedPackage> redMap = PubFun.listToMapByGroupObject(redPackageList, FsUserCourseVideoRedPackage::getVideoId);
         List<FsUserCourseVideo> videoList = fsUserCourseVideoMapper.selectVideoByCourseId(rules.get(0).getCourseId());
         Map<Long, FsUserCourseVideo> videoMap = PubFun.listToMapByGroupObject(videoList, FsUserCourseVideo::getVideoId);
-        return rules.stream().filter(e -> redMap.containsKey(e.getVideoId()) && videoMap.containsKey(e.getVideoId())).map(e -> {
+        return rules.stream()
+                .filter(e -> e.getVideoId() != null && redMap.containsKey(e.getVideoId()) && videoMap.containsKey(e.getVideoId())).map(e -> {
             FsUserCourseVideoRedPackage red = redMap.get(e.getVideoId());
             FsUserCourseVideo video = videoMap.get(e.getVideoId());
             QwSopTempRedPackageVo vo = new QwSopTempRedPackageVo();
@@ -414,12 +421,16 @@ public class QwSopTempServiceImpl implements IQwSopTempService
     public QwSopTempDay selectRulesInfo(Long id) {
         QwSopTempDay day = qwSopTempDayService.info(id);
         List<QwSopTempRules> rulesList = qwSopTempRulesService.listByDayId(id);
-        if(!rulesList.isEmpty()){
+        if(CollectionUtils.isNotEmpty(rulesList)){
             List<QwSopTempContent> contentList = qwSopTempContentService.listByRulesIds(PubFun.listToNewList(rulesList, QwSopTempRules::getId));
             Map<Long, List<QwSopTempContent>> contentMap = PubFun.listToMapByGroupList(contentList, QwSopTempContent::getRulesId);
             rulesList.forEach(e -> {
                 List<QwSopTempContent> contents = contentMap.get(e.getId());
-                e.setSetting(contents.stream().map(c -> JSON.parseObject(c.getContent())).collect(Collectors.toList()));
+                if(CollectionUtils.isNotEmpty(contents)){
+                    e.setSetting(contents.stream()
+                            .filter(c-> c!=null && StringUtils.isNotBlank(c.getContent()))
+                            .map(c -> JSON.parseObject(c.getContent())).collect(Collectors.toList()));
+                }
             });
         }
         day.setList(rulesList);