SupplierFinanceJob.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\jobs\supplier;
  12. use app\services\supplier\finance\SupplierFlowingWaterServices;
  13. use crmeb\basic\BaseJobs;
  14. use crmeb\traits\QueueTrait;
  15. use think\facade\Log;
  16. /**
  17. * 供应商资金流水记录
  18. * Class SupplierFinanceJob
  19. * @package app\jobs
  20. */
  21. class SupplierFinanceJob extends BaseJobs
  22. {
  23. use QueueTrait;
  24. /**供应商流水
  25. * @param int $oid
  26. * @param int $type
  27. * @return bool
  28. */
  29. public function doJob(int $oid, int $type)
  30. {
  31. try {
  32. /** @var SupplierFlowingWaterServices $supplierFlowServices */
  33. $supplierFlowServices = app()->make(SupplierFlowingWaterServices::class);
  34. $supplierFlowServices->setSupplierFinance($oid, $type);
  35. } catch (\Throwable $e) {
  36. Log::error('记录流水失败:' . $e->getMessage());
  37. }
  38. return true;
  39. }
  40. }