Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
scrm
/
rop-merchant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 412062d2
authored
Jul 19, 2021
by
wangnb
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
账户体系账户类型接口编写--think.wang
1 parent
47086d52
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
197 additions
and
78 deletions
src/main/java/cn/com/glsx/merchants/controller/MerchantAccountTypeController.java
src/main/java/cn/com/glsx/merchants/convert/ConverRequest.java → src/main/java/cn/com/glsx/merchants/convert/ConvertRequest.java
src/main/java/cn/com/glsx/merchants/convert/ConverResponse.java → src/main/java/cn/com/glsx/merchants/convert/ConvertResponse.java
src/main/java/cn/com/glsx/merchants/request/accounttype/AccountTypeListSearchRequest.java
src/main/java/cn/com/glsx/merchants/request/role/RoleListSearchRequest.java
src/main/java/cn/com/glsx/merchants/service/LoginService.java
src/main/java/cn/com/glsx/merchants/service/MerchantAccountTypeService.java
src/main/java/cn/com/glsx/merchants/service/MerchantDictDataService.java
src/main/java/cn/com/glsx/merchants/service/MerchantDictTypeService.java
src/main/java/cn/com/glsx/merchants/service/MerchantFileService.java
src/main/java/cn/com/glsx/merchants/service/MerchantFunctionService.java
src/main/java/cn/com/glsx/merchants/service/MerchantLogService.java
src/main/java/cn/com/glsx/merchants/service/MerchantMenuService.java
src/main/java/cn/com/glsx/merchants/service/MerchantProductService.java
src/main/java/cn/com/glsx/merchants/controller/MerchantAccountTypeController.java
View file @
412062d
package
cn
.
com
.
glsx
.
merchants
.
controller
;
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.framework.rop.response.RopResponse
;
import
cn.com.glsx.merchants.request.example.LoginRequest
;
import
cn.com.glsx.merchants.model.response.MerchantAccountTypeResponse
;
import
cn.com.glsx.merchants.response.LoginResponse
;
import
cn.com.glsx.merchants.request.accounttype.AccountTypeDeleteRequest
;
import
cn.com.glsx.merchants.request.accounttype.AccountTypeListSearchRequest
;
import
cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest
;
import
cn.com.glsx.merchants.service.MerchantAccountTypeService
;
import
cn.com.glsx.merchants.service.MerchantAccountTypeService
;
import
cn.com.glsx.merchants.util.Pagination
;
import
com.rop.annotation.NeedInSessionType
;
import
com.rop.annotation.NeedInSessionType
;
import
com.rop.annotation.ServiceMethod
;
import
com.rop.annotation.ServiceMethod
;
import
com.rop.annotation.ServiceMethodBean
;
import
com.rop.annotation.ServiceMethodBean
;
...
@@ -12,6 +16,8 @@ import io.swagger.annotations.ApiOperation;
...
@@ -12,6 +16,8 @@ import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.List
;
/**
/**
* @author zhouhaibao
* @author zhouhaibao
* @version 1.0
* @version 1.0
...
@@ -27,14 +33,71 @@ public class MerchantAccountTypeController {
...
@@ -27,14 +33,71 @@ public class MerchantAccountTypeController {
private
MerchantAccountTypeService
accountTypeService
;
private
MerchantAccountTypeService
accountTypeService
;
/**
/**
* 账户类型获取列表接口
*
*
* @param request
* @param request
* @return
* @return
*/
*/
@ServiceMethod
(
method
=
"org.ore.api.account.list"
,
needInSession
=
NeedInSessionType
.
YES
)
@ServiceMethod
(
method
=
"org.ore.api.account
Type
.list"
,
needInSession
=
NeedInSessionType
.
YES
)
@ApiOperation
(
"账户类型获取列表接口"
)
@ApiOperation
(
"账户类型获取列表接口"
)
public
RopResponse
<
LoginResponse
>
getAccountList
(
LoginRequest
request
)
{
public
RopResponse
<
List
<
MerchantAccountTypeResponse
>>
getAccountTypeList
(
AccountTypeListSearchRequest
request
)
{
return
RopResponse
.
success
(
null
);
try
{
return
RopResponse
.
success
(
accountTypeService
.
getAccountTypeList
(
request
));
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantAccountTypeController__invoke__getAccountTypeList__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 账户类型获取分页数据接口
*
* @param request
* @return
*/
@ServiceMethod
(
method
=
"org.ore.api.accountType.page"
,
needInSession
=
NeedInSessionType
.
YES
)
@ApiOperation
(
"账户类型获取分页数据接口"
)
public
RopResponse
<
Pagination
<
MerchantAccountTypeResponse
>>
getAccountTypePage
(
AccountTypeListSearchRequest
request
)
{
try
{
return
RopResponse
.
success
(
accountTypeService
.
getAccountTypePage
(
request
));
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantAccountTypeController__invoke__getAccountTypePage__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 根据id获取账户类型接口
*
* @param request
* @return
*/
@ServiceMethod
(
method
=
"org.ore.api.accountType.getById"
,
needInSession
=
NeedInSessionType
.
YES
)
@ApiOperation
(
"根据id获取账户类型接口"
)
public
RopResponse
<
MerchantAccountTypeResponse
>
getById
(
AccountTypeSearchRequest
request
)
{
try
{
return
RopResponse
.
success
(
accountTypeService
.
getAccountTypeDetail
(
request
.
getId
()));
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantAccountTypeController__invoke__getById__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 根据id获取账户类型接口
*
* @param request
* @return
*/
@ServiceMethod
(
method
=
"org.ore.api.accountType.deleteById"
,
needInSession
=
NeedInSessionType
.
YES
)
@ApiOperation
(
"根据id获取账户类型接口"
)
public
RopResponse
<
Boolean
>
deleteById
(
AccountTypeDeleteRequest
request
)
{
try
{
return
RopResponse
.
success
(
accountTypeService
.
delete
(
request
));
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantAccountTypeController__invoke__deleteById__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
}
}
src/main/java/cn/com/glsx/merchants/convert/ConverRequest.java
→
src/main/java/cn/com/glsx/merchants/convert/Conver
t
Request.java
View file @
412062d
...
@@ -9,7 +9,7 @@ import org.springframework.beans.BeanUtils;
...
@@ -9,7 +9,7 @@ import org.springframework.beans.BeanUtils;
* @description: 请求体转化
* @description: 请求体转化
* @date 2021/7/9 11:38
* @date 2021/7/9 11:38
*/
*/
public
class
ConverRequest
{
public
class
Conver
t
Request
{
/**
/**
* 转化请求参数
* 转化请求参数
...
@@ -32,7 +32,7 @@ public class ConverRequest {
...
@@ -32,7 +32,7 @@ public class ConverRequest {
* @param <T> 泛型
* @param <T> 泛型
* @return
* @return
*/
*/
public
static
<
T
>
RpcPagination
<
T
>
converPage
(
Object
old
,
T
t
){
public
static
<
T
>
RpcPagination
<
T
>
conver
t
Page
(
Object
old
,
T
t
){
RpcPagination
rpcPagination
=
new
RpcPagination
();
RpcPagination
rpcPagination
=
new
RpcPagination
();
BeanUtils
.
copyProperties
(
old
,
rpcPagination
);
BeanUtils
.
copyProperties
(
old
,
rpcPagination
);
BeanUtils
.
copyProperties
(
old
,
t
);
BeanUtils
.
copyProperties
(
old
,
t
);
...
...
src/main/java/cn/com/glsx/merchants/convert/ConverResponse.java
→
src/main/java/cn/com/glsx/merchants/convert/Conver
t
Response.java
View file @
412062d
...
@@ -16,21 +16,21 @@ import java.util.List;
...
@@ -16,21 +16,21 @@ import java.util.List;
* @date 2021/7/9 11:21
* @date 2021/7/9 11:21
*/
*/
@Data
@Data
public
class
ConverResponse
{
public
class
Conver
t
Response
{
/**
/**
* 转化集合
* 转化集合
*
*
* @param input 原集合
* @param input 原集合
* @param clzz 新集合类
* @param cl
a
zz 新集合类
* @param <T> 泛型
* @param <T> 泛型
* @return
* @return
*/
*/
public
static
<
E
,
T
>
List
<
T
>
convertList
(
List
<
E
>
input
,
Class
<
T
>
clzz
)
{
public
static
<
E
,
T
>
List
<
T
>
convertList
(
List
<
E
>
input
,
Class
<
T
>
cl
a
zz
)
{
List
<
T
>
output
=
Lists
.
newArrayList
();
List
<
T
>
output
=
Lists
.
newArrayList
();
if
(
CollectionUtils
.
isNotEmpty
(
input
))
{
if
(
CollectionUtils
.
isNotEmpty
(
input
))
{
for
(
E
source
:
input
)
{
for
(
E
source
:
input
)
{
T
target
=
BeanUtils
.
instantiateClass
(
clzz
);
T
target
=
BeanUtils
.
instantiateClass
(
cl
a
zz
);
BeanUtils
.
copyProperties
(
source
,
target
);
BeanUtils
.
copyProperties
(
source
,
target
);
output
.
add
(
target
);
output
.
add
(
target
);
}
}
...
@@ -45,11 +45,11 @@ public class ConverResponse {
...
@@ -45,11 +45,11 @@ public class ConverResponse {
* @param list 原集合
* @param list 原集合
* @return 新分页参数
* @return 新分页参数
*/
*/
public
static
<
E
,
T
>
Pagination
<
T
>
converPage
(
RpcPagination
<
E
>
list
,
Class
<
T
>
clazz
)
{
public
static
<
E
,
T
>
Pagination
<
T
>
conver
t
Page
(
RpcPagination
<
E
>
list
,
Class
<
T
>
clazz
)
{
Pagination
pagination
=
new
Pagination
();
Pagination
pagination
=
new
Pagination
();
pagination
.
setPageCount
(
list
.
getPageNum
());
pagination
.
setPageCount
(
list
.
getPageNum
());
List
<
T
>
new
l
ist
=
convertList
(
list
.
getList
(),
clazz
);
List
<
T
>
new
L
ist
=
convertList
(
list
.
getList
(),
clazz
);
pagination
.
setData
(
new
l
ist
);
pagination
.
setData
(
new
L
ist
);
pagination
.
setTotalCount
((
int
)
list
.
getTotal
());
pagination
.
setTotalCount
((
int
)
list
.
getTotal
());
pagination
.
setPageSize
(
list
.
getPageSize
());
pagination
.
setPageSize
(
list
.
getPageSize
());
return
pagination
;
return
pagination
;
...
...
src/main/java/cn/com/glsx/merchants/request/accounttype/AccountTypeListSearchRequest.java
View file @
412062d
...
@@ -16,11 +16,11 @@ public class AccountTypeListSearchRequest extends AbstractRopRequest {
...
@@ -16,11 +16,11 @@ public class AccountTypeListSearchRequest extends AbstractRopRequest {
private
String
accounttypeName
;
private
String
accounttypeName
;
@NotNull
@NotNull
@ApiModelProperty
(
notes
=
"分页数"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"分页数"
)
private
Integer
pageSize
;
private
Integer
pageSize
;
@NotNull
@NotNull
@ApiModelProperty
(
notes
=
"当前页"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"当前页"
)
private
Integer
pageNum
ber
;
private
Integer
pageNum
;
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/request/role/RoleListSearchRequest.java
View file @
412062d
...
@@ -22,11 +22,11 @@ public class RoleListSearchRequest extends AbstractRopRequest {
...
@@ -22,11 +22,11 @@ public class RoleListSearchRequest extends AbstractRopRequest {
private
Integer
merchantId
;
private
Integer
merchantId
;
@NotNull
@NotNull
@ApiModelProperty
(
notes
=
"分页数"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"分页数"
)
private
Integer
pageSize
;
private
Integer
pageSize
;
@NotNull
@NotNull
@ApiModelProperty
(
notes
=
"当前页"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"当前页"
)
private
Integer
pageNumber
;
private
Integer
pageNumber
;
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/service/LoginService.java
View file @
412062d
...
@@ -3,7 +3,6 @@ package cn.com.glsx.merchants.service;
...
@@ -3,7 +3,6 @@ package cn.com.glsx.merchants.service;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.contants.Contants
;
import
cn.com.glsx.merchants.contants.Contants
;
import
cn.com.glsx.merchants.convert.ConverRequest
;
import
cn.com.glsx.merchants.model.request.MerchantUserRequest
;
import
cn.com.glsx.merchants.model.request.MerchantUserRequest
;
import
cn.com.glsx.merchants.model.response.MerchantUserResponse
;
import
cn.com.glsx.merchants.model.response.MerchantUserResponse
;
import
cn.com.glsx.merchants.remote.MerchantUserRemote
;
import
cn.com.glsx.merchants.remote.MerchantUserRemote
;
...
...
src/main/java/cn/com/glsx/merchants/service/MerchantAccountTypeService.java
View file @
412062d
package
cn
.
com
.
glsx
.
merchants
.
service
;
package
cn
.
com
.
glsx
.
merchants
.
service
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConvertRequest
;
import
cn.com.glsx.merchants.convert.ConvertResponse
;
import
cn.com.glsx.merchants.model.request.MerchantAccountTypeRequest
;
import
cn.com.glsx.merchants.model.response.MerchantAccountTypeResponse
;
import
cn.com.glsx.merchants.model.response.MerchantAccountTypeResponse
;
import
cn.com.glsx.merchants.remote.MerchantAccountTypeRemote
;
import
cn.com.glsx.merchants.remote.MerchantAccountTypeRemote
;
import
cn.com.glsx.merchants.request.accounttype.AccountTypeDeleteRequest
;
import
cn.com.glsx.merchants.request.accounttype.AccountTypeListSearchRequest
;
import
cn.com.glsx.merchants.util.Pagination
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
/**
* @author zhouhaibao
* @author zhouhaibao
...
@@ -19,18 +29,70 @@ import javax.annotation.Resource;
...
@@ -19,18 +29,70 @@ import javax.annotation.Resource;
public
class
MerchantAccountTypeService
{
public
class
MerchantAccountTypeService
{
@Resource
@Resource
private
MerchantAccountTypeRemote
merchantA
ccountTypeRemote
;
private
MerchantAccountTypeRemote
a
ccountTypeRemote
;
/**
/**
* 获取账户类型详情
*
id
获取账户类型详情
*
*
* @param id
* @param id
* @return
* @return
*/
*/
public
RpcResponse
<
MerchantAccountTypeResponse
>
getAccountTypeDetail
(
Integer
id
)
{
public
MerchantAccountTypeResponse
getAccountTypeDetail
(
Integer
id
)
{
//获取主表数据
RpcResponse
<
MerchantAccountTypeResponse
>
response
=
accountTypeRemote
.
getByIdRemote
(
id
);
RpcResponse
<
MerchantAccountTypeResponse
>
response
=
merchantAccountTypeRemote
.
getByIdRemote
(
id
);
if
(
response
.
isSuccess
()){
return
response
;
return
response
.
getResult
();
}
throw
new
RpcServiceException
(
response
.
getException
().
getErrId
(),
response
.
getMessage
());
}
/**
* 获取账户类型分页数据
*
* @param request
* @return
*/
public
Pagination
<
MerchantAccountTypeResponse
>
getAccountTypePage
(
AccountTypeListSearchRequest
request
)
{
RpcPagination
<
MerchantAccountTypeRequest
>
pagination
=
ConvertRequest
.
convertPage
(
request
,
new
MerchantAccountTypeRequest
());
RpcResponse
<
RpcPagination
<
MerchantAccountTypeResponse
>>
response
=
accountTypeRemote
.
getAccountTypePageRemote
(
pagination
);
if
(
response
.
isSuccess
()){
return
ConvertResponse
.
convertPage
(
response
.
getResult
(),
MerchantAccountTypeResponse
.
class
);
}
throw
new
RpcServiceException
(
response
.
getException
().
getErrId
(),
response
.
getMessage
());
}
/**
* 获取账户类型数据列表
*
* @param request
* @return
*/
public
List
<
MerchantAccountTypeResponse
>
getAccountTypeList
(
AccountTypeListSearchRequest
request
)
{
MerchantAccountTypeRequest
typeRequest
=
new
MerchantAccountTypeRequest
();
typeRequest
.
setAccounttypeName
(
request
.
getAccounttypeName
());
RpcResponse
<
List
<
MerchantAccountTypeResponse
>>
response
=
accountTypeRemote
.
getAccountTypeListRemote
(
typeRequest
);
if
(
response
.
isSuccess
()){
return
response
.
getResult
();
}
throw
new
RpcServiceException
(
response
.
getException
().
getErrId
(),
response
.
getMessage
());
}
/**
* id删除账户类型
*
* @param request
* @return
*/
public
Boolean
delete
(
AccountTypeDeleteRequest
request
)
{
MerchantAccountTypeRequest
typeRequest
=
new
MerchantAccountTypeRequest
();
BeanUtils
.
copyProperties
(
request
,
typeRequest
);
RpcResponse
<
Boolean
>
response
=
accountTypeRemote
.
deleteRemote
(
typeRequest
);
if
(
response
.
isSuccess
()){
return
response
.
getResult
();
}
throw
new
RpcServiceException
(
response
.
getException
().
getErrId
(),
response
.
getMessage
());
}
}
}
}
src/main/java/cn/com/glsx/merchants/service/MerchantDictDataService.java
View file @
412062d
...
@@ -3,8 +3,8 @@ package cn.com.glsx.merchants.service;
...
@@ -3,8 +3,8 @@ package cn.com.glsx.merchants.service;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConverRequest
;
import
cn.com.glsx.merchants.convert.Conver
t
Request
;
import
cn.com.glsx.merchants.convert.ConverResponse
;
import
cn.com.glsx.merchants.convert.Conver
t
Response
;
import
cn.com.glsx.merchants.model.request.MerchantDictDataRequest
;
import
cn.com.glsx.merchants.model.request.MerchantDictDataRequest
;
import
cn.com.glsx.merchants.model.response.MerchantDictDataResponse
;
import
cn.com.glsx.merchants.model.response.MerchantDictDataResponse
;
import
cn.com.glsx.merchants.remote.MerchantDictDataRemote
;
import
cn.com.glsx.merchants.remote.MerchantDictDataRemote
;
...
@@ -34,38 +34,38 @@ public class MerchantDictDataService {
...
@@ -34,38 +34,38 @@ public class MerchantDictDataService {
private
MerchantUserService
merchantUserService
;
private
MerchantUserService
merchantUserService
;
public
void
saveDictData
(
DictDataSaveRequest
dictDataSaveRequest
)
{
public
void
saveDictData
(
DictDataSaveRequest
dictDataSaveRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictDataRemote
.
saveMerchantDictDataRemote
(
ConverRequest
.
converRequest
(
dictDataSaveRequest
,
new
MerchantDictDataRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictDataRemote
.
saveMerchantDictDataRemote
(
Conver
t
Request
.
converRequest
(
dictDataSaveRequest
,
new
MerchantDictDataRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
public
void
updateDictData
(
DictDataUpdateRequest
DictDataUpdateRequest
)
{
public
void
updateDictData
(
DictDataUpdateRequest
DictDataUpdateRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictDataRemote
.
updateMerchantDictDataRemote
(
ConverRequest
.
converRequest
(
DictDataUpdateRequest
,
new
MerchantDictDataRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictDataRemote
.
updateMerchantDictDataRemote
(
Conver
t
Request
.
converRequest
(
DictDataUpdateRequest
,
new
MerchantDictDataRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
public
Pagination
<
DictDataResponse
>
findDictData
(
DictDataListSearchRequest
DictDataListSearchRequest
)
{
public
Pagination
<
DictDataResponse
>
findDictData
(
DictDataListSearchRequest
DictDataListSearchRequest
)
{
RpcResponse
<
RpcPagination
<
MerchantDictDataResponse
>>
merProductByPageRemote
=
merchantDictDataRemote
.
findMerchantDictDataRemote
(
Conver
Request
.
conver
Page
(
DictDataListSearchRequest
,
new
MerchantDictDataRequest
()));
RpcResponse
<
RpcPagination
<
MerchantDictDataResponse
>>
merProductByPageRemote
=
merchantDictDataRemote
.
findMerchantDictDataRemote
(
Conver
tRequest
.
convert
Page
(
DictDataListSearchRequest
,
new
MerchantDictDataRequest
()));
if
(
merProductByPageRemote
.
isSuccess
())
{
if
(
merProductByPageRemote
.
isSuccess
())
{
return
Conver
Response
.
conver
Page
(
merProductByPageRemote
.
getResult
(),
DictDataResponse
.
class
);
return
Conver
tResponse
.
convert
Page
(
merProductByPageRemote
.
getResult
(),
DictDataResponse
.
class
);
}
}
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
}
}
public
void
deleteDictData
(
DictDataDeleteRequest
DictDataDeleteRequest
)
{
public
void
deleteDictData
(
DictDataDeleteRequest
DictDataDeleteRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictDataRemote
.
deleteMerchantDictDataRemote
(
ConverRequest
.
converRequest
(
DictDataDeleteRequest
,
new
MerchantDictDataRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictDataRemote
.
deleteMerchantDictDataRemote
(
Conver
t
Request
.
converRequest
(
DictDataDeleteRequest
,
new
MerchantDictDataRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
public
List
<
DictDataResponse
>
findAllDictData
(
DictDataSearchRequest
dictDataSearchRequest
)
{
public
List
<
DictDataResponse
>
findAllDictData
(
DictDataSearchRequest
dictDataSearchRequest
)
{
RpcResponse
<
List
<
MerchantDictDataResponse
>>
merProductByPageRemote
=
merchantDictDataRemote
.
findAllRemote
(
ConverRequest
.
converRequest
(
dictDataSearchRequest
,
new
MerchantDictDataRequest
()));
RpcResponse
<
List
<
MerchantDictDataResponse
>>
merProductByPageRemote
=
merchantDictDataRemote
.
findAllRemote
(
Conver
t
Request
.
converRequest
(
dictDataSearchRequest
,
new
MerchantDictDataRequest
()));
if
(
merProductByPageRemote
.
isSuccess
())
{
if
(
merProductByPageRemote
.
isSuccess
())
{
return
ConverResponse
.
convertList
(
merProductByPageRemote
.
getResult
(),
DictDataResponse
.
class
);
return
Conver
t
Response
.
convertList
(
merProductByPageRemote
.
getResult
(),
DictDataResponse
.
class
);
}
}
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
}
}
...
...
src/main/java/cn/com/glsx/merchants/service/MerchantDictTypeService.java
View file @
412062d
...
@@ -3,10 +3,9 @@ package cn.com.glsx.merchants.service;
...
@@ -3,10 +3,9 @@ package cn.com.glsx.merchants.service;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConverRequest
;
import
cn.com.glsx.merchants.convert.Conver
t
Request
;
import
cn.com.glsx.merchants.convert.ConverResponse
;
import
cn.com.glsx.merchants.convert.Conver
t
Response
;
import
cn.com.glsx.merchants.model.request.MerchantDictTypeRequest
;
import
cn.com.glsx.merchants.model.request.MerchantDictTypeRequest
;
import
cn.com.glsx.merchants.model.request.MerchantProductMenuRequest
;
import
cn.com.glsx.merchants.model.response.MerchantDictTypeResponse
;
import
cn.com.glsx.merchants.model.response.MerchantDictTypeResponse
;
import
cn.com.glsx.merchants.remote.MerchantDictTypeRemote
;
import
cn.com.glsx.merchants.remote.MerchantDictTypeRemote
;
import
cn.com.glsx.merchants.request.dicttype.DictTypeDeleteRequest
;
import
cn.com.glsx.merchants.request.dicttype.DictTypeDeleteRequest
;
...
@@ -40,29 +39,29 @@ public class MerchantDictTypeService {
...
@@ -40,29 +39,29 @@ public class MerchantDictTypeService {
@SysLog
(
value
=
"新增字典类型"
,
action
=
OperateType
.
ADD
,
module
=
"字典类型管理"
)
@SysLog
(
value
=
"新增字典类型"
,
action
=
OperateType
.
ADD
,
module
=
"字典类型管理"
)
public
void
saveDictType
(
DictTypeSaveRequest
dictTypeSaveRequest
)
{
public
void
saveDictType
(
DictTypeSaveRequest
dictTypeSaveRequest
)
{
merchantUserService
.
setUser
(
dictTypeSaveRequest
);
merchantUserService
.
setUser
(
dictTypeSaveRequest
);
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictTypeRemote
.
saveMerchantDictTypeRemote
(
ConverRequest
.
converRequest
(
dictTypeSaveRequest
,
new
MerchantDictTypeRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictTypeRemote
.
saveMerchantDictTypeRemote
(
Conver
t
Request
.
converRequest
(
dictTypeSaveRequest
,
new
MerchantDictTypeRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
public
void
updateDictType
(
DictTypeUpdateRequest
dictTypeUpdateRequest
)
{
public
void
updateDictType
(
DictTypeUpdateRequest
dictTypeUpdateRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictTypeRemote
.
updateMerchantDictTypeRemote
(
ConverRequest
.
converRequest
(
dictTypeUpdateRequest
,
new
MerchantDictTypeRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictTypeRemote
.
updateMerchantDictTypeRemote
(
Conver
t
Request
.
converRequest
(
dictTypeUpdateRequest
,
new
MerchantDictTypeRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
public
Pagination
<
DictTypeResponse
>
findDictType
(
DictTypeListSearchRequest
dictTypeListSearchRequest
)
{
public
Pagination
<
DictTypeResponse
>
findDictType
(
DictTypeListSearchRequest
dictTypeListSearchRequest
)
{
RpcResponse
<
RpcPagination
<
MerchantDictTypeResponse
>>
merProductByPageRemote
=
merchantDictTypeRemote
.
findMerchantDictTypeRemote
(
Conver
Request
.
conver
Page
(
dictTypeListSearchRequest
,
new
MerchantDictTypeRequest
()));
RpcResponse
<
RpcPagination
<
MerchantDictTypeResponse
>>
merProductByPageRemote
=
merchantDictTypeRemote
.
findMerchantDictTypeRemote
(
Conver
tRequest
.
convert
Page
(
dictTypeListSearchRequest
,
new
MerchantDictTypeRequest
()));
if
(
merProductByPageRemote
.
isSuccess
())
{
if
(
merProductByPageRemote
.
isSuccess
())
{
return
Conver
Response
.
conver
Page
(
merProductByPageRemote
.
getResult
(),
DictTypeResponse
.
class
);
return
Conver
tResponse
.
convert
Page
(
merProductByPageRemote
.
getResult
(),
DictTypeResponse
.
class
);
}
}
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
}
}
public
void
deleteDictType
(
DictTypeDeleteRequest
dictTypeDeleteRequest
)
{
public
void
deleteDictType
(
DictTypeDeleteRequest
dictTypeDeleteRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictTypeRemote
.
deleteMerchantDictTypeRemote
(
ConverRequest
.
converRequest
(
dictTypeDeleteRequest
,
new
MerchantDictTypeRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictTypeRemote
.
deleteMerchantDictTypeRemote
(
Conver
t
Request
.
converRequest
(
dictTypeDeleteRequest
,
new
MerchantDictTypeRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
...
...
src/main/java/cn/com/glsx/merchants/service/MerchantFileService.java
View file @
412062d
...
@@ -2,8 +2,8 @@ package cn.com.glsx.merchants.service;
...
@@ -2,8 +2,8 @@ package cn.com.glsx.merchants.service;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConverRequest
;
import
cn.com.glsx.merchants.convert.Conver
t
Request
;
import
cn.com.glsx.merchants.convert.ConverResponse
;
import
cn.com.glsx.merchants.convert.Conver
t
Response
;
import
cn.com.glsx.merchants.model.request.MerchantFileRequest
;
import
cn.com.glsx.merchants.model.request.MerchantFileRequest
;
import
cn.com.glsx.merchants.model.response.MerchantFileResponse
;
import
cn.com.glsx.merchants.model.response.MerchantFileResponse
;
import
cn.com.glsx.merchants.remote.MerchantFileRemote
;
import
cn.com.glsx.merchants.remote.MerchantFileRemote
;
...
@@ -30,11 +30,11 @@ public class MerchantFileService {
...
@@ -30,11 +30,11 @@ public class MerchantFileService {
public
List
<
FileResponse
>
findMerchantFile
(
FileSearchRequest
fileSearchRequest
){
public
List
<
FileResponse
>
findMerchantFile
(
FileSearchRequest
fileSearchRequest
){
//入参集合转化
//入参集合转化
RpcResponse
<
List
<
MerchantFileResponse
>>
merchantFileRemoteRpc
=
RpcResponse
<
List
<
MerchantFileResponse
>>
merchantFileRemoteRpc
=
merchantFileRemote
.
findMerchantFileRemote
(
ConverRequest
.
converRequest
(
fileSearchRequest
,
new
MerchantFileRequest
()));
merchantFileRemote
.
findMerchantFileRemote
(
Conver
t
Request
.
converRequest
(
fileSearchRequest
,
new
MerchantFileRequest
()));
//判断调用远程是否成功
//判断调用远程是否成功
if
(
merchantFileRemoteRpc
.
isSuccess
())
{
if
(
merchantFileRemoteRpc
.
isSuccess
())
{
//出参集合转化
//出参集合转化
return
ConverResponse
.
convertList
(
merchantFileRemoteRpc
.
getResult
(),
FileResponse
.
class
);
return
Conver
t
Response
.
convertList
(
merchantFileRemoteRpc
.
getResult
(),
FileResponse
.
class
);
}
}
//自定义异常信息
//自定义异常信息
throw
new
RpcServiceException
(
merchantFileRemoteRpc
.
getException
().
getErrId
(),
merchantFileRemoteRpc
.
getMessage
());
throw
new
RpcServiceException
(
merchantFileRemoteRpc
.
getException
().
getErrId
(),
merchantFileRemoteRpc
.
getMessage
());
...
...
src/main/java/cn/com/glsx/merchants/service/MerchantFunctionService.java
View file @
412062d
...
@@ -6,8 +6,8 @@ package cn.com.glsx.merchants.service;/**
...
@@ -6,8 +6,8 @@ package cn.com.glsx.merchants.service;/**
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConverRequest
;
import
cn.com.glsx.merchants.convert.Conver
t
Request
;
import
cn.com.glsx.merchants.convert.ConverResponse
;
import
cn.com.glsx.merchants.convert.Conver
t
Response
;
import
cn.com.glsx.merchants.model.request.MerchantProductFunctionRequest
;
import
cn.com.glsx.merchants.model.request.MerchantProductFunctionRequest
;
import
cn.com.glsx.merchants.model.response.MerchantProductFunctionResponse
;
import
cn.com.glsx.merchants.model.response.MerchantProductFunctionResponse
;
import
cn.com.glsx.merchants.remote.MerchantProductFunctionRemote
;
import
cn.com.glsx.merchants.remote.MerchantProductFunctionRemote
;
...
@@ -34,23 +34,23 @@ public class MerchantFunctionService {
...
@@ -34,23 +34,23 @@ public class MerchantFunctionService {
private
MerchantProductFunctionRemote
merchantProductFunctionRemote
;
private
MerchantProductFunctionRemote
merchantProductFunctionRemote
;
public
void
saveMerchantFunction
(
FunctionSaveRequest
functionSaveRequest
)
{
public
void
saveMerchantFunction
(
FunctionSaveRequest
functionSaveRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductFunctionRemote
.
saveMerchantProductFunctionRemote
(
ConverRequest
.
converRequest
(
functionSaveRequest
,
new
MerchantProductFunctionRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductFunctionRemote
.
saveMerchantProductFunctionRemote
(
Conver
t
Request
.
converRequest
(
functionSaveRequest
,
new
MerchantProductFunctionRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
public
void
updateMerchantFunction
(
FunctionUpdateRequest
functionUpdateRequest
)
{
public
void
updateMerchantFunction
(
FunctionUpdateRequest
functionUpdateRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductFunctionRemote
.
updateMerchantProductFunctionRemote
(
ConverRequest
.
converRequest
(
functionUpdateRequest
,
new
MerchantProductFunctionRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductFunctionRemote
.
updateMerchantProductFunctionRemote
(
Conver
t
Request
.
converRequest
(
functionUpdateRequest
,
new
MerchantProductFunctionRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
public
Pagination
<
FunctionResponse
>
findMerchantFunction
(
FunctionListSearchRequest
functionListSearchRequest
)
{
public
Pagination
<
FunctionResponse
>
findMerchantFunction
(
FunctionListSearchRequest
functionListSearchRequest
)
{
RpcResponse
<
RpcPagination
<
MerchantProductFunctionResponse
>>
merProductByPageRemote
=
merchantProductFunctionRemote
.
findMerProFunctionByPageRemote
(
Conver
Request
.
conver
Page
(
functionListSearchRequest
,
new
MerchantProductFunctionRequest
()));
RpcResponse
<
RpcPagination
<
MerchantProductFunctionResponse
>>
merProductByPageRemote
=
merchantProductFunctionRemote
.
findMerProFunctionByPageRemote
(
Conver
tRequest
.
convert
Page
(
functionListSearchRequest
,
new
MerchantProductFunctionRequest
()));
if
(
merProductByPageRemote
.
isSuccess
())
{
if
(
merProductByPageRemote
.
isSuccess
())
{
return
Conver
Response
.
conver
Page
(
merProductByPageRemote
.
getResult
(),
FunctionResponse
.
class
);
return
Conver
tResponse
.
convert
Page
(
merProductByPageRemote
.
getResult
(),
FunctionResponse
.
class
);
}
}
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
}
}
...
...
src/main/java/cn/com/glsx/merchants/service/MerchantLogService.java
View file @
412062d
...
@@ -3,8 +3,8 @@ package cn.com.glsx.merchants.service;
...
@@ -3,8 +3,8 @@ package cn.com.glsx.merchants.service;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConverRequest
;
import
cn.com.glsx.merchants.convert.Conver
t
Request
;
import
cn.com.glsx.merchants.convert.ConverResponse
;
import
cn.com.glsx.merchants.convert.Conver
t
Response
;
import
cn.com.glsx.merchants.model.request.MerchantLogRequest
;
import
cn.com.glsx.merchants.model.request.MerchantLogRequest
;
import
cn.com.glsx.merchants.model.response.MerchantLogResponse
;
import
cn.com.glsx.merchants.model.response.MerchantLogResponse
;
import
cn.com.glsx.merchants.remote.MerchantLogRemote
;
import
cn.com.glsx.merchants.remote.MerchantLogRemote
;
...
@@ -30,7 +30,7 @@ public class MerchantLogService {
...
@@ -30,7 +30,7 @@ public class MerchantLogService {
private
MerchantLogRemote
merchantLogRemote
;
private
MerchantLogRemote
merchantLogRemote
;
public
MerchantLogResponse
saveMerchantLog
(
LogRequest
logRequest
)
{
public
MerchantLogResponse
saveMerchantLog
(
LogRequest
logRequest
)
{
RpcResponse
<
MerchantLogResponse
>
booleanRpcResponse
=
merchantLogRemote
.
saveMerchantLogRemote
(
ConverRequest
.
converRequest
(
logRequest
,
new
MerchantLogRequest
()));
RpcResponse
<
MerchantLogResponse
>
booleanRpcResponse
=
merchantLogRemote
.
saveMerchantLogRemote
(
Conver
t
Request
.
converRequest
(
logRequest
,
new
MerchantLogRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
else
{
}
else
{
...
@@ -39,16 +39,16 @@ public class MerchantLogService {
...
@@ -39,16 +39,16 @@ public class MerchantLogService {
}
}
public
void
updateMerchantLog
(
LogRequest
logRequest
)
{
public
void
updateMerchantLog
(
LogRequest
logRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantLogRemote
.
updateMerchantLogRemote
(
ConverRequest
.
converRequest
(
logRequest
,
new
MerchantLogRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantLogRemote
.
updateMerchantLogRemote
(
Conver
t
Request
.
converRequest
(
logRequest
,
new
MerchantLogRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
public
Pagination
<
LogResponse
>
findLog
(
LogSearchRequest
logSearchRequest
)
{
public
Pagination
<
LogResponse
>
findLog
(
LogSearchRequest
logSearchRequest
)
{
RpcResponse
<
RpcPagination
<
MerchantLogResponse
>>
merProductByPageRemote
=
merchantLogRemote
.
findMerchantLogRemote
(
Conver
Request
.
conver
Page
(
logSearchRequest
,
new
MerchantLogRequest
()));
RpcResponse
<
RpcPagination
<
MerchantLogResponse
>>
merProductByPageRemote
=
merchantLogRemote
.
findMerchantLogRemote
(
Conver
tRequest
.
convert
Page
(
logSearchRequest
,
new
MerchantLogRequest
()));
if
(
merProductByPageRemote
.
isSuccess
())
{
if
(
merProductByPageRemote
.
isSuccess
())
{
return
Conver
Response
.
conver
Page
(
merProductByPageRemote
.
getResult
(),
LogResponse
.
class
);
return
Conver
tResponse
.
convert
Page
(
merProductByPageRemote
.
getResult
(),
LogResponse
.
class
);
}
}
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
}
}
...
...
src/main/java/cn/com/glsx/merchants/service/MerchantMenuService.java
View file @
412062d
...
@@ -3,19 +3,16 @@ package cn.com.glsx.merchants.service;
...
@@ -3,19 +3,16 @@ package cn.com.glsx.merchants.service;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConverRequest
;
import
cn.com.glsx.merchants.convert.Conver
t
Request
;
import
cn.com.glsx.merchants.convert.ConverResponse
;
import
cn.com.glsx.merchants.convert.Conver
t
Response
;
import
cn.com.glsx.merchants.model.request.MerchantProductMenuRequest
;
import
cn.com.glsx.merchants.model.request.MerchantProductMenuRequest
;
import
cn.com.glsx.merchants.model.request.MerchantProductRequest
;
import
cn.com.glsx.merchants.model.response.MerchantProductMenuResponse
;
import
cn.com.glsx.merchants.model.response.MerchantProductMenuResponse
;
import
cn.com.glsx.merchants.model.response.MerchantProductResponse
;
import
cn.com.glsx.merchants.remote.MerchantProductMenuRemote
;
import
cn.com.glsx.merchants.remote.MerchantProductMenuRemote
;
import
cn.com.glsx.merchants.request.menu.MenuListSearchRequest
;
import
cn.com.glsx.merchants.request.menu.MenuListSearchRequest
;
import
cn.com.glsx.merchants.request.menu.MenuSaveRequest
;
import
cn.com.glsx.merchants.request.menu.MenuSaveRequest
;
import
cn.com.glsx.merchants.request.menu.MenuSearchRequest
;
import
cn.com.glsx.merchants.request.menu.MenuSearchRequest
;
import
cn.com.glsx.merchants.request.menu.MenuUpdateRequest
;
import
cn.com.glsx.merchants.request.menu.MenuUpdateRequest
;
import
cn.com.glsx.merchants.response.MenuResponse
;
import
cn.com.glsx.merchants.response.MenuResponse
;
import
cn.com.glsx.merchants.response.ProductResponse
;
import
cn.com.glsx.merchants.util.Pagination
;
import
cn.com.glsx.merchants.util.Pagination
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -37,31 +34,31 @@ public class MerchantMenuService {
...
@@ -37,31 +34,31 @@ public class MerchantMenuService {
private
MerchantProductMenuRemote
merchantProductMenuRemote
;
private
MerchantProductMenuRemote
merchantProductMenuRemote
;
public
List
<
MenuResponse
>
findMerProMenuTreeRemote
(
MenuSearchRequest
menuSearchRequest
)
{
public
List
<
MenuResponse
>
findMerProMenuTreeRemote
(
MenuSearchRequest
menuSearchRequest
)
{
RpcResponse
<
List
<
MerchantProductMenuResponse
>>
merProMenuTreeRemote
=
merchantProductMenuRemote
.
findMerProMenuTreeRemote
(
ConverRequest
.
converRequest
(
menuSearchRequest
,
new
MerchantProductMenuRequest
()));
RpcResponse
<
List
<
MerchantProductMenuResponse
>>
merProMenuTreeRemote
=
merchantProductMenuRemote
.
findMerProMenuTreeRemote
(
Conver
t
Request
.
converRequest
(
menuSearchRequest
,
new
MerchantProductMenuRequest
()));
if
(
merProMenuTreeRemote
.
isSuccess
())
{
if
(
merProMenuTreeRemote
.
isSuccess
())
{
List
<
MenuResponse
>
menuResponseList
=
ConverResponse
.
convertList
(
merProMenuTreeRemote
.
getResult
(),
MenuResponse
.
class
);
List
<
MenuResponse
>
menuResponseList
=
Conver
t
Response
.
convertList
(
merProMenuTreeRemote
.
getResult
(),
MenuResponse
.
class
);
return
menuResponseList
;
return
menuResponseList
;
}
}
throw
new
RpcServiceException
(
merProMenuTreeRemote
.
getException
().
getErrId
(),
merProMenuTreeRemote
.
getMessage
());
throw
new
RpcServiceException
(
merProMenuTreeRemote
.
getException
().
getErrId
(),
merProMenuTreeRemote
.
getMessage
());
}
}
public
void
saveMerchantProductMenuRemote
(
MenuSaveRequest
menuSaveRequest
)
{
public
void
saveMerchantProductMenuRemote
(
MenuSaveRequest
menuSaveRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductMenuRemote
.
saveMerchantProductMenuRemote
(
ConverRequest
.
converRequest
(
menuSaveRequest
,
new
MerchantProductMenuRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductMenuRemote
.
saveMerchantProductMenuRemote
(
Conver
t
Request
.
converRequest
(
menuSaveRequest
,
new
MerchantProductMenuRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
public
Pagination
<
MenuResponse
>
findMerProMenuByPageRemote
(
MenuListSearchRequest
menuListSearchRequest
)
{
public
Pagination
<
MenuResponse
>
findMerProMenuByPageRemote
(
MenuListSearchRequest
menuListSearchRequest
)
{
RpcResponse
<
RpcPagination
<
MerchantProductMenuResponse
>>
merProductByPageRemote
=
merchantProductMenuRemote
.
findMerProMenuByPageRemote
(
Conver
Request
.
conver
Page
(
menuListSearchRequest
,
new
MerchantProductMenuRequest
()));
RpcResponse
<
RpcPagination
<
MerchantProductMenuResponse
>>
merProductByPageRemote
=
merchantProductMenuRemote
.
findMerProMenuByPageRemote
(
Conver
tRequest
.
convert
Page
(
menuListSearchRequest
,
new
MerchantProductMenuRequest
()));
if
(
merProductByPageRemote
.
isSuccess
())
{
if
(
merProductByPageRemote
.
isSuccess
())
{
return
Conver
Response
.
conver
Page
(
merProductByPageRemote
.
getResult
(),
MenuResponse
.
class
);
return
Conver
tResponse
.
convert
Page
(
merProductByPageRemote
.
getResult
(),
MenuResponse
.
class
);
}
}
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
}
}
public
void
updateMerchantProductMenuRemote
(
MenuUpdateRequest
menuUpdateRequest
)
{
public
void
updateMerchantProductMenuRemote
(
MenuUpdateRequest
menuUpdateRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductMenuRemote
.
updateMerchantProductMenuRemote
(
ConverRequest
.
converRequest
(
menuUpdateRequest
,
new
MerchantProductMenuRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductMenuRemote
.
updateMerchantProductMenuRemote
(
Conver
t
Request
.
converRequest
(
menuUpdateRequest
,
new
MerchantProductMenuRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
...
...
src/main/java/cn/com/glsx/merchants/service/MerchantProductService.java
View file @
412062d
...
@@ -3,8 +3,8 @@ package cn.com.glsx.merchants.service;
...
@@ -3,8 +3,8 @@ package cn.com.glsx.merchants.service;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConverRequest
;
import
cn.com.glsx.merchants.convert.Conver
t
Request
;
import
cn.com.glsx.merchants.convert.ConverResponse
;
import
cn.com.glsx.merchants.convert.Conver
t
Response
;
import
cn.com.glsx.merchants.model.request.MerchantProductRequest
;
import
cn.com.glsx.merchants.model.request.MerchantProductRequest
;
import
cn.com.glsx.merchants.model.response.MerchantProductResponse
;
import
cn.com.glsx.merchants.model.response.MerchantProductResponse
;
import
cn.com.glsx.merchants.remote.MerchantProductRemote
;
import
cn.com.glsx.merchants.remote.MerchantProductRemote
;
...
@@ -14,7 +14,6 @@ import cn.com.glsx.merchants.request.product.ProductUpdateRequest;
...
@@ -14,7 +14,6 @@ import cn.com.glsx.merchants.request.product.ProductUpdateRequest;
import
cn.com.glsx.merchants.response.ProductResponse
;
import
cn.com.glsx.merchants.response.ProductResponse
;
import
cn.com.glsx.merchants.util.Pagination
;
import
cn.com.glsx.merchants.util.Pagination
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.dubbo.config.annotation.DubboReference
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -36,29 +35,29 @@ public class MerchantProductService {
...
@@ -36,29 +35,29 @@ public class MerchantProductService {
public
List
<
ProductResponse
>
findProduct
()
{
public
List
<
ProductResponse
>
findProduct
()
{
RpcResponse
<
List
<
MerchantProductResponse
>>
merProductListRemote
=
merchantProductRemote
.
findMerProductListRemote
();
RpcResponse
<
List
<
MerchantProductResponse
>>
merProductListRemote
=
merchantProductRemote
.
findMerProductListRemote
();
if
(
merProductListRemote
.
isSuccess
())
{
if
(
merProductListRemote
.
isSuccess
())
{
List
<
ProductResponse
>
productResponses
=
ConverResponse
.
convertList
(
merProductListRemote
.
getResult
(),
ProductResponse
.
class
);
List
<
ProductResponse
>
productResponses
=
Conver
t
Response
.
convertList
(
merProductListRemote
.
getResult
(),
ProductResponse
.
class
);
return
productResponses
;
return
productResponses
;
}
}
throw
new
RpcServiceException
(
merProductListRemote
.
getException
().
getErrId
(),
merProductListRemote
.
getMessage
());
throw
new
RpcServiceException
(
merProductListRemote
.
getException
().
getErrId
(),
merProductListRemote
.
getMessage
());
}
}
public
void
saveProduct
(
ProductSaveRequest
productSearchRequest
)
{
public
void
saveProduct
(
ProductSaveRequest
productSearchRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductRemote
.
saveMerchantProductRemote
(
ConverRequest
.
converRequest
(
productSearchRequest
,
new
MerchantProductRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductRemote
.
saveMerchantProductRemote
(
Conver
t
Request
.
converRequest
(
productSearchRequest
,
new
MerchantProductRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
public
Pagination
<
ProductResponse
>
findProductByPage
(
ProductSearchRequest
productSearchRequest
)
{
public
Pagination
<
ProductResponse
>
findProductByPage
(
ProductSearchRequest
productSearchRequest
)
{
RpcResponse
<
RpcPagination
<
MerchantProductResponse
>>
merProductByPageRemote
=
merchantProductRemote
.
findMerProductByPageRemote
(
Conver
Request
.
conver
Page
(
productSearchRequest
,
new
MerchantProductRequest
()));
RpcResponse
<
RpcPagination
<
MerchantProductResponse
>>
merProductByPageRemote
=
merchantProductRemote
.
findMerProductByPageRemote
(
Conver
tRequest
.
convert
Page
(
productSearchRequest
,
new
MerchantProductRequest
()));
if
(
merProductByPageRemote
.
isSuccess
())
{
if
(
merProductByPageRemote
.
isSuccess
())
{
return
Conver
Response
.
conver
Page
(
merProductByPageRemote
.
getResult
(),
ProductResponse
.
class
);
return
Conver
tResponse
.
convert
Page
(
merProductByPageRemote
.
getResult
(),
ProductResponse
.
class
);
}
}
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
}
}
public
void
updateProduct
(
ProductUpdateRequest
productUpdateRequest
)
{
public
void
updateProduct
(
ProductUpdateRequest
productUpdateRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductRemote
.
updateProductRemote
(
ConverRequest
.
converRequest
(
productUpdateRequest
,
new
MerchantProductRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductRemote
.
updateProductRemote
(
Conver
t
Request
.
converRequest
(
productUpdateRequest
,
new
MerchantProductRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment