|
@@ -25,6 +25,7 @@ import com.redxun.knowledge.common.UserService;
|
|
|
import com.redxun.knowledge.entity.dao.ActionLog;
|
|
|
import com.redxun.knowledge.entity.dao.Knowledge;
|
|
|
import com.redxun.knowledge.entity.vo.KnowledgeCategoryAdminVo;
|
|
|
+import com.redxun.knowledge.mapper.ActionLogMapper;
|
|
|
import com.redxun.knowledge.service.KnowledgeCategoryServiceImpl;
|
|
|
import com.redxun.knowledge.service.KnowledgeServiceImpl;
|
|
|
import com.redxun.knowledge.utils.PageListUtils;
|
|
@@ -86,6 +87,9 @@ public class AlbumInfoServiceImpl extends SuperServiceImpl<AlbumInfoMapper, Albu
|
|
|
@Autowired
|
|
|
private AlbumYelpApproveServiceImpl albumYelpApproveService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ActionLogMapper actionLogMapper;
|
|
|
+
|
|
|
@Autowired
|
|
|
private UserService userService;
|
|
|
|
|
@@ -578,9 +582,8 @@ public class AlbumInfoServiceImpl extends SuperServiceImpl<AlbumInfoMapper, Albu
|
|
|
albumInfoDetailPcVo.setActionFlag(new ArrayList<>());
|
|
|
}
|
|
|
//增加点击量
|
|
|
- // TODO: 2023/2/17 增加点击量
|
|
|
- if (albumInfoDetailPcVo.getVersionState() == 2){
|
|
|
- addCountViews(userId,albumInfoDetailPcVo.getPkId());
|
|
|
+ if (albumInfoDetailPcVo.getVersionState() == 2) {
|
|
|
+ addCountViews(userId, albumInfoDetailPcVo.getPkId());
|
|
|
}
|
|
|
return albumInfoDetailPcVo;
|
|
|
}
|
|
@@ -684,6 +687,8 @@ public class AlbumInfoServiceImpl extends SuperServiceImpl<AlbumInfoMapper, Albu
|
|
|
* 生成最新版审核流程数据
|
|
|
*/
|
|
|
private void createAlbumApprove(String albumId, String versionId) {
|
|
|
+ //根据专辑Id查询审核表中批次(每次生成批次+1)
|
|
|
+ List<AlbumApprove> albumApproveListBatch = albumApproveService.findAll(new LambdaQueryWrapper<AlbumApprove>().eq(AlbumApprove::getAlbumId, albumId));
|
|
|
//删除老版本审核流程
|
|
|
albumApproveService.deleteByVersionId(versionId);
|
|
|
//拉取专辑审核节点表
|
|
@@ -702,6 +707,7 @@ public class AlbumInfoServiceImpl extends SuperServiceImpl<AlbumInfoMapper, Albu
|
|
|
albumApprove.setIsFinal(albumApprovalNode.getIsFinal());
|
|
|
albumApprove.setUpdateBy(userService.queryLoginUser());
|
|
|
albumApprove.setName(albumApprovalNode.getName());
|
|
|
+ albumApprove.setApprovalBatch(albumApproveListBatch.get(0).getApprovalBatch() + 1);
|
|
|
return albumApprove;
|
|
|
}).collect(Collectors.toList());
|
|
|
//批量添加
|
|
@@ -815,19 +821,21 @@ public class AlbumInfoServiceImpl extends SuperServiceImpl<AlbumInfoMapper, Albu
|
|
|
|
|
|
/**
|
|
|
* 向统计表中增加数据(相同数据不增加)
|
|
|
- * @param userId 用户Id
|
|
|
+ *
|
|
|
+ * @param userId 用户Id
|
|
|
* @param albumId 专辑Id
|
|
|
*/
|
|
|
- private void addCountViews(String userId,String albumId){
|
|
|
- //QueryWrapper<ActionLog> queryWrapper = new QueryWrapper<>();
|
|
|
- //queryWrapper.eq("USER_ID",userId);
|
|
|
- //queryWrapper.eq("KNOWLEDGE_ID",knowledgeId);
|
|
|
- //List<ActionLog> actionLogList = actionLogMapper.selectList(queryWrapper);
|
|
|
- //if (org.springframework.util.CollectionUtils.isEmpty(actionLogList)){
|
|
|
- // ActionLog actionLog = new ActionLog();
|
|
|
- // actionLog.setType(1);
|
|
|
- // actionLog.setKnowledgeId(knowledgeId);
|
|
|
- // actionLog.setUserId(userId);
|
|
|
- // actionLogMapper.insert(actionLog);
|
|
|
+ private void addCountViews(String userId, String albumId) {
|
|
|
+ QueryWrapper<ActionLog> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("USER_ID", userId);
|
|
|
+ queryWrapper.eq("KNOWLEDGE_ID", albumId);
|
|
|
+ List<ActionLog> actionLogList = actionLogMapper.selectList(queryWrapper);
|
|
|
+ if (CollectionUtils.isEmpty(actionLogList)) {
|
|
|
+ ActionLog actionLog = new ActionLog();
|
|
|
+ actionLog.setType(2);
|
|
|
+ actionLog.setKnowledgeId(albumId);
|
|
|
+ actionLog.setUserId(userId);
|
|
|
+ actionLogMapper.insert(actionLog);
|
|
|
+ }
|
|
|
}
|
|
|
}
|