|
@@ -362,11 +362,21 @@ public class CrowdProjectServiceImpl implements CrowdProjectService {
|
|
|
List<TaskToUser> acceptedUserList = crowdTestTask.getAcceptedUserList();
|
|
|
acceptedUserList.stream().map(taskToUser -> {
|
|
|
User user = userRepo.getByID(taskToUser.getUserId());
|
|
|
- // 对用户判断认证类型 测评机构为1 测试人员为2
|
|
|
|
|
|
+ // 对用户判断认证类型 测评机构为2 测试人员为6
|
|
|
Optional<UserTaskCountPO> userTaskCountPOOptional = userTaskCountDao.findByUserId(user.getId());
|
|
|
if (!userTaskCountPOOptional.isPresent()) {
|
|
|
- UserTaskCount userTaskCount = new UserTaskCount(user.getId(), 1L, RoleType.EVALUATION_USER.getId());
|
|
|
+ Long roleType = 2L;
|
|
|
+ if(user.getRoleList().stream().anyMatch(role -> role.getName().equals(RoleType.EVALUATION_USER))){
|
|
|
+ roleType = RoleType.EVALUATION_USER.getId();
|
|
|
+ }
|
|
|
+ else if(user.getRoleList().stream().anyMatch(role -> role.getName().equals(RoleType.EVALUATION_USER))){
|
|
|
+ roleType = RoleType.EVALUATION_USER.getId();
|
|
|
+ }
|
|
|
+// else{
|
|
|
+// throw new HttpBadRequestException("当前存在未认证的用户")
|
|
|
+// }
|
|
|
+ UserTaskCount userTaskCount = new UserTaskCount(user.getId(), 1L, roleType);
|
|
|
userTaskCountDao.save(Converter.convert(UserTaskCountPO.class, userTaskCount));
|
|
|
} else {
|
|
|
UserTaskCountPO userTaskCountPO = userTaskCountPOOptional.get();
|