1、新增文档和工具统计

2、样式调整
3、文件下载分页(还有一部分没有调整)
This commit is contained in:
pan 2024-09-05 22:36:07 +08:00
parent 3d679da3c3
commit f90c8e0c6f
6 changed files with 71 additions and 19 deletions

View File

@ -1,26 +1,17 @@
package com.rzdata.web.controller.tool;
import javax.servlet.http.HttpServletResponse;
import com.rzdata.common.utils.poi.ExcelUtil;
import com.rzdata.web.domain.DownloadCount;
import com.rzdata.web.service.IDownloadCountService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
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 com.rzdata.common.annotation.Log;
import com.rzdata.common.core.controller.BaseController;
import com.rzdata.common.core.domain.AjaxResult;
import com.rzdata.common.enums.BusinessType;
import com.rzdata.common.core.page.TableDataInfo;
import com.rzdata.common.enums.BusinessType;
import com.rzdata.common.utils.poi.ExcelUtil;
import com.rzdata.web.domain.DownloadCount;
import com.rzdata.web.service.IDownloadCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@ -48,6 +39,17 @@ public class DownloadCountController extends BaseController
}
/**
* 查询文档下载统计列表
*/
@GetMapping("/doc/list")
public TableDataInfo docList(DownloadCount downloadCount)
{
startPage();
List<DownloadCount> list = downloadCountService.selectDownloadDocCountList(downloadCount);
return getDataTable(list);
}
/**
* 根据详情统计
*/

View File

@ -46,4 +46,11 @@ public class DownloadCount extends BaseEntity
private String toolDownNum;
private String nickName;
/** 文档code */
private String docCode;
/** 文档名称 */
private String docName;
/** 文档下载数量 */
private String docDownNum;
}

View File

@ -61,4 +61,7 @@ public interface DownloadCountMapper
public int deleteDownloadCountByIds(String[] ids);
List<DownloadCount> userDownList(DownloadCount downloadCount);
/** 文档下载统计 **/
List<DownloadCount> selectDownloadDocCountList(DownloadCount downloadCount);
}

View File

@ -66,4 +66,12 @@ public interface IDownloadCountService
* @return
*/
List<DownloadCount> userDownList(DownloadCount downloadCount);
/**
* 文档下载统计
* @param downloadCount
* @return
*/
List<DownloadCount> selectDownloadDocCountList(DownloadCount downloadCount);
}

View File

@ -107,4 +107,9 @@ public class DownloadCountServiceImpl implements IDownloadCountService
public List<DownloadCount> userDownList(DownloadCount downloadCount) {
return downloadCountMapper.userDownList(downloadCount);
}
@Override
public List<DownloadCount> selectDownloadDocCountList(DownloadCount downloadCount) {
return downloadCountMapper.selectDownloadDocCountList(downloadCount);
}
}

View File

@ -19,6 +19,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="toolCode" column="tool_code" />
<result property="toolName" column="tool_name" />
<result property="toolDownNum" column="tool_down_num" />
<result property="docCode" column="doc_code" />
<result property="docName" column="doc_name" />
<result property="docDownNum" column="doc_down_num" />
<result property="nickName" column="nick_name" />
</resultMap>
@ -29,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDownloadCountList" parameterType="DownloadCount" resultMap="DownloadCountResult">
select
tdc.business_id,tdc.att_name,tl.tool_code,tl.tool_name,sum(1) as tool_down_num
tdc.business_id,tl.tool_code,tl.tool_name,sum(1) as tool_down_num
from t_download_count tdc
left join t_tool tl on tdc.business_id = tl.tool_id
<where>
@ -47,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND tl.tool_name like concat('%', #{toolName}, '%')
</if>
</where>
group by tdc.business_id,tdc.att_name,tl.tool_code,tl.tool_name
group by tdc.business_id,tl.tool_code,tl.tool_name
</select>
<select id="selectDownloadCountById" parameterType="String" resultMap="DownloadCountResult">
@ -124,7 +127,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND business_id = #{businessId}
</if>
</where>
group by su.nick_name
group by su.nick_name,tdc.business_id,tdc.att_name
</select>
<select id="selectDownloadDocCountList" parameterType="DownloadCount" resultMap="DownloadCountResult">
select
tdc.business_id,tl.doc_code,tl.doc_name,sum(1) as doc_down_num
from t_download_count tdc
left join t_document tl on tdc.business_id = tl.doc_id
<where>
and business_type = 'doc'
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(tdc.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(tdc.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<if test="docCode != null and docCode != ''">
AND tl.doc_code like concat('%', #{docCode}, '%')
</if>
<if test="docName != null and docName != ''">
AND tl.doc_name like concat('%', #{docName}, '%')
</if>
</where>
group by tdc.business_id,tl.doc_code,tl.doc_name
</select>
</mapper>