Commit 187d39b5 by 吴迪

【修改】点击量统计需求

parent cf82092c
...@@ -342,6 +342,12 @@ ...@@ -342,6 +342,12 @@
<version>1.20</version> <version>1.20</version>
</dependency> </dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-spring-boot-starter</artifactId>
<version>4.4.0</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package io.office.modules.manage.controller; package io.office.modules.manage.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sitech.idworkstarter.IdWorkService; import com.sitech.idworkstarter.IdWorkService;
import eu.bitwalker.useragentutils.UserAgent; import eu.bitwalker.useragentutils.UserAgent;
import io.office.common.enumpack.manage.ClickTypeEnum; import io.office.common.enumpack.manage.ClickTypeEnum;
...@@ -9,17 +11,22 @@ import io.office.common.utils.PageUtils; ...@@ -9,17 +11,22 @@ import io.office.common.utils.PageUtils;
import io.office.common.utils.R; import io.office.common.utils.R;
import io.office.modules.manage.entity.ClickDetailEntity; import io.office.modules.manage.entity.ClickDetailEntity;
import io.office.modules.manage.entity.dto.ClickCodeDetailDTO; import io.office.modules.manage.entity.dto.ClickCodeDetailDTO;
import io.office.modules.manage.entity.dto.ClickDetailDTO;
import io.office.modules.manage.service.ClickDetailService; import io.office.modules.manage.service.ClickDetailService;
import io.office.modules.manage.utils.DateUtils; import io.office.modules.manage.utils.DateUtils;
import io.office.modules.manage.utils.IdKeysConstant; import io.office.modules.manage.utils.IdKeysConstant;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.Map;
/** /**
...@@ -41,14 +48,70 @@ public class ClickDetailController { ...@@ -41,14 +48,70 @@ public class ClickDetailController {
/** /**
* 列表 * 列表
*/ */
//@RequestMapping("/list")
//// @RequiresPermissions("datamanage:clickdetail:list")
//public R list(@RequestParam Map<String, Object> params) {
// PageUtils page = clickDetailService.queryPage(params);
//
// return R.ok().put("page", page);
//}
@RequestMapping("/list") @RequestMapping("/list")
// @RequiresPermissions("datamanage:clickdetail:list") //@RequiresPermissions("datamanage:clickdetail:list")
public R list(@RequestParam Map<String, Object> params) { public R list(@RequestBody ClickDetailDTO clickDetailDTO) {
PageUtils page = clickDetailService.queryPage(params); Page page = null;
if (StrUtil.equals("1", clickDetailDTO.getTypeValue())) {
page = clickDetailService.selectClickNewsList(clickDetailDTO);
} else if (StrUtil.equals("2", clickDetailDTO.getTypeValue())) {
page = clickDetailService.getListPageImages(clickDetailDTO);
} else if (StrUtil.equals("3", clickDetailDTO.getTypeValue())) {
page = clickDetailService.getListPageViewSubs(clickDetailDTO);
} else if (StrUtil.equals("4", clickDetailDTO.getTypeValue())) {
page = clickDetailService.getListPageMovies(clickDetailDTO);
} else if (StrUtil.equals("5", clickDetailDTO.getTypeValue())) {
page = clickDetailService.getListPagePolicys(clickDetailDTO);
} else if (StrUtil.equals("6", clickDetailDTO.getTypeValue())) {
page = clickDetailService.getListPageApplications(clickDetailDTO);
} else if (StrUtil.equals("7", clickDetailDTO.getTypeValue())) {
page = clickDetailService.getListPageKnowledgeInfos(clickDetailDTO);
} else if (StrUtil.equals("9", clickDetailDTO.getTypeValue())) {
page = clickDetailService.getListPageProducts(clickDetailDTO);
} else if (StrUtil.equals("12", clickDetailDTO.getTypeValue())) {
page = clickDetailService.getListPageAnnounces(clickDetailDTO);
}
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("page", pageUtils);
}
return R.ok().put("page", page); @RequestMapping("/export")
//@RequiresPermissions("datamanage:clickdetail:list")
public void export(@RequestBody ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException {
if (StrUtil.equals("1", clickDetailDTO.getTypeValue())) {
clickDetailService.selectClickNewsListExport(clickDetailDTO,response);
} else if (StrUtil.equals("2", clickDetailDTO.getTypeValue())) {
clickDetailService.getListPageImagesExport(clickDetailDTO,response);
} else if (StrUtil.equals("3", clickDetailDTO.getTypeValue())) {
clickDetailService.getListPageViewSubsExport(clickDetailDTO,response);
} else if (StrUtil.equals("4", clickDetailDTO.getTypeValue())) {
clickDetailService.getListPageMoviesExport(clickDetailDTO,response);
} else if (StrUtil.equals("5", clickDetailDTO.getTypeValue())) {
clickDetailService.getListPagePolicysExport(clickDetailDTO,response);
} else if (StrUtil.equals("6", clickDetailDTO.getTypeValue())) {
clickDetailService.getListPageApplicationsExport(clickDetailDTO,response);
} else if (StrUtil.equals("7", clickDetailDTO.getTypeValue())) {
clickDetailService.getListPageKnowledgeInfosExport(clickDetailDTO,response);
} else if (StrUtil.equals("9", clickDetailDTO.getTypeValue())) {
clickDetailService.getListPageProductsExport(clickDetailDTO,response);
} else if (StrUtil.equals("12", clickDetailDTO.getTypeValue())) {
clickDetailService.getListPageAnnouncesExport(clickDetailDTO,response);
} }
}
/** /**
* 信息 * 信息
...@@ -61,6 +124,16 @@ public class ClickDetailController { ...@@ -61,6 +124,16 @@ public class ClickDetailController {
return R.ok().put("clickDetail", clickDetail); return R.ok().put("clickDetail", clickDetail);
} }
@RequestMapping("/getClickDetailList")
// @RequiresPermissions("datamanage:clickdetail:info")
public R getclickDetail(@RequestBody ClickDetailDTO clickDetailDTO) {
Page page = clickDetailService.selectClickList(clickDetailDTO);
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("page", pageUtils);
}
/** /**
* 保存 * 保存
*/ */
...@@ -68,7 +141,7 @@ public class ClickDetailController { ...@@ -68,7 +141,7 @@ public class ClickDetailController {
// @RequiresPermissions("datamanage:clickdetail:save") // @RequiresPermissions("datamanage:clickdetail:save")
public R save(@RequestBody ClickCodeDetailDTO clickCodeDetailDTO) { public R save(@RequestBody ClickCodeDetailDTO clickCodeDetailDTO) {
if(StringUtils.isBlank(clickCodeDetailDTO.getCode())||StringUtils.isBlank(clickCodeDetailDTO.getId())) { if (StringUtils.isBlank(clickCodeDetailDTO.getCode()) || StringUtils.isBlank(clickCodeDetailDTO.getId())) {
return R.error("参数不能为空"); return R.error("参数不能为空");
} }
//获取request //获取request
......
package io.office.modules.manage.dao; package io.office.modules.manage.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.manage.entity.ClickDetailEntity; import io.office.modules.manage.entity.ClickDetailEntity;
import io.office.modules.manage.entity.dto.ClickDetailDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* ${comments} * ${comments}
...@@ -14,4 +19,83 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -14,4 +19,83 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface ClickDetailDao extends BaseMapper<ClickDetailEntity> { public interface ClickDetailDao extends BaseMapper<ClickDetailEntity> {
/**
* 文章
* @param clickDetailDTO
* @param page
* @return
*/
List<ClickDetailDTO> getListPageNews(@Param("clickDetailDTO")ClickDetailDTO clickDetailDTO, Page page);
/**
* 图片
* @param clickDetailDTO
* @param page
* @return
*/
List<ClickDetailDTO> getListPageImages(@Param("clickDetailDTO")ClickDetailDTO clickDetailDTO, Page page);
/**
* 专题
* @param clickDetailDTO
* @param page
* @return
*/
List<ClickDetailDTO> getListPageViewSubs(@Param("clickDetailDTO")ClickDetailDTO clickDetailDTO, Page page);
/**
* 视频
* @param clickDetailDTO
* @param page
* @return
*/
List<ClickDetailDTO> getListPageMovies(@Param("clickDetailDTO")ClickDetailDTO clickDetailDTO, Page page);
/**
* 政策法规
* @param clickDetailDTO
* @param page
* @return
*/
List<ClickDetailDTO> getListPagePolicys(@Param("clickDetailDTO")ClickDetailDTO clickDetailDTO, Page page);
/**
* 应用领域
* @param clickDetailDTO
* @param page
* @return
*/
List<ClickDetailDTO> getListPageApplications(@Param("clickDetailDTO")ClickDetailDTO clickDetailDTO, Page page);
/**
* 知识统计
* @param clickDetailDTO
* @param page
* @return
*/
List<ClickDetailDTO> getListPageKnowledgeInfos(@Param("clickDetailDTO")ClickDetailDTO clickDetailDTO, Page page);
/**
* 图书文献
* @param clickDetailDTO
* @param page
* @return
*/
List<ClickDetailDTO> getListPageProducts(@Param("clickDetailDTO")ClickDetailDTO clickDetailDTO, Page page);
/**
* 公告统计
* @param clickDetailDTO
* @param page
* @return
*/
List<ClickDetailDTO> getListPageAnnounces(@Param("clickDetailDTO")ClickDetailDTO clickDetailDTO, Page page);
List<ClickDetailDTO> selectClickList(@Param("clickDetailDTO")ClickDetailDTO clickDetailDTO, Page page);
} }
package io.office.modules.manage.entity.dto;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @author wudi
* @date 2023/7/30
* @comment
*/
@Data
public class ClickDetailDTO implements Serializable {
private static final long serialVersionUID = 1L;
@Excel(name = "ID",width = 20)
private Long id;
/**
* 点击的知识id
*/
private Long cId;
/**
* $column.comments
*/
private String typeValue;
/**
* $column.comments
*/
private String typeName;
/**
* $column.comments
*/
private String clickTime;
/**
* $column.comments
*/
private String clientIp;
/**
* $column.comments
*/
private String clientOs;
/**
* $column.comments
*/
private String clientBrowser;
@Excel(name = "标题",width = 80)
private String title;
private String keyWord;
private String keyWordType;
private String type;
@Excel(name = "点击数",width = 40)
private Integer countNum;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date inputDate;
@Excel(name = "发布时间",width = 60)
private String inputDateStr;
private String jumpPath;
/**
* 编辑
*/
private String editor;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updatedate;
private long page=1;
private long limit=10;
private String sidx;
private String order;
}
package io.office.modules.manage.service; package io.office.modules.manage.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils; import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.ClickDetailEntity; import io.office.modules.manage.entity.ClickDetailEntity;
import io.office.modules.manage.entity.dto.ClickDetailDTO;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map; import java.util.Map;
/** /**
...@@ -17,5 +21,64 @@ import java.util.Map; ...@@ -17,5 +21,64 @@ import java.util.Map;
public interface ClickDetailService extends IService<ClickDetailEntity> { public interface ClickDetailService extends IService<ClickDetailEntity> {
PageUtils queryPage(Map<String, Object> params); PageUtils queryPage(Map<String, Object> params);
Page<ClickDetailDTO> selectClickNewsList(ClickDetailDTO clickDetailDTO);
Page<ClickDetailDTO> getListPageImages(ClickDetailDTO clickDetailDTO);
Page<ClickDetailDTO> getListPageViewSubs(ClickDetailDTO clickDetailDTO);
Page<ClickDetailDTO> getListPageMovies(ClickDetailDTO clickDetailDTO);
Page<ClickDetailDTO> getListPagePolicys(ClickDetailDTO clickDetailDTO);
Page<ClickDetailDTO> getListPageApplications(ClickDetailDTO clickDetailDTO);
Page<ClickDetailDTO> getListPageKnowledgeInfos(ClickDetailDTO clickDetailDTO);
Page<ClickDetailDTO> getListPageProducts(ClickDetailDTO clickDetailDTO);
Page<ClickDetailDTO> getListPageAnnounces(ClickDetailDTO clickDetailDTO);
Page<ClickDetailDTO> selectClickList(ClickDetailDTO clickDetailDTO);
void selectClickNewsListExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException;
void getListPageImagesExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException;
void getListPageViewSubsExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException;
void getListPageMoviesExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException;
void getListPagePolicysExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException;
void getListPageApplicationsExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException;
void getListPageKnowledgeInfosExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException;
void getListPageProductsExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException;
void getListPageAnnouncesExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException;
void selectClickListExport(ClickDetailDTO clickDetailDTO, HttpServletResponse response) throws IOException;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment