蔡德晨 5 years ago
parent
commit
09b8e94120

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

@@ -402,6 +402,8 @@ public List<JkxlDetailFee> findList(String id,String type){
       //获取未识别费用
         List<JkxlAdjustFee> wsbFees = BashInfo.getWsbFee(total);
         double wsbfee = 0.00;
+        //获取补税额
+        double btex = BashInfo.getBtex(total);
 //       double[] wsbFees = ExcelUtil.getDoubleArray(total, new String[]{BashInfo.BZZSSL,BashInfo.KJJGCC},1,2);
        double csFee = ExcelUtil.getDouble(gzhz,BashInfo.HZ_CH,1,2);
        double[] originalTotalFees = ExcelUtil.getDoubleArray(gzhz,BashInfo.HZ_ALL,1,2); //获取合计费
@@ -476,10 +478,24 @@ public List<JkxlDetailFee> findList(String id,String type){
            jkxlDetailFee.setId(id);
            list.add(jkxlDetailFee);
        }
-       double tz = 0.00; //总合计金额
-       for(JkxlDetailFee jkxlDetailFee : list){
-           tz += jkxlDetailFee.getTotalFee();
-       }
+        double tz = 0.00; //总合计金额
+        double texTotal = 0.00; //税合计金额
+        for(JkxlDetailFee jkxlDetailFee : list){
+           texTotal += jkxlDetailFee.getTex();
+        }
+        //补税
+        if(btex != 0.00){
+            for(JkxlDetailFee jkxlDetailFee : list){
+                double tex = jkxlDetailFee.getTex();
+                double total1 = jkxlDetailFee.getTotalFee();
+                double rate = tex/texTotal;
+                jkxlDetailFee.setTex(tex+btex*rate);
+                jkxlDetailFee.setTotalFee(total1+btex*rate);
+            }
+        }
+        for(JkxlDetailFee jkxlDetailFee : list){
+            tz += jkxlDetailFee.getTotalFee();
+        }
        if(wsbFees != null && wsbFees.size()>0){
            for(JkxlAdjustFee jkxlAdjustFee : wsbFees){
                jkxlAdjustFee.setId(id);
@@ -571,6 +587,8 @@ public List<JkxlDetailFee> findList(String id,String type){
         double gcjsFee = BashInfo.getGcjsFee(total);  //获取工程结算价
         double tax = 0.00; //税金
         double totalfee = 0.00;  //合计
+        //获取补税额
+        double btex = BashInfo.getBtex(total);
         List<JkxlDetailFee> list = new ArrayList<>();
         if(jzgc !=0.00 && azgc == 0.00){
             ImportExcel jzqd = new ImportExcel(file,1,BashInfo.SHEET_JZFBFXJJ,true);  //建筑分部分项工程量清单计价表
@@ -863,6 +881,20 @@ public List<JkxlDetailFee> findList(String id,String type){
             }
         }
         double tz = 0.00; //总合计金额
+        double texTotal = 0.00; //税合计金额
+        for(JkxlDetailFee jkxlDetailFee : list){
+            texTotal += jkxlDetailFee.getTex();
+        }
+        //补税
+        if(btex != 0.00){
+            for(JkxlDetailFee jkxlDetailFee : list){
+                double tex = jkxlDetailFee.getTex();
+                double total1 = jkxlDetailFee.getTotalFee();
+                double rate = tex/texTotal;
+                jkxlDetailFee.setTex(tex+btex*rate);
+                jkxlDetailFee.setTotalFee(total1+btex*rate);
+            }
+        }
         for(JkxlDetailFee jkxlDetailFee : list){
             tz += jkxlDetailFee.getTotalFee();
         }

+ 26 - 0
src/main/java/com/jeeplus/modules/sg/overheadline/util/BashInfo.java

@@ -485,4 +485,30 @@ public class BashInfo {
     }
 
 
+    /**
+     * 获取补税额
+     */
+    public static double getBtex(ImportExcel importExcel) {
+        int lastRow = importExcel.getLastDataRowNum();
+        int row = 0;
+        double d = 0.00;
+        for (int i = 0; i < lastRow; i++) {
+            String type = importExcel.getValue(i + 1, 1);
+            if (type.contains(JS_SJ)) {
+                row = i+1;
+            }
+        }
+        for (int j = row; j < lastRow; j++) {
+            String type = importExcel.getValue(j + 1, 1);
+            if(type.equals("")){
+                continue;
+            }
+            if (type.contains("税")) {
+                d = importExcel.getDouble(j+1,2);
+            }
+        }
+        return d;
+    }
+
+
 }

+ 6 - 2
src/main/java/com/jeeplus/modules/sg/overheadline/web/OverheadLineController.java

@@ -881,6 +881,7 @@ public class OverheadLineController extends BaseController {
     double originalFbrCost = 0.00;
     double originalCbrCost = 0.00;
     double ce1 = 0.00;
+    double qt = 0.00;
     for(JkxlAdjustFee jkxlAdjustFee : list2){
       if(jkxlAdjustFee.getType().equals(BashInfo.CE)){
         ce1 = jkxlAdjustFee.getFee();
@@ -897,6 +898,9 @@ public class OverheadLineController extends BaseController {
            originalFbrCost = jkxlDetailFee.getOriginalFbrCost();  //发包人合计
            originalCbrCost = jkxlDetailFee.getOriginalCbrCost();   //承包人合计
       }
+      if(jkxlDetailFee.getWbsCode().equals("合计") && jkxlDetailFee.getOriginalTotalCost() == null){
+         qt = jkxlDetailFee.getTotalFee();
+      }
     }
     for(Settlement settlement : list3){
       if(settlement.getEntryName().contains(BashInfo.JS_FBFX)){
@@ -930,8 +934,8 @@ public class OverheadLineController extends BaseController {
         settlement.setDifference(new BigDecimal(ce).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
       }
       if(settlement.getEntryName().contains(BashInfo.JS_QTXM)){
-        double ce = Math.abs(settlement.getMoney() - otherCost);
-        settlement.setTotalFee(otherCost);
+        double ce = Math.abs(settlement.getMoney() - otherCost-qt);
+        settlement.setTotalFee(otherCost+qt);
         settlement.setDifference(new BigDecimal(ce).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
       }
       if(settlement.getEntryName().contains("结算") || settlement.getEntryName().contains("报价")){

+ 17 - 0
src/main/java/com/jeeplus/modules/sg/project/service/ProjectService.java

@@ -2,20 +2,27 @@ package com.jeeplus.modules.sg.project.service;
 
 import com.jeeplus.common.json.AjaxJson;
 import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.core.persistence.Page;
 import com.jeeplus.core.service.CrudService;
 import com.jeeplus.modules.sg.overheadline.entity.Settlement;
+import com.jeeplus.modules.sg.overheadline.service.OverheadLineService;
+import com.jeeplus.modules.sg.overheadline.util.BashInfo;
 import com.jeeplus.modules.sg.project.entity.WbsItem;
 import com.jeeplus.modules.sg.project.entity.WbsProject;
 import com.jeeplus.modules.sg.project.entity.WbsSelection;
 import com.jeeplus.modules.sg.project.mapper.ItemMapper;
 import com.jeeplus.modules.sg.project.mapper.ProjectMapper;
+import com.jeeplus.modules.sg.substation.service.SubstationService;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.utils.UserUtils;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
 
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -26,6 +33,10 @@ public class ProjectService extends CrudService<ProjectMapper, WbsProject> {
     private ProjectMapper projectMapper;
     @Autowired
     private ItemService itemService;
+    @Autowired
+    private OverheadLineService overheadLineService;
+    @Autowired
+    private SubstationService substationService;
 
 
     public WbsProject get(String id) {
@@ -37,6 +48,12 @@ public class ProjectService extends CrudService<ProjectMapper, WbsProject> {
         return wbsProject;
     }
 
+    public void save(MultipartFile file ,WbsItem wbsItem) throws IOException, InvalidFormatException {
+        ImportExcel jk = new ImportExcel(file,1,new String[]{BashInfo.SHEET_GCHZ,BashInfo.SHEET_GCHZ1},false); //架空汇总
+        ImportExcel dljz = new ImportExcel(file, 1, BashInfo.SHEET_JZHZB,true);   //电缆线路建筑工程费用汇总表
+        ImportExcel dlaz = new ImportExcel(file, 1, BashInfo.SHEET_HZHZB,true);   //电缆线路安装工程费用汇总表
+    }
+
 
     public List<WbsProject> findList(WbsProject wbsProject) {
         List<WbsProject> list =  projectMapper.findList(wbsProject);

+ 1 - 1
src/main/java/com/jeeplus/modules/sg/project/web/ProjectTemController.java

@@ -86,7 +86,7 @@ public class ProjectTemController extends BaseController {
                 }
                 if(null != itemNo && itemNo.length >0) {
                     if (StringUtils.isNotBlank(itemNo[i])) {
-                        wbsItem.setUnit(itemNo[i]);
+                        wbsItem.setItemNo(itemNo[i]);
                     }
                 }
 //            保存数据到数据库

+ 60 - 0
src/main/java/com/jeeplus/modules/sg/substation/service/SubstationService.java

@@ -112,6 +112,8 @@ public class SubstationService {
         double wsbfee = 0.00;
         double tax = 0.00; //税金
         double totalfee = 0.00;  //合计
+       //获取补税额
+       double btex = BashInfo.getBtex(total);
         //变电站 结算汇总
         List<Settlement> settlementsBdz =  SettementUtil.getComparison(total);
 //        double cbperson = ExcelUtil.getDouble(tbrsb,BashInfo.QT_HJ,0,6);//获取投标人设备表合计
@@ -303,6 +305,34 @@ public class SubstationService {
             azDetail.setTotalFee(aztotalFee);
             azTotal.set(0,azDetail);
 
+            //补税
+            if(btex != 0.00){
+            double jztexTotal = 0.00;
+            double aztexTotal = 0.00;
+            double texTotal = jztexTotal+aztexTotal; //税合计金额
+            for(JkxlDetailFee jkxlDetailFee : jzTotal){
+                jztexTotal += jkxlDetailFee.getTex();
+            }
+            for(JkxlDetailFee jkxlDetailFee : azTotal){
+                aztexTotal += jkxlDetailFee.getTex();
+            }
+
+            for(JkxlDetailFee jkxlDetailFee : jzTotal){
+                    double tex = jkxlDetailFee.getTex();
+                    double total1 = jkxlDetailFee.getTotalFee();
+                    double rate = tex/texTotal;
+                    jkxlDetailFee.setTex(tex+btex*rate);
+                    jkxlDetailFee.setTotalFee(total1+btex*rate);
+            }
+            for(JkxlDetailFee jkxlDetailFee : azTotal){
+                    double tex = jkxlDetailFee.getTex();
+                    double total1 = jkxlDetailFee.getTotalFee();
+                    double rate = tex/texTotal;
+                    jkxlDetailFee.setTex(tex+btex*rate);
+                    jkxlDetailFee.setTotalFee(total1+btex*rate);
+            }
+            }
+
             double tz = jzTotal.get(0).getTotalFee()+azTotal.get(0).getTotalFee();//总合计金额
 
             if(wsbFees != null && wsbFees.size()>0){
@@ -423,6 +453,21 @@ public class SubstationService {
             jzDetail.setTex(jztex);
             jzTotal.set(0,jzDetail);
 
+            //补税
+            if(btex != 0.00){
+                double jztexTotal = 0.00;
+                for(JkxlDetailFee jkxlDetailFee : jzTotal){
+                    jztexTotal += jkxlDetailFee.getTex();
+                }
+                for(JkxlDetailFee jkxlDetailFee : jzTotal){
+                    double tex = jkxlDetailFee.getTex();
+                    double total1 = jkxlDetailFee.getTotalFee();
+                    double rate = tex/jztexTotal;
+                    jkxlDetailFee.setTex(tex+btex*rate);
+                    jkxlDetailFee.setTotalFee(total1+btex*rate);
+                }
+            }
+
             double tz = jzTotal.get(0).getTotalFee();//总合计金额
 
             if(wsbFees != null && wsbFees.size()>0){
@@ -545,6 +590,21 @@ public class SubstationService {
             azDetail.setTotalFee(aztotalFee);
             azTotal.set(0,azDetail);
 
+            //补税
+            if(btex != 0.00){
+                double aztexTotal = 0.00;
+                for(JkxlDetailFee jkxlDetailFee : azTotal){
+                    aztexTotal += jkxlDetailFee.getTex();
+                }
+                for(JkxlDetailFee jkxlDetailFee : azTotal){
+                    double tex = jkxlDetailFee.getTex();
+                    double total1 = jkxlDetailFee.getTotalFee();
+                    double rate = tex/aztexTotal;
+                    jkxlDetailFee.setTex(tex+btex*rate);
+                    jkxlDetailFee.setTotalFee(total1+btex*rate);
+                }
+            }
+
             double tz = azTotal.get(0).getTotalFee();//总合计金额
 
             if(wsbFees != null && wsbFees.size()>0){