Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
openApi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hj
openApi
Commits
193dcac2
Commit
193dcac2
authored
Jun 19, 2025
by
hj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新提交
parent
ffd831f8
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
151 additions
and
10 deletions
+151
-10
server/app/Finance/Services/InvoiceService.php
server/app/Finance/Services/InvoiceService.php
+6
-2
server/app/Mailer/MailService.php
server/app/Mailer/MailService.php
+1
-1
server/app/Repositories/Contracts/EmailSendLogsRepository.php
...er/app/Repositories/Contracts/EmailSendLogsRepository.php
+9
-0
server/app/Repositories/Eloquent/EmailSendLogsRepositoryEloquent.php
...Repositories/Eloquent/EmailSendLogsRepositoryEloquent.php
+21
-0
server/app/Repositories/Models/EmailSendLogs.php
server/app/Repositories/Models/EmailSendLogs.php
+37
-0
server/app/Services/EmailSendLogsService.php
server/app/Services/EmailSendLogsService.php
+39
-0
server/app/Services/Traits/BaseService.php
server/app/Services/Traits/BaseService.php
+0
-7
server/database/migrations/2025_06_19_095255_create_email_send_logs_table.php
...ations/2025_06_19_095255_create_email_send_logs_table.php
+38
-0
No files found.
server/app/Finance/Services/InvoiceService.php
View file @
193dcac2
...
@@ -12,6 +12,7 @@ use App\Mailer\MailService;
...
@@ -12,6 +12,7 @@ use App\Mailer\MailService;
use
App\Repositories\Contracts\ThirdApiPlatformRepository
;
use
App\Repositories\Contracts\ThirdApiPlatformRepository
;
use
App\Repositories\Transformers\Finance\InvoiceRecordStatusDetailTransformer
;
use
App\Repositories\Transformers\Finance\InvoiceRecordStatusDetailTransformer
;
use
App\Repositories\Transformers\Finance\InvoiceRecordTransformer
;
use
App\Repositories\Transformers\Finance\InvoiceRecordTransformer
;
use
App\Services\EmailSendLogsService
;
use
App\Services\ThirdPlatform\PlatformBaseService
;
use
App\Services\ThirdPlatform\PlatformBaseService
;
use
App\Support\Facades\SimpleLogs
;
use
App\Support\Facades\SimpleLogs
;
use
App\Support\Traits\Helpers
;
use
App\Support\Traits\Helpers
;
...
@@ -671,8 +672,11 @@ class InvoiceService
...
@@ -671,8 +672,11 @@ class InvoiceService
}
}
if
(
$cusInfo
){
if
(
$cusInfo
){
$cusInfo
=
current
(
$cusInfo
);
$cusInfo
=
current
(
$cusInfo
);
$this
->
mailService
->
sendMailToHtml
(
$invoiceParams
[
'invoice_platform'
],
$title
,
$cusInfo
[
'cus_invoice_email'
],
$message
);
$result
=
$this
->
mailService
->
sendMailToHtml
(
$invoiceParams
[
'invoice_platform'
],
$title
,
$cusInfo
[
'cus_invoice_email'
],
$message
);
if
(
$result
){
app
(
EmailSendLogsService
::
class
)
->
saveEmailLogs
(
$platformName
,
$invoiceParams
[
'invoice_platform'
],
$cusInfo
,
$message
);
SimpleLogs
::
writeLog
(
$message
,
__CLASS__
.
':'
.
__FUNCTION__
.
' 邮件发送成功:'
);
}
$this
->
apiService
->
storePlatformDataEntries
(
'invoice_sended_mail_list'
,
array_merge
(
$sended
,[
$invoiceParams
[
'invoice_real_number'
]]));
$this
->
apiService
->
storePlatformDataEntries
(
'invoice_sended_mail_list'
,
array_merge
(
$sended
,[
$invoiceParams
[
'invoice_real_number'
]]));
}
}
}
}
...
...
server/app/Mailer/MailService.php
View file @
193dcac2
...
@@ -66,7 +66,7 @@ class MailService{
...
@@ -66,7 +66,7 @@ class MailService{
public
function
sendMailToHtml
(
$type
,
$title
,
$toUser
,
$html
)
public
function
sendMailToHtml
(
$type
,
$title
,
$toUser
,
$html
)
{
{
$this
->
setFromType
(
$type
)
->
initSendService
();
$this
->
setFromType
(
$type
)
->
initSendService
();
Mail
::
mailer
(
'smtp_'
.
$type
)
->
html
(
$html
,
function
(
$mail
)
use
(
$toUser
,
$title
){
return
Mail
::
mailer
(
'smtp_'
.
$type
)
->
html
(
$html
,
function
(
$mail
)
use
(
$toUser
,
$title
){
$mail
->
to
(
$toUser
);
$mail
->
to
(
$toUser
);
$mail
->
subject
(
$title
);
$mail
->
subject
(
$title
);
...
...
server/app/Repositories/Contracts/EmailSendLogsRepository.php
0 → 100644
View file @
193dcac2
<?php
namespace
App\Repositories\Contracts
;
use
Prettus\Repository\Contracts\RepositoryInterface
;
interface
EmailSendLogsRepository
extends
RepositoryInterface
{
}
server/app/Repositories/Eloquent/EmailSendLogsRepositoryEloquent.php
0 → 100644
View file @
193dcac2
<?php
namespace
App\Repositories\Eloquent
;
use
App\Repositories\Contracts\EmailSendLogsRepository
;
use
App\Repositories\Models\EmailSendLogs
;
use
App\Repositories\BaseRepository
;
class
EmailSendLogsRepositoryEloquent
extends
BaseRepository
implements
EmailSendLogsRepository
{
/**
* Specify Model class name.
*
* @return string
*/
public
function
model
()
{
return
EmailSendLogs
::
class
;
}
}
server/app/Repositories/Models/EmailSendLogs.php
0 → 100644
View file @
193dcac2
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace
App\Repositories\Models
;
class
EmailSendLogs
extends
Model
{
protected
$table
=
'email_send_logs'
;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected
$fillable
=
[
'send_platform_name'
,
'send_platform_type'
,
'send_type'
,
'cus_name'
,
'cus_email'
,
'send_content'
,
'created_at'
,
'updated_at'
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected
$hidden
=
[
];
}
server/app/Services/EmailSendLogsService.php
0 → 100644
View file @
193dcac2
<?php
/*
* This file is part of the Jiannei/lumen-api-starter.
*
* (c) Jiannei <longjian.huang@foxmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace
App\Services
;
use
App\Repositories\Contracts\EmailSendLogsRepository
;
use
App\Services\Traits\BaseService
;
use
App\Support\Traits\Helpers
;
class
EmailSendLogsService
{
use
Helpers
, BaseService
;
public
function
__construct
(
EmailSendLogsRepository
$emailSendLogsRepository
)
{
$this
->
setRepository
(
$emailSendLogsRepository
);
}
public
function
saveEmailLogs
(
$platformName
,
$platformType
,
$cusInfo
,
$message
,
$sendType
=
'invoiceEmail'
)
{
$saveParams
=
[];
$saveParams
[
'send_platform_name'
]
=
$platformName
;
$saveParams
[
'send_platform_type'
]
=
$platformType
;
$saveParams
[
'send_type'
]
=
$sendType
;
$saveParams
[
'cus_name'
]
=
$cusInfo
[
'cus_name'
];
$saveParams
[
'cus_email'
]
=
$cusInfo
[
'cus_invoice_email'
];
$saveParams
[
'send_content'
]
=
$message
;
return
$this
->
getRepository
()
->
createOrUpdate
(
$saveParams
);
}
}
server/app/Services/Traits/BaseService.php
View file @
193dcac2
...
@@ -2,14 +2,7 @@
...
@@ -2,14 +2,7 @@
namespace
App\Services\Traits
;
namespace
App\Services\Traits
;
use
App\Exceptions\ServerRunTimeException
;
use
App\Repositories\Criteria\BaseCriteria
;
use
App\Repositories\Criteria\BaseCriteria
;
use
App\Services\AuthService
as
adminAuth
;
use
App\Services\Traits\DataEntriesService
;
use
App\Services\YyBao\Auth\AuthService
as
frontAuth
;
use
App\Services\YyBao\CustomersService
;
use
App\Services\YyBao\ImportExportTasksService
;
use
Illuminate\Support\Facades\DB
;
trait
BaseService
trait
BaseService
{
{
...
...
server/database/migrations/2025_06_19_095255_create_email_send_logs_table.php
0 → 100644
View file @
193dcac2
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreateEmailSendLogsTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'email_send_logs'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
string
(
'send_platform_name'
)
->
comment
(
'发送方'
)
->
nullable
(
false
);
$table
->
string
(
'send_platform_type'
)
->
comment
(
'发送平台'
)
->
nullable
(
false
);
$table
->
string
(
'send_type'
)
->
comment
(
'发送类型'
)
->
nullable
(
false
);
$table
->
string
(
'cus_name'
)
->
comment
(
'收件方名称'
)
->
nullable
(
false
);
$table
->
text
(
'cus_email'
)
->
comment
(
'收件方email'
)
->
nullable
(
false
);
$table
->
longText
(
'send_content'
)
->
comment
(
'发送内容'
)
->
nullable
(
false
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'email_send_logs'
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment