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 e8887734
authored
Jul 13, 2021
by
zhouhb
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]商户接口
1 parent
3488e6a7
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
1113 additions
and
21 deletions
src/main/java/cn/com/glsx/merchants/config/DubboConfig.java
src/main/java/cn/com/glsx/merchants/controller/MerchantDictDataController.java
src/main/java/cn/com/glsx/merchants/controller/MerchantDictTypeController.java
src/main/java/cn/com/glsx/merchants/controller/MerchantFunctionController.java
src/main/java/cn/com/glsx/merchants/controller/MerchantMenuController.java
src/main/java/cn/com/glsx/merchants/controller/MerchantProductController.java
src/main/java/cn/com/glsx/merchants/request/dictdata/DictDataDeleteRequest.java
src/main/java/cn/com/glsx/merchants/request/dictdata/DictDataListSearchRequest.java
src/main/java/cn/com/glsx/merchants/request/dictdata/DictDataSaveRequest.java
src/main/java/cn/com/glsx/merchants/request/dictdata/DictDataSearchRequest.java
src/main/java/cn/com/glsx/merchants/request/dictdata/DictDataUpdateRequest.java
src/main/java/cn/com/glsx/merchants/request/dicttype/DictTypeDeleteRequest.java
src/main/java/cn/com/glsx/merchants/request/dicttype/DictTypeListSearchRequest.java
src/main/java/cn/com/glsx/merchants/request/dicttype/DictTypeSaveRequest.java
src/main/java/cn/com/glsx/merchants/request/dicttype/DictTypeUpdateRequest.java
src/main/java/cn/com/glsx/merchants/request/function/FunctionSaveRequest.java
src/main/java/cn/com/glsx/merchants/request/function/FunctionUpdateRequest.java
src/main/java/cn/com/glsx/merchants/response/DictDataResponse.java
src/main/java/cn/com/glsx/merchants/response/DictTypeResponse.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/MerchantFunctionService.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/config/DubboConfig.java
View file @
e888773
package
cn
.
com
.
glsx
.
merchants
.
config
;
import
cn.com.glsx.merchants.remote.MerchantProductMenuRemote
;
import
cn.com.glsx.merchants.remote.MerchantProductRemote
;
import
cn.com.glsx.merchants.remote.*
;
import
org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
/**
*
Dubbo服务注册配置
* Dubbo服务注册配置
*/
@Configuration
public
class
DubboConfig
{
...
...
@@ -25,4 +24,19 @@ public class DubboConfig {
public
MerchantProductMenuRemote
getMerchantProductMenuRemote
()
{
return
factory
.
builder
(
MerchantProductMenuRemote
.
class
).
check
(
false
).
timeout
(
30000
).
version
(
"2.0.0"
).
build
();
}
@Bean
public
MerchantDictTypeRemote
getMerchantDictTypeRemote
()
{
return
factory
.
builder
(
MerchantDictTypeRemote
.
class
).
check
(
false
).
timeout
(
30000
).
version
(
"2.0.0"
).
build
();
}
@Bean
public
MerchantDictDataRemote
getMerchantDictDataRemote
()
{
return
factory
.
builder
(
MerchantDictDataRemote
.
class
).
check
(
false
).
timeout
(
30000
).
version
(
"2.0.0"
).
build
();
}
@Bean
public
MerchantProductFunctionRemote
getMerchantProductFunctionRemote
()
{
return
factory
.
builder
(
MerchantProductFunctionRemote
.
class
).
check
(
false
).
timeout
(
30000
).
version
(
"2.0.0"
).
build
();
}
}
src/main/java/cn/com/glsx/merchants/controller/MerchantDictDataController.java
0 → 100644
View file @
e888773
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.request.dictdata.*
;
import
cn.com.glsx.merchants.response.DictDataResponse
;
import
cn.com.glsx.merchants.service.MerchantDictDataService
;
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.springframework.beans.factory.annotation.Autowired
;
import
java.util.List
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/7/13 10:00
*/
@ServiceMethodBean
(
version
=
"1.0.0"
,
needInSession
=
NeedInSessionType
.
NO
)
@Api
(
"字典数据接口"
)
@Slf4j
public
class
MerchantDictDataController
{
@Autowired
private
MerchantDictDataService
merchantDictDataService
;
/**
* 保存字典
*
* @param DictDataSaveRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.saveDictData"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"保存字典数据"
)
public
RopResponse
<
Boolean
>
saveDictData
(
DictDataSaveRequest
DictDataSaveRequest
)
{
try
{
merchantDictDataService
.
saveDictData
(
DictDataSaveRequest
);
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__saveDictData__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 更新字典
*
* @param DictDataUpdateRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.updateDictData"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"更新字典数据"
)
public
RopResponse
<
Boolean
>
updateDictData
(
DictDataUpdateRequest
DictDataUpdateRequest
)
{
try
{
merchantDictDataService
.
updateDictData
(
DictDataUpdateRequest
);
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__updateDictData__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 删除字典
*
* @param DictDataDeleteRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.deleteDictData"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"删除字典数据"
)
public
RopResponse
<
Boolean
>
deleteDictData
(
DictDataDeleteRequest
DictDataDeleteRequest
)
{
try
{
merchantDictDataService
.
deleteDictData
(
DictDataDeleteRequest
);
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__deleteDictData__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 查询字典列表
*
* @param DictDataListSearchRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.findDictData"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"查询字典数据列表"
)
public
RopResponse
<
Pagination
<
DictDataResponse
>>
findDictData
(
DictDataListSearchRequest
DictDataListSearchRequest
)
{
try
{
Pagination
<
DictDataResponse
>
list
=
merchantDictDataService
.
findDictData
(
DictDataListSearchRequest
);
return
RopResponse
.
success
(
list
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__findDictData__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 查询所有字典
*
* @param dictDataSearchRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.findAllDictData"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"查询所有字典"
)
public
RopResponse
<
List
<
DictDataResponse
>>
findAllDictData
(
DictDataSearchRequest
dictDataSearchRequest
)
{
try
{
List
<
DictDataResponse
>
list
=
merchantDictDataService
.
findAllDictData
(
dictDataSearchRequest
);
return
RopResponse
.
success
(
list
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__findAllDictData__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
src/main/java/cn/com/glsx/merchants/controller/MerchantDictTypeController.java
0 → 100644
View file @
e888773
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.request.dicttype.DictTypeDeleteRequest
;
import
cn.com.glsx.merchants.request.dicttype.DictTypeListSearchRequest
;
import
cn.com.glsx.merchants.request.dicttype.DictTypeSaveRequest
;
import
cn.com.glsx.merchants.request.dicttype.DictTypeUpdateRequest
;
import
cn.com.glsx.merchants.response.DictTypeResponse
;
import
cn.com.glsx.merchants.service.MerchantDictTypeService
;
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.springframework.beans.factory.annotation.Autowired
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/7/13 10:00
*/
@ServiceMethodBean
(
version
=
"1.0.0"
,
needInSession
=
NeedInSessionType
.
NO
)
@Api
(
"字典类型接口"
)
@Slf4j
public
class
MerchantDictTypeController
{
@Autowired
private
MerchantDictTypeService
merchantDictTypeService
;
/**
* 保存字典类型
*
* @param dictTypeSaveRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.saveDictType"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"保存字典类型"
)
public
RopResponse
<
Boolean
>
saveDictType
(
DictTypeSaveRequest
dictTypeSaveRequest
)
{
try
{
merchantDictTypeService
.
saveDictType
(
dictTypeSaveRequest
);
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__saveDictType__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 更新字典类型
*
* @param dictTypeUpdateRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.updateDictType"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"更新字典类型"
)
public
RopResponse
<
Boolean
>
updateDictType
(
DictTypeUpdateRequest
dictTypeUpdateRequest
)
{
try
{
merchantDictTypeService
.
updateDictType
(
dictTypeUpdateRequest
);
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__updateDictType__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 删除字典类型
*
* @param dictTypeDeleteRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.deleteDictType"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"删除字典类型"
)
public
RopResponse
<
Boolean
>
deleteDictType
(
DictTypeDeleteRequest
dictTypeDeleteRequest
)
{
try
{
merchantDictTypeService
.
deleteDictType
(
dictTypeDeleteRequest
);
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__deleteDictType__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 查询字典类型
*
* @param dictTypeListSearchRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.findDictType"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"查询字典类型"
)
public
RopResponse
<
Pagination
<
DictTypeResponse
>>
findDictType
(
DictTypeListSearchRequest
dictTypeListSearchRequest
)
{
try
{
Pagination
<
DictTypeResponse
>
list
=
merchantDictTypeService
.
findDictType
(
dictTypeListSearchRequest
);
return
RopResponse
.
success
(
list
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke_findDictType__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
src/main/java/cn/com/glsx/merchants/controller/MerchantFunctionController.java
View file @
e888773
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.request.function.FunctionListSearchRequest
;
import
cn.com.glsx.merchants.request.function.FunctionSaveRequest
;
import
cn.com.glsx.merchants.request.function.FunctionUpdateRequest
;
import
cn.com.glsx.merchants.response.FunctionResponse
;
import
cn.com.glsx.merchants.response.MenuResponse
;
import
cn.com.glsx.merchants.service.MerchantFunctionService
;
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.springframework.beans.factory.annotation.Autowired
;
/**
* @author zhouhaibao
* @version 1.0
* @description:
TODO
* @description:
功能模块
* @date 2021/7/12 11:39
*/
@ServiceMethodBean
(
version
=
"1.0.0"
,
needInSession
=
NeedInSessionType
.
NO
)
...
...
@@ -25,4 +31,57 @@ public class MerchantFunctionController {
@Autowired
private
MerchantFunctionService
merchantFunctionService
;
/**
* 保存功能
*
* @param functionSaveRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.saveMerchantFunction"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"保存菜单"
)
public
RopResponse
<
Boolean
>
saveMerchantFunction
(
FunctionSaveRequest
functionSaveRequest
)
{
try
{
merchantFunctionService
.
saveMerchantFunction
(
functionSaveRequest
);
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__saveMerchantFunction__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 修改功能
*
* @param functionUpdateRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.updateMerchantFunction"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"保存菜单"
)
public
RopResponse
<
Boolean
>
updateMerchantFunction
(
FunctionUpdateRequest
functionUpdateRequest
)
{
try
{
merchantFunctionService
.
updateMerchantFunction
(
functionUpdateRequest
);
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__updateMerchantFunction__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 修改功能
*
* @param functionListSearchRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.findMerchantFunction"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"保存菜单"
)
public
RopResponse
<
Pagination
<
FunctionResponse
>>
findMerchantFunction
(
FunctionListSearchRequest
functionListSearchRequest
)
{
try
{
Pagination
<
FunctionResponse
>
listPagination
=
merchantFunctionService
.
findMerchantFunction
(
functionListSearchRequest
);
return
RopResponse
.
success
(
listPagination
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__findMerchantFunction__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
src/main/java/cn/com/glsx/merchants/controller/MerchantMenuController.java
View file @
e888773
...
...
@@ -48,7 +48,7 @@ public class MerchantMenuController {
return
RopResponse
.
success
(
menuResponseList
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__findMerProMenuTreeRemote__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErr
or
());
return
RopResponse
.
error
(
e
.
getErr
Id
(),
e
.
getMessage
());
}
}
...
...
@@ -66,7 +66,7 @@ public class MerchantMenuController {
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__saveMerchantProductMenuRemote__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErr
or
());
return
RopResponse
.
error
(
e
.
getErr
Id
(),
e
.
getMessage
());
}
}
...
...
@@ -84,7 +84,7 @@ public class MerchantMenuController {
return
RopResponse
.
success
(
list
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__findMerProMenuByPageRemote__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErr
or
());
return
RopResponse
.
error
(
e
.
getErr
Id
(),
e
.
getMessage
());
}
}
...
...
@@ -102,7 +102,7 @@ public class MerchantMenuController {
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__updateMerchantProductMenuRemote__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErr
or
());
return
RopResponse
.
error
(
e
.
getErr
Id
(),
e
.
getMessage
());
}
}
...
...
src/main/java/cn/com/glsx/merchants/controller/MerchantProductController.java
View file @
e888773
...
...
@@ -42,7 +42,7 @@ public class MerchantProductController {
return
RopResponse
.
success
(
list
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantProductController__invoke__findProduct__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErr
or
());
return
RopResponse
.
error
(
e
.
getErr
Id
(),
e
.
getMessage
());
}
}
...
...
@@ -54,7 +54,7 @@ public class MerchantProductController {
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantProductController__invoke__productSearchRequest__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErr
or
());
return
RopResponse
.
error
(
e
.
getErr
Id
(),
e
.
getMessage
());
}
}
...
...
@@ -66,7 +66,7 @@ public class MerchantProductController {
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantProductController__invoke__productSearchRequest__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErr
or
());
return
RopResponse
.
error
(
e
.
getErr
Id
(),
e
.
getMessage
());
}
}
...
...
@@ -84,7 +84,7 @@ public class MerchantProductController {
return
RopResponse
.
success
(
productByPage
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantProductController__invoke__productSearchRequest__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErr
or
());
return
RopResponse
.
error
(
e
.
getErr
Id
(),
e
.
getMessage
());
}
}
}
src/main/java/cn/com/glsx/merchants/request/dictdata/DictDataDeleteRequest.java
0 → 100644
View file @
e888773
package
cn
.
com
.
glsx
.
merchants
.
request
.
dictdata
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
@Data
public
class
DictDataDeleteRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
notes
=
"id"
,
required
=
true
)
@NotNull
private
Long
id
;
}
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/request/dictdata/DictDataListSearchRequest.java
0 → 100644
View file @
e888773
package
cn
.
com
.
glsx
.
merchants
.
request
.
dictdata
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/7/13 10:56
*/
@Data
public
class
DictDataListSearchRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
notes
=
"分页数"
)
private
Integer
pageSize
;
@ApiModelProperty
(
notes
=
"当前页"
)
private
Integer
pageNumer
;
/**
* 字典标签
*/
@ApiModelProperty
(
notes
=
"字典标签"
)
private
String
dictLabel
;
/**
* 字典类型
*/
@ApiModelProperty
(
notes
=
"字典类型"
)
private
String
dictType
;
@ApiModelProperty
(
notes
=
"是否启用"
)
private
Integer
enableStatus
;
}
src/main/java/cn/com/glsx/merchants/request/dictdata/DictDataSaveRequest.java
0 → 100644
View file @
e888773
package
cn
.
com
.
glsx
.
merchants
.
request
.
dictdata
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
@Data
public
class
DictDataSaveRequest
extends
AbstractRopRequest
{
/**
* 字典排序
*/
@ApiModelProperty
(
notes
=
"字典排序"
,
required
=
true
)
@NotNull
private
Integer
dictSort
;
/**
* 字典标签
*/
@ApiModelProperty
(
notes
=
"字典标签"
,
required
=
true
)
@NotNull
private
String
dictLabel
;
/**
* 字典键值
*/
@ApiModelProperty
(
notes
=
"字典键值"
,
required
=
true
)
@NotNull
private
String
dictValue
;
/**
* 字典类型
*/
@ApiModelProperty
(
notes
=
"dictType"
,
required
=
true
)
@NotNull
private
String
dictType
;
@ApiModelProperty
(
notes
=
"是否启用"
,
required
=
true
)
@NotNull
private
Integer
enableStatus
;
/**
* 备注
*/
@ApiModelProperty
(
notes
=
"备注"
,
required
=
true
)
@NotNull
private
String
remark
;
/**
* 创建者
*/
@ApiModelProperty
(
notes
=
"创建者"
,
required
=
true
)
@NotNull
private
Integer
createdBy
;
}
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/request/dictdata/DictDataSearchRequest.java
0 → 100644
View file @
e888773
package
cn
.
com
.
glsx
.
merchants
.
request
.
dictdata
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/7/13 11:07
*/
@Data
public
class
DictDataSearchRequest
extends
AbstractRopRequest
{
/**
* 字典类型
*/
@ApiModelProperty
(
notes
=
"dictType"
,
required
=
true
)
@NotNull
private
String
dictType
;
}
src/main/java/cn/com/glsx/merchants/request/dictdata/DictDataUpdateRequest.java
0 → 100644
View file @
e888773
package
cn
.
com
.
glsx
.
merchants
.
request
.
dictdata
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
@Data
public
class
DictDataUpdateRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
notes
=
"id"
,
required
=
true
)
@NotNull
private
Long
id
;
/**
* 字典排序
*/
@ApiModelProperty
(
notes
=
"字典排序"
,
required
=
true
)
@NotNull
private
Integer
dictSort
;
/**
* 字典标签
*/
@ApiModelProperty
(
notes
=
"字典标签"
,
required
=
true
)
@NotNull
private
String
dictLabel
;
/**
* 字典键值
*/
@ApiModelProperty
(
notes
=
"字典键值"
,
required
=
true
)
@NotNull
private
String
dictValue
;
/**
* 字典类型
*/
@ApiModelProperty
(
notes
=
"dictType"
,
required
=
true
)
@NotNull
private
String
dictType
;
@ApiModelProperty
(
notes
=
"是否启用"
,
required
=
true
)
@NotNull
private
Integer
enableStatus
;
/**
* 备注
*/
@ApiModelProperty
(
notes
=
"备注"
,
required
=
true
)
@NotNull
private
String
remark
;
/**
* 更新者
*/
@ApiModelProperty
(
notes
=
"更新者"
,
required
=
true
)
@NotNull
private
Integer
updatedBy
;
}
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/request/dicttype/DictTypeDeleteRequest.java
0 → 100644
View file @
e888773
package
cn
.
com
.
glsx
.
merchants
.
request
.
dicttype
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/7/13 10:49
*/
@Data
public
class
DictTypeDeleteRequest
extends
AbstractRopRequest
{
/**
* 字典主键
*/
@ApiModelProperty
(
notes
=
"字典主键"
,
required
=
true
)
@NotNull
private
Long
id
;
}
src/main/java/cn/com/glsx/merchants/request/dicttype/DictTypeListSearchRequest.java
0 → 100644
View file @
e888773
package
cn
.
com
.
glsx
.
merchants
.
request
.
dicttype
;
/**
* @author zhouhaibao
* @date 2021/7/12
*/
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/7/12 13:45
*/
@Data
public
class
DictTypeListSearchRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
notes
=
"分页数"
)
private
Integer
pageSize
;
@ApiModelProperty
(
notes
=
"当前页"
)
private
Integer
pageNumer
;
/**
* 功能名称
*/
@ApiModelProperty
(
notes
=
"功能名称"
)
private
String
functionName
;
}
src/main/java/cn/com/glsx/merchants/request/dicttype/DictTypeSaveRequest.java
0 → 100644
View file @
e888773
package
cn
.
com
.
glsx
.
merchants
.
request
.
dicttype
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/7/13 10:32
*/
@Data
public
class
DictTypeSaveRequest
extends
AbstractRopRequest
{
/**
* 字典名称
*/
@ApiModelProperty
(
notes
=
"字典名称"
,
required
=
true
)
@NotNull
private
String
dictName
;
/**
* 字典类型
*/
@ApiModelProperty
(
notes
=
"字典类型"
,
required
=
true
)
@NotNull
private
String
dictType
;
/**
* 备注
*/
@ApiModelProperty
(
notes
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
notes
=
"是否启用"
,
required
=
true
)
@NotNull
private
Integer
enableStatus
;
/**
* 创建者
*/
@ApiModelProperty
(
notes
=
"创建者"
,
required
=
true
)
@NotNull
private
Integer
createdBy
;
}
src/main/java/cn/com/glsx/merchants/request/dicttype/DictTypeUpdateRequest.java
0 → 100644
View file @
e888773
package
cn
.
com
.
glsx
.
merchants
.
request
.
dicttype
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/7/13 10:32
*/
@Data
public
class
DictTypeUpdateRequest
extends
AbstractRopRequest
{
/**
* 字典主键
*/
@ApiModelProperty
(
notes
=
"字典主键"
,
required
=
true
)
@NotNull
private
Long
id
;
/**
* 字典名称
*/
@ApiModelProperty
(
notes
=
"字典名称"
,
required
=
true
)
@NotNull
private
String
dictName
;
/**
* 字典类型
*/
@ApiModelProperty
(
notes
=
"字典类型"
,
required
=
true
)
@NotNull
private
String
dictType
;
/**
* 备注
*/
@ApiModelProperty
(
notes
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
notes
=
"是否启用"
,
required
=
true
)
@NotNull
private
Integer
enableStatus
;
/**
* 更新者
*/
@ApiModelProperty
(
notes
=
"更新者"
,
required
=
true
)
@NotNull
private
Integer
updatedBy
;
}
src/main/java/cn/com/glsx/merchants/request/function/FunctionSaveRequest.java
0 → 100644
View file @
e888773
package
cn
.
com
.
glsx
.
merchants
.
request
.
function
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.util.Date
;
@Data
public
class
FunctionSaveRequest
extends
AbstractRopRequest
implements
Serializable
{
private
Integer
id
;
/**
* 功能名称
*/
@ApiModelProperty
(
notes
=
"功能名称"
,
required
=
true
)
@NotNull
private
String
functionName
;
/**
* 功能属性名称
*/
@ApiModelProperty
(
notes
=
"功能属性名称"
,
required
=
true
)
@NotNull
private
String
functionAttributeName
;
/**
* 1.输入 2.按钮 3.单选
*/
@ApiModelProperty
(
notes
=
"功能类型"
,
required
=
true
)
@NotNull
private
Integer
functionType
;
/**
* 功能值
*/
@ApiModelProperty
(
notes
=
"功能值"
,
required
=
true
)
@NotNull
private
String
functionValue
;
/**
* 所属菜单
*/
@ApiModelProperty
(
notes
=
"所属菜单"
,
required
=
true
)
@NotNull
private
Integer
menuId
;
/**
* 所属客户群 1.账户类型 2.商户层级 3.商户id 4.账户角色
*/
@ApiModelProperty
(
notes
=
"所属客户群"
)
private
Integer
ownedCusgroupType
;
/**
* 所属客户群体值
*/
@ApiModelProperty
(
notes
=
"所属客户群体值"
)
private
String
ownedCusgroupValue
;
/**
* 排序
*/
@ApiModelProperty
(
notes
=
"排序"
,
required
=
true
)
@NotNull
private
Integer
sort
;
/**
* 创建人
*/
@ApiModelProperty
(
notes
=
"创建人"
,
required
=
true
)
@NotNull
private
Integer
createdBy
;
/**
* 更新人
*/
private
Integer
updatedBy
;
}
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/request/function/FunctionUpdateRequest.java
0 → 100644
View file @
e888773
package
cn
.
com
.
glsx
.
merchants
.
request
.
function
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
@Data
public
class
FunctionUpdateRequest
extends
AbstractRopRequest
implements
Serializable
{
@ApiModelProperty
(
notes
=
"功能id"
,
required
=
true
)
@NotNull
private
Integer
id
;
/**
* 功能名称
*/
@ApiModelProperty
(
notes
=
"功能名称"
,
required
=
true
)
@NotNull
private
String
functionName
;
/**
* 功能属性名称
*/
@ApiModelProperty
(
notes
=
"功能属性名称"
,
required
=
true
)
@NotNull
private
String
functionAttributeName
;
/**
* 1.输入 2.按钮 3.单选
*/
@ApiModelProperty
(
notes
=
"功能类型"
,
required
=
true
)
@NotNull
private
Integer
functionType
;
/**
* 功能值
*/
@ApiModelProperty
(
notes
=
"功能值"
,
required
=
true
)
@NotNull
private
String
functionValue
;
/**
* 所属菜单
*/
@ApiModelProperty
(
notes
=
"所属菜单"
,
required
=
true
)
@NotNull
private
Integer
menuId
;
/**
* 所属客户群 1.账户类型 2.商户层级 3.商户id 4.账户角色
*/
@ApiModelProperty
(
notes
=
"所属客户群"
)
private
Integer
ownedCusgroupType
;
/**
* 所属客户群体值
*/
@ApiModelProperty
(
notes
=
"所属客户群体值"
)
private
String
ownedCusgroupValue
;
/**
* 排序
*/
@ApiModelProperty
(
notes
=
"排序"
,
required
=
true
)
@NotNull
private
Integer
sort
;
/**
* 创建人
*/
@ApiModelProperty
(
notes
=
"创建人"
,
required
=
true
)
@NotNull
private
Integer
createdBy
;
/**
* 更新人
*/
@ApiModelProperty
(
notes
=
"更新人"
,
required
=
true
)
@NotNull
private
Integer
updatedBy
;
}
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/response/DictDataResponse.java
0 → 100644
View file @
e888773
package
cn
.
com
.
glsx
.
merchants
.
response
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
@Data
public
class
DictDataResponse
implements
Serializable
{
@ApiModelProperty
(
name
=
"id"
,
notes
=
"字典主键"
,
dataType
=
"Integer"
,
required
=
true
,
example
=
"1"
,
value
=
"字典主键"
)
private
Long
id
;
/**
* 字典排序
*/
@ApiModelProperty
(
name
=
"dictSort"
,
notes
=
"字典排序"
,
dataType
=
"Integer"
,
required
=
true
,
example
=
"1"
,
value
=
"字典主键"
)
private
Integer
dictSort
;
/**
* 字典标签
*/
@ApiModelProperty
(
name
=
"dictLabel"
,
notes
=
"字典标签"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
,
value
=
"字典主键"
)
private
String
dictLabel
;
/**
* 字典键值
*/
@ApiModelProperty
(
name
=
"dictValue"
,
notes
=
"字典键值"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
,
value
=
"字典主键"
)
private
String
dictValue
;
/**
* 字典类型
*/
@ApiModelProperty
(
name
=
"dictType"
,
notes
=
"字典类型"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
,
value
=
"字典主键"
)
private
String
dictType
;
@ApiModelProperty
(
name
=
"enableStatus"
,
notes
=
"是否启用"
,
dataType
=
"Integer"
,
required
=
true
,
example
=
"1"
,
value
=
"字典主键"
)
private
Integer
enableStatus
;
/**
* 备注
*/
@ApiModelProperty
(
name
=
"remark"
,
notes
=
"备注"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
,
value
=
"字典主键"
)
private
String
remark
;
@ApiModelProperty
(
name
=
"createdDate"
,
notes
=
"创建时间"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
,
value
=
"字典主键"
)
private
Date
createdDate
;
}
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/response/DictTypeResponse.java
0 → 100644
View file @
e888773
package
cn
.
com
.
glsx
.
merchants
.
response
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
@Data
public
class
DictTypeResponse
implements
Serializable
{
/**
* 字典主键
*/
@ApiModelProperty
(
name
=
"id"
,
notes
=
"字典主键"
,
dataType
=
"Integer"
,
required
=
true
,
example
=
"1"
,
value
=
"字典主键"
)
private
Long
id
;
/**
* 字典名称
*/
@ApiModelProperty
(
name
=
"dictName"
,
notes
=
"字典名称"
,
dataType
=
"String"
,
required
=
true
,
example
=
"assas"
,
value
=
"字典名称"
)
private
String
dictName
;
/**
* 字典类型
*/
@ApiModelProperty
(
name
=
"dictType"
,
notes
=
"字典类型"
,
dataType
=
"Integer"
,
required
=
true
,
example
=
"assas"
,
value
=
"字典类型"
)
private
String
dictType
;
/**
* 备注
*/
@ApiModelProperty
(
name
=
"remark"
,
notes
=
"备注"
,
dataType
=
"String"
,
required
=
true
,
example
=
"assas"
,
value
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
name
=
"enableStatus"
,
notes
=
"是否启用"
,
dataType
=
"Integer"
,
required
=
true
,
example
=
"assas"
,
value
=
"字典类型"
)
private
Integer
enableStatus
;
@ApiModelProperty
(
name
=
"createdDate"
,
notes
=
"创建时间"
,
dataType
=
"Date"
,
required
=
true
,
example
=
"assas"
,
value
=
"创建时间"
)
private
Date
createdDate
;
}
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/service/MerchantDictDataService.java
0 → 100644
View file @
e888773
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.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConverRequest
;
import
cn.com.glsx.merchants.convert.ConverResponse
;
import
cn.com.glsx.merchants.model.request.MerchantDictDataRequest
;
import
cn.com.glsx.merchants.model.response.MerchantDictDataResponse
;
import
cn.com.glsx.merchants.remote.MerchantDictDataRemote
;
import
cn.com.glsx.merchants.request.dictdata.*
;
import
cn.com.glsx.merchants.response.DictDataResponse
;
import
cn.com.glsx.merchants.util.Pagination
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/7/13 11:02
*/
@Service
@Slf4j
public
class
MerchantDictDataService
{
@Autowired
private
MerchantDictDataRemote
merchantDictDataRemote
;
public
void
saveDictData
(
DictDataSaveRequest
DictDataSaveRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictDataRemote
.
saveMerchantDictDataRemote
(
ConverRequest
.
converRequest
(
DictDataSaveRequest
,
new
MerchantDictDataRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
public
void
updateDictData
(
DictDataUpdateRequest
DictDataUpdateRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictDataRemote
.
updateMerchantDictDataRemote
(
ConverRequest
.
converRequest
(
DictDataUpdateRequest
,
new
MerchantDictDataRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
public
Pagination
<
DictDataResponse
>
findDictData
(
DictDataListSearchRequest
DictDataListSearchRequest
)
{
RpcResponse
<
RpcPagination
<
MerchantDictDataResponse
>>
merProductByPageRemote
=
merchantDictDataRemote
.
findMerchantDictDataRemote
(
ConverRequest
.
converPage
(
DictDataListSearchRequest
,
new
MerchantDictDataRequest
()));
if
(
merProductByPageRemote
.
isSuccess
())
{
return
ConverResponse
.
converPage
(
merProductByPageRemote
.
getResult
(),
DictDataResponse
.
class
);
}
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
}
public
void
deleteDictData
(
DictDataDeleteRequest
DictDataDeleteRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictDataRemote
.
deleteMerchantDictDataRemote
(
ConverRequest
.
converRequest
(
DictDataDeleteRequest
,
new
MerchantDictDataRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
public
List
<
DictDataResponse
>
findAllDictData
(
DictDataSearchRequest
dictDataSearchRequest
)
{
RpcResponse
<
List
<
MerchantDictDataResponse
>>
merProductByPageRemote
=
merchantDictDataRemote
.
findAllRemote
(
ConverRequest
.
converRequest
(
dictDataSearchRequest
,
new
MerchantDictDataRequest
()));
if
(
merProductByPageRemote
.
isSuccess
())
{
return
ConverResponse
.
convertList
(
merProductByPageRemote
.
getResult
(),
DictDataResponse
.
class
);
}
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
}
}
src/main/java/cn/com/glsx/merchants/service/MerchantDictTypeService.java
0 → 100644
View file @
e888773
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.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConverRequest
;
import
cn.com.glsx.merchants.convert.ConverResponse
;
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.remote.MerchantDictTypeRemote
;
import
cn.com.glsx.merchants.request.dicttype.DictTypeDeleteRequest
;
import
cn.com.glsx.merchants.request.dicttype.DictTypeListSearchRequest
;
import
cn.com.glsx.merchants.request.dicttype.DictTypeSaveRequest
;
import
cn.com.glsx.merchants.request.dicttype.DictTypeUpdateRequest
;
import
cn.com.glsx.merchants.response.DictTypeResponse
;
import
cn.com.glsx.merchants.util.Pagination
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* @author zhouhaibao
* @version 1.0
* @description: 字典类型服务类
* @date 2021/7/13 10:35
*/
@Service
@Slf4j
public
class
MerchantDictTypeService
{
@Autowired
private
MerchantDictTypeRemote
merchantDictTypeRemote
;
public
void
saveDictType
(
DictTypeSaveRequest
dictTypeSaveRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictTypeRemote
.
saveMerchantDictTypeRemote
(
ConverRequest
.
converRequest
(
dictTypeSaveRequest
,
new
MerchantDictTypeRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
public
void
updateDictType
(
DictTypeUpdateRequest
dictTypeUpdateRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictTypeRemote
.
updateMerchantDictTypeRemote
(
ConverRequest
.
converRequest
(
dictTypeUpdateRequest
,
new
MerchantDictTypeRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
public
Pagination
<
DictTypeResponse
>
findDictType
(
DictTypeListSearchRequest
dictTypeListSearchRequest
)
{
RpcResponse
<
RpcPagination
<
MerchantDictTypeResponse
>>
merProductByPageRemote
=
merchantDictTypeRemote
.
findMerchantDictTypeRemote
(
ConverRequest
.
converPage
(
dictTypeListSearchRequest
,
new
MerchantDictTypeRequest
()));
if
(
merProductByPageRemote
.
isSuccess
())
{
return
ConverResponse
.
converPage
(
merProductByPageRemote
.
getResult
(),
DictTypeResponse
.
class
);
}
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
}
public
void
deleteDictType
(
DictTypeDeleteRequest
dictTypeDeleteRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantDictTypeRemote
.
deleteMerchantDictTypeRemote
(
ConverRequest
.
converRequest
(
dictTypeDeleteRequest
,
new
MerchantDictTypeRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
src/main/java/cn/com/glsx/merchants/service/MerchantFunctionService.java
View file @
e888773
...
...
@@ -3,7 +3,21 @@ package cn.com.glsx.merchants.service;/**
* @date 2021/7/12
*/
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConverRequest
;
import
cn.com.glsx.merchants.convert.ConverResponse
;
import
cn.com.glsx.merchants.model.request.MerchantProductFunctionRequest
;
import
cn.com.glsx.merchants.model.response.MerchantProductFunctionResponse
;
import
cn.com.glsx.merchants.remote.MerchantProductFunctionRemote
;
import
cn.com.glsx.merchants.request.function.FunctionListSearchRequest
;
import
cn.com.glsx.merchants.request.function.FunctionSaveRequest
;
import
cn.com.glsx.merchants.request.function.FunctionUpdateRequest
;
import
cn.com.glsx.merchants.response.FunctionResponse
;
import
cn.com.glsx.merchants.util.Pagination
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
...
...
@@ -16,5 +30,28 @@ import org.springframework.stereotype.Service;
@Slf4j
public
class
MerchantFunctionService
{
@Autowired
private
MerchantProductFunctionRemote
merchantProductFunctionRemote
;
public
void
saveMerchantFunction
(
FunctionSaveRequest
functionSaveRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductFunctionRemote
.
saveMerchantProductFunctionRemote
(
ConverRequest
.
converRequest
(
functionSaveRequest
,
new
MerchantProductFunctionRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
public
void
updateMerchantFunction
(
FunctionUpdateRequest
functionUpdateRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductFunctionRemote
.
updateMerchantProductFunctionRemote
(
ConverRequest
.
converRequest
(
functionUpdateRequest
,
new
MerchantProductFunctionRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
public
Pagination
<
FunctionResponse
>
findMerchantFunction
(
FunctionListSearchRequest
functionListSearchRequest
)
{
RpcResponse
<
RpcPagination
<
MerchantProductFunctionResponse
>>
merProductByPageRemote
=
merchantProductFunctionRemote
.
findMerProFunctionByPageRemote
(
ConverRequest
.
converPage
(
functionListSearchRequest
,
new
MerchantProductFunctionRequest
()));
if
(
merProductByPageRemote
.
isSuccess
())
{
return
ConverResponse
.
converPage
(
merProductByPageRemote
.
getResult
(),
FunctionResponse
.
class
);
}
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
}
}
src/main/java/cn/com/glsx/merchants/service/MerchantMenuService.java
View file @
e888773
...
...
@@ -42,13 +42,13 @@ public class MerchantMenuService {
List
<
MenuResponse
>
menuResponseList
=
ConverResponse
.
convertList
(
merProMenuTreeRemote
.
getResult
(),
MenuResponse
.
class
);
return
menuResponseList
;
}
throw
new
RpcServiceException
(
merProMenuTreeRemote
.
getException
().
getErr
or
());
throw
new
RpcServiceException
(
merProMenuTreeRemote
.
getException
().
getErr
Id
(),
merProMenuTreeRemote
.
getMessage
());
}
public
void
saveMerchantProductMenuRemote
(
MenuSaveRequest
menuSaveRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductMenuRemote
.
saveMerchantProductMenuRemote
(
ConverRequest
.
converRequest
(
menuSaveRequest
,
new
MerchantProductMenuRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErr
or
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErr
Id
(),
booleanRpcResponse
.
getMessage
());
}
}
...
...
@@ -57,13 +57,13 @@ public class MerchantMenuService {
if
(
merProductByPageRemote
.
isSuccess
())
{
return
ConverResponse
.
converPage
(
merProductByPageRemote
.
getResult
(),
MenuResponse
.
class
);
}
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErr
or
());
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErr
Id
(),
merProductByPageRemote
.
getMessage
());
}
public
void
updateMerchantProductMenuRemote
(
MenuUpdateRequest
menuUpdateRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductMenuRemote
.
updateMerchantProductMenuRemote
(
ConverRequest
.
converRequest
(
menuUpdateRequest
,
new
MerchantProductMenuRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErr
or
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErr
Id
(),
booleanRpcResponse
.
getMessage
());
}
}
}
src/main/java/cn/com/glsx/merchants/service/MerchantProductService.java
View file @
e888773
...
...
@@ -39,13 +39,13 @@ public class MerchantProductService {
List
<
ProductResponse
>
productResponses
=
ConverResponse
.
convertList
(
merProductListRemote
.
getResult
(),
ProductResponse
.
class
);
return
productResponses
;
}
throw
new
RpcServiceException
(
merProductListRemote
.
getException
().
getErr
or
());
throw
new
RpcServiceException
(
merProductListRemote
.
getException
().
getErr
Id
(),
merProductListRemote
.
getMessage
());
}
public
void
saveProduct
(
ProductSaveRequest
productSearchRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductRemote
.
saveMerchantProductRemote
(
ConverRequest
.
converRequest
(
productSearchRequest
,
new
MerchantProductRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErr
or
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErr
Id
(),
booleanRpcResponse
.
getMessage
());
}
}
...
...
@@ -54,13 +54,13 @@ public class MerchantProductService {
if
(
merProductByPageRemote
.
isSuccess
())
{
return
ConverResponse
.
converPage
(
merProductByPageRemote
.
getResult
(),
ProductResponse
.
class
);
}
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErr
or
());
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErr
Id
(),
merProductByPageRemote
.
getMessage
());
}
public
void
updateProduct
(
ProductUpdateRequest
productUpdateRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductRemote
.
updateProductRemote
(
ConverRequest
.
converRequest
(
productUpdateRequest
,
new
MerchantProductRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErr
or
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErr
Id
(),
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