From b9a9d7dbe0ff19813877fb9d6a0533d22ed228ee Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期一, 10 二月 2025 15:18:48 +0800 Subject: [PATCH] 修改bug --- cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java | 18 +++++------------- 1 files changed, 5 insertions(+), 13 deletions(-) diff --git a/cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java b/cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java index ba756fc..b91139e 100644 --- a/cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java +++ b/cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java @@ -120,38 +120,30 @@ if (null == uid) { return ResultUtil.tokenErr(); } - int numDigits = String.valueOf(editParticipant.getId()).length(); - - - if (numDigits == 9) { + if (null != editParticipant.getIsStudent() && 0 == editParticipant.getIsStudent()) { Participant byId = participantService.getById(editParticipant.getId()); editParticipant.setName(byId.getName()); return participantService.editParticipant(uid, editParticipant); } else { - - TStudent student = new TStudent(); student.setId(editParticipant.getId()); TStudent student1 = studentClient.queryById(editParticipant.getId()); student.setName(student1.getName()); student.setIdCard(editParticipant.getIdcard()); + student.setHeadImg(editParticipant.getHeadImg()); if (editParticipant.getHeight() != null) { student.setHeight(Double.valueOf(editParticipant.getHeight())); } - if (editParticipant.getWeight() != null) { student.setWeight(editParticipant.getWeight()); } - if (ToolUtil.isNotEmpty(student.getName()) && ToolUtil.isNotEmpty(student.getIdCard())) { Boolean aBoolean = JuHeUtil.idcardAuthentication(student.getIdCard(), student.getName()); if (!aBoolean) { return ResultUtil.error("身份证和姓名不匹配"); } } - - student.setPhone(editParticipant.getPhone()); studentClient.updateAppUser(student); return ResultUtil.success(); @@ -169,13 +161,13 @@ @ApiImplicitParams({ @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") }) - public ResultUtil delParticipant(Integer id) { + public ResultUtil delParticipant(Integer id, Integer isStudent) { try { Integer uid = tokenUtil.getUserIdFormRedis(); if (null == uid) { return ResultUtil.tokenErr(); } - return participantService.delParticipant(id); + return participantService.delParticipant(id, isStudent); } catch (Exception e) { e.printStackTrace(); return ResultUtil.runErr(); @@ -210,7 +202,7 @@ @ResponseBody @PostMapping("/participant/getParticipant") - public Participant getParticipant(@RequestBody Integer id){ + public Participant getParticipant(@RequestBody Long id){ return participantService.getById(id); } } -- Gitblit v1.7.1