OpenController.java 33 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650
package cn.com.glsx.merchants.controller;

import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import cn.com.glsx.merchants.model.response.MerchantStaffResponse;
import cn.com.glsx.merchants.model.response.MerchantSubListResponse;
import cn.com.glsx.merchants.request.accounttype.MerchantListByConditionRopRequest;
import cn.com.glsx.merchants.request.merchant.*;
import cn.com.glsx.merchants.request.open.*;
import cn.com.glsx.merchants.request.serviceCenter.*;
import cn.com.glsx.merchants.request.staff.MerchantNoListByStaffPhone;
import cn.com.glsx.merchants.request.staff.StaffListRequest;
import cn.com.glsx.merchants.response.*;
import cn.com.glsx.merchants.response.serviceCenter.SearchServiceMerchantRopResponse;
import cn.com.glsx.merchants.response.serviceCenter.ServiceStaffRopResponse;
import cn.com.glsx.merchants.response.serviceCenter.VisibleMerchantRopResponse;
import cn.com.glsx.merchants.service.OpenService;
import cn.com.glsx.merchants.service.StaffService;
import cn.com.glsx.merchants.util.Pagination;
import com.rop.AbstractRopRequest;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;

import java.util.List;

/**
 * @author zhouhaibao
 * @version 1.0
 * @description: TODO
 * @date 2021/9/17 9:41
 */
@Slf4j
@Api("对外开发接口")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
public class OpenController {

    @Autowired
    private OpenService openService;

    @Autowired
    private StaffService staffService;

