From 8cf0d92343a92e1834b90b38ec88be7e899b4ebf Mon Sep 17 00:00:00 2001 From: zjf <1799650030@qq.com> Date: Mon, 19 May 2025 18:54:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=B1=E7=89=A9=E6=8B=9B=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/constant/CacheConstants.java | 4 ++ .../lostandfound/app/LostAndFoundPageVo.java | 58 +++++++++++++++++++ .../controller/LostAndFoundController.java | 30 +++++++++- 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 pjcloud-integrated/pjcloud-integrated-api/src/main/java/com/bsd/pjcloud/integrated/vo/lostandfound/app/LostAndFoundPageVo.java diff --git a/pjcloud-common/pjcloud-common-core/src/main/java/com/bsd/pjcloud/common/core/constant/CacheConstants.java b/pjcloud-common/pjcloud-common-core/src/main/java/com/bsd/pjcloud/common/core/constant/CacheConstants.java index a497f05ae..c1bee2b88 100644 --- a/pjcloud-common/pjcloud-common-core/src/main/java/com/bsd/pjcloud/common/core/constant/CacheConstants.java +++ b/pjcloud-common/pjcloud-common-core/src/main/java/com/bsd/pjcloud/common/core/constant/CacheConstants.java @@ -145,4 +145,8 @@ public interface CacheConstants { String THIRDPARTY_ZY_SELF_TOKEN = "thirdparty:zy:self_token:"; /* ************************************* end 第三方对接相关 end ************************************* */ + + + /** mfa */ + String SMS_CODE_KEY="sms_code:"; } diff --git a/pjcloud-integrated/pjcloud-integrated-api/src/main/java/com/bsd/pjcloud/integrated/vo/lostandfound/app/LostAndFoundPageVo.java b/pjcloud-integrated/pjcloud-integrated-api/src/main/java/com/bsd/pjcloud/integrated/vo/lostandfound/app/LostAndFoundPageVo.java new file mode 100644 index 000000000..444bb24cd --- /dev/null +++ b/pjcloud-integrated/pjcloud-integrated-api/src/main/java/com/bsd/pjcloud/integrated/vo/lostandfound/app/LostAndFoundPageVo.java @@ -0,0 +1,58 @@ +package com.bsd.pjcloud.integrated.vo.lostandfound.app; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDate; + +@Data +public class LostAndFoundPageVo { + + /** + * id + */ + @Schema(description="id") + private Long id; + + /** + * 标题 + */ + @Schema(description="标题") + private String title; + + /** + * 图片 + */ + @Schema(description="图片") + private String picUrl; + + + /** + * 描述 + */ + @Schema(description="描述") + private String description; + + + /** + * 发现日期 + */ + @Schema(description="发现日期") + private LocalDate dateFound; + + + /** + * 发现地点 + */ + @Schema(description="发现地点") + private String location; + + /** + * 状态 + */ + @Schema(description="状态") + private String status; + +} \ No newline at end of file diff --git a/pjcloud-integrated/pjcloud-integrated-biz/src/main/java/com/bsd/pjcloud/integrated/controller/LostAndFoundController.java b/pjcloud-integrated/pjcloud-integrated-biz/src/main/java/com/bsd/pjcloud/integrated/controller/LostAndFoundController.java index f8510ad02..353939d51 100644 --- a/pjcloud-integrated/pjcloud-integrated-biz/src/main/java/com/bsd/pjcloud/integrated/controller/LostAndFoundController.java +++ b/pjcloud-integrated/pjcloud-integrated-biz/src/main/java/com/bsd/pjcloud/integrated/controller/LostAndFoundController.java @@ -6,11 +6,13 @@ import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.bsd.pjcloud.common.core.util.BeanUtils; import com.bsd.pjcloud.common.core.util.R; import com.bsd.pjcloud.common.log.annotation.SysLog; import com.bsd.pjcloud.common.security.util.SecurityUtils; import com.bsd.pjcloud.integrated.entity.LostAndFoundEntity; import com.bsd.pjcloud.integrated.service.LostAndFoundService; +import com.bsd.pjcloud.integrated.vo.lostandfound.app.LostAndFoundPageVo; import org.springframework.security.access.prepost.PreAuthorize; import com.bsd.pjcloud.common.excel.annotation.ResponseExcel; import io.swagger.v3.oas.annotations.security.SecurityRequirement; @@ -49,7 +51,6 @@ public class LostAndFoundController { @GetMapping("/page" ) @PreAuthorize("@pms.hasPermission('integrated_lostAndFound_view')" ) public R getLostAndFoundPage(@ParameterObject Page page, @ParameterObject LostAndFoundEntity lostAndFound) { - lostAndFound.setDeptId(SecurityUtils.getUser().getDeptId()); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); wrapper.like(StrUtil.isNotBlank(lostAndFound.getTitle()),LostAndFoundEntity::getTitle,lostAndFound.getTitle()); wrapper.eq(StrUtil.isNotBlank(lostAndFound.getStatus()),LostAndFoundEntity::getStatus,lostAndFound.getStatus()); @@ -79,6 +80,7 @@ public class LostAndFoundController { @PostMapping @PreAuthorize("@pms.hasPermission('integrated_lostAndFound_add')" ) public R save(@RequestBody LostAndFoundEntity lostAndFound) { + lostAndFound.setDeptId(SecurityUtils.getUser().getDeptId()); return R.ok(lostAndFoundService.save(lostAndFound)); } @@ -121,4 +123,30 @@ public class LostAndFoundController { public List export(LostAndFoundEntity lostAndFound,Long[] ids) { return lostAndFoundService.list(Wrappers.lambdaQuery(lostAndFound).in(ArrayUtil.isNotEmpty(ids), LostAndFoundEntity::getId, ids)); } + + + /**-------------------------------APP--------------------------*/ + /** + * app分页查询 + * @param page 分页对象 + * @param lostAndFound 失物招领 + * @return + */ + @Operation(summary = "失物招领app分页查询" , description = "物招领app分页查询" ) + @GetMapping("/app/page" ) + public R getLostAndFoundAppPage(@ParameterObject Page page, @ParameterObject LostAndFoundEntity lostAndFound) { + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); + wrapper.like(StrUtil.isNotBlank(lostAndFound.getTitle()),LostAndFoundEntity::getTitle,lostAndFound.getTitle()); + Page pageData = lostAndFoundService.page(page, wrapper); + List records = pageData.getRecords(); + + Page lostAndFoundPageVoPage = new Page<>(); + List lostAndFoundPageVos = BeanUtils.toBean(records, LostAndFoundPageVo.class); + lostAndFoundPageVoPage.setRecords(lostAndFoundPageVos); + lostAndFoundPageVoPage.setTotal(pageData.getTotal()); + lostAndFoundPageVoPage.setCurrent(pageData.getCurrent()); + lostAndFoundPageVoPage.setSize(pageData.getSize()); + return R.ok(lostAndFoundPageVoPage); + } + } \ No newline at end of file