|
@@ -229,13 +229,16 @@ public class SettementUtil {
|
|
|
* @param otherTotal 获取其他项目费合计
|
|
|
* @param feescount 获取规费合计
|
|
|
* @param cbperson 获取承包人采购合计
|
|
|
+ * @param opinion 判断是否减去发包人
|
|
|
* @return 导入架空项目校验后的集合。
|
|
|
*/
|
|
|
- public static List<Settlement> getComparison(List<Settlement> settlements, double builtTotal, double[] divisiontotal, double wordtotal1,double wordtotal2, double otherTotal, double feescount,double cbperson){
|
|
|
+ public static List<Settlement> getComparison(List<Settlement> settlements, double builtTotal, double[] divisiontotal, double wordtotal1,double wordtotal2, double otherTotal, double feescount,double cbperson,boolean opinion){
|
|
|
double wordtotal=wordtotal1+wordtotal2;//措施费相加
|
|
|
String name;//获取当前汇总表名称
|
|
|
double money;//获取当前汇总表金额
|
|
|
Settlement settlement;//对象
|
|
|
+ double moneyComparison1;//范围金额+5.0元
|
|
|
+ double moneyComparison2;//范围金额-5.0元
|
|
|
for (int i = 0; i < settlements.size(); i++) {
|
|
|
settlement=settlements.get(i);
|
|
|
name=settlement.getEntryName();
|
|
@@ -250,34 +253,51 @@ public class SettementUtil {
|
|
|
name=BashInfo.JS_JGJS;
|
|
|
}
|
|
|
money=settlement.getMoney();
|
|
|
+ moneyComparison1 = money+5.0;
|
|
|
+ moneyComparison2 = money-5.0;
|
|
|
settlement.setStatus("1");
|
|
|
switch (name){
|
|
|
case BashInfo.JS_FBFX:
|
|
|
- if (money==builtTotal&&money==divisiontotal[0]){
|
|
|
+// if (money==builtTotal&&money==divisiontotal[0]){
|
|
|
+// settlement.setStatus("0");
|
|
|
+// }
|
|
|
+ if(builtTotal<=moneyComparison1&&builtTotal>=moneyComparison2&&divisiontotal[0]<=moneyComparison1&&divisiontotal[0]>=moneyComparison2){
|
|
|
settlement.setStatus("0");
|
|
|
}
|
|
|
settlement.setTheAmount(String.valueOf(nf.format(builtTotal)+","+nf.format(divisiontotal[0])));
|
|
|
break;
|
|
|
case BashInfo.JS_CBRF:
|
|
|
- if(money==cbperson){
|
|
|
+// if(money==cbperson){
|
|
|
+// settlement.setStatus("0");
|
|
|
+// }
|
|
|
+ if(cbperson<=moneyComparison1&&cbperson>=moneyComparison2){
|
|
|
settlement.setStatus("0");
|
|
|
}
|
|
|
settlement.setTheAmount(String.valueOf(nf.format(cbperson)));
|
|
|
break;
|
|
|
case BashInfo.JS_CSXM:
|
|
|
- if (money==wordtotal){
|
|
|
+// if (money==wordtotal){
|
|
|
+// settlement.setStatus("0");
|
|
|
+// }
|
|
|
+ if(wordtotal<=moneyComparison1&&wordtotal>=moneyComparison2){
|
|
|
settlement.setStatus("0");
|
|
|
}
|
|
|
settlement.setTheAmount(String.valueOf(nf.format(wordtotal1)+","+nf.format(wordtotal2)+","+nf.format(wordtotal)));
|
|
|
break;
|
|
|
case BashInfo.JS_QTXM:
|
|
|
- if(money==otherTotal){
|
|
|
+// if(money==otherTotal){
|
|
|
+// settlement.setStatus("0");
|
|
|
+// }
|
|
|
+ if(otherTotal<=moneyComparison1&&otherTotal>=moneyComparison2){
|
|
|
settlement.setStatus("0");
|
|
|
}
|
|
|
settlement.setTheAmount(String.valueOf(nf.format(otherTotal)));
|
|
|
break;
|
|
|
case BashInfo.JS_GF:
|
|
|
- if (money==feescount){
|
|
|
+// if (money==feescount){
|
|
|
+// settlement.setStatus("0");
|
|
|
+// }
|
|
|
+ if (feescount<=moneyComparison1&&feescount>=moneyComparison2){
|
|
|
settlement.setStatus("0");
|
|
|
}
|
|
|
settlement.setTheAmount(String.valueOf(nf.format(feescount)));
|
|
@@ -287,14 +307,20 @@ public class SettementUtil {
|
|
|
settlement.setTheAmount(String.valueOf(nf.format(money)));
|
|
|
break;
|
|
|
case BashInfo.JS_FBRF:
|
|
|
- if(money==divisiontotal[1]){
|
|
|
+// if(money==divisiontotal[1]){
|
|
|
+// settlement.setStatus("0");
|
|
|
+// }
|
|
|
+ if(divisiontotal[1]<=moneyComparison1&&divisiontotal[1]>=moneyComparison2){
|
|
|
settlement.setStatus("0");
|
|
|
}
|
|
|
settlement.setTheAmount(String.valueOf(nf.format(divisiontotal[1])));
|
|
|
break;
|
|
|
case BashInfo.JS_JGJS:
|
|
|
- double[] doubles = getJgjsComparison(settlements);
|
|
|
- if (money==doubles[0]){
|
|
|
+ double[] doubles = getJgjsComparison(settlements,opinion);
|
|
|
+// if (money==doubles[0]){
|
|
|
+// settlement.setStatus("0");
|
|
|
+// }
|
|
|
+ if (doubles[0]<=moneyComparison1&&doubles[1]>=moneyComparison2){
|
|
|
settlement.setStatus("0");
|
|
|
}
|
|
|
String str = String.valueOf(nf.format(doubles[0])+','+nf.format(doubles[1])+','+nf.format(doubles[2])+','+nf.format(doubles[3])
|
|
@@ -312,7 +338,10 @@ public class SettementUtil {
|
|
|
break;
|
|
|
case BashInfo.JS_GCJS:
|
|
|
double[] gcComparison =getGcComparison(settlements);
|
|
|
- if (money==gcComparison[0]){
|
|
|
+// if (money==gcComparison[0]){
|
|
|
+// settlement.setStatus("0");
|
|
|
+// }
|
|
|
+ if (gcComparison[0]<=moneyComparison1&&gcComparison[0]>=moneyComparison2){
|
|
|
settlement.setStatus("0");
|
|
|
}
|
|
|
String gc = String.valueOf(nf.format(gcComparison[0])+','+
|
|
@@ -337,13 +366,16 @@ public class SettementUtil {
|
|
|
* @param otherTotal 其他项目费
|
|
|
* @param feescount 规费
|
|
|
* @param cbperson 发包人 / 招标人 费用
|
|
|
+ * @param opinion //判断是否减去发包人
|
|
|
* @return 电缆/变电站 项目 导入后 校验规则 list集合
|
|
|
*/
|
|
|
- public static List<Settlement> getDLComparison(List<Settlement> settlements, double builtTotal[], double[] divisiontotal, double wordtotal1,double wordtotal2, double otherTotal, double feescount,double cbperson){
|
|
|
+ public static List<Settlement> getDLComparison(List<Settlement> settlements, double builtTotal[], double[] divisiontotal, double wordtotal1,double wordtotal2, double otherTotal, double feescount,double cbperson,boolean opinion){
|
|
|
double wordtotal=wordtotal1+wordtotal2;//措施费相加
|
|
|
String name;//获取当前汇总表名称
|
|
|
double money;//获取当前汇总表金额
|
|
|
Settlement settlement;//对象
|
|
|
+ double moneyComparison1;//范围金额+5.0元
|
|
|
+ double moneyComparison2;//范围金额-5.0元
|
|
|
for (int i = 0; i < settlements.size(); i++) {
|
|
|
settlement=settlements.get(i);
|
|
|
name=settlement.getEntryName();
|
|
@@ -359,19 +391,27 @@ public class SettementUtil {
|
|
|
}
|
|
|
//获取金额
|
|
|
money=settlement.getMoney();
|
|
|
+ moneyComparison1 = money+5.0;
|
|
|
+ moneyComparison2 = money-5.0;
|
|
|
//默认初始状态为 1-不一致
|
|
|
settlement.setStatus("1");
|
|
|
switch (name){
|
|
|
case BashInfo.JS_FBFX:
|
|
|
double division=divisiontotal[0]+divisiontotal[2];//分工清单分部分项
|
|
|
double built = builtTotal[0]+builtTotal[1];//安装合计总金额
|
|
|
- if (money==built&&money==division){
|
|
|
+// if (money==built&&money==division){
|
|
|
+// settlement.setStatus("0");
|
|
|
+// }
|
|
|
+ if(built<=moneyComparison1&&built>=moneyComparison2&&division<=moneyComparison1&&division>=moneyComparison2){
|
|
|
settlement.setStatus("0");
|
|
|
}
|
|
|
settlement.setTheAmount(String.valueOf(nf.format(built)+","+nf.format(division)+","+nf.format(builtTotal[0])+","+nf.format(builtTotal[1])+","+nf.format(divisiontotal[0])+","+nf.format(divisiontotal[2])));
|
|
|
break;
|
|
|
case BashInfo.JS_CBRF:
|
|
|
- if(money==cbperson){
|
|
|
+// if(money==cbperson){
|
|
|
+// settlement.setStatus("0");
|
|
|
+// }
|
|
|
+ if(cbperson<=moneyComparison1&&cbperson>=moneyComparison2){
|
|
|
settlement.setStatus("0");
|
|
|
}
|
|
|
settlement.setTheAmount(String.valueOf(nf.format(cbperson)));
|
|
@@ -386,10 +426,16 @@ public class SettementUtil {
|
|
|
if(money==otherTotal){
|
|
|
settlement.setStatus("0");
|
|
|
}
|
|
|
+ if(otherTotal<=moneyComparison1&&otherTotal>=moneyComparison2){
|
|
|
+ settlement.setStatus("0");
|
|
|
+ }
|
|
|
settlement.setTheAmount(String.valueOf(nf.format(otherTotal)));
|
|
|
break;
|
|
|
case BashInfo.JS_GF:
|
|
|
- if (money==feescount){
|
|
|
+// if (money==feescount){
|
|
|
+// settlement.setStatus("0");
|
|
|
+// }
|
|
|
+ if (feescount<=moneyComparison1&&feescount>=moneyComparison2){
|
|
|
settlement.setStatus("0");
|
|
|
}
|
|
|
settlement.setTheAmount(String.valueOf(nf.format(feescount)));
|
|
@@ -400,14 +446,20 @@ public class SettementUtil {
|
|
|
break;
|
|
|
case BashInfo.JS_FBRF:
|
|
|
double divisionFbr =divisiontotal[1]+divisiontotal[3];
|
|
|
- if(money==divisionFbr){
|
|
|
+// if(money==divisionFbr){
|
|
|
+// settlement.setStatus("0");
|
|
|
+// }
|
|
|
+ if(divisionFbr<=moneyComparison1&&divisionFbr>=money){
|
|
|
settlement.setStatus("0");
|
|
|
}
|
|
|
settlement.setTheAmount(String.valueOf(nf.format(divisionFbr)+","+nf.format(divisiontotal[1])+","+nf.format(divisiontotal[3])));
|
|
|
break;
|
|
|
case BashInfo.JS_JGJS:
|
|
|
- double[] doubles = getJgjsComparison(settlements);
|
|
|
- if (money==doubles[0]){
|
|
|
+ double[] doubles = getJgjsComparison(settlements,opinion);
|
|
|
+// if (money==doubles[0]){
|
|
|
+// settlement.setStatus("0");
|
|
|
+// }
|
|
|
+ if (doubles[0]<=moneyComparison1&&doubles[0]>=moneyComparison2){
|
|
|
settlement.setStatus("0");
|
|
|
}
|
|
|
String str = String.valueOf(nf.format(doubles[0])+','+nf.format(doubles[1])+','+nf.format(doubles[2])+','+nf.format(doubles[3])
|
|
@@ -425,7 +477,10 @@ public class SettementUtil {
|
|
|
break;
|
|
|
case BashInfo.JS_GCJS:
|
|
|
double[] gcComparison =getGcComparison(settlements);
|
|
|
- if (money==gcComparison[0]){
|
|
|
+// if (money==gcComparison[0]){
|
|
|
+// settlement.setStatus("0");
|
|
|
+// }
|
|
|
+ if (gcComparison[0]<=moneyComparison1&&gcComparison[0]>=moneyComparison2){
|
|
|
settlement.setStatus("0");
|
|
|
}
|
|
|
String gc = String.valueOf(nf.format(gcComparison[0])+','+
|
|
@@ -442,9 +497,10 @@ public class SettementUtil {
|
|
|
/**
|
|
|
* 架空、电缆、变电站 竣工结算/工程投标 合计计算
|
|
|
* @param settlements 《工程项目投标报价汇总表》/《工程项目结算汇总表》 集合
|
|
|
+ * @param opinion //判断是否减去发包人
|
|
|
* @return double[] 计算匹配数据集合
|
|
|
*/
|
|
|
- public static double[] getJgjsComparison(List<Settlement> settlements){
|
|
|
+ public static double[] getJgjsComparison(List<Settlement> settlements,boolean opinion){
|
|
|
double[] doubles = new double[8];
|
|
|
String name;
|
|
|
double money=0;
|
|
@@ -484,7 +540,11 @@ public class SettementUtil {
|
|
|
doubles[7]=money;
|
|
|
}
|
|
|
}
|
|
|
- doubles[0]=doubles[1]+doubles[2]+doubles[3]+doubles[4]+doubles[5]+doubles[6]-doubles[7];
|
|
|
+ if (opinion){
|
|
|
+ doubles[0]=doubles[1]+doubles[2]+doubles[3]+doubles[4]+doubles[5]+doubles[6]-doubles[7];
|
|
|
+ }else {
|
|
|
+ doubles[0]=doubles[1]+doubles[2]+doubles[3]+doubles[4]+doubles[5]+doubles[6];
|
|
|
+ }
|
|
|
return doubles;
|
|
|
}
|
|
|
/**
|