zhongzewei 7 年之前
父节点
当前提交
9c4c0bb604
共有 34 个文件被更改,包括 500 次插入410 次删除
  1. 33 0
      modules/all_models/compleGlj_glj.js
  2. 61 0
      modules/all_models/compleRation_ration.js
  3. 26 0
      modules/all_models/stdBills_bills.js
  4. 17 0
      modules/all_models/stdBills_itemCharacter.js
  5. 17 0
      modules/all_models/stdBills_jobContent.js
  6. 22 0
      modules/all_models/stdBills_lib.js
  7. 33 0
      modules/all_models/stdGlj_glj.js
  8. 16 0
      modules/all_models/stdGlj_gljClass.js
  9. 15 0
      modules/all_models/stdGlj_gljClassTemplate.js
  10. 30 0
      modules/all_models/stdGlj_lib.js
  11. 25 0
      modules/all_models/stdRation_coe.js
  12. 18 0
      modules/all_models/stdRation_installFeeItem.js
  13. 29 0
      modules/all_models/stdRation_installSection.js
  14. 16 0
      modules/all_models/stdRation_lib.js
  15. 49 0
      modules/all_models/stdRation_ration.js
  16. 20 0
      modules/all_models/stdRation_section.js
  17. 21 0
      modules/all_models/std_glj_types.js
  18. 14 0
      modules/all_schemas/opr_schema.js
  19. 4 5
      modules/bills_lib/models/bills_lib_interfaces.js
  20. 0 18
      modules/bills_lib/models/bills_lib_model.js
  21. 0 85
      modules/bills_lib/models/bills_lib_schemas.js
  22. 2 1
      modules/common/std/std_glj_lib_map_model.js
  23. 2 1
      modules/ration_repository/controllers/ration_repository_controller.js
  24. 2 1
      modules/ration_repository/models/coe.js
  25. 3 1
      modules/ration_repository/models/glj_repository.js
  26. 4 2
      modules/ration_repository/models/installation.js
  27. 3 2
      modules/ration_repository/models/ration_item.js
  28. 2 3
      modules/ration_repository/models/ration_section_tree.js
  29. 5 2
      modules/ration_repository/models/repository_map.js
  30. 0 180
      modules/ration_repository/models/schemas.js
  31. 5 3
      modules/std_glj_lib/models/gljMapModel.js
  32. 5 1
      modules/std_glj_lib/models/gljModel.js
  33. 0 102
      modules/std_glj_lib/models/schemas.js
  34. 1 3
      public/web/sheet/sheet_common.js

+ 33 - 0
modules/all_models/compleGlj_glj.js

@@ -0,0 +1,33 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*补充工料机*/
+//补充工料机的组成物可能来自标准工料机和补充工料机
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const comple_gljComponent = new Schema(
+    {
+        isStd: Boolean, //组成物里的工料机是否是标准的,否则是补充的
+        ID: Number,
+        consumeAmt: String
+    },
+    {_id: false},
+    {versionKey: false}
+);
+//补充工料机跟用户和编办绑定
+const comple_glj = new Schema({
+    userId: Number,
+    compilationId: String,
+    ID: Number,
+    code: String,
+    name: String,
+    specs: String,
+    unit: String,
+    basePrice: String,
+    gljClass: Number,
+    gljType: Number,
+    shortName: String,
+    component: [comple_gljComponent]
+}, {versionKey: false});
+
+mongoose.model('complementary_glj_lib', comple_glj, 'complementary_glj_lib');

+ 61 - 0
modules/all_models/compleRation_ration.js

@@ -0,0 +1,61 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*补充定额库-定额*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const deleteSchema = require('../all_schemas/delete_schema');
+
+//定额工料机
+const compleRationGljItemSchema = new Schema({
+    gljId: Number,
+    consumeAmt: String,
+    type: String    //std or complementary
+
+}, { _id: false });
+
+//辅助定额调整
+const compleRationAssItemSchema = new Schema({
+    name: String,
+    assistID: Number,
+    assistCode: String,
+    stdValue: String,
+    stepValue: String,
+    decimal: Number,
+    carryBit: String,
+    minValue: String,
+    maxValue: String
+}, { _id: false });
+
+//定额安装增加费用
+const rationInstSchema = new Schema({
+    feeItemId: String,
+    sectionId: String
+},{_id: false});
+
+//补充定额
+const 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: [compleRationGljItemSchema],
+    rationCoeList: Array,
+    rationAssList: [compleRationAssItemSchema],
+    rationInstList: [rationInstSchema],
+    deleteInfo: deleteSchema
+}, {versionKey: false});
+
+mongoose.model('complementary_ration_items', compleRationSchema, 'complementary_ration_items');

