Przeglądaj źródła

2019-09-20 13:39

xs 5 lat temu
rodzic
commit
3e3d14ca44

+ 8 - 4
src/main/java/com/jeeplus/modules/sg/overheadline/service/OverheadLineService.java

@@ -279,7 +279,8 @@ public List<JkxlDetailFee> findList(String id,String type){
        double csFees = BashInfo.getCsFee(csqd); //安装措施费
        double gfFees = ExcelUtil.getDouble(gf,BashInfo.QT_HJ,0,4); //规费
        //结算汇总
-        List<Settlement> settlements=SettementUtil.getComparison(settlementList,builtTotal,divisiontotal,wordtotal1,wordtotal2,otherTotal,feescount,cbperson,flag);
+        List<Settlement> settlements=SettementUtil.getComparison(settlementList,builtTotal,divisiontotal,wordtotal1,wordtotal2,otherTotal,feescount,cbperson);
+        Boolean f = SettementUtil.getFlag;
         settlementService.save(settlements,id);
        //将本体工程费用明细存入集合
        List<JkxlDetailFee> list = new ArrayList<>();
@@ -505,7 +506,8 @@ public List<JkxlDetailFee> findList(String id,String type){
             }
             boolean flag = BashInfo.getFlag(originalTotalJzFees,zjgcJzFees);
             //电缆结算汇总
-            List<Settlement> dlSettlements = SettementUtil.getDLComparison(settlementList,builtTotal,division,word1total,word2total,otherDlTotal,feesDlCount,cbperson,flag);
+            List<Settlement> dlSettlements = SettementUtil.getDLComparison(settlementList,builtTotal,division,word1total,word2total,otherDlTotal,feesDlCount,cbperson);
+            Boolean f = SettementUtil.getFlag;
             //数据核验并保存数据库
             settlementService.save(dlSettlements,id);
             for(int i=0;i<originalTotalJzFees.length;i++){
@@ -584,7 +586,8 @@ public List<JkxlDetailFee> findList(String id,String type){
             }
             boolean flag = BashInfo.getFlag(originalTotalAzFees,zjgcAzFees);
             //结算汇总
-            List<Settlement> dlSettlements = SettementUtil.getDLComparison(settlementList,builtTotal,division,word1total,word2total,otherDlTotal,feesDlCount,cbperson,flag);
+            List<Settlement> dlSettlements = SettementUtil.getDLComparison(settlementList,builtTotal,division,word1total,word2total,otherDlTotal,feesDlCount,cbperson);
+            Boolean f = SettementUtil.getFlag;
             //数据核验并保存数据库
             settlementService.save(dlSettlements,id);
             for(int i=0;i<originalTotalAzFees.length;i++){
@@ -683,7 +686,8 @@ public List<JkxlDetailFee> findList(String id,String type){
             if(flagJz && flagAz){
                 flag = true;
             }
-            List<Settlement> dlSettlements = SettementUtil.getDLComparison(settlementList,builtTotal,division,word1total,word2total,otherDlTotal,feesDlCount,cbperson,flag);
+            List<Settlement> dlSettlements = SettementUtil.getDLComparison(settlementList,builtTotal,division,word1total,word2total,otherDlTotal,feesDlCount,cbperson);
+            Boolean f = SettementUtil.getFlag;
             //数据核验并保存数据库
             settlementService.save(dlSettlements,id);
             //将本体工程费用明细存入集合

+ 157 - 148
src/main/java/com/jeeplus/modules/sg/overheadline/util/SettementUtil.java

@@ -3,6 +3,7 @@ package com.jeeplus.modules.sg.overheadline.util;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.common.utils.sg.ExcelUtil;
+import com.jeeplus.modules.sg.overheadline.entity.JkxlAdjustFee;
 import com.jeeplus.modules.sg.overheadline.entity.Settlement;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -14,14 +15,16 @@ import java.util.ArrayList;
 import java.util.List;
 public class SettementUtil {
     private static final NumberFormat nf= NumberFormat.getInstance();
+    public static Boolean getFlag = false;
     public static final String RESON_TRUE="【范围内】&nbsp;金额<span style='color:#0000FF'>&nbsp;一致。</span>";
     public static final String RESON_FLASE="【范围内】金额<span style='color:#FF0000'>&nbsp;不一致。</span>";
     public static final String BDZ_TBRNAME="投标人采购设备费";
     public static final String BDZ_ZBRNAME="招标人采购材料费";
     public static final String BDZ_TBNAME="投标报价";
     public static final String SE= "税额";
-    public static final String RESON_KYJ="扣夜间施工增加费";
-    public static final String RESON_QZWT="签证及委托";
+    public static final String RESON_KYJ="扣";
+    public static final String RESON_KYJ1="减";
+    public static final String RESON_ZZJS="最终结算价";
     /*
         分布分项比对
      */
@@ -69,7 +72,6 @@ public class SettementUtil {
     public static final String RESON_GF1="《规费项目清单计价表》,合计金额,<span style='font-weight: bold;'>xxx</span>,";
     //变电站
     public static final String BDZ_GF="《工程项目投标报价汇总表》,规费,<span style='font-weight: bold;'>xxx</span>,";
-    public static final String BDZ_GF1="《规费项目清单计价表》,合计金额,<span style='font-weight: bold;'>xxx</span>,";
     /*
         税率 不验证
      */
@@ -93,23 +95,13 @@ public class SettementUtil {
         竣工结算
      */
     public static final String RESON_JGJS="《工程项目竣工结算汇总表》,竣工结算价合计金额,<span style='font-weight: bold;'>xxx</span>,";
-    public static final String RESON_JGJS1=",分部分项工程费,<span style='font-weight: bold;'>xxx</span>,";
-    public static final String RESON_JGJS2=",承包人采购设备费,<span style='font-weight: bold;'>xxx</span>,";
-    public static final String RESON_JGJS3=",措施项目费,<span style='font-weight: bold;'>xxx</span>,";
-    public static final String RESON_JGJS4=",其他项目费,<span style='font-weight: bold;'>xxx</span>,";
-    public static final String RESON_JGJS5=",规费,<span style='font-weight: bold;'>xxx</span>,";
-    public static final String RESON_JGJS6=",税金,<span style='font-weight: bold;'>xxx</span>,";
-    public static final String RESON_JGJS7=",发包人材料费,<span style='font-weight: bold;'>xxx</span>,";
     public static final String RESON_JGJS8=",小计,<span style='font-weight: bold;'>xxx</span>,";
     //变电站
     public static final String BDZ_TBBJ="《工程项目投标报价汇总表》,投标报价,<span style='font-weight: bold;'>xxx</span>,";
-    public static final String BDZ_TBBJ1=",投标人采购设备费,<span style='font-weight: bold;'>xxx</span>,";
-    public static final String BDZ_TBBJ2=",招标人材料费,<span style='font-weight: bold;'>xxx</span>,";
     /*
         增补税率差额
      */
     public static final String RESON_BZZS="补增值税税率调整差额";
-    public static final String RESON_KJJG="扣减甲供材超供材料费";
     /*
        工程结算
     */
@@ -118,10 +110,6 @@ public class SettementUtil {
     public static final String RESON_GCJS2="《工程项目竣工结算汇总表》,补增值税税率调整差额,<span style='font-weight: bold;'>xxx</span>,";
     public static final String RESON_GCJS3="《工程项目竣工结算汇总表》,扣减甲供材超供材料费,<span style='font-weight: bold;'>xxx</span>,";
     public static final String RESON_GCJS4="&nbsp;,小计,<span style='font-weight: bold;'>xxx</span>,";
-    //工程投标 拼接数组
-    public static final  String[] TOP2 = {BDZ_TBBJ,RESON_JGJS1,BDZ_TBBJ1,RESON_JGJS3, RESON_JGJS4,RESON_JGJS5,RESON_JGJS6,BDZ_TBBJ2,RESON_JGJS8};
-    //工程竣工 拼接数组
-    public static final String[] TOP1 = {RESON_JGJS,RESON_JGJS1,RESON_JGJS2,RESON_JGJS3,RESON_JGJS4,RESON_JGJS5,RESON_JGJS6,RESON_JGJS7,RESON_JGJS8};
     public static final String[] DLBDZ_FBFX2 = {RESON_FBFX1,BDZ_FBFX1,BDZ_FBFX2,RESON_GCJS4,RESON_JZFBFX3,RESON_AZFBFX3,RESON_GCJS4};
     public static final String[] DLBDZ_FBFX1 = {RESON_FBFX1,RESON_JZFBFX,RESON_AZFBFX,RESON_GCJS4,RESON_JZFBFX3,RESON_AZFBFX3,RESON_GCJS4};
     /*
@@ -136,6 +124,7 @@ public class SettementUtil {
      * @return 《工程竣工表》/《工程项目投资表》 list集合
      */
     public static List<Settlement> getComparison(ImportExcel importExcel){
+        List<JkxlAdjustFee> jkxlAdjustFees = BashInfo.getWsbFee(importExcel);
         boolean flag = false;//判断 是否是变电站
         Settlement settlement;
         List<Settlement> settlementList = new ArrayList<Settlement>();
@@ -163,6 +152,10 @@ public class SettementUtil {
                 flag=true;
                 key=BashInfo.JS_JGJS;
             }
+            if (key.equals(RESON_ZZJS)){
+                key = BashInfo.JS_GCJS;
+                flag=true;
+            }
             switch (key){
                 case BashInfo.JS_FBFX:
                     settlementList.add(getSettlement(settlement,key,importExcel,i));
@@ -196,6 +189,13 @@ public class SettementUtil {
                     }
                     if (count==1){
                         settlementList.add(getSettlement(settlement,key,importExcel,i));
+                        for (JkxlAdjustFee jkxlAdjustFee:jkxlAdjustFees){
+                            settlement=new Settlement();
+                            settlement.setEntryName(jkxlAdjustFee.getType());
+                            settlement.setMoney(jkxlAdjustFee.getFee());
+                            settlement.setRemarks("");
+                            settlementList.add(settlement);
+                        }
                     }
                     break;
                 case BashInfo.JS_FBRF:
@@ -205,12 +205,6 @@ public class SettementUtil {
                     }
                     settlementList.add(getSettlement(settlement,key,importExcel,i));
                     break;
-                case RESON_KYJ:
-                    settlementList.add(getSettlement(settlement,key,importExcel,i));
-                    break;
-                case RESON_QZWT:
-                    settlementList.add(getSettlement(settlement,key,importExcel,i));
-                    break;
                 case BashInfo.JS_JGJS:
                     if (flag){
                         key=BDZ_TBNAME;
@@ -218,13 +212,11 @@ public class SettementUtil {
                     }
                     settlementList.add(getSettlement(settlement,key,importExcel,i));
                     break;
-                case BashInfo.JS_BZZS:
-                    settlementList.add(getSettlement(settlement,key,importExcel,i));
-                    break;
-                case BashInfo.JS_KJJG:
-                    settlementList.add(getSettlement(settlement,key,importExcel,i));
-                    break;
                 case BashInfo.JS_GCJS:
+                    if (flag){
+                        key=RESON_ZZJS;
+                        flag=false;
+                    }
                     settlementList.add(getSettlement(settlement,key,importExcel,i));
                     break;
             }
@@ -242,10 +234,9 @@ 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,boolean opinion){
+    public static List<Settlement> getComparison(List<Settlement> settlements, double builtTotal, double[] divisiontotal, double wordtotal1,double wordtotal2, double otherTotal, double feescount,double cbperson){
         double wordtotal=wordtotal1+wordtotal2;//措施费相加
         String name;//获取当前汇总表名称
         double money;//获取当前汇总表金额
@@ -265,6 +256,15 @@ public class SettementUtil {
             if (name.equals(BDZ_TBNAME)){
                 name=BashInfo.JS_JGJS;
             }
+            if (name.contains(RESON_KYJ)){
+                name = RESON_KYJ;
+            }
+            if (name.contains(RESON_KYJ1)){
+                name = RESON_KYJ1;
+            }
+            if (name.equals(RESON_ZZJS)){
+                name = BashInfo.JS_GCJS;
+            }
             money=settlement.getMoney();
             moneyComparison1 = money+5.0;
             moneyComparison2 = money-5.0;
@@ -310,31 +310,16 @@ public class SettementUtil {
                     }
                     settlement.setTheAmount(String.valueOf(nf.format(divisiontotal[1])));
                     break;
-                case RESON_KYJ:
-                    settlement.setStatus("2");
-                    break;
-                case RESON_QZWT:
-                    settlement.setStatus("2");
-                    break;
                 case BashInfo.JS_JGJS:
-                    double[] doubles = getJgjsComparison(settlements,opinion);
-                    if (doubles[0]<=moneyComparison1&&doubles[0]>=moneyComparison2){
+                    double doubles = getJgjsComparison(settlements);
+                    if (doubles<=moneyComparison1&&doubles>=moneyComparison2){
                         settlement.setStatus("0");
                     }
-                    String str = String.valueOf(nf.format(doubles[0])+','+nf.format(doubles[1])+','+nf.format(doubles[2])+','+nf.format(doubles[3])
-                            +','+nf.format(doubles[4])+','+nf.format(doubles[5])+','+nf.format(doubles[6])+','+nf.format(doubles[7]));
+                    String str = String.valueOf(nf.format(doubles));
                     settlement.setTheAmount(str);
                     break;
-                case BashInfo.JS_BZZS:
-                    settlement.setStatus("2");
-                    settlement.setTheAmount(String.valueOf(nf.format(money)));
-                    break;
-                case BashInfo.JS_KJJG:
-                    settlement.setStatus("2");
-                    settlement.setTheAmount(String.valueOf(nf.format(money)));
-                    break;
                 case BashInfo.JS_GCJS:
-                    double[] gcComparison =getGcComparison(settlements,opinion);
+                    double[] gcComparison =getGcComparison(settlements);
                     if (gcComparison[0]<=moneyComparison1&&gcComparison[0]>=moneyComparison2){
                         settlement.setStatus("0");
                     }
@@ -344,6 +329,9 @@ public class SettementUtil {
                             nf.format(gcComparison[3]));
                     settlement.setTheAmount(gc);
                     break;
+                default:
+                    settlement.setStatus("2");
+                    break;
             }
         }
         return settlements;
@@ -359,13 +347,12 @@ 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,boolean opinion){
+    public static List<Settlement> getDLComparison(List<Settlement> settlements, double builtTotal[], double[] divisiontotal, double wordtotal1,double wordtotal2, double otherTotal, double feescount,double cbperson){
         double wordtotal=wordtotal1+wordtotal2;//措施费相加
-        String name;//获取当前汇总表名称
-        double money;//获取当前汇总表金额
+        String name="";//获取当前汇总表名称
+        double money=0.0;//获取当前汇总表金额
         Settlement settlement;//对象
         double moneyComparison1;//范围金额+5.0元
         double moneyComparison2;//范围金额-5.0元
@@ -382,6 +369,15 @@ public class SettementUtil {
             if (name.equals(BDZ_TBNAME)){
                 name=BashInfo.JS_JGJS;
             }
+            if (name.contains(RESON_KYJ)){
+                name = RESON_KYJ;
+            }
+            if (name.contains(RESON_KYJ1)){
+                name = RESON_KYJ1;
+            }
+            if (name.equals(RESON_ZZJS)){
+                name = BashInfo.JS_GCJS;
+            }
             //获取金额
             money=settlement.getMoney();
             moneyComparison1 = money+5.0;
@@ -432,31 +428,16 @@ public class SettementUtil {
                     }
                     settlement.setTheAmount(String.valueOf(nf.format(divisionFbr)+","+nf.format(divisiontotal[1])+","+nf.format(divisiontotal[3])));
                     break;
-                case RESON_KYJ:
-                    settlement.setStatus("2");
-                    break;
-                case RESON_QZWT:
-                    settlement.setStatus("2");
-                    break;
                 case BashInfo.JS_JGJS:
-                    double[] doubles = getJgjsComparison(settlements,opinion);
-                    if (doubles[0]<=moneyComparison1&&doubles[0]>=moneyComparison2){
+                    double doubles = getJgjsComparison(settlements);
+                    if (doubles<=moneyComparison1&&doubles>=moneyComparison2){
                         settlement.setStatus("0");
                     }
-                    String str = String.valueOf(nf.format(doubles[0])+','+nf.format(doubles[1])+','+nf.format(doubles[2])+','+nf.format(doubles[3])
-                            +','+nf.format(doubles[4])+','+nf.format(doubles[5])+','+nf.format(doubles[6])+','+nf.format(doubles[7]));
+                    String str = String.valueOf(nf.format(doubles));
                     settlement.setTheAmount(str);
                     break;
-                case BashInfo.JS_BZZS:
-                    settlement.setStatus("2");
-                    settlement.setTheAmount(String.valueOf(money));
-                    break;
-                case BashInfo.JS_KJJG:
-                    settlement.setStatus("2");
-                    settlement.setTheAmount(String.valueOf(money));
-                    break;
                 case BashInfo.JS_GCJS:
-                    double[] gcComparison =getGcComparison(settlements,opinion);
+                    double[] gcComparison =getGcComparison(settlements);
                     if (gcComparison[0]<=moneyComparison1&&gcComparison[0]>=moneyComparison2){
                         settlement.setStatus("0");
                     }
@@ -466,6 +447,9 @@ public class SettementUtil {
                             nf.format(gcComparison[3]));
                     settlement.setTheAmount(gc);
                     break;
+                default:
+                    settlement.setStatus("2");
+                    break;
             }
         }
         return settlements;
@@ -473,17 +457,21 @@ public class SettementUtil {
     /**
      * 架空、电缆、变电站 竣工结算/工程投标 合计计算
      * @param settlements 《工程项目投标报价汇总表》/《工程项目结算汇总表》 集合
-     * @param opinion //判断是否减去发包人
-     * @return double[] 计算匹配数据集合
      */
-    public static double[] getJgjsComparison(List<Settlement> settlements,boolean opinion){
+    public static Double getJgjsComparison(List<Settlement> settlements){
         double[] doubles = new double[8];
-        String name;
-        double money=0;
+        boolean flag= false;
+        String name="";
+        double money=0.0;
         double minus = 0.0;
         double addcount = 0.0;
+        double jgjeCount = 0.0;
         for (Settlement settlement:settlements){
             name = settlement.getEntryName();
+            money = settlement.getMoney();
+            if (name.equals(BDZ_TBNAME)){
+                name=BashInfo.JS_JGJS;
+            }
             if(name.equals(BDZ_TBRNAME)){
                 name=BashInfo.JS_CBRF;
             }
@@ -493,7 +481,15 @@ public class SettementUtil {
             if (name.equals(BDZ_TBNAME)){
                 name=BashInfo.JS_JGJS;
             }
-            money =settlement.getMoney();
+            if (name.contains(RESON_KYJ)){
+                name = RESON_KYJ;
+            }
+            if (name.contains(RESON_KYJ1)){
+                name = RESON_KYJ1;
+            }
+            if (name.equals(RESON_ZZJS)){
+                name = BashInfo.JS_GCJS;
+            }
             switch (name) {
                 case BashInfo.JS_FBFX:
                     doubles[1]=money;
@@ -517,33 +513,64 @@ public class SettementUtil {
                     doubles[7]=money;
                     break;
                 case RESON_KYJ:
-                    minus = money;
+                    minus += money;
                     break;
-                case RESON_QZWT:
-                    addcount=money;
+                case RESON_KYJ1:
+                    minus += money;
+                    break;
+                default:
+                    if (name.equals(BashInfo.JS_JGJS)){
+                        jgjeCount=money;
+                    }else if (!name.equals(BashInfo.JS_GCJS)){
+                        addcount+=money;
+                    }
+                    if (name.equals(BashInfo.JS_GCJS)){
+                        flag=true;
+                    }
                     break;
             }
         }
-        if (opinion){
+        doubles[0]=doubles[1]+doubles[2]+doubles[3]+doubles[4]+doubles[5]+doubles[6]-minus+addcount;
+        if (flag){
+            doubles[0] = doubles[0]+ minus - addcount;
+        }
+        if (jgjeCount!=doubles[0]){
             doubles[0]=doubles[1]+doubles[2]+doubles[3]+doubles[4]+doubles[5]+doubles[6]-doubles[7]-minus+addcount;
-        }else {
-            doubles[0]=doubles[1]+doubles[2]+doubles[3]+doubles[4]+doubles[5]+doubles[6]-minus+addcount;
+            getFlag = true;
         }
-        return doubles;
+        if (flag){
+            doubles[0] = doubles[0]+ minus - addcount;
+        }
+        return doubles[0];
+
+//        if (opinion){
+//            doubles[0]=doubles[1]+doubles[2]+doubles[3]+doubles[4]+doubles[5]+doubles[6]-doubles[7]-minus+addcount;
+//        }else {
+//            doubles[0]=doubles[1]+doubles[2]+doubles[3]+doubles[4]+doubles[5]+doubles[6]-minus+addcount;
+//        }
+//        if (flag){
+//            doubles[0]= doubles[0]+minus-addcount;
+//        }
+//        return doubles[0];
     }
+
     /**
      * 工程结算价 校验
      * @param settlements 《工程项目结算汇总表》 集合
      * @return double[] 计算匹配数据集合
      */
-    public static double[] getGcComparison(List<Settlement> settlements,boolean opinion){
+    public static double[] getGcComparison(List<Settlement> settlements){
         double[] doubles=new double[4];
         double[] doubles1 = new double[8];
         String name;
         double money=0;
         double minus = 0.0;
+        double addcount = 0.0;
         for (Settlement settlement:settlements){
             name = settlement.getEntryName();
+            if (name.equals(BDZ_TBNAME)){
+                name=BashInfo.JS_JGJS;
+            }
             if(name.equals(BDZ_TBRNAME)){
                 name=BashInfo.JS_CBRF;
             }
@@ -553,6 +580,15 @@ public class SettementUtil {
             if (name.equals(BDZ_TBNAME)){
                 name=BashInfo.JS_JGJS;
             }
+            if (name.contains(RESON_KYJ)&&!name.equals(BashInfo.JS_KJJG)){
+                name = RESON_KYJ;
+            }
+            if (name.contains(RESON_KYJ1)&&!name.equals(BashInfo.JS_KJJG)){
+                name = RESON_KYJ1;
+            }
+            if (name.equals(RESON_ZZJS)){
+                name = BashInfo.JS_GCJS;
+            }
             money =settlement.getMoney();
             switch (name) {
                 case BashInfo.JS_FBFX:
@@ -577,7 +613,10 @@ public class SettementUtil {
                     doubles1[7]=money;
                     break;
                 case RESON_KYJ:
-                    minus = money;
+                    minus += money;
+                    break;
+                case RESON_KYJ1:
+                    minus += money;
                     break;
                 case BashInfo.JS_BZZS://补增值税
                     doubles[2]=money;
@@ -585,33 +624,21 @@ public class SettementUtil {
                 case BashInfo.JS_KJJG://扣减
                     doubles[3]=money;
                     break;
+                default:
+                    if (!name.equals(BashInfo.JS_JGJS)&&!name.equals(BashInfo.JS_GCJS)){
+                        addcount+=money;
+                    }
+                    break;
             }
         }
-        if (opinion){
-            doubles1[0]=doubles1[1]+doubles1[2]+doubles1[3]+doubles1[4]+doubles1[5]+doubles1[6]-doubles1[7]-minus;
+        if (getFlag){
+            doubles1[0]=doubles1[1]+doubles1[2]+doubles1[3]+doubles1[4]+doubles1[5]+doubles1[6]-doubles1[7]-minus+addcount;
         }else {
-            doubles1[0]=doubles1[1]+doubles1[2]+doubles1[3]+doubles1[4]+doubles1[5]+doubles1[6]-minus;
+            doubles1[0]=doubles1[1]+doubles1[2]+doubles1[3]+doubles1[4]+doubles1[5]+doubles1[6]-minus+addcount;
         }
         doubles[1]=doubles1[0];
         doubles[0]=doubles[1]+doubles[2]-doubles[3];
         return doubles;
-//        for (Settlement settlement:settlements){
-//            name = settlement.getEntryName();
-//            money =settlement.getMoney();
-//            switch (name) {
-//                case BashInfo.JS_JGJS://竣工结算
-//                    doubles[1]=money;
-//                    break;
-//                case BashInfo.JS_BZZS://补增值税
-//                    doubles[2]=money;
-//                    break;
-//                case BashInfo.JS_KJJG://扣减
-//                    doubles[3]=money;
-//                    break;
-//            }
-//        }
-//        doubles[0]=doubles[1]+doubles[2]-doubles[3];
-//        return doubles;
     }
     /**
      * 前台显示提示数据匹配:架空线路
@@ -681,10 +708,10 @@ public class SettementUtil {
                 case BashInfo.JS_JGJS:
                     if(flag){
                         settlement.setEntryName(BDZ_TBNAME);
-                        reason = getJgJoint(TOP2,settlement,booleans);
+                        reason = getJgJoint(BDZ_TBBJ,settlement,settlementList);
                         flag = false;
                     }else {
-                        reason = getJgJoint(TOP1,settlement,booleans);
+                        reason = getJgJoint(RESON_JGJS,settlement,settlementList);
                     }
                     settlement.setReason(reason);
                     break;
@@ -772,10 +799,10 @@ public class SettementUtil {
                 case BashInfo.JS_JGJS:
                     if(flag){
                         settlement.setEntryName(BDZ_TBNAME);
-                        reason = getJgJoint(TOP2,settlement,booleans);
+                        reason = getJgJoint(BDZ_TBBJ,settlement,settlementList);
                         flag =false;
                     }else {
-                        reason = getJgJoint(TOP1,settlement,booleans);
+                        reason = getJgJoint(RESON_JGJS,settlement,settlementList);
                     }
                     settlement.setReason(reason);
                     break;
@@ -865,10 +892,10 @@ public class SettementUtil {
                 case SettementUtil.BDZ_TBNAME:
                     if(flag){
                         settlement.setEntryName(BashInfo.JS_JGJS);
-                        reason = getJgJoint(TOP1,settlement,booleans);
+                        reason = getJgJoint(RESON_JGJS,settlement,settlementList);
                         flag= false; //默认关闭
                     }else {
-                        reason = getJgJoint(TOP2,settlement,booleans);
+                        reason = getJgJoint(BDZ_TBBJ,settlement,settlementList);
                     }
                     settlement.setReason(reason);
                     break;
@@ -951,15 +978,6 @@ public class SettementUtil {
             double amout2 = Double.valueOf(amout[1]);
             double moneyComparison1=money+5.0;//范围金额+5.0元
             double moneyComparison2=money-5.0;//范围金额-5.0元
-//            if (amout1>moneyComparison1&&amout1<moneyComparison2&&amout2>moneyComparison1&&amout2<moneyComparison2){
-//                reason=reason1+SettementUtil.RESON_FLASE+","+","+","+reason2+SettementUtil.RESON_FLASE;
-//            }
-//            if(money!=amout2&&amout1<=moneyComparison1&&amout1>=moneyComparison2){
-//                reason=reason1+SettementUtil.RESON_TRUE+","+","+","+reason2+SettementUtil.RESON_FLASE;
-//            }
-//            if (money!=amout1&&amout2<=moneyComparison1&&amout2>=moneyComparison2){
-//                reason=reason1+SettementUtil.RESON_FLASE+","+","+","+reason2+SettementUtil.RESON_TRUE;
-//            }
             if (amout1>=moneyComparison1||amout1<=moneyComparison2){
                 if (amout2>=moneyComparison1||amout2<=moneyComparison2){
                     reason=reason1+SettementUtil.RESON_FLASE+","+","+","+reason2+SettementUtil.RESON_FLASE;
@@ -1043,35 +1061,26 @@ public class SettementUtil {
      * 工程竣工 常量匹配
      * @param tops //常量拼接
      * @param settlement bean
-     * @param booleans  判断《工程竣工结算表》字段 是否存在
+     * @param  settlements  集合
      * @return string
      */
-    public static String getJgJoint(String[] tops,Settlement settlement,boolean[] booleans){
+    public static String getJgJoint(String tops,Settlement settlement,List<Settlement> settlements){
         String reason="";
-        String[] amout=settlement.getTheAmount().split(",");
-        reason+=tops[0].replace("xxx",String.valueOf(nf.format(settlement.getMoney())));
-        if (booleans[1]){
-            reason+=tops[1].replace("xxx",amout[1]);
-        }
-        if (booleans[2]){
-            reason+=tops[2].replace("xxx",amout[2]);
-        }
-        if (booleans[3]){
-            reason+=tops[3].replace("xxx",amout[3]);
-        }
-        if (booleans[4]){
-            reason+=tops[4].replace("xxx",amout[4]);
-        }
-        if (booleans[5]){
-            reason+=tops[5].replace("xxx",amout[5]);
-        }
-        if (booleans[6]){
-            reason+=tops[6].replace("xxx",amout[6]);
-        }
-        if (booleans[7]){
-            reason+=tops[7].replace("xxx",amout[7]);
+        reason+=tops.replace("xxx",String.valueOf(nf.format(settlement.getMoney())));
+        String amout=settlement.getTheAmount();
+        for (int i = 0; i < settlements.size(); i++) {
+            if (settlements.get(i).getEntryName().equals(BashInfo.JS_JGJS)){
+                reason+=RESON_JGJS8.replace("xxx",amout);
+                if (settlement.getStatus().equals("0")){
+                    reason+=SettementUtil.RESON_TRUE;
+                }else {
+                    reason+=SettementUtil.RESON_FLASE;
+                }
+                return reason;
+            }
+            reason += ","+settlements.get(i).getEntryName()+",<span style='font-weight: bold;'>"+nf.format(settlements.get(i).getMoney())+"</span>,";
         }
-        reason+=tops[8].replace("xxx",amout[0]);
+        reason+=RESON_JGJS8.replace("xxx",amout);
         if (settlement.getStatus().equals("0")){
             reason+=SettementUtil.RESON_TRUE;
         }else {

+ 4 - 3
src/main/java/com/jeeplus/modules/sg/substation/service/SubstationService.java

@@ -227,7 +227,8 @@ public class SubstationService {
                 flag = true;
             }
             //结算汇总
-            List<Settlement> settlementBdzs = SettementUtil.getDLComparison(settlementsBdz,builtTotal,division,word1total,word2total,otherBdzTotal,feesBdzCount,cbperson,flag);
+            List<Settlement> settlementBdzs = SettementUtil.getDLComparison(settlementsBdz,builtTotal,division,word1total,word2total,otherBdzTotal,feesBdzCount,cbperson);
+            Boolean f = SettementUtil.getFlag;
             settlementService.save(settlementBdzs,id);
             for(JkxlDetailFee jkxlDetailFee:jzTotal){
                  double originalTotalCost = jkxlDetailFee.getOriginalTotalCost();
@@ -431,7 +432,7 @@ public class SubstationService {
             jzTotal.addAll(dxgc);
             boolean flagJz = SubstationInfo.getFlag(jzTotal);
             //结算汇总保存
-            List<Settlement> settlementBdzs = SettementUtil.getDLComparison(settlementsBdz,builtTotal,division,word1total,word2total,otherBdzTotal,feesBdzCount,cbperson,flagJz);
+            List<Settlement> settlementBdzs = SettementUtil.getDLComparison(settlementsBdz,builtTotal,division,word1total,word2total,otherBdzTotal,feesBdzCount,cbperson);
             settlementService.save(settlementBdzs,id);
             for(JkxlDetailFee jkxlDetailFee:jzTotal){
                 double originalTotalCost = jkxlDetailFee.getOriginalTotalCost();
@@ -583,7 +584,7 @@ public class SubstationService {
             azTotal.addAll(zwdy);
             azTotal.addAll(zwtx);
             boolean flagAz = SubstationInfo.getFlag(azTotal);
-            List<Settlement> settlementBdzs = SettementUtil.getDLComparison(settlementsBdz,builtTotal,division,word1total,word2total,otherBdzTotal,feesBdzCount,cbperson,flagAz);
+            List<Settlement> settlementBdzs = SettementUtil.getDLComparison(settlementsBdz,builtTotal,division,word1total,word2total,otherBdzTotal,feesBdzCount,cbperson);
             settlementService.save(settlementBdzs,id);
             for(JkxlDetailFee jkxlDetailFee:azTotal){
                 double originalTotalCost = jkxlDetailFee.getOriginalTotalCost();