Commit 17786971 by yelq

Merge from rop-merchant scrm_v3.7.0_20230330

1 parent 341fa6c3
Showing 23 changed files with 508 additions and 3 deletions
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<dependency> <dependency>
<groupId>cn.com.glsx.merchants</groupId> <groupId>cn.com.glsx.merchants</groupId>
<artifactId>platform-merchants-api</artifactId> <artifactId>platform-merchants-api</artifactId>
<version>3.7.1-SNAPSHOT</version> <version>3.7.0-SNAPSHOT</version>
</dependency> </dependency>
<!--引用GSON,用于打印--> <!--引用GSON,用于打印-->
<dependency> <dependency>
......
...@@ -538,4 +538,20 @@ public class MerchantController { ...@@ -538,4 +538,20 @@ public class MerchantController {
} }
} }
/**
* 查询企微关联-商户列表
*
* @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());
}
}
} }
...@@ -7,9 +7,13 @@ import cn.com.glsx.merchants.model.response.MerchantSubListResponse; ...@@ -7,9 +7,13 @@ import cn.com.glsx.merchants.model.response.MerchantSubListResponse;
import cn.com.glsx.merchants.request.accounttype.MerchantListByConditionRopRequest; import cn.com.glsx.merchants.request.accounttype.MerchantListByConditionRopRequest;
import cn.com.glsx.merchants.request.merchant.*; import cn.com.glsx.merchants.request.merchant.*;
import cn.com.glsx.merchants.request.open.*; 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.MerchantNoListByStaffPhone;
import cn.com.glsx.merchants.request.staff.StaffListRequest; import cn.com.glsx.merchants.request.staff.StaffListRequest;
import cn.com.glsx.merchants.response.*; 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.OpenService;
import cn.com.glsx.merchants.service.StaffService; import cn.com.glsx.merchants.service.StaffService;
import cn.com.glsx.merchants.util.Pagination; import cn.com.glsx.merchants.util.Pagination;
...@@ -520,6 +524,96 @@ public class OpenController { ...@@ -520,6 +524,96 @@ public class OpenController {
} }
} }
@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());
}
}
/** /**
* 查询员工列表 * 查询员工列表
* *
......
package cn.com.glsx.merchants.request.merchant;
import cn.com.glsx.merchants.request.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class MerchantNameRopRequest extends DefaultRequest {
@ApiModelProperty(notes = "商户名",required = true)
private String merchantName;
}
...@@ -211,4 +211,7 @@ public class MerchantSaveRequest extends DefaultRequest implements Serializable ...@@ -211,4 +211,7 @@ public class MerchantSaveRequest extends DefaultRequest implements Serializable
@ApiModelProperty(notes = "市名称") @ApiModelProperty(notes = "市名称")
private String cityName; private String cityName;
@ApiModelProperty(notes = "创建来源 1:账户中心 2:SCRM 3:生意助手 4:门店助手")
private Integer createdSource;
} }
\ No newline at end of file \ No newline at end of file
...@@ -74,6 +74,9 @@ public class MerchantSearchResquest extends DefaultRequest { ...@@ -74,6 +74,9 @@ public class MerchantSearchResquest extends DefaultRequest {
@ApiModelProperty(notes = "商户号") @ApiModelProperty(notes = "商户号")
private Integer merchantNo; private Integer merchantNo;
@ApiModelProperty(notes = "创建来源 1:账户中心 2:SCRM 3:生意助手 4:门店助手")
private Integer createdSource;
/** /**
* 父商户号 * 父商户号
*/ */
......
...@@ -14,4 +14,6 @@ public class StaffListOpenRequest extends AbstractRopRequest { ...@@ -14,4 +14,6 @@ public class StaffListOpenRequest extends AbstractRopRequest {
@ApiModelProperty(value = "产品code") @ApiModelProperty(value = "产品code")
private String productCode; private String productCode;
} }
package cn.com.glsx.merchants.request.serviceCenter;
import cn.com.glsx.merchants.request.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class CreateMerchantRopRequest extends DefaultRequest {
@ApiModelProperty(notes = "商户名",required = true)
private String merchantName;
@ApiModelProperty(notes = "登录密码",required = true)
private String password;
@ApiModelProperty(notes = "联系人")
private String merchantLegalPerson;
@ApiModelProperty(notes = "联系电话",required = true)
private String merchantLegalPersonPhone;
/**
* 创建类型
*/
@ApiModelProperty(notes = "创建类型:1:服务中心 2:客户",required = true)
private Integer createType;
@ApiModelProperty(notes = "创建来源 1:账户中心 2:SCRM 3:生意助手 4:门店助手",required = true)
private Integer createdSource;
@ApiModelProperty(notes = "创建人(服务商商户名)")
private String createdAccount;
}
package cn.com.glsx.merchants.request.serviceCenter;
import cn.com.glsx.merchants.request.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class CreateMerchantStaffRopRequest extends DefaultRequest {
@ApiModelProperty(value = "所属服务中心商户号",required = true)
private Integer merchantNo;
@ApiModelProperty(notes = "员工姓名",required = true)
private String staffName;
@ApiModelProperty(notes = "员工电话",required = true)
private String staffPhone;
@ApiModelProperty(notes = "创建来源 1:账户中心 2:SCRM 3:生意助手 4:门店助手",required = true)
private Integer createdSource;
@ApiModelProperty(notes = "可见范围:0:部分可见 1:全部客户")
private Integer visualType;
@ApiModelProperty(notes = "创建人")
private String createdAccount;
@ApiModelProperty(notes = "可见下级商户")
private List<Integer> visibleMerchantNoList;
}
package cn.com.glsx.merchants.request.serviceCenter;
import cn.com.glsx.merchants.request.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class SearchServiceMerchantRopRequest extends DefaultRequest {
@ApiModelProperty(notes = "商户号集合",required = true)
private List<Integer> merchantNoList;
}
package cn.com.glsx.merchants.request.serviceCenter;
import cn.com.glsx.merchants.request.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
public class SearchStaffPageRopRequest extends DefaultRequest {
@ApiModelProperty(notes = "商户号集合",required = true)
private List<Integer> merchantNoList;
@ApiModelProperty(notes = "分页数",required = true)
@NotNull
private Integer pageSize;
@ApiModelProperty(notes = "当前页",required = true)
@NotNull
private Integer pageNum;
}
package cn.com.glsx.merchants.request.serviceCenter;
import cn.com.glsx.merchants.request.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class StaffVisibleMerRopRequest extends DefaultRequest {
@ApiModelProperty(notes = "员工UUID",required = true)
private String staffUUID;
}
package cn.com.glsx.merchants.request.serviceCenter;
import cn.com.glsx.merchants.request.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class UpdateMerchantRopRequest extends DefaultRequest {
@ApiModelProperty(notes = "商户号",required = true)
private Integer merchantNo;
@ApiModelProperty(notes = "商户名",required = true)
private String merchantName;
@ApiModelProperty(notes = "旧登录账号",required = true)
private String oldLoginAccount;
@ApiModelProperty(notes = "联系人")
private String merchantLegalPerson;
@ApiModelProperty(notes = "联系电话")
private String merchantLegalPersonPhone;
@ApiModelProperty(notes = "登录密码")
private String password;
}
package cn.com.glsx.merchants.request.serviceCenter;
import cn.com.glsx.merchants.request.DefaultRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class UpdateStaffRopRequest extends DefaultRequest {
@ApiModelProperty(notes = "商户号",required = true)
private Integer merchantNo;
@ApiModelProperty(notes = "员工uuid",required = true)
private String staffUuid;
@ApiModelProperty(notes = "员工姓名")
private String staffName;
@ApiModelProperty(notes = "员工电话")
private String staffPhone;
@ApiModelProperty(notes = "可见范围:0:部分可见 1:全部客户")
private Integer visualType;
@ApiModelProperty(notes = "可见下级商户")
private List<Integer> visibleMerchantNoList;
}
...@@ -34,6 +34,9 @@ public class StaffPageRequest extends DefaultRequest { ...@@ -34,6 +34,9 @@ public class StaffPageRequest extends DefaultRequest {
@ApiModelProperty(notes = "角色id") @ApiModelProperty(notes = "角色id")
private Integer roleId; private Integer roleId;
@ApiModelProperty(notes = "创建来源")
private Integer createdSource;
@NotNull @NotNull
@ApiModelProperty(notes = "分页数", name = "pageSize", dataType = "Integer") @ApiModelProperty(notes = "分页数", name = "pageSize", dataType = "Integer")
private Integer pageSize; private Integer pageSize;
......
...@@ -72,7 +72,7 @@ public class StaffSaveRequest extends DefaultRequest { ...@@ -72,7 +72,7 @@ public class StaffSaveRequest extends DefaultRequest {
@ApiModelProperty(notes = "0-其他、1-销售部、2-售后部、3-客服部、4-续保部") @ApiModelProperty(notes = "0-其他、1-销售部、2-售后部、3-客服部、4-续保部")
private Integer department; private Integer department;
@ApiModelProperty(notes = "创建来源 1:账户中心 2:SCRM 3:生意助手 4:门店助手",required = true)
private Integer createdSource;
} }
...@@ -379,4 +379,12 @@ public class MerchantRopResponse { ...@@ -379,4 +379,12 @@ public class MerchantRopResponse {
@ApiModelProperty(notes = "车品牌树状Obj") @ApiModelProperty(notes = "车品牌树状Obj")
private List<MerchantBrandDTO> brandTreeList; private List<MerchantBrandDTO> brandTreeList;
@ApiModelProperty(notes = "创建来源")
private String createdSourceStr;
/**
* 创建人账号
*/
private String createdAccount;
} }
\ No newline at end of file \ No newline at end of file
...@@ -193,4 +193,7 @@ public class StaffResponse implements Serializable { ...@@ -193,4 +193,7 @@ public class StaffResponse implements Serializable {
private String staffLabel; private String staffLabel;
@ApiModelProperty(notes = "0-其他、1-销售部、2-售后部、3-客服部、4-续保部", dataType = "Integer") @ApiModelProperty(notes = "0-其他、1-销售部、2-售后部、3-客服部、4-续保部", dataType = "Integer")
private Integer department; private Integer department;
@ApiModelProperty(example = "创建来源")
private String createdSourceStr;
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.merchants.response.serviceCenter;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
public class SearchServiceMerchantRopResponse implements Serializable {
@ApiModelProperty(example = "商户id")
private Integer merchantId;
@ApiModelProperty(example = "商户号")
private Integer merchantNo;
@ApiModelProperty(example = "商户名")
private String merchantName;
@ApiModelProperty(example = "登录密码")
private String password;
@ApiModelProperty(example = "联系人")
private String merchantLegalPerson;
@ApiModelProperty(example = "联系电话")
private String merchantLegalPersonPhone;
@ApiModelProperty(example = "员工集合")
private List<ServiceStaffRopResponse> staffList;
@ApiModelProperty(example = "创建时间")
@JsonFormat(pattern = "yyyy.MM.dd", timezone = "GMT+8")
private Date createdDate;
}
package cn.com.glsx.merchants.response.serviceCenter;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class ServiceStaffRopResponse implements Serializable {
@ApiModelProperty(example = "商户号")
private Integer merchantNo;
@ApiModelProperty(example = "商户名")
private String merchantName;
@ApiModelProperty(example = "员工名")
private String staffName;
@ApiModelProperty(example = "员工手机号")
private String staffPhone;
@ApiModelProperty(example = "所属部门")
private String departmentName;
@ApiModelProperty(example = "员工可见4s店")
private String visibleMerchantNo;
@ApiModelProperty(notes = "微信头像")
private String weChatAvatarUrl;
@ApiModelProperty(notes = "员工uuid")
private String staffUuid;
@ApiModelProperty(notes = "可见范围:0:部分可见 1:全部客户")
private Integer visualType;
@ApiModelProperty(example = "创建日期")
@JsonFormat(pattern = "yyyy.MM.dd", timezone = "GMT+8")
private Date createdDate;
}
package cn.com.glsx.merchants.response.serviceCenter;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class VisibleMerchantRopResponse {
@ApiModelProperty(notes = "商户号")
private Integer merchantNo;
@ApiModelProperty(notes = "商户名")
private String merchantName;
@ApiModelProperty(notes = "商户层级")
private Integer merchantAccountLevel;
@ApiModelProperty(notes = "账户类型")
private List<Integer> accountTypeIds;
}
...@@ -307,4 +307,12 @@ public class MerchantService { ...@@ -307,4 +307,12 @@ public class MerchantService {
} }
throw new RpcServiceException(response.getException().getErrId(), response.getMessage()); throw new RpcServiceException(response.getException().getErrId(), response.getMessage());
} }
public Boolean checkMerchantNameRepeat(MerchantNameRopRequest request) {
RpcResponse<Boolean> rpcResponse = merchantRemote.checkMerchantNameRepeat(request.getMerchantName());
if (rpcResponse.isSuccess()) {
return rpcResponse.getResult();
}
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage());
}
} }
...@@ -9,7 +9,11 @@ import cn.com.glsx.merchants.convert.ConvertResponse; ...@@ -9,7 +9,11 @@ import cn.com.glsx.merchants.convert.ConvertResponse;
import cn.com.glsx.merchants.model.request.*; import cn.com.glsx.merchants.model.request.*;
import cn.com.glsx.merchants.model.request.merchant.FindBySupMerchantNoRpcRequest; import cn.com.glsx.merchants.model.request.merchant.FindBySupMerchantNoRpcRequest;
import cn.com.glsx.merchants.model.request.merchant.MerchantListByConditionRpcRequest; import cn.com.glsx.merchants.model.request.merchant.MerchantListByConditionRpcRequest;
import cn.com.glsx.merchants.model.request.serviceCenter.*;
import cn.com.glsx.merchants.model.response.*; import cn.com.glsx.merchants.model.response.*;
import cn.com.glsx.merchants.model.response.serviceCenter.SearchMerchantRpcResponse;
import cn.com.glsx.merchants.model.response.serviceCenter.ServiceStaffRpcResponse;
import cn.com.glsx.merchants.model.response.serviceCenter.VisibleMerchantRpcResponse;
import cn.com.glsx.merchants.remote.MerchantRemote; import cn.com.glsx.merchants.remote.MerchantRemote;
import cn.com.glsx.merchants.remote.MerchantStaffRemote; import cn.com.glsx.merchants.remote.MerchantStaffRemote;
import cn.com.glsx.merchants.remote.MerchantUserRemote; import cn.com.glsx.merchants.remote.MerchantUserRemote;
...@@ -18,7 +22,11 @@ import cn.com.glsx.merchants.request.file.FileSaveRequest; ...@@ -18,7 +22,11 @@ import cn.com.glsx.merchants.request.file.FileSaveRequest;
import cn.com.glsx.merchants.request.merchant.*; import cn.com.glsx.merchants.request.merchant.*;
import cn.com.glsx.merchants.request.open.*; import cn.com.glsx.merchants.request.open.*;
import cn.com.glsx.merchants.request.open.MerchantListOpenRequest; import cn.com.glsx.merchants.request.open.MerchantListOpenRequest;
import cn.com.glsx.merchants.request.serviceCenter.*;
import cn.com.glsx.merchants.response.*; 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.util.ListUtils; import cn.com.glsx.merchants.util.ListUtils;
import cn.com.glsx.merchants.util.Pagination; import cn.com.glsx.merchants.util.Pagination;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -396,4 +404,69 @@ public class OpenService { ...@@ -396,4 +404,69 @@ public class OpenService {
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage()); throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage());
} }
public MerchantNoNameRopResponse createMerchant(CreateMerchantRopRequest ropRequest) {
CreateMerchantRpcRequest remoteRequest = ConvertRequest.convertRequest(ropRequest,new CreateMerchantRpcRequest());
RpcResponse<MerchantNoNameRpcResponse> rpcResponse = merchantRemote.createMerchant(remoteRequest);;
if (rpcResponse.isSuccess())
return ConvertResponse.convertObject(rpcResponse.getResult(),MerchantNoNameRopResponse.class);
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage());
}
public Boolean updateMerchant(UpdateMerchantRopRequest ropRequest) {
UpdateMerchantRpcRequest remoteRequest = ConvertRequest.convertRequest(ropRequest,new UpdateMerchantRpcRequest());
RpcResponse<Boolean> rpcResponse = merchantRemote.updateServiceCenterMerchant(remoteRequest);;
if (rpcResponse.isSuccess())
return rpcResponse.getResult();
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage());
}
public Boolean createStaff(CreateMerchantStaffRopRequest ropRequest) {
CreateMerchantStaffRpcRequest remoteRequest = ConvertRequest.convertRequest(ropRequest,new CreateMerchantStaffRpcRequest());
RpcResponse<Boolean> rpcResponse = merchantRemote.createStaff(remoteRequest);;
if (rpcResponse.isSuccess())
return rpcResponse.getResult();
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage());
}
public Boolean updateStaff(UpdateStaffRopRequest ropRequest) {
UpdateStaffRpcRequest remoteRequest = ConvertRequest.convertRequest(ropRequest,new UpdateStaffRpcRequest());
RpcResponse<Boolean> rpcResponse = merchantRemote.updateServiceCenterStaff(remoteRequest);
if (rpcResponse.isSuccess())
return rpcResponse.getResult();
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage());
}
public List<SearchServiceMerchantRopResponse> searchMerchantAndStaff(SearchServiceMerchantRopRequest ropRequest) {
SearchMerchantRpcRequest remoteRequest = ConvertRequest.convertRequest(ropRequest,new SearchMerchantRpcRequest());
RpcResponse<List<SearchMerchantRpcResponse>> rpcResponse = merchantRemote.searchMerchantAndStaff(remoteRequest);
if (rpcResponse.isSuccess())
return ConvertResponse.convertList(rpcResponse.getResult(),SearchServiceMerchantRopResponse.class);
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage());
}
public List<SearchServiceMerchantRopResponse> searchMerchant(SearchServiceMerchantRopRequest ropRequest) {
SearchMerchantRpcRequest remoteRequest = ConvertRequest.convertRequest(ropRequest,new SearchMerchantRpcRequest());
RpcResponse<List<SearchMerchantRpcResponse>> rpcResponse = merchantRemote.searchMerchant(remoteRequest);
if (rpcResponse.isSuccess())
return ConvertResponse.convertList(rpcResponse.getResult(),SearchServiceMerchantRopResponse.class);
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage());
}
public Pagination<ServiceStaffRopResponse> searchStaffPage(SearchStaffPageRopRequest ropRequest) {
RpcResponse<RpcPagination<ServiceStaffRpcResponse>> merchantListByPageRemote = merchantStaffRemote.searchStaffPage(ConvertRequest.convertRequest(ropRequest, new SearchMerchantRpcRequest()));
if (merchantListByPageRemote.isSuccess()) {
return ConvertResponse.convertPage(merchantListByPageRemote.getResult(), ServiceStaffRopResponse.class);
}
throw new RpcServiceException(merchantListByPageRemote.getException().getErrId(), merchantListByPageRemote.getMessage());
}
public List<VisibleMerchantRopResponse> visibleMerByStaff(StaffVisibleMerRopRequest ropRequest) {
StaffVisibleMerRpcRequest remoteRequest = ConvertRequest.convertRequest(ropRequest,new StaffVisibleMerRpcRequest());
RpcResponse<List<VisibleMerchantRpcResponse>> rpcResponse = merchantStaffRemote.visibleMerByStaff(remoteRequest);
if (rpcResponse.isSuccess())
return ConvertResponse.convertList(rpcResponse.getResult(),VisibleMerchantRopResponse.class);
throw new RpcServiceException(rpcResponse.getException().getErrId(), rpcResponse.getMessage());
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!