123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- /**
- * 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)
- 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: Number,
- proportion: Number //配合比,暂时无需使用,默认0
- }, { _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 });
- //定额
- var rationItemSchema = new Schema({
- ID:Number,
- code: String,
- name: String,
- unit: String,
- labourPrice: Number,
- materialPrice: Number,
- machinePrice: Number,
- basePrice: Number,
- sectionId: Number,
- rationRepId: Number,
- caption: String,
- feeType: Number,
- jobContent: String,
- annotation: String,
- rationGljList: [rationGljItemSchema],
- rationCoeList: Array,
- rationAssList: [rationAssItemSchema],
- isDeleted: Boolean
- });
- 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");
- export{coeListModel, rationRepository, rationChapterTreeModel, rationItemModel};
|