gljUtil.js 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. getPirceInfoDatas: getPirceInfoDatas,
  26. };
  27. function calcProjectGLJQuantity(projectGLJDatas,rationGLJDatas,rationDatas,billsDatas,q_decimal) {
  28. gljNodeUtil.calcProjectGLJQuantity(projectGLJDatas,rationGLJDatas,rationDatas,billsDatas,q_decimal,_,scMathUtil);
  29. }
  30. function getGLJPrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio=false,tenderCoe, isReport) {
  31. return gljNodeUtil.getGLJPrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil,tenderCoe, isReport);
  32. }
  33. function getMarketPrice(glj,projectGLJDatas,calcOptions,decimalObj,isRadio=false,tenderCoe) {
  34. return gljNodeUtil.getMarketPrice(glj,projectGLJDatas,calcOptions,decimalObj,isRadio,_,scMathUtil,tenderCoe);
  35. }
  36. function getBasePrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio=false) {
  37. return gljNodeUtil.getBasePrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil);
  38. }
  39. function getAdjustPrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio=false,_,scMathUtil) {
  40. return gljNodeUtil.getAdjustPrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil);
  41. }
  42. function calcPriceDiff(glj,calcOptions) {
  43. gljNodeUtil.calcPriceDiff(glj,calcOptions);
  44. }
  45. function getGljTypeSeq() {
  46. return gljNodeUtil.getGljTypeSeq();
  47. }
  48. function sortRationGLJ(list,std) {
  49. return gljNodeUtil.sortRationGLJ(list,std);
  50. }
  51. function getEngineerCostData(property,bills,fixedFlag,scMathUtil) {
  52. return gljNodeUtil.getEngineerCostData(property,bills,fixedFlag,scMathUtil);
  53. }
  54. function getEconomicDatas(engineerFeatures,economics,bills,fixedFlag,_,scMathUtil,decimal) {
  55. return gljNodeUtil.getEconomicDatas(engineerFeatures,economics,bills,fixedFlag,_,scMathUtil,decimal);
  56. }
  57. function getMainMaterialDatas(projectProperty,engineerFeatures,materials,projectGLJData,calcOptions,decimalObj,isRadio,_,scMathUtil) {
  58. return gljNodeUtil.getMainMaterialDatas(projectProperty,engineerFeatures,materials,projectGLJData,calcOptions,decimalObj,isRadio,_,scMathUtil);
  59. }
  60. function getQuantityDatas(engineerFeatures,mainQuantities,billsList,fixedFlag,_,scMathUtil,decimal) {
  61. return gljNodeUtil.getQuantityDatas(engineerFeatures,mainQuantities,billsList,fixedFlag,_,scMathUtil,decimal);
  62. }
  63. function getTenderPriceCoe(glj,tproperty){
  64. return gljNodeUtil.getTenderPriceCoe(glj,tproperty);
  65. }
  66. function getPriceCoeDatas(pgljList, contractorList, totalFee, tprojectProperty,_,scMathUtil){
  67. return gljNodeUtil.getPriceCoeDatas(pgljList, contractorList, totalFee, tprojectProperty,_,scMathUtil);
  68. }
  69. function getPirceInfoDatas(projectGLJList, contractor_list, labourCoeDatas, projectProperty, _, scMathUtil) {
  70. return gljNodeUtil.getPirceInfoDatas(projectGLJList, contractor_list, labourCoeDatas, projectProperty, _, scMathUtil);
  71. }