Showing
2 changed files
with
5 additions
and
2 deletions
| ... | @@ -55,6 +55,9 @@ public class DinerDTO { | ... | @@ -55,6 +55,9 @@ public class DinerDTO { |
| 55 | @NotNull(message = "班级不能为空") | 55 | @NotNull(message = "班级不能为空") |
| 56 | private Integer classId; | 56 | private Integer classId; |
| 57 | 57 | ||
| 58 | + @ApiModelProperty(value = "学号") | ||
| 59 | + private String studentNo; | ||
| 60 | + | ||
| 58 | @ApiModelProperty(value = "姓名") | 61 | @ApiModelProperty(value = "姓名") |
| 59 | private String name; | 62 | private String name; |
| 60 | } | 63 | } | ... | ... |
| ... | @@ -116,11 +116,11 @@ public class DinerServiceImpl implements DinerService { | ... | @@ -116,11 +116,11 @@ public class DinerServiceImpl implements DinerService { |
| 116 | throw ClientEndExceptions.IncorrectRequestValue.build(ErrorCodeEnum.CLIENT_CODE_NOT_EXISTS); | 116 | throw ClientEndExceptions.IncorrectRequestValue.build(ErrorCodeEnum.CLIENT_CODE_NOT_EXISTS); |
| 117 | } | 117 | } |
| 118 | final var singleClientRpcResponse = clientsByCodes.get(0); | 118 | final var singleClientRpcResponse = clientsByCodes.get(0); |
| 119 | - if (diner.getClientId() == singleClientRpcResponse.getId() && diner.getClassId() == updateDinerDTO.getClassId() && !diner.getName().equals(updateDinerDTO.getName())) { | 119 | + if (diner.getClientId() == singleClientRpcResponse.getId() && diner.getClassId() == updateDinerDTO.getClassId() && diner.getStudentNo().equals(updateDinerDTO.getStudentNo()) && !diner.getName().equals(updateDinerDTO.getName())) { |
| 120 | mealOrderServiceRpcClient.updateDiner(loginInfo, DinerModification.newBuilder().setId(diner.getId()).setShouldUpdateName(true).setName(updateDinerDTO.getName()).build()); | 120 | mealOrderServiceRpcClient.updateDiner(loginInfo, DinerModification.newBuilder().setId(diner.getId()).setShouldUpdateName(true).setName(updateDinerDTO.getName()).build()); |
| 121 | return; | 121 | return; |
| 122 | } | 122 | } |
| 123 | - final var diners = mealOrderServiceRpcClient.queryDinersByCondition(loginInfo.getEnterpriseId(), List.of(singleClientRpcResponse.getId()), List.of(updateDinerDTO.getClassId()), diner.getStudentNo()); | 123 | + final var diners = mealOrderServiceRpcClient.queryDinersByCondition(loginInfo.getEnterpriseId(), List.of(singleClientRpcResponse.getId()), List.of(updateDinerDTO.getClassId()), updateDinerDTO.getStudentNo()); |
| 124 | if (!diners.isEmpty()) { | 124 | if (!diners.isEmpty()) { |
| 125 | throw ClientEndExceptions.IncorrectRequestValue.build(ErrorCodeEnum.DINER_ALREADY_EXISTS); | 125 | throw ClientEndExceptions.IncorrectRequestValue.build(ErrorCodeEnum.DINER_ALREADY_EXISTS); |
| 126 | } | 126 | } | ... | ... |
-
Please register or login to post a comment