失物招领

This commit is contained in:
zjf committed 2025-05-19 18:54:55 +08:00
1 parent e1f343c2b4
commit 8cf0d92343
3 files changed
+91 -1

No files matched your search

@@ -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:";
}
@@ -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;
}
@@ -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<LostAndFoundEntity> 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<LostAndFoundEntity> 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<LostAndFoundEntity> wrapper = Wrappers.lambdaQuery();
wrapper.like(StrUtil.isNotBlank(lostAndFound.getTitle()),LostAndFoundEntity::getTitle,lostAndFound.getTitle());
Page<LostAndFoundEntity> pageData = lostAndFoundService.page(page, wrapper);
List<LostAndFoundEntity> records = pageData.getRecords();
Page<LostAndFoundPageVo> lostAndFoundPageVoPage = new Page<>();
List<LostAndFoundPageVo> 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);
}
}