    @ServiceMethod(method = "merchants.api.open.findMerchantDetailByMerchantNo", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据商户号查询商户详情")
    public RopResponse<MerchantRopResponse> findMerchantDetailByMerchantNo(OpenMerchantDetailRequest openMerchantRequest) {
        try {
            MerchantRopResponse merchantRopResponse = openService.findMerchantDetailByMerchantNo(openMerchantRequest);
            return RopResponse.success(merchantRopResponse);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findMerchantDetailByMerchantNo__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.findSuperlativeMerchant", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据商户号最上级工厂商户号")
    public RopResponse<Integer> findSuperlativeMerchant(OpenMerchantDetailRequest openMerchantRequest) {
        try {
            Integer superlativeMerchant = openService.findSuperlativeMerchant(openMerchantRequest);
            return RopResponse.success(superlativeMerchant);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findSuperlativeMerchant__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }


    @ServiceMethod(method = "merchants.api.open.findSuperiorList", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据商户查询商户上级列表")
    public RopResponse<List<MerchantRopResponse>> findSuperiorList(OpenMerchantLevelRequest openMerchantRequest) {
        try {
            List<MerchantRopResponse> superiorList = openService.findSuperiorList(openMerchantRequest);
            return RopResponse.success(superiorList);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findSuperiorList__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.findMerchantList", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据商户名称和渠道类型查询商户列表")
    public RopResponse<List<MerchantRopResponse>> findMerchantList(OpenMerchantListRequest openMerchantRequest) {
        try {
            List<MerchantRopResponse> superiorList = openService.findMerchantList(openMerchantRequest);
            return RopResponse.success(superiorList);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findSuperiorList__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.findSubordinateListByPage", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据商户查询商户下级列表")
    public RopResponse<Pagination<MerchantRopResponse>> findSubordinateListByPage(OpenMerchantPageRequest openMerchantRequest) {
        try {
            Pagination<MerchantRopResponse> subordinateListByPage = openService.findSubordinateListByPage(openMerchantRequest);
            return RopResponse.success(subordinateListByPage);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findSubordinateListByPage__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.checkBussinessAccount", needInSession = NeedInSessionType.NO)
    @ApiOperation("用户登录校验")
    public RopResponse<List<OpenUserResponse>> checkBussinessAccount(OpenCheckUserRequest openUserRequest) {
        try {
            List<OpenUserResponse> openUserResponse = openService.checkBussinessAccount(openUserRequest);

            return RopResponse.success(openUserResponse);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__checkBussinessAccount__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.findDataPermission", needInSession = NeedInSessionType.NO)
    @ApiOperation("用户数据权限获取")
    public RopResponse<List<Integer>> findDataPermission(OpenUserDataPermissionRequest openUserRequest) {
        try {
            List<Integer> dataPermission = openService.findDataPermission(openUserRequest);
            return RopResponse.success(dataPermission);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findDataPermission__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.findMenuFunPermission", needInSession = NeedInSessionType.NO)
    @ApiOperation("用户菜单权限获取")
    public RopResponse<List<AccountTypeTreeRopResponse>> findMenuFunPermission(OpenUserMenuPermissionRequest openUserRequest) {
        try {
            List<AccountTypeTreeRopResponse> menuFunPermission = openService.findMenuFunPermission(openUserRequest);
            return RopResponse.success(menuFunPermission);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findMenuFunPermission__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }


    /**
     * 保存或者更新商户信息接口(对外)
     *
     * @param merchantSaveRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.open.saveMerchant", needInSession = NeedInSessionType.NO)
    @ApiOperation("保存或者更新商户信息接口(对外)")
    public RopResponse<String> saveMerchant(MerchantSaveOpenRequest merchantSaveRequest) {
        try {
            String merchant = openService.saveMerchant(merchantSaveRequest);
            return RopResponse.success(merchant);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__saveMerchant__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 企微关联商户
     *
     * @param relaevanceMerRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.open.relevanceMerchant", needInSession = NeedInSessionType.NO)
    @ApiOperation("企微关联商户")
    public RopResponse<Boolean> relevanceMerchant(RelaevanceMerRequest relaevanceMerRequest) {
        try {
            Boolean merchant = openService.relevanceMerchant(relaevanceMerRequest);
            return RopResponse.success(merchant);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__relevanceMerchant__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 保存或者更新员工接口(对外)
     *
     * @param staffSaveOpenRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.open.saveStaff", needInSession = NeedInSessionType.NO)
    @ApiOperation("保存或者更新员工接口(对外)")
    public RopResponse<String> saveStaff(StaffSaveOpenRequest staffSaveOpenRequest) {
        try {
            String id = openService.saveStaff(staffSaveOpenRequest);
            return RopResponse.success(id);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__saveStaff__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 同步企微员工
     *
     * @param staffSaveOpenRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.open.syncEntmicroStaff", needInSession = NeedInSessionType.NO)
    @ApiOperation("同步企微员工")
    public RopResponse<List<StaffResponse>> syncEntmicroStaff(SyncStaffOpenRequest staffSaveOpenRequest) {
        try {
            List<StaffResponse> merchantRopResponses = openService.syncEntmicroStaff(staffSaveOpenRequest);
            return RopResponse.success(merchantRopResponses);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__syncEntmicroStaff__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 查询最近的n家门店
     *
     * @param openProximityMerchantRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.open.proximityMerchantList", needInSession = NeedInSessionType.NO)
    @ApiOperation("查询最近的n家门店")
    public RopResponse<List<MerchantRopResponse>> proximityMerchantList(OpenProximityMerchantRequest openProximityMerchantRequest) {
        try {
            List<MerchantRopResponse> proximityMerchantList = openService.proximityMerchantList(openProximityMerchantRequest);
            return RopResponse.success(proximityMerchantList);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__proximityMerchantList__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 根据账户类型,层级查询商户列表
     *
     * @param merchantListOpenRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.open.findMerchantListByPage", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据账户类型,层级查询商户列表")
    public RopResponse<Pagination<MerchantRopResponse>> findMerchantListByPage(MerchantListOpenRequest merchantListOpenRequest) {
        try {
            Pagination<MerchantRopResponse> subordinateListByPage = openService.findMerchantListByPage(merchantListOpenRequest);
            return RopResponse.success(subordinateListByPage);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findMerchantListByPage__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 根据登录号查询员工详情
     *
     * @param staffSearchOpenRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.open.findStaffByAccount", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据登录号查询员工详情")
    public RopResponse<StaffResponse> findStaffByAccount(StaffSearchOpenRequest staffSearchOpenRequest) {
        try {
            StaffResponse staffResponse = openService.findStaffByAccount(staffSearchOpenRequest);
            return RopResponse.success(staffResponse);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke_findStaffByAccount__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 商户树查询
     *
     * @param merchantTreeOpenRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.open.findMerchantTreeByMerchantNo", needInSession = NeedInSessionType.NO)
    @ApiOperation("商户树查询")
    public RopResponse<List<MerchantTreeOpenResponse>> findMerchantTreeByMerchantNo(MerchantTreeOpenRequest merchantTreeOpenRequest) {
        try {
            List<MerchantTreeOpenResponse> merchantTreeByMerchantNo = openService.findMerchantTreeByMerchantNo(merchantTreeOpenRequest);
            return RopResponse.success(merchantTreeByMerchantNo);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findMerchantTreeByMerchantNo__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.checkPhone", needInSession = NeedInSessionType.NO)
    @ApiOperation("手机号校验")
    public RopResponse<List<OpenUserResponse>> checkPhone(OpenCheckPhoneRequest openCheckPhoneRequest) {
        try {
            List<OpenUserResponse> openUserResponse = openService.checkPhone(openCheckPhoneRequest);
            return RopResponse.success(openUserResponse);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__checkPhone__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.findBySapCode", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据sapCode查询商户")
    public RopResponse<MerchantRopResponse> findBySapCode(OpenSapSearchRequest openSapSearchRequest) {
        try {
            MerchantRopResponse openUserResponse = openService.findBySapCode(openSapSearchRequest);
            return RopResponse.success(openUserResponse);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findBySapCode__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.userLogin", needInSession = NeedInSessionType.NO)
    @ApiOperation("用户登录")
    public RopResponse<Boolean> userLogin(UserLoginRequest userLoginRequest) {
        try {
            openService.userLogin(userLoginRequest);
            return RopResponse.success(true);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__userLogin__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.updateMd5Password", needInSession = NeedInSessionType.NO)
    @ApiOperation("md5")
    public RopResponse<Boolean> updateMd5Password(AbstractRopRequest abstractRopRequest) {
        try {
            openService.updateMd5Password();
            return RopResponse.success(true);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__userLogin__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.findUserById", needInSession = NeedInSessionType.NO)
    @ApiOperation("查询账户")
    public RopResponse<List<OpenUserResponse>> findUserById(UserRequest userRequest) {
        try {
            return RopResponse.success(openService.findUserById(userRequest));
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__userLogin__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.checkUniquenessAccount", needInSession = NeedInSessionType.NO)
    @ApiOperation("用户登录名校验")
    public RopResponse<OpenUserResponse> checkUniquenessAccount(OpenLoginAccountRequest openLoginAccountRequest) {
        try {
            return RopResponse.success(openService.checkUniquenessAccount(openLoginAccountRequest));
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__userLogin__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.checkUniquenessPhone", needInSession = NeedInSessionType.NO)
    @ApiOperation("用户登录手机号校验")
    public RopResponse<OpenUserResponse> checkUniquenessPhone(OpenLoginAccountRequest openLoginAccountRequest) {
        try {
            return RopResponse.success(openService.checkUniquenessPhone(openLoginAccountRequest));
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__userLogin__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.updatePassword", needInSession = NeedInSessionType.NO)
    @ApiOperation("密码修改")
    public RopResponse<Boolean> updatePassword(UpdatePasswordOpenRequest updatePasswordOpenRequest) {
        try {
            return RopResponse.success(openService.updatePassword(updatePasswordOpenRequest));
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__userLogin__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.getAccountInfoByUuid", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据uuid获取账户信息")
    public RopResponse<OpenUserResponse> getAccountInfoByUuid(AccountInfoOpenRequest accountInfoOpenRequest) {
        try {
            OpenUserResponse openUserResponse = openService.getAccountInfoByUuid(accountInfoOpenRequest.getUuid());
            return RopResponse.success(openUserResponse);
        } catch (RpcServiceException e) {
            log.info("根据uuid获取账户信息异常:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.findStaffListByMerchantNo", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据商户号查询员工列表")
    public RopResponse<List<StaffResponse>> findStaffListByMerchantNo(StaffListOpenRequest staffListOpenRequest) {
        try {
            List<StaffResponse> list = openService.findStaffListByMerchantNo(staffListOpenRequest);
            return RopResponse.success(list);
        } catch (RpcServiceException e) {
            log.info("根据商户号查询员工列表异常:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.findLoginInfoByMerchantNo", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据商户号获取登录信息")
    public RopResponse<OpenUserResponse> findLoginInfoByMerchantNo(StaffListOpenRequest staffListOpenRequest) {
        try {
            OpenUserResponse openUserResponse = openService.findLoginInfoByMerchantNo(staffListOpenRequest);
            return RopResponse.success(openUserResponse);
        } catch (RpcServiceException e) {
            log.info("根据商户号查询员工列表异常:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.confirmPermissions")
    @ApiOperation("根据uuid,menuId查询是否存在该权限")
    public RopResponse<Boolean> confirmPermissionsByUuidAndMenuId(ConfirmPermissionsRequest confirmPermissionsRequest) {
        log.info("根据uuid,menuId查询是否存在该权限入参:{}", confirmPermissionsRequest);
        try {
            Boolean bl = openService.confirmPermissionsByUuidAndMenuId(confirmPermissionsRequest);
            return RopResponse.success(bl);
        } catch (RpcServiceException e) {
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }


    @ServiceMethod(method = "merchants.api.open.updateMerchantByMerchantNo")
    @ApiOperation("根据商户号修改商户信息(企微名称)")
    public RopResponse<Boolean> updateMerchantByMerchantNo(@Validated UpdateMerchantByMerchantNoRequest updateMerchantByMerchantNoReq) {
        try {
            Boolean bl = openService.updateMerchantByMerchantNo(updateMerchantByMerchantNoReq);
            return RopResponse.success(bl);
        } catch (RpcServiceException e) {
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.findSubMerchantbySupMerchantNo", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据商户号查询商户下一级列表")
    public RopResponse<List<MerchantSubListResponse>> findSubMerchantbySupMerchantNo(OpenMerchantDetailRequest openMerchantDetailRequest) {
        try {
            List<MerchantSubListResponse> responses = openService.findSubMerchantbySupMerchantNo(openMerchantDetailRequest);
            return RopResponse.success(responses);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findSubMerchantbySupMerchantNo__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.findJoinEntMicroStaffByMerchantNo", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据商户号查询已加入企微员工")
    public RopResponse<List<MerchantStaffResponse>> findJoinEntMicroStaffByMerchantNo(OpenFindEntMicroStaffByMerchantNoRequest request) {
        try {
            List<MerchantStaffResponse> responses = openService.findJoinEntMicroStaffByMerchantNo(request);
            return RopResponse.success(responses);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findJoinEntMicroStaffByMerchantNo__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.findMerchantNoList", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据条件查询商户号集合")
    public RopResponse<List<Integer>> findMerchantNoList(MerchantNosRopRequest request) {
        try {
            List<Integer> responses = openService.findMerchantNoList(request);
            return RopResponse.success(responses);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findMerchantNoList__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.findMerchantNoListByMerAccTypeId", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据商户层级查询商户号集合")
    public RopResponse<List<MerchantListByConditionRopResponse>> findMerchantNoListByMerAccTypeId(MerchantListByConditionRopRequest request) {
        try {
            List<MerchantListByConditionRopResponse> responses = openService.findMerchantNoListByMerAccTypeId(request);
            return RopResponse.success(responses);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findMerchantNoListByMerAccTypeId__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.findMerchantBySupMerchantNo", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据上级查询商户号集合")
    public RopResponse<List<MerchantNoNameRopResponse>> findMerchantBySupMerchantNo(FindBySupMerchantNoRopRequest ropRequest) {
        try {
            List<MerchantNoNameRopResponse> responses = openService.findMerchantBySupMerchantNo(ropRequest);
            return RopResponse.success(responses);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findMerchantBySupMerchantNo__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.merchantNoListByStaffPhone", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据手机查询商户号")
    public RopResponse<List<Integer>> merchantNoListByStaffPhone(MerchantNoListByStaffPhone ropRequest) {
        try {
            List<Integer> responses = openService.merchantNoListByStaffPhone(ropRequest.getStaffPhone());
            return RopResponse.success(responses);
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findMerchantBySupMerchantNo__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.findTopMerchantInfo", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据商户号集合查询所属工厂")
    public RopResponse<List<MerchantAndTopMerchantRopResponse>> findTopMerchantInfo(TopMerchantRopRequest ropRequest) {
        try {
            return RopResponse.success(openService.findTopMerchantInfo(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__findTopMerchantInfo__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.serviceCenter.createMerchant", needInSession = NeedInSessionType.NO)
    @ApiOperation("服务中心-创建商户")
    public RopResponse<MerchantNoNameRopResponse> createMerchant(CreateMerchantRopRequest ropRequest) {
        try {
            return RopResponse.success(openService.createMerchant(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__serviceCenterCreateMerchant__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.serviceCenter.updateMerchant", needInSession = NeedInSessionType.NO)
    @ApiOperation("服务中心-更新商户")
    public RopResponse<Boolean> updateMerchant(UpdateMerchantRopRequest ropRequest) {
        try {
            return RopResponse.success(openService.updateMerchant(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__serviceCenterupdateMerchant__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.serviceCenter.searchMerchantAndStaff", needInSession = NeedInSessionType.NO)
    @ApiOperation("服务中心-查询商户(及员工)")
    public RopResponse<List<SearchServiceMerchantRopResponse>> searchMerchantAndStaff(SearchServiceMerchantRopRequest ropRequest) {
        try {
            return RopResponse.success(openService.searchMerchantAndStaff(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__searchMerchantAndStaff__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.serviceCenter.searchMerchant", needInSession = NeedInSessionType.NO)
    @ApiOperation("服务中心-查询(客户)商户")
    public RopResponse<List<SearchServiceMerchantRopResponse>> searchMerchant(SearchServiceMerchantRopRequest ropRequest) {
        try {
            return RopResponse.success(openService.searchMerchant(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__searchMerchant__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.serviceCenter.createStaff", needInSession = NeedInSessionType.NO)
    @ApiOperation("服务中心-创建员工")
    public RopResponse<Boolean> createStaff(CreateMerchantStaffRopRequest ropRequest) {
        try {
            return RopResponse.success(openService.createStaff(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__serviceCenterCreateStaff__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.serviceCenter.updateStaff", needInSession = NeedInSessionType.NO)
    @ApiOperation("服务中心-更新员工")
    public RopResponse<Boolean> updateStaff(UpdateStaffRopRequest ropRequest) {
        try {
            return RopResponse.success(openService.updateStaff(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__serviceCenterupdateStaff__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }


    @ServiceMethod(method = "merchants.api.open.serviceCenter.searchStaffPage", needInSession = NeedInSessionType.NO)
    @ApiOperation("服务中心-查询员工分页")
    public RopResponse<Pagination<ServiceStaffRopResponse>> searchStaffPage(SearchStaffPageRopRequest ropRequest) {
        try {
            return RopResponse.success(openService.searchStaffPage(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__serviceCenterSearchStaffPage__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.serviceCenter.visibleMerByStaff", needInSession = NeedInSessionType.NO)
    @ApiOperation("服务中心-查询员工可见商户信息")
    public RopResponse<List<VisibleMerchantRopResponse>> visibleMerByStaff(StaffVisibleMerRopRequest ropRequest) {
        try {
            return RopResponse.success(openService.visibleMerByStaff(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======OpenController__invoke__serviceCentervisibleMerByStaff__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }


    /**
     * 查询员工列表
     *
     * @param staffListRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.open.findMerchantStaffList", needInSession = NeedInSessionType.NO)
    @ApiOperation("查询员工列表")
    public RopResponse<List<StaffResponse>> findMerchantStaffList(StaffListRequest staffListRequest) {
        try {
            List<StaffResponse> staffResponse = staffService.findMerchantStaffList(staffListRequest);
            return RopResponse.success(staffResponse);
        } catch (RpcServiceException e) {
            log.info("=======StaffController__invoke__findMerchantStaffList__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.open.findStaffListByUuidList", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据uuid查询员工列表")
    public RopResponse<List<StaffResponse>> findStaffListByUuidList(StaffListUuidOpenRequest request) {
        try {
            List<StaffResponse> list = openService.findStaffListByUuidList(request);
            return RopResponse.success(list);
        } catch (RpcServiceException e) {
            log.info("根据uuid查询员工列表异常:{}", e.getMessage(),e);
            return RopResponse.error(e.getErrId(), e.getMessage());
        }catch (Exception e) {
            log.info("根据uuid查询员工列表异常:{}", e);
            return RopResponse.error(DefaultErrorEnum.UNKNOW_ERROR,e.getMessage());
        }
    }
}