+ 26 - 0
modules/all_models/stdBills_bills.js

@@ -0,0 +1,26 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*清单库编辑器-清单*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const stdBills_bills = new Schema({
+            ID: String,
+            ParentID: String,
+            NextSiblingID: String,
+            code: String,
+            name: String,
+            unit: String,
+            ruleText: String,
+            engineering: Number, //工程专业,填计算程序工程专业ID
+            Expression: String,
+            jobs: [],
+            items: [],
+            recharge:String,
+            billsLibId: Number,
+            deleted: Boolean
+    },
+    {versionKey: false}
+);
+
+mongoose.model('std_bills_lib_bills', stdBills_bills, 'std_bills_lib_bills');

+ 17 - 0
modules/all_models/stdBills_itemCharacter.js

@@ -0,0 +1,17 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const stdBills_itemCharacter = new Schema({
+        id: Number,
+        code: Number,
+        content: String,
+        itemValue: Array,
+        billsLibId: Number,
+        deleted: Boolean
+    },
+    {versionKey: false}
+);
+
+mongoose.model('std_bills_lib_itemCharacter', stdBills_itemCharacter);

+ 17 - 0
modules/all_models/stdBills_jobContent.js

@@ -0,0 +1,17 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*清单库编辑器-工作内容*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const stdBills_jobContent = new Schema({
+        id: Number,
+        code: Number,
+        content: String,
+        billsLibId: Number,
+        deleted: Boolean
+    },
+    {versionKey: false}
+);
+
+mongoose.model('std_bills_lib_jobContent', stdBills_jobContent);

+ 22 - 0
modules/all_models/stdBills_lib.js

@@ -0,0 +1,22 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*清单库编辑器-库*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const oprSchema = require('../all_schemas/opr_schema');
+const stdBills_lib = new Schema({
+        creator: String,
+        createDate: String,
+        recentOpr: [oprSchema],
+
+        billsLibId: Number,
+        billsLibName: String,
+        compilationId: String,
+        compilationName: String,
+        deleted: Boolean
+    },
+    {versionKey: false}
+);
+
+mongoose.model('std_bills_lib_list', stdBills_lib);

+ 33 - 0
modules/all_models/stdGlj_glj.js

@@ -0,0 +1,33 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*标准工料机*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+//标准工料机的组成物只来自标准工料机
+const std_gljComponent = new Schema(
+    {
+        ID: Number,
+        consumeAmt: Number
+    },
+    {_id: false},
+    {versionKey: false}
+);
+
+const std_glj = new Schema({
+    deleted: Boolean,
+    repositoryId: Number,
+    ID: Number,
+    code: String,
+    name: String,
+    specs: String,
+    basePrice: Number,
+    gljClass: Number,
+    gljType: Number,
+    shortName: String,
+    unit: String,
+    adjCoe: Number,
+    component: [std_gljComponent]
+},{versionKey: false});
+
+mongoose.model('std_glj_lib_gljList', std_glj, 'std_glj_lib_gljList');

+ 16 - 0
modules/all_models/stdGlj_gljClass.js

@@ -0,0 +1,16 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*标准工料机分类树*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const std_gljClass = new Schema({
+    repositoryId: Number,
+    ID: Number,
+    ParentID: Number,
+    NextSiblingID: Number,
+    Name: String,
+    deleted: Boolean
+}, {versionKey: false});
+
+mongoose.model('std_glj_lib_gljClass', std_gljClass, 'std_glj_lib_gljClass');

+ 15 - 0
modules/all_models/stdGlj_gljClassTemplate.js

