|
|
|
@ -10,16 +10,12 @@ import com.huoran.api.NakadaiClient; |
|
|
|
|
import com.huoran.api.UserClient; |
|
|
|
|
import com.huoran.common.constant.DelConstant; |
|
|
|
|
import com.huoran.common.constant.PlatformConstant; |
|
|
|
|
import com.huoran.common.entity.BcJudgmentPoint; |
|
|
|
|
import com.huoran.common.entity.LcJudgmentPoint; |
|
|
|
|
import com.huoran.common.entity.ProjectJudgmentVo; |
|
|
|
|
import com.huoran.common.entity.ProjectManage; |
|
|
|
|
import com.huoran.common.entity.*; |
|
|
|
|
import com.huoran.common.entity.to.JudgmentPointDataTo; |
|
|
|
|
import com.huoran.common.entity.to.ProjectDataTo; |
|
|
|
|
import com.huoran.common.exception.CustomException; |
|
|
|
|
import com.huoran.common.exception.ExceptionEnum; |
|
|
|
|
import com.huoran.common.response.R; |
|
|
|
|
import com.huoran.common.entity.ProjectJudgment; |
|
|
|
|
import com.huoran.occupationlab.entity.ProjectManageDisable; |
|
|
|
|
import com.huoran.occupationlab.entity.SchoolProjectHintOpen; |
|
|
|
|
import com.huoran.occupationlab.entity.req.PageAssessmentForProjectReq; |
|
|
|
@ -118,7 +114,8 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
return R.ok(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Integer bindProjectJudgment(Integer systemId, Integer projectId, List<ProjectJudgment> projectJudgmentList) { |
|
|
|
|
private Integer bindProjectJudgment(Integer systemId, Integer projectId, |
|
|
|
|
List<ProjectJudgment> projectJudgmentList) { |
|
|
|
|
int result = 1; |
|
|
|
|
// 根据系统查询判分点类型
|
|
|
|
|
Integer type = baseMapper.selectSystemType(systemId); |
|
|
|
@ -212,12 +209,12 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
List<ProjectJudgmentVo> projectJudgmentVos = new ArrayList<>(); |
|
|
|
|
Map<Integer, BcJudgmentPoint> bcJudgmentPointMap = new HashMap<>(); |
|
|
|
|
Map<Integer, LcJudgmentPoint> lcJudgmentPointMap = new HashMap<>(); |
|
|
|
|
if (type == 1){ |
|
|
|
|
if (type == 1) { |
|
|
|
|
List<LcJudgmentPoint> lcJudgmentPoints; |
|
|
|
|
|
|
|
|
|
if (stuAssessent != null){ |
|
|
|
|
if (stuAssessent != null) { |
|
|
|
|
lcJudgmentPoints = judgmentPointClient.queryLcJudgmentByLcIds(judgmentIds, null); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
lcJudgmentPoints = judgmentPointClient.queryLcJudgmentByLcIds(judgmentIds, DelConstant.IS_OPEN); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -226,13 +223,13 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
LcJudgmentPoint::getLcId, // key 为 LcId
|
|
|
|
|
point -> point, // value 为对应的 LcJudgmentPoint 对象
|
|
|
|
|
(existing, replacement) -> existing // 解决并发冲突
|
|
|
|
|
)); |
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
List<BcJudgmentPoint> bcJudgmentPoints; |
|
|
|
|
if (stuAssessent != null){ |
|
|
|
|
if (stuAssessent != null) { |
|
|
|
|
bcJudgmentPoints = judgmentPointClient.queryBcJudgmentByBcIds(judgmentIds, null); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
bcJudgmentPoints = judgmentPointClient.queryBcJudgmentByBcIds(judgmentIds, DelConstant.IS_OPEN); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -241,7 +238,7 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
BcJudgmentPoint::getBcId, // key 为 BcId
|
|
|
|
|
point -> point, // value 为对应的 BcJudgmentPoint 对象
|
|
|
|
|
(existing, replacement) -> existing // 解决并发冲突
|
|
|
|
|
)); |
|
|
|
|
)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -311,8 +308,6 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// for (ProjectJudgment projectJudgment : projectJudgmentList) {
|
|
|
|
|
// BcJudgmentPoint judgmentPoint = null;
|
|
|
|
|
// //根据系统id获取判分点名称、要求
|
|
|
|
@ -335,7 +330,8 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
// projectJudgmentVo.setName(judgmentPoint.getName());
|
|
|
|
|
// projectJudgmentVo.setExperimentalRequirements(judgmentPoint.getExperimentalRequirements());
|
|
|
|
|
// projectJudgmentVo.setExperimentCodeType(judgmentPoint.getExperimentCodeType());
|
|
|
|
|
// projectJudgmentVo.setExperimentalRequirementsType(judgmentPoint.getExperimentalRequirementsType());
|
|
|
|
|
// projectJudgmentVo.setExperimentalRequirementsType(judgmentPoint
|
|
|
|
|
// .getExperimentalRequirementsType());
|
|
|
|
|
// projectJudgmentVos.add(projectJudgmentVo);
|
|
|
|
|
// } else {
|
|
|
|
|
// if (judgmentPoint.getIsOpen() == 0) {
|
|
|
|
@ -345,9 +341,11 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
// projectJudgmentVo.setProjectId(projectJudgment.getProjectId().toString());
|
|
|
|
|
// projectJudgmentVo.setJudgmentId(projectJudgment.getJudgmentId());
|
|
|
|
|
// projectJudgmentVo.setName(judgmentPoint.getName());
|
|
|
|
|
// projectJudgmentVo.setExperimentalRequirements(judgmentPoint.getExperimentalRequirements());
|
|
|
|
|
// projectJudgmentVo.setExperimentalRequirements(judgmentPoint.getExperimentalRequirements
|
|
|
|
|
// ());
|
|
|
|
|
// projectJudgmentVo.setExperimentCodeType(judgmentPoint.getExperimentCodeType());
|
|
|
|
|
// projectJudgmentVo.setExperimentalRequirementsType(judgmentPoint.getExperimentalRequirementsType());
|
|
|
|
|
// projectJudgmentVo.setExperimentalRequirementsType(judgmentPoint
|
|
|
|
|
// .getExperimentalRequirementsType());
|
|
|
|
|
// projectJudgmentVos.add(projectJudgmentVo);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
@ -382,7 +380,8 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
// projectJudgmentVo.setProjectId(projectJudgment.getProjectId().toString());
|
|
|
|
|
// projectJudgmentVo.setJudgmentId(projectJudgment.getJudgmentId());
|
|
|
|
|
// projectJudgmentVo.setName(lcJudgmentPoint.getName());
|
|
|
|
|
// projectJudgmentVo.setExperimentalRequirements(lcJudgmentPoint.getExperimentalRequirements());
|
|
|
|
|
// projectJudgmentVo.setExperimentalRequirements(lcJudgmentPoint
|
|
|
|
|
// .getExperimentalRequirements());
|
|
|
|
|
// projectJudgmentVos.add(projectJudgmentVo);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
@ -404,7 +403,8 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QueryWrapper<ProjectManage> wrapper = new QueryWrapper<ProjectManage>().eq("project_name", projectManage.getProjectName()); |
|
|
|
|
QueryWrapper<ProjectManage> wrapper = new QueryWrapper<ProjectManage>().eq("project_name", |
|
|
|
|
projectManage.getProjectName()); |
|
|
|
|
wrapper.eq("is_del", DelConstant.NOT_DEL); |
|
|
|
|
wrapper.eq("zt_del", DelConstant.NOT_DEL); |
|
|
|
|
/*switch (projectManage.getFounder()) { |
|
|
|
@ -420,13 +420,14 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R avgValues(Integer number) { |
|
|
|
|
final int totalPoints = 100; |
|
|
|
|
if (number > 100){ |
|
|
|
|
if (number > 100) { |
|
|
|
|
// 使用方式
|
|
|
|
|
List<BigDecimal> scores = allocateScores(totalPoints, number); |
|
|
|
|
return R.ok().put("data", scores).put("sum",scores.stream().mapToDouble(BigDecimal::doubleValue).sum()); |
|
|
|
|
return R.ok().put("data", scores).put("sum", scores.stream().mapToDouble(BigDecimal::doubleValue).sum()); |
|
|
|
|
} |
|
|
|
|
List<Integer> list = new ArrayList<>(); |
|
|
|
|
Integer score = totalPoints / number; |
|
|
|
@ -442,13 +443,14 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
list.set(i, score + 1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return R.ok().put("data", list).put("sum",list.stream().mapToDouble(Integer::intValue).sum()); |
|
|
|
|
return R.ok().put("data", list).put("sum", list.stream().mapToDouble(Integer::intValue).sum()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public static List<BigDecimal> allocateScores(int totalPoints, int numberOfShares) {
|
|
|
|
|
// public static List<BigDecimal> allocateScores(int totalPoints, int numberOfShares) {
|
|
|
|
|
// if (totalPoints <= 0 || numberOfShares <= 0 || numberOfShares > 1000) {
|
|
|
|
|
// throw new IllegalArgumentException("Invalid input. Total points must be positive, number of shares must be between 1 and 1000.");
|
|
|
|
|
// throw new IllegalArgumentException("Invalid input. Total points must be positive, number of shares must
|
|
|
|
|
// be between 1 and 1000.");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// BigDecimal totalScore = BigDecimal.valueOf(totalPoints);
|
|
|
|
@ -468,9 +470,11 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
// // 调整最后一个份额以确保总和等于100
|
|
|
|
|
// BigDecimal sum = scoresList.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
// if (sum.compareTo(totalScore) < 0) {
|
|
|
|
|
// scoresList.set(scoresList.size() - 1, scoresList.get(scoresList.size() - 1).add(totalScore.subtract(sum)));
|
|
|
|
|
// scoresList.set(scoresList.size() - 1, scoresList.get(scoresList.size() - 1).add(totalScore.subtract
|
|
|
|
|
// (sum)));
|
|
|
|
|
// } else if (sum.compareTo(totalScore) > 0) {
|
|
|
|
|
// scoresList.set(scoresList.size() - 1, scoresList.get(scoresList.size() - 1).subtract(sum.subtract(totalScore)));
|
|
|
|
|
// scoresList.set(scoresList.size() - 1, scoresList.get(scoresList.size() - 1).subtract(sum.subtract
|
|
|
|
|
// (totalScore)));
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// // 四舍五入并保留一位小数
|
|
|
|
@ -482,7 +486,8 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
// }
|
|
|
|
|
public static List<BigDecimal> allocateScores(int totalPoints, int numberOfShares) { |
|
|
|
|
if (totalPoints <= 0 || numberOfShares <= 0 || numberOfShares > 1000) { |
|
|
|
|
throw new IllegalArgumentException("Invalid input. Total points must be positive, number of shares must be between 1 and 1000."); |
|
|
|
|
throw new IllegalArgumentException("Invalid input. Total points must be positive, number of shares must " + |
|
|
|
|
"be between 1 and 1000."); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
BigDecimal totalScore = BigDecimal.valueOf(totalPoints); |
|
|
|
@ -520,14 +525,14 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
//查询学校在产品下创建的练习项目
|
|
|
|
|
List<ProjectManage> projectManages = projectManageMapper |
|
|
|
|
.selectList(new QueryWrapper<ProjectManage>() |
|
|
|
|
.eq("school_id", schoolId) |
|
|
|
|
.eq("permissions", permissions) |
|
|
|
|
.eq("zt_del", DelConstant.NOT_DEL) |
|
|
|
|
.eq("is_del", DelConstant.NOT_DEL) |
|
|
|
|
.eq("zt_open", 0) |
|
|
|
|
.eq("is_open", 0) |
|
|
|
|
.eq("mall_id", mallId).last(" AND FIND_IN_SET( system_id, '" + systemId + "' )") |
|
|
|
|
); |
|
|
|
|
.eq("school_id", schoolId) |
|
|
|
|
.eq("permissions", permissions) |
|
|
|
|
.eq("zt_del", DelConstant.NOT_DEL) |
|
|
|
|
.eq("is_del", DelConstant.NOT_DEL) |
|
|
|
|
.eq("zt_open", 0) |
|
|
|
|
.eq("is_open", 0) |
|
|
|
|
.eq("mall_id", mallId).last(" AND FIND_IN_SET( system_id, '" + systemId + "' )") |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
//课程排序优于老师创建的项目
|
|
|
|
|
// List<ProjectManage> projectManageList = new ArrayList<>();
|
|
|
|
@ -541,27 +546,35 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
// projectManageList.add(manage);
|
|
|
|
|
// }
|
|
|
|
|
//查询课程系统下绑定的项目
|
|
|
|
|
List<ProjectManage> projectManageList = projectManageMapper.selectSystemProject(schoolId, systemId, permissions, cId); |
|
|
|
|
List<ProjectManage> projectManageList = projectManageMapper.selectSystemProject(schoolId, systemId, |
|
|
|
|
permissions, cId); |
|
|
|
|
|
|
|
|
|
projectManageList.addAll(projectManages); |
|
|
|
|
|
|
|
|
|
return R.ok().put("projects", projectManageList).put("projectSize", projectManageList.size()); |
|
|
|
|
//查询当前课程绑定的练习试卷
|
|
|
|
|
List<ProjectManage> practiceExamPaperList = projectManageMapper.getTestPaperByCourse( |
|
|
|
|
permissions, cId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return R.ok().put("projects", projectManageList).put("projectSize", projectManageList.size()).put( |
|
|
|
|
"exercisePaperList", practiceExamPaperList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<ProjectManage> getProjectBySystemIdRemoteCall(String systemId,Integer schoolId, Integer permissions, Integer cId, Integer mallId) { |
|
|
|
|
public List<ProjectManage> getProjectBySystemIdRemoteCall(String systemId, Integer schoolId, Integer permissions, |
|
|
|
|
Integer cId, Integer mallId) { |
|
|
|
|
|
|
|
|
|
List<ProjectManage> projectManages = projectManageMapper |
|
|
|
|
.selectList(new QueryWrapper<ProjectManage>() |
|
|
|
|
.eq("school_id", schoolId) |
|
|
|
|
.eq("permissions", permissions) |
|
|
|
|
.eq("zt_del", DelConstant.NOT_DEL) |
|
|
|
|
.eq("is_del", DelConstant.NOT_DEL) |
|
|
|
|
.eq("zt_open", 0) |
|
|
|
|
.eq("is_open", 0).eq("mall_id", mallId) |
|
|
|
|
.last(" AND FIND_IN_SET( system_id, '" + systemId + "' )") |
|
|
|
|
); |
|
|
|
|
.eq("school_id", schoolId) |
|
|
|
|
.eq("permissions", permissions) |
|
|
|
|
.eq("zt_del", DelConstant.NOT_DEL) |
|
|
|
|
.eq("is_del", DelConstant.NOT_DEL) |
|
|
|
|
.eq("zt_open", 0) |
|
|
|
|
.eq("is_open", 0).eq("mall_id", mallId) |
|
|
|
|
.last(" AND FIND_IN_SET( system_id, '" + systemId + "' )") |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
//课程排序优于老师创建的项目
|
|
|
|
|
List<ProjectManage> projectManageList = new ArrayList<>(); |
|
|
|
@ -613,13 +626,37 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<ProjectManage> getInternalProjectBySystemId(List<Integer> systemId, Integer permissions) { |
|
|
|
|
public List<ProjectManage> getInternalProjectBySystemId(List<Integer> systemId, Integer permissions, |
|
|
|
|
String keyword) { |
|
|
|
|
String id = ""; |
|
|
|
|
List<Integer> systemTypes = new ArrayList<>(); |
|
|
|
|
for (Integer sysId : systemId) { |
|
|
|
|
id += sysId + ","; |
|
|
|
|
|
|
|
|
|
int type = baseMapper.selectSystemType(sysId); |
|
|
|
|
systemTypes.add(type); |
|
|
|
|
} |
|
|
|
|
String systemIds = id.substring(0, id.length() - 1); |
|
|
|
|
return baseMapper.selectProjectList(systemIds, permissions); |
|
|
|
|
|
|
|
|
|
List<ProjectManage> projectManageList = baseMapper.selectProjectList(systemIds, permissions, keyword); |
|
|
|
|
|
|
|
|
|
//如果systemTypes包含了3,那么查询查询对应的理论试卷
|
|
|
|
|
if (systemTypes.contains(3)) { |
|
|
|
|
|
|
|
|
|
projectManageList.addAll(getAllExamPaper(keyword)); |
|
|
|
|
} |
|
|
|
|
return projectManageList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取中台发布的全部全部试卷 |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
public List<ProjectManage> getAllExamPaper(String keyword) { |
|
|
|
|
return baseMapper.getAllExamPaper(0, keyword); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -697,7 +734,8 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
* 教师筛选条件:默认展示全部学校发布的项目信息 |
|
|
|
|
* 全部筛选条件:默认展示内置项目信息 以及展示全部学校发布的项目 |
|
|
|
|
*/ |
|
|
|
|
Page<ProjectManage> page = new Page<ProjectManage>(projectManageReq.getPageNum(), projectManageReq.getPageSize()); |
|
|
|
|
Page<ProjectManage> page = new Page<ProjectManage>(projectManageReq.getPageNum(), |
|
|
|
|
projectManageReq.getPageSize()); |
|
|
|
|
IPage<ProjectManage> iPage = null; |
|
|
|
|
/* |
|
|
|
|
|
|
|
|
@ -719,7 +757,8 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
switch (projectManageReq.getFounder()) { |
|
|
|
|
|
|
|
|
|
case 0://0:系统
|
|
|
|
|
// queryWrapper.eq("zt_del", DelConstant.NOT_DEL).eq("founder", projectManageReq.getFounder()).orderByDesc("update_time");
|
|
|
|
|
// queryWrapper.eq("zt_del", DelConstant.NOT_DEL).eq("founder", projectManageReq.getFounder())
|
|
|
|
|
// .orderByDesc("update_time");
|
|
|
|
|
|
|
|
|
|
//中台——>系统筛选
|
|
|
|
|
// iPage = baseMapper.selectPage(page, queryWrapper);
|
|
|
|
@ -749,7 +788,8 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
* 教师筛选条件:默认展示本校发布的项目信息(同时依据本校角色展示超管、管理员可查看该校全部,其它角色只可看本人发布的) |
|
|
|
|
* 全部筛选条件:默认展示由该校购买的订单下包含的课程下的项目以及默认展示本校发布的项目信息(同时依据本校角色展示超管、管理员可查看该校全部,其它角色只可看本人发布的) |
|
|
|
|
*/ |
|
|
|
|
Page<ProjectManage> page = new Page<ProjectManage>(projectManageReq.getPageNum(), projectManageReq.getPageSize()); |
|
|
|
|
Page<ProjectManage> page = new Page<ProjectManage>(projectManageReq.getPageNum(), |
|
|
|
|
projectManageReq.getPageSize()); |
|
|
|
|
IPage<ProjectManage> iPage = null; |
|
|
|
|
|
|
|
|
|
QueryWrapper<ProjectManageDisable> queryWrapper = new QueryWrapper<>(); |
|
|
|
@ -763,7 +803,7 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
case 0: |
|
|
|
|
if (projectManageReq.getPlatformId() == PlatformConstant.POST_STATION) { |
|
|
|
|
//当平台为职站时候查询根据课程绑定的项目(只查询购买订单下课程所绑定启用且未删除的项目)
|
|
|
|
|
String cid = nakadaiClient.getSchoolCourse(projectManageReq.getSchoolId(),null); |
|
|
|
|
String cid = nakadaiClient.getSchoolCourse(projectManageReq.getSchoolId(), null); |
|
|
|
|
// projectManageReq.setCid(cid);
|
|
|
|
|
projectManageReq.setCid(projectManageReq.getCid()); |
|
|
|
|
iPage = baseMapper.queryProjectManage(page, projectManageReq); |
|
|
|
@ -771,7 +811,8 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
QueryWrapper<SchoolProjectHintOpen> openQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
openQueryWrapper.eq("school_id", projectManageReq.getSchoolId()); |
|
|
|
|
openQueryWrapper.eq("project_id", record.getProjectId()); |
|
|
|
|
SchoolProjectHintOpen schoolProjectHintOpen = schoolProjectHintOpenMapper.selectOne(openQueryWrapper); |
|
|
|
|
SchoolProjectHintOpen schoolProjectHintOpen = |
|
|
|
|
schoolProjectHintOpenMapper.selectOne(openQueryWrapper); |
|
|
|
|
if (ObjectUtil.isNotNull(schoolProjectHintOpen)) { |
|
|
|
|
record.setHintOpenBySchool(schoolProjectHintOpen.getHintOpen()); |
|
|
|
|
} else { |
|
|
|
@ -790,7 +831,9 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
if (roleName.contains("超级管理员") || roleName.contains("管理员")) { |
|
|
|
|
projectManageReq.setIsAdmin(1); |
|
|
|
|
} else { |
|
|
|
|
List<Integer> accountIdList = userClient.getAccountIdsBySchoolId(projectManageReq.getSchoolId(), PlatformConstant.POST_STATION); |
|
|
|
|
List<Integer> accountIdList = |
|
|
|
|
userClient.getAccountIdsBySchoolId(projectManageReq.getSchoolId(), |
|
|
|
|
PlatformConstant.POST_STATION); |
|
|
|
|
//为满足非超管、管理员的角色情况下能看到本人及超管、管理员角色发布的项目 由此将当前用户的账号id赋值进去List
|
|
|
|
|
accountIdList.add(projectManageReq.getAccountId()); |
|
|
|
|
projectManageReq.setAccountIdList(accountIdList); |
|
|
|
@ -801,7 +844,8 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
QueryWrapper<SchoolProjectHintOpen> openQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
openQueryWrapper.eq("school_id", projectManageReq.getSchoolId()); |
|
|
|
|
openQueryWrapper.eq("project_id", record.getProjectId()); |
|
|
|
|
SchoolProjectHintOpen schoolProjectHintOpen = schoolProjectHintOpenMapper.selectOne(openQueryWrapper); |
|
|
|
|
SchoolProjectHintOpen schoolProjectHintOpen = |
|
|
|
|
schoolProjectHintOpenMapper.selectOne(openQueryWrapper); |
|
|
|
|
if (ObjectUtil.isNotNull(schoolProjectHintOpen)) { |
|
|
|
|
record.setHintOpenBySchool(schoolProjectHintOpen.getHintOpen()); |
|
|
|
|
} else { |
|
|
|
@ -813,7 +857,7 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
} |
|
|
|
|
case 2: {//全部
|
|
|
|
|
//查询购买的课程下的项目以及根据角色查询本校内的项目
|
|
|
|
|
String cid = nakadaiClient.getSchoolCourse(projectManageReq.getSchoolId(),null); |
|
|
|
|
String cid = nakadaiClient.getSchoolCourse(projectManageReq.getSchoolId(), null); |
|
|
|
|
// projectManageReq.setCid(cid);
|
|
|
|
|
projectManageReq.setCid(projectManageReq.getCid()); |
|
|
|
|
//依据角色查询本校内的项目(超管管理员角色能看到本校内发布的全部项目、其它角色只能看到自己发布的以及超管管理员发布的项目)
|
|
|
|
@ -823,7 +867,8 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
if (roleName.contains("超级管理员") || roleName.contains("管理员")) { |
|
|
|
|
projectManageReq.setIsAdmin(1); |
|
|
|
|
} else { |
|
|
|
|
List<Integer> accountIdList = userClient.getAccountIdsBySchoolId(projectManageReq.getSchoolId(), PlatformConstant.POST_STATION); |
|
|
|
|
List<Integer> accountIdList = userClient.getAccountIdsBySchoolId(projectManageReq.getSchoolId(), |
|
|
|
|
PlatformConstant.POST_STATION); |
|
|
|
|
//为满足非超管、管理员的角色情况下能看到本人及超管、管理员角色发布的项目 由此将当前用户的账号id赋值进去List
|
|
|
|
|
accountIdList.add(projectManageReq.getAccountId()); |
|
|
|
|
projectManageReq.setAccountIdList(accountIdList); |
|
|
|
@ -834,7 +879,8 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
QueryWrapper<SchoolProjectHintOpen> openQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
openQueryWrapper.eq("school_id", projectManageReq.getSchoolId()); |
|
|
|
|
openQueryWrapper.eq("project_id", record.getProjectId()); |
|
|
|
|
SchoolProjectHintOpen schoolProjectHintOpen = schoolProjectHintOpenMapper.selectOne(openQueryWrapper); |
|
|
|
|
SchoolProjectHintOpen schoolProjectHintOpen = |
|
|
|
|
schoolProjectHintOpenMapper.selectOne(openQueryWrapper); |
|
|
|
|
if (ObjectUtil.isNotNull(schoolProjectHintOpen)) { |
|
|
|
|
record.setHintOpenBySchool(schoolProjectHintOpen.getHintOpen()); |
|
|
|
|
} else { |
|
|
|
@ -865,7 +911,8 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
if (roleName.contains("超级管理员") || roleName.contains("管理员")) { |
|
|
|
|
projectManageReq.setIsAdmin(1); |
|
|
|
|
} else { |
|
|
|
|
List<Integer> accountIdList = userClient.getAccountIdsBySchoolId(projectManageReq.getSchoolId(), PlatformConstant.POST_STATION); |
|
|
|
|
List<Integer> accountIdList = userClient.getAccountIdsBySchoolId(projectManageReq.getSchoolId(), |
|
|
|
|
PlatformConstant.POST_STATION); |
|
|
|
|
//为满足非超管、管理员的角色情况下能看到本人及超管、管理员角色发布的项目 由此将当前用户的账号id赋值进去List
|
|
|
|
|
accountIdList.add(projectManageReq.getAccountId()); |
|
|
|
|
projectManageReq.setAccountIdList(accountIdList); |
|
|
|
@ -889,6 +936,13 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
return R.ok().put("data", iPage); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R getProjectOrExamPaperByAssessment(PageAssessmentForProjectReq req) { |
|
|
|
|
Page<ProjectManage> page = new Page<ProjectManage>(req.getPageNum(), req.getPageSize()); |
|
|
|
|
IPage<ProjectManage> iPage = baseMapper.getProjectOrExamPaperByAssessment(page, req); |
|
|
|
|
return R.ok().put("data", iPage); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R getProjectAssessmentByCompetition(PageAssessmentForProjectReq req) { |
|
|
|
|
Page<ProjectManage> page = new Page<ProjectManage>(req.getPageNum(), req.getPageSize()); |
|
|
|
@ -911,7 +965,7 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
.eq("is_del", DelConstant.NOT_DEL) |
|
|
|
|
.eq("zt_open", 0) |
|
|
|
|
.eq("is_open", 0).in("system_id", req.getSystemId()) |
|
|
|
|
); |
|
|
|
|
); |
|
|
|
|
for (ProjectManage projectManage : projectManages) { |
|
|
|
|
String name = baseMapper.selectSystemName(projectManage.getSystemId()); |
|
|
|
|
projectManage.setSystemName(name); |
|
|
|
@ -923,7 +977,7 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Integer getCurriculumCountByType(Integer cid,Integer permissions) { |
|
|
|
|
public Integer getCurriculumCountByType(Integer cid, Integer permissions) { |
|
|
|
|
return baseMapper.getCurriculumCountByType(cid, permissions); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -937,13 +991,15 @@ public class ProjectManageServiceImpl extends ServiceImpl<ProjectManageMapper, P |
|
|
|
|
|
|
|
|
|
if (projectManageMapper.selectSystemType(projectDataTo.getSystemId()) == 0) { |
|
|
|
|
//查询编程判分点
|
|
|
|
|
ArrayList<Integer> judgmentIds = projectJudgmentMapper.selectBcJudgmentIdList(projectDataTo.getSet(), projectDataTo.getName()); |
|
|
|
|
ArrayList<Integer> judgmentIds = projectJudgmentMapper.selectBcJudgmentIdList(projectDataTo.getSet(), |
|
|
|
|
projectDataTo.getName()); |
|
|
|
|
JudgmentPointDataTo judgmentPointDataTo = new JudgmentPointDataTo(); |
|
|
|
|
judgmentPointDataTo.setJudgmentIds(judgmentIds); |
|
|
|
|
return judgmentPointDataTo; |
|
|
|
|
} else { |
|
|
|
|
//查询流程判分点
|
|
|
|
|
ArrayList<Integer> judgmentIds = projectJudgmentMapper.selectLcJudgmentIdList(projectDataTo.getSet(), projectDataTo.getName()); |
|
|
|
|
ArrayList<Integer> judgmentIds = projectJudgmentMapper.selectLcJudgmentIdList(projectDataTo.getSet(), |
|
|
|
|
projectDataTo.getName()); |
|
|
|
|
JudgmentPointDataTo judgmentPointDataTo = new JudgmentPointDataTo(); |
|
|
|
|
judgmentPointDataTo.setJudgmentIds(judgmentIds); |
|
|
|
|
return judgmentPointDataTo; |
|
|
|
|