Commit 767ce28e by zhouhb

[+]代码提交

1 parent c6df71b0
......@@ -10,6 +10,7 @@ import cn.com.glsx.merchants.request.user.OpenUserRequest;
import cn.com.glsx.merchants.response.AccountTypeTreeRopResponse;
import cn.com.glsx.merchants.response.MerchantRopResponse;
import cn.com.glsx.merchants.response.OpenUserResponse;
import cn.com.glsx.merchants.response.StaffResponse;
import cn.com.glsx.merchants.service.OpenService;
import cn.com.glsx.merchants.util.Pagination;
import com.rop.annotation.NeedInSessionType;
......@@ -223,4 +224,39 @@ public class OpenController {
}
}
/**
* 根据账户类型,层级查询商户列表
*
* @param merchantListOpenRequest 入参
* @return
*/
@ServiceMethod(method = "cn.com.glsx.merchants.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 = "cn.com.glsx.merchants.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());
}
}
}
......@@ -8,6 +8,7 @@ import cn.com.glsx.merchants.convert.ConvertResponse;
import cn.com.glsx.merchants.model.request.*;
import cn.com.glsx.merchants.model.response.AccountTypeTreeResponse;
import cn.com.glsx.merchants.model.response.MerchantResponse;
import cn.com.glsx.merchants.model.response.MerchantStaffResponse;
import cn.com.glsx.merchants.model.response.MerchantUserResponse;
import cn.com.glsx.merchants.remote.MerchantRemote;
import cn.com.glsx.merchants.remote.MerchantStaffRemote;
......@@ -17,10 +18,12 @@ import cn.com.glsx.merchants.request.merchant.MerchantSaveRequest;
import cn.com.glsx.merchants.request.merchant.OpenMerchantPageRequest;
import cn.com.glsx.merchants.request.merchant.OpenMerchantRequest;
import cn.com.glsx.merchants.request.open.*;
import cn.com.glsx.merchants.request.open.MerchantListOpenRequest;
import cn.com.glsx.merchants.request.user.OpenUserRequest;
import cn.com.glsx.merchants.response.AccountTypeTreeRopResponse;
import cn.com.glsx.merchants.response.MerchantRopResponse;
import cn.com.glsx.merchants.response.OpenUserResponse;
import cn.com.glsx.merchants.response.StaffResponse;
import cn.com.glsx.merchants.util.Pagination;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang.StringUtils;
......@@ -155,4 +158,20 @@ public class OpenService {
}
throw new RpcServiceException(subordinateListByPageRemote.getException().getErrId(), subordinateListByPageRemote.getMessage());
}
public Pagination<MerchantRopResponse> findMerchantListByPage(MerchantListOpenRequest merchantListOpenRequest) {
RpcResponse<RpcPagination<MerchantResponse>> merchantListByPageRemote = merchantRemote.findMerchantListByPageRemote(ConvertRequest.convertPage(merchantListOpenRequest, new cn.com.glsx.merchants.model.request.MerchantListOpenRequest()));
if (merchantListByPageRemote.isSuccess()) {
return ConvertResponse.convertPage(merchantListByPageRemote.getResult(), MerchantRopResponse.class);
}
throw new RpcServiceException(merchantListByPageRemote.getException().getErrId(), merchantListByPageRemote.getMessage());
}
public StaffResponse findStaffByAccount(StaffSearchOpenRequest staffSearchOpenRequest) {
RpcResponse<MerchantStaffResponse> staffByAccount = merchantStaffRemote.findStaffByAccount(ConvertRequest.convertRequest(staffSearchOpenRequest, new StaffOpenRequest()));
if (staffByAccount.isSuccess()) {
return ConvertResponse.convertObject(staffByAccount.getResult(), StaffResponse.class);
}
throw new RpcServiceException(staffByAccount.getException().getErrId(), staffByAccount.getMessage());
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!