@@ -0,0 +1,15 @@
+/**
+ * Created by Zhong on 2018/3/23.
+ */
+/* 标准工料机分类模板*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+let gljClassTemplate = mongoose.Schema({
+    ID: Number,
+    ParentID: Number,
+    NextSiblingID: Number,
+    Name: String,
+    deleted: Boolean
+}, {versionKey: false});
+
+mongoose.model('std_glj_lib_gljClassTemplate', gljClassTemplate, 'std_glj_lib_gljClassTemplate');

+ 30 - 0
modules/all_models/stdGlj_lib.js

@@ -0,0 +1,30 @@
+/**
+ * Created by Zhong on 2018/3/23.
+ */
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const oprSchema = require('../all_schemas/opr_schema');
+let gjlMapRationLibsSchema = new Schema(
+    {
+        ID: Number,
+        dispName: String
+    },
+    {_id: false},
+    {versionKey: false}
+);
+let gljMapSchema = new Schema({
+        deleted: Boolean,
+        ID: Number,
+        dispName: String,
+        appType: String,
+        creator: String,
+        createDate: String,
+        recentOpr: [oprSchema],
+        rationLibs: [gjlMapRationLibsSchema],
+        compilationId: String,
+        compilationName: String
+    },
+    {versionKey: false}
+);
+
+mongoose.model('std_glj_lib_gljList', gljMapSchema, 'std_glj_lib_gljList');

+ 25 - 0
modules/all_models/stdRation_coe.js

@@ -0,0 +1,25 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*定额库编辑器-附注条件*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const coeSchema = new Schema({
+    coeType: String,                // 系数类型,指作用范围:
+                                    // 单个(如:111量0.001)、人工类、材料类、机械类、全部(如:定额×0.925)。
+    gljID: Number,                  // 要调整的工料机ID(当coeType=0时有效)
+    operator: String,               // 运算符(*、+、-、=)
+    amount: String,                 // 调整的量
+    _id: false
+});
+
+const coeListSchema = new Schema({
+    libID: Number,                      // 所属定额定ID
+    ID: Number,                         // 系数ID(流水号ID)
+    serialNo: Number,                  //编号
+    name: String,                       // 名称
+    content: String,                    // 说明
+    coes: [coeSchema]
+}, {versionKey: false});
+
+mongoose.model('std_ration_lib_coe_list', coeListSchema, 'std_ration_lib_coe_list');

+ 18 - 0
modules/all_models/stdRation_installFeeItem.js

@@ -0,0 +1,18 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*标准定额库-安装费用项*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+//标准安装增加费-费用项
+const installFeeItemSchema = new Schema({
+    rationRepId: Number,
+    ID: String,
+    feeItem: String, //费用项
+    feeType: String, //费用类型
+    position: String, //记取位置
+    section: [],
+    deleted: false
+}, {versionKey: false});
+
+mongoose.model('std_ration_lib_installation', installFeeItemSchema, 'std_ration_lib_installation');

+ 29 - 0
modules/all_models/stdRation_installSection.js

@@ -0,0 +1,29 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*标准定额库-安装分册章节*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+//安装增加费-费用规则
+const feeRuleSchema = new Schema({
+    ID: String,
+    code: String,
+    rule: String,
+    base: String,
+    feeRate: Number,
+    labour: Number,
+    material: Number,
+    machine: Number
+});
+
+//标准安装增加费-分册章节
+const installSectionSchema = new Schema({
+    rationRepId: Number,
+    ID: String,
+    feeItemId: String,
+    name: String,
+    feeRule: [feeRuleSchema],
+    deleted: false
+}, {versionKey: false});
+
+mongoose.model('std_ration_lib_installationSection', installSectionSchema, 'std_ration_lib_installationSection');

+ 16 - 0
modules/all_models/stdRation_lib.js

@@ -0,0 +1,16 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*标准定额库*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const RepositoryMapSchema = new Schema({
+    "ID": Number,
+    "dispName" : String,
+    "appType" : String, //如:"建筑" / "公路"
+    "localeType": String, //如 各个省份 / 部颁
+    "descr" : String,
+    "deleted": Boolean
+});
+
+mongoose.model('std_ration_lib_map', RepositoryMapSchema, 'std_ration_lib_map');

+ 49 - 0
modules/all_models/stdRation_ration.js

