123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- // 信息价数据
- const mongoose = require('mongoose');
- const Schema = mongoose.Schema;
- const keywordSchema = new Schema({
- keyword: {
- type: String,
- default: ''
- }, // 关键字
- coe: {
- type: String,
- default: ''
- }, // 系数(关键字效果)
- unit: {
- type: String,
- default: ''
- }, // 单位
- group: {
- type: String,
- default: ''
- }, // 组别
- optionCode: {
- type: String,
- default: ''
- }, // 选项号
- }, { _id: false });
- const priceInfoItems = new Schema({
- ID: String,
- libID: String,
- classID: String, // 分类
- code: {
- type: String,
- default: ''
- },
- name: {
- type: String,
- default: ''
- },
- specs: {
- type: String,
- default: ''
- },
- unit: {
- type: String,
- default: ''
- },
- taxPrice: {
- type: String,
- default: ''
- }, // 含税价格
- noTaxPrice: {
- type: String,
- default: ''
- }, // 不含税价格
- // 以下冗余数据为方便前台信息价功能处理
- period: String, // 期数 eg: 2020-05
- areaID: String, // 地区
- compilationID: String, // 费用定额
- remark: {
- type: String,
- default: ''
- },
- // 别名编码
- classCode: {
- type: String,
- default: ''
- },
- // 计算式
- expString: {
- type: String,
- default: ''
- },
- // 月份、价格备注
- dateRemark: {
- type: String,
- default: ''
- },
- // 关键字
- keywordList: {
- type: [keywordSchema],
- default: []
- }
- }, { versionKey: false });
- priceInfoItems.index({ areaID: 1, period: 1 });
- priceInfoItems.index({ ID: 1 });
- priceInfoItems.index({ libID: 1 });
- mongoose.model('std_price_info_items', priceInfoItems, 'std_price_info_items');
|