From 2e9d2b35e68a9284efcf7d13abf62fe7597b0128 Mon Sep 17 00:00:00 2001 From: ww664853070 Date: Thu, 1 Dec 2022 11:38:09 +0800 Subject: [PATCH] =?UTF-8?q?=EF=BC=88*=EF=BC=89=E5=AE=A2=E6=88=B7=E8=81=94?= =?UTF-8?q?=E7=B3=BB=E4=BA=BA=E8=B7=9F=E8=BF=9B=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customerContactsFollup/index.js | 23 +++++++ api/app/lib/models/customerContactsFollup.js | 65 +++++++++++++++++++ .../routes/customerContactsFollup/index.js | 8 +++ 3 files changed, 96 insertions(+) create mode 100644 api/app/lib/controllers/customerContactsFollup/index.js create mode 100644 api/app/lib/models/customerContactsFollup.js create mode 100644 api/app/lib/routes/customerContactsFollup/index.js diff --git a/api/app/lib/controllers/customerContactsFollup/index.js b/api/app/lib/controllers/customerContactsFollup/index.js new file mode 100644 index 0000000..612eed1 --- /dev/null +++ b/api/app/lib/controllers/customerContactsFollup/index.js @@ -0,0 +1,23 @@ +'use strict'; + +// 查询储备项目统计表 +async function getCustomerContactsFollowup(ctx, next) { + const { type } = ctx.params; + let rslt = null; + try { + rslt = await ctx.fs.dc.models.ReserveItemReport.findAll({ + order: [['id', 'DESC']], + // where: { type: type } + }) + ctx.status = 200 + ctx.body = rslt + } catch (error) { + ctx.fs.logger.error(`path:${ctx.path},error:${error}`) + ctx.status = 400; + ctx.body = { name: 'FindAllError', message: '获取失败' } + } +} + +module.exports = { + getCustomerContactsFollowup +} \ No newline at end of file diff --git a/api/app/lib/models/customerContactsFollup.js b/api/app/lib/models/customerContactsFollup.js new file mode 100644 index 0000000..53537c1 --- /dev/null +++ b/api/app/lib/models/customerContactsFollup.js @@ -0,0 +1,65 @@ +/* eslint-disable*/ +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const ReserveItemReport = sequelize.define("reserveItemReport", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + primaryKey: true, + field: "id", + autoIncrement: true, + }, + customer: { + type: DataTypes.STRING, + allowNull: true, + field: "customer", + }, + items: { + type: DataTypes.STRING, + allowNull: true, + field: "items", + }, + department: { + type: DataTypes.STRING, + allowNull: false, + field: "department", + }, + sale: { + type: DataTypes.STRING, + allowNull: true, + field: "sale", + }, + updatetime: { + type: DataTypes.DATE, + allowNull: false, + field: "updatetime", + }, + customerContacts: { + type: DataTypes.STRING, + allowNull: true, + field: "customer_contacts", + }, + phone: { + type: DataTypes.STRING, + allowNull: true, + field: "phone", + }, + visitStyle: { + type: DataTypes.STRING, + allowNull: true, + field: "visit_style", + }, + itemText: { + type: DataTypes.STRING, + allowNull: true, + field: "item_text", + } + }, { + tableName: "customer_contacts_followup", + }); + dc.models.ReserveItemReport = ReserveItemReport; + return ReserveItemReport; +}; \ No newline at end of file diff --git a/api/app/lib/routes/customerContactsFollup/index.js b/api/app/lib/routes/customerContactsFollup/index.js new file mode 100644 index 0000000..b8c0cee --- /dev/null +++ b/api/app/lib/routes/customerContactsFollup/index.js @@ -0,0 +1,8 @@ +'use strict'; + +const report = require('../../controllers/customerContactsFollup'); + +module.exports = function (app, router, opts) { + app.fs.api.logAttr['GET/customerContactsFollup'] = { content: '客户联系人对接跟进', visible: false }; + router.get('/customerContactsFollup', report.getReserveItemReport); +}; \ No newline at end of file