@@ -0,0 +1,49 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*定额库-定额*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const rationGljItemSchema = new Schema({
+    gljId: Number,
+    consumeAmt: Number,
+    proportion: Number //配合比,暂时无需使用,默认0
+}, { _id: false });
+
+const rationAssItemSchema = new Schema({
+    name: String,
+    assistID: Number,
+    assistCode: String,
+    stdValue: String,
+    stepValue: String,
+    decimal: Number,
+    carryBit: String,
+    minValue: String,
+    maxValue: String
+}, { _id: false });
+
+//定额安装增加费用
+const rationInstSchema = new Schema({
+    feeItemId: String,
+    sectionId: String
+},{_id: false});
+
+const rationItemSchema = new Schema({
+    ID:Number,
+    code: String,
+    name: String,
+    unit: String,
+    basePrice: Number,
+    sectionId: Number,
+    rationRepId: Number,
+    caption: String,
+    feeType: Number,
+    jobContent: String,
+    annotation: String,
+    rationGljList: [rationGljItemSchema],
+    rationCoeList: Array,
+    rationAssList: [rationAssItemSchema],
+    rationInstList: [rationInstSchema]
+});
+
+mongoose.model('std_ration_lib_ration_items', rationItemSchema, 'std_ration_lib_ration_items');

+ 20 - 0
modules/all_models/stdRation_section.js

@@ -0,0 +1,20 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*标准定额章节树*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const rationChapterTreeSchema = new Schema({//章节树  //生成唯一id改为sectionID  改成string
+    rationRepId: Number,
+    ID:Number,
+    ParentID:Number,
+    NextSiblingID:Number,
+    name: String,
+    explanation: String,//说明
+    ruleText: String,//计算规则,
+    jobContentSituation: String,//工作内容适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
+    annotationSituation: String,//附注适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
+    isDeleted: Boolean
+});
+
+mongoose.model("std_ration_lib_ration_chapter_trees", rationChapterTreeSchema, 'std_ration_lib_ration_chapter_trees');

+ 21 - 0
modules/all_models/std_glj_types.js

@@ -0,0 +1,21 @@
+/**
+ * Created by Tony on 2017/7/6.
+ */
+let mongoose = require('mongoose');
+let Schema = mongoose.Schema;
+
+let RptCfgSchema = new Schema({
+    "typeName" : String,
+    "typesDefine": [{
+        "ID": Number,
+        "fullName": String,
+        "shortName": String,
+        "items": [{
+            "ID": Number,
+            "fullName": String,
+            "shortName": String
+        }]
+    }],
+});
+
+mongoose.model("std_glj_type", RptCfgSchema, "std_glj_type");

+ 14 - 0
modules/all_schemas/opr_schema.js

@@ -0,0 +1,14 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const oprSchema = new Schema({
+        operateDate: String,
+        operator: String
+    },
+    {_id: false},
+    {versionKey: false}
+);
+
+module.exports = oprSchema;

+ 4 - 5
modules/bills_lib/models/bills_lib_interfaces.js

@@ -1,13 +1,12 @@
 /**
  * Created by vian on 2017/3/20.
  */
-let model = require("./bills_lib_model");
 let counter = require("../../../public/counter/counter");
 let async = require("async");
-let StdBillsLib = model.stdBillsLibMod;
-let Bills = model.billsMod;
-let JobContent = model.jobContentMod;
-let ItemCharacter = model.itemCharacterMod;
+let StdBillsLib = mongoose.model('std_bills_lib_list');
+let Bills = mongoose.model('std_bills_lib_bills');
+let JobContent = mongoose.model('std_bills_lib_jobContent');
+let ItemCharacter = mongoose.model('std_bills_lib_itemCharacter');
 let moment = require("moment");
 let billsLibDao = function(){};
 

+ 0 - 18
modules/bills_lib/models/bills_lib_model.js

@@ -1,18 +0,0 @@
-/**
- * Created by vian on 2017/3/17.
- */
-let dbm = require("../../../config/db/db_manager");
-let schemas = require("./bills_lib_schemas.js");
-let db = dbm.getCfgConnection("scConstruct");
-//let db = dbm.getLocalConnection("stdBillsEditor");
-let stdBillsLibMod = db.model("std_bills_lib_list", schemas.stdBillsLibSchema);
-let billsMod = db.model("std_bills_lib_bills", schemas.billsSchema);
-let jobContentMod = db.model("std_bills_lib_jobContent", schemas.jobContentSchema);
-let itemCharacterMod = db.model("std_bills_lib_itemCharacter", schemas.itemCharacterSchema);
-
-module.exports = {
-    stdBillsLibMod: stdBillsLibMod,
-    billsMod: billsMod,
-    jobContentMod: jobContentMod,
-    itemCharacterMod: itemCharacterMod,
-}

+ 0 - 85
modules/bills_lib/models/bills_lib_schemas.js

