|
@@ -15,6 +15,13 @@ import com.yonge.cooleshow.biz.dal.wrapper.AlbumCategoryWrapper;
|
|
import com.yonge.cooleshow.biz.dal.mapper.AlbumCategoryMapper;
|
|
import com.yonge.cooleshow.biz.dal.mapper.AlbumCategoryMapper;
|
|
import com.yonge.cooleshow.biz.dal.service.AlbumCategoryService;
|
|
import com.yonge.cooleshow.biz.dal.service.AlbumCategoryService;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
+
|
|
|
|
+import java.util.Collection;
|
|
|
|
+import java.util.Collections;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 机构专辑分类
|
|
* 机构专辑分类
|
|
@@ -58,10 +65,18 @@ public class AlbumCategoryServiceImpl extends ServiceImpl<AlbumCategoryMapper, A
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public Boolean del(Long id) {
|
|
public Boolean del(Long id) {
|
|
- return this.lambdaUpdate()
|
|
|
|
- .eq(AlbumCategory::getId, id)
|
|
|
|
- .set(AlbumCategory::getDelFlag, 1)
|
|
|
|
- .update();
|
|
|
|
|
|
+ return this.removeById(id);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Map<Long, AlbumCategory> getMapByIds(List<Long> albumCategoryIds) {
|
|
|
|
+
|
|
|
|
+ if (CollectionUtils.isEmpty(albumCategoryIds)) {
|
|
|
|
+ return Collections.emptyMap();
|
|
|
|
+ }
|
|
|
|
+ Collection<AlbumCategory> albumCategories = listByIds(albumCategoryIds);
|
|
|
|
+ return albumCategories.stream().collect(Collectors.toMap(AlbumCategory::getId, albumCategory -> albumCategory));
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|