From e380949c08060fa22aab72eff4c932b07f53f3dd Mon Sep 17 00:00:00 2001 From: wuqun Date: Wed, 30 Nov 2022 15:11:30 +0800 Subject: [PATCH] =?UTF-8?q?(*)=E5=9B=9E=E6=AC=BE=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E8=A1=A8=20=E8=A1=A8=E6=A8=A1=E5=9E=8B=E4=BF=AE=E6=94=B9;=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=96=87=E4=BB=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/report/achievement.js | 20 +++++ .../{back_detile.js => receivable_detail.js} | 84 +++++++++---------- api/app/lib/routes/report/index.js | 4 + api/sequelize-automate.config.js | 10 +-- 4 files changed, 71 insertions(+), 47 deletions(-) create mode 100644 api/app/lib/controllers/report/achievement.js rename api/app/lib/models/{back_detile.js => receivable_detail.js} (70%) diff --git a/api/app/lib/controllers/report/achievement.js b/api/app/lib/controllers/report/achievement.js new file mode 100644 index 0000000..70bfa50 --- /dev/null +++ b/api/app/lib/controllers/report/achievement.js @@ -0,0 +1,20 @@ +'use strict'; +const fs = require('fs'); +const moment = require('moment'); +//业绩报表相关 +async function getReceivedDetail(ctx) { + let rslt = null; + try { + + 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 = { + getReceivedDetail +} \ No newline at end of file diff --git a/api/app/lib/models/back_detile.js b/api/app/lib/models/receivable_detail.js similarity index 70% rename from api/app/lib/models/back_detile.js rename to api/app/lib/models/receivable_detail.js index cd76020..bd9faa0 100644 --- a/api/app/lib/models/back_detile.js +++ b/api/app/lib/models/receivable_detail.js @@ -5,7 +5,7 @@ module.exports = dc => { const DataTypes = dc.ORM; const sequelize = dc.orm; - const BackDetile = sequelize.define("backDetile", { + const ReceivableDetail = sequelize.define("receivableDetail", { id: { type: DataTypes.INTEGER, allowNull: false, @@ -17,52 +17,52 @@ module.exports = dc => { }, year: { type: DataTypes.STRING, - allowNull: true, + allowNull: false, defaultValue: null, - comment: "年度", + comment: "年度:【申请日期】-年份", primaryKey: false, field: "year", autoIncrement: false }, serialNo: { type: DataTypes.INTEGER, - allowNull: true, + allowNull: false, defaultValue: null, - comment: "序号", + comment: "序号:自动生成\n(自动升序),每一年自动从1开始", primaryKey: false, field: "serial_no", autoIncrement: false }, number: { type: DataTypes.STRING, - allowNull: true, + allowNull: false, defaultValue: null, - comment: "编号", + comment: "编号:年份+序号 如2022年1", primaryKey: false, field: "number", autoIncrement: false }, department: { type: DataTypes.STRING, - allowNull: true, + allowNull: false, defaultValue: null, - comment: "部门", + comment: "部门:申请部门", primaryKey: false, field: "department", autoIncrement: false }, sale: { type: DataTypes.STRING, - allowNull: true, + allowNull: false, defaultValue: null, - comment: "销售人员", + comment: "销售人员:申请人", primaryKey: false, field: "sale", autoIncrement: false }, contractNo: { type: DataTypes.STRING, - allowNull: true, + allowNull: false, defaultValue: null, comment: "合同编号", primaryKey: false, @@ -71,16 +71,16 @@ module.exports = dc => { }, customer: { type: DataTypes.STRING, - allowNull: true, + allowNull: false, defaultValue: null, - comment: "客户名称", + comment: "客户名称:【甲方名称】", primaryKey: false, field: "customer", autoIncrement: false }, item: { type: DataTypes.STRING, - allowNull: true, + allowNull: false, defaultValue: null, comment: "项目名称", primaryKey: false, @@ -89,99 +89,99 @@ module.exports = dc => { }, amount: { type: DataTypes.STRING, - allowNull: true, + allowNull: false, defaultValue: null, - comment: "合同金额", + comment: "合同金额:【合同金额\n(元)】", primaryKey: false, field: "amount", autoIncrement: false }, changeAmount: { type: DataTypes.STRING, - allowNull: true, + allowNull: false, defaultValue: null, comment: "变更后合同金额", primaryKey: false, field: "change_amount", autoIncrement: false }, - backYear: { + receivableYear: { type: DataTypes.STRING, - allowNull: true, + allowNull: false, defaultValue: null, comment: "回款年份", primaryKey: false, - field: "back_year", + field: "receivable_year", autoIncrement: false }, - backDate: { + receivableDate: { type: DataTypes.DATEONLY, - allowNull: true, + allowNull: false, defaultValue: null, comment: "回款日期", primaryKey: false, - field: "back_date", + field: "receivable_date", autoIncrement: false }, - backAmount: { + receivableAmount: { type: DataTypes.STRING, - allowNull: true, + allowNull: false, defaultValue: null, comment: "回款金额", primaryKey: false, - field: "back_amount", + field: "receivable_amount", autoIncrement: false }, - inBack: { + invoicedBack: { type: DataTypes.STRING, - allowNull: true, + allowNull: false, defaultValue: null, comment: "开票-回款", primaryKey: false, - field: "in_back", + field: "invoiced_back ", autoIncrement: false }, remainConAmount: { type: DataTypes.STRING, - allowNull: true, + allowNull: false, defaultValue: null, comment: "剩余合同金额", primaryKey: false, field: "remain_con_amount", autoIncrement: false }, - backConfirmDate: { + incomeConfirmdate: { type: DataTypes.DATEONLY, - allowNull: true, + allowNull: false, defaultValue: null, comment: "收入确认时间", primaryKey: false, - field: "back_confirm_date", + field: "income_confirmdate", autoIncrement: false }, - payCompany: { + thirdPayment: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: "第三方付款单位", primaryKey: false, - field: "pay_company", + field: "third_payment", autoIncrement: false }, - text: { + remark: { type: DataTypes.STRING, allowNull: true, defaultValue: null, - comment: "备注", + comment: "备注:回款流程》-备注", primaryKey: false, - field: "text", + field: "remark", autoIncrement: false } }, { - tableName: "back_detile", + tableName: "receivable_detail", comment: "", indexes: [] }); - dc.models.BackDetile = BackDetile; - return BackDetile; + dc.models.ReceivableDetail = ReceivableDetail; + return ReceivableDetail; }; \ No newline at end of file diff --git a/api/app/lib/routes/report/index.js b/api/app/lib/routes/report/index.js index 7873b82..a0b647a 100644 --- a/api/app/lib/routes/report/index.js +++ b/api/app/lib/routes/report/index.js @@ -1,6 +1,7 @@ 'use strict'; const report = require('../../controllers/report'); +const achieve = require('../../controllers/report/achievement'); module.exports = function (app, router, opts) { app.fs.api.logAttr['GET/reserveItem/report/:type'] = { content: '查询储备项目统计表', visible: false }; @@ -8,4 +9,7 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['GET/sales/member/list'] = { content: '查询销售人员分布明细表', visible: false }; router.get('/sales/member/list', report.getSalersReport); + + app.fs.api.logAttr['GET/received/detail'] = { content: '查询回款明细表', visible: false }; + router.get('/received/detail', achieve.getReceivedDetail); }; \ No newline at end of file diff --git a/api/sequelize-automate.config.js b/api/sequelize-automate.config.js index 6a31e50..99c28f7 100644 --- a/api/sequelize-automate.config.js +++ b/api/sequelize-automate.config.js @@ -1,11 +1,11 @@ module.exports = { // 数据库配置 与 sequelize 相同 dbOptions: { - database: 'hr-dev', - username: 'postgres', - password: '123', + database: 'data_center', + username: 'FashionAdmin', + password: '123456', dialect: 'postgres', - host: '10.8.30.166', + host: '10.8.30.36', port: 5432, define: { underscored: false, @@ -26,7 +26,7 @@ module.exports = { dir: './app/lib/models', // 指定输出 models 文件的目录 typesDir: 'models', // 指定输出 TypeScript 类型定义的文件目录,只有 TypeScript / Midway 等会有类型定义 emptyDir: false, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir` - tables: ['overtime_day','vacate_day'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性 + tables: ['receivable_detail'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性 skipTables: [], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性 tsNoCheck: false, // 是否添加 `@ts-nocheck` 注释到 models 文件中 ignorePrefix: [], // 生成的模型名称忽略的前缀,因为 项目中有以下表名是以 t_ 开头的,在实际模型中不需要, 可以添加多个 [ 't_data_', 't_',] ,长度较长的 前缀放前面