project_facade.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. /**
  2. * Created by zhang on 2018/1/26.
  3. */
  4. module.exports = {
  5. markUpdateProject:markUpdateProject,
  6. removeProjectMark:removeProjectMark,
  7. updateNodes:updateNodes,
  8. calcInstallationFee:calcInstallationFee,
  9. calcOverHeightFee: calcOverHeightFee,
  10. saveProperty: saveProperty,
  11. getDefaultColSetting: getDefaultColSetting,
  12. markProjectsToChange:markProjectsToChange,
  13. getSEIProjects:getSEIProjects,
  14. loadSEIProjectData:loadSEIProjectData,
  15. setSEILibData:setSEILibData,
  16. getIndexReportData:getIndexReportData
  17. };
  18. let mongoose = require('mongoose');
  19. let logger = require("../../../logs/log_helper").logger;
  20. let projectsModel = mongoose.model('projects');
  21. let async_n = require("async");
  22. let _ = require('lodash');
  23. let ration_model = require('../models/ration');
  24. let bill_model = require('../models/bills');
  25. let consts = require('../models/project_consts');
  26. let projectConsts = consts.projectConst;
  27. let ration_glj_model = mongoose.model('ration_glj');
  28. let rationTemplateModel = mongoose.model('ration_template');
  29. let project_glj_model = mongoose.model('glj_list');
  30. let ration_glj_facade = require("../../ration_glj/facade/ration_glj_facade");
  31. const uuidV1 = require('uuid/v1');
  32. const gljUtil = require('../../../public/gljUtil');
  33. let stdColSettingModel = mongoose.model('std_main_col_lib');
  34. import GLJListModel from "../../glj/models/glj_list_model";
  35. let economicLib = mongoose.model('std_economic_lib');
  36. let engineerFeatureLib = mongoose.model('std_engineer_feature_lib');
  37. let engineerInfoLib = mongoose.model('std_engineer_info_lib');
  38. let mainQuantityLib = mongoose.model('std_main_quantity_lib');
  39. let materialLib = mongoose.model('std_material_lib');
  40. import fixedFlag from '../../common/const/bills_fixed';
  41. const scMathUtil = require('../../../public/scMathUtil').getUtil();
  42. const billsLibDao = require("../../bills_lib/models/bills_lib_interfaces");
  43. async function calcInstallationFee(data) {
  44. let result={};
  45. let billTasks = generateTasks(data.bills,data.useID);
  46. let rationTasks = generateTasks(data.ration,data.useID);
  47. if(billTasks.length>0){
  48. await bill_model.model.bulkWrite(billTasks);
  49. }
  50. console.log(rationTasks);
  51. if(rationTasks.length>0){
  52. await ration_model.model.bulkWrite(rationTasks);
  53. }
  54. //如果删除定额,需要删除对应的工料机
  55. if(data.ration.delete.length>0){
  56. let rationIDS = _.map(data.ration.delete,'ID');
  57. await ration_glj_model.deleteMany({projectID: data.ration.delete[0].projectID, rationID: {"$in": rationIDS}});//删除定额工料机
  58. }
  59. let rationGLJTasks = [];
  60. let updateList = [];
  61. if(data.ration.update.length>0){//如果有需要更新的定额工料机
  62. for(let ur of data.ration.update){
  63. for(let g of ur.glj){
  64. let gTasks = {
  65. updateOne:{
  66. filter:{
  67. ID:g.ID,
  68. projectID:g.projectID
  69. },
  70. update :{
  71. quantity:g.quantity,
  72. rationItemQuantity:g.rationItemQuantity
  73. }
  74. }
  75. };
  76. rationGLJTasks.push(gTasks);
  77. updateList.push(g);
  78. }
  79. }
  80. }
  81. if(rationGLJTasks.length>0){
  82. await ration_glj_model.bulkWrite(rationGLJTasks);
  83. }
  84. let newGljList = [];
  85. if(data.ration.add.length>0){//新增的安装子目要增加对应的工料机
  86. for(let nr of data.ration.add){
  87. for(let tkey in nr.glj){
  88. let [newRecode,projectGLJ] = await createRationGLJData(nr.glj[tkey])
  89. newGljList.push(newRecode);
  90. }
  91. }
  92. }
  93. if(newGljList.length>0){
  94. await ration_glj_model.insertMany(newGljList);
  95. }
  96. result.update = updateList;
  97. result.add = newGljList;
  98. return result;
  99. }
  100. async function createRationGLJData(glj) {
  101. glj.ID = uuidV1();
  102. let [info,projectGLJ ] = await ration_glj_facade.getInfoFromProjectGLJ(glj);
  103. let newRecode = ration_glj_facade.createNewRecord(info);
  104. return [newRecode,projectGLJ];
  105. }
  106. function generateTasks(data,userID) {
  107. let tasks=[];
  108. let deleteInfo={deleted: true, deleteDateTime: new Date(), deleteBy: userID};
  109. if(data.delete && data.delete.length > 0){
  110. for(let bd of data.delete){
  111. //原先是假删除,现在改成真删除
  112. let task = {
  113. deleteOne:{
  114. filter:{
  115. ID:bd.ID,
  116. projectID:bd.projectID
  117. }
  118. }
  119. };
  120. /* let task={
  121. updateOne:{
  122. filter:{
  123. ID:bd.ID,
  124. projectID:bd.projectID
  125. },
  126. update :{
  127. deleteInfo:deleteInfo
  128. }
  129. }
  130. };*/
  131. tasks.push(task);
  132. }
  133. }
  134. if(data.add && data.add.length > 0){
  135. for(let n_data of data.add){
  136. let task = {
  137. insertOne :{
  138. document:n_data
  139. }
  140. };
  141. tasks.push(task);
  142. }
  143. }
  144. return tasks;
  145. }
  146. /**
  147. * 计取超高降效费,可能包含更新清单、更新定额、新增清单、新增定额及其子数据、删除定额及其子数据
  148. * @param {Object} data - {updateData: {ration: [],..}, addData: {ration: [],...}, deleteData: {ration: [],...}}
  149. * @return {Object} - {bills: Array, rationGLJ: Array}
  150. */
  151. async function calcOverHeightFee(data) {
  152. // 更新数据
  153. async function update({ project, bills, ration }) {
  154. const tasks = [];
  155. // 更新项目
  156. if (project && project.ID) {
  157. const projectTask = projectsModel.update({ ID: project.ID },
  158. { 'property.overHeightOption': project.overHeightOption, 'property.overHeightSpecificID': project.overHeightSpecificID });
  159. tasks.push(projectTask);
  160. }
  161. // 更新清单和定额的超高降效列
  162. const models = [];
  163. if (bills.length) {
  164. models.push({ model: bill_model.model, items: bills });
  165. }
  166. if (ration.length) {
  167. models.push({ model: ration_model.model, items: ration });
  168. }
  169. models.forEach(modelData => {
  170. const bulkTask = modelData.items.map(item => (
  171. {
  172. updateOne: {
  173. filter: { ID: item.ID },
  174. update: { overHeight: item.overHeight }
  175. }
  176. }));
  177. const task = modelData.model.bulkWrite(bulkTask);
  178. tasks.push(task);;
  179. });
  180. if (!tasks.length) {
  181. return;
  182. }
  183. await Promise.all(tasks);
  184. }
  185. // 插入数据
  186. async function add({ bills, ration, rationGLJ}) {
  187. const tasks = [];
  188. // 匹配标准清单,加上工作内容等数据
  189. for (const billsItem of bills) {
  190. let stdBills = await billsLibDao.getStdBillsByCode(billsItem);
  191. stdBills = stdBills ? stdBills._doc : null;
  192. if (stdBills) {
  193. // 获取项目清单所需要的数据
  194. const projectBillsData = billsLibDao.getDataToProjectBills(stdBills);
  195. Object.assign(billsItem, projectBillsData);
  196. } else {
  197. delete billsItem.billsLibId;
  198. }
  199. billsItem.code += '001';
  200. }
  201. // 新增清单
  202. if (bills.length) {
  203. tasks.push(bill_model.model.insertMany(bills));
  204. }
  205. // 新增定额
  206. if (ration.length) {
  207. tasks.push(ration_model.model.insertMany(ration));
  208. }
  209. // 完整的定额人材机数据
  210. let completeRationGLJList = [];
  211. if (rationGLJ.length) {
  212. // 定额人材机需要新增项目人材机、单价文件、且返回完整的定额人材机数据
  213. const rationGLJTasks = rationGLJ.map(glj => createRationGLJData(glj));
  214. completeRationGLJList = await Promise.all(rationGLJTasks);
  215. // 新增定额人材机
  216. tasks.push(ration_glj_model.insertMany(completeRationGLJList));
  217. }
  218. // 返回新的清单和定额人材机数据
  219. const rst = {
  220. bills,
  221. rationGLJ: completeRationGLJList,
  222. }
  223. if (!tasks.length) {
  224. return rst;
  225. }
  226. await Promise.all(tasks);
  227. return rst;
  228. }
  229. // 删除数据
  230. async function del({ ration }) {
  231. const tasks = [];
  232. const rationIDList = ration.map(item => item.ID);
  233. if (!rationIDList.length) {
  234. return;
  235. }
  236. // 删除定额数据
  237. const rationTask = ration_model.model.deleteMany({ ID: {$in: rationIDList} });
  238. tasks.push(rationTask);
  239. // 删除定额人材机数据
  240. const rationGLJTask = ration_glj_model.deleteMany({ rationID: {$in: rationIDList} });
  241. tasks.push(rationGLJTask);
  242. await Promise.all(tasks);
  243. }
  244. // 处理任务
  245. const { updateData, addData, deleteData } = data;
  246. const updateTask = update(updateData);
  247. const addTask = add(addData);
  248. const delTask = del(deleteData);
  249. const [updateRst, addRst, delRst] = await Promise.all([updateTask, addTask, delTask]);
  250. return addRst;
  251. }
  252. async function updateNodes(datas){
  253. let nodeGroups = _.groupBy(datas,'type');
  254. let rationTasks = [];
  255. let billTasks = [];
  256. let rationGLJTasks = [];
  257. let projectGLJTasks = [];
  258. let projectTasks = [];
  259. let rationTemplateTasks = [];
  260. let asyncTasks = [];
  261. for(let type in nodeGroups){
  262. for(let node of nodeGroups[type]){
  263. if(type == projectConsts.BILLS){
  264. billTasks.push(getTask(node));
  265. }else if(type == projectConsts.RATION){
  266. rationTasks.push(getTask(node));
  267. }else if(type == projectConsts.RATION_GLJ){
  268. rationGLJTasks.push(getTask(node));
  269. }else if(type == projectConsts.PROJECTGLJ){
  270. projectGLJTasks.push(getTask(node,'id'));
  271. }else if(type == projectConsts.PROJECT){
  272. projectTasks.push(getTask(node));
  273. }else if(type == projectConsts.RATION_TEMPLATE){
  274. rationTemplateTasks.push(getTask(node))
  275. }
  276. }
  277. }
  278. //test------------------------
  279. if (billTasks.length) {
  280. console.log(`billTasks===============================`);
  281. billTasks.forEach(task => {
  282. if (task.updateOne.update.name === '分部分项工程') {
  283. console.log(`task.updateOne.filter`);
  284. console.log(task.updateOne.filter);
  285. console.log(`task.updateOne.update`);
  286. console.log(task.updateOne.update);
  287. }
  288. /*console.log(`task.updateOne.filter`);
  289. console.log(task.updateOne.filter);
  290. console.log(`task.updateOne.update`);
  291. console.log(task.updateOne.update);*/
  292. });
  293. }
  294. //test------------------------
  295. rationTasks.length>0?asyncTasks.push(ration_model.model.bulkWrite(rationTasks)):'';
  296. billTasks.length>0?asyncTasks.push(bill_model.model.bulkWrite(billTasks)):"";
  297. rationGLJTasks.length>0?asyncTasks.push(ration_glj_model.bulkWrite(rationGLJTasks)):"";
  298. projectGLJTasks.length>0?asyncTasks.push(project_glj_model.bulkWrite(projectGLJTasks)):"";
  299. projectTasks.length>0?asyncTasks.push(projectsModel.bulkWrite(projectTasks)):"";
  300. rationTemplateTasks.length>0?asyncTasks.push(rationTemplateModel.bulkWrite(rationTemplateTasks)):"";
  301. return asyncTasks.length>0?await Promise.all(asyncTasks):"";
  302. function getTask(node,idFiled = 'ID') {
  303. let task={
  304. updateOne:{
  305. filter:{},
  306. update :_.cloneDeep(node.data)
  307. }
  308. };
  309. task.updateOne.filter[idFiled] = node.data[idFiled];//现在复制项目也重新生成一个新的ID了,所以ID是唯一的
  310. delete task.updateOne.update[idFiled];//防止误操作
  311. return task;
  312. }
  313. }
  314. /*function updateNodes(datas,callback) {
  315. let tasks = [];
  316. for(let node of datas){
  317. tasks.push(updateOne(node))
  318. }
  319. async_n.parallel(tasks, function(err, results) {
  320. if (!err){
  321. callback(0, '', results);
  322. }
  323. else{
  324. console.log(err);
  325. callback(1, 'save project failed'+err.message, null);
  326. }
  327. });
  328. function updateOne(node) {
  329. if(node.type == projectConsts.BILLS){
  330. return function (asCallback) {
  331. bill_model.model.findOneAndUpdate({projectID: node.data.projectID, ID: node.data.ID,deleteInfo: null}, node.data,{new: true}, asCallback);
  332. }
  333. }else if(node.type ==projectConsts.RATION){
  334. return function (asCallback) {
  335. ration_model.model.findOneAndUpdate({projectID: node.data.projectID, ID: node.data.ID,deleteInfo: null}, node.data,{new: true}, asCallback);
  336. }
  337. }
  338. }
  339. }*/
  340. //data = {feeRateID:111111,projectID:1245}; type = feeRate
  341. async function markUpdateProject(data,type) {
  342. let query = {deleteInfo:null};
  343. if(type=="feeRate"){//更改了费率
  344. query['property.feeFile.id'] = data.feeRateID;
  345. }
  346. if(type=="unitFile"){//更改了单价文件
  347. query['property.unitPriceFile.id'] = data.unitFileID;//unitPriceFile
  348. }
  349. let projects = await projectsModel.find(query);
  350. return await markProjectsToChange(projects,type,data.projectID);
  351. }
  352. async function markProjectsToChange(projects,type,extProjectID){
  353. let tasks=[];
  354. for(let p of projects){
  355. if(extProjectID && p.ID===extProjectID) continue;//排除当前项目
  356. tasks.push(generateMarkTask(type,p.ID));
  357. }
  358. return tasks.length>0 ? await projectsModel.bulkWrite(tasks):null;
  359. }
  360. async function removeProjectMark(projectID) {
  361. return await projectsModel.findOneAndUpdate({ID:projectID},{"$unset":{"changeMark":1}});
  362. }
  363. function generateMarkTask(value,projectID) {
  364. let task = {
  365. updateOne:{
  366. filter:{
  367. ID:projectID
  368. },
  369. update:{
  370. changeMark:value
  371. }
  372. }
  373. };
  374. return task
  375. }
  376. // {projectID: 5, propertyName: 'aaa', propertyValue: 1}
  377. function saveProperty(data, callback){
  378. let obj = {};
  379. let pn = 'property.' + data.propertyName;
  380. obj[pn] = data.propertyValue;
  381. projectsModel.update({"ID": data.projectID}, obj, function (err) {
  382. if (err) {
  383. logger.err(pn + ' save error: ' + err);
  384. callback(err, null)
  385. } else {
  386. logger.info(pn + ' saved.');
  387. callback('', null);
  388. }}
  389. );
  390. }
  391. async function getDefaultColSetting(libID){
  392. return await stdColSettingModel.findOne({ID: libID, deleted: false}, '-_id main_tree_col');
  393. }
  394. function sortChildren(lists) {
  395. let IDMap ={},nextMap = {}, firstNode = null,newList=[];
  396. for(let l of lists){
  397. if(l.children&&l.children.length > 0) l.children = sortChildren(l.children);//递规排序
  398. IDMap[l.ID] = l;
  399. if(l.NextSiblingID!=-1) nextMap[l.NextSiblingID] = l;
  400. }
  401. for(let t of lists){
  402. if(!nextMap[t.ID]){ //如果在下一节点映射没找到,则是第一个节点
  403. firstNode = t;
  404. break;
  405. }
  406. }
  407. if(firstNode){
  408. newList.push(firstNode);
  409. delete IDMap[firstNode.ID];
  410. setNext(firstNode,newList);
  411. }
  412. //容错处理,如果链断了的情况,直接添加到后面
  413. for(let key in IDMap){
  414. if(IDMap[key]) newList.push(IDMap[key])
  415. }
  416. return newList;
  417. function setNext(node,array) {
  418. if(node.NextSiblingID != -1){
  419. let next = IDMap[node.NextSiblingID];
  420. if(next){
  421. array.push(next);
  422. delete IDMap[next.ID];
  423. setNext(next,array);
  424. }
  425. }
  426. }
  427. }
  428. async function getSEIProjects(projectID) {
  429. let project = await projectsModel.findOne({ID:projectID});
  430. if(!project) throw new Error(`找不到建设项目:${projectID}`);
  431. let tem_e = await projectsModel.find({ParentID:project.ID});
  432. let engineers = [];
  433. for(let e of tem_e){
  434. if(!e.deleteInfo || !e.deleteInfo.deleted){
  435. let tenders = await projectsModel.find({ParentID:e.ID});
  436. let children = [];
  437. for(let t of tenders){
  438. if(!t.deleteInfo || !t.deleteInfo.deleted){
  439. children.push(t);
  440. }
  441. }
  442. e._doc.children = children;
  443. engineers.push(e);
  444. }
  445. }
  446. engineers = sortChildren(engineers);
  447. project._doc.children = engineers;
  448. return project;
  449. }
  450. async function loadSEIProjectData(projectID) {
  451. let gljListModel = new GLJListModel();
  452. let [gljList, mixRatioConnectData,mixRatioMap,unitPriceMap] = await gljListModel.getListByProjectId(projectID);
  453. let rations = await ration_model.getDataSync(projectID);
  454. let bills = await bill_model.getDataSync(projectID);
  455. let ration_gljs = await ration_glj_model.find({projectID:projectID});
  456. let projectGLJs = {
  457. gljList : gljList,
  458. mixRatioConnectData:mixRatioConnectData,
  459. mixRatioMap:mixRatioMap,
  460. unitPriceMap:unitPriceMap
  461. };
  462. return{bills:bills,rations:rations,ration_gljs:ration_gljs,projectGLJs:projectGLJs}
  463. }
  464. async function setSEILibData(property){
  465. if(property.engineerInfoLibID){//工程信息指标
  466. let engineerInfo = await engineerInfoLib.findOne({'ID':property.engineerInfoLibID});
  467. if(engineerInfo) property.engineerInfos = engineerInfo.info;
  468. }
  469. if(property.engineerFeatureLibID){//工程特征指标
  470. let engineerFeature = await engineerFeatureLib.findOne({'ID':property.engineerFeatureLibID});
  471. if(engineerFeature) property.engineerFeatures = engineerFeature.features;
  472. }
  473. if(property.materialLibID){//主要工料指标
  474. let material = await materialLib.findOne({'ID':property.materialLibID});
  475. if(material) property.materials = material.materials;
  476. }
  477. if(property.mainQuantityLibID){//主要工程量指标
  478. let mainQuantity = await mainQuantityLib.findOne({'ID':property.mainQuantityLibID});
  479. if(mainQuantity) property.mainQuantities = mainQuantity.index;
  480. }
  481. if(property.economicLibID){//主要工程量指标
  482. let economic = await economicLib.findOne({'ID':property.economicLibID});
  483. if(economic) property.economics = economic.index;
  484. }
  485. }
  486. async function getIndexReportData(projectID,keyArr) {
  487. let project = await projectsModel.findOne({ID:projectID});
  488. let bills = await bill_model.getDataSync(projectID);
  489. let result = {};
  490. for(let key of keyArr){
  491. switch (key) {
  492. case 'ProjectCostFields':
  493. result[key] =getEngineerCostData(project.property,bills);
  494. break;
  495. case 'ProjectEcoFields':
  496. result[key] = getEconomicDatas(project.property,bills);
  497. break;
  498. case 'ProjectLabMaterialFields':
  499. result[key] = await getMainMaterialDatas(projectID,project.property);
  500. break;
  501. case 'ProjectQtyFields':
  502. result[key] = await getQuantityDatas(project.property,bills);
  503. break;
  504. case 'ProjectInfoFields':
  505. result[key] = getEngineerInfoData(project.property.engineerInfos);
  506. break;
  507. case 'ProjectFeatureFields':
  508. result[key] = getEngineerFeaturesDatas(project.property.engineerFeatures);
  509. break;
  510. }
  511. }
  512. return result
  513. }
  514. function getEngineerInfoData(engineerInfos) {
  515. let datas = [];
  516. for(let info of engineerInfos){
  517. let d = {
  518. name:info.dispName,
  519. value:info.value
  520. };
  521. datas.push(d);
  522. }
  523. return datas;
  524. }
  525. function getEngineerFeaturesDatas(engineerFeatures) {
  526. let datas = [];
  527. if (engineerFeatures !== null && engineerFeatures !== undefined) {
  528. for(let f of engineerFeatures){
  529. let tem = {
  530. ID:f.ID,
  531. name:f.name,
  532. value:f.value,
  533. ParentID:f.ParentID
  534. }
  535. datas.push(tem);
  536. }
  537. }
  538. return datas;
  539. }
  540. function getQuantityDatas(property,bills) {
  541. return gljUtil.getQuantityDatas(property.engineerFeatures,property.mainQuantities,bills,fixedFlag,_,scMathUtil,property.decimal)
  542. }
  543. function getEconomicDatas(property,bills) {
  544. return gljUtil.getEconomicDatas(property.engineerFeatures,property.economics,bills,fixedFlag,_,scMathUtil,property.decimal)
  545. }
  546. function getEngineerCostData(property,bills){
  547. let datas = [];
  548. let priceIndex = gljUtil.getEngineerCostData(property,bills,fixedFlag,scMathUtil);
  549. for(let c of priceIndex.children){
  550. let tem = {
  551. name:c.name,
  552. cost:parseFloat(c.attrs[0].value),
  553. unitCost:parseFloat(c.attrs[1].value),
  554. per:parseFloat(c.attrs[2].value)
  555. };
  556. datas.push(tem);
  557. }
  558. return datas;
  559. }
  560. async function getMainMaterialDatas(projectID,property) {
  561. let gljListModel = new GLJListModel();
  562. let [gljList, mixRatioConnectData,mixRatioMap,unitPriceMap] = await gljListModel.getListByProjectId(projectID, property.unitPriceFile?property.unitPriceFile.id:null);
  563. gljList = JSON.parse(JSON.stringify(gljList));
  564. await calcProjectGLJQuantity(projectID,{gljList:gljList,mixRatioMap:mixRatioMap},property);
  565. return gljUtil.getMainMaterialDatas(property.engineerFeatures,property.materials,{gljList:gljList},property.calcOptions,property.decimal,false,_,scMathUtil)
  566. }
  567. async function calcProjectGLJQuantity(projectID,projectGLJDatas,property){
  568. let q_decimal = property.decimal.glj.quantity;
  569. let rationGLJDatas = await ration_glj_model.find({'projectID':projectID});
  570. let rationDatas = await ration_model.model.find({'projectID':projectID});
  571. gljUtil.calcProjectGLJQuantity(projectGLJDatas,rationGLJDatas,rationDatas,[],q_decimal)
  572. }