projects.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * Created by Zhong on 2018/3/22.
  3. */
  4. /*项目*/
  5. const mongoose = require('mongoose');
  6. const { stringAt } = require('pdfkit/js/data');
  7. const Schema = mongoose.Schema;
  8. const deleteSchema = require('../all_schemas/delete_schema');
  9. const collectionName = 'projects';
  10. const shareSchema = new Schema({
  11. userID: String, //userID
  12. allowCopy: {type: Boolean, default: false},
  13. allowCooperate: {type: Boolean, default: false},
  14. shareDate: String,
  15. }, {versionKey: false, _id: false});
  16. const ProjectSchema = new Schema({
  17. "ID":{type: Number, index: true},
  18. "GUID": String, // 接口需要
  19. "ParentID": Number,
  20. "NextSiblingID": Number,
  21. "userID": String,
  22. "importedByInterface": {type: Boolean, default: false},
  23. "name": String,
  24. "projType": String,
  25. "recentDateTime": Date,
  26. "createDateTime": Date,
  27. "compilation": String,
  28. "deleteInfo": deleteSchema,
  29. 'fullFolder': Array,
  30. //"shareInfo": [shareSchema],
  31. "property": {
  32. type: Schema.Types.Mixed,
  33. default: {}
  34. },
  35. "location":String,//工程所在地
  36. "summaryFees":{
  37. totalFee: String,
  38. estimateFee: String,
  39. safetyFee: String,
  40. chargeFee: String
  41. },
  42. "changeMark":String,//更新标记 feeRate:费率文件发生了改变,unitFile 单件文件发生了改变
  43. "remark":String, //备注
  44. "fileVer": String, // 创建时程序版本号
  45. "lastFileVer": String // 最新打开并计算时的程序版本号
  46. });
  47. mongoose.model(collectionName, ProjectSchema, collectionName);