@Override @Transactional public boolean deteleLayout(int pageId, int layoutOrder, AppConfigStatus status) { List<MobileLayoutConfig> layoutList = mobileLayoutConfigMapper.getLayoutByPageIdAndOrder(pageId, layoutOrder); if (CollectionUtils.isNotEmpty(layoutList)) { MobileLayoutConfig layout = layoutList.get(0); long layoutId = layout.getId(); if (mobileLayoutConfigMapper.delete(layoutId) > 0) { return mobileUnitConfigMapper.deleteByLayoutId(layoutId) > 0 && mobileLayoutFormMapper.deleteByLayoutId(layoutId) > 0; } } return true; }
@Override @Transactional public List<MobileLayoutConfigDTO> getLayoutConfigListByPageId(int pageId) { List<MobileLayoutConfigDTO> layoutDTOList = new ArrayList<>(); List<MobileLayoutConfig> layout = mobileLayoutConfigMapper.getLayoutConfigListByPageId( pageId, AppConfigStatus.PUBLISHED.getIntValue()); for (MobileLayoutConfig config : layout) { MobileLayoutConfigDTO dto = new MobileLayoutConfigDTO(config); List<MobileUnitConfigDTO> unitList = getUnitConfigByLayoutId(config.getId()); dto.setUnitList(unitList); layoutDTOList.add(dto); } Collections.sort(layoutDTOList); return layoutDTOList; }