Commit 047287a6595be9ec9228f83dcb132c74d05a6186
1 parent
61ccad4b
Exists in
master
[Redmine PCS: Atendimento #4698]Add grupo master
Showing
1 changed file
with
1 additions
and
21 deletions
Show diff stats
cit-contratos-api/src/main/java/br/com/centralit/api/service/impl/InicializarContratosServiceImpl.java
| ... | ... | @@ -40,33 +40,13 @@ public class InicializarContratosServiceImpl extends UtilStartup { |
| 40 | 40 | @Autowired |
| 41 | 41 | private ModuloService moduloService; |
| 42 | 42 | |
| 43 | - @Autowired | |
| 44 | - private GrupoService grupoService; | |
| 45 | - | |
| 46 | - @Autowired | |
| 47 | - private MenuGrupoService menuGrupoService; | |
| 48 | - | |
| 49 | 43 | /** Atributo menuContratos. */ |
| 50 | 44 | Menu menuContratos; |
| 51 | 45 | |
| 52 | 46 | public void gerarCarga() { |
| 53 | 47 | |
| 54 | 48 | criarPaginasMenus(); |
| 55 | - | |
| 56 | - if(UtilColecao.isVazio(menuContratos.getMenuGrupos())){ | |
| 57 | - List<MenuGrupo> menuGrupos = new ArrayList<>(); | |
| 58 | - Collection<Grupo> gruposMaster = this.grupoService.findGruposMaster(); | |
| 59 | - for (Grupo grupo : gruposMaster) { | |
| 60 | - MenuGrupo menuGrupo = new MenuGrupo(); | |
| 61 | - menuGrupo.setOrganizacao(grupo.getOrganizacao()); | |
| 62 | - menuGrupo.setMenu(menuContratos); | |
| 63 | - menuGrupo.setGrupo(grupo); | |
| 64 | - this.menuGrupoService.save(menuGrupo); | |
| 65 | - menuGrupos.add(menuGrupo); | |
| 66 | - } | |
| 67 | - menuContratos.setMenuGrupos(menuGrupos); | |
| 68 | - this.menuService.merge(menuContratos); | |
| 69 | - } | |
| 49 | + this.menuService.adicionarGrupoMasterMenu(menuContratos); | |
| 70 | 50 | } |
| 71 | 51 | |
| 72 | 52 | /** | ... | ... |