Commit c2680494 by 胡悦

添加AI助手等功能

1 parent d81a56f6
......@@ -28,6 +28,8 @@ export class EmailQueryDto {
scene_market?: string;
reportData?: string;
template?: string;
aiAgentColumns?: string;
ai_agent?: string;
}
class MentorshipPage {
count: number;
......
......@@ -19,34 +19,8 @@ export class EmailService {
// });
// }
async sendMail(query: EmailQueryDto): Promise<void> {
const { to, subject, mentorship_page, supervisor_daily_page, extraction, reportData, template, sales_content, training_materials, scene_market } = query
Logger.log(supervisor_daily_page, 'supervisor_daily_page')
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 { to, subject, mentorship_page, supervisor_daily_page, extraction, reportData, template, sales_content, training_materials, scene_market, aiAgentColumns, ai_agent } = query
Logger.log(aiAgentColumns, 'aiAgentColumns')
const mailOptions = {
from: process.env.SMTP_FROM,
to,
......@@ -56,7 +30,6 @@ export class EmailService {
code: 1, //验证码
date: '2025-05-28', //日期
sign: '系统邮件,回复无效。', //发送的签名,当然也可以不要
assessmentList,
mentorship_page,
supervisor_daily_page,
extraction,
......@@ -64,7 +37,9 @@ export class EmailService {
training_materials,
scene_market,
reportData,
template
template,
aiAgentColumns,
ai_agent
// mentorship_page: mentorship_page,
// supervisor_daily_page: JSON.parse(supervisor_daily_page),
// extraction: JSON.parse(extraction),
......
......@@ -27,12 +27,12 @@
tr.highlight {
background-color: #e8f5e9;
}
.last-bg td:last-child {
/* .last-bg td:last-child {
background-color: #f1f4fe;
}
.last-bg tr td:last-child {
background-color: #f1f4fe;
}
} */
</style>
</head>
......@@ -201,7 +201,7 @@
<% locals.extraction.forEach(row=> { %>
<tr>
<td>
<%= row.formattedStart + ' - ' + row.formattedEnd %>
<%= row.formattedStart + ' 至 ' + row.formattedEnd %>
</td>
<td>
<%= row.count %>
......@@ -236,7 +236,7 @@
<% locals.sales_content.forEach(row=> { %>
<tr class="highlight">
<td>
<%= row.formattedStart + ' - ' + row.formattedEnd %>
<%= row.formattedStart + ' 至 ' + row.formattedEnd %>
</td>
<td>
<%= row.count %>
......@@ -272,7 +272,7 @@
<% locals.scene_market.forEach(row=> { %>
<tr class="highlight">
<td>
<%= row.formattedStart + ' - ' + row.formattedEnd %>
<%= row.formattedStart + ' 至 ' + row.formattedEnd %>
</td>
<td>
<%= row.count %>
......@@ -308,7 +308,7 @@
<% locals.training_materials.forEach(row=> { %>
<tr class="highlight">
<td>
<%= row.formattedStart + ' - ' + row.formattedEnd %>
<%= row.formattedStart + ' 至 ' + row.formattedEnd %>
</td>
<td>
<%= row.count %>
......@@ -337,50 +337,30 @@
<li>2、表格中底色的用于标识当天提问最高人次、当天提问最高次数</li>
<li>3、表格中空白处代表 0人、0次</li>
</ul>
<!-- <table class="last-bg">
<table class="last-bg">
<thead>
<tr>
<th></th>
<th>总部管理制度</th>
<th>AI营销助理</th>
<th>众筹续保测算智能体</th>
<th>对接人查询</th>
<th>对接人查询 2</th>
<th>驻店管理制度(智能体)</th>
<th>汇总</th>
<% locals.aiAgentColumns.forEach(column => { %>
<th><%= column.title %></th>
<% }); %>
</tr>
</thead>
<tbody>
<% locals.assessmentList.forEach(row=> { %>
<% locals.ai_agent.forEach(row => { %>
<tr>
<td>
<%= row.formattedStart + ' - ' + row.formattedEnd %>
</td>
<td>
<%= row.submit %>
</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>
<% locals.aiAgentColumns.forEach(column => { %>
<td>
<% if (column.dataIndex === 'date') { %>
<%= row.date %>
<% } else { %>
<%= row[column.dataIndex] || '-' %>
<% } %>
</td>
<% }); %>
</tr>
<% }); %>
</tbody>
</table> -->
</table>
</div>
</body>
......
......@@ -48,6 +48,7 @@ export class ClueController{
}
} else if (['sales_content', 'training_materials', 'scene_market'].includes(event_code)) {
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 == 'sales_content') where['show_channel'] = '1'
if (event_code == 'scene_market') where['show_channel'] = '3'
......@@ -72,5 +73,27 @@ export class ClueController{
// // pageSize: Number(pageSize),
// 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
......@@ -12,10 +12,14 @@ import { DB1_Table4Entity } from './db1/entities/table4.entity';
TypeOrmModule.forRoot({
name: 'db1', // 连接名称
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,
username: 'user_chenwq',
password: 'IxQstO23',
password: '5bL3Vk1x',
database: 'dj_smartcarlife',
entities: [DB1_Table1Entity, DB1_Table2Entity, DB1_Table4Entity],
synchronize: false,
......@@ -23,10 +27,14 @@ import { DB1_Table4Entity } from './db1/entities/table4.entity';
TypeOrmModule.forRoot({
name: 'db2', // 连接名称
type: 'mysql',
host: '192.168.3.227',
port: 3306,
username: 'os_user',
password: 'os#123',
// host: '192.168.3.227',
// port: 3306,
// username: 'os_user',
// password: 'os#123',
host: '192.168.5.1',
port: 3310,
username: 'user_chenwq',
password: 'n41X5tbK',
database: 'scrm_clue',
entities: [DB2_Table3Entity],
synchronize: false,
......
......@@ -27,12 +27,12 @@
tr.highlight {
background-color: #e8f5e9;
}
.last-bg td:last-child {
/* .last-bg td:last-child {
background-color: #f1f4fe;
}
.last-bg tr td:last-child {
background-color: #f1f4fe;
}
} */
</style>
</head>
......@@ -201,7 +201,7 @@
<% locals.extraction.forEach(row=> { %>
<tr>
<td>
<%= row.formattedStart + ' - ' + row.formattedEnd %>
<%= row.formattedStart + ' 至 ' + row.formattedEnd %>
</td>
<td>
<%= row.count %>
......@@ -236,7 +236,7 @@
<% locals.sales_content.forEach(row=> { %>
<tr class="highlight">
<td>
<%= row.formattedStart + ' - ' + row.formattedEnd %>
<%= row.formattedStart + ' 至 ' + row.formattedEnd %>
</td>
<td>
<%= row.count %>
......@@ -272,7 +272,7 @@
<% locals.scene_market.forEach(row=> { %>
<tr class="highlight">
<td>
<%= row.formattedStart + ' - ' + row.formattedEnd %>
<%= row.formattedStart + ' 至 ' + row.formattedEnd %>
</td>
<td>
<%= row.count %>
......@@ -308,7 +308,7 @@
<% locals.training_materials.forEach(row=> { %>
<tr class="highlight">
<td>
<%= row.formattedStart + ' - ' + row.formattedEnd %>
<%= row.formattedStart + ' 至 ' + row.formattedEnd %>
</td>
<td>
<%= row.count %>
......@@ -337,7 +337,30 @@
<li>2、表格中底色的用于标识当天提问最高人次、当天提问最高次数</li>
<li>3、表格中空白处代表 0人、0次</li>
</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>
</body>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!