Showing
8 changed files
with
356 additions
and
12 deletions
| ... | @@ -6,10 +6,12 @@ import com.infoloop.tianting.mealorderservice.SingleMealOrderRpcResponse; | ... | @@ -6,10 +6,12 @@ import com.infoloop.tianting.mealorderservice.SingleMealOrderRpcResponse; |
| 6 | import com.infoloop.tianting.model.common.CreatedResult; | 6 | import com.infoloop.tianting.model.common.CreatedResult; |
| 7 | import com.infoloop.tianting.model.dto.MealOrderDTO; | 7 | import com.infoloop.tianting.model.dto.MealOrderDTO; |
| 8 | import com.infoloop.tianting.model.vo.DeliveryRuleVO; | 8 | import com.infoloop.tianting.model.vo.DeliveryRuleVO; |
| 9 | +import com.infoloop.tianting.model.vo.DinerMealSuspensionRecordVO; | ||
| 9 | import com.infoloop.tianting.model.vo.MealOrderVO; | 10 | import com.infoloop.tianting.model.vo.MealOrderVO; |
| 10 | import com.infoloop.tianting.service.MealOrderService; | 11 | import com.infoloop.tianting.service.MealOrderService; |
| 11 | import io.swagger.annotations.Api; | 12 | import io.swagger.annotations.Api; |
| 12 | import io.swagger.annotations.ApiOperation; | 13 | import io.swagger.annotations.ApiOperation; |
| 14 | +import io.swagger.annotations.ApiParam; | ||
| 13 | import lombok.RequiredArgsConstructor; | 15 | import lombok.RequiredArgsConstructor; |
| 14 | import lombok.extern.slf4j.Slf4j; | 16 | import lombok.extern.slf4j.Slf4j; |
| 15 | import org.springframework.beans.factory.annotation.Autowired; | 17 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | @@ -20,6 +22,7 @@ import org.springframework.web.bind.annotation.PostMapping; | ... | @@ -20,6 +22,7 @@ import org.springframework.web.bind.annotation.PostMapping; |
| 20 | import org.springframework.web.bind.annotation.PutMapping; | 22 | import org.springframework.web.bind.annotation.PutMapping; |
| 21 | import org.springframework.web.bind.annotation.RequestAttribute; | 23 | import org.springframework.web.bind.annotation.RequestAttribute; |
| 22 | import org.springframework.web.bind.annotation.RequestBody; | 24 | import org.springframework.web.bind.annotation.RequestBody; |
| 25 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 23 | import org.springframework.web.bind.annotation.ResponseStatus; | 26 | import org.springframework.web.bind.annotation.ResponseStatus; |
| 24 | import org.springframework.web.bind.annotation.RestController; | 27 | import org.springframework.web.bind.annotation.RestController; |
| 25 | 28 | ||
| ... | @@ -67,4 +70,11 @@ public class MealOrderController { | ... | @@ -67,4 +70,11 @@ public class MealOrderController { |
| 67 | return mealOrderService.getDeliveryRule(); | 70 | return mealOrderService.getDeliveryRule(); |
| 68 | } | 71 | } |
| 69 | 72 | ||
| 73 | + @ApiOperation(value = "查询停餐信息") | ||
| 74 | + @GetMapping("/dinermealsuspensionrecord") | ||
| 75 | + @ResponseStatus(HttpStatus.OK) | ||
| 76 | + public List<DinerMealSuspensionRecordVO> queryDinerMealSuspensionRecordsByCondition() { | ||
| 77 | + return mealOrderService.queryDinerMealSuspensionRecordsByCondition(); | ||
| 78 | + } | ||
| 79 | + | ||
| 70 | } | 80 | } | ... | ... |
| ... | @@ -66,6 +66,8 @@ public enum ErrorCodeEnum implements BaseEnum { | ... | @@ -66,6 +66,8 @@ public enum ErrorCodeEnum implements BaseEnum { |
| 66 | 66 | ||
| 67 | MP_ACCOUNT_ALREADY_DISABLED(406000024, "账号已禁用"), | 67 | MP_ACCOUNT_ALREADY_DISABLED(406000024, "账号已禁用"), |
| 68 | 68 | ||
| 69 | + DINER_MEAL_SUSPENDED(406000025, "当前就餐人处于停餐状态") | ||
| 70 | + | ||
| 69 | 71 | ||
| 70 | ; | 72 | ; |
| 71 | private final int code; | 73 | private final int code; | ... | ... |
| ... | @@ -3,14 +3,7 @@ package com.infoloop.tianting.logic.task; | ... | @@ -3,14 +3,7 @@ package com.infoloop.tianting.logic.task; |
| 3 | import com.infoloop.tianting.clientinventoryservice.SingleClientRpcResponse; | 3 | import com.infoloop.tianting.clientinventoryservice.SingleClientRpcResponse; |
| 4 | import com.infoloop.tianting.context.LoginContextHolder; | 4 | import com.infoloop.tianting.context.LoginContextHolder; |
| 5 | import com.infoloop.tianting.enums.LoginSourceEnum; | 5 | import com.infoloop.tianting.enums.LoginSourceEnum; |
| 6 | -import com.infoloop.tianting.mealorderservice.MealOrderCreation; | 6 | +import com.infoloop.tianting.mealorderservice.*; |
| 7 | -import com.infoloop.tianting.mealorderservice.MealOrderOrderMethodEnum; | ||
| 8 | -import com.infoloop.tianting.mealorderservice.MenuSchedule; | ||
| 9 | -import com.infoloop.tianting.mealorderservice.SingleDinerRpcResponse; | ||
| 10 | -import com.infoloop.tianting.mealorderservice.SingleGradeClassRpcResponse; | ||
| 11 | -import com.infoloop.tianting.mealorderservice.SingleMealMenuRecordRpcResponse; | ||
| 12 | -import com.infoloop.tianting.mealorderservice.SingleMealOrderRpcResponse; | ||
| 13 | -import com.infoloop.tianting.mealorderservice.SingleMpAccountDinerRefRpcResponse; | ||
| 14 | import com.infoloop.tianting.service.client.ClientInventoryServiceRpcClient; | 7 | import com.infoloop.tianting.service.client.ClientInventoryServiceRpcClient; |
| 15 | import com.infoloop.tianting.service.client.DeliveryRuleServiceRpcClient; | 8 | import com.infoloop.tianting.service.client.DeliveryRuleServiceRpcClient; |
| 16 | import com.infoloop.tianting.service.client.MealOrderServiceRpcClient; | 9 | import com.infoloop.tianting.service.client.MealOrderServiceRpcClient; |
| ... | @@ -31,6 +24,7 @@ import java.time.temporal.TemporalAdjusters; | ... | @@ -31,6 +24,7 @@ import java.time.temporal.TemporalAdjusters; |
| 31 | import java.util.ArrayList; | 24 | import java.util.ArrayList; |
| 32 | import java.util.Collections; | 25 | import java.util.Collections; |
| 33 | import java.util.Comparator; | 26 | import java.util.Comparator; |
| 27 | +import java.util.HashMap; | ||
| 34 | import java.util.LinkedHashSet; | 28 | import java.util.LinkedHashSet; |
| 35 | import java.util.List; | 29 | import java.util.List; |
| 36 | import java.util.Map; | 30 | import java.util.Map; |
| ... | @@ -109,8 +103,82 @@ public class AutoCreateMealOrderTask { | ... | @@ -109,8 +103,82 @@ public class AutoCreateMealOrderTask { |
| 109 | final var clientMap = clientInventoryServiceRpcClient.getClientsByIds(enterpriseId, clientIds).getClientsList().stream().collect(Collectors.toMap(SingleClientRpcResponse::getId, Function.identity())); | 103 | final var clientMap = clientInventoryServiceRpcClient.getClientsByIds(enterpriseId, clientIds).getClientsList().stream().collect(Collectors.toMap(SingleClientRpcResponse::getId, Function.identity())); |
| 110 | final var gradeClassMap = mealOrderServiceRpcClient.getGradeClassesByIds(enterpriseId, classIds).stream().collect(Collectors.toMap(SingleGradeClassRpcResponse::getId, Function.identity())); | 104 | final var gradeClassMap = mealOrderServiceRpcClient.getGradeClassesByIds(enterpriseId, classIds).stream().collect(Collectors.toMap(SingleGradeClassRpcResponse::getId, Function.identity())); |
| 111 | final var latestMealMenuRecordMap = mealOrderServiceRpcClient.queryLatestMealMenuRecordsByClientIds(enterpriseId, clientIds).stream().collect(Collectors.toMap(SingleMealMenuRecordRpcResponse::getClientId, Function.identity())); | 105 | final var latestMealMenuRecordMap = mealOrderServiceRpcClient.queryLatestMealMenuRecordsByClientIds(enterpriseId, clientIds).stream().collect(Collectors.toMap(SingleMealMenuRecordRpcResponse::getClientId, Function.identity())); |
| 106 | + | ||
| 107 | + // 批量查询学校级别的停餐信息 | ||
| 108 | + final var schoolSuspensionMap = new HashMap<Integer, SingleDinerMealSuspensionRecordRpcResponse>(); | ||
| 109 | + var schoolSuspensionRecords = mealOrderServiceRpcClient.queryDinerMealSuspensionRecordsByCondition( | ||
| 110 | + enterpriseId, | ||
| 111 | + clientIds, // 使用0表示查询所有 | ||
| 112 | + null, | ||
| 113 | + null | ||
| 114 | + ); | ||
| 115 | + | ||
| 116 | + if (schoolSuspensionRecords != null) { | ||
| 117 | + var currentTime = System.currentTimeMillis(); | ||
| 118 | + schoolSuspensionRecords.stream() | ||
| 119 | + .filter(record -> clientIds.contains(record.getClientId())) | ||
| 120 | + .filter(record -> currentTime >= record.getStartAt() && currentTime <= record.getEndAt()) | ||
| 121 | + .collect(Collectors.groupingBy( | ||
| 122 | + SingleDinerMealSuspensionRecordRpcResponse::getClientId, | ||
| 123 | + Collectors.collectingAndThen( | ||
| 124 | + Collectors.maxBy((a, b) -> Long.compare(a.getCreatedAt(), b.getCreatedAt())), | ||
| 125 | + opt -> opt.orElse(null) | ||
| 126 | + ) | ||
| 127 | + )) | ||
| 128 | + .forEach((clientId, record) -> { | ||
| 129 | + if (record != null) { | ||
| 130 | + schoolSuspensionMap.put(clientId, record); | ||
| 131 | + } | ||
| 132 | + }); | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + // 批量查询学生级别的停餐信息 | ||
| 136 | + final var studentSuspensionMap = new HashMap<Integer, SingleDinerMealSuspensionRecordRpcResponse>(); | ||
| 137 | + var studentSuspensionRecords = mealOrderServiceRpcClient.queryDinerMealSuspensionRecordsByCondition( | ||
| 138 | + enterpriseId, | ||
| 139 | + null, // 使用0表示查询所有 | ||
| 140 | + null, | ||
| 141 | + notReservedDiners.stream().map(SingleDinerRpcResponse::getId).toList() | ||
| 142 | + ); | ||
| 143 | + | ||
| 144 | + if (studentSuspensionRecords != null) { | ||
| 145 | + var currentTime = System.currentTimeMillis(); | ||
| 146 | + var dinerIdSet = notReservedDiners.stream() | ||
| 147 | + .map(SingleDinerRpcResponse::getId) | ||
| 148 | + .collect(Collectors.toSet()); | ||
| 149 | + | ||
| 150 | + studentSuspensionRecords.stream() | ||
| 151 | + .filter(record -> dinerIdSet.contains(record.getDinerId())) | ||
| 152 | + .filter(record -> currentTime >= record.getStartAt() && currentTime <= record.getEndAt()) | ||
| 153 | + .collect(Collectors.groupingBy( | ||
| 154 | + SingleDinerMealSuspensionRecordRpcResponse::getDinerId, | ||
| 155 | + Collectors.collectingAndThen( | ||
| 156 | + Collectors.maxBy((a, b) -> Long.compare(a.getCreatedAt(), b.getCreatedAt())), | ||
| 157 | + opt -> opt.orElse(null) | ||
| 158 | + ) | ||
| 159 | + )) | ||
| 160 | + .forEach((dinerId, record) -> { | ||
| 161 | + if (record != null) { | ||
| 162 | + studentSuspensionMap.put(dinerId, record); | ||
| 163 | + } | ||
| 164 | + }); | ||
| 165 | + } | ||
| 166 | + | ||
| 112 | // 构建创建请求 | 167 | // 构建创建请求 |
| 113 | - final var creations = notReservedDiners.stream().map(diner -> toMealOrderCreation(diner, clientMap, gradeClassMap, latestMealMenuRecordMap, mpAccountDinerRefMap, nextWeekStart)).filter(Objects::nonNull).toList(); | 168 | + final var creations = notReservedDiners.stream() |
| 169 | + .map(diner -> toMealOrderCreation( | ||
| 170 | + diner, | ||
| 171 | + clientMap, | ||
| 172 | + gradeClassMap, | ||
| 173 | + latestMealMenuRecordMap, | ||
| 174 | + mpAccountDinerRefMap, | ||
| 175 | + nextWeekStart, | ||
| 176 | + schoolSuspensionMap, | ||
| 177 | + studentSuspensionMap | ||
| 178 | + )) | ||
| 179 | + .filter(Objects::nonNull) | ||
| 180 | + .toList(); | ||
| 181 | + | ||
| 114 | if (creations.isEmpty()) { | 182 | if (creations.isEmpty()) { |
| 115 | return; | 183 | return; |
| 116 | } | 184 | } |
| ... | @@ -132,12 +200,27 @@ public class AutoCreateMealOrderTask { | ... | @@ -132,12 +200,27 @@ public class AutoCreateMealOrderTask { |
| 132 | Map<Integer, SingleGradeClassRpcResponse> classMap, | 200 | Map<Integer, SingleGradeClassRpcResponse> classMap, |
| 133 | Map<Integer, SingleMealMenuRecordRpcResponse> menuMap, | 201 | Map<Integer, SingleMealMenuRecordRpcResponse> menuMap, |
| 134 | Map<Integer, SingleMpAccountDinerRefRpcResponse> mpAccountDinerRefMap, | 202 | Map<Integer, SingleMpAccountDinerRefRpcResponse> mpAccountDinerRefMap, |
| 135 | - ZonedDateTime startOfNextWeek) { | 203 | + ZonedDateTime startOfNextWeek, |
| 204 | + Map<Integer, SingleDinerMealSuspensionRecordRpcResponse> schoolSuspensionMap, | ||
| 205 | + Map<Integer, SingleDinerMealSuspensionRecordRpcResponse> studentSuspensionMap) { | ||
| 136 | final var menu = menuMap.get(diner.getClientId()); | 206 | final var menu = menuMap.get(diner.getClientId()); |
| 137 | final var client = clientMap.get(diner.getClientId()); | 207 | final var client = clientMap.get(diner.getClientId()); |
| 138 | final var gradeClass = classMap.get(diner.getClassId()); | 208 | final var gradeClass = classMap.get(diner.getClassId()); |
| 139 | final var mpAccountDinerRef = mpAccountDinerRefMap.get(diner.getId()); | 209 | final var mpAccountDinerRef = mpAccountDinerRefMap.get(diner.getId()); |
| 140 | if (menu == null || client == null || gradeClass == null) return null; | 210 | if (menu == null || client == null || gradeClass == null) return null; |
| 211 | + | ||
| 212 | + // 检查学校级别的停餐信息 | ||
| 213 | + if (schoolSuspensionMap.containsKey(diner.getClientId())) { | ||
| 214 | + log.info("学校 {} 当前处于停餐状态,跳过自动订餐", client.getName()); | ||
| 215 | + return null; | ||
| 216 | + } | ||
| 217 | + | ||
| 218 | + // 检查学生级别的停餐信息 | ||
| 219 | + if (studentSuspensionMap.containsKey(diner.getId())) { | ||
| 220 | + log.info("学生 {} 当前处于停餐状态,跳过自动订餐", diner.getName()); | ||
| 221 | + return null; | ||
| 222 | + } | ||
| 223 | + | ||
| 141 | return MealOrderCreation.newBuilder() | 224 | return MealOrderCreation.newBuilder() |
| 142 | .setClientId(diner.getClientId()) | 225 | .setClientId(diner.getClientId()) |
| 143 | .setMenuId(menu.getId()) | 226 | .setMenuId(menu.getId()) | ... | ... |
| 1 | +package com.infoloop.tianting.model.vo; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Builder; | ||
| 6 | +import lombok.Data; | ||
| 7 | + | ||
| 8 | +import java.util.Date; | ||
| 9 | + | ||
| 10 | +@Data | ||
| 11 | +@Builder | ||
| 12 | +@ApiModel("停餐记录VO") | ||
| 13 | +public class DinerMealSuspensionRecordVO { | ||
| 14 | + @ApiModelProperty("ID") | ||
| 15 | + private Long id; | ||
| 16 | + | ||
| 17 | + @ApiModelProperty("企业ID") | ||
| 18 | + private Long enterpriseId; | ||
| 19 | + | ||
| 20 | + @ApiModelProperty("客户ID") | ||
| 21 | + private Long clientId; | ||
| 22 | + | ||
| 23 | + @ApiModelProperty("班级ID") | ||
| 24 | + private Long classId; | ||
| 25 | + | ||
| 26 | + @ApiModelProperty("年级名称") | ||
| 27 | + private String gradeName; | ||
| 28 | + | ||
| 29 | + @ApiModelProperty("班级名称") | ||
| 30 | + private String className; | ||
| 31 | + | ||
| 32 | + @ApiModelProperty("用餐人ID") | ||
| 33 | + private Long dinerId; | ||
| 34 | + | ||
| 35 | + @ApiModelProperty("用餐人姓名") | ||
| 36 | + private String dinerName; | ||
| 37 | + | ||
| 38 | + @ApiModelProperty("学号") | ||
| 39 | + private String studentNo; | ||
| 40 | + | ||
| 41 | + @ApiModelProperty("开始时间") | ||
| 42 | + private Date startAt; | ||
| 43 | + | ||
| 44 | + @ApiModelProperty("结束时间") | ||
| 45 | + private Date endAt; | ||
| 46 | + | ||
| 47 | + @ApiModelProperty("备注") | ||
| 48 | + private String comment; | ||
| 49 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -4,6 +4,7 @@ import com.infoloop.tianting.mealorderservice.SingleMealOrderRpcResponse; | ... | @@ -4,6 +4,7 @@ import com.infoloop.tianting.mealorderservice.SingleMealOrderRpcResponse; |
| 4 | import com.infoloop.tianting.model.common.CreatedResult; | 4 | import com.infoloop.tianting.model.common.CreatedResult; |
| 5 | import com.infoloop.tianting.model.dto.MealOrderDTO; | 5 | import com.infoloop.tianting.model.dto.MealOrderDTO; |
| 6 | import com.infoloop.tianting.model.vo.DeliveryRuleVO; | 6 | import com.infoloop.tianting.model.vo.DeliveryRuleVO; |
| 7 | +import com.infoloop.tianting.model.vo.DinerMealSuspensionRecordVO; | ||
| 7 | import com.infoloop.tianting.model.vo.MealOrderVO; | 8 | import com.infoloop.tianting.model.vo.MealOrderVO; |
| 8 | 9 | ||
| 9 | import java.util.List; | 10 | import java.util.List; |
| ... | @@ -17,4 +18,16 @@ public interface MealOrderService { | ... | @@ -17,4 +18,16 @@ public interface MealOrderService { |
| 17 | MealOrderVO getMealOrderById(SingleMealOrderRpcResponse mealOrder); | 18 | MealOrderVO getMealOrderById(SingleMealOrderRpcResponse mealOrder); |
| 18 | 19 | ||
| 19 | DeliveryRuleVO getDeliveryRule(); | 20 | DeliveryRuleVO getDeliveryRule(); |
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 查询停餐信息 | ||
| 24 | + * 先查询学校的停餐信息,再查询学生的停餐信息,学校的停餐信息优先级高于学生停餐信息 | ||
| 25 | + * | ||
| 26 | + * @param enterpriseId 企业ID | ||
| 27 | + * @param clientId 客户ID | ||
| 28 | + * @param classId 班级ID | ||
| 29 | + * @param dinerId 用餐人ID | ||
| 30 | + * @return 停餐信息列表 | ||
| 31 | + */ | ||
| 32 | + List<DinerMealSuspensionRecordVO> queryDinerMealSuspensionRecordsByCondition(); | ||
| 20 | } | 33 | } | ... | ... |
| ... | @@ -47,6 +47,8 @@ import com.infoloop.tianting.mealorderservice.UpdateDinerRpcRequest; | ... | @@ -47,6 +47,8 @@ import com.infoloop.tianting.mealorderservice.UpdateDinerRpcRequest; |
| 47 | import com.infoloop.tianting.mealorderservice.UpdateDinerRpcResponse; | 47 | import com.infoloop.tianting.mealorderservice.UpdateDinerRpcResponse; |
| 48 | import com.infoloop.tianting.mealorderservice.UpdateMpAccountRpcRequest; | 48 | import com.infoloop.tianting.mealorderservice.UpdateMpAccountRpcRequest; |
| 49 | import com.infoloop.tianting.mealorderservice.UpdateMpAccountRpcResponse; | 49 | import com.infoloop.tianting.mealorderservice.UpdateMpAccountRpcResponse; |
| 50 | +import com.infoloop.tianting.mealorderservice.QueryDinerMealSuspensionRecordsByConditionRpcRequest; | ||
| 51 | +import com.infoloop.tianting.mealorderservice.SingleDinerMealSuspensionRecordRpcResponse; | ||
| 50 | import lombok.RequiredArgsConstructor; | 52 | import lombok.RequiredArgsConstructor; |
| 51 | import org.apache.commons.collections4.CollectionUtils; | 53 | import org.apache.commons.collections4.CollectionUtils; |
| 52 | import org.apache.commons.lang3.StringUtils; | 54 | import org.apache.commons.lang3.StringUtils; |
| ... | @@ -274,4 +276,30 @@ public class MealOrderServiceRpcClient { | ... | @@ -274,4 +276,30 @@ public class MealOrderServiceRpcClient { |
| 274 | .setShouldFilterReserveDateEnd(reserveDateEnd != null).setReserveDateEnd(reserveDateEnd == null ? 0 : reserveDateEnd) | 276 | .setShouldFilterReserveDateEnd(reserveDateEnd != null).setReserveDateEnd(reserveDateEnd == null ? 0 : reserveDateEnd) |
| 275 | .build()).getResponsesList(); | 277 | .build()).getResponsesList(); |
| 276 | } | 278 | } |
| 279 | + | ||
| 280 | + public List<SingleDinerMealSuspensionRecordRpcResponse> queryDinerMealSuspensionRecordsByCondition( | ||
| 281 | + int enterpriseId, | ||
| 282 | + @Nullable List<Integer> clientIds, | ||
| 283 | + @Nullable List<Integer> classIds, | ||
| 284 | + @Nullable List<Integer> dinerIds) { | ||
| 285 | + var request = QueryDinerMealSuspensionRecordsByConditionRpcRequest.newBuilder() | ||
| 286 | + .setEnterpriseId(enterpriseId); | ||
| 287 | + | ||
| 288 | + if (clientIds != null) { | ||
| 289 | + request.setShouldFilterClientIds(true) | ||
| 290 | + .addAllClientIds(clientIds); | ||
| 291 | + } | ||
| 292 | + if (classIds != null) { | ||
| 293 | + request.setShouldFilterClassIds(true) | ||
| 294 | + .addAllClassIds(classIds); | ||
| 295 | + } | ||
| 296 | + | ||
| 297 | + if (dinerIds != null) { | ||
| 298 | + request.setShouldFilterDinerIds(true) | ||
| 299 | + .addAllDinerIds(dinerIds); | ||
| 300 | + } | ||
| 301 | + | ||
| 302 | + return mealOrderServiceRpcBlockingStub.queryDinerMealSuspensionRecordsByCondition(request.build()) | ||
| 303 | + .getResponsesList(); | ||
| 304 | + } | ||
| 277 | } | 305 | } | ... | ... |
This diff is collapsed. Click to expand it.
| ... | @@ -31,6 +31,7 @@ service MealOrderServiceRpc { | ... | @@ -31,6 +31,7 @@ service MealOrderServiceRpc { |
| 31 | rpc UpdateDiner (UpdateDinerRpcRequest) returns (UpdateDinerRpcResponse) {} | 31 | rpc UpdateDiner (UpdateDinerRpcRequest) returns (UpdateDinerRpcResponse) {} |
| 32 | rpc BatchSaveOrUpdateDiners (BatchSaveOrUpdateDinersRpcRequest) returns (BatchSaveOrUpdateDinersRpcResponse) {} | 32 | rpc BatchSaveOrUpdateDiners (BatchSaveOrUpdateDinersRpcRequest) returns (BatchSaveOrUpdateDinersRpcResponse) {} |
| 33 | rpc DeleteDinersByIds (DeleteDinersByIdsRpcRequest) returns (DeleteDinersRpcResponse) {} | 33 | rpc DeleteDinersByIds (DeleteDinersByIdsRpcRequest) returns (DeleteDinersRpcResponse) {} |
| 34 | + rpc DeleteGraduationDinersByClassIds (DeleteGraduationDinersByClassIdsRpcRequest) returns (DeleteGraduationDinersByClassIdsRpcResponse) {} | ||
| 34 | 35 | ||
| 35 | rpc GetMpAccountDinerRefsByIds (GetMpAccountDinerRefsByIdsRpcRequest) returns (GetMpAccountDinerRefsByIdsRpcResponse) {} | 36 | rpc GetMpAccountDinerRefsByIds (GetMpAccountDinerRefsByIdsRpcRequest) returns (GetMpAccountDinerRefsByIdsRpcResponse) {} |
| 36 | rpc QueryMpAccountDinerRefsByCondition (QueryMpAccountDinerRefsByConditionRpcRequest) returns (QueryMpAccountDinerRefsByConditionRpcResponse) {} | 37 | rpc QueryMpAccountDinerRefsByCondition (QueryMpAccountDinerRefsByConditionRpcRequest) returns (QueryMpAccountDinerRefsByConditionRpcResponse) {} |
| ... | @@ -46,12 +47,22 @@ service MealOrderServiceRpc { | ... | @@ -46,12 +47,22 @@ service MealOrderServiceRpc { |
| 46 | rpc BatchSaveOrUpdateGradeClasses (BatchSaveOrUpdateGradeClassesRpcRequest) returns (BatchSaveOrUpdateGradeClassesRpcResponse) {} | 47 | rpc BatchSaveOrUpdateGradeClasses (BatchSaveOrUpdateGradeClassesRpcRequest) returns (BatchSaveOrUpdateGradeClassesRpcResponse) {} |
| 47 | rpc DeleteGradeClassesByIds (DeleteGradeClassesByIdsRpcRequest) returns (DeleteGradeClassesRpcResponse) {} | 48 | rpc DeleteGradeClassesByIds (DeleteGradeClassesByIdsRpcRequest) returns (DeleteGradeClassesRpcResponse) {} |
| 48 | rpc DeleteGradeClassesAndDinersByClientIds (DeleteGradeClassesAndDinersByClientIdsRpcRequest) returns (DeleteGradeClassesAndDinersByClientIdsRpcResponse) {} | 49 | rpc DeleteGradeClassesAndDinersByClientIds (DeleteGradeClassesAndDinersByClientIdsRpcRequest) returns (DeleteGradeClassesAndDinersByClientIdsRpcResponse) {} |
| 50 | + rpc DeleteGradeClassesAndDinersByClassIds (DeleteGradeClassesAndDinersByClassIdsRpcRequest) returns (DeleteGradeClassesAndDinersByClassIdsRpcResponse) {} | ||
| 49 | 51 | ||
| 50 | rpc GetMealMenuRecordById (GetMealMenuRecordByIdRpcRequest) returns (GetMealMenuRecordByIdRpcResponse) {} | 52 | rpc GetMealMenuRecordById (GetMealMenuRecordByIdRpcRequest) returns (GetMealMenuRecordByIdRpcResponse) {} |
| 51 | rpc GetMealMenuRecordsByIds (GetMealMenuRecordsByIdsRpcRequest) returns (GetMealMenuRecordsByIdsRpcResponse) {} | 53 | rpc GetMealMenuRecordsByIds (GetMealMenuRecordsByIdsRpcRequest) returns (GetMealMenuRecordsByIdsRpcResponse) {} |
| 52 | rpc QueryMealMenuRecordsByCondition (QueryMealMenuRecordsByConditionRpcRequest) returns (QueryMealMenuRecordsByConditionRpcResponse) {} | 54 | rpc QueryMealMenuRecordsByCondition (QueryMealMenuRecordsByConditionRpcRequest) returns (QueryMealMenuRecordsByConditionRpcResponse) {} |
| 53 | rpc CreateMealMenuRecord (CreateMealMenuRecordRpcRequest) returns (CreateMealMenuRecordRpcResponse) {} | 55 | rpc CreateMealMenuRecord (CreateMealMenuRecordRpcRequest) returns (CreateMealMenuRecordRpcResponse) {} |
| 54 | rpc QueryLatestMealMenuRecordsByClientIds (QueryLatestMealMenuRecordsByClientIdsRpcRequest) returns (QueryLatestMealMenuRecordsByClientIdsRpcResponse) {} | 56 | rpc QueryLatestMealMenuRecordsByClientIds (QueryLatestMealMenuRecordsByClientIdsRpcRequest) returns (QueryLatestMealMenuRecordsByClientIdsRpcResponse) {} |
| 57 | + | ||
| 58 | + // 停餐记录相关服务 | ||
| 59 | + rpc getDinerMealSuspensionRecordById(GetDinerMealSuspensionRecordByIdRpcRequest) returns (GetDinerMealSuspensionRecordByIdRpcResponse); | ||
| 60 | + rpc getDinerMealSuspensionRecordsByIds(GetDinerMealSuspensionRecordsByIdsRpcRequest) returns (GetDinerMealSuspensionRecordsByIdsRpcResponse); | ||
| 61 | + rpc queryDinerMealSuspensionRecordsByCondition(QueryDinerMealSuspensionRecordsByConditionRpcRequest) returns (QueryDinerMealSuspensionRecordsByConditionRpcResponse); | ||
| 62 | + rpc createDinerMealSuspensionRecord(CreateDinerMealSuspensionRecordRpcRequest) returns (CreateDinerMealSuspensionRecordRpcResponse); | ||
| 63 | + rpc batchCreateDinerMealSuspensionRecords(BatchCreateDinerMealSuspensionRecordsRpcRequest) returns (BatchCreateDinerMealSuspensionRecordsRpcResponse); | ||
| 64 | + rpc updateDinerMealSuspensionRecord(UpdateDinerMealSuspensionRecordRpcRequest) returns (UpdateDinerMealSuspensionRecordRpcResponse); | ||
| 65 | + rpc deleteDinerMealSuspensionRecordsByIds(DeleteDinerMealSuspensionRecordsByIdsRpcRequest) returns (DeleteDinerMealSuspensionRecordsRpcResponse); | ||
| 55 | } | 66 | } |
| 56 | 67 | ||
| 57 | enum MealOrderOrderMethodEnum { | 68 | enum MealOrderOrderMethodEnum { |
| ... | @@ -357,6 +368,17 @@ message DeleteDinersRpcResponse { | ... | @@ -357,6 +368,17 @@ message DeleteDinersRpcResponse { |
| 357 | bool isDeleted = 1; | 368 | bool isDeleted = 1; |
| 358 | } | 369 | } |
| 359 | 370 | ||
| 371 | +message DeleteGraduationDinersByClassIdsRpcRequest { | ||
| 372 | + repeated int32 classIds = 1; | ||
| 373 | + int32 enterpriseId = 2; | ||
| 374 | + int32 updatedBy = 3; | ||
| 375 | + int32 updateSource = 4; | ||
| 376 | +} | ||
| 377 | + | ||
| 378 | +message DeleteGraduationDinersByClassIdsRpcResponse { | ||
| 379 | + bool isDeleted = 1; | ||
| 380 | +} | ||
| 381 | + | ||
| 360 | enum MpAccountGenderEnum { | 382 | enum MpAccountGenderEnum { |
| 361 | MP_ACCOUNT_GENDER_MAN = 0; | 383 | MP_ACCOUNT_GENDER_MAN = 0; |
| 362 | MP_ACCOUNT_GENDER_WOMAN = 1; | 384 | MP_ACCOUNT_GENDER_WOMAN = 1; |
| ... | @@ -613,8 +635,8 @@ message QueryGradeClassesByConditionRpcRequest { | ... | @@ -613,8 +635,8 @@ message QueryGradeClassesByConditionRpcRequest { |
| 613 | int32 enterpriseId = 1; | 635 | int32 enterpriseId = 1; |
| 614 | bool shouldFilterClientIds = 2; | 636 | bool shouldFilterClientIds = 2; |
| 615 | repeated int32 clientIds = 3; | 637 | repeated int32 clientIds = 3; |
| 616 | - bool shouldFilterGradeName = 4; | 638 | + bool shouldFilterGradeNames = 4; |
| 617 | - string gradeName = 5; | 639 | + repeated string gradeName = 5; |
| 618 | bool includeDeleted = 6; | 640 | bool includeDeleted = 6; |
| 619 | } | 641 | } |
| 620 | 642 | ||
| ... | @@ -721,6 +743,18 @@ message DeleteGradeClassesAndDinersByClientIdsRpcResponse { | ... | @@ -721,6 +743,18 @@ message DeleteGradeClassesAndDinersByClientIdsRpcResponse { |
| 721 | bool isDeleted = 1; | 743 | bool isDeleted = 1; |
| 722 | } | 744 | } |
| 723 | 745 | ||
| 746 | +message DeleteGradeClassesAndDinersByClassIdsRpcRequest { | ||
| 747 | + repeated int32 classIds = 1; | ||
| 748 | + int32 enterpriseId = 2; | ||
| 749 | + int32 updatedBy = 3; | ||
| 750 | + int32 updateSource = 4; | ||
| 751 | +} | ||
| 752 | + | ||
| 753 | +message DeleteGradeClassesAndDinersByClassIdsRpcResponse { | ||
| 754 | + bool isDeleted = 1; | ||
| 755 | +} | ||
| 756 | + | ||
| 757 | + | ||
| 724 | message SingleMealMenuRecordRpcResponse { | 758 | message SingleMealMenuRecordRpcResponse { |
| 725 | int32 id = 1; | 759 | int32 id = 1; |
| 726 | int32 enterpriseId = 2; | 760 | int32 enterpriseId = 2; |
| ... | @@ -734,6 +768,7 @@ message SingleMealMenuRecordRpcResponse { | ... | @@ -734,6 +768,7 @@ message SingleMealMenuRecordRpcResponse { |
| 734 | int64 updatedAt = 10; | 768 | int64 updatedAt = 10; |
| 735 | int32 updateSource = 11; | 769 | int32 updateSource = 11; |
| 736 | bool isDeleted = 12; | 770 | bool isDeleted = 12; |
| 771 | + string operatorName = 13; | ||
| 737 | } | 772 | } |
| 738 | 773 | ||
| 739 | message GetMealMenuRecordByIdRpcRequest { | 774 | message GetMealMenuRecordByIdRpcRequest { |
| ... | @@ -781,6 +816,7 @@ message CreateMealMenuRecordRpcRequest { | ... | @@ -781,6 +816,7 @@ message CreateMealMenuRecordRpcRequest { |
| 781 | int32 enterpriseId = 2; | 816 | int32 enterpriseId = 2; |
| 782 | int32 createdBy = 3; | 817 | int32 createdBy = 3; |
| 783 | int32 creationSource = 4; | 818 | int32 creationSource = 4; |
| 819 | + string operatorName = 5; | ||
| 784 | } | 820 | } |
| 785 | 821 | ||
| 786 | message CreateMealMenuRecordRpcResponse { | 822 | message CreateMealMenuRecordRpcResponse { |
| ... | @@ -796,3 +832,126 @@ message QueryLatestMealMenuRecordsByClientIdsRpcRequest { | ... | @@ -796,3 +832,126 @@ message QueryLatestMealMenuRecordsByClientIdsRpcRequest { |
| 796 | message QueryLatestMealMenuRecordsByClientIdsRpcResponse { | 832 | message QueryLatestMealMenuRecordsByClientIdsRpcResponse { |
| 797 | repeated SingleMealMenuRecordRpcResponse responses = 1; | 833 | repeated SingleMealMenuRecordRpcResponse responses = 1; |
| 798 | } | 834 | } |
| 835 | + | ||
| 836 | +// 停餐记录相关消息定义 | ||
| 837 | +message SingleDinerMealSuspensionRecordRpcResponse { | ||
| 838 | + int32 id = 1; | ||
| 839 | + int32 enterpriseId = 2; | ||
| 840 | + int32 clientId = 3; | ||
| 841 | + int32 classId = 4; | ||
| 842 | + int32 dinerId = 5; | ||
| 843 | + int64 startAt = 6; | ||
| 844 | + int64 endAt = 7; | ||
| 845 | + string comment = 8; | ||
| 846 | + int64 createdAt = 9; | ||
| 847 | + int32 createdBy = 10; | ||
| 848 | + int32 creationSource = 11; | ||
| 849 | + int64 updatedAt = 12; | ||
| 850 | + int32 updatedBy = 13; | ||
| 851 | + int32 updateSource = 14; | ||
| 852 | +} | ||
| 853 | + | ||
| 854 | +message GetDinerMealSuspensionRecordByIdRpcRequest { | ||
| 855 | + int64 id = 1; | ||
| 856 | +} | ||
| 857 | + | ||
| 858 | +message GetDinerMealSuspensionRecordByIdRpcResponse { | ||
| 859 | + SingleDinerMealSuspensionRecordRpcResponse response = 1; | ||
| 860 | +} | ||
| 861 | + | ||
| 862 | +message GetDinerMealSuspensionRecordsByIdsRpcRequest { | ||
| 863 | + repeated int32 ids = 1; | ||
| 864 | +} | ||
| 865 | + | ||
| 866 | +message GetDinerMealSuspensionRecordsByIdsRpcResponse { | ||
| 867 | + repeated SingleDinerMealSuspensionRecordRpcResponse responses = 1; | ||
| 868 | +} | ||
| 869 | + | ||
| 870 | +message QueryDinerMealSuspensionRecordsByConditionRpcRequest { | ||
| 871 | + int32 enterpriseId = 1; | ||
| 872 | + bool shouldFilterClientIds = 2; | ||
| 873 | + repeated int32 clientIds = 3; | ||
| 874 | + bool shouldFilterClassIds = 4; | ||
| 875 | + repeated int32 classIds = 5; | ||
| 876 | + bool shouldFilterDinerIds = 6; | ||
| 877 | + repeated int32 dinerIds = 7; | ||
| 878 | + bool shouldFilterStartAt = 8; | ||
| 879 | + int64 startAt = 9; | ||
| 880 | + bool shouldFilterEndAt = 10; | ||
| 881 | + int64 endAt = 11; | ||
| 882 | +} | ||
| 883 | + | ||
| 884 | +message QueryDinerMealSuspensionRecordsByConditionRpcResponse { | ||
| 885 | + repeated SingleDinerMealSuspensionRecordRpcResponse responses = 1; | ||
| 886 | +} | ||
| 887 | + | ||
| 888 | +message CreateDinerMealSuspensionRecordRpcRequest { | ||
| 889 | + int32 enterpriseId = 1; | ||
| 890 | + int32 createdBy = 2; | ||
| 891 | + int32 creationSource = 3; | ||
| 892 | + DinerMealSuspensionRecordCreation creation = 4; | ||
| 893 | +} | ||
| 894 | + | ||
| 895 | +message DinerMealSuspensionRecordCreation { | ||
| 896 | + int32 clientId = 1; | ||
| 897 | + int32 classId = 2; | ||
| 898 | + int32 dinerId = 3; | ||
| 899 | + int64 startAt = 4; | ||
| 900 | + int64 endAt = 5; | ||
| 901 | + string comment = 6; | ||
| 902 | +} | ||
| 903 | + | ||
| 904 | +message CreateDinerMealSuspensionRecordRpcResponse { | ||
| 905 | + bool isCreated = 1; | ||
| 906 | + int32 id = 2; | ||
| 907 | +} | ||
| 908 | + | ||
| 909 | +message UpdateDinerMealSuspensionRecordRpcRequest { | ||
| 910 | + int32 enterpriseId = 1; | ||
| 911 | + int32 updatedBy = 2; | ||
| 912 | + int32 updateSource = 3; | ||
| 913 | + DinerMealSuspensionRecordModification modification = 4; | ||
| 914 | +} | ||
| 915 | + | ||
| 916 | +message DinerMealSuspensionRecordModification { | ||
| 917 | + int32 id = 1; | ||
| 918 | + bool shouldUpdateClientId = 2; | ||
| 919 | + int32 clientId = 3; | ||
| 920 | + bool shouldUpdateClassId = 4; | ||
| 921 | + int32 classId = 5; | ||
| 922 | + bool shouldUpdateDinerId = 6; | ||
| 923 | + int32 dinerId = 7; | ||
| 924 | + bool shouldUpdateStartAt = 8; | ||
| 925 | + int64 startAt = 9; | ||
| 926 | + bool shouldUpdateEndAt = 10; | ||
| 927 | + int64 endAt = 11; | ||
| 928 | + bool shouldUpdateComment = 12; | ||
| 929 | + string comment = 13; | ||
| 930 | +} | ||
| 931 | + | ||
| 932 | +message UpdateDinerMealSuspensionRecordRpcResponse { | ||
| 933 | + bool isUpdated = 1; | ||
| 934 | +} | ||
| 935 | + | ||
| 936 | +message DeleteDinerMealSuspensionRecordsByIdsRpcRequest { | ||
| 937 | + repeated int32 ids = 1; | ||
| 938 | + int32 enterpriseId = 2; | ||
| 939 | + int32 updatedBy = 3; | ||
| 940 | + int32 updateSource = 4; | ||
| 941 | +} | ||
| 942 | + | ||
| 943 | +message DeleteDinerMealSuspensionRecordsRpcResponse { | ||
| 944 | + bool isDeleted = 1; | ||
| 945 | +} | ||
| 946 | + | ||
| 947 | +message BatchCreateDinerMealSuspensionRecordsRpcRequest { | ||
| 948 | + int32 enterpriseId = 1; | ||
| 949 | + int32 createdBy = 2; | ||
| 950 | + int32 creationSource = 3; | ||
| 951 | + repeated DinerMealSuspensionRecordCreation creations = 4; | ||
| 952 | +} | ||
| 953 | + | ||
| 954 | +message BatchCreateDinerMealSuspensionRecordsRpcResponse { | ||
| 955 | + bool isCreated = 1; | ||
| 956 | + repeated int32 ids = 2; | ||
| 957 | +} | ... | ... |
-
Please register or login to post a comment