ration_glj_controller.js 743 B

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * Created by chen on 2017/6/29.
  3. */
  4. let mongoose = require("mongoose")
  5. let ration_glj_facade = require('../facade/ration_glj_facade')
  6. module.exports={
  7. createRationGLJ:createRationGLJ,
  8. testGetQuantify:testGetQuantify
  9. }
  10. function createRationGLJ() {
  11. let gls = mongoose.model('ration_glj');
  12. gls.create({'GLJID':1,'basePrice':23.23,'name':"testgls"},function(err, gls){
  13. console.log(gls)
  14. })
  15. }
  16. //测试获取消耗量:
  17. async function testGetQuantify() {
  18. var condition = {
  19. projectID:99,
  20. projectGLJIDList:[60,61,62]
  21. }
  22. try{
  23. let result = await ration_glj_facade.getQuantityByProjectGLJ(condition);
  24. console.log(result)
  25. }catch (err){
  26. console.log(err);
  27. }
  28. }