|
@@ -58,7 +58,7 @@ public class TestController extends BaseController {
|
|
|
|
|
|
@PostMapping("/buildUserRole")
|
|
@PostMapping("/buildUserRole")
|
|
@SaIgnore
|
|
@SaIgnore
|
|
- public ResultData test1(){
|
|
|
|
|
|
+ public ResultData buildUserRole(){
|
|
for (ProjectTeam projectTeam : projectTeaml.list()) {
|
|
for (ProjectTeam projectTeam : projectTeaml.list()) {
|
|
Integer isCreater = projectTeam.getIsCreater();
|
|
Integer isCreater = projectTeam.getIsCreater();
|
|
UserRole userRole=new UserRole();
|
|
UserRole userRole=new UserRole();
|
|
@@ -71,9 +71,11 @@ public class TestController extends BaseController {
|
|
userRole.setUserId(byUserName.getUserId());
|
|
userRole.setUserId(byUserName.getUserId());
|
|
userRole.setRoleId(2);
|
|
userRole.setRoleId(2);
|
|
}
|
|
}
|
|
- userRoleService.save(userRole);
|
|
|
|
|
|
+ UserRole byUserIdAndPorId = userRoleService.findByUserIdAndPorId(byUserName.getUserId(), projectTeam.getProjectId());
|
|
|
|
+ if (ObjectUtil.isNull(byUserIdAndPorId)){
|
|
|
|
+ userRoleService.save(userRole);
|
|
|
|
+ }
|
|
|
|
|
|
- projectTeaml.updateById(projectTeam);
|
|
|
|
}
|
|
}
|
|
return ResultData.ok( );
|
|
return ResultData.ok( );
|
|
}
|
|
}
|