Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
chnmuseum-party
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liqin
chnmuseum-party
Commits
4459faea
Commit
4459faea
authored
4 years ago
by
liqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
c5d03e45
master
1.0
dev
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
17 deletions
+20
-17
CopyrightOwnerController.java
...museum/party/web/controller/CopyrightOwnerController.java
+20
-17
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/CopyrightOwnerController.java
View file @
4459faea
...
@@ -5,7 +5,10 @@ import cn.wisenergy.chnmuseum.party.common.util.TimeUtils;
...
@@ -5,7 +5,10 @@ import cn.wisenergy.chnmuseum.party.common.util.TimeUtils;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.model.*
;
import
cn.wisenergy.chnmuseum.party.model.AssetType
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwner
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwnerAssetType
;
import
cn.wisenergy.chnmuseum.party.model.ExhibitionBoard
;
import
cn.wisenergy.chnmuseum.party.service.*
;
import
cn.wisenergy.chnmuseum.party.service.*
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
@@ -123,23 +126,8 @@ public class CopyrightOwnerController extends BaseController {
...
@@ -123,23 +126,8 @@ public class CopyrightOwnerController extends BaseController {
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
paramType
=
"path"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
paramType
=
"path"
,
dataType
=
"String"
)
})
})
public
Map
<
String
,
Object
>
deleteCopyrightOwner
(
@PathVariable
(
"id"
)
String
id
)
{
public
Map
<
String
,
Object
>
deleteCopyrightOwner
(
@PathVariable
(
"id"
)
String
id
)
{
LambdaUpdateWrapper
<
Asset
>
updateWrapper
=
Wrappers
.<
Asset
>
lambdaUpdate
().
eq
(
Asset:
:
getAssetCopyrightOwnerId
,
id
);
updateWrapper
.
set
(
Asset:
:
getAssetCopyrightOwnerId
,
null
);
boolean
result1
=
this
.
assetService
.
update
(
updateWrapper
);
LambdaUpdateWrapper
<
ExhibitionBoard
>
updateWrapper1
=
Wrappers
.<
ExhibitionBoard
>
lambdaUpdate
().
eq
(
ExhibitionBoard:
:
getBoardCopyrightOwnerId
,
id
);
updateWrapper1
.
set
(
ExhibitionBoard:
:
getBoardCopyrightOwnerId
,
null
);
boolean
result2
=
this
.
exhibitionBoardService
.
update
(
updateWrapper1
);
LambdaUpdateWrapper
<
CopyrightOwnerAssetType
>
updateWrapper2
=
Wrappers
.<
CopyrightOwnerAssetType
>
lambdaUpdate
().
eq
(
CopyrightOwnerAssetType:
:
getCopyrightOwnerId
,
id
);
boolean
result3
=
this
.
copyrightOwnerAssetTypeService
.
remove
(
updateWrapper2
);
boolean
result
=
this
.
copyrightOwnerService
.
removeById
(
id
);
if
(
result
&&
result1
&&
result2
&&
result3
)
{
return
getSuccessResult
();
return
getSuccessResult
();
}
}
return
getFailResult
();
}
@ApiImplicitParams
(
value
=
{
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"copyrightOwnerType"
,
value
=
"版权方类型"
,
paramType
=
"query"
,
dataType
=
"String"
,
required
=
true
)
@ApiImplicitParam
(
name
=
"copyrightOwnerType"
,
value
=
"版权方类型"
,
paramType
=
"query"
,
dataType
=
"String"
,
required
=
true
)
...
@@ -221,6 +209,21 @@ public class CopyrightOwnerController extends BaseController {
...
@@ -221,6 +209,21 @@ public class CopyrightOwnerController extends BaseController {
@RequiresPermissions
(
"copyright:owner:get:id"
)
@RequiresPermissions
(
"copyright:owner:get:id"
)
public
Map
<
String
,
Object
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
public
Map
<
String
,
Object
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
CopyrightOwner
copyrightOwner
=
copyrightOwnerService
.
getById
(
id
);
CopyrightOwner
copyrightOwner
=
copyrightOwnerService
.
getById
(
id
);
String
ownerType
=
copyrightOwner
.
getOwnerType
();
if
(
CopyrightOwnerTypeEnum
.
ASSET
.
name
.
equals
(
ownerType
))
{
LambdaQueryWrapper
<
CopyrightOwnerAssetType
>
lambdaQueryWrapper
=
Wrappers
.<
CopyrightOwnerAssetType
>
lambdaQuery
().
eq
(
CopyrightOwnerAssetType:
:
getCopyrightOwnerId
,
id
);
List
<
CopyrightOwnerAssetType
>
copyrightOwnerAssetTypeList
=
this
.
copyrightOwnerAssetTypeService
.
list
(
lambdaQueryWrapper
);
if
(!
copyrightOwnerAssetTypeList
.
isEmpty
())
{
List
<
String
>
assetTypeIdArrayList
=
copyrightOwnerAssetTypeList
.
stream
().
map
(
CopyrightOwnerAssetType:
:
getAssetTypeId
).
distinct
().
collect
(
Collectors
.
toList
());
copyrightOwner
.
setAssetTypeIdList
(
assetTypeIdArrayList
);
final
List
<
AssetType
>
assetTypeList
=
this
.
assetTypeService
.
listByIds
(
assetTypeIdArrayList
);
if
(!
assetTypeList
.
isEmpty
())
{
final
List
<
String
>
assetTypeNameList
=
assetTypeList
.
stream
().
map
(
AssetType:
:
getName
).
collect
(
Collectors
.
toList
());
copyrightOwner
.
setAssetTypeNameList
(
assetTypeNameList
);
}
}
}
return
getResult
(
copyrightOwner
);
return
getResult
(
copyrightOwner
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment