public HKRespData addCustomerSycData(AgentCustomerRequest request) {
        logger.info("新建经销商第二步:{}", request.getUserSid());
        Assert.notNull(request.getUserSid(), "缺少经销商编码！");
        //检查用户是否存在
        Map<String, Object> queryMap = new HashMap<>();
        queryMap.put("userSid", request.getUserSid());
        Users user = usersMapper.getByParam(queryMap);
        if (null == user || null == user.getUserSid()) {
            throw new RuntimeException("用户信息同步暂未完成，请稍后再试！");
        }
        //检查 分类 关系绑定是否完成
        Map<String, Long> categoryBindStatus = productCategoryMapper.checkShipBindStatus(request.getUserSid());
        if (0 != categoryBindStatus.get("remainNumbers")) {
            throw new RuntimeException("产品分类关系绑定暂未完成，请稍后再试！");
        }
        //检查 产品 关系绑定是否完成
        Map<String, Long> productBindStatus = productMapper.checkShipBindStatus(request.getUserSid());
        if (0 != productBindStatus.get("remainNumbers")) {
            throw new RuntimeException("产品信息关系绑定暂未完成，请稍后再试！");
        }
        //执行经销商数据库初始化脚本
        try {
            List<String> sqlList = new ArrayList<>();
            sqlList.add(FileUtils.read(new ClassPathResource("script/Init/DealerInit.sql")));
            String initDealerid = FileUtils.read(new ClassPathResource("script/Init/InitDealerid.sql")).replace("{dealerid}", request.getUserSid());
            sqlList.add(initDealerid);
            String initVchcode = "ALTER TABLE Dlyndx ADD CONSTRAINT Dlyndx_PK PRIMARY KEY (Vchcode);";
            String initDlyOrder ="ALTER TABLE DlyNdxOrder ADD CONSTRAINT DlyNdxOrder_PK PRIMARY KEY (Vchcode);";
            sqlList.add(initVchcode);
            sqlList.add(initDlyOrder);
            SqlSession sqlSession = dataSourceService.locateDataSource(request.getUserSid());
            dmpSqlExeUtils.exeCallSql(sqlSession, sqlList);
            logger.info("新建经销商执行初始化脚本完成:{}", request.getUserSid());
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            throw new RuntimeException("初始化经销商库失败！请联系管理员");
        }
        //验证脚本执行结果
        //DCMonitor_Stock 表是否存在
        try {
            List<String> sqlList = new ArrayList<>();
            sqlList.add(ConstantSql.CHECK_DEALER_TABLE_SQL);
            SqlSession sqlSession = dataSourceService.locateDataSource(request.getUserSid());
            dmpSqlExeUtils.exeCallSql(sqlSession, sqlList);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            throw new RuntimeException("初始化经销商库失败,DCMonitor_Stock未能创建成功！请联系管理员");
        }
        //DCMonitor_Stock_Insert、DCMonitor_Stock_Delete 两个触发器是否存在
        try {
            List<String> sqlList = new ArrayList<>();
            sqlList.add(ConstantSql.CHECK_DEALER_TRIGGERS_SQL);
            SqlSession sqlSession = dataSourceService.locateDataSource(request.getUserSid());
            List<List<Map<String, Object>>> result = dmpSqlExeUtils.exeMapsCallSql(sqlSession, sqlList);
            result.forEach(mapList -> {
                mapList.forEach(columnAndValue -> {
                    if (null == columnAndValue.get("tiggerNumbers") || 2 != Integer.parseInt(String.valueOf(columnAndValue.get("tiggerNumbers")))) {
                        logger.error("初始化经销商库失败,DCMonitor_Stock_Insert、DCMonitor_Stock_Delete触发器未能成功创建,请联系管理员");
                        throw new RuntimeException("初始化经销商库失败,DCMonitor_Stock_Insert、DCMonitor_Stock_Delete触发器未能成功创建,请联系管理员");
                    }
                });
            });
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            throw new RuntimeException(e.getMessage());
        }
        //Department 表中是否存在 dfullname 为'DMP自动同步' employee表中是否存在efullname为'DMP自动同步'
        try {
            List<String> sqlList = new ArrayList<>();
            sqlList.add(ConstantSql.CHECK_DEALER_ORG_USER_SQL);
            SqlSession sqlSession = dataSourceService.locateDataSource(request.getUserSid());
            List<List<Map<String, Object>>> result = dmpSqlExeUtils.exeMapsCallSql(sqlSession, sqlList);
            result.forEach(mapList -> {
                mapList.forEach(columnAndValue -> {
                    if (null == columnAndValue.get("dNumbers") || 1 != Integer.parseInt(String.valueOf(columnAndValue.get("dNumbers")))) {
                        logger.error("Department表中数据未能成功插入");
                        throw new RuntimeException("Department表中数据未能成功插入");
                    }
                    if (null == columnAndValue.get("eNumbers") || 1 != Integer.parseInt(String.valueOf(columnAndValue.get("eNumbers")))) {
                        logger.error("employee表中数据未能成功插入");
                        throw new RuntimeException("employee表中数据未能成功插入");
                    }
                });
            });
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            throw new RuntimeException(e.getMessage());
        }
        //调用接口 同步分类和产品
        DmpResult dmpResult = productCategoryService.pushDataToErp(request.getUserSid());
        if (!ErrorCodeEnum.SUC.getCode().equals(dmpResult.getRetCode())) {
            logger.warn("调用/api/pushProductCat同步分类和产品出现错误，接口返回失败，返回值：" + dmpResult.toString());
            throw new RuntimeException("调用推送分类产品接口失败，请联系管理员！");
        }
        try {
            //放入经销商数据同步监测列表
            List<String> sycDealerIds = redisClient.lRange(Constants.SYC_DATA_DEALER, 0, -1);
            if (null == sycDealerIds) {
                sycDealerIds = new ArrayList<>();
                sycDealerIds.add(request.getUserSid());
                redisClient.lPushAll(Constants.SYC_DATA_DEALER, sycDealerIds);
            } else {
                if (!sycDealerIds.contains(request.getUserSid())) {
                    redisClient.rPush(Constants.SYC_DATA_DEALER, request.getUserSid());
                }
            }
        } catch (Exception e) {
            logger.error("新建经销商放入监测列表失败", e);
        }
        return null;
    }优化一下代码