@@ -1,85 +0,0 @@
-let mongoose = require('mongoose');
-
-let oprSchema = mongoose.Schema({
-    operateDate: String,
-    operator: String
-},
-    {_id: false},
-    {versionKey: false});
-
-let stdBillsLibSchema =mongoose.Schema({
-        creator: String,
-        createDate: String,
-        recentOpr: [oprSchema],
-       /* lastOperator: String,
-        lastOperateDate: Date,*/
-        billsLibId: Number,
-        billsLibName: String,
-        compilationId: String,
-        compilationName: String,
-        deleted: Boolean
-    },
-    {versionKey: false}
-);
-
-let jobsSchema = mongoose.Schema({
-    id: Number,
-    serialNo: Number
-},
-    {_id: false},
-    {versionKey: false});
-
-let itemsSchema = mongoose.Schema({
-    id: Number,
-    serialNo: Number
-},
-    {_id: false},
-    {versionKey: false});
-
-let billsSchema = mongoose.Schema({
-    ID: String,
-    ParentID: String,
-    NextSiblingID: String,
-    code: String,
-    name: String,
-    unit: String,
-    ruleText: String,
-    engineering: Number,   //工程专业,对应计算程序工程ID
-    Expression: String,
-    jobs: [],
-    items: [],
-    recharge:String,
-    billsLibId: Number,
-    sectionInfo: {},
-    deleted: Boolean
-},
-    {versionKey: false}
-);
-
-let jobContentSchema = mongoose.Schema({
-    id: Number,
-    code: Number,
-    content: String,
-    billsLibId: Number,
-    deleted: Boolean
-},
-    {versionKey: false}
-);
-
-let itemCharacterSchema = mongoose.Schema({
-    id: Number,
-    code: Number,
-    content: String,
-    itemValue: Array,
-    billsLibId: Number,
-    deleted: Boolean
-},
-    {versionKey: false}
-);
-
-module.exports = {
-    stdBillsLibSchema: stdBillsLibSchema,
-    billsSchema: billsSchema,
-    jobContentSchema: jobContentSchema,
-    itemCharacterSchema: itemCharacterSchema
-}

+ 2 - 1
modules/common/std/std_glj_lib_map_model.js

@@ -6,7 +6,8 @@
  * @version
  */
 import BaseModel from "../../common/base/base_model";
