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 a358f739
authored
Jul 29, 2021
by
licy
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
菜单和功能的删除功能
1 parent
a5ffa895
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
113 additions
and
23 deletions
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/request/function/FunctionDeleteRequest.java
src/main/java/cn/com/glsx/merchants/request/menu/MenuDeleteRequest.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/controller/MerchantFunctionController.java
View file @
a358f73
...
@@ -2,6 +2,7 @@ package cn.com.glsx.merchants.controller;
...
@@ -2,6 +2,7 @@ package cn.com.glsx.merchants.controller;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
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.function.FunctionDeleteRequest
;
import
cn.com.glsx.merchants.request.function.FunctionListSearchRequest
;
import
cn.com.glsx.merchants.request.function.FunctionListSearchRequest
;
import
cn.com.glsx.merchants.request.function.FunctionSaveRequest
;
import
cn.com.glsx.merchants.request.function.FunctionSaveRequest
;
import
cn.com.glsx.merchants.request.function.FunctionUpdateRequest
;
import
cn.com.glsx.merchants.request.function.FunctionUpdateRequest
;
...
@@ -84,4 +85,22 @@ public class MerchantFunctionController {
...
@@ -84,4 +85,22 @@ public class MerchantFunctionController {
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
}
/**
* 删除功能信息
*
* @param functionDeleteRequest
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.deleteMerchantFunction"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"删除功能信息"
)
public
RopResponse
<
Boolean
>
deleteMerchantFunction
(
FunctionDeleteRequest
functionDeleteRequest
)
{
try
{
merchantFunctionService
.
deleteMerchantFunction
(
functionDeleteRequest
);
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__deleteMerchantFunction__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
}
src/main/java/cn/com/glsx/merchants/controller/MerchantMenuController.java
View file @
a358f73
...
@@ -2,10 +2,7 @@ package cn.com.glsx.merchants.controller;
...
@@ -2,10 +2,7 @@ package cn.com.glsx.merchants.controller;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
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.menu.MenuListSearchRequest
;
import
cn.com.glsx.merchants.request.menu.*
;
import
cn.com.glsx.merchants.request.menu.MenuSaveRequest
;
import
cn.com.glsx.merchants.request.menu.MenuSearchRequest
;
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.service.MerchantMenuService
;
import
cn.com.glsx.merchants.service.MerchantMenuService
;
import
cn.com.glsx.merchants.util.Pagination
;
import
cn.com.glsx.merchants.util.Pagination
;
...
@@ -40,14 +37,14 @@ public class MerchantMenuController {
...
@@ -40,14 +37,14 @@ public class MerchantMenuController {
* @param menuSearchRequest 入参
* @param menuSearchRequest 入参
* @return 菜单树结构
* @return 菜单树结构
*/
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.findMerProMenuTree
Remote
"
,
needInSession
=
NeedInSessionType
.
NO
)
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.findMerProMenuTree"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"查询菜单树"
)
@ApiOperation
(
"查询菜单树"
)
public
RopResponse
<
List
<
MenuResponse
>>
findMerProMenuTree
Remote
(
MenuSearchRequest
menuSearchRequest
)
{
public
RopResponse
<
List
<
MenuResponse
>>
findMerProMenuTree
(
MenuSearchRequest
menuSearchRequest
)
{
try
{
try
{
List
<
MenuResponse
>
menuResponseList
=
merchantMenuService
.
findMerProMenuTreeRemote
(
menuSearchRequest
);
List
<
MenuResponse
>
menuResponseList
=
merchantMenuService
.
findMerProMenuTreeRemote
(
menuSearchRequest
);
return
RopResponse
.
success
(
menuResponseList
);
return
RopResponse
.
success
(
menuResponseList
);
}
catch
(
RpcServiceException
e
)
{
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__findMerProMenuTree
Remote
__exception:{}"
,
e
.
getMessage
());
log
.
info
(
"=======MerchantMenuController__invoke__findMerProMenuTree__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
}
...
@@ -58,14 +55,14 @@ public class MerchantMenuController {
...
@@ -58,14 +55,14 @@ public class MerchantMenuController {
* @param menuSaveRequest 入参
* @param menuSaveRequest 入参
* @return
* @return
*/
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.saveMerchantProductMenu
Remote
"
,
needInSession
=
NeedInSessionType
.
NO
)
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.saveMerchantProductMenu"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"保存菜单"
)
@ApiOperation
(
"保存菜单"
)
public
RopResponse
<
Boolean
>
saveMerchantProductMenu
Remote
(
MenuSaveRequest
menuSaveRequest
)
{
public
RopResponse
<
Boolean
>
saveMerchantProductMenu
(
MenuSaveRequest
menuSaveRequest
)
{
try
{
try
{
merchantMenuService
.
saveMerchantProductMenuRemote
(
menuSaveRequest
);
merchantMenuService
.
saveMerchantProductMenuRemote
(
menuSaveRequest
);
return
RopResponse
.
success
(
true
);
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__saveMerchantProductMenu
Remote
__exception:{}"
,
e
.
getMessage
());
log
.
info
(
"=======MerchantMenuController__invoke__saveMerchantProductMenu__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
}
...
@@ -76,14 +73,14 @@ public class MerchantMenuController {
...
@@ -76,14 +73,14 @@ public class MerchantMenuController {
* @param menuListSearchRequest 入参
* @param menuListSearchRequest 入参
* @return
* @return
*/
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.findMerProMenuByPage
Remote
"
,
needInSession
=
NeedInSessionType
.
NO
)
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.findMerProMenuByPage"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"查询菜单列表"
)
@ApiOperation
(
"查询菜单列表"
)
public
RopResponse
<
Pagination
<
MenuResponse
>>
findMerProMenuByPage
Remote
(
MenuListSearchRequest
menuListSearchRequest
)
{
public
RopResponse
<
Pagination
<
MenuResponse
>>
findMerProMenuByPage
(
MenuListSearchRequest
menuListSearchRequest
)
{
try
{
try
{
Pagination
<
MenuResponse
>
list
=
merchantMenuService
.
findMerProMenuByPageRemote
(
menuListSearchRequest
);
Pagination
<
MenuResponse
>
list
=
merchantMenuService
.
findMerProMenuByPageRemote
(
menuListSearchRequest
);
return
RopResponse
.
success
(
list
);
return
RopResponse
.
success
(
list
);
}
catch
(
RpcServiceException
e
)
{
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__findMerProMenuByPage
Remote
__exception:{}"
,
e
.
getMessage
());
log
.
info
(
"=======MerchantMenuController__invoke__findMerProMenuByPage__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
}
...
@@ -94,14 +91,32 @@ public class MerchantMenuController {
...
@@ -94,14 +91,32 @@ public class MerchantMenuController {
* @param menuUpdateRequest 入参
* @param menuUpdateRequest 入参
* @return
* @return
*/
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.updateMerchantProductMenu
Remote
"
,
needInSession
=
NeedInSessionType
.
NO
)
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.updateMerchantProductMenu"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"更新菜单"
)
@ApiOperation
(
"更新菜单"
)
public
RopResponse
<
Boolean
>
updateMerchantProductMenu
Remote
(
MenuUpdateRequest
menuUpdateRequest
)
{
public
RopResponse
<
Boolean
>
updateMerchantProductMenu
(
MenuUpdateRequest
menuUpdateRequest
)
{
try
{
try
{
merchantMenuService
.
updateMerchantProductMenuRemote
(
menuUpdateRequest
);
merchantMenuService
.
updateMerchantProductMenuRemote
(
menuUpdateRequest
);
return
RopResponse
.
success
(
true
);
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__updateMerchantProductMenuRemote__exception:{}"
,
e
.
getMessage
());
log
.
info
(
"=======MerchantMenuController__invoke__updateMerchantProductMenu__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 删除菜单
*
* @param menuDeleteRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.deleteMerchantProductMenu"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"删除菜单"
)
public
RopResponse
<
Boolean
>
deleteMerchantProductMenu
(
MenuDeleteRequest
menuDeleteRequest
)
{
try
{
merchantMenuService
.
deleteMerchantProductMenuRemote
(
menuDeleteRequest
);
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__deleteMerchantProductMenu__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
}
...
...
src/main/java/cn/com/glsx/merchants/request/function/FunctionDeleteRequest.java
0 → 100644
View file @
a358f73
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
;
/**
* @author Lichongyuan
* @Description: 功能删除入参
* @date 2021/7/29 16:56
*/
@Data
public
class
FunctionDeleteRequest
extends
AbstractRopRequest
implements
Serializable
{
@ApiModelProperty
(
notes
=
"id"
,
required
=
true
)
@NotNull
private
Integer
id
;
}
src/main/java/cn/com/glsx/merchants/request/menu/MenuDeleteRequest.java
0 → 100644
View file @
a358f73
package
cn
.
com
.
glsx
.
merchants
.
request
.
menu
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
/**
* @author Lichongyuan
* @Description: 菜单删除入参
* @date 2021/7/29 15:47
*/
@Data
public
class
MenuDeleteRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
notes
=
"id"
,
required
=
true
)
@NotNull
private
Integer
id
;
}
src/main/java/cn/com/glsx/merchants/service/MerchantFunctionService.java
View file @
a358f73
...
@@ -11,6 +11,7 @@ import cn.com.glsx.merchants.convert.ConvertResponse;
...
@@ -11,6 +11,7 @@ import cn.com.glsx.merchants.convert.ConvertResponse;
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
;
import
cn.com.glsx.merchants.request.function.FunctionDeleteRequest
;
import
cn.com.glsx.merchants.request.function.FunctionListSearchRequest
;
import
cn.com.glsx.merchants.request.function.FunctionListSearchRequest
;
import
cn.com.glsx.merchants.request.function.FunctionSaveRequest
;
import
cn.com.glsx.merchants.request.function.FunctionSaveRequest
;
import
cn.com.glsx.merchants.request.function.FunctionUpdateRequest
;
import
cn.com.glsx.merchants.request.function.FunctionUpdateRequest
;
...
@@ -39,7 +40,7 @@ public class MerchantFunctionService {
...
@@ -39,7 +40,7 @@ public class MerchantFunctionService {
public
void
saveMerchantFunction
(
FunctionSaveRequest
functionSaveRequest
)
{
public
void
saveMerchantFunction
(
FunctionSaveRequest
functionSaveRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductFunctionRemote
.
saveMerchantProductFunctionRemote
(
ConvertRequest
.
convertRequest
(
functionSaveRequest
,
new
MerchantProductFunctionRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductFunctionRemote
.
saveMerchantProductFunctionRemote
(
ConvertRequest
.
convertRequest
(
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
());
}
}
}
}
...
@@ -47,7 +48,7 @@ public class MerchantFunctionService {
...
@@ -47,7 +48,7 @@ public class MerchantFunctionService {
public
void
updateMerchantFunction
(
FunctionUpdateRequest
functionUpdateRequest
)
{
public
void
updateMerchantFunction
(
FunctionUpdateRequest
functionUpdateRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductFunctionRemote
.
updateMerchantProductFunctionRemote
(
ConvertRequest
.
convertRequest
(
functionUpdateRequest
,
new
MerchantProductFunctionRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductFunctionRemote
.
updateMerchantProductFunctionRemote
(
ConvertRequest
.
convertRequest
(
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
());
}
}
}
}
...
@@ -56,6 +57,13 @@ public class MerchantFunctionService {
...
@@ -56,6 +57,13 @@ public class MerchantFunctionService {
if
(
merProductByPageRemote
.
isSuccess
())
{
if
(
merProductByPageRemote
.
isSuccess
())
{
return
ConvertResponse
.
convertPage
(
merProductByPageRemote
.
getResult
(),
FunctionResponse
.
class
);
return
ConvertResponse
.
convertPage
(
merProductByPageRemote
.
getResult
(),
FunctionResponse
.
class
);
}
}
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
throw
new
RpcServiceException
(
merProductByPageRemote
.
getException
().
getErrId
(),
merProductByPageRemote
.
getMessage
());
}
public
void
deleteMerchantFunction
(
FunctionDeleteRequest
functionDeleteRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductFunctionRemote
.
deleteMerchantProductFunctionRemote
(
ConvertRequest
.
convertRequest
(
functionDeleteRequest
,
new
MerchantProductFunctionRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
}
src/main/java/cn/com/glsx/merchants/service/MerchantMenuService.java
View file @
a358f73
...
@@ -8,10 +8,7 @@ import cn.com.glsx.merchants.convert.ConvertResponse;
...
@@ -8,10 +8,7 @@ import cn.com.glsx.merchants.convert.ConvertResponse;
import
cn.com.glsx.merchants.model.request.MerchantProductMenuRequest
;
import
cn.com.glsx.merchants.model.request.MerchantProductMenuRequest
;
import
cn.com.glsx.merchants.model.response.MerchantProductMenuResponse
;
import
cn.com.glsx.merchants.model.response.MerchantProductMenuResponse
;
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.*
;
import
cn.com.glsx.merchants.request.menu.MenuSaveRequest
;
import
cn.com.glsx.merchants.request.menu.MenuSearchRequest
;
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.util.Pagination
;
import
cn.com.glsx.merchants.util.Pagination
;
import
com.glsx.plat.common.annotation.SysLog
;
import
com.glsx.plat.common.annotation.SysLog
;
...
@@ -67,4 +64,12 @@ public class MerchantMenuService {
...
@@ -67,4 +64,12 @@ public class MerchantMenuService {
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
@SysLog
(
value
=
"删除菜单"
,
action
=
OperateType
.
DELETE
,
module
=
"菜单模块"
)
public
void
deleteMerchantProductMenuRemote
(
MenuDeleteRequest
menuDeleteRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantProductMenuRemote
.
deleteMerchantProductMenuRemote
(
ConvertRequest
.
convertRequest
(
menuDeleteRequest
,
new
MerchantProductMenuRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
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