@Override @Transactional public boolean saveLayoutConfig(MobileLayoutConfigDTO layoutDTO) { if (deteleLayout(layoutDTO.getPageId(), layoutDTO.getLayoutOrder(), AppConfigStatus.SAVED)) { int ret = mobileLayoutConfigMapper.add(layoutDTO); if (ret > 0) { long layoutId = layoutDTO.getId(); List<MobileUnitConfigDTO> unitList = layoutDTO.getUnitList(); for (MobileUnitConfigDTO unit : unitList) { unit.setLayoutId(layoutId); } MobileLayoutForm form = layoutDTO.getLayoutForm(); form.setLayoutId(layoutId); int addRet = mobileUnitConfigMapper.addList(unitList); if (addRet < unitList.size()) { throw new RuntimeException("单元保存异常..."); } return mobileLayoutFormMapper.add(form) > 0; } } return false; }