作者 wwmin

基金计算每年

  1 +package com.synthesize_energy.item.dto;
  2 +
  3 +import io.swagger.annotations.ApiModelProperty;
  4 +import lombok.Data;
  5 +
  6 +/**
  7 + * @auth wwmin
  8 + * @create 2020-11-19 17:37
  9 + **/
  10 +@Data
  11 +public class FundYearModel {
  12 + @ApiModelProperty("可抵扣进项税")
  13 + private Double deductionAddedTax;
  14 + @ApiModelProperty("应缴增值税")
  15 + private Double addedTax ;
  16 + @ApiModelProperty("税金及附加")
  17 + private Double taxAddAddition;
  18 +}
@@ -1924,10 +1924,18 @@ public class ProjectServiceImpl implements ProjectService { @@ -1924,10 +1924,18 @@ public class ProjectServiceImpl implements ProjectService {
1924 */ 1924 */
1925 @Override 1925 @Override
1926 public Map<String, Object> no_3_6GetList(String id) { 1926 public Map<String, Object> no_3_6GetList(String id) {
  1927 +
  1928 +
1927 Map<String, Object> map = new HashMap<>(4); 1929 Map<String, Object> map = new HashMap<>(4);
1928 Synthesize_no_3_6 synthesize_no_3_6 = synthesize_no_3_6Service.getById(id); 1930 Synthesize_no_3_6 synthesize_no_3_6 = synthesize_no_3_6Service.getById(id);
1929 Synthesize_no_2_6 synthesize_no_2_6 = synthesize_no_2_6Service.getById(id);// 典型值 1931 Synthesize_no_2_6 synthesize_no_2_6 = synthesize_no_2_6Service.getById(id);// 典型值
1930 Synthesize_no_2_5 synthesize_no_2_5 = synthesize_no_2_5Service.getById(id); // 税收优惠 1932 Synthesize_no_2_5 synthesize_no_2_5 = synthesize_no_2_5Service.getById(id); // 税收优惠
  1933 +
  1934 + //电费增值税率
  1935 + double electricAddedTax = 0.13;//synthesize_no_3_6.getNo64();//0.13
  1936 + //燃气、水费、供冷、供热等增值税率
  1937 + double otherAddedTax = 0.09;//后期可调成前台修改值
  1938 +
1931 Double otherIncome = 0.0; 1939 Double otherIncome = 0.0;
1932 if (!StringUtils.isEmpty(synthesize_no_2_5.getOtherMoney())) { 1940 if (!StringUtils.isEmpty(synthesize_no_2_5.getOtherMoney())) {
1933 otherIncome = synthesize_no_2_5.getOtherMoney(); 1941 otherIncome = synthesize_no_2_5.getOtherMoney();
@@ -1936,13 +1944,13 @@ public class ProjectServiceImpl implements ProjectService { @@ -1936,13 +1944,13 @@ public class ProjectServiceImpl implements ProjectService {
1936 * 年收入 (含税) 1944 * 年收入 (含税)
1937 * =供电收入+供热收入+供冷收入+热水收入 1945 * =供电收入+供热收入+供冷收入+热水收入
1938 */ 1946 */
1939 - double annualIncome = (Double.parseDouble(synthesize_no_3_6.getNo1()) + synthesize_no_3_6.getNo2() + synthesize_no_3_6.getNo3() + Double.parseDouble(synthesize_no_3_6.getNo4())) / 10000; 1947 + double annualIncome = (Double.parseDouble(synthesize_no_3_6.getNo1()) + electricAddedTax + synthesize_no_3_6.getNo3() + Double.parseDouble(synthesize_no_3_6.getNo4())) / 10000;
1940 /** 1948 /**
1941 * 原值 (收入不含税)= 1949 * 原值 (收入不含税)=
1942 * 年收入/(1+增值税率) 1950 * 年收入/(1+增值税率)
1943 */ 1951 */
1944 // double originalValue = annualIncome / (1 + synthesize_no_2_6.getNo64()); 1952 // double originalValue = annualIncome / (1 + synthesize_no_2_6.getNo64());
1945 - double originalValue = Double.parseDouble(synthesize_no_3_6.getNo1()) / 10000 / (1 + synthesize_no_2_6.getNo64()) + (synthesize_no_3_6.getNo2() + synthesize_no_3_6.getNo3() + Double.parseDouble(synthesize_no_3_6.getNo4())) / 10000 / (1 + 0.09); 1953 + double originalValue = Double.parseDouble(synthesize_no_3_6.getNo1()) / 10000 / (1 + electricAddedTax) + (synthesize_no_3_6.getNo2() + synthesize_no_3_6.getNo3() + Double.parseDouble(synthesize_no_3_6.getNo4())) / 10000 / (1 + otherAddedTax);
1946 /** 1954 /**
1947 * 年总运成本 1955 * 年总运成本
1948 * = 光伏单位运维*光伏容量+风电单位运维*风电容量+ 1956 * = 光伏单位运维*光伏容量+风电单位运维*风电容量+
@@ -2101,6 +2109,44 @@ public class ProjectServiceImpl implements ProjectService { @@ -2101,6 +2109,44 @@ public class ProjectServiceImpl implements ProjectService {
2101 return map; 2109 return map;
2102 } 2110 }
2103 2111
  2112 + /**
  2113 + * 计算增值税及附加税
  2114 + * 按年 调用
  2115 + */
  2116 + private static FundYearModel addedTax(int currentYear/*当前年*/, double annualElectricIncome, double annualHeatIncome, double annualColdIncome,
  2117 + double annualHotWaterIncome/*每年热水收入*/, double totalInvestment/*总投资*/, double annualElectricFee/*用电费*/, double annualFuelGasAndWaterFee/*燃气加水费*/, double beginDeductionAddedTax/*期初可抵扣进项税*/,double electricAddedTax,double otherAddedTax) {
  2118 + //税金及附加
  2119 + double taxAndAdditionRate = 0.12;
  2120 + //销项税
  2121 + double outputTax = annualElectricIncome / (1 + electricAddedTax) * electricAddedTax + (annualHeatIncome + annualColdIncome + annualHotWaterIncome) / (1 + otherAddedTax) * otherAddedTax;
  2122 + //当期新增进项税
  2123 + double currentAddedTax = 0.0;
  2124 + //建筑安装工程费占比
  2125 + double buildingInstallRate = 0.3;
  2126 + //设备费占比
  2127 + double facilityFeeRate = 0.4;
  2128 + if (currentYear == 0) {
  2129 + currentAddedTax = totalInvestment * buildingInstallRate / (1 + otherAddedTax) * otherAddedTax + totalInvestment * facilityFeeRate / (1 + electricAddedTax) * electricAddedTax;
  2130 + } else {
  2131 + currentAddedTax = annualElectricFee / (1 + electricAddedTax) * electricAddedTax + annualFuelGasAndWaterFee / (1 + otherAddedTax) * otherAddedTax;
  2132 + }
  2133 +
  2134 + //当期可抵扣进项税
  2135 + double currentDeductionAddedTax = 0.0;
  2136 + double minAddedTax = Math.min(currentAddedTax + currentAddedTax, outputTax);
  2137 + //期末可抵扣进项税
  2138 + double endDeductionAddedTax = beginDeductionAddedTax + currentAddedTax - minAddedTax;
  2139 + //应缴增值税
  2140 + double addedTax = outputTax - minAddedTax;
  2141 + //税金及附加
  2142 + double taxAndAddition =addedTax * taxAndAdditionRate;
  2143 + FundYearModel res = new FundYearModel();
  2144 + res.setDeductionAddedTax(endDeductionAddedTax);
  2145 + res.setAddedTax(addedTax);
  2146 + res.setTaxAddAddition(taxAndAddition);
  2147 + return res;
  2148 + }
  2149 +
2104 public static double irr(List<Double> values, double guess) { 2150 public static double irr(List<Double> values, double guess) {
2105 int maxIterationCount = 1000; 2151 int maxIterationCount = 1000;
2106 double absoluteAccuracy = 1.0E-007D; 2152 double absoluteAccuracy = 1.0E-007D;
1 spring: 1 spring:
2 profiles: 2 profiles:
3 #开发时使用下面注释 3 #开发时使用下面注释
4 -# active: dev 4 + active: dev
5 # 打包时使用下面注释 5 # 打包时使用下面注释
6 - active: dev2 6 +# active: dev2
7 7
8 8