wangyingyang

fix

No preview for this file type
......@@ -37,10 +37,10 @@ public class MealController {
}
@ApiOperation(value = "获取enterprise所有餐别")
@GetMapping("/enterprises/{enterpriseId}/meals")
@GetMapping("/enterprises/meals")
@ResponseStatus(HttpStatus.OK)
public List<MealDto> getAllMeals(@PathVariable Integer enterpriseId) {
return mealService.getAllMeals(enterpriseId);
public List<MealDto> getAllMeals() {
return mealService.getAllMeals();
}
}
......
......@@ -7,5 +7,5 @@ public interface MealService {
List<MealDto> getMealsByIds(Integer enterpriseId, List<Integer> ids);
List<MealDto> getAllMeals(Integer enterpriseId);
List<MealDto> getAllMeals();
}
......
......@@ -134,15 +134,20 @@ public class KdsServiceImpl implements KdsService {
final var operatorLoginInfo = LoginContextHolder.getLoginInfo();
final var userResource = enterpriseResourceServiceRpcClient.getUserResources(
operatorLoginInfo.getEnterpriseId(), operatorLoginInfo.getId());
boolean shouldFilterStallIds = false;
List<Integer> stallIds = new ArrayList<>();
final var operator = wOperatorServiceRpcClient.getWOperatorById(operatorLoginInfo.getId()).getResponse();
if (!operator.getIsSuper()) {
shouldFilterStallIds = true;
final var userResource = enterpriseResourceServiceRpcClient.getUserResources(
operatorLoginInfo.getEnterpriseId(), operatorLoginInfo.getId());
stallIds.addAll(userResource.getStallIdsList());
}
final var queryOrderDto = QueryOrderByConditionDto.builder()
.enterpriseId(operatorLoginInfo.getEnterpriseId())
.shouldFilterClientIds(true)
.clientIds(userResource.getClientIdsList())
.shouldFilterStallIds(true)
.stallIds(userResource.getStallIdsList())
.shouldFilterStallIds(shouldFilterStallIds)
.stallIds(stallIds)
.shouldFilterCreatedAtTimeStart(true)
.createdAtTimeStart(todayZero)
.shouldFilterCreatedAtTimeEnd(true)
......@@ -150,6 +155,7 @@ public class KdsServiceImpl implements KdsService {
.shouldFilterStatus(true)
.status(queryDto.getOrderStatus())
.build();
final var orderList = orderServiceRpcClient.getOrdersByCondition(queryOrderDto);
List<Integer> orderIds = orderList.stream()
.map(SingleClientCustomerOrderRpcResponse::getId)
......
package com.infoloop.tianting.service.impl;
import com.infoloop.tianting.context.LoginContextHolder;
import com.infoloop.tianting.model.dto.MealDbDTO.MealDto;
import com.infoloop.tianting.service.MealService;
import com.infoloop.tianting.service.client.MealServiceRpcClient;
......@@ -40,8 +41,9 @@ public class MealServiceImpl implements MealService {
}
@Override
public List<MealDto> getAllMeals(Integer enterpriseId) {
final var response = mealServiceRpcClient.getAllMeals(enterpriseId);
public List<MealDto> getAllMeals() {
final var operatorLoginInfo = LoginContextHolder.getLoginInfo();
final var response = mealServiceRpcClient.getAllMeals(operatorLoginInfo.getEnterpriseId());
return response.getResponsesList().stream().map(
meal -> MealDto.builder()
.id(meal.getId())
......