gljUtil.js 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 = require("./web/gljUtil");
  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. getMainType: getMainType,
  18. isConcreteType: isConcreteType,
  19. isCommercialConcreteType: isCommercialConcreteType,
  20. getIndex: getIndex,
  21. sortRationGLJ: sortRationGLJ,
  22. sortProjectGLJ: sortProjectGLJ,
  23. getCCSProjectGLJ: getCCSProjectGLJ,
  24. getBaseCCSMixRatio: getBaseCCSMixRatio,
  25. setMaterialCalcRationFee: setMaterialCalcRationFee,
  26. getTenderPriceCoe: getTenderPriceCoe
  27. };
  28. function calcProjectGLJQuantity(projectGLJDatas,rationGLJDatas,rationDatas,billsDatas,q_decimal) {
  29. gljNodeUtil.calcProjectGLJQuantity(projectGLJDatas,rationGLJDatas,rationDatas,billsDatas,q_decimal,_,scMathUtil);
  30. }
  31. function getGLJPrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio=false,tenderCoe, isReport) {
  32. return gljNodeUtil.getGLJPrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil,tenderCoe, isReport);
  33. }
  34. function setMaterialCalcRationFee(ration,ration_gljs,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,_,scMathUtil) {
  35. return gljNodeUtil.setMaterialCalcRationFee(ration,ration_gljs,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,_,scMathUtil);
  36. }
  37. function getMarketPrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio=false,tenderCoe) {
  38. return gljNodeUtil.getMarketPrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil,tenderCoe);
  39. }
  40. function getBasePrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio=false) {
  41. return gljNodeUtil.getBasePrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil);
  42. }
  43. function getAdjustPrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio=false,_,scMathUtil) {
  44. return gljNodeUtil.getAdjustPrice(glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil);
  45. }
  46. function calcPriceDiff(glj,calcOptions) {
  47. gljNodeUtil.calcPriceDiff(glj,calcOptions);
  48. }
  49. function getMainType() {
  50. return gljNodeUtil.getMainType();
  51. }
  52. function getIndex(obj, pops) {
  53. return gljNodeUtil.getIndex(obj, pops);
  54. }
  55. function isConcreteType(type) {
  56. return gljNodeUtil.isConcreteType(type);
  57. }
  58. function isCommercialConcreteType(type){
  59. return gljNodeUtil.isCommercialConcreteType(type);
  60. }
  61. function sortRationGLJ(list, std) {
  62. return gljNodeUtil.sortRationGLJ(list, std);
  63. }
  64. function sortProjectGLJ(list,lodash) {
  65. return gljNodeUtil.sortProjectGLJ(list,lodash);
  66. }
  67. function getCCSProjectGLJ(unitFileID,project_id) {
  68. return gljNodeUtil.getCCSProjectGLJ(unitFileID,project_id);
  69. }
  70. function getBaseCCSMixRatio(unitFileID,consumption,connect_key) {
  71. return gljNodeUtil.getBaseCCSMixRatio(unitFileID,consumption,connect_key)
  72. }
  73. function getTenderPriceCoe(glj,tproperty){
  74. return gljNodeUtil.getTenderPriceCoe(glj,tproperty);
  75. }