MerchantController.java 23.7 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
package cn.com.glsx.merchants.controller;

import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import cn.com.glsx.merchants.model.response.MerchantSearchEntMicroResponse;
import cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest;
import cn.com.glsx.merchants.request.menu.BuildMenuParam;
import cn.com.glsx.merchants.request.merchant.*;
import cn.com.glsx.merchants.request.role.RoleSearchRequest;
import cn.com.glsx.merchants.response.*;
import cn.com.glsx.merchants.service.MerchantService;
import cn.com.glsx.merchants.util.Pagination;
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.apache.commons.lang.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * @author zhouhaibao
 * @version 1.0
 * @description: 商户接口
 * @date 2021/7/21 16:52
 */
@Slf4j
@Api("商户接口")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
public class MerchantController {

    @Autowired
    private MerchantService merchantService;

    /**
     * 保存商户基础信息
     *
     * @param merchantSaveRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.merchant.saveMerchant", needInSession = NeedInSessionType.NO)
    @ApiOperation("保存商户基础信息")
    public RopResponse<Integer> saveMerchant(MerchantSaveRequest merchantSaveRequest) {
        try {
            Integer merchant = merchantService.saveMerchant(merchantSaveRequest);
            return RopResponse.success(merchant);
        } catch (RpcServiceException e) {
            log.info("=======MerchantController__invoke__saveMerchant__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.merchant.saveMerchantAuto", needInSession = NeedInSessionType.NO)
    @ApiOperation("保存商户基础信息脚本测试")
    public RopResponse<Integer> saveMerchantAuto(BuildMenuParam merchantSaveRequest) {

        /**
         * timestamp: 1648198769743
         * appKey: 48e5e13229b82c1b4e6e8c96151f0637
         * v: 1.0.0
         * source: glsx
         * format: json
         * isloginName: 0
         * bussinessBegintime:
         * bussinessEndtime:
         * merchantName: 性能测试1
         * merchantAbbreviation:
         * merchantType:
         * merchantOrgcode:
         * merchantLegalPerson:
         * merchantLegalPersonPhone: 12245457878
         * residentContact:
         * residentPhone:
         * merchantLoginAccount: pp211
         * merchantLoginPassword: a123456
         * merchantAccountLevel: 1
         * effectiveTime:
         * merchantModel: 2
         * channelId: 1
         * businessType: 1,2,3,4,5,6
         * accounttypeId: 2
         * merchantBrandListJson: []
         * method: merchants.api.merchant.saveMerchant
         * status: 1
         * sign: 2198C1C6567D159D46B177F167AF9426DCF1CE0
         */
        String param = merchantSaveRequest.getUrl();
        //父商户
        MerchantSaveRequest parent = new MerchantSaveRequest();
        parent.setMerchantName(merchantSaveRequest.getUrl() + "p");
        String tel = getTel();
        parent.setIsloginName((byte)0);
        parent.setMerchantLegalPersonPhone(tel);
        parent.setMerchantLoginAccount(tel);
        parent.setMerchantLoginPassword("a" + tel);
        parent.setMerchantAccountLevel(1);
        parent.setMerchantModel(2);
        parent.setChannelId(1);
        parent.setBusinessType("1,2,3,4,5,6");
        parent.setAccounttypeId(Arrays.asList(2));
        parent.setStatus((byte)1);
        Integer parentId = merchantService.saveMerchant(parent);
        //查询商户详情
        MerchantDetailRequest merchantDetailRequest = new MerchantDetailRequest();
        merchantDetailRequest.setId(parentId);
        MerchantRopResponse merchantDetail = merchantService.findMerchantDetail(merchantDetailRequest);

        /**
         * 修改权限
         * timestamp: 1648198807437
         * appKey: 48e5e13229b82c1b4e6e8c96151f0637
         * v: 1.0.0
         * source: glsx
         * format: json
         * merchantId: 42722
         * accountTypes: [{"accountTypeId":"2","products":[{"productId":81,"functionIds":[],"menuIds":[]}]}]
         * method: merchants.api.merchant.updatePermissions
         * status: 2
         * sign: BB37CFB3B39B18560BBE199B68813D35EA2FCB61
         */

