提交 f9bef3c9 authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 a7dfc401
......@@ -86,12 +86,11 @@ public class AnimationLibrarySerivceImpl extends BaseServiceImpl<AnimationLibrar
@Override
public boolean saveOrUpdate(SaveUpdateAnimationLibraryForm form) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
AnimationLibrary entity = new AnimationLibrary();
if(form.getDiyTypeId().size() != form.getDiyTypeCode().size()){
throw new BaseException("自定义分类数据错误");
}
if(form.getId()==null){
AnimationLibrary entity = new AnimationLibrary();
BeanUtils.copyProperties(form, entity);
//添加动画信息
entity.setStatus(0);
......@@ -101,7 +100,7 @@ public class AnimationLibrarySerivceImpl extends BaseServiceImpl<AnimationLibrar
animationMapper.insert(entity);
}else{
AnimationLibrary entity = animationMapper.selectByPrimaryKey(form.getId());
entity = animationMapper.selectByPrimaryKey(form.getId());
BeanUtils.copyProperties(form, entity);
//修改动画资源
entity.setUpdateTime(new Date());
......@@ -119,7 +118,7 @@ public class AnimationLibrarySerivceImpl extends BaseServiceImpl<AnimationLibrar
label.setObjectId(entity.getId());
labelMapper.delete(label);
}
AnimationLibrary entity = animationMapper.selectByPrimaryKey(form.getId());
entity = animationMapper.selectByPrimaryKey(entity.getId());
//添加商品信息
AnimationGoods goods = new AnimationGoods();
BeanUtils.copyProperties(form, goods);
......
......@@ -88,12 +88,12 @@ public class ArticleLibrarySerivceImpl extends BaseServiceImpl<ArticleLibrary,In
}
@Override
public boolean saveOrUpdate(SaveUpdateArticleLibraryForm form) throws ParseException {
ArticleLibrary entity = new ArticleLibrary();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if(form.getDiyTypeId() == null||form.getDiyTypeId().size() != form.getDiyTypeCode().size()){
throw new BaseException("自定义分类数据错误");
}
if(form.getId() == null){
ArticleLibrary entity = new ArticleLibrary();
BeanUtils.copyProperties(form, entity);
//添加
entity.setStatus(0);
......@@ -176,7 +176,7 @@ public class ArticleLibrarySerivceImpl extends BaseServiceImpl<ArticleLibrary,In
articleMapper.insert(entity);
}else{
//修改
ArticleLibrary entity = articleMapper.selectByPrimaryKey(form.getId());
entity = articleMapper.selectByPrimaryKey(form.getId());
BeanUtils.copyProperties(form, entity);
entity.setUpdateTime(new Date());
if(form.getPdfResourceType()!=null ){
......@@ -266,7 +266,7 @@ public class ArticleLibrarySerivceImpl extends BaseServiceImpl<ArticleLibrary,In
label.setObjectId(entity.getId());
alcdMapper.delete(label);
}
ArticleLibrary entity = articleMapper.selectByPrimaryKey(form.getId());
entity = articleMapper.selectByPrimaryKey(entity.getId());
// 维护合同的关联关系
if (StringUtils.isNotBlank(form.getRelatedContracts())) {
Copyright copyright = copyrightService.selectByPrimaryKey(form.getRelatedContracts());
......
......@@ -71,12 +71,12 @@ public class AudioLibrarySerivceImpl extends BaseServiceImpl<AudioLibrary,Intege
}
@Override
public boolean saveOrUpdate(SaveUpdateAudioLibraryForm form) throws ParseException {
AudioLibrary entity = new AudioLibrary();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if(form.getDiyTypeId().size() > 0 &&form.getDiyTypeId().size() != form.getDiyTypeCode().size()){
throw new BaseException("自定义分类数据错误");
}
if(form.getId()==null){
AudioLibrary entity = new AudioLibrary();
BeanUtils.copyProperties(form, entity);
//添加
entity.setStatus(0);
......@@ -86,7 +86,7 @@ public class AudioLibrarySerivceImpl extends BaseServiceImpl<AudioLibrary,Intege
audioMapper.insert(entity);
}else{
//修改
AudioLibrary entity = audioMapper.selectByPrimaryKey(form.getId());
entity = audioMapper.selectByPrimaryKey(form.getId());
BeanUtils.copyProperties(form, entity);
entity.setUpdateTime(new Date());
audioMapper.updateByPrimaryKeySelective(entity);
......@@ -103,7 +103,7 @@ public class AudioLibrarySerivceImpl extends BaseServiceImpl<AudioLibrary,Intege
label.setObjectId(entity.getId());
labelMapper.delete(label);
}
AudioLibrary entity = audioMapper.selectByPrimaryKey(form.getId());
entity = audioMapper.selectByPrimaryKey(entity.getId());
// 维护合同的关联关系
if (StringUtils.isNotBlank(form.getRelatedContracts())) {
Copyright copyright = copyrightService.selectByPrimaryKey(form.getRelatedContracts());
......
......@@ -75,19 +75,20 @@ public class AuthorLibraryServiceImpl extends BaseServiceImpl<AuthorLibrary, Int
@Override
public Boolean saveOrUpdate(SaveUpdateAuthorForm form) {
AuthorLibrary authorLibrary = new AuthorLibrary();
BeanUtils.copyProperties(form, authorLibrary);
List<AuthorLibraryDiyType> typeList = new ArrayList<AuthorLibraryDiyType>();
if(form.getDiyTypeId().size() > 0 &&form.getDiyTypeId().size() != form.getDiyTypeCode().size()){
throw new BaseException("自定义分类数据错误");
}
if(form.getId()==null){
//添加
BeanUtils.copyProperties(form, authorLibrary);
authorLibrary.setResourceType(16);
authorLibrary.setIsDelete(0);
authorLibrary.setStatus(0);
authorLibrary.setCreateTime(new Date());
authorMapper.insert(authorLibrary);
}else{
authorMapper.selectByPrimaryKey(form.getId());
authorLibrary.setUpdateTime(new Date());
authorMapper.updateByPrimaryKeySelective(authorLibrary);
// 删除原有关系表中的关系
......
......@@ -70,11 +70,11 @@ public class CoursewareLibrarySerivceImpl extends BaseServiceImpl<CoursewareLibr
@Override
public boolean saveOrUpdate(SaveUpdateCoursewareLibraryForm form) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
CoursewareLibrary entity = new CoursewareLibrary();
if(form.getDiyTypeId().size() != form.getDiyTypeCode().size()){
throw new BaseException("自定义分类数据错误");
}
if(form.getId()==null){
CoursewareLibrary entity = new CoursewareLibrary();
BeanUtils.copyProperties(form, entity);
entity.setStatus(0);
entity.setIsDelete(0);
......@@ -83,7 +83,7 @@ public class CoursewareLibrarySerivceImpl extends BaseServiceImpl<CoursewareLibr
coursewareMapper.insert(entity);
}else{
//修改
CoursewareLibrary entity = coursewareMapper.selectByPrimaryKey(form.getId());
entity = coursewareMapper.selectByPrimaryKey(form.getId());
BeanUtils.copyProperties(form, entity);
entity.setUpdateTime(new Date());
coursewareMapper.updateByPrimaryKeySelective(entity);
......@@ -100,7 +100,7 @@ public class CoursewareLibrarySerivceImpl extends BaseServiceImpl<CoursewareLibr
label.setObjectId(entity.getId());
labelMapper.delete(label);
}
CoursewareLibrary entity = coursewareMapper.selectByPrimaryKey(form.getId());
entity = coursewareMapper.selectByPrimaryKey(entity.getId());
// 维护合同的关联关系
if (StringUtils.isNotBlank(form.getRelatedContracts())) {
Copyright copyright = copyrightService.selectByPrimaryKey(form.getRelatedContracts());
......@@ -141,8 +141,8 @@ public class CoursewareLibrarySerivceImpl extends BaseServiceImpl<CoursewareLibr
type.setCode(form.getDiyTypeCode().get(i));
typeList.add(type);
}
diyTypeMapper.insertUuidList(typeList);
}
diyTypeMapper.insertUuidList(typeList);
//添加当前对象与自定义标签的关系
List<CoursewareLibraryLabel> labelList= new ArrayList<CoursewareLibraryLabel>();
if(form.getLabelId()!=null && form.getLabelId().size()>0){
......
......@@ -105,13 +105,13 @@ public class EbookServiceImpl extends BaseServiceImpl<Ebook, String> implements
@Override
public boolean saveOrUpdate(SaveUpdateEbookForm form) throws ParseException {
Book book = new Book();
List<BookDiyType> dtList = new ArrayList<BookDiyType>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if (form.getDiyTypeId() == null || form.getDiyTypeId().size() == 0) {
throw new BaseException("参数验证失败。");
} else {
if (form.getId() == null) {
Book book = new Book();
BeanUtils.copyProperties(form, book);
Ebook ebook = new Ebook();
BeanUtils.copyProperties(form, ebook);
......@@ -216,7 +216,7 @@ public class EbookServiceImpl extends BaseServiceImpl<Ebook, String> implements
}
}
} else {
Book book = bookMapper.selectByPrimaryKey(form.getId());
book = bookMapper.selectByPrimaryKey(form.getId());
BeanUtils.copyProperties(form, book);
Ebook ebook = ebookMapper.selectByPrimaryKey(form.getId());
BeanUtils.copyProperties(form, ebook);
......@@ -323,7 +323,7 @@ public class EbookServiceImpl extends BaseServiceImpl<Ebook, String> implements
issued.setObjectId(book.getId());
bookIssuedMapper.delete(issued);
}
Book book = bookMapper.selectByPrimaryKey(form.getId());
book = bookMapper.selectByPrimaryKey(form.getId());
BookGoods goods = new BookGoods();
BeanUtils.copyProperties(form, goods);
//添加商品信息
......
......@@ -79,13 +79,13 @@ public class ImageLibrarySerivceImpl extends BaseServiceImpl<ImageLibrary,Intege
*/
@Override
public boolean saveOrUpdate(SaveUpdateImageLibraryForm form) throws ParseException {
ImageLibrary entity = new ImageLibrary();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if(form.getDiyTypeId().size() != form.getDiyTypeCode().size()){
throw new BaseException(-7,"自定义分类数据错误");
}
if(form.getId() == null){
//添加图片信息
ImageLibrary entity = new ImageLibrary();
BeanUtils.copyProperties(form, entity);
entity.setIsDelete(0);
entity.setStatus(0);
......@@ -96,7 +96,7 @@ public class ImageLibrarySerivceImpl extends BaseServiceImpl<ImageLibrary,Intege
}
}else{
//修改
ImageLibrary entity = imageMapper.selectByPrimaryKey(form.getId());
entity = imageMapper.selectByPrimaryKey(form.getId());
BeanUtils.copyProperties(form, entity);
entity.setUpdateTime(new Date());
imageMapper.updateByPrimaryKeySelective(entity);
......@@ -113,7 +113,7 @@ public class ImageLibrarySerivceImpl extends BaseServiceImpl<ImageLibrary,Intege
label.setObjectId(entity.getId());
labelMapper.delete(label);
}
ImageLibrary entity = imageMapper.selectByPrimaryKey(form.getId());
entity = imageMapper.selectByPrimaryKey(entity.getId());
// 维护合同的关联关系
if (StringUtils.isNotBlank(form.getRelatedContracts())) {
Copyright copyright = copyrightService.selectByPrimaryKey(form.getRelatedContracts());
......
......@@ -80,14 +80,13 @@ public class PdfLibrarySerivceImpl extends BaseServiceImpl<PdfLibrary,Integer> i
*/
@Override
public boolean saveOrUpdate(SaveUpdatePdfLibraryForm form) throws ParseException {
PdfLibrary entity = new PdfLibrary();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if(form.getDiyTypeId().size() != form.getDiyTypeCode().size()){
throw new BaseException("自定义分类数据错误");
}
if(form.getId()==null){
//添加
PdfLibrary entity = new PdfLibrary();
BeanUtils.copyProperties(form, entity);
entity.setStatus(0);
entity.setIsDelete(0);
......@@ -109,7 +108,7 @@ public class PdfLibrarySerivceImpl extends BaseServiceImpl<PdfLibrary,Integer> i
}
}else{
//修改
PdfLibrary entity = pdfMapper.selectByPrimaryKey(form.getId());
entity = pdfMapper.selectByPrimaryKey(form.getId());
BeanUtils.copyProperties(form, entity);
entity.setUpdateTime(new Date());
pdfMapper.updateByPrimaryKeySelective(entity);
......@@ -139,7 +138,7 @@ public class PdfLibrarySerivceImpl extends BaseServiceImpl<PdfLibrary,Integer> i
label.setObjectId(entity.getId());
labelMapper.delete(label);
}
PdfLibrary entity = pdfMapper.selectByPrimaryKey(form.getId());
entity = pdfMapper.selectByPrimaryKey(entity.getId());
//添加商品信息
PdfGoods goods = new PdfGoods();
BeanUtils.copyProperties(form, goods);
......
......@@ -95,6 +95,7 @@ public class StatuteLibraryServiceImpl extends BaseServiceImpl<StatuteLibrary, I
* @throws ParseException */
@Override
public boolean saveOrUpdate(SaveUpdateStatuteLibraryForm form) throws ParseException {
StatuteLibrary entity = new StatuteLibrary();
if (form.getDiyTypeId() == null || form.getDiyTypeId().size() != form.getDiyTypeCode().size()) {
throw new BaseException(7, "自定义分类数据错误");
}
......@@ -103,7 +104,6 @@ public class StatuteLibraryServiceImpl extends BaseServiceImpl<StatuteLibrary, I
String objectId = form.getId();
if (objectId == null) {
// 添加
StatuteLibrary entity = new StatuteLibrary();
BeanUtils.copyProperties(form, entity);
if (StringUtils.isNotBlank(form.getIssuingTime())) {
entity.setIssuingTime(sdf.parse(form.getIssuingTime()));
......@@ -195,7 +195,7 @@ public class StatuteLibraryServiceImpl extends BaseServiceImpl<StatuteLibrary, I
}
} else {
// 更新
StatuteLibrary entity = mapper.selectByPrimaryKey(form.getId());
entity = mapper.selectByPrimaryKey(entity.getId());
BeanUtils.copyProperties(form, entity);
entity.setUpdateTime(new Date());
if(form.getPdfResourceType()!=null ){
......@@ -285,7 +285,7 @@ public class StatuteLibraryServiceImpl extends BaseServiceImpl<StatuteLibrary, I
label.setObjectId(objectId);
labelMapper.delete(label);
}
StatuteLibrary entity = mapper.selectByPrimaryKey(form.getId());
entity = mapper.selectByPrimaryKey(entity.getId());
// 保存商品信息
StatuteGoods goods = new StatuteGoods();
BeanUtils.copyProperties(form, goods);
......
......@@ -75,13 +75,13 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,Intege
*/
@Override
public boolean saveOrUpdate(SaveUpdateVideoLibraryForm form) throws ParseException {
VideoLibrary entity = new VideoLibrary();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if(form.getDiyTypeId().size() != form.getDiyTypeCode().size()){
throw new BaseException("自定义分类数据错误");
}
if(form.getId()==null){
//添加视频信息
VideoLibrary entity = new VideoLibrary();
BeanUtils.copyProperties(form, entity);
entity.setStatus(0);
entity.setIsDelete(0);
......@@ -90,7 +90,7 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,Intege
videoMapper.insert(entity);
}else{
//修改
VideoLibrary entity = videoMapper.selectByPrimaryKey(form.getId());
entity = videoMapper.selectByPrimaryKey(form.getId());
BeanUtils.copyProperties(form, entity);
entity.setUpdateTime(new Date());
videoMapper.updateByPrimaryKeySelective(entity);
......@@ -107,7 +107,7 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,Intege
label.setObjectId(entity.getId());
labelMapper.delete(label);
}
VideoLibrary entity = videoMapper.selectByPrimaryKey(form.getId());
entity = videoMapper.selectByPrimaryKey(entity.getId());
//添加商品信息
VideoGoods goods = new VideoGoods();
BeanUtils.copyProperties(form, goods);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论