Browse Source

(*)回款明细表 表模型修改; 接口文件提交

master
wuqun 2 years ago
parent
commit
e380949c08
  1. 20
      api/app/lib/controllers/report/achievement.js
  2. 84
      api/app/lib/models/receivable_detail.js
  3. 4
      api/app/lib/routes/report/index.js
  4. 10
      api/sequelize-automate.config.js

20
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
}

84
api/app/lib/models/back_detile.js → 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;
};

4
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);
};

10
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_',] ,长度较长的 前缀放前面

Loading…
Cancel
Save