        MerchantTreeRopRequest merchantParent = new MerchantTreeRopRequest();
        //merchantParent
        merchantParent.setMerchantId(parentId);
        merchantParent.setAccountTypes("[{\"accountTypeId\":\"2\",\"products\":[{\"productId\":81,\"functionIds\":[],\"menuIds\":[]}]}]");
        merchantParent.setStatus(2);
        merchantService.updatePermissions(merchantParent);

        /**
         * timestamp: 1648199002154
         * appKey: 48e5e13229b82c1b4e6e8c96151f0637
         * v: 1.0.0
         * source: glsx
         * format: json
         * isloginName: 0
         * bussinessBegintime:
         * bussinessEndtime:
         * merchantName: qqqqa
         * merchantAbbreviation:
         * merchantType:
         * merchantOrgcode:
         * merchantLegalPerson:
         * merchantLegalPersonPhone: 12256569847
         * residentContact:
         * residentPhone:
         * merchantLoginAccount: tyu
         * merchantLoginPassword: a123456
         * merchantAccountLevel: 4
         * effectiveStarttime: Fri Mar 25 2022 08:00:00 GMT+0800 (中国标准时间)
         * expireDate: Sat Mar 26 2022 08:00:00 GMT+0800 (中国标准时间)
         * channelId: 1
         * businessType: 1,2,3,4,5,6
         * accounttypeId: 2
         * merchantBrandListJson: []
         * parentId: 42722
         * merchantModel: 2
         * method: merchants.api.merchant.saveMerchant
         * status: 1
         * sign: DFEB4B114F74673616599BA981F9B928C806A287
         */


