Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
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
徐少华
midjourney-proxy
Commits
f20048be
Commit
f20048be
authored
Aug 19, 2019
by
阮思源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加批量操作
parent
5d618de9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
15 deletions
+70
-15
AdvertisingSpaceBizImpl.java
...ud/book/advertising/biz/impl/AdvertisingSpaceBizImpl.java
+28
-13
BookAndChannelDTO.java
...va/com/pcloud/book/advertising/dto/BookAndChannelDTO.java
+23
-1
AdvertisingAdviserPermission.java
...book/advertising/entity/AdvertisingAdviserPermission.java
+19
-1
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/advertising/biz/impl/AdvertisingSpaceBizImpl.java
View file @
f20048be
...
...
@@ -874,20 +874,35 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
advertisingAdviserPermissionDao
.
update
(
adviserPermission
);
}
}
else
{
// 删除编辑所有数据
advertisingAdviserPermissionDao
.
deleteByAdviserId
(
adviserPermission
.
getAdviserId
());
List
<
BookDto
>
bookList
=
bookDao
.
listBookIdAndChannelId4Adviser
(
paramMap
);
if
(!
ListUtils
.
isEmpty
(
bookList
))
{
List
<
AdvertisingAdviserPermission
>
list
=
new
ArrayList
<>();
for
(
BookDto
bookDto
:
bookList
)
{
AdvertisingAdviserPermission
permission
=
new
AdvertisingAdviserPermission
();
permission
.
setAdviserId
(
adviserPermission
.
getAdviserId
());
permission
.
setIsOpen
(
adviserPermission
.
getIsOpen
());
permission
.
setBookId
(
bookDto
.
getBookId
());
permission
.
setChannelId
(
bookDto
.
getChannelId
());
list
.
add
(
permission
);
if
(!
ListUtils
.
isEmpty
(
adviserPermission
.
getBookAndChannelDTOS
()))
{
//一个一个更新
for
(
BookAndChannelDTO
bookAndChannelDTO
:
adviserPermission
.
getBookAndChannelDTOS
())
{
if
(
bookAndChannelDTO
!=
null
&&
bookAndChannelDTO
.
getBookId
()
!=
null
&&
bookAndChannelDTO
.
getChannelId
()
!=
null
)
{
paramMap
.
put
(
"bookId"
,
bookAndChannelDTO
.
getBookId
());
paramMap
.
put
(
"channelId"
,
bookAndChannelDTO
.
getChannelId
());
AdvertisingAdviserPermission
permission
=
(
AdvertisingAdviserPermission
)
advertisingAdviserPermissionDao
.
getBy
(
paramMap
,
"getByAdviserId"
);
if
(
null
!=
permission
)
{
adviserPermission
.
setId
(
permission
.
getId
());
advertisingAdviserPermissionDao
.
update
(
adviserPermission
);
}
}
}
}
else
{
// 删除编辑所有数据
advertisingAdviserPermissionDao
.
deleteByAdviserId
(
adviserPermission
.
getAdviserId
());
List
<
BookDto
>
bookList
=
bookDao
.
listBookIdAndChannelId4Adviser
(
paramMap
);
if
(!
ListUtils
.
isEmpty
(
bookList
))
{
List
<
AdvertisingAdviserPermission
>
list
=
new
ArrayList
<>();
for
(
BookDto
bookDto
:
bookList
)
{
AdvertisingAdviserPermission
permission
=
new
AdvertisingAdviserPermission
();
permission
.
setAdviserId
(
adviserPermission
.
getAdviserId
());
permission
.
setIsOpen
(
adviserPermission
.
getIsOpen
());
permission
.
setBookId
(
bookDto
.
getBookId
());
permission
.
setChannelId
(
bookDto
.
getChannelId
());
list
.
add
(
permission
);
}
advertisingAdviserPermissionDao
.
batchInsert
(
list
);
}
advertisingAdviserPermissionDao
.
batchInsert
(
list
);
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dto/BookAndChannelDTO.java
View file @
f20048be
package
com
.
pcloud
.
book
.
advertising
.
dto
;
import
java.io.Serializable
;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/8/19 9:49
**/
public
class
BookAndChannelDTO
{
public
class
BookAndChannelDTO
implements
Serializable
{
private
Long
bookId
;
private
Long
channelId
;
public
Long
getBookId
()
{
return
bookId
;
}
public
void
setBookId
(
Long
bookId
)
{
this
.
bookId
=
bookId
;
}
public
Long
getChannelId
()
{
return
channelId
;
}
public
void
setChannelId
(
Long
channelId
)
{
this
.
channelId
=
channelId
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/entity/AdvertisingAdviserPermission.java
View file @
f20048be
package
com
.
pcloud
.
book
.
advertising
.
entity
;
import
java.util.Date
;
import
java.util.List
;
import
com.pcloud.book.advertising.dto.BookAndChannelDTO
;
import
com.pcloud.common.entity.BaseEntity
;
/**
...
...
@@ -50,6 +53,11 @@ public class AdvertisingAdviserPermission extends BaseEntity {
*/
private
Boolean
isBatchOperation
;
/**
* bookId和channelId集合
*/
private
List
<
BookAndChannelDTO
>
bookAndChannelDTOS
;
@Override
public
Long
getId
()
{
return
id
;
...
...
@@ -120,6 +128,14 @@ public class AdvertisingAdviserPermission extends BaseEntity {
this
.
isBatchOperation
=
isBatchOperation
;
}
public
List
<
BookAndChannelDTO
>
getBookAndChannelDTOS
()
{
return
bookAndChannelDTOS
;
}
public
void
setBookAndChannelDTOS
(
List
<
BookAndChannelDTO
>
bookAndChannelDTOS
)
{
this
.
bookAndChannelDTOS
=
bookAndChannelDTOS
;
}
@Override
public
String
toString
()
{
return
"AdvertisingAdviserPermission{"
+
...
...
@@ -128,9 +144,10 @@ public class AdvertisingAdviserPermission extends BaseEntity {
", bookId="
+
bookId
+
", channelId="
+
channelId
+
", isOpen="
+
isOpen
+
", isBatchOperation="
+
isBatchOperation
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
", isBatchOperation="
+
isBatchOperation
+
", bookAndChannelDTOS="
+
bookAndChannelDTOS
+
"} "
+
super
.
toString
();
}
}
\ No newline at end of file
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