Browse Source

Merge branch 'feat-quiz' into temp-pre

shc 1 year ago
parent
commit
940bf7adc2

+ 6 - 4
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmScorePackageController.java

@@ -111,7 +111,7 @@ public class WmScorePackageController {
 
 
 	@GetMapping(value = "/quiz/relation/list")
-	public R<?> ListPkgQuizRel(@RequestParam Integer pkgId){
+	public R<?> ListPkgQuizRel(@RequestParam Integer pkgId) {
 
 		List<WmPkgQuizRelation> wmPkgQuizRelations = pkgQuizRelationService.listQuizRelationsByPkgIds(Collections.singletonList(pkgId));
 		return R.ok(wmPkgQuizRelations);
@@ -2031,20 +2031,22 @@ public class WmScorePackageController {
 	}
 
 	/**
-	 * 修改积分包 new  二期   业务平台
+	 * 修改积分包(二期)
 	 *
 	 * @param wmScorePackage 积分包
-	 * @return R
+	 * @return 更新结果
 	 */
-	@ApiOperation(value = "修改积分包", notes = "修改积分包")
 	@SysLog("修改积分包(大包)")
 	@PostMapping("/updateByIds")
 	@Transactional(rollbackFor = Exception.class)
 	public R<?> updateByIds(@RequestBody WmScorePackage wmScorePackage) {
+
 		log.info("修改积分包(大包)入参:{}", wmScorePackage);
+
 		if (wmScorePackage.getScore() <= 0) {
 			return R.failed("积分包分值必须大于0");
 		}
+
 		wmScorePackage.setPackageType1("1");
 		wmScorePackage.setUpdateUser(SecurityUtils.getUser().getId());
 		wmScorePackage.setUpdateTime(LocalDateTime.now());

+ 2 - 2
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmScorePackageStatusController.java

@@ -152,11 +152,11 @@ public class WmScorePackageStatusController {
 	 *
 	 * @param page                 分页对象
 	 * @param wmScorePackageStatus 积分包状态
-	 * @return
+	 * @return 分页结果
 	 */
 	@ApiOperation(value = "分页查询", notes = "分页查询")
 	@GetMapping("/getPage")
-	public R getPage(Page page, WmScorePackageStatus wmScorePackageStatus) {
+	public R<?> getPage(Page page, WmScorePackageStatus wmScorePackageStatus) {
 		if (StringUtil.isEmpty(wmScorePackageStatus.getPackageId())) {
 			return R.failed("未查询到积分包id");
 		}

+ 8 - 22
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/WmScorePackageStatusService.java

@@ -1,20 +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;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -39,9 +22,11 @@ import java.util.Map;
  */
 public interface WmScorePackageStatusService extends IService<WmScorePackageStatus> {
 
-	R getPage(Page page, WmScorePackageStatus wmScorePackageStatus);
-	R approvalStatus(WmScorePackageStatus wmScorePackageStatus);
-	R updateZZ(WmScorePackageStatus wmScorePackageStatus);
+	R<?> getPage(Page page, WmScorePackageStatus wmScorePackageStatus);
+
+	R<?> approvalStatus(WmScorePackageStatus wmScorePackageStatus);
+
+	R<?> updateZZ(WmScorePackageStatus wmScorePackageStatus);
 
 	List<WmScorePackageStatus> getByPackageId(WmScorePackageStatus wmScorePackageStatus);
 
@@ -58,7 +43,7 @@ public interface WmScorePackageStatusService extends IService<WmScorePackageStat
 	/**
 	 * 获取当前部门已接单人的列表
 	 *
-	 * @param deptId 部门id
+	 * @param deptId       部门id
 	 * @param packageType1 积分包任务类型1
 	 * @param packageType2 积分包任务类型2
 	 * @return
@@ -67,8 +52,9 @@ public interface WmScorePackageStatusService extends IService<WmScorePackageStat
 
 	/**
 	 * 批量审核
+	 *
 	 * @param statusBatch 批量审核
 	 * @return 批量审核结果
 	 */
-	Map<String,Integer> approvalStatusBatch(WmScorePackageStatusBatch statusBatch);
+	Map<String, Integer> approvalStatusBatch(WmScorePackageStatusBatch statusBatch);
 }

+ 23 - 35
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmScorePackageServiceImpl.java

@@ -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();

+ 1 - 17
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmScorePackageStatusServiceImpl.java

@@ -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.collection.CollUtil;
@@ -69,7 +53,7 @@ public class WmScorePackageStatusServiceImpl extends ServiceImpl<WmScorePackageS
 	private final WmTaskMapper wmTaskMapper;
 
 	@Override
-	public R getPage(Page page, WmScorePackageStatus wmScorePackageStatus) {
+	public R<?> getPage(Page page, WmScorePackageStatus wmScorePackageStatus) {
 		IPage<WmScorePackageStatus> pages=wmScorePackageStatusMapper.getPage(page, wmScorePackageStatus);
 		return R.ok(pages);
 	}

+ 1 - 0
hnqz-upms/hnqz-upms-biz/src/main/resources/mapper/WmScorePackageStatusMapper.xml

@@ -39,6 +39,7 @@
 		s.create_time,
 		s.enable_type,
 		s.user_id as task_user_id,
+		s.quiz_res,
 		s.task_num
 		from wm_score_package_status s
 		left join sys_user u on u.user_id=s.user_id