gljUtil.js 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /**
  2. * Created by zhang on 2018/6/7.
  3. */
  4. const fs = require('fs');
  5. let _= require('lodash');
  6. const scMathUtil = require('./scMathUtil').getUtil();
  7. let gljNodeUtil = null;
  8. let data = fs.readFileSync(__dirname + '/web/gljUtil.js', 'utf8', 'r');
  9. eval(data + ' ; gljNodeUtil = gljUtil; ');
  10. module.exports = {
  11. calcProjectGLJQuantity :calcProjectGLJQuantity,
  12. getGLJPrice:getGLJPrice,
  13. calcPriceDiff:calcPriceDiff,
  14. getMarketPrice:getMarketPrice,
  15. getBasePrice:getBasePrice,
  16. getAdjustPrice:getAdjustPrice,
  17. getGljTypeSeq:getGljTypeSeq,
  18. sortRationGLJ:sortRationGLJ,
  19. getEngineerCostData:getEngineerCostData,
  20. getEconomicDatas:getEconomicDatas,
  21. getMainMaterialDatas:getMainMaterialDatas,
  22. getQuantityDatas:getQuantityDatas,
  23. getTenderPriceCoe:getTenderPriceCoe,
  24. getPriceCoeDatas:getPriceCoeDatas,
  25. };
  26. function calcProjectGLJQuantity(projectGLJDatas,rationGLJDatas,rationDatas,billsDatas,q_decimal) {
  27. gljNodeUtil.calcProjectGLJQuantity(projectGLJDatas,rationGLJDatas,rationDatas,billsDatas,q_decimal,_,scMathUtil);
  28. }
  29. function getGLJPrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio=false,tenderCoe, isReport) {
  30. return gljNodeUtil.getGLJPrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil,tenderCoe, isReport);
  31. }
  32. function getMarketPrice(glj,projectGLJDatas,calcOptions,decimalObj,isRadio=false,tenderCoe) {
  33. return gljNodeUtil.getMarketPrice(glj,projectGLJDatas,calcOptions,decimalObj,isRadio,_,scMathUtil,tenderCoe);
  34. }
  35. function getBasePrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio=false) {
  36. return gljNodeUtil.getBasePrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil);
  37. }
  38. function getAdjustPrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio=false,_,scMathUtil) {
  39. return gljNodeUtil.getAdjustPrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil);
  40. }
  41. function calcPriceDiff(glj,calcOptions) {
  42. gljNodeUtil.calcPriceDiff(glj,calcOptions);
  43. }
  44. function getGljTypeSeq() {
  45. return gljNodeUtil.getGljTypeSeq();
  46. }
  47. function sortRationGLJ(list,std) {
  48. return gljNodeUtil.sortRationGLJ(list,std);
  49. }
  50. function getEngineerCostData(property,bills,fixedFlag,scMathUtil) {
  51. return gljNodeUtil.getEngineerCostData(property,bills,fixedFlag,scMathUtil);
  52. }
  53. function getEconomicDatas(engineerFeatures,economics,bills,fixedFlag,_,scMathUtil,decimal) {
  54. return gljNodeUtil.getEconomicDatas(engineerFeatures,economics,bills,fixedFlag,_,scMathUtil,decimal);
  55. }
  56. function getMainMaterialDatas(projectProperty,engineerFeatures,materials,projectGLJData,calcOptions,decimalObj,isRadio,_,scMathUtil) {
  57. return gljNodeUtil.getMainMaterialDatas(projectProperty,engineerFeatures,materials,projectGLJData,calcOptions,decimalObj,isRadio,_,scMathUtil);
  58. }
  59. function getQuantityDatas(engineerFeatures,mainQuantities,billsList,fixedFlag,_,scMathUtil,decimal) {
  60. return gljNodeUtil.getQuantityDatas(engineerFeatures,mainQuantities,billsList,fixedFlag,_,scMathUtil,decimal);
  61. }
  62. function getTenderPriceCoe(glj,tproperty){
  63. return gljNodeUtil.getTenderPriceCoe(glj,tproperty);
  64. }
  65. function getPriceCoeDatas(pgljList, contractorList, totalFee, tprojectProperty,_,scMathUtil){
  66. gljNodeUtil.getPriceCoeDatas(pgljList, contractorList, totalFee, tprojectProperty,_,scMathUtil);
  67. }