|
@@ -58,12 +58,14 @@ public class TreePosterContentServiceImpl extends ServiceImpl<ITreePosterContent
|
|
|
|
|
|
if (posterLib != null) {
|
|
if (posterLib != null) {
|
|
// 查询该时间段是否已经插入海报悄悄话
|
|
// 查询该时间段是否已经插入海报悄悄话
|
|
- List<TreePosterContent> treePosterContentList = this.lambdaQuery()
|
|
|
|
|
|
+ TreePosterContent treePosterContent = this.lambdaQuery()
|
|
.eq(TreePosterContent::getPosterLibId, posterLib.getId())
|
|
.eq(TreePosterContent::getPosterLibId, posterLib.getId())
|
|
- .list();
|
|
|
|
- if (treePosterContentList.size() == 0) {
|
|
|
|
|
|
+ .eq(TreePosterContent::getAppUserId, addDTO.getAppUserId())
|
|
|
|
+ .eq(TreePosterContent::getTreeId, addDTO.getTreeId())
|
|
|
|
+ .one();
|
|
|
|
+ if (treePosterContent == null) {
|
|
// 2.获取悄悄话,取最新一条记录
|
|
// 2.获取悄悄话,取最新一条记录
|
|
- TreePosterContent treePosterContent = new TreePosterContent();
|
|
|
|
|
|
+ treePosterContent = new TreePosterContent();
|
|
BeanUtil.copyProperties(addDTO, treePosterContent);
|
|
BeanUtil.copyProperties(addDTO, treePosterContent);
|
|
treePosterContent.setTenantId(tenantId);
|
|
treePosterContent.setTenantId(tenantId);
|
|
treePosterContent.setPosterLibId(posterLib.getId());
|
|
treePosterContent.setPosterLibId(posterLib.getId());
|
|
@@ -76,10 +78,8 @@ public class TreePosterContentServiceImpl extends ServiceImpl<ITreePosterContent
|
|
treePosterContent.setStatus(1);
|
|
treePosterContent.setStatus(1);
|
|
// 新增
|
|
// 新增
|
|
this.save(treePosterContent);
|
|
this.save(treePosterContent);
|
|
- BeanUtil.copyProperties(treePosterContent, respDTO);
|
|
|
|
- } else {
|
|
|
|
- BeanUtil.copyProperties(treePosterContentList.get(0), respDTO);
|
|
|
|
}
|
|
}
|
|
|
|
+ BeanUtil.copyProperties(treePosterContent, respDTO);
|
|
}
|
|
}
|
|
return respDTO;
|
|
return respDTO;
|
|
}
|
|
}
|