        //子商户
        List<MerchantSaveRequest> list = new ArrayList<>();
        for (int i = 0; i < 50; i++) {
            MerchantSaveRequest saveRequest = new MerchantSaveRequest();
            saveRequest.setIsloginName((byte)0);
            saveRequest.setMerchantName(param + i);
            saveRequest.setMerchantLegalPersonPhone(getTel());
            saveRequest.setMerchantLoginAccount(param+i);
            saveRequest.setMerchantLoginPassword("a123456");
            saveRequest.setMerchantAccountLevel(4);
            saveRequest.setEffectiveStarttime(new Date());
            saveRequest.setExpireDate(DateUtils.addHours(new Date(), 30));
            saveRequest.setChannelId(1);
            saveRequest.setBusinessType("1,2,3,4,5,6");
            saveRequest.setAccounttypeId(Arrays.asList(2));
            saveRequest.setParentId(parentId);
            saveRequest.setMerchantModel(2);
            saveRequest.setStatus((byte)1);
            Integer subMerchantId = merchantService.saveMerchant(saveRequest);
            MerchantTreeRopRequest merchantTreeRequest = new MerchantTreeRopRequest();
            /**
             * timestamp: 1648199086038
             * appKey: 48e5e13229b82c1b4e6e8c96151f0637
             * v: 1.0.0
             * source: glsx
             * format: json
             * merchantId: 42724
             * accountTypes: [{"accountTypeId":"2","products":[{"productId":81,"functionIdList":[],"menuIdList":[]}]}]
             * method: merchants.api.merchant.updatePermissions
             * status: 2
             * sign: CAF709032C69AF6F76993640100D7871A6945EB3
             */
            merchantTreeRequest.setMerchantId(subMerchantId);
            merchantTreeRequest.setAccountTypes("[{\"accountTypeId\":\"2\",\"products\":[{\"productId\":81,\"functionIdList\":[],\"menuIdList\":[]}]}]");
            merchantTreeRequest.setStatus(2);
            merchantService.updatePermissions(merchantTreeRequest);
        }
        return null;

    }

    public static void main(String[] args) {
        Date date = DateUtils.addDays(new Date(), 30);
        System.out.println(date);
    }

    private static String[] telFirst="134,135,136,137,138,139,150,151,152,157,158,159,130,131,132,155,156,133,153".split(",");
    private static String getTel() {
        int index=getNum(0,telFirst.length-1);
        String first=telFirst[index];
        String second=String.valueOf(getNum(1,888)+10000).substring(1);
        String third=String.valueOf(getNum(1,9100)+10000).substring(1);
        return first+second+third;
    }

    public static int getNum(int start,int end) {
        return (int)(Math.random()*(end-start+1)+start);
    }


    /**
     * 更新商户基础信息
     *
     * @param merchantUpdateRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.merchant.updateMerchant", needInSession = NeedInSessionType.NO)
    @ApiOperation("更新商户基础信息")
    public RopResponse<Boolean> updateMerchant(MerchantUpdateRequest merchantUpdateRequest) {
        try {
            merchantService.updateMerchant(merchantUpdateRequest);
            return RopResponse.success(true);
        } catch (RpcServiceException e) {
            log.info("=======MerchantController__invoke__updateMerchant__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 保存商户权限信息
     *
     * @param merchantTreeRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.merchant.savePermissions", needInSession = NeedInSessionType.NO)
    @ApiOperation("保存商户权限信息")
    @PostMapping
    public RopResponse<Boolean> savePermissions(@RequestBody MerchantTreeRopRequest merchantTreeRequest) {
        try {
            merchantService.savePermissions(merchantTreeRequest);
            return RopResponse.success(true);
        } catch (RpcServiceException e) {
            log.info("=======MerchantController__invoke__savePermissions__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 查询商户详情
     *
     * @param merchantDetailRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.merchant.findMerchantDetail", needInSession = NeedInSessionType.NO)
    @ApiOperation("查询商户详情")
    public RopResponse<MerchantRopResponse> findMerchantDetail(MerchantDetailRequest merchantDetailRequest) {
        try {
            MerchantRopResponse merchantResponse = merchantService.findMerchantDetail(merchantDetailRequest);
            return RopResponse.success(merchantResponse);
        } catch (RpcServiceException e) {
            log.info("=======MerchantController__invoke__updatePermissions__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 更新商户权限信息
     *
     * @param merchantTreeRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.merchant.updatePermissions", needInSession = NeedInSessionType.NO)
    @ApiOperation("更新商户权限信息")
    public RopResponse<Boolean> updatePermissions(@RequestBody MerchantTreeRopRequest merchantTreeRequest) {
        try {
            merchantService.updatePermissions(merchantTreeRequest);
            return RopResponse.success(true);
        } catch (RpcServiceException e) {
            log.info("=======MerchantController__invoke__updatePermissions__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 查询商户树
     *
     * @param merchantDetailRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.merchant.findMerchantTree", needInSession = NeedInSessionType.NO)
    @ApiOperation("查询商户树")
    public RopResponse<List<MerchantTreeRopResponse>> findMerchantTree(MerchantDetailRequest merchantDetailRequest) {
        try {
            List<MerchantTreeRopResponse> merchantResponse = merchantService.findMerchantTree(merchantDetailRequest);
            return RopResponse.success(merchantResponse);
        } catch (RpcServiceException e) {
            log.info("=======MerchantController__invoke__findMerchantTree__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 查询商户的菜单权限
     *
     * @param merchantDetailRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.merchant.findPermissionsByMerId", needInSession = NeedInSessionType.NO)
    @ApiOperation("查询商户的菜单权限")
    public RopResponse<List<AccountTypeTreeRopResponse>> findPermissionsByMerId(MerchantDetailRequest merchantDetailRequest) {
        try {
            List<AccountTypeTreeRopResponse> merchantResponse = merchantService.findPermissionsByMerId(merchantDetailRequest);
            return RopResponse.success(merchantResponse);
        } catch (RpcServiceException e) {
            log.info("=======MerchantController__invoke__findMerchantTree__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 获取账户类型下产品菜单功能树
     *
     * @param accountTypeSearchRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.merchant.accountTypeSearchRequest", needInSession = NeedInSessionType.NO)
    @ApiOperation("获取账户类型下产品菜单功能树")
    public RopResponse<List<AccountTypeTreeRopResponse>> accountTypeSearchRequest(AccountTypeSearchRequest accountTypeSearchRequest) {
        try {
            List<AccountTypeTreeRopResponse> merchantResponse = merchantService.findMenuFunTreeByAccountType(accountTypeSearchRequest);
            return RopResponse.success(merchantResponse);
        } catch (RpcServiceException e) {
            log.info("=======MerchantController__invoke__accountTypeSearchRequest__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 获取角色产品菜单功能树
     *
     * @param roleSearchRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.merchant.findMenuFunTreeByRoleId", needInSession = NeedInSessionType.NO)
    @ApiOperation("获取角色产品菜单功能树")
    public RopResponse<List<AccountTypeTreeRopResponse>> findMenuFunTreeByRoleId(RoleSearchRequest roleSearchRequest) {
        try {
            List<AccountTypeTreeRopResponse> merchantResponse = merchantService.findMenuFunTreeByRoleId(roleSearchRequest);
            return RopResponse.success(merchantResponse);
        } catch (RpcServiceException e) {
            log.info("=======MerchantController__invoke__findMenuFunTreeByRoleId__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 查询商户的菜单权限树
     *
     * @param merchantDetailRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.merchant.findMenuFunTreeByMerId", needInSession = NeedInSessionType.NO)
    @ApiOperation("查询商户的菜单权限树")
    public RopResponse<List<AccountTypeTreeRopResponse>> findMenuFunTreeByMerId(MerchantDetailRequest merchantDetailRequest) {
        try {
            List<AccountTypeTreeRopResponse> merchantResponse = merchantService.findMenuFunTreeByMerId(merchantDetailRequest);
            return RopResponse.success(merchantResponse);
        } catch (RpcServiceException e) {
            log.info("=======MerchantController__invoke__findMenuFunTreeByMerId__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 更新商户的有效期
     *
     * @param merchantUpdateValRequest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.merchant.updateValPerByMerId", needInSession = NeedInSessionType.NO)
    @ApiOperation("更新商户的有效期")
    public RopResponse<Boolean> updateValPerByMerId(MerchantUpdateValRequest merchantUpdateValRequest) {
        try {
            merchantService.updateValPerByMerId(merchantUpdateValRequest);
            return RopResponse.success(true);
        } catch (RpcServiceException e) {
            log.info("=======MerchantController__invoke__updateValPerByMerId__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 查询商户列表
     *
     * @param merchantSearchResquest 入参
     * @return
     */
    @ServiceMethod(method = "merchants.api.menu.findMerchantByPage", needInSession = NeedInSessionType.NO)
    @ApiOperation("查询商户列表")
    public RopResponse<Pagination<MerchantRopResponse>> findMerchantByPage(MerchantSearchResquest merchantSearchResquest) {
        try {
            Pagination<MerchantRopResponse> list = merchantService.findMerchantByPage(merchantSearchResquest);
            return RopResponse.success(list);
        } catch (RpcServiceException e) {
            log.info("=======MerchantMenuController__invoke__merchantSearchResquest__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 查询所有商户
     *
     * @return
     */
    @ServiceMethod(method = "merchants.api.menu.findAllMerchant", needInSession = NeedInSessionType.NO)
    @ApiOperation("查询所有商户")
    public RopResponse<List<MerchantRopListRes>> findAllMerchant(MerchantFindRequest merchantFindRequest) {
        try {
            List<MerchantRopListRes> list = merchantService.findAllMerchant(merchantFindRequest);
            return RopResponse.success(list);
        } catch (RpcServiceException e) {
            log.info("=======MerchantMenuController__invoke__findAllMerchant__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 查询上下级商户详情
     *
     * @return
     */
    @ServiceMethod(method = "merchants.api.menu.findSubordinateRelationship", needInSession = NeedInSessionType.NO)
    @ApiOperation("查询上下级商户详情")
    public RopResponse<MerchantRopResponse> findSubordinateRelationship(MerchantDetailRequest merchantDetailRequest) {
        try {
            MerchantRopResponse merchantRopResponse = merchantService.findSubordinateRelationship(merchantDetailRequest);
            return RopResponse.success(merchantRopResponse);
        } catch (RpcServiceException e) {
            log.info("=======MerchantMenuController__invoke__findSubordinateRelationship__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }


    /**
     * 查询商户基本信息
     *
     * @return
     */
    @ServiceMethod(method = "merchants.api.merchant.findMerchantBaseInfo", needInSession = NeedInSessionType.NO)
    @ApiOperation("查询商户基本信息")
    public RopResponse<MerchantBaseInfoRopResponse> findMerchantBaseInfo(MerchantBaseInfoRequest merchantBaseInfoRequest) {
        try {
            MerchantBaseInfoRopResponse merchantRopResponse = merchantService.findMerchantBaseInfo(merchantBaseInfoRequest);
            return RopResponse.success(merchantRopResponse);
        } catch (RpcServiceException e) {
            log.info("=======MerchantController__invoke__findMerchantBaseInfo__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.merchant.updateMerchantDepth", needInSession = NeedInSessionType.NO)
    @ApiOperation("根据商户号修改商户层级关系(闭包)")
    public RopResponse<Boolean> updateMerchantPath(MerchantUpdatePathRequest merchantUpdatePathRequest){
        try {
            merchantService.updateMerchantPath(merchantUpdatePathRequest);
            return RopResponse.success(Boolean.TRUE);
        }catch (RpcServiceException e){
            log.info("MerchantController_updateMerchantPath_exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "merchants.api.merchant.updateAccessMode", needInSession = NeedInSessionType.NO)
    @ApiOperation("修改商户接入模式")
    public RopResponse<Boolean> accessMode(MerchantAccessMode merchantAccessMode){
        try {
            merchantService.updateAccessMode(merchantAccessMode);
            return RopResponse.success(Boolean.TRUE);
        }catch (RpcServiceException e){
            log.info("MerchantController_updateMerchantPath_exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }

    }

    /**
     * 查询商户信息(滴加企微管家)
     *
     * @return
     */
    @ServiceMethod(method = "merchants.api.merchant.findMerchantInfoToDj", needInSession = NeedInSessionType.NO)
    @ApiOperation("滴加企微管家查询商户基本信息")
    public RopResponse<MerchantInfoDjRopResponse> findMerchantInfoToDj(MerchantBaseInfoRequest merchantBaseInfoRequest) {
        try {
            MerchantInfoDjRopResponse merchantInfoDjRopResponse = merchantService.findMerchantInfoToDj(merchantBaseInfoRequest);
            return RopResponse.success(merchantInfoDjRopResponse);
        } catch (RpcServiceException e) {
            log.info("findMerchantInfoToDj_exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 查询企微关联-商户列表
     *
     * @return
     */
    @ServiceMethod(method = "merchants.api.merchant.findEntMicroMerchantsByPage", needInSession = NeedInSessionType.NO)
    @ApiOperation("查询企微关联-商户列表")
    public RopResponse<Pagination<MerchantSearchEntMicroResponse>> findEntMicroMerchantsByPage(MerchantSearchEntMicroRequest merchantSearchEntMicroRequest) {
        try {
            Pagination<MerchantSearchEntMicroResponse> response = merchantService.findEntMicroMerchantsByPage(merchantSearchEntMicroRequest);
            return RopResponse.success(response);
        } catch (RpcServiceException e) {
            log.info("findEntMicroMerchantsByPage_exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 查询企微关联-商户列表
     *
     * @return
     */
    @ServiceMethod(method = "merchants.api.merchant.checkMerchantNameRepeat", needInSession = NeedInSessionType.NO)
    @ApiOperation("检查商户名是否存在")
    public RopResponse<Boolean> checkMerchantNameRepeat(MerchantNameRopRequest request) {
        try {
            return RopResponse.success(merchantService.checkMerchantNameRepeat(request));
        } catch (RpcServiceException e) {
            log.info("checkMerchantNameRepeat_exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

}