|
@@ -19,6 +19,8 @@ import com.zhongzheng.modules.goods.service.IGoodsAuditionConfigService;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsCourseService;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsAuditionConfigVo;
|
|
|
+import com.zhongzheng.modules.goods.vo.GoodsPhotographConfigVo;
|
|
|
+import com.zhongzheng.modules.goods.vo.GoodsPlayConfigVo;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -56,9 +58,18 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
public GoodsVo queryById(Long goodsId){
|
|
|
Goods db = this.baseMapper.selectById(goodsId);
|
|
|
GoodsVo goodsVo = BeanUtil.toBean(db, GoodsVo.class);
|
|
|
+ //试听配置
|
|
|
if(db.getGoodsAuditionConfig()!=null){
|
|
|
goodsVo.setAuditionList(JSON.parseArray(db.getGoodsAuditionConfig(), GoodsAuditionConfigVo.class));
|
|
|
}
|
|
|
+ //播放设置
|
|
|
+ if(db.getGoodsPlayConfig()!=null){
|
|
|
+ goodsVo.setGoodsPlayConfigVo(JSON.parseObject(db.getGoodsPlayConfig(), GoodsPlayConfigVo.class));
|
|
|
+ }
|
|
|
+ //拍照设置
|
|
|
+ if(db.getGoodsPhotographConfig()!=null){
|
|
|
+ goodsVo.setGoodsPhotographConfigVo(JSON.parseObject(db.getGoodsPhotographConfig(), GoodsPhotographConfigVo.class));
|
|
|
+ }
|
|
|
return goodsVo;
|
|
|
}
|
|
|
|
|
@@ -126,10 +137,18 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
validEntityBeforeSave(add);
|
|
|
add.setCreateTime(DateUtils.getNowTime());
|
|
|
add.setUpdateTime(DateUtils.getNowTime());
|
|
|
- //试听列表
|
|
|
+ //试听设置列表
|
|
|
if(bo.getAuditionList()!=null){
|
|
|
add.setGoodsAuditionConfig(JSON.toJSONString(bo.getAuditionList()));
|
|
|
}
|
|
|
+ //播放设置
|
|
|
+ if(bo.getPlayConfig()!=null){
|
|
|
+ add.setGoodsPlayConfig(JSON.toJSONString(bo.getPlayConfig()));
|
|
|
+ }
|
|
|
+ //拍照设置
|
|
|
+ if(bo.getPhotographConfig()!=null){
|
|
|
+ add.setGoodsPhotographConfig(JSON.toJSONString(bo.getPhotographConfig()));
|
|
|
+ }
|
|
|
boolean result = this.save(add);
|
|
|
//课程列表
|
|
|
if(bo.getCourseList()!=null){
|
|
@@ -196,6 +215,14 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
if(bo.getAuditionList()!=null&&bo.getAuditionList().size()>0){
|
|
|
update.setGoodsAuditionConfig(JSON.toJSONString(bo.getAuditionList()));
|
|
|
}
|
|
|
+ //播放设置
|
|
|
+ if(bo.getPlayConfig()!=null){
|
|
|
+ update.setGoodsPlayConfig(JSON.toJSONString(bo.getPlayConfig()));
|
|
|
+ }
|
|
|
+ //拍照设置
|
|
|
+ if(bo.getPhotographConfig()!=null){
|
|
|
+ update.setGoodsPhotographConfig(JSON.toJSONString(bo.getPhotographConfig()));
|
|
|
+ }
|
|
|
return this.updateById(update);
|
|
|
}
|
|
|
|