项目分类统计预览

This commit is contained in:
cwchen 2025-04-03 16:46:05 +08:00
parent 54bebfc937
commit 75ffed7edc
7 changed files with 114 additions and 63 deletions

View File

@ -91,4 +91,11 @@ public class SynthesisQueryController {
synthesisQueryService.downloadExcel(dto.getData(),response);
}
@ApiOperation("项目分类统计-查看图片")
@PostMapping(value = "getProImgList")
@DecryptAndVerify(decryptedClass = QueryParamDto.class)
public ServerResponse getProImgList(EncryptedReq<QueryParamDto> data) {
return synthesisQueryService.getProImgList(data.getData());
}
}

View File

@ -78,4 +78,13 @@ public interface SynthesisQueryDao {
List<ProClassifyStatisticsVo> getProClassifyStatisticsList(QueryParamDto dto);
void deleteComprehensiveQuery(Long id);
/**
* 项目分类统计-查看图片
* @param dto
* @return List<SynthesisQueryVo>
* @author cwchen
* @date 2025/4/3 16:28
*/
List<SynthesisQueryVo> getProImgList(QueryParamDto dto);
}

View File

@ -82,4 +82,13 @@ public interface SynthesisQueryService {
* @param id
*/
void deleteComprehensiveQuery(Long id);
/**
* 项目分类统计-查看图片
* @param data
* @return ServerResponse
* @author cwchen
* @date 2025/4/3 16:27
*/
ServerResponse getProImgList(QueryParamDto data);
}

View File

@ -196,4 +196,19 @@ public class SynthesisQueryServiceImpl implements SynthesisQueryService {
log.error(e.toString(), e);
}
}
@Override
public ServerResponse getProImgList(QueryParamDto dto) {
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
try {
Long userId = Optional.ofNullable(UserUtil.getLoginUser()).map(LoginUser::getId).orElse(0L);
dto.setUserId(userId);
List<SynthesisQueryVo> list = Optional.ofNullable(synthesisQueryDao.getProImgList(dto)).orElseGet(ArrayList::new);
PageInfo<SynthesisQueryVo> pageInfo = new PageInfo<>(list);
return ServerResponse.createSuccess(pageInfo);
} catch (Exception e) {
log.error(e.toString(), e);
return ServerResponse.createErroe("查询失败");
}
}
}

View File

@ -236,13 +236,49 @@
#{proId}
</foreach>
</if>
<if test="id!=null">
AND tcq.pro_id = #{id}
</if>
AND tcq.is_active = '1'
</where>
GROUP BY tcq.upload_type, tcq.pro_id
</select>
<!--项目分类统计-查看图片-->
<select id="getProImgList" resultType="com.bonus.imgTool.backstage.entity.SynthesisQueryVo">
SELECT sfr.id,
sfr.original_file_path AS originalFilePath,
sfr.compress_file_path AS compressFilePath,
sfr.watermark_file_path AS watermarkFilePath,
sfr.upload_type AS uploadType,
CASE sfr.upload_type WHEN '1' THEN '安全违章' WHEN '2' THEN '质量检查' WHEN '3' THEN '安全措施落实'
WHEN '4' THEN '协调照片' WHEN '5' THEN '重要事项及宣传类' ELSE '' END AS uploadTypeName,
sfr.create_time AS uploadTime,
source_type AS sourceType,
A.dict_name AS sourceTypeName,
IF(tpc.file_resource_id IS NULL,'0','1') AS collectStatus,
tcq.title,
tcq.pro_name AS proName
FROM tb_comprehensive_query tcq
LEFT JOIN sys_file_resource sfr ON tcq.id = sfr.source_id AND tcq.upload_type = sfr.upload_type AND sfr.is_active = '1'
LEFT JOIN tb_photo_collect tpc ON sfr.id = tpc.file_resource_id AND tpc.collect_user_id = #{userId}
LEFT JOIN (
SELECT sd.dict_value,sd.dict_name
FROM sys_distinct sd
LEFT JOIN sys_distinct sd2 ON sd.p_id = sd2.id
WHERE sd2.dict_code = 'file_source_type' AND sd.del_flag = 0
) A ON A.dict_value = sfr.source_type
<where>
<if test="roleLevel = 0 and proIds != null and proIds.size() > 0">
AND tcq.pro_id IN
<foreach collection="proIds" item="proId" open="(" separator="," close=")">
#{proId}
</foreach>
</if>
AND tcq.pro_id = #{id}
<if test="uploadType!=0">
AND tcq.upload_type = #{uploadType}
</if>
AND tcq.is_active = '1'
</where>
ORDER BY sfr.create_time DESC
</select>
<!--收藏/取消收藏图片-->
<update id="collectData">
<if test="collectType == 1">

View File

@ -1,16 +1,17 @@
let form, laydate, flow,layer,rightPopup;
let form, laydate, flow,layer;
let pageNum = 1, pageSize = 20; // 定义分页
let objParams = {};
function setParams(obj){
objParams = JSON.parse(obj);
layui.config({
base: "../../js/layui-v2.9.14/layui/", //此处路径请自行处理, 可以使用绝对路径
}).extend({
rightPopup: "rightPopup",
}).use(["form", 'laydate', 'flow','layer','rightPopup'], function () {
}).use(["form", 'laydate', 'flow','layer'], function () {
form = layui.form;
laydate = layui.laydate;
flow = layui.flow;
layer = layui.layer;
rightPopup = layui.rightPopup;
dataFlow();
});
}
@ -44,10 +45,12 @@ function dataFlow() {
/**加载图片数据*/
function loadData() {
let returnData = null;
let url = dataUrl + "/backstage/synthesisQuery/getImgList"
let url = dataUrl + "/backstage/synthesisQuery/getProImgList"
let obj = {
pageNum: pageNum,
pageSize: pageSize,
id:objParams.proId,
uploadType: objParams.type
}
let params = {
encryptedData: encryptCBC(JSON.stringify(obj))
@ -71,13 +74,14 @@ function initImgData(list) {
let htmlArr = [];
if (list && list.length > 0) {
$.each(list, function (index, item) {
let filePath = imgUrl + item.compressFilePath + "?token=" + tokens
htmlArr.push("<div class='img-info2'>" +
" <div class='img-viewer layout'>\n" +
" <img src='" + item.compressFilePath + "'>" +
" <img src='" + filePath + "'>" +
" </div>" +
" <div class='hidden-actions3'><div class='hidden-btn layout'>" +
" <div class='layout' onclick='viewImg(" + JSON.stringify(item) + ")'><div class='img-view' title='放大'></div></div>" +
" <div class='layout' onclick='imgDownLoad(" + JSON.stringify(item) + ")'><div title='原图下载' class='img-download'></div></div>" +
" <div class='layout' onclick='imgDownLoad(" + JSON.stringify(item) + ",1)'><div title='原图下载' class='img-download'></div></div>" +
" <div class='layout' onclick='waterImgDownLoad(" + JSON.stringify(item) + ")'><div title='水印下载' class='img-water'></div></div>" +
setCollectImg(item) +
" </div></div>" +
@ -98,66 +102,35 @@ function initImgData(list) {
}
}
// 设置收藏图标
function setCollectData(item) {
if (item.collectStatus === '1') {
return "<img src='../../img/synthesisQuery/collect_check.png'>";
}
return "<img style='display:none;' src='../../img/synthesisQuery/collect_check.png'>";
}
}
/**放大*/
function viewImg(item) {
layer.photos({
shade: 0.5,
footer: false,
photos: {
"title": "图片预览",
"start": 0,
"data": [
{
"pid": 1,
"src": "../../img/synthesisQuery/7.jpg",
}
]
},
});
}
/**放大*/
function imgDownLoad(item) {
alert(item.id)
}
/**水印下载*/
function waterImgDownLoad(item) {
alert(item.id)
}
/**收藏*/
function collectImg(that, item, type) {
if (type === 0) { // 收藏
$(that).next().removeAttr("style");
$(that).css({'display': 'none'})
$(that).parent().parent().prev().find('img').eq(0).removeAttr('style')
let flag = collectData({
collectType: 1,
id: item.id
});
if (flag) {
$(that).next().removeAttr("style");
$(that).css({'display': 'none'})
layer.msg("收藏成功",{icon:1})
}else{
layer.msg("收藏失败",{icon:2})
}
} else if (type === 1) { // 取消收藏
$(that).prev().removeAttr("style");
$(that).css({'display': 'none'});
$(that).parent().parent().prev().find('img').eq(0).css({'display': 'none'})
let flag = collectData({
collectType: 2,
id: item.id
});
if (flag) {
$(that).prev().removeAttr("style");
$(that).css({'display': 'none'});
layer.msg("取消收藏成功",{icon:1})
}else{
layer.msg("取消收藏失败",{icon:2})
}
}
}
/**高级筛选*/
function highSearch(){
rightPopup.rightPopupLayer("../../pages/synthesisQuery/highSearchForm.html", JSON.stringify({}),["45%", "100%"]);
}
/*图片类型查询*/
function queryByType(that,type){
$('.type-num').each(function(){
$(this).removeClass('type-num-check');
})
$(that).addClass('type-num-check');
}

View File

@ -22,4 +22,6 @@
</div>
</body>
<script src="../../js/synthesisQuery/photoView.js" charset="UTF-8" type="text/javascript"></script>
<script src="../../js/synthesisQuery/synthesisQueryAjax.js" charset="UTF-8" type="text/javascript"></script>
<script src="../../js/synthesisQuery/synthesisQueryCommon.js" charset="UTF-8" type="text/javascript"></script>
</html>