Merged in dirga/refactorV2 (pull request #6)

fix parent menu
This commit is contained in:
Dirgantara 2023-06-06 04:45:30 +00:00
commit 4807fe5c23
4 changed files with 10 additions and 5 deletions

View File

@ -30,8 +30,8 @@ public interface RksIsiRepository extends JpaRepository<RksIsi, Long> {
List<RksIsi> findByRksDaftarIsiIdAndIsDeleteFalse(Long rksDaftarIsiId);
@Modifying
@Query(value = "update RksIsi ri " +
"set ri.isDelete = true " +
"where ri.rksDaftarIsiId = :rksDaftarIsiId")
@Query(value = "UPDATE rks_isi " +
"SET is_delete = 1 " +
"WHERE rks_daftar_isi_id = :rksDaftarIsiId", nativeQuery = true)
void deleteRksIsi(@Param("rksDaftarIsiId") Long rksDaftarIsiId);
}

View File

@ -118,6 +118,8 @@ public class LoginService implements BaseService<LoginRequest, LoginResponse> {
menusPermissionResponseList.add(menusPermissionResponse);
}
parentMenusResponseList.removeIf(parentMenusResponse -> parentMenusResponse.getId().equals(menusPermissionView.getId()) &&
BooleanUtils.isFalse(menusPermissionView.getCanView()));
}
for (ParentMenusResponse parentMenusResponse : parentMenusResponseList) {

View File

@ -9,6 +9,8 @@ import com.iconplus.smartproc.repository.RksIsiRepository;
import com.iconplus.smartproc.util.Constants;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
@Service
public class DeleteRksDaftarIsiService implements BaseService<RksDaftarIsiRequest, EmptyResponse> {
@ -20,6 +22,7 @@ public class DeleteRksDaftarIsiService implements BaseService<RksDaftarIsiReques
this.rksIsiRepository = rksIsiRepository;
}
@Transactional
@Override
public EmptyResponse execute(RksDaftarIsiRequest input) {

View File

@ -83,10 +83,10 @@ public class PostCreateRksIsiService implements BaseService<RksIsiRequest, RksIs
throw new BusinessException(
Constants.ERR_CODE_10002,
Constants.ERR_TTL_10002,
String.format(Constants.ERR_MSG_10002, "Sub Bab", input.getSubBab()));
String.format(Constants.ERR_MSG_10002, "Sub Bab", input.getKelompok()));
}
rksIsi.setParent(input.getParent());
rksIsi.setKelompok(input.getSubBab());
rksIsi.setKelompok(input.getKelompok());
}
}
}