提交 df97e1c4 authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 922bae98
......@@ -90,7 +90,7 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
if(PriceOptionEnum.STATUS_0.getCode() == form.getPriceOption()){
entity.setRealPrice(new BigDecimal(0));
}
if(entity.getId() == null){
if(StringUtils.isBlank(entity.getId())){
//添加
entity.setStatus(LibraryStatusEnum.STATUS_2.getCode());
entity.setUploadTime(new Date());
......@@ -100,6 +100,11 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
mapper.insert(entity);
}else{
//修改
if(StringUtils.isBlank(form.getAuthorId())) {
CourseLibrary c = mapper.selectByPrimaryKey(form.getId());
c.setAuthorId(null);
mapper.updateByPrimaryKey(c);
}
entity.setUpdateTime(new Date());
mapper.updateByPrimaryKeySelective(entity);
//删除当前对象与自定义分类的关系
......
......@@ -34,6 +34,7 @@ import com.zrqx.resource.commons.form.bg.QueryResourceForPoPForm;
import com.zrqx.resource.commons.form.bg.videolibrary.QueryVideoLibraryForm;
import com.zrqx.resource.commons.form.bg.videolibrary.SaveUpdateVideoLibraryForm;
import com.zrqx.resource.commons.form.bg.videolibrary.SaveVideoLibraryForm;
import com.zrqx.resource.commons.model.courcelibrary.CourseLibrary;
import com.zrqx.resource.commons.model.membercollection.MemberCollection;
import com.zrqx.resource.commons.model.record.Record;
import com.zrqx.resource.commons.model.resourcerelation.ResourceRelation;
......@@ -100,7 +101,7 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
if(PriceOptionEnum.STATUS_0.getCode() == form.getPriceOption()){
entity.setRealPrice(new BigDecimal(0));
}
if(entity.getId() == null){
if(StringUtils.isBlank(entity.getId())){
//添加
entity.setStatus(LibraryStatusEnum.STATUS_2.getCode());
entity.setUploadTime(new Date());
......@@ -110,6 +111,11 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
mapper.insert(entity);
}else{
//修改
if(StringUtils.isBlank(form.getAuthorId())) {
VideoLibrary v = mapper.selectByPrimaryKey(form.getId());
v.setAuthorId(null);
mapper.updateByPrimaryKey(v);
}
entity.setUpdateTime(new Date());
mapper.updateByPrimaryKeySelective(entity);
if(form.getPrice() == null){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论