|
@@ -1,19 +1,3 @@
|
|
|
-/*
|
|
|
- * Copyright (c) 2018-2025, hnqz All rights reserved.
|
|
|
- *
|
|
|
- * Redistribution and use in source and binary forms, with or without
|
|
|
- * modification, are permitted provided that the following conditions are met:
|
|
|
- *
|
|
|
- * Redistributions of source code must retain the above copyright notice,
|
|
|
- * this list of conditions and the following disclaimer.
|
|
|
- * Redistributions in binary form must reproduce the above copyright
|
|
|
- * notice, this list of conditions and the following disclaimer in the
|
|
|
- * documentation and/or other materials provided with the distribution.
|
|
|
- * Neither the name of the pig4cloud.com developer nor the names of its
|
|
|
- * contributors may be used to endorse or promote products derived from
|
|
|
- * this software without specific prior written permission.
|
|
|
- * Author: hnqz
|
|
|
- */
|
|
|
package com.qunzhixinxi.hnqz.admin.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
@@ -466,34 +450,38 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
|
|
|
@Override
|
|
|
public WmScorePackage selectWmScorePackage(WmScorePackage wmScorePackage) {
|
|
|
+
|
|
|
+ String pkgId = wmScorePackage.getScoreId();
|
|
|
wmScorePackage = wmScorePackageMapper.selectByScoreId(wmScorePackage.getScoreId());
|
|
|
- if (wmScorePackage.getRelationScoreId() == null || wmScorePackage.getRelationScoreId().equals("")) {
|
|
|
+
|
|
|
+ if (StrUtil.isBlank(wmScorePackage.getRelationScoreId())) {
|
|
|
wmScorePackage.setRelationScoreId("-1");
|
|
|
}
|
|
|
+
|
|
|
WmScoreTaskType wmScoreTaskType = new WmScoreTaskType();
|
|
|
- if (wmScorePackage.getRelationScoreId().equals("-1")) {
|
|
|
- wmScoreTaskType.setScoreId(wmScorePackage.getId());
|
|
|
- } else {
|
|
|
- wmScoreTaskType.setScoreId(wmScorePackage.getRelationScoreId());
|
|
|
- }
|
|
|
+ wmScoreTaskType.setScoreId("-1".equals(wmScorePackage.getRelationScoreId()) ? wmScorePackage.getId() : wmScorePackage.getRelationScoreId());
|
|
|
List<WmScoreTaskType> taskTypeList = wmScoreTaskTypeMapper.listWmScoreTaskType(wmScoreTaskType);
|
|
|
- Set taskTypeSet = taskTypeList.stream().map(WmScoreTaskType::getTaskTypeId).collect(Collectors.toSet());
|
|
|
+ Set<String> taskTypeSet = taskTypeList.stream().map(WmScoreTaskType::getTaskTypeId).collect(Collectors.toSet());
|
|
|
wmScorePackage.setTaskTypeSet(taskTypeSet);
|
|
|
+
|
|
|
+
|
|
|
+ // 查询关联的试卷
|
|
|
+ List<WmPkgQuizRelation> quizRelations = pkgQuizRelationService.listQuizRelationsByPkgIds(Collections.singletonList(Integer.parseInt(pkgId)));
|
|
|
+
|
|
|
+ if (CollUtil.isNotEmpty(quizRelations)){
|
|
|
+
|
|
|
+ List<Integer> quizIds = quizRelations.stream().map(WmPkgQuizRelation::getQuizId).collect(Collectors.toList());
|
|
|
+ List<Integer> relIds = quizRelations.stream().map(WmPkgQuizRelation::getRelationId).collect(Collectors.toList());
|
|
|
+ wmScorePackage.setQuizIds(quizIds);
|
|
|
+ wmScorePackage.setQuizRelationIds(relIds);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ wmScorePackage.setQuizRelations(quizRelations);
|
|
|
+
|
|
|
return wmScorePackage;
|
|
|
}
|
|
|
|
|
|
- // @Override
|
|
|
- // public IPage<WmScorePackage> selectWmScorePackageLists(Page page, WmScorePackage wmScorePackage) {
|
|
|
- // OrderItem orderItem = new OrderItem();
|
|
|
- // orderItem.setColumn("create_time");
|
|
|
- // orderItem.setAsc(false);
|
|
|
- // page.addOrder(orderItem);
|
|
|
- //
|
|
|
- // SysDept sysDept = sysDeptService.getById(SecurityUtils.getUser().getDeptId());
|
|
|
- // wmScorePackage.setSendPackageDeptId(String.valueOf(sysDept.getDeptId()));
|
|
|
- // return wmScorePackageMapper.selectWmScorePackageLists(page, wmScorePackage);
|
|
|
- // }
|
|
|
-
|
|
|
@Override
|
|
|
public IPage<WmScorePackage> selectWmScorePackageLists(Page page, WmScorePackage wmScorePackage) {
|
|
|
OrderItem orderItem = new OrderItem();
|