Переглянути джерело

CaseExtendsVO添加字段存放themeIds

薛晓波 6 роки тому
батько
коміт
cf36672888

+ 2 - 0
mooctest-site-server/src/main/java/cn/iselab/mooctest/site/web/data/CaseExtendsVO.java

@@ -35,4 +35,6 @@ public class CaseExtendsVO extends CaseVO {
     private VisitControlAttr visitControlAttr;
 
     private VerifyMessage hasPurchase;
+    //包含此题的ThemeId
+    private List<Long> themeIds;
 }

+ 1 - 0
mooctest-site-server/src/main/java/cn/iselab/mooctest/site/web/logic/drools/CaseExtendsDroolsVarifyLogicImpl.java

@@ -45,6 +45,7 @@ public class CaseExtendsDroolsVarifyLogicImpl implements CaseExtendsDroolsVarify
         List<Long> userHasBuyTheme = user2ThemeService.findByUserId(userId).stream().map(User2Theme::getThemeId).collect(Collectors.toList());
         List<Long> themeHasTheCase = themeService.getThemeEntityRelationsByEntityId(caseExtendsVO.getId(),EntityTypeEnum.CASE).stream().map(ThemeEntityRelations::getThemeId).collect(Collectors.toList());
         List<Long> roleList = user2RoleService.getByUserId(userId).stream().map(User2Role::getRoleId).collect(Collectors.toList());
+        caseExtendsVO.setThemeIds(themeHasTheCase);
         boolean hasBuy =  themeHasTheCase.stream()
                 .filter(userHasBuyTheme::contains).collect(Collectors.toList()).size() != 0;
         KieSession kieSession = droolsWithDBService.getKieBase("theme").newKieSession();