-import STDGLJLibMapSchema from "../../std_glj_lib/models/schemas";
+import mongoose from 'mongoose';
+const STDGLJLibMapSchema = mongoose.model('std_glj_lib_gljList')
 
 class STDGLJLibMapModel extends BaseModel {
 

+ 2 - 1
modules/ration_repository/controllers/ration_repository_controller.js

@@ -1,10 +1,11 @@
 /**
  * Created by Tony on 2017/4/20.
  */
+const mongoose = require('mongoose');
 var rationRepository = require("../models/repository_map");
 import baseController from "../../common/base/base_controller";
 import CompilationModel from "../../users/models/compilation_model";
-import gljMapModel from "../../std_glj_lib/models/schemas";
+const gljMapModel = mongoose.model('std_glj_lib_gljList');
 import async from "async";
 var callback = function(req, res, err, message, data){
     res.json({error: err, message: message, data: data});

+ 2 - 1
modules/ration_repository/models/coe.js

@@ -3,8 +3,9 @@
  * 系数表。
  */
 //modiyied by zhong on 2017/9/21
+const mongoose = require('mongoose');
+const coeListModel = mongoose.model('std_ration_lib_coe_list');
 let counter = require('../../../public/counter/counter');
-import {coeListModel} from './schemas';
 import async from 'async';
 
 let coeListDAO = function(){};

+ 3 - 1
modules/ration_repository/models/glj_repository.js

@@ -35,7 +35,9 @@ var gljItemModel = db.model("std_ration_lib_glj_list",gljSchema, "std_ration_lib
 var repositoryMap = require('./repository_map');
 var counter = require('../../../public/counter/counter');
 let moment = require('moment');
-import {gljModel, gljClassModel, compleGljModel} from "../../std_glj_lib/models/schemas";
+const compleGljModel = mongoose.model('complementary_glj_lib');
+const gljModel = mongoose.model('std_glj_lib_gljList');
+const gljClassModel = mongoose.model('std_glj_lib_gljClass');
 
 var gljItemDAO = function(){};
 gljItemDAO.prototype.getGljTypes = function(gljLibID, callback){

+ 4 - 2
modules/ration_repository/models/installation.js

@@ -1,8 +1,10 @@
 /**
  * Created by Zhong on 2018/1/24.
  */
-
-import {rationItemModel, installFeeItemModel, installSectionModel} from '../models/schemas';
+const mongoose = require('mongoose');
+const rationItemModel = mongoose.model('std_ration_lib_ration_items');
+const installFeeItemModel = mongoose.model('std_ration_lib_installation');
+const installSectionModel = mongoose.model('std_ration_lib_installationSection');
 
 class InstallationDao{
     async getInstallation(rationRepId, callback){

+ 3 - 2
modules/ration_repository/models/ration_item.js

@@ -1,14 +1,15 @@
 /**
  * Created by Tony on 2017/4/28.
  */
-
+const mongoose = require('mongoose');
 let async = require("async");
 let moment = require('moment');
 let counter = require('../../../public/counter/counter');
 let gljDao = require('./glj_repository');
 let rationRepositoryDao = require('./repository_map');
 const scMathUtil = require('../../../public/scMathUtil').getUtil();
-import {rationItemModel, compleRationModel} from './schemas';
+const rationItemModel = mongoose.model('std_ration_lib_ration_items');
+const compleRationModel = mongoose.model('complementary_ration_items');
 import STDGLJListModel from '../../std_glj_lib/models/gljModel';
 
 var rationItemDAO = function(){};

+ 2 - 3
modules/ration_repository/models/ration_section_tree.js

@@ -1,13 +1,12 @@
 /**
  * Created by Tony on 2017/4/21.
  */
-
+const mongoose = require('mongoose');
 let async = require('async');
 let moment = require('moment');
 let counter = require('../../../public/counter/counter');
 let rationRepositoryDao = require('./repository_map');
-import {rationChapterTreeModel} from './schemas';
-
+const rationChapterTreeModel = mongoose.model('std_ration_lib_ration_chapter_trees');
 var rationChapterTreeDAO = function(){};
 
 rationChapterTreeDAO.prototype.getRationChapterTree = function(rationLibId,callback){

+ 5 - 2
modules/ration_repository/models/repository_map.js

@@ -4,9 +4,12 @@
  */
 let async = require("async");
 let moment = require('moment');
+const mongoose = require('mongoose');
 let counter = require('../../../public/counter/counter');
-import gljMapModel from "../../std_glj_lib/models/schemas";
-import {rationRepository, rationChapterTreeModel, rationItemModel} from './schemas';
+const gljMapModel = mongoose.model('std_glj_lib_gljList');
+const rationRepository = mongoose.model('std_ration_lib_map');
+const rationChapterTreeModel = mongoose.model('std_ration_lib_ration_chapter_trees');
+const rationItemModel = mongoose.model('complementary_ration_items');
 
 function createNewLibModel(rationLibObj){
     var rst = {};

+ 0 - 180
modules/ration_repository/models/schemas.js

@@ -1,180 +0,0 @@
-/**
- * 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};

+ 5 - 3
modules/std_glj_lib/models/gljMapModel.js

@@ -1,9 +1,11 @@
 /**
  * Created by Zhong on 2017/8/11.
  */
-import gljMapModel from "./schemas";
-import {gljModel, gljClassModel} from "./schemas";
-import {rationRepository} from "../../ration_repository/models/schemas";
+const mongoose = require('mongoose');
+const gljMapModel = mongoose.model('std_glj_lib_gljList');
+const gljModel = mongoose.model('std_glj_lib_gljList');
+const gljClassModel = mongoose.model('std_glj_lib_gljClass');
+const rationRepository = mongoose.model('std_ration_lib_map');
 import moment from "moment";
 import counter from "../../../public/counter/counter";
 import async from "async";

+ 5 - 1
modules/std_glj_lib/models/gljModel.js

@@ -1,7 +1,11 @@
 /**
  * Created by Zhong on 2017/8/11.
  */
-import {gljMapModel, gljModel, gljClassModel, gljClassTemplateModel} from "./schemas";
+const mongoose = require('mongoose');
+const gljMapModel = mongoose.model('std_glj_lib_gljList');
+const gljModel = mongoose.model('std_glj_lib_gljList');
+const gljClassModel = mongoose.model('std_glj_lib_gljClass');
+const gljClassTemplateModel = mongoose.model('std_glj_lib_gljClassTemplate');
 import {OprDao} from  "./gljMapModel";
 import moment from "moment";
 import counter from "../../../public/counter/counter";

+ 0 - 102
modules/std_glj_lib/models/schemas.js

@@ -1,102 +0,0 @@
-/**
- * Created by Zhong on 2017/8/11.
- */
-import mongoose from "mongoose";
-let Schema = mongoose.Schema;
-let gjlMapRationLibsSchema = new Schema(
-    {
-        ID: Number,
-        dispName: String
-    },
-    {_id: false},
-    {versionKey: false}
-);
-
-let oprSchema = new Schema({
-        operateDate: String,
-        operator: String
-    },
-    {_id: false},
-    {versionKey: false});
-
-let gljMapSchema = new Schema({
-    deleted: Boolean,
-    ID: Number,
-    dispName: String,
-    appType: String,
-    creator: String,
-    createDate: String,
-    recentOpr: [oprSchema],
-    rationLibs: [gjlMapRationLibsSchema],
-    compilationId: String,
-    compilationName: String
-},
-    {versionKey: false});
-
-
-let gjlComponentSchema = mongoose.Schema(
-    {
-        ID: Number,
-        consumeAmt: String
-    },
-    {_id: false},
-    {versionKey: false}
-);
-
-
-let gljSchema = new Schema({
-    deleted: Boolean,
-    repositoryId: Number,
-    ID: Number,
-    code: String,
-    name: String,
-    specs: String,
-    unit: String,
-    basePrice: String,
-    gljClass: Number,
-    gljType: Number,
-    shortName: String,
-    adjCoe: Number, //调整系数
-    component: [gjlComponentSchema]
-},{versionKey: false});
-
-let gljClassSchema = mongoose.Schema({
-    repositoryId: Number,
-    ID: Number,
-    ParentID: Number,
-    NextSiblingID: Number,
-    Name: String,
-    deleted: Boolean
-}, {versionKey: false});
-
-let gljClassTemplate = mongoose.Schema({
-    ID: Number,
-    ParentID: Number,
-    NextSiblingID: Number,
-    Name: String,
-    deleted: Boolean
-}, {versionKey: false});
-
-//补充工料机跟用户和编办绑定
-let complementaryGljSchema = new Schema({
-    userId: Number,
-    compilationId: String,
-    ID: Number,
-    code: String,
-    name: String,
-    specs: String,
-    unit: String,
-    basePrice: String,
-    gljClass: Number,
-    gljType: Number,
-    shortName: String,
-    component: Array
-}, {versionKey: false});
-
-let gljMapModel = mongoose.model('std_glj_lib_map', gljMapSchema, 'std_glj_lib_map');
-let gljModel = mongoose.model('std_glj_lib_gljList', gljSchema, 'std_glj_lib_gljList');
-let gljClassModel = mongoose.model('std_glj_lib_gljClass', gljClassSchema, 'std_glj_lib_gljClass');
-let gljClassTemplateModel = mongoose.model('std_glj_lib_gljClassTemplate', gljClassTemplate, 'std_glj_lib_gljClassTemplate');
-let compleGljModel = mongoose.model('complementary_glj_lib', complementaryGljSchema, 'complementary_glj_lib');
-
-export {gljMapModel as default, gljModel, gljClassModel, gljClassTemplateModel, compleGljModel};

+ 1 - 3
public/web/sheet/sheet_common.js

@@ -267,8 +267,7 @@ var sheetCommonObj = {
         ComboCellForActiveCell.prototype.paintValue = function (ctx, value, x, y, w, h, style, options) {
             let sheet = options.sheet;
             if (options.row === sheet.getActiveRowIndex() && options.col === sheet.getActiveColumnIndex()) {
-                GC.Spread.Sheets.CellTypes.ComboBox.prototype.paintValue.apply(this, arguments);
-
+                    GC.Spread.Sheets.CellTypes.ComboBox.prototype.paintValue.apply(this, arguments);
             } else {
                 GC.Spread.Sheets.CellTypes.Base.prototype.paintValue.apply(this, arguments);
             }
@@ -277,7 +276,6 @@ var sheetCommonObj = {
             let sheet = options.sheet;
             if (options.row === sheet.getActiveRowIndex() && options.col === sheet.getActiveColumnIndex()) {
                 return GC.Spread.Sheets.CellTypes.ComboBox.prototype.getHitInfo.apply(this, arguments);
-
             } else {
                 return GC.Spread.Sheets.CellTypes.Base.prototype.getHitInfo.apply(this, arguments);
             }