stdRation_ration.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * Created by Zhong on 2018/3/22.
  3. */
  4. /*定额库-定额*/
  5. const mongoose = require('mongoose');
  6. const Schema = mongoose.Schema;
  7. const rationGljItemSchema = new Schema({
  8. gljId: Number,
  9. consumeAmt: Number,
  10. proportion: { type: Number, default: 0 }, //配合比,暂时无需使用,默认0
  11. lossRateID: String,
  12. lossRateNo: Number,
  13. lossRateName: String,
  14. lossRate: Number,
  15. }, { _id: false });
  16. const rationAssItemSchema = new Schema({
  17. name: String,
  18. assistID: Number,
  19. assistCode: String,
  20. stdValue: String,
  21. stepValue: String,
  22. decimal: Number,
  23. carryBit: String,
  24. minValue: String,
  25. maxValue: String,
  26. paramName: String,//参数名称
  27. param: String,//参数
  28. thirdRationCode: String//第三定额
  29. }, { _id: false });
  30. //定额安装增加费用
  31. const rationInstSchema = new Schema({
  32. feeItemId: String,
  33. sectionId: String
  34. }, { _id: false });
  35. const rationItemSchema = new Schema({
  36. ID: Number,
  37. code: String,
  38. name: String,
  39. unit: String,
  40. basePrice: Number,
  41. sectionId: Number,
  42. rationRepId: { type: Number, index: true },
  43. caption: String,
  44. feeType: String,
  45. jobContent: String,
  46. annotation: String,
  47. rationGljList: [rationGljItemSchema],
  48. rationCoeList: Array,
  49. rationAssList: [rationAssItemSchema],
  50. rationInstList: [rationInstSchema],
  51. rationTemplateList: {
  52. type: Array,
  53. default: []
  54. },
  55. isDeleted: { type: Boolean, default: false }
  56. });
  57. mongoose.model('std_ration_lib_ration_items', rationItemSchema, 'std_ration_lib_ration_items');
  58. mongoose.model('std_ration_lib_ration_items_backup', rationItemSchema, 'std_ration_lib_ration_items_backup');