|
|
@@ -32,6 +32,8 @@ public class DanAssessmentController {
|
|
|
private AssessmentPermissionService permissionService;
|
|
|
@Resource
|
|
|
private com.etotem.cfc.mapper.DanAssessmentResultMapper danAssessmentResultMapper;
|
|
|
+ @Resource
|
|
|
+ private com.etotem.cfc.mapper.UserMapper userMapper;
|
|
|
|
|
|
@Resource
|
|
|
private DanReportParseService danReportParseService;
|
|
|
@@ -215,10 +217,40 @@ public class DanAssessmentController {
|
|
|
return ok ? Result.success("取消成功") : Result.error("取消失败");
|
|
|
}
|
|
|
|
|
|
-@Operation(summary = "获取用户的预约列表")
|
|
|
+ @Operation(summary = "获取用户的预约列表")
|
|
|
@PostMapping("/appointment/user")
|
|
|
- public Result<List<AssessmentAppointment>> getUserAppointments(@RequestParam Long userId) {
|
|
|
- return Result.success(appointmentService.getByUserId(userId));
|
|
|
+ public Result<List<Map<String, Object>>> getUserAppointments(@RequestBody Map<String, Object> body) {
|
|
|
+ Long userId = body.get("userId") != null ? Long.valueOf(body.get("userId").toString()) : null;
|
|
|
+ if (userId == null) return Result.error("userId 不能为空");
|
|
|
+ List<AssessmentAppointment> list = appointmentService.getByUserId(userId);
|
|
|
+ List<Map<String, Object>> result = new java.util.ArrayList<>();
|
|
|
+ for (AssessmentAppointment app : list) {
|
|
|
+ Map<String, Object> item = new java.util.LinkedHashMap<>();
|
|
|
+ item.put("id", app.getId());
|
|
|
+ item.put("userId", app.getUserId());
|
|
|
+ item.put("familyId", app.getFamilyId());
|
|
|
+ item.put("childId", app.getChildId());
|
|
|
+ item.put("guideId", app.getGuideId());
|
|
|
+ item.put("packageId", app.getPackageId());
|
|
|
+ item.put("appointmentDate", app.getAppointmentDate());
|
|
|
+ item.put("appointmentTime", app.getAppointmentTime());
|
|
|
+ item.put("durationMinutes", app.getDurationMinutes());
|
|
|
+ item.put("status", app.getStatus());
|
|
|
+ item.put("appointmentType", app.getAppointmentType());
|
|
|
+ item.put("notes", app.getNotes());
|
|
|
+ item.put("contactPhone", app.getContactPhone());
|
|
|
+ item.put("meetLink", app.getMeetLink());
|
|
|
+ item.put("createdAt", app.getCreatedAt());
|
|
|
+ // 关联查询规划师名称
|
|
|
+ if (app.getGuideId() != null) {
|
|
|
+ com.etotem.cfc.entity.User guide = userMapper.selectById(app.getGuideId());
|
|
|
+ item.put("guideName", guide != null ? guide.getNickname() : "");
|
|
|
+ } else {
|
|
|
+ item.put("guideName", "");
|
|
|
+ }
|
|
|
+ result.add(item);
|
|
|
+ }
|
|
|
+ return Result.success(result);
|
|
|
}
|
|
|
|
|
|
@Operation(summary = "获取规划师的预约列表")
|