|
@@ -5,9 +5,11 @@ import com.ym.mec.biz.dal.dao.PhotoDao;
|
|
|
import com.ym.mec.biz.dal.entity.Photo;
|
|
|
import com.ym.mec.biz.dal.entity.PhotoAlbum;
|
|
|
import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
|
+import com.ym.mec.biz.dal.page.PhotoQueryInfo;
|
|
|
import com.ym.mec.biz.service.PhotoService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
+import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -51,6 +53,7 @@ public class PhotoServiceImpl extends BaseServiceImpl<Integer, Photo> implement
|
|
|
PhotoAlbum photoAlbum = photoAlbumDao.findByTypeAndGroupId(musicGroupId,"SHOW");
|
|
|
if(photoAlbum == null){
|
|
|
photoAlbum = new PhotoAlbum();
|
|
|
+ photoAlbum.setMusicGroupId(musicGroupId);
|
|
|
photoAlbum.setName("获奖证书");
|
|
|
photoAlbum.setClientShow(YesOrNoEnum.YES);
|
|
|
photoAlbum.setType("SHOW");
|
|
@@ -68,4 +71,26 @@ public class PhotoServiceImpl extends BaseServiceImpl<Integer, Photo> implement
|
|
|
public int batchUpdate(List<Photo> photoList) {
|
|
|
return photoDao.batchUpdate(photoList);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageInfo<Photo> queryPhotoPage(PhotoQueryInfo queryInfo) {
|
|
|
+ Integer photoAlbumId = queryInfo.getPhotoAlbumId();
|
|
|
+ if(photoAlbumId == null){
|
|
|
+ String type = queryInfo.getType();
|
|
|
+ if(!"SHOW".equals(type)){
|
|
|
+ throw new BizException("参数校验失败");
|
|
|
+ }
|
|
|
+ PhotoAlbum photoAlbum = photoAlbumDao.findByTypeAndGroupId(queryInfo.getMusicGroupId(), type);
|
|
|
+ if(photoAlbum == null){
|
|
|
+ photoAlbum = new PhotoAlbum();
|
|
|
+ photoAlbum.setMusicGroupId(queryInfo.getMusicGroupId());
|
|
|
+ photoAlbum.setName("获奖证书");
|
|
|
+ photoAlbum.setClientShow(YesOrNoEnum.YES);
|
|
|
+ photoAlbum.setType("SHOW");
|
|
|
+ photoAlbumDao.insert(photoAlbum);
|
|
|
+ }
|
|
|
+ queryInfo.setPhotoAlbumId(photoAlbum.getId());
|
|
|
+ }
|
|
|
+ return queryPage(queryInfo);
|
|
|
+ }
|
|
|
}
|