|
|
@@ -22,11 +22,11 @@ module.exports={
|
|
|
calculateQuantity:calculateQuantity,
|
|
|
getGLJTypeByID:getGLJTypeByID
|
|
|
}
|
|
|
-//辅助定额调整、替换工料机、稳定土配合比、标准附注条件调整、添加工料机、自定义消耗量(包括删除工料机)、自定义乘系数、市场单价调整
|
|
|
+//辅助定额调整、稳定土配合比、替换工料机、标准附注条件调整、添加工料机、自定义消耗量(包括删除工料机)、自定义乘系数、市场单价调整
|
|
|
let stateSeq ={
|
|
|
ass:1,
|
|
|
- replace:2,
|
|
|
- proportion: 3,
|
|
|
+ proportion: 2,
|
|
|
+ replace:3,
|
|
|
coe:4,
|
|
|
add:5,
|
|
|
cusQuantity:6,
|
|
|
@@ -83,6 +83,11 @@ async function calculateQuantity(query,noNeedCal=null,refreshRationName = false)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ // 稳定土调整状态
|
|
|
+ const proportionStr = gljList.filter(glj => glj.rationProportion).map(glj => glj.adjustProportion || 0).join(':');
|
|
|
+ if (proportionStr) {
|
|
|
+ adjustState.push({ index: stateSeq.proportion, content: proportionStr });
|
|
|
+ }
|
|
|
for(let glj of gljList){//先把混凝土,砂浆,配合比有自定义消耗的挑出来
|
|
|
if(gljUtil.isConcreteType(glj.type)) await getMixRatioMap(glj,gljList,coeList,assList,mixRatioMap);
|
|
|
}
|
|
|
@@ -94,11 +99,6 @@ async function calculateQuantity(query,noNeedCal=null,refreshRationName = false)
|
|
|
if(noNeedCal==null && result.glj_result.length > 0){
|
|
|
await ration_glj.bulkWrite(generateUpdateTasks(result.glj_result));
|
|
|
}
|
|
|
- // 稳定土调整状态
|
|
|
- const proportionStr = gljList.filter(glj => glj.rationProportion).map(glj => glj.adjustProportion || 0).join(':');
|
|
|
- if (proportionStr) {
|
|
|
- adjustState.push({ index: stateSeq.proportion, content: proportionStr });
|
|
|
- }
|
|
|
adjustState= _.sortByOrder(adjustState, ['index'], ['asc']);
|
|
|
adjustState=_.map(adjustState, _.property('content'));
|
|
|
let adjustStateString = adjustState.join(';');
|
|
|
@@ -209,7 +209,7 @@ async function calculateQuantityPerGLJ(glj,gljList,coeList,assList,adjustState,m
|
|
|
}
|
|
|
};
|
|
|
try {
|
|
|
- if(noNeedCal==null){//计算顺序:辅助定额,附注条件,自定义消耗(如果有就不用前计算两项),自定义乘系数
|
|
|
+ if(noNeedCal==null){//计算顺序:辅助定额, 稳定土配合比、附注条件,自定义消耗(如果有就不用前计算两项),自定义乘系数
|
|
|
if(noCustomQuantiyt(glj)){
|
|
|
quantity = await calcWhenNoCustomQuantiyt(decimal,glj,gljList,coeList,assList);
|
|
|
let mIndex = gljUtil.getIndex(glj);
|