class SetupDataBaseService {

    public boolean setupAdmin(DasGroup dasGroup, LoginUser user) throws Exception {
        if (StringUtils.isBlank(dasGroup.getGroup_name())) {
            return false;
        }

        if (StringUtils.isBlank(user.getUserName())) {
            return false;
        }

        Long userResult = loginUserDao.insertUser(user);
        if (userResult <= 0) {
            return false;
        }
        user = loginUserDao.getUserByNo(user.getUserNo());

        dasGroup.setId(consts.SUPER_GROUP_ID);
        dasGroup.setUpdate_user_no(user.getUserNo());

        Long groupResult = groupDao.insertDasGroup(dasGroup);
        if (groupResult <= 0) {
            return false;
        }

        Long userGroupResult = userGroupDao.insertUserGroup(user.getId(), consts.SUPER_GROUP_ID, RoleTypeEnum.Admin.getType(), OperateUserEnum.Allow.getType());
        if (userGroupResult <= 0) {
            return false;
        }
        return true;
    }

}