diff --git a/src/main/java/com/bonus/imgTool/backstage/controller/SynthesisQueryController.java b/src/main/java/com/bonus/imgTool/backstage/controller/SynthesisQueryController.java index c36306f..20a4228 100644 --- a/src/main/java/com/bonus/imgTool/backstage/controller/SynthesisQueryController.java +++ b/src/main/java/com/bonus/imgTool/backstage/controller/SynthesisQueryController.java @@ -1,9 +1,22 @@ package com.bonus.imgTool.backstage.controller; +import com.bonus.imgTool.annotation.DecryptAndVerify; +import com.bonus.imgTool.annotation.LogAnnotation; +import com.bonus.imgTool.backstage.entity.QueryParamDto; import com.bonus.imgTool.backstage.service.SynthesisQueryService; +import com.bonus.imgTool.model.SysUser; +import com.bonus.imgTool.system.vo.EncryptedReq; +import com.bonus.imgTool.utils.ServerResponse; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; +import java.util.List; + /** * @className:SynthesisQueryController * @author:cwchen @@ -15,5 +28,13 @@ import org.springframework.web.bind.annotation.RestController; @RequestMapping("/backstage/synthesisQuery/") public class SynthesisQueryController { + @Resource(name = "SynthesisQueryService") private SynthesisQueryService synthesisQueryService; + + @PostMapping(value = "getImgList") + @DecryptAndVerify(decryptedClass = QueryParamDto.class) + @LogAnnotation(operModul = "综合查询-照片综合查询", operation = "查询照片", operDesc = "系统级事件",operType="查询") + public ServerResponse getImgList(EncryptedReq data) { + return synthesisQueryService.getImgList(data.getData()); + } } diff --git a/src/main/java/com/bonus/imgTool/backstage/dao/SynthesisQueryDao.java b/src/main/java/com/bonus/imgTool/backstage/dao/SynthesisQueryDao.java index 3f00602..fcc39a2 100644 --- a/src/main/java/com/bonus/imgTool/backstage/dao/SynthesisQueryDao.java +++ b/src/main/java/com/bonus/imgTool/backstage/dao/SynthesisQueryDao.java @@ -1,7 +1,11 @@ package com.bonus.imgTool.backstage.dao; +import com.bonus.imgTool.backstage.entity.QueryParamDto; +import com.bonus.imgTool.backstage.entity.SynthesisQueryVo; import org.springframework.stereotype.Repository; +import java.util.List; + /** * @className:SynthesisQueryDao * @author:cwchen @@ -11,4 +15,12 @@ import org.springframework.stereotype.Repository; */ @Repository(value = "SynthesisQueryDao") public interface SynthesisQueryDao { + /** + * 照片综合查询 + * @param dto + * @return List + * @author cwchen + * @date 2025/3/31 15:56 + */ + List getImgList(QueryParamDto dto); } diff --git a/src/main/java/com/bonus/imgTool/backstage/entity/QueryParamDto.java b/src/main/java/com/bonus/imgTool/backstage/entity/QueryParamDto.java new file mode 100644 index 0000000..0dcbb3e --- /dev/null +++ b/src/main/java/com/bonus/imgTool/backstage/entity/QueryParamDto.java @@ -0,0 +1,23 @@ +package com.bonus.imgTool.backstage.entity; + +import lombok.Data; + +/** + * @className:QueryParamDto + * @author:cwchen + * @date:2025-03-31-15:46 + * @version:1.0 + * @description:前端参数 + */ +@Data +public class QueryParamDto { + + /** + * 1.我的收藏 2.最近上传 + */ + private int queryType; + /**用户id*/ + private long userId; + private int pageNum = 1; + private int pageSize = 10; +} diff --git a/src/main/java/com/bonus/imgTool/backstage/entity/SynthesisQueryVo.java b/src/main/java/com/bonus/imgTool/backstage/entity/SynthesisQueryVo.java index 8c929fd..a92c431 100644 --- a/src/main/java/com/bonus/imgTool/backstage/entity/SynthesisQueryVo.java +++ b/src/main/java/com/bonus/imgTool/backstage/entity/SynthesisQueryVo.java @@ -1,5 +1,10 @@ package com.bonus.imgTool.backstage.entity; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + /** * @className:SynthesisQueryVo * @author:cwchen @@ -7,5 +12,46 @@ package com.bonus.imgTool.backstage.entity; * @version:1.0 * @description:综合查询-vo */ +@Data public class SynthesisQueryVo { + + private String id; + /** + * 原图图片路径 + */ + private String originalFilePath; + /** + * 压缩图片路径 + */ + private String compressFilePath; + /** + * 图片水印路径 + */ + private String watermarkFilePath; + /** + * 上传类型 1.安全违章、2.质量检查、3.安全措施落实、4.协调照片、5.重要事项及宣传照片 + */ + private String uploadType; + + /** + * 上传类型名称 1.安全违章、2.质量检查、3.安全措施落实、4.协调照片、5.重要事项及宣传照片 + */ + private String uploadTypeName; + /** + * 上传时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date uploadTime; + /** + * 资源类型 + */ + private String sourceType; + /** + * 资源类型名称 + */ + private String sourceTypeName; + /** + * 收藏状态 0.未收藏 1.已收藏 + */ + private String collectStatus; } diff --git a/src/main/java/com/bonus/imgTool/backstage/service/SynthesisQueryService.java b/src/main/java/com/bonus/imgTool/backstage/service/SynthesisQueryService.java index bfce8dc..1893366 100644 --- a/src/main/java/com/bonus/imgTool/backstage/service/SynthesisQueryService.java +++ b/src/main/java/com/bonus/imgTool/backstage/service/SynthesisQueryService.java @@ -1,5 +1,8 @@ package com.bonus.imgTool.backstage.service; +import com.bonus.imgTool.backstage.entity.QueryParamDto; +import com.bonus.imgTool.utils.ServerResponse; + /** * @className:SynthesisQueryService * @author:cwchen @@ -8,4 +11,12 @@ package com.bonus.imgTool.backstage.service; * @description:综合查询 */ public interface SynthesisQueryService { + /** + * 照片综合查询 + * @param data + * @return ServerResponse + * @author cwchen + * @date 2025/3/31 15:47 + */ + ServerResponse getImgList(QueryParamDto data); } diff --git a/src/main/java/com/bonus/imgTool/backstage/service/impl/SynthesisQueryServiceImpl.java b/src/main/java/com/bonus/imgTool/backstage/service/impl/SynthesisQueryServiceImpl.java index b04f39d..0c01fdf 100644 --- a/src/main/java/com/bonus/imgTool/backstage/service/impl/SynthesisQueryServiceImpl.java +++ b/src/main/java/com/bonus/imgTool/backstage/service/impl/SynthesisQueryServiceImpl.java @@ -1,10 +1,23 @@ package com.bonus.imgTool.backstage.service.impl; import com.bonus.imgTool.backstage.dao.SynthesisQueryDao; +import com.bonus.imgTool.backstage.entity.QueryParamDto; +import com.bonus.imgTool.backstage.entity.SynthesisQueryVo; import com.bonus.imgTool.backstage.service.SynthesisQueryService; +import com.bonus.imgTool.utils.ServerResponse; +import com.bonus.imgTool.utils.UserUtil; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; +import org.apache.catalina.security.SecurityUtil; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + /** * @className:SynthesisQueryServiceImpl * @author:cwchen @@ -16,5 +29,20 @@ import org.springframework.stereotype.Service; @Slf4j public class SynthesisQueryServiceImpl implements SynthesisQueryService { + @Resource(name = "SynthesisQueryDao") private SynthesisQueryDao synthesisQueryDao; + + @Override + public ServerResponse getImgList(QueryParamDto dto) { + PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); + try { + dto.setUserId(UserUtil.getLoginUser() != null ? UserUtil.getLoginUser().getId() : 0); + List list = Optional.ofNullable(synthesisQueryDao.getImgList(dto)).orElseGet(ArrayList::new); + PageInfo pageInfo = new PageInfo<>(list); + return ServerResponse.createSuccess(pageInfo); + } catch (Exception e) { + log.error(e.toString(), e); + return ServerResponse.createErroe("查询失败"); + } + } } diff --git a/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml b/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml index 5bc7377..1f0cd0a 100644 --- a/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml +++ b/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml @@ -3,6 +3,18 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - + + diff --git a/src/main/resources/static/css/synthesisQuery/synthesisQuery.css b/src/main/resources/static/css/synthesisQuery/synthesisQuery.css new file mode 100644 index 0000000..8cfc13f --- /dev/null +++ b/src/main/resources/static/css/synthesisQuery/synthesisQuery.css @@ -0,0 +1,191 @@ +html, +body { + width: 99.5%; + height: 99%; + margin: 0.15% 0 0 0.25%; + padding: 0; + font-family: 'Alibaba PuHuiTi R'; +} + +.layout { + display: flex; + justify-content: center; + align-items: center; +} + +#main-box { + width: 100%; + height: 100%; + padding: 0.5% 1%; + box-sizing: border-box; + /*background-color: #fff;*/ +} + +#search-box { + width: 100%; + height: 60px; +} + +#type-num-box { + width: 100%; + height: 90px; + justify-content: space-between; +} + +.type-num { + width: 200px; + height: 80px; + border-radius: 6px; + background-color: #fff; +} + +.type-num > div:nth-child(1) { + width: 70%; + height: 100%; + flex-direction: column; + justify-content: space-evenly; +} + +.type-num > div > p:nth-child(1) { + color: #999; +} + +.type-num > div > p:nth-child(2) { + color: #666; + font-size: 20px; + font-weight: bold; +} + +.type-num > div:nth-child(2) { + width: 30%; + height: 100%; +} + +.type-num > div:nth-child(2) > img { + width: 32px; + height: 32px; +} + +#change-type-box { + width: 130px; + height: 60px; + justify-content: space-between; +} + +#change-type-box p { + cursor: pointer; +} + +.checkedElement { + color: #00377a !important; + font-weight: bold; +} + +.noCheckedElement { + color: #999 !important; +} + +#img-box { + width: 100%; + height: calc(100% - 200px); +} + +.layui-flow-more{ + width: 100%; +} + +#ID-flow-demo { + width: 100%; + height: 100%; + justify-content: start; + align-items: start; + flex-wrap: wrap; + overflow-y: auto; +} + +.img-info { + width: 19%; + height: 250px; + margin: 0 1% 1% 0; + background-color: #fff; +} + +.imgData { + width: 100%; + height: 70%; +} + +.imgData img { + width: 100%; + height: 100%; + object-fit: contain; /* 或 contain */ +} + +.imgData2 { + width: 100%; + height: 15%; + justify-content: space-between; +} +.imgData2>p{ + margin: 0 10px; +} +.imgData2>p:nth-child(1){ + color: #999; +} + +.imgData3 { + width: 100%; + height: 15%; + justify-content: start; +} +.imgData3>p{ + margin: 0 10px; +} +.imgData3>p:nth-child(1){ + color: #666; + font-weight: bold; +} + +.img-color1{ + background-color: #FEF1F1; + color: #F36C6C; + padding: 2px 10px; +} + +.img-color2{ + background-color: #EFFBF6; + color: #5AD8A6; + padding: 2px 10px; +} + +.img-color3{ + background-color: #FFF9EA; + color: #FFC328; + padding: 2px 10px; +} + +.img-color4{ + background-color: #FCF2FA; + color: #F66CD7; + padding: 2px 10px; +} + +.img-color5{ + background-color: #E6F9F9; + color: #00CCDD; + padding: 2px 10px; +} + +.layui-input:hover, +.layui-select:hover, +.layui-textarea:hover { + border-color: #00377a !important; + box-shadow: 0 0 0 3px rgba(0, 55, 122, .08) +} + +.layui-input:focus, +.layui-select:focus, +.layui-textarea:focus { + border-color: #00377a !important; + box-shadow: 0 0 0 3px rgba(0, 55, 122, .08) +} \ No newline at end of file diff --git a/src/main/resources/static/img/synthesisQuery/1.png b/src/main/resources/static/img/synthesisQuery/1.png new file mode 100644 index 0000000..d304ce0 Binary files /dev/null and b/src/main/resources/static/img/synthesisQuery/1.png differ diff --git a/src/main/resources/static/img/synthesisQuery/2.png b/src/main/resources/static/img/synthesisQuery/2.png new file mode 100644 index 0000000..4233751 Binary files /dev/null and b/src/main/resources/static/img/synthesisQuery/2.png differ diff --git a/src/main/resources/static/img/synthesisQuery/3.png b/src/main/resources/static/img/synthesisQuery/3.png new file mode 100644 index 0000000..37b0600 Binary files /dev/null and b/src/main/resources/static/img/synthesisQuery/3.png differ diff --git a/src/main/resources/static/img/synthesisQuery/4.png b/src/main/resources/static/img/synthesisQuery/4.png new file mode 100644 index 0000000..7f1a17f Binary files /dev/null and b/src/main/resources/static/img/synthesisQuery/4.png differ diff --git a/src/main/resources/static/img/synthesisQuery/5.png b/src/main/resources/static/img/synthesisQuery/5.png new file mode 100644 index 0000000..db125df Binary files /dev/null and b/src/main/resources/static/img/synthesisQuery/5.png differ diff --git a/src/main/resources/static/img/synthesisQuery/6.png b/src/main/resources/static/img/synthesisQuery/6.png new file mode 100644 index 0000000..2bc5375 Binary files /dev/null and b/src/main/resources/static/img/synthesisQuery/6.png differ diff --git a/src/main/resources/static/img/synthesisQuery/7.jpg b/src/main/resources/static/img/synthesisQuery/7.jpg new file mode 100644 index 0000000..bb9e92c Binary files /dev/null and b/src/main/resources/static/img/synthesisQuery/7.jpg differ diff --git a/src/main/resources/static/js/synthesisQuery/synthesisQuery.js b/src/main/resources/static/js/synthesisQuery/synthesisQuery.js new file mode 100644 index 0000000..b37da43 --- /dev/null +++ b/src/main/resources/static/js/synthesisQuery/synthesisQuery.js @@ -0,0 +1,110 @@ +let form, laydate, flow; +let pageNum = 1, pageSize = 15; // 定义分页 +let queryType = 2; // 默认最近上传 +layui.use(["form", 'laydate', 'flow'], function () { + form = layui.form; + laydate = layui.laydate; + flow = layui.flow; + flow.load({ + elem: '#ID-flow-demo', // 流加载容器 + scrollElem: '#ID-flow-demo', // 滚动条所在元素,一般不用填,此处只是演示需要。 + end: '数据加载完毕', + direction:'bottom', + done: function (page, next) { // 执行下一页的回调 + console.error(page); + pageNum = page; + let lis = []; + let returnData = loadData(); + if (returnData != null) { + lis = initImgData(returnData.data.list) + next(lis.join(''), page < returnData.data.total/15); + } + } + }); + +}); + + + +/*切换查询类型*/ +function changeType(type, that) { + queryType = type; + pageNum = 1; + $(that).removeClass("noCheckedElement"); + if ($(that).hasClass("checkedElement") && type === 1) { + $(that).next().removeClass("checkedElement").addClass("noCheckedElement"); + } else if (!$(that).hasClass("checkedElement") && type === 1) { + $(that).addClass("checkedElement"); + $(that).next().removeClass("checkedElement").addClass("noCheckedElement"); + } else if ($(that).hasClass("checkedElement") && type === 2) { + $(that).prev().removeClass("checkedElement").addClass("noCheckedElement"); + } else if (!$(that).hasClass("checkedElement") && type === 2) { + $(that).addClass("checkedElement"); + $(that).prev().removeClass("checkedElement").addClass("noCheckedElement"); + } + $('#ID-flow-demo').empty(); + flow.load({ + elem: '#ID-flow-demo', // 流加载容器 + scrollElem: '#ID-flow-demo', // 滚动条所在元素,一般不用填,此处只是演示需要。 + end: '数据加载完毕', + direction:'bottom', + done: function (page, next) { // 执行下一页的回调 + console.error(page); + let lis = []; + let returnData = loadData(); + if (returnData != null) { + lis = initImgData(returnData.data.list) + next(lis.join(''), page < returnData.data.total/15); + } + } + }); +} + +/**加载图片数据*/ +function loadData() { + let returnData = null; + let url = dataUrl + "/backstage/synthesisQuery/getImgList" + let obj = { + pageNum: pageNum, + pageSize: pageSize, + queryType: queryType + } + let params = { + encryptedData: encryptCBC(JSON.stringify(obj)) + } + ajaxRequest(url, "POST", params, false, function () { + }, function (result) { + if (result.status === 200) { + console.log(result) + returnData = result; + } else { + layer.msg(result.msg, {icon: 2}) + } + }, function (xhr) { + error(xhr) + }); + return returnData; +} + +/**渲染图片*/ +function initImgData(list) { + let htmlArr = []; + if (list && list.length > 0) { + $.each(list, function (index, item) { + htmlArr.push("
" + + "
\n" + + " " + + "
" + + "
" + + "

" + item.uploadTime + "

" + + "

" + item.uploadTypeName + "

" + + "
" + + "
" + + "

" + item.sourceTypeName + "

" + + "

" + item.id.substr(0,10) + "

" + + "
" + + "
"); + }) + } + return htmlArr; +} \ No newline at end of file diff --git a/src/main/resources/static/pages/synthesisQuery/synthesisQuery.html b/src/main/resources/static/pages/synthesisQuery/synthesisQuery.html new file mode 100644 index 0000000..5665796 --- /dev/null +++ b/src/main/resources/static/pages/synthesisQuery/synthesisQuery.html @@ -0,0 +1,114 @@ + + + + + 照片综合查询 + + + + + + + + + + + + +
+ + + +
+
+
+

总照片数

+

1250

+
+
+ +
+
+
+
+

安全违章

+

1250

+
+
+ +
+
+
+
+

质量检查

+

1250

+
+
+ +
+
+
+
+

安全措施落实

+

1250

+
+
+ +
+
+
+
+

协调照片

+

1250

+
+
+ +
+
+
+
+

重要事项及宣传类

+

1250

+
+
+ +
+
+
+ +
+

我的收藏

+

最近上传

+
+
+
+ +
+
+
+ + + \ No newline at end of file