|
@@ -32,6 +32,7 @@ import com.qunzhixinxi.hnqz.admin.api.entity.SysDictItem;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysRole;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysUser;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.WmAdRecord;
|
|
|
+import com.qunzhixinxi.hnqz.admin.api.entity.WmPkgQuizRelation;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.WmTaskSubmissionPercentRule;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.WmTaskSubmissionRule;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.vo.PersonalScoreRecordVO;
|
|
@@ -96,6 +97,7 @@ import com.qunzhixinxi.hnqz.admin.service.WmDaHospitalService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmDaPharmacyService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmDeptTaskTypeTemplateService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmFeedbackService;
|
|
|
+import com.qunzhixinxi.hnqz.admin.service.WmPkgQuizRelationService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmScorePackageService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmScorePackageStatusService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmScoreTaskTypeService;
|
|
@@ -227,6 +229,7 @@ public class ApiController {
|
|
|
private final MedicalEquipmentService medicalEquipmentService;
|
|
|
private final WmScorePackageSettleNoteMapper wmScorePackageSettleNoteMapper;
|
|
|
private final Sequence taskSequence;
|
|
|
+ private final WmPkgQuizRelationService quizRelationService;
|
|
|
|
|
|
@SysLog("通过任务类型获取表单配置")
|
|
|
@ApiOperation(value = "任务类型表单配置-通过任务类型获取表单配置", notes = "根据任务类型获取表单配置")
|
|
@@ -1732,7 +1735,7 @@ public class ApiController {
|
|
|
*/
|
|
|
@ApiOperation(value = "积分包-获取用户积分包", notes = "积分包-获取用户积分包,selType 众包用户传值,1 可领取 2 已领取")
|
|
|
@GetMapping("/getUserScorePackageList2")
|
|
|
- public R getUserScorePackageList2(Page page, int selType, String packageName, String selDate, String activeId) {
|
|
|
+ public R<?> getUserScorePackageList2(Page page, int selType, String packageName, String selDate, String activeId) {
|
|
|
|
|
|
UserVO userVO = sysUserService.selectUserVoById(SecurityUtils.getUser().getId());
|
|
|
|
|
@@ -1741,13 +1744,9 @@ public class ApiController {
|
|
|
return R.ok();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-// LambdaQueryWrapper<WmScorePackage> scoreQuery = Wrappers.lambdaQuery(query);
|
|
|
-
|
|
|
IPage<WmScorePackageApiOutput> scorePage;
|
|
|
// 小程序角色:5-全职学术信息沟通专员, 6-兼职学术信息沟通专员, 10-兼职CRC, 13-HCP
|
|
|
- if (1 == selType && (isZbRole(userVO.getRoleList(), 6) || isZbRole(userVO.getRoleList(), 10)
|
|
|
- || isZbRole(userVO.getRoleList(), 13))) {
|
|
|
+ if (1 == selType && (isZbRole(userVO.getRoleList(), 6) || isZbRole(userVO.getRoleList(), 10) || isZbRole(userVO.getRoleList(), 13))) {
|
|
|
WmScorePackage query = new WmScorePackage();
|
|
|
query.setDeptId(userVO.getDeptId() + "");
|
|
|
query.setTypeid("4");
|
|
@@ -1757,13 +1756,19 @@ public class ApiController {
|
|
|
scorePage = wmScorePackageService.getPackageListForReceive(page, query);
|
|
|
scorePackageList = scorePage.getRecords();
|
|
|
|
|
|
+ // 获取积分包的关联试卷
|
|
|
+ Map<Integer, List<WmPkgQuizRelation>> quizMap = null;
|
|
|
+ if (CollUtil.isNotEmpty(scorePackageList)){
|
|
|
+ List<Integer> collect = scorePackageList.stream().mapToInt(pkg -> Integer.parseInt(pkg.getId())).boxed().distinct().collect(Collectors.toList());
|
|
|
+ List<WmPkgQuizRelation> quizRelations = quizRelationService.listQuizRelationsByPkgIds(collect);
|
|
|
+
|
|
|
+ if (CollUtil.isNotEmpty(quizRelations)){
|
|
|
+ quizMap = quizRelations.stream().collect(Collectors.groupingBy(WmPkgQuizRelation::getPkgId));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
for (WmScorePackageApiOutput item : scorePackageList) {
|
|
|
-// Map<String, Object> map = new HashMap<>();
|
|
|
-// map.put("id", item.getId());
|
|
|
-// map.put("packageName", item.getScorePackageName());
|
|
|
-// map.put("score", item.getScore());
|
|
|
-// map.put("packageEntName", item.getPackageEntName());
|
|
|
-// map.put("userNum", item.getUserNum());
|
|
|
WmScorePackageStatus queryGetUser = new WmScorePackageStatus();
|
|
|
queryGetUser.setPackageId(item.getId());
|
|
|
queryGetUser.setStatus("2");
|
|
@@ -1776,35 +1781,19 @@ public class ApiController {
|
|
|
item.setScore(String.format("%.2f", Integer.parseInt(item.getScore()) / 100.0));
|
|
|
}
|
|
|
|
|
|
-// map.put("taskNum", item.getTaskNum());
|
|
|
-// map.put("createTime", item.getCreateTime());
|
|
|
-// map.put("description", item.getDescription());
|
|
|
-// map.put("packageType1", item.getPackageType1());
|
|
|
-// if ("1".equals(item.getPackageType1())) {
|
|
|
-// map.put("type1", "定额");
|
|
|
-// } else if ("2".equals(item.getPackageType1())) {
|
|
|
-// map.put("type1", "定量");
|
|
|
-// } else if ("3".equals(item.getPackageType1())) {
|
|
|
-// map.put("type1", "通用");
|
|
|
-// }
|
|
|
-
|
|
|
-// resultList.add(map);
|
|
|
+ if (CollUtil.isNotEmpty(quizMap)){
|
|
|
+ List<WmPkgQuizRelation> quizRelations = quizMap.get(Integer.parseInt(item.getId()));
|
|
|
+ item.setQuizRelations(quizRelations);
|
|
|
+ }
|
|
|
}
|
|
|
-// scorePage.setRecords(resultList);
|
|
|
return R.ok(scorePage);
|
|
|
}
|
|
|
|
|
|
-// WmScorePackageStatus status = new WmScorePackageStatus();
|
|
|
-// status.setDeptId(userVO.getDeptId() + "");
|
|
|
-// status.setUserId(userVO.getUserId() + "");
|
|
|
-// LambdaQueryWrapper<WmScorePackageStatus> statusQuery = Wrappers.lambdaQuery(status);
|
|
|
-
|
|
|
if (2 == selType) {
|
|
|
WmScorePackageApiInput input = new WmScorePackageApiInput();
|
|
|
input.setScorePackageName(packageName);
|
|
|
input.setSelDate(selDate);
|
|
|
input.setUserId(userVO.getUserId() + "");
|
|
|
-// input.setPackageType2(packageType2);
|
|
|
if (isZbRole(userVO.getRoleList(), 5)) {
|
|
|
// 小程序角色:5-全职学术信息沟通专员
|
|
|
input.setTypeid("3");
|
|
@@ -1849,21 +1838,23 @@ public class ApiController {
|
|
|
} else {
|
|
|
return R.ok();
|
|
|
}
|
|
|
-// if(inFlag){
|
|
|
-// List<WmScorePackage> inList = wmScorePackageService.list(scoreQuery);
|
|
|
-// List<String> ids = inList.stream().map(WmScorePackage::getId).collect(Collectors.toList());
|
|
|
-// System.err.println("-----"+inList.size());
|
|
|
-// if (CollectionUtils.isNotEmpty(ids)) {
|
|
|
-// statusQuery.in(WmScorePackageStatus::getPackageId,ids);
|
|
|
-// }else {
|
|
|
-// statusQuery.eq(WmScorePackageStatus::getPackageId,"-1");
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
|
|
|
scorePage = wmScorePackageStatusService.getReceivedPackageList(page, input);
|
|
|
|
|
|
scorePackageList = scorePage.getRecords();
|
|
|
+
|
|
|
+ // 获取积分包的关联试卷
|
|
|
+ Map<Integer, List<WmPkgQuizRelation>> quizMap = null;
|
|
|
+ if (CollUtil.isNotEmpty(scorePackageList)){
|
|
|
+ List<Integer> collect = scorePackageList.stream().mapToInt(pkg -> Integer.parseInt(pkg.getId())).boxed().distinct().collect(Collectors.toList());
|
|
|
+ List<WmPkgQuizRelation> quizRelations = quizRelationService.listQuizRelationsByPkgIds(collect);
|
|
|
+
|
|
|
+ if (CollUtil.isNotEmpty(quizRelations)){
|
|
|
+ quizMap = quizRelations.stream().collect(Collectors.groupingBy(WmPkgQuizRelation::getPkgId));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
if (CollectionUtils.isNotEmpty(scorePackageList)) {
|
|
|
Set<String> scorePackageIds = scorePackageList.stream()
|
|
|
.filter(output -> PackageTypeEnum.TYPE1_SCOTE_PACKAGE.val().equals(output.getPackageType1()))
|
|
@@ -1877,8 +1868,13 @@ public class ApiController {
|
|
|
.collect(Collectors.groupingBy(WmScorePackageSettleNote::getPackageId));
|
|
|
}
|
|
|
}
|
|
|
-// Map<String, Object> map = new HashMap<>();
|
|
|
for (WmScorePackageApiOutput item : scorePackageList) {
|
|
|
+
|
|
|
+ if (CollUtil.isNotEmpty(quizMap)){
|
|
|
+ List<WmPkgQuizRelation> quizRelations = quizMap.get(Integer.parseInt(item.getId()));
|
|
|
+ item.setQuizRelations(quizRelations);
|
|
|
+ }
|
|
|
+
|
|
|
if (PackageTypeEnum.TYPE1_SCOTE_PACKAGE.val().equals(item.getPackageType1())) {
|
|
|
// 只处理积分包的情况
|
|
|
List<WmScorePackageSettleNote> settleNoteList = settelMap.get(item.getId());
|
|
@@ -1888,29 +1884,6 @@ public class ApiController {
|
|
|
item.setSettleNoteStatus(String.valueOf(settleNote.getSettleNoteStatus()));
|
|
|
}
|
|
|
}
|
|
|
-// WmScorePackage item = wmScorePackageService.getById(status1.getPackageId());
|
|
|
-// map.put("id", item.getId());
|
|
|
-// map.put("packageName", item.getScorePackageName());
|
|
|
-// map.put("score", item.getScore());
|
|
|
-//// map.put("packageEntName", sysDeptService.getById(item.getSendPackageDeptId()).getName());
|
|
|
-// map.put("packageEntName", item.getPackageEntName());
|
|
|
-// map.put("userNum", item.getUserNum());
|
|
|
-// map.put("taskNum", item.getTaskNum());
|
|
|
-// map.put("createTime", item.getCreateTime());
|
|
|
-// map.put("description", item.getDescription());
|
|
|
-// map.put("packageType1", item.getPackageType1());
|
|
|
-
|
|
|
-// if ("1".equals(item.getStatus())) {
|
|
|
-// item.setStatusLabel("审核中");
|
|
|
-// } else if ("2".equals(item.getStatus())) {
|
|
|
-// item.setStatusLabel("审核通过");
|
|
|
-// } else if ("3".equals(item.getStatus())) {
|
|
|
-// item.setStatusLabel("审核不通过");
|
|
|
-// }
|
|
|
-// if (!"0".equals(item.getEnableType())) {
|
|
|
-// item.setStatusLabel("已终止");
|
|
|
-// }
|
|
|
-// map.put("taskAddFlag", item.getTaskAddFlag());
|
|
|
|
|
|
WmScorePackageStatus queryGetUser = new WmScorePackageStatus();
|
|
|
queryGetUser.setPackageId(item.getId());
|
|
@@ -1934,10 +1907,6 @@ public class ApiController {
|
|
|
.eq(WmTask::getRealFlag, "0")
|
|
|
.eq(WmTask::getDelFlag, DelEnum.NOT_DEL.val())
|
|
|
.ne(WmTask::getTaskStatus, "4"));
|
|
|
-// .ne(WmTask::getRealFlag, "1").ne(WmTask::getTaskStatus, "4"));
|
|
|
-
|
|
|
-// map.put("taskFinishNum", wmTaskList.size());
|
|
|
-// map.put("speedProgress", "0");
|
|
|
item.setTaskFinishNum(wmTaskList.size());
|
|
|
item.setSpeedProgress(0);
|
|
|
item.setFinishScore(0);
|
|
@@ -1965,11 +1934,9 @@ public class ApiController {
|
|
|
if (d > 100) {
|
|
|
d = 100;
|
|
|
}
|
|
|
-// map.put("speedProgress", new Double(d).intValue());
|
|
|
item.setSpeedProgress(new Double(d).intValue());
|
|
|
}
|
|
|
} else {
|
|
|
-// } else if ("2".equals(item.getPackageType1())) {
|
|
|
Integer waitApprovalTaskNum = 0;
|
|
|
double d = Math.ceil(wmTaskList.size() * 100 / item.getTaskNum());
|
|
|
if (d > 100) {
|
|
@@ -1981,15 +1948,12 @@ public class ApiController {
|
|
|
}
|
|
|
}
|
|
|
item.setWaitApprovalTaskNum(waitApprovalTaskNum);
|
|
|
-// map.put("speedProgress", new Double(d).intValue());
|
|
|
item.setSpeedProgress(new Double(d).intValue());
|
|
|
}
|
|
|
|
|
|
-// resultList.add(map);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
-// scorePage.setRecords(resultList);
|
|
|
return R.ok(scorePage);
|
|
|
|
|
|
}
|