Merge branch 'feature/2025-10-23' into 'master'
Feature/2025 10 23 See merge request !11
Showing
16 changed files
with
238 additions
and
44 deletions
| ... | @@ -57,6 +57,8 @@ public class LoginContextHolder { | ... | @@ -57,6 +57,8 @@ public class LoginContextHolder { |
| 57 | 57 | ||
| 58 | private Integer enterpriseId; | 58 | private Integer enterpriseId; |
| 59 | 59 | ||
| 60 | + private Integer clientId; | ||
| 61 | + | ||
| 60 | private String name; | 62 | private String name; |
| 61 | 63 | ||
| 62 | @Builder.Default | 64 | @Builder.Default | ... | ... |
| ... | @@ -48,8 +48,8 @@ public class KdsController { | ... | @@ -48,8 +48,8 @@ public class KdsController { |
| 48 | @ApiOperation(value = "kds获取餐别详情") | 48 | @ApiOperation(value = "kds获取餐别详情") |
| 49 | @PostMapping("/kds/mealDetails") | 49 | @PostMapping("/kds/mealDetails") |
| 50 | @ResponseStatus(HttpStatus.OK) | 50 | @ResponseStatus(HttpStatus.OK) |
| 51 | - public List<KdsMealDetailDto> getMealDetail() { | 51 | + public List<KdsMealDetailDto> getMealDetail(@Valid @RequestBody KdsDTO.KdsMealDetailQueryDto queryDto) { |
| 52 | - return kdsService.getMealDetail(); | 52 | + return kdsService.getMealDetail(queryDto); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | } | 55 | } | ... | ... |
| ... | @@ -8,6 +8,7 @@ import lombok.Getter; | ... | @@ -8,6 +8,7 @@ import lombok.Getter; |
| 8 | public enum SettlementDimensionEnum { | 8 | public enum SettlementDimensionEnum { |
| 9 | BY_SKU(1, "菜品"), | 9 | BY_SKU(1, "菜品"), |
| 10 | BY_MEAL(2, "餐别"), | 10 | BY_MEAL(2, "餐别"), |
| 11 | + BY_ORDER(3, "订单") | ||
| 11 | ; | 12 | ; |
| 12 | 13 | ||
| 13 | /** | 14 | /** | ... | ... |
| ... | @@ -93,7 +93,7 @@ public class LoginInterceptor implements HandlerInterceptor { | ... | @@ -93,7 +93,7 @@ public class LoginInterceptor implements HandlerInterceptor { |
| 93 | ResponseUtil.write(response, ResponseResult.failed(ErrorCodeEnum.FORBIDDEN)); | 93 | ResponseUtil.write(response, ResponseResult.failed(ErrorCodeEnum.FORBIDDEN)); |
| 94 | return false; | 94 | return false; |
| 95 | } | 95 | } |
| 96 | - builder.id(loginId).enterpriseId(enterpriseId).name(customer.getResponse().getName()).openId(openId).loginSource(LoginSourceEnum.CUSTOMER); | 96 | + builder.id(loginId).enterpriseId(enterpriseId).clientId(customer.getResponse().getClientId()).name(customer.getResponse().getName()).openId(openId).loginSource(LoginSourceEnum.CUSTOMER); |
| 97 | return true; | 97 | return true; |
| 98 | } else if (loginSource.equals(LoginSourceEnum.OPERATOR.getValue())){ | 98 | } else if (loginSource.equals(LoginSourceEnum.OPERATOR.getValue())){ |
| 99 | final var loginId = StpUtil.getLoginIdAsInt(); | 99 | final var loginId = StpUtil.getLoginIdAsInt(); |
| ... | @@ -103,7 +103,7 @@ public class LoginInterceptor implements HandlerInterceptor { | ... | @@ -103,7 +103,7 @@ public class LoginInterceptor implements HandlerInterceptor { |
| 103 | ResponseUtil.write(response, ResponseResult.failed(ErrorCodeEnum.FORBIDDEN)); | 103 | ResponseUtil.write(response, ResponseResult.failed(ErrorCodeEnum.FORBIDDEN)); |
| 104 | return false; | 104 | return false; |
| 105 | } | 105 | } |
| 106 | - builder.id(loginId).enterpriseId(enterpriseId).name(opeartor.getName()).loginSource(LoginSourceEnum.OPERATOR); | 106 | + builder.id(loginId).enterpriseId(enterpriseId).clientId(opeartor.getClientId()).name(opeartor.getName()).loginSource(LoginSourceEnum.OPERATOR); |
| 107 | return true; | 107 | return true; |
| 108 | } else if (loginSource.equals(LoginSourceEnum.KDS.getValue())) { | 108 | } else if (loginSource.equals(LoginSourceEnum.KDS.getValue())) { |
| 109 | final var loginId = StpUtil.getLoginIdAsInt(); | 109 | final var loginId = StpUtil.getLoginIdAsInt(); | ... | ... |
| ... | @@ -30,6 +30,7 @@ public class KdsDTO { | ... | @@ -30,6 +30,7 @@ public class KdsDTO { |
| 30 | private Integer price; | 30 | private Integer price; |
| 31 | private String roomNo; | 31 | private String roomNo; |
| 32 | private String remark; | 32 | private String remark; |
| 33 | + private String avoidRemark; | ||
| 33 | private CustomerNotice customerNotice; | 34 | private CustomerNotice customerNotice; |
| 34 | private String adjustSkuRemark; | 35 | private String adjustSkuRemark; |
| 35 | private String mealTime; | 36 | private String mealTime; |
| ... | @@ -38,6 +39,8 @@ public class KdsDTO { | ... | @@ -38,6 +39,8 @@ public class KdsDTO { |
| 38 | private ClientDto client; | 39 | private ClientDto client; |
| 39 | private ClientDto stall; | 40 | private ClientDto stall; |
| 40 | private CustomerDetailDto customer; | 41 | private CustomerDetailDto customer; |
| 42 | + private Integer menuId; | ||
| 43 | + private String menuName; | ||
| 41 | } | 44 | } |
| 42 | 45 | ||
| 43 | @Data | 46 | @Data |
| ... | @@ -77,6 +80,7 @@ public class KdsDTO { | ... | @@ -77,6 +80,7 @@ public class KdsDTO { |
| 77 | private String tableCode; | 80 | private String tableCode; |
| 78 | private Integer totalCount; | 81 | private Integer totalCount; |
| 79 | private String remark; | 82 | private String remark; |
| 83 | + private String avoidRemark; | ||
| 80 | private String mealTime; | 84 | private String mealTime; |
| 81 | private CustomerNotice customerNotice; | 85 | private CustomerNotice customerNotice; |
| 82 | private Integer totalPrice; | 86 | private Integer totalPrice; |
| ... | @@ -87,6 +91,8 @@ public class KdsDTO { | ... | @@ -87,6 +91,8 @@ public class KdsDTO { |
| 87 | private ClientDto client; | 91 | private ClientDto client; |
| 88 | private CustomerDetailDto customer; | 92 | private CustomerDetailDto customer; |
| 89 | private List<KdsOrderLocationDetailDto> orderDetailList; | 93 | private List<KdsOrderLocationDetailDto> orderDetailList; |
| 94 | + private Integer menuId; | ||
| 95 | + private String menuName; | ||
| 90 | } | 96 | } |
| 91 | 97 | ||
| 92 | @Data | 98 | @Data |
| ... | @@ -97,6 +103,7 @@ public class KdsDTO { | ... | @@ -97,6 +103,7 @@ public class KdsDTO { |
| 97 | public static class KdsOrderSkuQueryDto { | 103 | public static class KdsOrderSkuQueryDto { |
| 98 | private ServeStatusEnum serveStatus; | 104 | private ServeStatusEnum serveStatus; |
| 99 | private Integer mealId; | 105 | private Integer mealId; |
| 106 | + private String mealTime; | ||
| 100 | } | 107 | } |
| 101 | 108 | ||
| 102 | @Data | 109 | @Data |
| ... | @@ -107,12 +114,22 @@ public class KdsDTO { | ... | @@ -107,12 +114,22 @@ public class KdsDTO { |
| 107 | public static class KdsOrderLocationQueryDto { | 114 | public static class KdsOrderLocationQueryDto { |
| 108 | private OrderStatusEnum orderStatus; | 115 | private OrderStatusEnum orderStatus; |
| 109 | private Integer mealId; | 116 | private Integer mealId; |
| 117 | + private String mealTime; | ||
| 110 | } | 118 | } |
| 111 | 119 | ||
| 112 | @Data | 120 | @Data |
| 113 | @Builder | 121 | @Builder |
| 114 | @AllArgsConstructor | 122 | @AllArgsConstructor |
| 115 | @NoArgsConstructor | 123 | @NoArgsConstructor |
| 124 | + @ApiModel(description = "KdsMealDetailQueryDto") | ||
| 125 | + public static class KdsMealDetailQueryDto { | ||
| 126 | + private String mealTime; | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + @Data | ||
| 130 | + @Builder | ||
| 131 | + @AllArgsConstructor | ||
| 132 | + @NoArgsConstructor | ||
| 116 | @ApiModel(description = "KdsMealDetailDto") | 133 | @ApiModel(description = "KdsMealDetailDto") |
| 117 | public static class KdsMealDetailDto { | 134 | public static class KdsMealDetailDto { |
| 118 | private Integer mealId; | 135 | private Integer mealId; | ... | ... |
| ... | @@ -64,6 +64,16 @@ public class OrderDbDTO { | ... | @@ -64,6 +64,16 @@ public class OrderDbDTO { |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | @Data | 66 | @Data |
| 67 | + @ApiModel(description = "查询订单Dto") | ||
| 68 | + public static class QueryOrderDto { | ||
| 69 | + private Integer enterpriseId; | ||
| 70 | + private Integer clientId; | ||
| 71 | + private OrderStatusEnum status; | ||
| 72 | + private String keyword; | ||
| 73 | + private List<Integer> stallIds; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + @Data | ||
| 67 | @ApiModel(description = "查询已撤销订单Dto") | 77 | @ApiModel(description = "查询已撤销订单Dto") |
| 68 | public static class QueryRefundOrderByPaginationDto { | 78 | public static class QueryRefundOrderByPaginationDto { |
| 69 | private Integer enterpriseId; | 79 | private Integer enterpriseId; |
| ... | @@ -155,6 +165,7 @@ public class OrderDbDTO { | ... | @@ -155,6 +165,7 @@ public class OrderDbDTO { |
| 155 | private String tableCode; | 165 | private String tableCode; |
| 156 | private Integer updatedBy; | 166 | private Integer updatedBy; |
| 157 | private OrderSourceEnum updatedSource; | 167 | private OrderSourceEnum updatedSource; |
| 168 | + private String avoidRemark; | ||
| 158 | } | 169 | } |
| 159 | 170 | ||
| 160 | 171 | ||
| ... | @@ -440,6 +451,9 @@ public class OrderDbDTO { | ... | @@ -440,6 +451,9 @@ public class OrderDbDTO { |
| 440 | @ApiModelProperty(value = "备注") | 451 | @ApiModelProperty(value = "备注") |
| 441 | private String remark; | 452 | private String remark; |
| 442 | 453 | ||
| 454 | + @ApiModelProperty(value = "忌口备注") | ||
| 455 | + private String avoidRemark; | ||
| 456 | + | ||
| 443 | @ApiModelProperty(value = "下单客户当时的忌口、医嘱") | 457 | @ApiModelProperty(value = "下单客户当时的忌口、医嘱") |
| 444 | private CustomerNotice customerNoticeJson; | 458 | private CustomerNotice customerNoticeJson; |
| 445 | 459 | ... | ... |
| ... | @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel; | ... | @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel; |
| 5 | import lombok.Builder; | 5 | import lombok.Builder; |
| 6 | import lombok.Data; | 6 | import lombok.Data; |
| 7 | 7 | ||
| 8 | +import java.math.BigDecimal; | ||
| 8 | import java.time.LocalDateTime; | 9 | import java.time.LocalDateTime; |
| 9 | import java.util.ArrayList; | 10 | import java.util.ArrayList; |
| 10 | import java.util.List; | 11 | import java.util.List; |
| ... | @@ -75,7 +76,55 @@ public class SettlementDTO { | ... | @@ -75,7 +76,55 @@ public class SettlementDTO { |
| 75 | private Map<String, Map<String, Map<String, List<SettlementMenuMealDto>>>> classifyOrders; | 76 | private Map<String, Map<String, Map<String, List<SettlementMenuMealDto>>>> classifyOrders; |
| 76 | } | 77 | } |
| 77 | 78 | ||
| 78 | -} | 79 | + @Data |
| 80 | + @Builder | ||
| 81 | + @ApiModel(description = "SettlementDataByOrderDto") | ||
| 82 | + public static class SettlementDataByOrderDto { | ||
| 83 | + private List<SettlementOrderDetail> classifyOrders; | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + @Data | ||
| 87 | + @Builder | ||
| 88 | + @ApiModel(description = "SettlementOrderDetail") | ||
| 89 | + public static class SettlementOrderDetail { | ||
| 90 | + private String mealTime; | ||
| 91 | + private String code; | ||
| 92 | + private String mealName; | ||
| 93 | + private String roomNo; | ||
| 94 | + private String customerName; | ||
| 95 | + private String HISCustomerNo; | ||
| 96 | + private List<String> avoids; | ||
| 97 | + private List<String> doctors; | ||
| 98 | + private String menuName; | ||
| 99 | + private String skuName; | ||
| 100 | + private Integer count; | ||
| 101 | + private BigDecimal price; | ||
| 102 | + private BigDecimal totalPrice; | ||
| 103 | + private String remark; | ||
| 104 | + private String avoidRemark; | ||
| 105 | + private String onlinePay; | ||
| 106 | + } | ||
| 79 | 107 | ||
| 108 | + @Data | ||
| 109 | + @Builder | ||
| 110 | + @ApiModel(description = "SeparateMealDetail") | ||
| 111 | + public static class SeparateMealDetail { | ||
| 112 | + private Integer orderId; | ||
| 113 | + private String mealName; | ||
| 114 | + private String roomNo; | ||
| 115 | + private String customerName; | ||
| 116 | + private String menuName; | ||
| 117 | + private String skuName; | ||
| 118 | + private Integer count; | ||
| 119 | + private String avoids; | ||
| 120 | + private String remark; | ||
| 121 | + } | ||
| 80 | 122 | ||
| 81 | - | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 123 | + @Data | ||
| 124 | + @Builder | ||
| 125 | + @ApiModel(description = "SeparateMealDataDto") | ||
| 126 | + public static class SeparateMealDataDto { | ||
| 127 | + private List<SeparateMealDetail> mealDetails; | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | +} | ... | ... |
| 1 | +package com.infoloop.tianting.model.enums.desc; | ||
| 2 | + | ||
| 3 | +import com.infoloop.tianting.clientcustomerorderservice.OnlinePayEnum; | ||
| 4 | + | ||
| 5 | +public enum OnlinePayDescEnum implements BaseProtoDescEnum<OnlinePayEnum> { | ||
| 6 | + | ||
| 7 | + UNKNOWN(OnlinePayEnum.UNKNOWN, ""), | ||
| 8 | + ONLINE(OnlinePayEnum.ONLINE, "线上支付"), | ||
| 9 | + OFFLINE(OnlinePayEnum.OFFLINE, "线下支付"), | ||
| 10 | + LEAVE_HOSPITAL(OnlinePayEnum.LEAVE_HOSPITAL, "出院支付"), | ||
| 11 | + EMPLOYEE_CARD(OnlinePayEnum.EMPLOYEE_CARD, "员工卡支付"), | ||
| 12 | + PAPER_VERIFICATION(OnlinePayEnum.PAPER_VERIFICATION, "纸质核销"), | ||
| 13 | + CASH(OnlinePayEnum.CASH, "现金支付"), | ||
| 14 | + MEAL_CARD(OnlinePayEnum.MEAL_CARD, "餐卡结算"), | ||
| 15 | + BAND_CARD(OnlinePayEnum.BAND_CARD, "POS-银行卡"), | ||
| 16 | + ALIPAY(OnlinePayEnum.ALIPAY, "POS-支付宝"), | ||
| 17 | + WECHATPAY(OnlinePayEnum.WECHATPAY, "POS-微信"); | ||
| 18 | + | ||
| 19 | + private final OnlinePayEnum protoEnum; | ||
| 20 | + private final String desc; | ||
| 21 | + | ||
| 22 | + OnlinePayDescEnum(OnlinePayEnum protoEnum, String desc) { | ||
| 23 | + this.protoEnum = protoEnum; | ||
| 24 | + this.desc = desc; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + @Override | ||
| 28 | + public OnlinePayEnum getProtoEnum() { | ||
| 29 | + return protoEnum; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + @Override | ||
| 33 | + public String getDesc() { | ||
| 34 | + return desc; | ||
| 35 | + } | ||
| 36 | +} |
| 1 | package com.infoloop.tianting.service; | 1 | package com.infoloop.tianting.service; |
| 2 | 2 | ||
| 3 | +import com.infoloop.tianting.model.dto.KdsDTO; | ||
| 3 | import com.infoloop.tianting.model.dto.KdsDTO.KdsMealDetailDto; | 4 | import com.infoloop.tianting.model.dto.KdsDTO.KdsMealDetailDto; |
| 4 | import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderLocationDto; | 5 | import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderLocationDto; |
| 5 | import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderLocationQueryDto; | 6 | import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderLocationQueryDto; |
| ... | @@ -14,5 +15,5 @@ public interface KdsService { | ... | @@ -14,5 +15,5 @@ public interface KdsService { |
| 14 | 15 | ||
| 15 | List<KdsOrderLocationDto> getOrderDetailByLocation(KdsOrderLocationQueryDto queryDto); | 16 | List<KdsOrderLocationDto> getOrderDetailByLocation(KdsOrderLocationQueryDto queryDto); |
| 16 | 17 | ||
| 17 | - List<KdsMealDetailDto> getMealDetail(); | 18 | + List<KdsMealDetailDto> getMealDetail(KdsDTO.KdsMealDetailQueryDto queryDto); |
| 18 | } | 19 | } | ... | ... |
| 1 | package com.infoloop.tianting.service; | 1 | package com.infoloop.tianting.service; |
| 2 | 2 | ||
| 3 | +import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderDto; | ||
| 3 | import com.infoloop.tianting.model.dto.SettlementDTO.SettlementRequestDto; | 4 | import com.infoloop.tianting.model.dto.SettlementDTO.SettlementRequestDto; |
| 4 | 5 | ||
| 5 | import java.io.ByteArrayOutputStream; | 6 | import java.io.ByteArrayOutputStream; |
| 6 | 7 | ||
| 7 | public interface SettlementService { | 8 | public interface SettlementService { |
| 8 | ByteArrayOutputStream generateOrderSettlementExcel(SettlementRequestDto settlementRequest); | 9 | ByteArrayOutputStream generateOrderSettlementExcel(SettlementRequestDto settlementRequest); |
| 10 | + ByteArrayOutputStream exportSeparateMealsExcel(QueryOrderDto queryOrderDto); | ||
| 9 | } | 11 | } | ... | ... |
| ... | @@ -31,6 +31,7 @@ import com.infoloop.tianting.clientcustomerorderservice.OrderStatusEnum; | ... | @@ -31,6 +31,7 @@ import com.infoloop.tianting.clientcustomerorderservice.OrderStatusEnum; |
| 31 | import com.infoloop.tianting.clientcustomerorderservice.OrderTypeEnum; | 31 | import com.infoloop.tianting.clientcustomerorderservice.OrderTypeEnum; |
| 32 | import com.infoloop.tianting.clientcustomerorderservice.PayStatusEnum; | 32 | import com.infoloop.tianting.clientcustomerorderservice.PayStatusEnum; |
| 33 | import com.infoloop.tianting.clientcustomerorderservice.QueryClientCustomerOrdersByConditionRpcRequest; | 33 | import com.infoloop.tianting.clientcustomerorderservice.QueryClientCustomerOrdersByConditionRpcRequest; |
| 34 | +import com.infoloop.tianting.clientcustomerorderservice.QueryClientCustomerOrdersByConditionRpcResponse; | ||
| 34 | import com.infoloop.tianting.clientcustomerorderservice.QueryClientCustomerOrdersByPaginationRpcRequest; | 35 | import com.infoloop.tianting.clientcustomerorderservice.QueryClientCustomerOrdersByPaginationRpcRequest; |
| 35 | import com.infoloop.tianting.clientcustomerorderservice.QueryClientCustomerOrdersByPaginationRpcResponse; | 36 | import com.infoloop.tianting.clientcustomerorderservice.QueryClientCustomerOrdersByPaginationRpcResponse; |
| 36 | import com.infoloop.tianting.clientcustomerorderservice.QuerySkuSellQuantitiesByStallAndSkuIdsRpcRequest; | 37 | import com.infoloop.tianting.clientcustomerorderservice.QuerySkuSellQuantitiesByStallAndSkuIdsRpcRequest; |
| ... | @@ -57,6 +58,7 @@ import com.infoloop.tianting.model.bo.AddSkusSellQuantityBO; | ... | @@ -57,6 +58,7 @@ import com.infoloop.tianting.model.bo.AddSkusSellQuantityBO; |
| 57 | import com.infoloop.tianting.model.bo.SkuSellQuantityBO; | 58 | import com.infoloop.tianting.model.bo.SkuSellQuantityBO; |
| 58 | import com.infoloop.tianting.model.dto.OperationDTO.BatchOperationDto; | 59 | import com.infoloop.tianting.model.dto.OperationDTO.BatchOperationDto; |
| 59 | import com.infoloop.tianting.model.dto.OperationDTO.SingleOperationDto; | 60 | import com.infoloop.tianting.model.dto.OperationDTO.SingleOperationDto; |
| 61 | +import com.infoloop.tianting.model.dto.OrderDbDTO; | ||
| 60 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderDetailDto; | 62 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderDetailDto; |
| 61 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderDto; | 63 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderDto; |
| 62 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderResponse; | 64 | import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderResponse; |
| ... | @@ -180,6 +182,8 @@ public class OrderServiceRpcClient { | ... | @@ -180,6 +182,8 @@ public class OrderServiceRpcClient { |
| 180 | .setTableCode(tableCode) | 182 | .setTableCode(tableCode) |
| 181 | .setShouldUpdateRoomNo(updateOrderDto.isShouldUpdateRoomNo()) | 183 | .setShouldUpdateRoomNo(updateOrderDto.isShouldUpdateRoomNo()) |
| 182 | .setRoomNo(roomNo) | 184 | .setRoomNo(roomNo) |
| 185 | + .setShouldUpdateAvoidRemark(updateOrderDto.getAvoidRemark() != null) | ||
| 186 | + .setAvoidRemark(updateOrderDto.getAvoidRemark() == null ? "" : updateOrderDto.getAvoidRemark()) | ||
| 183 | .build(); | 187 | .build(); |
| 184 | final var request = UpdateClientCustomerOrderRpcRequest.newBuilder() | 188 | final var request = UpdateClientCustomerOrderRpcRequest.newBuilder() |
| 185 | .setEnterpriseId(updateOrderDto.getEnterpriseId()) | 189 | .setEnterpriseId(updateOrderDto.getEnterpriseId()) |
| ... | @@ -188,7 +192,7 @@ public class OrderServiceRpcClient { | ... | @@ -188,7 +192,7 @@ public class OrderServiceRpcClient { |
| 188 | .setModification(modification) | 192 | .setModification(modification) |
| 189 | .build(); | 193 | .build(); |
| 190 | final UpdateClientCustomerOrderRpcResponse updateClientCustomerOrderRpcResponse = orderServiceRpcBlockingStub.updateClientCustomerOrder(request); | 194 | final UpdateClientCustomerOrderRpcResponse updateClientCustomerOrderRpcResponse = orderServiceRpcBlockingStub.updateClientCustomerOrder(request); |
| 191 | - if (updateClientCustomerOrderRpcResponse.getIsUpdated() && updateOrderDto.getStatus() == OrderStatusEnum.ORDER_CANCELED) { | 195 | + if (updateClientCustomerOrderRpcResponse.getIsUpdated() && updateOrderDto.getStatus() != null && updateOrderDto.getStatus() == OrderStatusEnum.ORDER_CANCELED) { |
| 192 | final var orderById = getOrderById(updateOrderDto.getId()); | 196 | final var orderById = getOrderById(updateOrderDto.getId()); |
| 193 | if (orderById != null && orderById.getCloseTimeType() == CloseTimeType.IMMEDIATELY) { | 197 | if (orderById != null && orderById.getCloseTimeType() == CloseTimeType.IMMEDIATELY) { |
| 194 | final var orderDetails = getOrderDetailsByOrderId(orderById.getId()); | 198 | final var orderDetails = getOrderDetailsByOrderId(orderById.getId()); |
| ... | @@ -484,6 +488,17 @@ public class OrderServiceRpcClient { | ... | @@ -484,6 +488,17 @@ public class OrderServiceRpcClient { |
| 484 | return orderServiceRpcBlockingStub.queryClientCustomerOrdersByPagination(request); | 488 | return orderServiceRpcBlockingStub.queryClientCustomerOrdersByPagination(request); |
| 485 | } | 489 | } |
| 486 | 490 | ||
| 491 | + public QueryClientCustomerOrdersByConditionRpcResponse queryClientCustomerOrdersByCondition(OrderDbDTO.QueryOrderDto queryOrderDto) { | ||
| 492 | + final var request = QueryClientCustomerOrdersByConditionRpcRequest.newBuilder() | ||
| 493 | + .setShouldFilterStatus(true) | ||
| 494 | + .setStatus(queryOrderDto.getStatus()) | ||
| 495 | + .setEnterpriseId(queryOrderDto.getEnterpriseId()) | ||
| 496 | + .setShouldFilterClientIds(true).addClientIds(queryOrderDto.getClientId()) | ||
| 497 | + .setShouldFilterStallIds(true).addAllStallIds(queryOrderDto.getStallIds()) | ||
| 498 | + .build(); | ||
| 499 | + return orderServiceRpcBlockingStub.queryClientCustomerOrdersByCondition(request); | ||
| 500 | + } | ||
| 501 | + | ||
| 487 | public QueryClientCustomerOrdersByPaginationRpcResponse queryRefundClientCustomerOrdersByPagination( | 502 | public QueryClientCustomerOrdersByPaginationRpcResponse queryRefundClientCustomerOrdersByPagination( |
| 488 | QueryRefundOrderByPaginationDto queryOrderDto) { | 503 | QueryRefundOrderByPaginationDto queryOrderDto) { |
| 489 | final var request = QueryClientCustomerOrdersByPaginationRpcRequest.newBuilder() | 504 | final var request = QueryClientCustomerOrdersByPaginationRpcRequest.newBuilder() | ... | ... |
| ... | @@ -6,7 +6,9 @@ import com.infoloop.tianting.clientcustomerorderservice.ServeStatusEnum; | ... | @@ -6,7 +6,9 @@ import com.infoloop.tianting.clientcustomerorderservice.ServeStatusEnum; |
| 6 | import com.infoloop.tianting.clientcustomerorderservice.SingleClientCustomerOrderDetailRpcResponse; | 6 | import com.infoloop.tianting.clientcustomerorderservice.SingleClientCustomerOrderDetailRpcResponse; |
| 7 | import com.infoloop.tianting.clientcustomerorderservice.SingleClientCustomerOrderRpcResponse; | 7 | import com.infoloop.tianting.clientcustomerorderservice.SingleClientCustomerOrderRpcResponse; |
| 8 | import com.infoloop.tianting.context.LoginContextHolder; | 8 | import com.infoloop.tianting.context.LoginContextHolder; |
| 9 | +import com.infoloop.tianting.menuservice.SingleMenuRpcResponse; | ||
| 9 | import com.infoloop.tianting.model.dto.ClientInventoryDbDTO.ClientDto; | 10 | import com.infoloop.tianting.model.dto.ClientInventoryDbDTO.ClientDto; |
| 11 | +import com.infoloop.tianting.model.dto.KdsDTO; | ||
| 10 | import com.infoloop.tianting.model.dto.KdsDTO.KdsMealDetailDto; | 12 | import com.infoloop.tianting.model.dto.KdsDTO.KdsMealDetailDto; |
| 11 | import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderLocationDetailDto; | 13 | import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderLocationDetailDto; |
| 12 | import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderLocationDto; | 14 | import com.infoloop.tianting.model.dto.KdsDTO.KdsOrderLocationDto; |
| ... | @@ -22,6 +24,7 @@ import com.infoloop.tianting.service.client.ClientCustomerServiceRpcClient; | ... | @@ -22,6 +24,7 @@ import com.infoloop.tianting.service.client.ClientCustomerServiceRpcClient; |
| 22 | import com.infoloop.tianting.service.client.ClientInventoryServiceRpcClient; | 24 | import com.infoloop.tianting.service.client.ClientInventoryServiceRpcClient; |
| 23 | import com.infoloop.tianting.service.client.EnterpriseResourceServiceRpcClient; | 25 | import com.infoloop.tianting.service.client.EnterpriseResourceServiceRpcClient; |
| 24 | import com.infoloop.tianting.service.client.MealServiceRpcClient; | 26 | import com.infoloop.tianting.service.client.MealServiceRpcClient; |
| 27 | +import com.infoloop.tianting.service.client.MenuServiceRpcClient; | ||
| 25 | import com.infoloop.tianting.service.client.OrderServiceRpcClient; | 28 | import com.infoloop.tianting.service.client.OrderServiceRpcClient; |
| 26 | import com.infoloop.tianting.service.client.SkuServiceRpcClient; | 29 | import com.infoloop.tianting.service.client.SkuServiceRpcClient; |
| 27 | import com.infoloop.tianting.service.client.WOperatorServiceRpcClient; | 30 | import com.infoloop.tianting.service.client.WOperatorServiceRpcClient; |
| ... | @@ -33,8 +36,10 @@ import org.springframework.stereotype.Service; | ... | @@ -33,8 +36,10 @@ import org.springframework.stereotype.Service; |
| 33 | 36 | ||
| 34 | import java.time.LocalDate; | 37 | import java.time.LocalDate; |
| 35 | import java.time.LocalDateTime; | 38 | import java.time.LocalDateTime; |
| 39 | +import java.time.LocalTime; | ||
| 36 | import java.util.ArrayList; | 40 | import java.util.ArrayList; |
| 37 | import java.util.List; | 41 | import java.util.List; |
| 42 | +import java.util.function.Function; | ||
| 38 | import java.util.stream.Collectors; | 43 | import java.util.stream.Collectors; |
| 39 | 44 | ||
| 40 | @Slf4j | 45 | @Slf4j |
| ... | @@ -49,14 +54,14 @@ public class KdsServiceImpl implements KdsService { | ... | @@ -49,14 +54,14 @@ public class KdsServiceImpl implements KdsService { |
| 49 | private final SkuServiceRpcClient skuServiceRpcClient; | 54 | private final SkuServiceRpcClient skuServiceRpcClient; |
| 50 | private final ClientInventoryServiceRpcClient clientInventoryServiceRpcClient; | 55 | private final ClientInventoryServiceRpcClient clientInventoryServiceRpcClient; |
| 51 | private final ClientCustomerServiceRpcClient clientCustomerServiceRpcClient; | 56 | private final ClientCustomerServiceRpcClient clientCustomerServiceRpcClient; |
| 57 | + private final MenuServiceRpcClient menuServiceRpcClient; | ||
| 52 | 58 | ||
| 53 | @Override | 59 | @Override |
| 54 | public List<KdsOrderSkuDto> getOrderDetailBySku(KdsOrderSkuQueryDto queryDto) { | 60 | public List<KdsOrderSkuDto> getOrderDetailBySku(KdsOrderSkuQueryDto queryDto) { |
| 55 | // 获取当日所有的订单 和 订单明细 | 61 | // 获取当日所有的订单 和 订单明细 |
| 56 | - LocalDate today = LocalDate.now(); | 62 | + LocalDate today = LocalDate.parse(queryDto.getMealTime(), DateUtil.YYYY_MM_DD); |
| 57 | LocalDateTime todayZero = today.atStartOfDay(); | 63 | LocalDateTime todayZero = today.atStartOfDay(); |
| 58 | - LocalDate tomorrow = today.plusDays(1); | 64 | + LocalDateTime todayEnd = today.atTime(LocalTime.MAX); |
| 59 | - LocalDateTime tomorrowZero = tomorrow.atStartOfDay(); | ||
| 60 | final var operatorLoginInfo = LoginContextHolder.getLoginInfo(); | 65 | final var operatorLoginInfo = LoginContextHolder.getLoginInfo(); |
| 61 | boolean shouldFilterStallIds = false; | 66 | boolean shouldFilterStallIds = false; |
| 62 | List<Integer> stallIds = new ArrayList<>(); | 67 | List<Integer> stallIds = new ArrayList<>(); |
| ... | @@ -73,7 +78,7 @@ public class KdsServiceImpl implements KdsService { | ... | @@ -73,7 +78,7 @@ public class KdsServiceImpl implements KdsService { |
| 73 | .shouldFilterMealTimeStart(true) | 78 | .shouldFilterMealTimeStart(true) |
| 74 | .mealTimeStart(todayZero) | 79 | .mealTimeStart(todayZero) |
| 75 | .shouldFilterMealTimeEnd(true) | 80 | .shouldFilterMealTimeEnd(true) |
| 76 | - .mealTimeEnd(tomorrowZero) | 81 | + .mealTimeEnd(todayEnd) |
| 77 | .shouldFilterPayStatus(true) | 82 | .shouldFilterPayStatus(true) |
| 78 | .payStatus(PayStatusEnum.SUCCEED) | 83 | .payStatus(PayStatusEnum.SUCCEED) |
| 79 | .build(); | 84 | .build(); |
| ... | @@ -118,6 +123,9 @@ public class KdsServiceImpl implements KdsService { | ... | @@ -118,6 +123,9 @@ public class KdsServiceImpl implements KdsService { |
| 118 | .collect(Collectors.toList()); | 123 | .collect(Collectors.toList()); |
| 119 | final var skus = skuServiceRpcClient.getDishSkusByIds(skuIds).getResponseList(); | 124 | final var skus = skuServiceRpcClient.getDishSkusByIds(skuIds).getResponseList(); |
| 120 | 125 | ||
| 126 | + final var menuIds = orderList.stream().map(SingleClientCustomerOrderRpcResponse::getMenuId).distinct().toList(); | ||
| 127 | + final var menuMap = menuServiceRpcClient.getMenusByIds(operator.getEnterpriseId(), menuIds).getResponsesList().stream().collect(Collectors.toMap(SingleMenuRpcResponse::getId, Function.identity())); | ||
| 128 | + | ||
| 121 | List<KdsOrderSkuDto> kdsOrderSkuList = new ArrayList<>(); | 129 | List<KdsOrderSkuDto> kdsOrderSkuList = new ArrayList<>(); |
| 122 | for (Integer menuDetailId : menuDetailIds) { | 130 | for (Integer menuDetailId : menuDetailIds) { |
| 123 | // 找出该menuDetailId 的所有orderDetail | 131 | // 找出该menuDetailId 的所有orderDetail |
| ... | @@ -168,8 +176,11 @@ public class KdsServiceImpl implements KdsService { | ... | @@ -168,8 +176,11 @@ public class KdsServiceImpl implements KdsService { |
| 168 | .count(detail.getCount()) | 176 | .count(detail.getCount()) |
| 169 | .orderDetailId(detail.getId()) | 177 | .orderDetailId(detail.getId()) |
| 170 | .remark(order.get().getRemark()) | 178 | .remark(order.get().getRemark()) |
| 179 | + .avoidRemark(order.get().getAvoidRemark()) | ||
| 171 | .orderId(order.get().getId()) | 180 | .orderId(order.get().getId()) |
| 172 | .roomNo(order.get().getSyncRoomNo().isEmpty() ? order.get().getRoomNo() : order.get().getSyncRoomNo()) | 181 | .roomNo(order.get().getSyncRoomNo().isEmpty() ? order.get().getRoomNo() : order.get().getSyncRoomNo()) |
| 182 | + .menuId(order.get().getMenuId()) | ||
| 183 | + .menuName(menuMap.get(order.get().getMenuId()) == null ? "" : menuMap.get(order.get().getMenuId()).getName()) | ||
| 173 | .tableCode(order.get().getTableCode()) | 184 | .tableCode(order.get().getTableCode()) |
| 174 | .customerNotice(CustomerNotice.builder() | 185 | .customerNotice(CustomerNotice.builder() |
| 175 | .doctors(order.get().getCustomerNoticeJson().getDoctorsList()) | 186 | .doctors(order.get().getCustomerNoticeJson().getDoctorsList()) |
| ... | @@ -208,9 +219,9 @@ public class KdsServiceImpl implements KdsService { | ... | @@ -208,9 +219,9 @@ public class KdsServiceImpl implements KdsService { |
| 208 | } | 219 | } |
| 209 | 220 | ||
| 210 | @Override | 221 | @Override |
| 211 | - public List<KdsMealDetailDto> getMealDetail() { | 222 | + public List<KdsMealDetailDto> getMealDetail(KdsDTO.KdsMealDetailQueryDto queryDto) { |
| 212 | // 获取当日用餐的所有的订单 和 订单明细 | 223 | // 获取当日用餐的所有的订单 和 订单明细 |
| 213 | - LocalDate today = LocalDate.now(); | 224 | + LocalDate today = LocalDate.parse(queryDto.getMealTime(), DateUtil.YYYY_MM_DD); |
| 214 | LocalDateTime todayZero = today.atStartOfDay(); | 225 | LocalDateTime todayZero = today.atStartOfDay(); |
| 215 | LocalDate tomorrow = today.plusDays(1); | 226 | LocalDate tomorrow = today.plusDays(1); |
| 216 | LocalDateTime tomorrowZero = tomorrow.atStartOfDay().minusMinutes(1); | 227 | LocalDateTime tomorrowZero = tomorrow.atStartOfDay().minusMinutes(1); |
| ... | @@ -235,6 +246,8 @@ public class KdsServiceImpl implements KdsService { | ... | @@ -235,6 +246,8 @@ public class KdsServiceImpl implements KdsService { |
| 235 | .mealTimeStart(todayZero) | 246 | .mealTimeStart(todayZero) |
| 236 | .shouldFilterMealTimeEnd(true) | 247 | .shouldFilterMealTimeEnd(true) |
| 237 | .mealTimeEnd(tomorrowZero) | 248 | .mealTimeEnd(tomorrowZero) |
| 249 | + .shouldFilterPayStatus(true) | ||
| 250 | + .payStatus(PayStatusEnum.SUCCEED) | ||
| 238 | .build(); | 251 | .build(); |
| 239 | 252 | ||
| 240 | final var orderList = orderServiceRpcClient.getOrdersByCondition(queryOrderDto); | 253 | final var orderList = orderServiceRpcClient.getOrdersByCondition(queryOrderDto); |
| ... | @@ -281,10 +294,9 @@ public class KdsServiceImpl implements KdsService { | ... | @@ -281,10 +294,9 @@ public class KdsServiceImpl implements KdsService { |
| 281 | @Override | 294 | @Override |
| 282 | public List<KdsOrderLocationDto> getOrderDetailByLocation(KdsOrderLocationQueryDto queryDto) { | 295 | public List<KdsOrderLocationDto> getOrderDetailByLocation(KdsOrderLocationQueryDto queryDto) { |
| 283 | // 获取当日用餐的所有的订单 和 订单明细 | 296 | // 获取当日用餐的所有的订单 和 订单明细 |
| 284 | - LocalDate today = LocalDate.now(); | 297 | + LocalDate today = LocalDate.parse(queryDto.getMealTime(), DateUtil.YYYY_MM_DD); |
| 285 | LocalDateTime todayZero = today.atStartOfDay(); | 298 | LocalDateTime todayZero = today.atStartOfDay(); |
| 286 | - LocalDate tomorrow = today.plusDays(1); | 299 | + LocalDateTime todayEnd = today.atTime(LocalTime.MAX); |
| 287 | - LocalDateTime tomorrowZero = tomorrow.atStartOfDay().minusMinutes(1); | ||
| 288 | 300 | ||
| 289 | final var operatorLoginInfo = LoginContextHolder.getLoginInfo(); | 301 | final var operatorLoginInfo = LoginContextHolder.getLoginInfo(); |
| 290 | 302 | ||
| ... | @@ -305,7 +317,7 @@ public class KdsServiceImpl implements KdsService { | ... | @@ -305,7 +317,7 @@ public class KdsServiceImpl implements KdsService { |
| 305 | .shouldFilterMealTimeStart(true) | 317 | .shouldFilterMealTimeStart(true) |
| 306 | .mealTimeStart(todayZero) | 318 | .mealTimeStart(todayZero) |
| 307 | .shouldFilterMealTimeEnd(true) | 319 | .shouldFilterMealTimeEnd(true) |
| 308 | - .mealTimeEnd(tomorrowZero) | 320 | + .mealTimeEnd(todayEnd) |
| 309 | .shouldFilterStatus(true) | 321 | .shouldFilterStatus(true) |
| 310 | .status(queryDto.getOrderStatus()) | 322 | .status(queryDto.getOrderStatus()) |
| 311 | .shouldFilterPayStatus(true) | 323 | .shouldFilterPayStatus(true) |
| ... | @@ -339,6 +351,12 @@ public class KdsServiceImpl implements KdsService { | ... | @@ -339,6 +351,12 @@ public class KdsServiceImpl implements KdsService { |
| 339 | final var filteredOrderDetailList = orderDetailList.stream() | 351 | final var filteredOrderDetailList = orderDetailList.stream() |
| 340 | .filter(od -> od.getMealId() == queryDto.getMealId() && od.getServeStatus() != ServeStatusEnum.SERVE_REJECT) | 352 | .filter(od -> od.getMealId() == queryDto.getMealId() && od.getServeStatus() != ServeStatusEnum.SERVE_REJECT) |
| 341 | .collect(Collectors.toList()); | 353 | .collect(Collectors.toList()); |
| 354 | + | ||
| 355 | + | ||
| 356 | + final var menuIds = orderList.stream().map(SingleClientCustomerOrderRpcResponse::getMenuId).distinct().toList(); | ||
| 357 | + final var menuMap = menuServiceRpcClient.getMenusByIds(operator.getEnterpriseId(), menuIds).getResponsesList().stream().collect(Collectors.toMap(SingleMenuRpcResponse::getId, Function.identity())); | ||
| 358 | + | ||
| 359 | + | ||
| 342 | List<KdsOrderLocationDto> kdsOrderLocationList = new ArrayList<>(); | 360 | List<KdsOrderLocationDto> kdsOrderLocationList = new ArrayList<>(); |
| 343 | 361 | ||
| 344 | for (SingleClientCustomerOrderRpcResponse order : orderList) { | 362 | for (SingleClientCustomerOrderRpcResponse order : orderList) { |
| ... | @@ -395,9 +413,12 @@ public class KdsServiceImpl implements KdsService { | ... | @@ -395,9 +413,12 @@ public class KdsServiceImpl implements KdsService { |
| 395 | final var kdsOrder = KdsOrderLocationDto.builder() | 413 | final var kdsOrder = KdsOrderLocationDto.builder() |
| 396 | .totalCount(order.getTotalNum()) | 414 | .totalCount(order.getTotalNum()) |
| 397 | .remark(order.getRemark()) | 415 | .remark(order.getRemark()) |
| 416 | + .avoidRemark(order.getAvoidRemark()) | ||
| 398 | .orderId(order.getId()) | 417 | .orderId(order.getId()) |
| 399 | .roomNo(order.getSyncRoomNo().isEmpty() ? order.getRoomNo() : order.getSyncRoomNo()) | 418 | .roomNo(order.getSyncRoomNo().isEmpty() ? order.getRoomNo() : order.getSyncRoomNo()) |
| 400 | .tableCode(order.getTableCode()) | 419 | .tableCode(order.getTableCode()) |
| 420 | + .menuId(order.getMenuId()) | ||
| 421 | + .menuName(menuMap.get(order.getMenuId()) == null ? "" : menuMap.get(order.getMenuId()).getName()) | ||
| 401 | .customerNotice(CustomerNotice.builder() | 422 | .customerNotice(CustomerNotice.builder() |
| 402 | .doctors(order.getCustomerNoticeJson().getDoctorsList()) | 423 | .doctors(order.getCustomerNoticeJson().getDoctorsList()) |
| 403 | .avoids(order.getCustomerNoticeJson().getAvoidsList()) | 424 | .avoids(order.getCustomerNoticeJson().getAvoidsList()) | ... | ... |
| ... | @@ -487,6 +487,7 @@ public class OrderServiceImpl implements OrderService { | ... | @@ -487,6 +487,7 @@ public class OrderServiceImpl implements OrderService { |
| 487 | .mealTime(DateUtil.formatDate(r.getMealTime())) | 487 | .mealTime(DateUtil.formatDate(r.getMealTime())) |
| 488 | .orderType(r.getOrderTypeValue()) | 488 | .orderType(r.getOrderTypeValue()) |
| 489 | .remark(r.getRemark()) | 489 | .remark(r.getRemark()) |
| 490 | + .avoidRemark(r.getAvoidRemark()) | ||
| 490 | .isDeleted(r.getIsDeleted()) | 491 | .isDeleted(r.getIsDeleted()) |
| 491 | .isRead(r.getIsRead()) | 492 | .isRead(r.getIsRead()) |
| 492 | .creationSource(r.getCreationSource().getNumber()) | 493 | .creationSource(r.getCreationSource().getNumber()) | ... | ... |
This diff is collapsed. Click to expand it.
| ... | @@ -2,6 +2,8 @@ package com.infoloop.tianting.streamController; | ... | @@ -2,6 +2,8 @@ package com.infoloop.tianting.streamController; |
| 2 | 2 | ||
| 3 | import cn.dev33.satoken.annotation.SaIgnore; | 3 | import cn.dev33.satoken.annotation.SaIgnore; |
| 4 | import com.github.xiaoymin.knife4j.annotations.ApiSupport; | 4 | import com.github.xiaoymin.knife4j.annotations.ApiSupport; |
| 5 | +import com.infoloop.tianting.enums.SettlementDimensionEnum; | ||
| 6 | +import com.infoloop.tianting.model.dto.OrderDbDTO; | ||
| 5 | import com.infoloop.tianting.model.dto.SettlementDTO.SettlementRequestDto; | 7 | import com.infoloop.tianting.model.dto.SettlementDTO.SettlementRequestDto; |
| 6 | import com.infoloop.tianting.service.SettlementService; | 8 | import com.infoloop.tianting.service.SettlementService; |
| 7 | import io.swagger.annotations.Api; | 9 | import io.swagger.annotations.Api; |
| ... | @@ -21,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController; | ... | @@ -21,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController; |
| 21 | 23 | ||
| 22 | import javax.validation.Valid; | 24 | import javax.validation.Valid; |
| 23 | import java.io.ByteArrayOutputStream; | 25 | import java.io.ByteArrayOutputStream; |
| 26 | +import java.time.format.DateTimeFormatter; | ||
| 24 | 27 | ||
| 25 | @Api(tags = "结算") | 28 | @Api(tags = "结算") |
| 26 | @ApiSupport(order = 0) | 29 | @ApiSupport(order = 0) |
| ... | @@ -29,35 +32,59 @@ import java.io.ByteArrayOutputStream; | ... | @@ -29,35 +32,59 @@ import java.io.ByteArrayOutputStream; |
| 29 | @RestController | 32 | @RestController |
| 30 | @RequiredArgsConstructor(onConstructor = @__(@Autowired)) | 33 | @RequiredArgsConstructor(onConstructor = @__(@Autowired)) |
| 31 | public class SettlementController { | 34 | public class SettlementController { |
| 32 | - private final SettlementService settlementService; | 35 | + private final SettlementService settlementService; |
| 33 | - | 36 | + |
| 34 | - @SaIgnore | 37 | + @SaIgnore |
| 35 | - @ApiOperation(value = "企业端结算账单生成excel") | 38 | + @ApiOperation(value = "企业端结算账单生成excel") |
| 36 | - @PostMapping("/enterprise/settlement/generate-excel") | 39 | + @PostMapping("/enterprise/settlement/generate-excel") |
| 37 | - @ResponseStatus(HttpStatus.OK) | 40 | + @ResponseStatus(HttpStatus.OK) |
| 38 | - public ResponseEntity<byte[]> enterpriseSettlementGenerateExcel(@Valid @RequestBody SettlementRequestDto settlementRequestDto) { | 41 | + public ResponseEntity<byte[]> enterpriseSettlementGenerateExcel(@Valid @RequestBody SettlementRequestDto settlementRequestDto) { |
| 39 | - ByteArrayOutputStream outputStream = settlementService.generateOrderSettlementExcel(settlementRequestDto); | 42 | + ByteArrayOutputStream outputStream = settlementService.generateOrderSettlementExcel(settlementRequestDto); |
| 40 | - HttpHeaders headers = new HttpHeaders(); | 43 | + HttpHeaders headers = new HttpHeaders(); |
| 41 | - headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); | 44 | + headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); |
| 42 | - headers.setContentDispositionFormData("attachment", "订单数据.xlsx"); | 45 | + headers.setContentDispositionFormData("attachment", "订单数据.xlsx"); |
| 43 | - return ResponseEntity.ok() | 46 | + return ResponseEntity.ok() |
| 44 | - .headers(headers) | 47 | + .headers(headers) |
| 45 | - .body(outputStream.toByteArray()); | 48 | + .body(outputStream.toByteArray()); |
| 46 | - } | 49 | + } |
| 47 | 50 | ||
| 48 | @ApiOperation(value = "结算账单生成excel") | 51 | @ApiOperation(value = "结算账单生成excel") |
| 49 | @PostMapping("/settlement/generate-excel") | 52 | @PostMapping("/settlement/generate-excel") |
| 50 | @ResponseStatus(HttpStatus.OK) | 53 | @ResponseStatus(HttpStatus.OK) |
| 51 | - public ResponseEntity<byte[]> settlementGenerateExcel( | 54 | + public ResponseEntity<byte[]> settlementGenerateExcel(@Valid @RequestBody SettlementRequestDto settlementRequestDto) { |
| 52 | - @Valid @RequestBody SettlementRequestDto settlementRequestDto) { | 55 | + ByteArrayOutputStream outputStream = settlementService.generateOrderSettlementExcel( |
| 53 | - ByteArrayOutputStream outputStream = settlementService.generateOrderSettlementExcel( | 56 | + settlementRequestDto); |
| 54 | - settlementRequestDto); | 57 | + |
| 55 | - HttpHeaders headers = new HttpHeaders(); | 58 | + String fileName; |
| 56 | - headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); | 59 | + if (settlementRequestDto.getDimension() == SettlementDimensionEnum.BY_ORDER) { |
| 57 | - headers.setContentDispositionFormData("attachment", "订单数据.xlsx"); | 60 | + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); |
| 58 | - | 61 | + String startDate = settlementRequestDto.getTimeStart().format(formatter); |
| 59 | - return ResponseEntity.ok() | 62 | + String endDate = settlementRequestDto.getTimeEnd().format(formatter); |
| 60 | - .headers(headers) | 63 | + fileName = String.format("结算报表_%s_%s.xlsx", startDate, endDate); |
| 61 | - .body(outputStream.toByteArray()); | 64 | + } else { |
| 65 | + fileName = "订单数据.xlsx"; | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + HttpHeaders headers = new HttpHeaders(); | ||
| 69 | + headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); | ||
| 70 | + headers.setContentDispositionFormData("attachment", fileName); | ||
| 71 | + | ||
| 72 | + return ResponseEntity.ok() | ||
| 73 | + .headers(headers) | ||
| 74 | + .body(outputStream.toByteArray()); | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + @ApiOperation(value = "院区端订单导出") | ||
| 78 | + @PostMapping("/separateMeals/export") | ||
| 79 | + @ResponseStatus(HttpStatus.OK) | ||
| 80 | + public ResponseEntity<byte[]> exportSeparateMeals(@Valid @RequestBody OrderDbDTO.QueryOrderDto queryOrderDto) { | ||
| 81 | + ByteArrayOutputStream outputStream = settlementService.exportSeparateMealsExcel(queryOrderDto); | ||
| 82 | + HttpHeaders headers = new HttpHeaders(); | ||
| 83 | + headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); | ||
| 84 | + headers.setContentDispositionFormData("attachment", "分餐表.xlsx"); | ||
| 85 | + return ResponseEntity.ok() | ||
| 86 | + .headers(headers) | ||
| 87 | + .body(outputStream.toByteArray()); | ||
| 62 | } | 88 | } |
| 89 | + | ||
| 63 | } | 90 | } | ... | ... |
| ... | @@ -89,6 +89,11 @@ enum OnlinePayEnum { | ... | @@ -89,6 +89,11 @@ enum OnlinePayEnum { |
| 89 | LEAVE_HOSPITAL = 3;//出院 | 89 | LEAVE_HOSPITAL = 3;//出院 |
| 90 | EMPLOYEE_CARD = 4; //员工卡 | 90 | EMPLOYEE_CARD = 4; //员工卡 |
| 91 | PAPER_VERIFICATION = 5; //纸质核销 | 91 | PAPER_VERIFICATION = 5; //纸质核销 |
| 92 | + CASH = 6;//现金 | ||
| 93 | + MEAL_CARD = 7;//餐卡 | ||
| 94 | + BAND_CARD = 8;//银行卡 | ||
| 95 | + ALIPAY = 9;//支付宝 | ||
| 96 | + WECHATPAY = 10;//微信支付 | ||
| 92 | } | 97 | } |
| 93 | 98 | ||
| 94 | enum ServeStatusEnum { | 99 | enum ServeStatusEnum { |
| ... | @@ -141,6 +146,7 @@ message SingleClientCustomerOrderRpcResponse { | ... | @@ -141,6 +146,7 @@ message SingleClientCustomerOrderRpcResponse { |
| 141 | bool isAllocation = 35; | 146 | bool isAllocation = 35; |
| 142 | string syncRoomNo = 36; | 147 | string syncRoomNo = 36; |
| 143 | bool isCanceled = 37; | 148 | bool isCanceled = 37; |
| 149 | + string avoidRemark = 38; | ||
| 144 | } | 150 | } |
| 145 | 151 | ||
| 146 | message GetClientCustomerOrderByIdRpcRequest { | 152 | message GetClientCustomerOrderByIdRpcRequest { |
| ... | @@ -385,6 +391,8 @@ message ClientCustomerOrderModification { | ... | @@ -385,6 +391,8 @@ message ClientCustomerOrderModification { |
| 385 | string syncRoomNo = 55; | 391 | string syncRoomNo = 55; |
| 386 | bool shouldUpdateIsCanceled = 56; | 392 | bool shouldUpdateIsCanceled = 56; |
| 387 | bool isCanceled = 57; | 393 | bool isCanceled = 57; |
| 394 | + bool shouldUpdateAvoidRemark = 58; | ||
| 395 | + string avoidRemark = 59; | ||
| 388 | } | 396 | } |
| 389 | 397 | ||
| 390 | message UpdateClientCustomerOrderRpcRequest { | 398 | message UpdateClientCustomerOrderRpcRequest { | ... | ... |
-
Please register or login to post a comment