123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- /**
- * Created by Zhong on 2017/9/13.
- */
- import mongoose from "mongoose";
- let dbm = require("../../../config/db/db_manager");
- let db = dbm.getCfgConnection("scConstruct");
- let Schema = mongoose.Schema;
- let coeSchema = new Schema({
- coeType: String, // 系数类型,指作用范围:
- // 单个(如:111量0.001)、人工类、材料类、机械类、全部(如:定额×0.925)。
- gljCode: String, // 要调整的工料机Code(当coeType=0时有效)
- gljName: String,
- operator: String, // 运算符(*、+、-、=)
- amount: String, // 调整的量
- _id: false
- });
- let coeListSchema = new Schema({
- libID: Number, // 所属定额定ID
- ID: Number, // 系数ID(流水号ID)
- serialNo: Number, //编号
- name: String, // 名称
- content: String, // 说明
- coes: [coeSchema]
- }, {versionKey: false});
- let oprSchema = new Schema({
- operateDate: String,
- operator: String
- },
- {_id: false},
- {versionKey: false});
- //定额库
- let RepositoryMapSchema = new Schema({
- "ID": Number,
- "dispName" : String,
- "appType" : String, //如:"建筑" / "公路"
- "compilationId": String, //编办
- "compilationName": String,
- "gljLib": Number,
- "descr" : String,
- "creator": String,
- "createDate": String,
- "recentOpr" :[oprSchema],
- "deleted": Boolean
- }, {versionKey: false});
- //定额章节树
- let rationChapterTreeSchema = new Schema({
- rationRepId: Number,
- ID:Number,
- ParentID:Number,
- NextSiblingID:Number,
- name: String,
- explanation: String,//说明
- ruleText: String,//计算规则
- jobContentSituation: String,//工作内容适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额,NONE无
- annotationSituation: String,//附注的适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额,NONE无
- isDeleted: Boolean
- });
- //定额工料机
- let rationGljItemSchema = new Schema({
- gljId: Number,
- consumeAmt: String,
- proportion: Number //配合比,暂时无需使用,默认0
- }, { _id: false });
- //定额安装增加费用
- let rationInstSchema = new Schema({
- feeItemId: String,
- sectionId: String
- },{_id: false});
- //辅助定额调整
- let rationAssItemSchema = new Schema({
- name: String,
- assistID: Number,
- assistCode: String,
- stdValue: String,
- stepValue: String,
- decimal: Number,
- carryBit: String,
- minValue: String,
- maxValue: String
- }, { _id: false });
- //安装增加费-费用规则
- let feeRuleSchema = new Schema({
- ID: String,
- code: String,
- rule: String,
- base: String,
- feeRate: Number,
- labour: Number,
- material: Number,
- machine: Number
- });
- //安装增加费-分册章节
- let installSectionSchema = new Schema({
- rationRepId: Number,
- ID: String,
- feeItemId: String,
- name: String,
- feeRule: [feeRuleSchema],
- deleted: false
- }, {versionKey: false});
- //安装增加费-费用项
- let installFeeItemSchema = new Schema({
- rationRepId: Number,
- ID: String,
- feeItem: String, //费用项
- feeType: String, //费用类型
- position: String, //记取位置
- section: [],
- deleted: false
- }, {versionKey: false});
- //定额
- var rationItemSchema = new Schema({
- ID:Number,
- code: String,
- name: String,
- unit: String,
- labourPrice: String,
- materialPrice: String,
- machinePrice: String,
- basePrice: String,
- sectionId: Number,
- rationRepId: Number,
- caption: String,
- feeType: Number,
- jobContent: String,
- annotation: String,
- rationGljList: [rationGljItemSchema],
- rationCoeList: Array,
- rationAssList: [rationAssItemSchema],
- rationInstList: [rationInstSchema],
- isDeleted: Boolean
- });
- //补充定额
- let compleRationSchema = new Schema({
- userId: Number,
- compilationId: String,
- rationRepId: Number,
- ID:Number,
- code: String,
- name: String,
- unit: String,
- labourPrice: String,
- materialPrice: String,
- machinePrice: String,
- basePrice: String,
- sectionId: Number,
- caption: String,
- feeType: Number,
- jobContent: String,
- annotation: String,
- rationGljList: Array,
- rationCoeList: Array,
- rationAssList: Array,
- deleteInfo: Schema.Types.Mixed
- }, {versionKey: false});
- let coeListModel = db.model("std_ration_lib_coe_list",coeListSchema, "std_ration_lib_coe_list")
- let rationRepository = db.model("std_ration_lib_map", RepositoryMapSchema, "std_ration_lib_map");
- let rationChapterTreeModel = db.model("std_ration_lib_ration_chapter_trees", rationChapterTreeSchema, "std_ration_lib_ration_chapter_trees");
- let rationItemModel = db.model("std_ration_lib_ration_items",rationItemSchema, "std_ration_lib_ration_items");
- let installSectionModel = db.model("std_ration_lib_installationSection", installSectionSchema, "std_ration_lib_installationSection")
- let installFeeItemModel = db.model("std_ration_lib_installation", installFeeItemSchema, "std_ration_lib_installation");
- //补充定额
- let compleRationModel = db.model('complementary_ration_items', compleRationSchema, 'complementary_ration_items');
- export{coeListModel, rationRepository, rationChapterTreeModel, rationItemModel, installFeeItemModel, installSectionModel, compleRationModel};
|