Commit f20048be by 阮思源

增加批量操作

parent 5d618de9
...@@ -874,6 +874,20 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz { ...@@ -874,6 +874,20 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
advertisingAdviserPermissionDao.update(adviserPermission); advertisingAdviserPermissionDao.update(adviserPermission);
} }
} else { } else {
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()); advertisingAdviserPermissionDao.deleteByAdviserId(adviserPermission.getAdviserId());
List<BookDto> bookList = bookDao.listBookIdAndChannelId4Adviser(paramMap); List<BookDto> bookList = bookDao.listBookIdAndChannelId4Adviser(paramMap);
...@@ -891,6 +905,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz { ...@@ -891,6 +905,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
} }
} }
} }
}
/** /**
* 编辑端获取书刊列表 * 编辑端获取书刊列表
......
package com.pcloud.book.advertising.dto; package com.pcloud.book.advertising.dto;
import java.io.Serializable;
/** /**
* @Description * @Description
* @Author ruansiyuan * @Author ruansiyuan
* @Date 2019/8/19 9:49 * @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;
}
} }
package com.pcloud.book.advertising.entity; package com.pcloud.book.advertising.entity;
import java.util.Date; import java.util.Date;
import java.util.List;
import com.pcloud.book.advertising.dto.BookAndChannelDTO;
import com.pcloud.common.entity.BaseEntity; import com.pcloud.common.entity.BaseEntity;
/** /**
...@@ -50,6 +53,11 @@ public class AdvertisingAdviserPermission extends BaseEntity { ...@@ -50,6 +53,11 @@ public class AdvertisingAdviserPermission extends BaseEntity {
*/ */
private Boolean isBatchOperation; private Boolean isBatchOperation;
/**
* bookId和channelId集合
*/
private List<BookAndChannelDTO> bookAndChannelDTOS;
@Override @Override
public Long getId() { public Long getId() {
return id; return id;
...@@ -120,6 +128,14 @@ public class AdvertisingAdviserPermission extends BaseEntity { ...@@ -120,6 +128,14 @@ public class AdvertisingAdviserPermission extends BaseEntity {
this.isBatchOperation = isBatchOperation; this.isBatchOperation = isBatchOperation;
} }
public List<BookAndChannelDTO> getBookAndChannelDTOS() {
return bookAndChannelDTOS;
}
public void setBookAndChannelDTOS(List<BookAndChannelDTO> bookAndChannelDTOS) {
this.bookAndChannelDTOS = bookAndChannelDTOS;
}
@Override @Override
public String toString() { public String toString() {
return "AdvertisingAdviserPermission{" + return "AdvertisingAdviserPermission{" +
...@@ -128,9 +144,10 @@ public class AdvertisingAdviserPermission extends BaseEntity { ...@@ -128,9 +144,10 @@ public class AdvertisingAdviserPermission extends BaseEntity {
", bookId=" + bookId + ", bookId=" + bookId +
", channelId=" + channelId + ", channelId=" + channelId +
", isOpen=" + isOpen + ", isOpen=" + isOpen +
", isBatchOperation=" + isBatchOperation +
", createTime=" + createTime + ", createTime=" + createTime +
", updateTime=" + updateTime + ", updateTime=" + updateTime +
", isBatchOperation=" + isBatchOperation +
", bookAndChannelDTOS=" + bookAndChannelDTOS +
"} " + super.toString(); "} " + super.toString();
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment