项目分类统计详情
This commit is contained in:
parent
ddc2291b6e
commit
35710a7742
|
|
@ -98,4 +98,11 @@ public class SynthesisQueryController {
|
|||
return synthesisQueryService.getProImgList(data.getData());
|
||||
}
|
||||
|
||||
@PostMapping(value = "getListData")
|
||||
@ApiOperation("项目分类统计-查看列表数据")
|
||||
@DecryptAndVerify(decryptedClass = QueryParamDto.class)
|
||||
public ServerResponse getListData(EncryptedReq<QueryParamDto> data) {
|
||||
return synthesisQueryService.getListData(data.getData());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
package com.bonus.imgTool.backstage.dao;
|
||||
|
||||
import com.bonus.imgTool.backstage.entity.ComprehensiveQueryVo;
|
||||
import com.bonus.imgTool.backstage.entity.QueryParamDto;
|
||||
import com.bonus.imgTool.backstage.entity.SynthesisNumVo;
|
||||
import com.bonus.imgTool.backstage.entity.SynthesisQueryVo;
|
||||
import com.bonus.imgTool.backstage.entity.ProClassifyStatisticsVo;
|
||||
import com.bonus.imgTool.backstage.entity.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -87,4 +84,22 @@ public interface SynthesisQueryDao {
|
|||
* @date 2025/4/3 16:28
|
||||
*/
|
||||
List<SynthesisQueryVo> getProImgList(QueryParamDto dto);
|
||||
|
||||
/**
|
||||
* 项目分类统计-查看列表
|
||||
* @param dto
|
||||
* @return List<ProClassifyStatisticDetailVo>
|
||||
* @author cwchen
|
||||
* @date 2025/4/6 18:08
|
||||
*/
|
||||
List<ProClassifyStatisticDetailVo> getListData(QueryParamDto dto);
|
||||
|
||||
/**
|
||||
* 获取图片
|
||||
* @param detailVo
|
||||
* @return List<SynthesisQueryVo>
|
||||
* @author cwchen
|
||||
* @date 2025/4/6 18:35
|
||||
*/
|
||||
List<SynthesisQueryVo> getImgs(@Param("params") ProClassifyStatisticDetailVo detailVo, @Param("type") int type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,87 @@
|
|||
package com.bonus.imgTool.backstage.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:ProClassifyStatisticDetailVo
|
||||
* @author:cwchen
|
||||
* @date:2025-04-03-15:31
|
||||
* @version:1.0
|
||||
* @description:项目分类统计-vo
|
||||
*/
|
||||
@Data
|
||||
public class ProClassifyStatisticDetailVo {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 违章时间/检查时间/时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date vioDate;
|
||||
|
||||
/**
|
||||
* 违章地点/检查地点/建设地点
|
||||
*/
|
||||
private String vioPlace;
|
||||
|
||||
/**
|
||||
* 违章描述/检查描述
|
||||
*/
|
||||
private String vioDesc;
|
||||
/**
|
||||
* 整改说明
|
||||
*/
|
||||
private String rectDesc;
|
||||
|
||||
/**
|
||||
* 上传类型:1.安全违章、2.质量检查、3.安全措施落实、4.协调照片、5.重要事项及宣传
|
||||
*/
|
||||
private String uploadType;
|
||||
|
||||
/**
|
||||
* 上传类型名称
|
||||
*/
|
||||
private String uploadTypeName;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 建设前描述
|
||||
*/
|
||||
private String buildBeforeDesc;
|
||||
/**
|
||||
* 建设中描述
|
||||
*/
|
||||
private String buildUnderDesc;
|
||||
/**
|
||||
* 恢复后描述
|
||||
*/
|
||||
private String buildAfterDesc;
|
||||
|
||||
/**
|
||||
* 整改状态:0.未整改、1.已整改
|
||||
*/
|
||||
private String rectStatus;
|
||||
|
||||
private List<SynthesisQueryVo> photoList;
|
||||
|
||||
private List<SynthesisQueryVo> photoList2;
|
||||
|
||||
private List<SynthesisQueryVo> photoList3;
|
||||
|
||||
private Long userId;
|
||||
|
||||
}
|
||||
|
|
@ -91,4 +91,13 @@ public interface SynthesisQueryService {
|
|||
* @date 2025/4/3 16:27
|
||||
*/
|
||||
ServerResponse getProImgList(QueryParamDto data);
|
||||
|
||||
/**
|
||||
* 项目分类统计-查看列表
|
||||
* @param data
|
||||
* @return ServerResponse
|
||||
* @author cwchen
|
||||
* @date 2025/4/3 16:27
|
||||
*/
|
||||
ServerResponse getListData(QueryParamDto data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,4 +211,60 @@ public class SynthesisQueryServiceImpl implements SynthesisQueryService {
|
|||
return ServerResponse.createErroe("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponse getListData(QueryParamDto dto) {
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||
try {
|
||||
Long userId = Optional.ofNullable(UserUtil.getLoginUser()).map(LoginUser::getId).orElse(0L);
|
||||
dto.setUserId(userId);
|
||||
List<ProClassifyStatisticDetailVo> list = Optional.ofNullable(synthesisQueryDao.getListData(dto)).orElseGet(ArrayList::new);
|
||||
PageHelper.clearPage();
|
||||
list.forEach(item->{
|
||||
item.setUserId(userId);
|
||||
ProClassifyStatisticDetailVo detailVo = setDataList(item);
|
||||
item.setPhotoList(detailVo.getPhotoList());
|
||||
item.setPhotoList2(detailVo.getPhotoList2());
|
||||
item.setPhotoList3(detailVo.getPhotoList3());
|
||||
});
|
||||
PageInfo<ProClassifyStatisticDetailVo> pageInfo = new PageInfo<>(list);
|
||||
return ServerResponse.createSuccess(pageInfo);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return ServerResponse.createErroe("查询失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询图片上传类型:1.安全违章、2.质量检查、3.安全措施落实、4.协调照片、5.重要事项及宣传
|
||||
* @param detailVo
|
||||
* @return ProClassifyStatisticDetailVo
|
||||
* @author cwchen
|
||||
* @date 2025/4/6 18:44
|
||||
*/
|
||||
public ProClassifyStatisticDetailVo setDataList(ProClassifyStatisticDetailVo detailVo){
|
||||
try {
|
||||
switch (detailVo.getUploadType()){
|
||||
case "1":
|
||||
detailVo.setPhotoList(Optional.ofNullable(synthesisQueryDao.getImgs(detailVo,1)).orElseGet(ArrayList::new));
|
||||
detailVo.setPhotoList2(Optional.ofNullable(synthesisQueryDao.getImgs(detailVo,2)).orElseGet(ArrayList::new));
|
||||
break;
|
||||
case "2":
|
||||
detailVo.setPhotoList(Optional.ofNullable(synthesisQueryDao.getImgs(detailVo,3)).orElseGet(ArrayList::new));
|
||||
detailVo.setPhotoList2(Optional.ofNullable(synthesisQueryDao.getImgs(detailVo,4)).orElseGet(ArrayList::new));
|
||||
case "3":
|
||||
detailVo.setPhotoList(Optional.ofNullable(synthesisQueryDao.getImgs(detailVo,5)).orElseGet(ArrayList::new));
|
||||
case "4":
|
||||
detailVo.setPhotoList(Optional.ofNullable(synthesisQueryDao.getImgs(detailVo,6)).orElseGet(ArrayList::new));
|
||||
detailVo.setPhotoList(Optional.ofNullable(synthesisQueryDao.getImgs(detailVo,7)).orElseGet(ArrayList::new));
|
||||
detailVo.setPhotoList(Optional.ofNullable(synthesisQueryDao.getImgs(detailVo,8)).orElseGet(ArrayList::new));
|
||||
case "5":
|
||||
detailVo.setPhotoList(Optional.ofNullable(synthesisQueryDao.getImgs(detailVo,9)).orElseGet(ArrayList::new));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return detailVo;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@
|
|||
</if>
|
||||
</if>
|
||||
<if test="searchType == 2">
|
||||
<if test="uploadType!=0">
|
||||
<if test="uploadType!=null and uploadType!=0">
|
||||
AND tcq.upload_type = #{uploadType}
|
||||
</if>
|
||||
</if>
|
||||
|
|
@ -281,13 +281,70 @@
|
|||
</foreach>
|
||||
</if>
|
||||
AND tcq.pro_id = #{id}
|
||||
<if test="uploadType!=0">
|
||||
<if test="uploadType!=null and uploadType!=0">
|
||||
AND tcq.upload_type = #{uploadType}
|
||||
</if>
|
||||
AND tcq.is_active = '1'
|
||||
</where>
|
||||
ORDER BY sfr.create_time DESC
|
||||
</select>
|
||||
<!--项目分类统计-查看列表-->
|
||||
<select id="getListData" resultType="com.bonus.imgTool.backstage.entity.ProClassifyStatisticDetailVo">
|
||||
SELECT tcq.id AS id,
|
||||
tcq.vio_date AS vioDate,
|
||||
tcq.vio_place AS vioPlace,
|
||||
tcq.vio_desc AS vioDesc,
|
||||
tcq.rect_desc AS rectDesc,
|
||||
tcq.upload_type AS uploadType,
|
||||
CASE tcq.upload_type WHEN '1' THEN '安全违章' WHEN '2' THEN '质量检查' WHEN '3' THEN '安全措施落实'
|
||||
WHEN '4' THEN '协调照片' WHEN '5' THEN '重要事项及宣传类' ELSE '' END AS uploadTypeName,
|
||||
tcq.title,
|
||||
tcq.content,
|
||||
tcq.build_before_desc AS buildBeforeDesc,
|
||||
tcq.build_under_desc AS buildUnderDesc,
|
||||
tcq.build_after_desc AS buildAfterDesc,
|
||||
tcq.rect_status AS rectStatus
|
||||
FROM tb_comprehensive_query tcq
|
||||
<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!=null and uploadType!=0">
|
||||
AND tcq.upload_type = #{uploadType}
|
||||
</if>
|
||||
AND tcq.is_active = '1'
|
||||
</where>
|
||||
ORDER BY tcq.update_time DESC
|
||||
</select>
|
||||
<!--获取图片-->
|
||||
<select id="getImgs" 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,
|
||||
sfr.source_type AS sourceType,
|
||||
A.dict_name AS sourceTypeName,
|
||||
IF(tpc.file_resource_id IS NULL,'0','1') AS collectStatus
|
||||
FROM sys_file_resource sfr
|
||||
LEFT JOIN tb_photo_collect tpc ON sfr.id = tpc.file_resource_id AND tpc.collect_user_id = #{params.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>
|
||||
AND sfr.source_id = #{params.id} AND sfr.upload_type = #{params.uploadType} AND sfr.source_type = #{type} AND sfr.is_active = '1'
|
||||
</where>
|
||||
</select>
|
||||
<!--收藏/取消收藏图片-->
|
||||
<update id="collectData">
|
||||
<if test="collectType == 1">
|
||||
|
|
|
|||
|
|
@ -67,13 +67,11 @@ function dataFlow(queryParams) {
|
|||
function loadData(queryParams) {
|
||||
let returnData = null;
|
||||
let url = null;
|
||||
let obj = {}
|
||||
let obj = queryParams;
|
||||
if (queryType === 2) { // 图片
|
||||
url = dataUrl + "/backstage/synthesisQuery/getImgList";
|
||||
obj = queryParams;
|
||||
} else { // 列表
|
||||
url = dataUrl + "/backstage/synthesisQuery/getImgList";
|
||||
obj = queryParams;
|
||||
url = dataUrl + "/backstage/synthesisQuery/getListData";
|
||||
}
|
||||
let params = {
|
||||
encryptedData: encryptCBC(JSON.stringify(obj))
|
||||
|
|
@ -154,21 +152,24 @@ function initImgData(list) {
|
|||
|
||||
/**1.图片 2.列表*/
|
||||
function changeType(that, type) {
|
||||
let queryParams = {
|
||||
pageNum: pageNum,
|
||||
pageSize: pageSize,
|
||||
queryType: queryType,
|
||||
id:objParams.proId
|
||||
}
|
||||
if (type === 2) {
|
||||
$(that).attr('src', '../../img/synthesisQuery/photo_check.png');
|
||||
$(that).next().attr('src', '../../img/synthesisQuery/list.png');
|
||||
} else {
|
||||
$(that).attr('src', '../../img/synthesisQuery/list_check.png');
|
||||
$(that).prev().attr('src', '../../img/synthesisQuery/photo.png');
|
||||
queryParams.pageNum = pageNum2;
|
||||
queryParams.pageSize = pageSize2;
|
||||
}
|
||||
queryType = type;
|
||||
resetData();
|
||||
searchData({
|
||||
pageNum: pageNum,
|
||||
pageSize: pageSize,
|
||||
queryType: queryType,
|
||||
id:objParams.proId
|
||||
});
|
||||
searchData(queryParams);
|
||||
}
|
||||
/**渲染列表图片*/
|
||||
function initListData(list) {
|
||||
|
|
@ -177,7 +178,7 @@ function initListData(list) {
|
|||
$.each(list, function (index, item) {
|
||||
let html = "<div class='list-info'>" +
|
||||
" <div class='info-data layout'>" +
|
||||
" <p>" + item.uploadTime + "</p>" +
|
||||
" <p>" + item.vioDate + "</p>" +
|
||||
" <p class='img-color" + (item.uploadType) + "'>" + item.uploadTypeName + "</p>" +
|
||||
" </div>" +
|
||||
setBasicInfo(item) +
|
||||
|
|
@ -194,85 +195,86 @@ function initListData(list) {
|
|||
if (item.uploadType === '1') { // 安全违章
|
||||
html += "<div class='info-data2 layout'>" +
|
||||
"<p>违章地点:</p>" +
|
||||
"<p>" + item.id + "</p>" +
|
||||
"<p>" + item.vioPlace + "</p>" +
|
||||
"</div>" +
|
||||
"<div class='info-data2 layout'>" +
|
||||
"<p>违章描述:</p>" +
|
||||
"<p>施工人员未正确佩戴安全帽,存在安全隐患</p>" +
|
||||
"<p>"+item.vioDesc+"</p>" +
|
||||
"</div>" +
|
||||
"<div class='info-img'>" +
|
||||
setImgData() +
|
||||
setImgData(item,item.photoList) +
|
||||
"</div>" +
|
||||
setRectData(item);
|
||||
} else if (item.uploadType === '2') { // 质量检测
|
||||
html += "<div class='info-data2 layout'>" +
|
||||
"<p>检查地点</p>" +
|
||||
"<p>工地 A 区施工现场 3 号楼</p>" +
|
||||
"<p>"+item.vioPlace+"</p>" +
|
||||
"</div>" +
|
||||
"<div class='info-data2 layout'>" +
|
||||
"<p>检查描述:</p>" +
|
||||
"<p>施工人员未正确佩戴安全帽,存在安全隐患</p>" +
|
||||
"<p>"+item.vioDesc+"</p>" +
|
||||
"</div>" +
|
||||
"<div class='info-img'>" +
|
||||
setImgData() +
|
||||
setImgData(item,item.photoList) +
|
||||
"</div>" +
|
||||
setRectData(item);
|
||||
} else if (item.uploadType === '3') { // 安全措施落实
|
||||
html += "<div class='info-data2 layout'>" +
|
||||
"<p>检查地点</p>" +
|
||||
"<p>工地 A 区施工现场 3 号楼</p>" +
|
||||
"<p>"+item.vioPlace+"</p>" +
|
||||
"</div>" +
|
||||
"<div class='info-data2 layout'>" +
|
||||
"<p>检查描述:</p>" +
|
||||
"<p>施工人员未正确佩戴安全帽,存在安全隐患</p>" +
|
||||
"<p>"+item.vioDesc+"</p>" +
|
||||
"</div>" +
|
||||
"<div class='info-img'>" +
|
||||
setImgData() +
|
||||
setImgData(item,item.photoList) +
|
||||
"</div>";
|
||||
} else if (item.uploadType === '4') { // 协调照片
|
||||
html += "<div class='info-data2 layout'>" +
|
||||
"<p>建设前描述</p>" +
|
||||
"<p>工地 A 区施工现场 3 号楼</p>" +
|
||||
"<p>"+item.buildBeforeDesc+"</p>" +
|
||||
"</div>" +
|
||||
"<div class='info-img'>" +
|
||||
setImgData() +
|
||||
setImgData(item,item.photoList) +
|
||||
"</div>" +
|
||||
"<div class='info-data2 layout'>" +
|
||||
"<p>建设中描述:</p>" +
|
||||
"<p>施工人员未正确佩戴安全帽,存在安全隐患</p>" +
|
||||
"<p>"+item.buildUnderDesc+"</p>" +
|
||||
"</div>" +
|
||||
"<div class='info-img'>" +
|
||||
setImgData() +
|
||||
setImgData(item,item.photoList2) +
|
||||
"</div>" +
|
||||
"<div class='info-data2 layout'>" +
|
||||
"<p>恢复后描述:</p>" +
|
||||
"<p>施工人员未正确佩戴安全帽,存在安全隐患</p>" +
|
||||
"<p>"+item.buildAfterDesc+"</p>" +
|
||||
"</div>" +
|
||||
"<div class='info-img'>" +
|
||||
setImgData() +
|
||||
setImgData(item,item.photoList3) +
|
||||
"</div>";
|
||||
|
||||
} else if (item.uploadType === '5') { // 重要事项及宣传类
|
||||
html += "<div class='info-data2 layout'>" +
|
||||
"<p>标题</p>" +
|
||||
"<p>工地 A 区施工现场 3 号楼</p>" +
|
||||
"<p>"+item.title+"</p>" +
|
||||
"</div>" +
|
||||
"<div class='info-data2 layout'>" +
|
||||
"<p>内容:</p>" +
|
||||
"<p>施工人员未正确佩戴安全帽,存在安全隐患</p>" +
|
||||
"<p>"+item.content+"</p>" +
|
||||
"</div>" +
|
||||
"<div class='info-img'>" +
|
||||
setImgData() +
|
||||
setImgData(item,item.photoList) +
|
||||
"</div>";
|
||||
}
|
||||
return html;
|
||||
|
||||
function setImgData() {
|
||||
let list = [{compressFilePath: '../../img/synthesisQuery/7.jpg'}, {compressFilePath: '../../img/synthesisQuery/7.jpg'}, {compressFilePath: '../../img/synthesisQuery/7.jpg'}, {compressFilePath: '../../img/synthesisQuery/7.jpg'}, {compressFilePath: '../../img/synthesisQuery/7.jpg'}, {compressFilePath: '../../img/synthesisQuery/7.jpg'}];
|
||||
function setImgData(obj,list) {
|
||||
let cent = '';
|
||||
$.each(list, function (index, item) {
|
||||
item.proName = obj.proName;
|
||||
let filePath = imgUrl + item.compressFilePath + "?token=" + tokens
|
||||
cent += "<div class='img-data'>" +
|
||||
"<img src=" + item.compressFilePath + ">" +
|
||||
"<img src=" + filePath + ">" +
|
||||
"<div class='hidden-actions2'><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) + ",1)'><div title='原图下载' class='img-download'></div></div>" +
|
||||
|
|
@ -290,10 +292,10 @@ function initListData(list) {
|
|||
if (item.rectStatus === '1') { // 已整改
|
||||
cent2 += "<div class='info-data2 layout'>" +
|
||||
"<p>整改说明:</p>" +
|
||||
"<p>施工人员已进行安全教育</p>" +
|
||||
"<p>"+item.rectDesc+"</p>" +
|
||||
"</div>" +
|
||||
"<div class='info-img'>" +
|
||||
setImgData() +
|
||||
setImgData(item,item.photoList2) +
|
||||
"</div>";
|
||||
}
|
||||
return cent2;
|
||||
|
|
|
|||
Loading…
Reference in New Issue