用户故障上报分页查询

This commit is contained in:
yanglei 2025-11-18 13:56:19 +08:00
parent 876fde6aed
commit 930e49bcd3
5 changed files with 15 additions and 9 deletions

View File

@ -1,6 +1,5 @@
package com.cdzy.user.controller;
import cn.dev33.satoken.stp.StpUtil;
import com.cdzy.common.model.request.PageParam;
import com.cdzy.common.model.response.JsonResult;
import com.cdzy.user.model.dto.EbikeFaultReportDto;
@ -114,14 +113,14 @@ public class EbikeFaultReportController {
}
/**
* 根据用户id查询用户故障上报信息
* 根据用户id分页查询用户故障上报信息
*
* @param pageParam 分页参数
*/
@PostMapping("queryFaultReportByUserId")
public JsonResult<?> getFaultListByWeChatUser(PageParam pageParam) {
@GetMapping("queryFaultReportByUserId")
public JsonResult<?> getFaultListByWeChatUser(@RequestParam("userId") Long userId, PageParam pageParam) {
QueryWrapper queryWrapper = QueryWrapper.create()
.where(EBIKE_FAULT_REPORT.CREATE_BY.eq(StpUtil.getLoginIdAsLong()));
.where(EBIKE_FAULT_REPORT.CREATE_BY.eq(userId));
Page<EbikeFaultReport> page = ebikeFaultReportService.page(pageParam.getPage(), queryWrapper);
return JsonResult.success(page);
}

View File

@ -7,6 +7,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.mybatisflex.annotation.Column;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -32,6 +33,12 @@ public class EbikeFaultReportDto {
*/
private Long reportId;
/**
* 用户id
*/
@NotNull(message = "用户id不能为空")
private Long userId;
/**
* 车辆编号
*/

View File

@ -36,11 +36,10 @@ public class EbikeFaultReportVo {
/**
* 车辆编号
*/
@NotBlank(message = "车辆编号不能为空!")
private String bikeCode;
/**
* operatorId
* 运营商id
*/
private Long operatorId;

View File

@ -71,6 +71,7 @@ public class EbikeFaultReportServiceImpl extends ServiceImpl<EbikeFaultReportMap
.location(ebikeFaultReportDto.getLocation())
.orderId(ebikeFaultReportDto.getOrderId())
.reviewId(ebikeFaultReportDto.getReviewId())
.createBy(ebikeFaultReportDto.getUserId())
.build();
this.save(userFaultReport);
// 保存附件信息
@ -162,7 +163,7 @@ public class EbikeFaultReportServiceImpl extends ServiceImpl<EbikeFaultReportMap
.location(ebikeFaultReportDto.getLocation())
.orderId(ebikeFaultReportDto.getOrderId())
.reviewId(ebikeFaultReportDto.getReviewId())
//.updateBy(userId)
.updateBy(ebikeFaultReportDto.getUserId())
.build();
this.updateById(userFaultReport);
List<EbikeAttachmentFileDto> attachmentFiles = ebikeFaultReportDto.getAttachmentFiles();

View File

@ -395,7 +395,7 @@ CREATE TABLE "public"."ebike_refund_file" (
"is_deleted" bool NOT NULL DEFAULT false
);
COMMENT ON COLUMN "public"."ebike_attachment_file"."file_id" IS '主键ID';
COMMENT ON COLUMN "public"."ebike_attachment_file"."report_id" IS '退款主键id';
COMMENT ON COLUMN "public"."ebike_attachment_file"."refund_id" IS '退款主键id';
COMMENT ON COLUMN "public"."ebike_attachment_file"."file_name" IS '附件文件名';
COMMENT ON COLUMN "public"."ebike_attachment_file"."file_type" IS '附件类型';
COMMENT ON COLUMN "public"."ebike_attachment_file"."file_url" IS '附件地址';