修改查看检验日志返回接口的参数

This commit is contained in:
lxd 2025-04-21 16:19:02 +08:00
parent a0ac54a2dc
commit 2de54946bb
4 changed files with 23 additions and 5 deletions

View File

@ -53,11 +53,11 @@ public class InspectApplylogController {
@GetMapping("/ApplylogsByIdcard") @GetMapping("/ApplylogsByIdcard")
@Operation(summary = "获得检验单日志记录") @Operation(summary = "获得检验单日志记录")
public CommonResult<List<InspectApplylogDO>> getLatestApplylogsByIdcard(@RequestParam("idcard") String idcard) public CommonResult<List<InspectApplylogSimpleRespVO>> getLatestApplylogsByIdcard(@RequestParam("idcard") String idcard)
{ {
if(idcard!=null) if(idcard!=null)
{ {
List<InspectApplylogDO> inspectApplylogDOS= applylogService .getLatestApplylogsByIdcard(idcard); List<InspectApplylogSimpleRespVO> inspectApplylogDOS= applylogService .getLatestApplylogsByIdcard(idcard);
return success(inspectApplylogDOS); return success(inspectApplylogDOS);
} }
else else

View File

@ -0,0 +1,17 @@
package cn.iocoder.yudao.module.inspect.controller.admin.inspectapplylog.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "检验单日志记录简单响应 VO")
@Data
public class InspectApplylogSimpleRespVO {
@Schema(description = "idcard")
private Integer idcard;
@Schema(description = "json")
private String json;
}

View File

@ -31,7 +31,7 @@ public interface InspectApplylogService {
/* /*
* 通过身份证获取日志消息消息记录 返回最新的2条 * 通过身份证获取日志消息消息记录 返回最新的2条
* */ * */
List<InspectApplylogDO> getLatestApplylogsByIdcard(String idcard); List<InspectApplylogSimpleRespVO> getLatestApplylogsByIdcard(String idcard);
/** /**
* 删除创建检验单日志记录 * 删除创建检验单日志记录

View File

@ -46,12 +46,13 @@ public class InspectApplylogServiceImpl implements InspectApplylogService {
applylogMapper.updateById(updateObj); applylogMapper.updateById(updateObj);
} }
@Override @Override
public List<InspectApplylogDO> getLatestApplylogsByIdcard(String idcard) { public List<InspectApplylogSimpleRespVO> getLatestApplylogsByIdcard(String idcard) {
QueryWrapper<InspectApplylogDO> queryWrapper = new QueryWrapper<>(); QueryWrapper<InspectApplylogDO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("idcard", idcard) queryWrapper.eq("idcard", idcard)
.orderByDesc("time") // Time 字段降序排序 .orderByDesc("time") // Time 字段降序排序
.last("LIMIT 2"); // 限制结果数量为 2如果需要多条可以调整 LIMIT 的值 .last("LIMIT 2"); // 限制结果数量为 2如果需要多条可以调整 LIMIT 的值
return applylogMapper.selectList(queryWrapper); List<InspectApplylogDO> applylogs = applylogMapper.selectList(queryWrapper);
return BeanUtils.toBean(applylogs, InspectApplylogSimpleRespVO.class);
} }
@Override @Override
public void deleteApplylog(Integer id) { public void deleteApplylog(Integer id) {