|
@@ -10,6 +10,7 @@ import com.mooctest.crowd.domain.repository.CrowdTestProjectRepo;
|
|
|
import com.mooctest.crowd.domain.repository.EvaluationAgencyRepo;
|
|
|
import com.mooctest.crowd.domain.repository.UserRepo;
|
|
|
import com.mooctest.crowd.domain.util.Converter;
|
|
|
+import com.mooctest.crowd.site.command.ApplyEnterpriseAuthCommand;
|
|
|
import com.mooctest.crowd.site.command.ApplyPersonalAuthCommand;
|
|
|
import com.mooctest.crowd.site.command.LoginCommand;
|
|
|
import com.mooctest.crowd.site.command.RegisterCommand;
|
|
@@ -119,6 +120,30 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
private UserToRoleDao userToRoleDao;
|
|
|
|
|
|
@Override
|
|
|
+ public void saveEnterpriseRole(User user, ApplyEnterpriseAuthCommand applyEnterpriseAuthCommand) {
|
|
|
+ UserPO userPO = userDao.save(Converter.convert(UserPO.class, user));
|
|
|
+ //如果是研发机构那么能发包
|
|
|
+ if(applyEnterpriseAuthCommand.getIsDaOrEa().equals("研发机构")){
|
|
|
+ UserToRolePO u2r = new UserToRolePO();
|
|
|
+ u2r.setUserId(userPO.getId());
|
|
|
+ u2r.setRoleId(8L);
|
|
|
+ userToRoleDao.save(u2r);
|
|
|
+
|
|
|
+ }
|
|
|
+ if(applyEnterpriseAuthCommand.getIsDaOrEa().equals("测评机构")){
|
|
|
+ UserToRolePO u2r = new UserToRolePO();
|
|
|
+ u2r.setUserId(userPO.getId());
|
|
|
+ u2r.setRoleId(2L);
|
|
|
+ userToRoleDao.save(u2r);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public void saveUserRole(User user, ApplyPersonalAuthCommand command) {
|
|
|
if (command.getRoleList().size() == 0 || command.getRoleList() == null) {
|
|
|
throw new BaseException("请选择成为发包或者接包用户");
|