tourze/hotel-card-delivery-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tourze/hotel-card-delivery-bundle

Composer 安装命令:

composer require tourze/hotel-card-delivery-bundle

包简介

酒店房卡配送管理组件,提供房卡配送任务管理、配送费用计算、配送状态跟踪等功能

README 文档

README

English | 中文

[Packagist Version] (https://packagist.org/packages/tourze/hotel-card-delivery-bundle) [PHP Version Require] (https://packagist.org/packages/tourze/hotel-card-delivery-bundle) [License] (https://packagist.org/packages/tourze/hotel-card-delivery-bundle) [Build Status] (https://github.com/tourze/hotel-card-delivery-bundle/actions) [Code Coverage] (https://codecov.io/gh/tourze/hotel-card-delivery-bundle)

A Symfony bundle for managing hotel key card delivery services, including delivery tasks, cost calculation, and status tracking.

Table of Contents

Features

  • 🏨 Hotel key card delivery management
  • 📋 Delivery task creation and tracking
  • 💰 Cost calculation with multiple factors (base, distance, urgency, extra)
  • 🔄 Delivery status workflow management
  • 🎛️ EasyAdmin integration for backend management
  • 📊 Comprehensive reporting and analytics

Installation

Install the bundle via Composer:

composer require tourze/hotel-card-delivery-bundle

Register the bundle in your config/bundles.php:

return [
    // ...
    Tourze\HotelCardDeliveryBundle\HotelCardDeliveryBundle::class => ['all' => true],
];

Configuration

Database Migration

Create and run database migrations:

php bin/console make:migration
php bin/console doctrine:migrations:migrate

Usage

Entity Structure

KeyCardDelivery Entity

Represents a hotel key card delivery task with the following properties:

  • Order reference (hotel booking order)
  • Hotel information
  • Room count (number of key cards)
  • Delivery time
  • Status (pending, assigned, in_progress, completed, cancelled, exception)
  • Fee amount
  • Receipt photo URL
  • Completion time
  • Remarks

DeliveryCost Entity

Represents detailed cost breakdown for delivery:

  • Base cost
  • Distance-based cost
  • Urgency cost
  • Extra charges
  • Distance information
  • Settlement status
  • Remarks

Delivery Status Workflow

graph TD
    A[PENDING] --> B[ASSIGNED]
    B --> C[IN_PROGRESS]
    C --> D[COMPLETED]
    
    A --> E[CANCELLED]
    B --> E
    C --> E
    
    A --> F[EXCEPTION]
    B --> F
    C --> F

Repository Usage

KeyCardDelivery Repository

use Tourze\HotelCardDeliveryBundle\Repository\KeyCardDeliveryRepository;

// Find deliveries by status
$pendingDeliveries = $repository->findByStatus(DeliveryStatusEnum::PENDING);

// Find today's deliveries
$todayDeliveries = $repository->findTodayDeliveries();

// Get total fee for a period
$totalFee = $repository->getTotalFeeInPeriod($startDate, $endDate);

DeliveryCost Repository

use Tourze\HotelCardDeliveryBundle\Repository\DeliveryCostRepository;

// Find cost by delivery
$cost = $repository->findByDelivery($delivery);

// Find unsettled costs
$unsettledCosts = $repository->findUnsettled();

// Calculate total cost by period
$totalCost = $repository->calculateTotalCostByPeriod($startDate, $endDate);

Admin Interface

The bundle provides EasyAdmin controllers for:

  • Key card delivery management
  • Cost tracking and settlement
  • Status updates and workflow management

Advanced Usage

Creating Delivery Tasks Programmatically

use Tourze\HotelCardDeliveryBundle\Entity\KeyCardDelivery;
use Tourze\HotelCardDeliveryBundle\Enum\DeliveryStatusEnum;

$delivery = new KeyCardDelivery();
$delivery->setOrder($order)
    ->setHotel($hotel)
    ->setRoomCount(2)
    ->setDeliveryTime(new \DateTimeImmutable('+2 hours'))
    ->setStatus(DeliveryStatusEnum::PENDING)
    ->calculateFee(100.0); // 100 per room

$entityManager->persist($delivery);
$entityManager->flush();

Cost Calculation

use Tourze\HotelCardDeliveryBundle\Entity\DeliveryCost;

$cost = new DeliveryCost();
$cost->setDelivery($delivery)
    ->setBaseCost('50.00')
    ->setDistance(5.2) // 5.2 km
    ->calculateDistanceCost(2.0) // 2.0 per km
    ->setUrgencyCost('20.00');

$entityManager->persist($cost);
$entityManager->flush();

Requirements

  • PHP 8.1+
  • Symfony 6.4+
  • Doctrine ORM 3.0+
  • EasyAdmin Bundle 4+

Required Dependencies

This bundle requires the following packages:

  • tourze/hotel-agent-bundle - Hotel agent management
  • tourze/hotel-profile-bundle - Hotel profile management
  • tourze/doctrine-timestamp-bundle - Timestamp functionality
  • tourze/doctrine-user-bundle - User management

Testing

Run the test suite:

# Run PHPUnit tests
./vendor/bin/phpunit packages/hotel-card-delivery-bundle/tests

# Run PHPStan analysis
php -d memory_limit=2G ./vendor/bin/phpstan analyse packages/hotel-card-delivery-bundle

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

tourze/hotel-card-delivery-bundle 适用场景与选型建议

tourze/hotel-card-delivery-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 05 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 tourze/hotel-card-delivery-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 tourze/hotel-card-delivery-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 tourze/hotel-card-delivery-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 22
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-25