Преглед изворни кода

财务模块,其他费用明细表

lem пре 4 година
родитељ
комит
e286b1aa6d

+ 9 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCredit.java

@@ -38,6 +38,7 @@ public class ErpCredit extends DataEntity<ErpCredit>{
     private String supplierName;//供应商名称
     private String cableTube;//电缆管信息
     private String status;//状态
+    private Double deduction; //抵扣增值税
     private List<ErpCreditEquipment> erpCreditChild1s = new ArrayList<ErpCreditEquipment>();//设备列表
     private List<ErpCreditMaterial> erpCreditChild2s = new ArrayList<ErpCreditMaterial>();//材料列表
     private Map<String,ErpCreditEquipment> equipmentMap = new HashMap<>();//以物料描述为key值的设备map
@@ -124,6 +125,14 @@ public class ErpCredit extends DataEntity<ErpCredit>{
         this.status = status;
     }
 
+    public Double getDeduction() {
+        return deduction;
+    }
+
+    public void setDeduction(Double deduction) {
+        this.deduction = deduction;
+    }
+
     public static long getSerialVersionUID() {
         return serialVersionUID;
     }

+ 166 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/OtherExpenses.java

@@ -0,0 +1,166 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+public class OtherExpenses {
+    /**
+     * 序号栏
+     * */
+    private String serialNumber;
+    /**
+     * 项目号
+     * */
+    private String projectNumber;
+    /**
+     * 项目编号
+     * */
+    private String projectCode;
+    /**
+     * 工程项目
+     * */
+    private String projectName;
+    /**
+     * 项目管理经费
+     * */
+    private String managementFunds;
+    /**
+     * 监理费
+     * */
+    private String supervisionFee;
+    /**
+     * 设计费
+     * */
+    private String designFee;
+    /**
+     * 贷款利息
+     * */
+    private String loanInterest;
+    /**
+     * 赔偿费
+     * */
+    private String damages;
+    /**
+     * 合计
+     * */
+    private String total;
+    /**
+     * 抵扣增值税
+     * */
+    private String deduction;
+    /**
+     * 实际含税投资合计
+     * */
+    private String includingTax;
+
+    @Override
+    public String toString() {
+        return "otherExpenses{" +
+                "serialNumber='" + serialNumber + '\'' +
+                ", projectNumber='" + projectNumber + '\'' +
+                ", projectCode='" + projectCode + '\'' +
+                ", projectName='" + projectName + '\'' +
+                ", managementFunds='" + managementFunds + '\'' +
+                ", supervisionFee='" + supervisionFee + '\'' +
+                ", designFee='" + designFee + '\'' +
+                ", loanInterest='" + loanInterest + '\'' +
+                ", damages='" + damages + '\'' +
+                ", total='" + total + '\'' +
+                ", deduction='" + deduction + '\'' +
+                ", includingTax='" + includingTax + '\'' +
+                '}';
+    }
+
+    public String getSerialNumber() {
+        return serialNumber;
+    }
+
+    public void setSerialNumber(String serialNumber) {
+        this.serialNumber = serialNumber;
+    }
+
+    public String getProjectNumber() {
+        return projectNumber;
+    }
+
+    public void setProjectNumber(String projectNumber) {
+        this.projectNumber = projectNumber;
+    }
+
+    public String getProjectCode() {
+        return projectCode;
+    }
+
+    public void setProjectCode(String projectCode) {
+        this.projectCode = projectCode;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public String getManagementFunds() {
+        return managementFunds;
+    }
+
+    public void setManagementFunds(String managementFunds) {
+        this.managementFunds = managementFunds;
+    }
+
+    public String getSupervisionFee() {
+        return supervisionFee;
+    }
+
+    public void setSupervisionFee(String supervisionFee) {
+        this.supervisionFee = supervisionFee;
+    }
+
+    public String getDesignFee() {
+        return designFee;
+    }
+
+    public void setDesignFee(String designFee) {
+        this.designFee = designFee;
+    }
+
+    public String getLoanInterest() {
+        return loanInterest;
+    }
+
+    public void setLoanInterest(String loanInterest) {
+        this.loanInterest = loanInterest;
+    }
+
+    public String getDamages() {
+        return damages;
+    }
+
+    public void setDamages(String damages) {
+        this.damages = damages;
+    }
+
+    public String getTotal() {
+        return total;
+    }
+
+    public void setTotal(String total) {
+        this.total = total;
+    }
+
+    public String getDeduction() {
+        return deduction;
+    }
+
+    public void setDeduction(String deduction) {
+        this.deduction = deduction;
+    }
+
+    public String getIncludingTax() {
+        return includingTax;
+    }
+
+    public void setIncludingTax(String includingTax) {
+        this.includingTax = includingTax;
+    }
+}

+ 1 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/service/ErpCreditService.java

@@ -281,6 +281,7 @@ public class ErpCreditService extends CrudService<ErpCreditMapper,ErpCredit> {
             ExportUtil.getSheetSettlement(sheetSettlement,erpCreditList,maintainDatas);
             ExportUtil.getSheetLine2(sheetLine2,erpCreditList,workbook);
             ExportUtil.getSheetEquip2(sheetEquip2,erpCreditList,maintainDatas,workbook);
+            ExportUtil.getOtherExpenses(newForm,erpCreditList,maintainDatas,workbook);
             workbook.write(fos);
             fos.flush();
             fos.close();

+ 2 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ErpInfo.java

@@ -250,6 +250,7 @@ public  class ErpInfo {
                     }
                     //只要满足一二条件都属于合计
                     erpCredit.setOtherTotalFee(DoubleUtil.add(erpCredit.getOtherTotalFee(),lineItemAmount));
+                    erpCredit.setDeduction(DoubleUtil.add(erpCredit.getDeduction(),inputTax));
                     //这里是后期规则的兼容  项目建设成-成本下这三项都归到合计中,前两项分别属于监理费和设计费,因此第三项归于法人管理费
                 }else if(subjectName.contains("项目建设成本-成本")){
                     if(wbsDetail.contains("工程监理费")){
@@ -261,6 +262,7 @@ public  class ErpInfo {
                     }else if(wbsDetail.contains("项目管理经费 - 会议费")||wbsDetail.contains("项目管理经费 -其它")){
                         erpCredit.setOtherTotalFee(DoubleUtil.add(erpCredit.getOtherTotalFee(),lineItemAmount));
                         erpCredit.setOtherLegalManage(DoubleUtil.add(erpCredit.getOtherLegalManage(),lineItemAmount));
+                        erpCredit.setDeduction(DoubleUtil.add(erpCredit.getDeduction(),inputTax));
                     }
                 }
             }else{ //这里是物料描述不为空的情况

+ 115 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil.java

@@ -787,6 +787,121 @@ public class ExportUtil {
         }
     }
 
+    public static void getOtherExpenses(Sheet sheet,List<ErpCredit> erpCredits,List<MaintainData> maintainDataList,Workbook workbook){
+        if (sheet!=null){
+            CellStyle cellStyleFont = getCellStyleFont(workbook);
+            CellStyle cellStyle = getCellStyle(workbook);
+            OtherExpenses otherExpenses = null;
+            XSSFRow row = (XSSFRow) sheet.createRow(5);
+            XSSFCell cell = row.getCell(3);
+            List<OtherExpenses> otherList = ExportUtilCalculate.getOtherExpenses(erpCredits, maintainDataList);
+            for (int i = 0; i <otherList.size(); i++) {
+                otherExpenses = otherList.get(i);
+                row=(XSSFRow)sheet.createRow(i+5);
+                if (row.getCell(0) == null){
+                    cell = row.createCell(0);
+                }else {
+                    cell = row.getCell(0);
+                }
+                cell.setCellValue(i+1);
+                cell.setCellStyle(cellStyle);
+                if (i==otherList.size()-1){ cell.setCellStyle(cellStyleFont); }
+
+                if (row.getCell(1) == null){
+                    cell = row.createCell(1);
+                }else {
+                    cell = row.getCell(1);
+                }
+                cell.setCellValue(otherExpenses.getProjectNumber());
+                cell.setCellStyle(cellStyle);
+                if (i==otherList.size()-1){ cell.setCellStyle(cellStyleFont); }
+                if (row.getCell(2)==null){
+                    cell =row.createCell(2);
+                }else {
+                    cell=row.getCell(2);
+                }
+                cell.setCellValue("");
+                cell.setCellStyle(cellStyle);
+                if (i==otherList.size()-1){ cell.setCellStyle(cellStyleFont); }
+                if (row.getCell(3)==null){
+                    cell=row.createCell(3);
+                }else {
+                    cell=row.getCell(3);
+                }
+                cell.setCellValue(otherExpenses.getProjectName());
+                cell.setCellStyle(cellStyle);
+                if (i==otherList.size()-1){ cell.setCellStyle(cellStyleFont); }
+                if (row.getCell(4)==null){
+                    cell=row.createCell(4);
+                }else {
+                    cell=row.getCell(4);
+                }
+                cell.setCellValue(otherExpenses.getManagementFunds());
+                cell.setCellStyle(cellStyle);
+                if (i==otherList.size()-1){ cell.setCellStyle(cellStyleFont); }
+                if (row.getCell(5)==null){
+                    cell=row.createCell(5);
+                }else {
+                    cell=row.getCell(5);
+                }
+                cell.setCellValue(otherExpenses.getSupervisionFee());
+                cell.setCellStyle(cellStyle);
+                if (i==otherList.size()-1){ cell.setCellStyle(cellStyleFont); }
+                if (row.getCell(6)==null){
+                    cell=row.createCell(6);
+                }else {
+                    cell=row.getCell(6);
+                }
+                cell.setCellValue(otherExpenses.getDesignFee());
+                cell.setCellStyle(cellStyle);
+                if (i==otherList.size()-1){ cell.setCellStyle(cellStyleFont); }
+                if (row.getCell(7)==null){
+                    cell=row.createCell(7);
+                }else {
+                    cell=row.getCell(7);
+                }
+                cell.setCellValue(otherExpenses.getLoanInterest());
+                cell.setCellStyle(cellStyle);
+                if (i==otherList.size()-1){ cell.setCellStyle(cellStyleFont); }
+                if (row.getCell(8)==null){
+                    cell=row.createCell(8);
+                }else {
+                    cell=row.getCell(8);
+                }
+                cell.setCellValue(otherExpenses.getDamages());
+                cell.setCellStyle(cellStyle);
+                if (i==otherList.size()-1){ cell.setCellStyle(cellStyleFont); }
+
+                if (row.getCell(9)==null){
+                    cell=row.createCell(9);
+                }else {
+                    cell=row.getCell(9);
+                }
+                cell.setCellValue(otherExpenses.getTotal());
+                cell.setCellStyle(cellStyle);
+                if (i==otherList.size()-1){ cell.setCellStyle(cellStyleFont); }
+
+                if (row.getCell(10)==null){
+                    cell=row.createCell(10);
+                }else {
+                    cell=row.getCell(10);
+                }
+                cell.setCellValue(otherExpenses.getDeduction());
+                cell.setCellStyle(cellStyle);
+                if (i==otherList.size()-1){ cell.setCellStyle(cellStyleFont); }
+                if (row.getCell(11)==null){
+                    cell=row.createCell(11);
+                }else {
+                    cell=row.getCell(11);
+                }
+                cell.setCellValue(otherExpenses.getIncludingTax());
+                cell.setCellStyle(cellStyle);
+                if (i==otherList.size()-1){ cell.setCellStyle(cellStyleFont); }
+            }
+        }
+
+    }
+
     //概述表
     public static void getSheetOverView(Sheet sheet, List<ErpCredit> erpCredits, List<MaintainData> maintainDataList){
        if (sheet!=null){

+ 125 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtilCalculate.java

@@ -214,6 +214,63 @@ public class ExportUtilCalculate {
         return schedule;
     }
 
+
+    public static OtherExpenses getExpenses(OtherExpenses otherExpenses, ErpCredit erpCredit, List<MaintainData> maintainDataList){
+        DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
+        Double otherSupervisorFee = getExDouble(erpCredit.getOtherSupervisorFee());
+        Double otherDesignFee = getExDouble(erpCredit.getOtherDesignFee());
+        Double otherBuildLoan = getExDouble(erpCredit.getOtherBuildLoan());
+        Double otherLineDamages = getExDouble(erpCredit.getOtherLineDamages());
+        Double otherTotalFee = getExDouble(erpCredit.getOtherTotalFee());
+        Double deduction = getExDouble(erpCredit.getDeduction());
+        OtherExpenses otherActual = new OtherExpenses();
+        otherActual.setProjectName(erpCredit.getItemName());
+        otherActual.setProjectNumber(erpCredit.getItemId());
+        String format = decimalFormat.format(otherTotalFee - otherLineDamages - otherBuildLoan - otherDesignFee - otherSupervisorFee);
+        if (format.equals("-0.00")) {
+            format = format.replace("-",  "");
+        }
+        otherActual.setManagementFunds(format);
+        otherActual.setSupervisionFee(decimalFormat.format(otherSupervisorFee));
+        otherActual.setDesignFee(decimalFormat.format(otherDesignFee));
+        otherActual.setLoanInterest(decimalFormat.format(otherBuildLoan));
+        otherActual.setDamages(decimalFormat.format(otherLineDamages));
+        otherActual.setTotal(decimalFormat.format(otherTotalFee));
+        otherActual.setDeduction(decimalFormat.format(deduction));
+        otherActual.setIncludingTax(decimalFormat.format(otherTotalFee + deduction));
+        /*OtherExpenses otherBudget = getScheduleBudget(schedule,erpCredit,maintainDataList);//得到预算合计费用
+        OtherExpenses otherActual = getScheduleActual(scheduleBudget,erpCredit);//得到实际费用
+        double addSubtractionLines = 0.0;//增加额
+        double addSubtractionRate1=0.0;//增减去率
+        //判断为空的条件
+        //如果实际合计金额为空 赋予初始值为0
+        if (null==schedule.getActualTotalFee()) {
+            schedule.setActualTotalFee("0");
+        }
+        //如果预算合计金额为空,赋予初始值0
+        if (null==schedule.getBudgetTotalFee()){
+            schedule.setBudgetTotalFee("0");
+        }
+        //增加率
+        addSubtractionLines=Double.parseDouble(schedule.getActualTotalFee())-Double.parseDouble(schedule.getBudgetTotalFee());
+        schedule.setAddSubtractionLines(decimalFormat.format(addSubtractionLines));//添加入郑家率
+        if (null==schedule.getBudgetTotalFee()) {//如果预算价值为空,赋初始值为1;
+            schedule.setAddSubtractionLines("1");
+        }
+        //计算增减率
+        addSubtractionRate1 = addSubtractionLines/Double.parseDouble(schedule.getBudgetTotalFee())*100;
+        schedule.setAddSubtractionRate(decimalFormat.format(addSubtractionRate1));*/
+        return otherActual;
+    }
+
+    private static Double getExDouble(Double otherSupervisorFee) {
+        if (null == otherSupervisorFee) {
+            otherSupervisorFee = 0.0;
+        }
+        return otherSupervisorFee;
+    }
+
+
     /**
      * 其他费用明细表 实际费用
      * @param erpCreditList
@@ -1094,6 +1151,74 @@ public class ExportUtilCalculate {
             }
         }
     }
+
+    /**
+     * 其 他 费 用 明 细 表
+     * @param erpCreditList
+     * @param maintainDataList
+     * @return
+     */
+    public static List<OtherExpenses> getOtherExpenses(List<ErpCredit> erpCreditList, List<MaintainData> maintainDataList){
+        DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
+        String itemNameAll="合计";//工程名称
+        Double managementFunds=0.0;//项目管理经费
+        Double supervisionFee=0.0;//监理费
+        Double designFee=0.0;//设计费
+        Double loanInterest=0.0;//贷款利息
+        Double damages=0.0;//赔偿费
+        Double total=0.0;//合计
+        Double deduction=0.0;//抵扣增值税
+        Double includingTax=0.0;//实际含税投资合计
+        OtherExpenses otherExpenses = new OtherExpenses();
+        List<OtherExpenses> otherExpensesList = new ArrayList<OtherExpenses>();
+        OtherExpenses expenses  = null;
+        if (null!=erpCreditList&&erpCreditList.size()>0){
+            for (ErpCredit erpCredit:erpCreditList){
+                expenses = new OtherExpenses();
+                expenses = getExpenses(expenses,erpCredit,maintainDataList);//得到一览表实际金额
+                otherExpensesList.add(expenses);
+            }
+        }
+        for (OtherExpenses s:otherExpensesList){
+            if (null!=s.getManagementFunds()){
+                managementFunds+=Double.parseDouble(s.getManagementFunds());
+                otherExpenses.setManagementFunds(decimalFormat.format(managementFunds));
+            }
+            if (null!=s.getSupervisionFee()){
+                supervisionFee+=Double.parseDouble(s.getSupervisionFee());
+                otherExpenses.setSupervisionFee(decimalFormat.format(supervisionFee));
+            }
+            if (null!=s.getDesignFee()){
+                designFee+=Double.parseDouble(s.getDesignFee());
+                otherExpenses.setDesignFee(decimalFormat.format(designFee));
+            }
+            if (null!=s.getLoanInterest()){
+                loanInterest+=Double.parseDouble(s.getLoanInterest());
+                otherExpenses.setLoanInterest(decimalFormat.format(loanInterest));
+            }
+            if (null!=s.getDamages()){
+                damages+=Double.parseDouble(s.getDamages());
+                otherExpenses.setDamages(decimalFormat.format(damages));
+            }
+            if (null!=s.getTotal()){
+                total+=Double.parseDouble(s.getTotal());
+                otherExpenses.setTotal(decimalFormat.format(total));
+            }
+            if (null!=s.getDeduction()){
+                deduction+=Double.parseDouble(s.getDeduction());
+                otherExpenses.setDeduction(decimalFormat.format(deduction));
+            }
+            if (null!=s.getIncludingTax()){
+                includingTax+=Double.parseDouble(s.getIncludingTax());
+                otherExpenses.setIncludingTax(decimalFormat.format(includingTax));
+            }
+        }
+        otherExpenses.setProjectName(itemNameAll);
+        otherExpensesList.add(otherExpenses);
+        return otherExpensesList;
+    }
+
+
     /*
         设备费统计
      */

BIN
src/main/resources/freemarker/excelmodel/completionModel.xlsx