Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-serivce
/
glsk-analysis-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c2680494
authored
Jun 30, 2025
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加AI助手等功能
1 parent
d81a56f6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
82 deletions
src/dto/email.dto.ts
src/email/email.service.ts
src/email/templates/function.point.ejs
src/modules/clue/clue.controller.ts
src/modules/clue/clue.module.ts
views/template.ejs
src/dto/email.dto.ts
View file @
c268049
...
@@ -28,6 +28,8 @@ export class EmailQueryDto {
...
@@ -28,6 +28,8 @@ export class EmailQueryDto {
scene_market
?:
string
;
scene_market
?:
string
;
reportData
?:
string
;
reportData
?:
string
;
template
?:
string
;
template
?:
string
;
aiAgentColumns
?:
string
;
ai_agent
?:
string
;
}
}
class
MentorshipPage
{
class
MentorshipPage
{
count
:
number
;
count
:
number
;
...
...
src/email/email.service.ts
View file @
c268049
...
@@ -19,34 +19,8 @@ export class EmailService {
...
@@ -19,34 +19,8 @@ export class EmailService {
// });
// });
// }
// }
async
sendMail
(
query
:
EmailQueryDto
):
Promise
<
void
>
{
async
sendMail
(
query
:
EmailQueryDto
):
Promise
<
void
>
{
const
{
to
,
subject
,
mentorship_page
,
supervisor_daily_page
,
extraction
,
reportData
,
template
,
sales_content
,
training_materials
,
scene_market
}
=
query
const
{
to
,
subject
,
mentorship_page
,
supervisor_daily_page
,
extraction
,
reportData
,
template
,
sales_content
,
training_materials
,
scene_market
,
aiAgentColumns
,
ai_agent
}
=
query
Logger
.
log
(
supervisor_daily_page
,
'supervisor_daily_page'
)
Logger
.
log
(
aiAgentColumns
,
'aiAgentColumns'
)
const
assessmentList
=
[
{
date
:
'5.20(周二)'
,
submit
:
14
,
fill
:
21
,
submitRate
:
'66.7'
},
{
date
:
'5.20(周二)'
,
submit
:
14
,
fill
:
21
,
submitRate
:
'66.7'
},
{
date
:
'5.20(周二)'
,
submit
:
14
,
fill
:
21
,
submitRate
:
''
},
{
date
:
'5.20(周二)'
,
submit
:
14
,
fill
:
21
,
submitRate
:
''
}
]
const
mailOptions
=
{
const
mailOptions
=
{
from
:
process
.
env
.
SMTP_FROM
,
from
:
process
.
env
.
SMTP_FROM
,
to
,
to
,
...
@@ -56,7 +30,6 @@ export class EmailService {
...
@@ -56,7 +30,6 @@ export class EmailService {
code
:
1
,
//验证码
code
:
1
,
//验证码
date
:
'2025-05-28'
,
//日期
date
:
'2025-05-28'
,
//日期
sign
:
'系统邮件,回复无效。'
,
//发送的签名,当然也可以不要
sign
:
'系统邮件,回复无效。'
,
//发送的签名,当然也可以不要
assessmentList
,
mentorship_page
,
mentorship_page
,
supervisor_daily_page
,
supervisor_daily_page
,
extraction
,
extraction
,
...
@@ -64,7 +37,9 @@ export class EmailService {
...
@@ -64,7 +37,9 @@ export class EmailService {
training_materials
,
training_materials
,
scene_market
,
scene_market
,
reportData
,
reportData
,
template
template
,
aiAgentColumns
,
ai_agent
// mentorship_page: mentorship_page,
// mentorship_page: mentorship_page,
// supervisor_daily_page: JSON.parse(supervisor_daily_page),
// supervisor_daily_page: JSON.parse(supervisor_daily_page),
// extraction: JSON.parse(extraction),
// extraction: JSON.parse(extraction),
...
...
src/email/templates/function.point.ejs
View file @
c268049
...
@@ -27,12 +27,12 @@
...
@@ -27,12 +27,12 @@
tr
.highlight
{
tr
.highlight
{
background-color
:
#e8f5e9
;
background-color
:
#e8f5e9
;
}
}
.last-bg
td
:last-child
{
/*
.last-bg td:last-child {
background-color: #f1f4fe;
background-color: #f1f4fe;
}
}
.last-bg tr td:last-child {
.last-bg tr td:last-child {
background-color: #f1f4fe;
background-color: #f1f4fe;
}
}
*/
</style>
</style>
</head>
</head>
...
@@ -201,7 +201,7 @@
...
@@ -201,7 +201,7 @@
<
% locals.extraction.forEach(row=> { %>
<
% locals.extraction.forEach(row=> { %>
<tr>
<tr>
<td>
<td>
<
%= row.formattedStart + '
-
' + row.formattedEnd %>
<
%= row.formattedStart + '
至
' + row.formattedEnd %>
</td>
</td>
<td>
<td>
<
%= row.count %>
<
%= row.count %>
...
@@ -236,7 +236,7 @@
...
@@ -236,7 +236,7 @@
<
% locals.sales_content.forEach(row=> { %>
<
% locals.sales_content.forEach(row=> { %>
<tr
class=
"highlight"
>
<tr
class=
"highlight"
>
<td>
<td>
<
%= row.formattedStart + '
-
' + row.formattedEnd %>
<
%= row.formattedStart + '
至
' + row.formattedEnd %>
</td>
</td>
<td>
<td>
<
%= row.count %>
<
%= row.count %>
...
@@ -272,7 +272,7 @@
...
@@ -272,7 +272,7 @@
<
% locals.scene_market.forEach(row=> { %>
<
% locals.scene_market.forEach(row=> { %>
<tr
class=
"highlight"
>
<tr
class=
"highlight"
>
<td>
<td>
<
%= row.formattedStart + '
-
' + row.formattedEnd %>
<
%= row.formattedStart + '
至
' + row.formattedEnd %>
</td>
</td>
<td>
<td>
<
%= row.count %>
<
%= row.count %>
...
@@ -308,7 +308,7 @@
...
@@ -308,7 +308,7 @@
<
% locals.training_materials.forEach(row=> { %>
<
% locals.training_materials.forEach(row=> { %>
<tr
class=
"highlight"
>
<tr
class=
"highlight"
>
<td>
<td>
<
%= row.formattedStart + '
-
' + row.formattedEnd %>
<
%= row.formattedStart + '
至
' + row.formattedEnd %>
</td>
</td>
<td>
<td>
<
%= row.count %>
<
%= row.count %>
...
@@ -337,50 +337,30 @@
...
@@ -337,50 +337,30 @@
<li>
2、表格中底色的用于标识当天提问最高人次、当天提问最高次数
</li>
<li>
2、表格中底色的用于标识当天提问最高人次、当天提问最高次数
</li>
<li>
3、表格中空白处代表 0人、0次
</li>
<li>
3、表格中空白处代表 0人、0次
</li>
</ul>
</ul>
<
!-- <
table class="last-bg">
<table
class=
"last-bg"
>
<thead>
<thead>
<tr>
<tr>
<th></th>
<
% locals.aiAgentColumns.forEach(column => { %>
<th>总部管理制度</th>
<th>
<
%= column.title %>
</th>
<th>AI营销助理</th>
<
% }); %>
<th>众筹续保测算智能体</th>
<th>对接人查询</th>
<th>对接人查询 2</th>
<th>驻店管理制度(智能体)</th>
<th>汇总</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<% locals.a
ssessmentList.forEach(row
=> { %>
<
% locals.a
i_agent.forEach(row
=> { %>
<tr>
<tr>
<
% locals.aiAgentColumns.forEach(column => { %>
<td>
<td>
<%= row.formattedStart + ' - ' + row.formattedEnd %>
<
% if (column.dataIndex === 'date') { %>
</td>
<
%= row.date %>
<td>
<
% } else { %>
<%= row.submit %>
<
%= row[column.dataIndex] || '-' %>
</td>
<
% } %>
<td>
<%= row.fill %>
</td>
<td>
<%= row.submitRate ? row.submitRate : '' %>%
</td>
<td>
<%= row.submitRate ? row.submitRate : '' %>%
</td>
<td>
<%= row.submitRate ? row.submitRate : '' %>%
</td>
<td>
<%= row.submitRate ? row.submitRate : '' %>%
</td>
<td>
<%= row.submitRate ? row.submitRate : '' %>%
</td>
</td>
<
% }); %>
</tr>
</tr>
<
% }); %>
<
% }); %>
</tbody>
</tbody>
</table>
-->
</table>
</div>
</div>
</body>
</body>
...
...
src/modules/clue/clue.controller.ts
View file @
c268049
...
@@ -48,6 +48,7 @@ export class ClueController{
...
@@ -48,6 +48,7 @@ export class ClueController{
}
}
}
else
if
([
'sales_content'
,
'training_materials'
,
'scene_market'
].
includes
(
event_code
))
{
}
else
if
([
'sales_content'
,
'training_materials'
,
'scene_market'
].
includes
(
event_code
))
{
tableName
=
'dj_car_life_customer_dynamic_record'
tableName
=
'dj_car_life_customer_dynamic_record'
// show_channel这个 - (0-培训资料;1-营销素材;2-展业助手 3.场景集市)
if
(
event_code
==
'training_materials'
)
where
[
'show_channel'
]
=
'0'
if
(
event_code
==
'training_materials'
)
where
[
'show_channel'
]
=
'0'
if
(
event_code
==
'sales_content'
)
where
[
'show_channel'
]
=
'1'
if
(
event_code
==
'sales_content'
)
where
[
'show_channel'
]
=
'1'
if
(
event_code
==
'scene_market'
)
where
[
'show_channel'
]
=
'3'
if
(
event_code
==
'scene_market'
)
where
[
'show_channel'
]
=
'3'
...
@@ -72,5 +73,27 @@ export class ClueController{
...
@@ -72,5 +73,27 @@ export class ClueController{
// // pageSize: Number(pageSize),
// // pageSize: Number(pageSize),
// where, // 仅传递字段相关条件
// where, // 仅传递字段相关条件
// });
// });
}
@
Get
(
'callThirdPartyAPI'
)
async
callThirdPartyAPI
(
@
Query
(
'startDate'
)
startDate
:
string
,
@
Query
(
'endDate'
)
endDate
:
string
,
@
Query
(
'rspType'
)
rspType
:
number
,
)
{
try
{
let
url
=
`http://192.168.5.30:8008/api/selectAgentData?startDate=
${
startDate
}
&endDate=
${
endDate
}
`
;
if
(
rspType
)
url
+=
url
+
`&rspType=
${
rspType
}
`
const
response
=
await
fetch
(
url
,
{
method
:
'GET'
,
});
const
data
=
await
response
.
json
();
console
.
log
(
data
);
return
{
data
};
}
catch
(
error
)
{
console
.
error
(
'Error calling third party API:'
,
error
);
throw
error
;
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
src/modules/clue/clue.module.ts
View file @
c268049
...
@@ -12,10 +12,14 @@ import { DB1_Table4Entity } from './db1/entities/table4.entity';
...
@@ -12,10 +12,14 @@ import { DB1_Table4Entity } from './db1/entities/table4.entity';
TypeOrmModule
.
forRoot
({
TypeOrmModule
.
forRoot
({
name
:
'db1'
,
// 连接名称
name
:
'db1'
,
// 连接名称
type
:
'mysql'
,
type
:
'mysql'
,
host
:
'192.168.1.39'
,
// host: '192.168.1.39',
// port: 3306,
// username: 'user_chenwq',
// password: 'IxQstO23',
host
:
'192.168.5.23'
,
port
:
3306
,
port
:
3306
,
username
:
'user_chenwq'
,
username
:
'user_chenwq'
,
password
:
'
IxQstO23
'
,
password
:
'
5bL3Vk1x
'
,
database
:
'dj_smartcarlife'
,
database
:
'dj_smartcarlife'
,
entities
:
[
DB1_Table1Entity
,
DB1_Table2Entity
,
DB1_Table4Entity
],
entities
:
[
DB1_Table1Entity
,
DB1_Table2Entity
,
DB1_Table4Entity
],
synchronize
:
false
,
synchronize
:
false
,
...
@@ -23,10 +27,14 @@ import { DB1_Table4Entity } from './db1/entities/table4.entity';
...
@@ -23,10 +27,14 @@ import { DB1_Table4Entity } from './db1/entities/table4.entity';
TypeOrmModule
.
forRoot
({
TypeOrmModule
.
forRoot
({
name
:
'db2'
,
// 连接名称
name
:
'db2'
,
// 连接名称
type
:
'mysql'
,
type
:
'mysql'
,
host
:
'192.168.3.227'
,
// host: '192.168.3.227',
port
:
3306
,
// port: 3306,
username
:
'os_user'
,
// username: 'os_user',
password
:
'os#123'
,
// password: 'os#123',
host
:
'192.168.5.1'
,
port
:
3310
,
username
:
'user_chenwq'
,
password
:
'n41X5tbK'
,
database
:
'scrm_clue'
,
database
:
'scrm_clue'
,
entities
:
[
DB2_Table3Entity
],
entities
:
[
DB2_Table3Entity
],
synchronize
:
false
,
synchronize
:
false
,
...
...
views/template.ejs
View file @
c268049
...
@@ -27,12 +27,12 @@
...
@@ -27,12 +27,12 @@
tr
.highlight
{
tr
.highlight
{
background-color
:
#e8f5e9
;
background-color
:
#e8f5e9
;
}
}
.last-bg
td
:last-child
{
/*
.last-bg td:last-child {
background-color: #f1f4fe;
background-color: #f1f4fe;
}
}
.last-bg tr td:last-child {
.last-bg tr td:last-child {
background-color: #f1f4fe;
background-color: #f1f4fe;
}
}
*/
</style>
</style>
</head>
</head>
...
@@ -201,7 +201,7 @@
...
@@ -201,7 +201,7 @@
<
% locals.extraction.forEach(row=> { %>
<
% locals.extraction.forEach(row=> { %>
<tr>
<tr>
<td>
<td>
<
%= row.formattedStart + '
-
' + row.formattedEnd %>
<
%= row.formattedStart + '
至
' + row.formattedEnd %>
</td>
</td>
<td>
<td>
<
%= row.count %>
<
%= row.count %>
...
@@ -236,7 +236,7 @@
...
@@ -236,7 +236,7 @@
<
% locals.sales_content.forEach(row=> { %>
<
% locals.sales_content.forEach(row=> { %>
<tr
class=
"highlight"
>
<tr
class=
"highlight"
>
<td>
<td>
<
%= row.formattedStart + '
-
' + row.formattedEnd %>
<
%= row.formattedStart + '
至
' + row.formattedEnd %>
</td>
</td>
<td>
<td>
<
%= row.count %>
<
%= row.count %>
...
@@ -272,7 +272,7 @@
...
@@ -272,7 +272,7 @@
<
% locals.scene_market.forEach(row=> { %>
<
% locals.scene_market.forEach(row=> { %>
<tr
class=
"highlight"
>
<tr
class=
"highlight"
>
<td>
<td>
<
%= row.formattedStart + '
-
' + row.formattedEnd %>
<
%= row.formattedStart + '
至
' + row.formattedEnd %>
</td>
</td>
<td>
<td>
<
%= row.count %>
<
%= row.count %>
...
@@ -308,7 +308,7 @@
...
@@ -308,7 +308,7 @@
<
% locals.training_materials.forEach(row=> { %>
<
% locals.training_materials.forEach(row=> { %>
<tr
class=
"highlight"
>
<tr
class=
"highlight"
>
<td>
<td>
<
%= row.formattedStart + '
-
' + row.formattedEnd %>
<
%= row.formattedStart + '
至
' + row.formattedEnd %>
</td>
</td>
<td>
<td>
<
%= row.count %>
<
%= row.count %>
...
@@ -337,7 +337,30 @@
...
@@ -337,7 +337,30 @@
<li>
2、表格中底色的用于标识当天提问最高人次、当天提问最高次数
</li>
<li>
2、表格中底色的用于标识当天提问最高人次、当天提问最高次数
</li>
<li>
3、表格中空白处代表 0人、0次
</li>
<li>
3、表格中空白处代表 0人、0次
</li>
</ul>
</ul>
<table
class=
"last-bg"
>
<thead>
<tr>
<
% locals.aiAgentColumns.forEach(column => { %>
<th>
<
%= column.title %>
</th>
<
% }); %>
</tr>
</thead>
<tbody>
<
% locals.ai_agent.forEach(row => { %>
<tr>
<
% locals.aiAgentColumns.forEach(column => { %>
<td>
<
% if (column.dataIndex === 'date') { %>
<
%= row.date %>
<
% } else { %>
<
%= row[column.dataIndex] || '-' %>
<
% } %>
</td>
<
% }); %>
</tr>
<
% }); %>
</tbody>
</table>
</div>
</div>
</body>
</body>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment