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

--no commit message

上级 cb7933ea
......@@ -136,7 +136,7 @@ public class AudioLibraryController {
return CallBack.success();
}
@ApiOperation(value = "批量审核", notes = "批量审核")
/*@ApiOperation(value = "批量审核", notes = "批量审核")
@PostMapping(value = "/batch/update/status")
public CallBack<Boolean> updateArray(@RequestBody List<String> ids) {
Example example = service.createExample();
......@@ -148,7 +148,7 @@ public class AudioLibraryController {
throw new BaseException("操作失败");
}
return CallBack.success();
}
}*/
@ApiOperation(value = "删除" , notes ="删除")
@PostMapping(value = "/delete/{oid}")
......@@ -175,17 +175,6 @@ public class AudioLibraryController {
AudioLibrary entity = service.selectByPrimaryKey(oid);
AudioLibraryOneVO vo = new AudioLibraryOneVO();
BeanUtils.copyProperties(entity,vo);
if(StringUtils.isNotBlank(entity.getAuthorId())){
vo.setAuthorNameAndId(entity.getAuthor() + "," + entity.getAuthorId());
}else{
vo.setAuthorNameAndId(entity.getAuthor());
}
if(entity.getRealPrice() != null){
vo.setRealPrice(entity.getRealPrice().toString());
}
if(entity.getPrice() != null){
vo.setPrice(entity.getPrice().toString());
}
Example example = vdrService.createExample();
example.createCriteria().andEqualTo("audioId",oid);
List<AudioLibraryDiyType> list = vdrService.selectByExample(example);
......@@ -256,7 +245,7 @@ public class AudioLibraryController {
return CallBack.success();
}*/
@ApiOperation(value = "批量修改阅读权限", notes = "批量修改阅读权限")
/* @ApiOperation(value = "批量修改阅读权限", notes = "批量修改阅读权限")
@PostMapping(value = "/batch/update/read")
public CallBack<Boolean> updateReadTextPower(@RequestBody BatchUpdateVideoLibraryForm form) {
Example example = service.createExample();
......@@ -267,5 +256,5 @@ public class AudioLibraryController {
throw new BaseException("操作失败");
}
return CallBack.success();
}
}*/
}
......@@ -50,36 +50,20 @@ public class AudioLibrarySerivceImpl extends BaseServiceImpl<AudioLibrary,String
@Override
public boolean saveOrUpdate(SaveUpdateAudioLibraryForm form) {
AudioLibrary entity = new AudioLibrary();
if(StringUtils.isNotBlank(form.getAuthorNameAndId())){
String[] authorNameAndId = form.getAuthorNameAndId().split(",");
form.setAuthor(authorNameAndId[0]);
if(authorNameAndId.length > 1){
form.setAuthorId(authorNameAndId[1]);
}
}
BeanUtils.copyProperties(form, entity);
if(PriceOptionEnum.STATUS_0.getCode() == form.getPriceOption()){
entity.setRealPrice(new BigDecimal(0));
}
if(entity.getId() == null){
//添加
entity.setStatus(LibraryStatusEnum.STATUS_0.getCode());
entity.setUploadTime(new Date());
entity.setResourceType(AllResourceTypeEnum.AUDIO.getCode());
entity.setBrowseNum(50);
entity.setReadTextPower(1);
entity.setBrowseNum(0);
entity.setSalesNum(0);
entity.setClickNum(50);
entity.setClickNum(0);
mapper.insert(entity);
}else{
//修改
entity.setUpdateTime(new Date());
mapper.updateByPrimaryKeySelective(entity);
if(form.getPrice() == null){
AudioLibrary a = super.notNull(entity.getId());
a.setPrice(form.getPrice());
mapper.updateByPrimaryKey(a);
}
//删除当前对象与自定义分类的关系
AudioLibraryDiyType old = new AudioLibraryDiyType();
old.setAudioId(entity.getId());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论