概算页面和预算页面不同的处理方式
parent
c7f54029c9
commit
bb538620b0
|
@ -1,8 +1,17 @@
|
||||||
package cn.palmte.work.bean;
|
package cn.palmte.work.bean;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预算页面
|
* 预算页面
|
||||||
* @author xiongshiyan at 2021/11/1 , contact me with email yanshixiong@126.com or phone 15208384257
|
* @author xiongshiyan at 2021/11/1 , contact me with email yanshixiong@126.com or phone 15208384257
|
||||||
*/
|
*/
|
||||||
public class BudgetBean extends IncomeCostBean{
|
public class BudgetBean extends IncomeCostBean{
|
||||||
|
/**
|
||||||
|
* null就返回0
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected BigDecimal handleSpecial(BigDecimal src) {
|
||||||
|
return null == src ? new BigDecimal(0) : src;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,17 @@
|
||||||
package cn.palmte.work.bean;
|
package cn.palmte.work.bean;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 概算页面
|
* 概算页面
|
||||||
* @author xiongshiyan at 2021/11/1 , contact me with email yanshixiong@126.com or phone 15208384257
|
* @author xiongshiyan at 2021/11/1 , contact me with email yanshixiong@126.com or phone 15208384257
|
||||||
*/
|
*/
|
||||||
public class EstimateBean extends IncomeCostBean{
|
public class EstimateBean extends IncomeCostBean{
|
||||||
|
/**
|
||||||
|
* 原样返回
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected BigDecimal handleSpecial(BigDecimal src) {
|
||||||
|
return src;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import java.math.BigDecimal;
|
||||||
* 预算概算页面的公共属性
|
* 预算概算页面的公共属性
|
||||||
* @author xiongshiyan at 2021/11/1 , contact me with email yanshixiong@126.com or phone 15208384257
|
* @author xiongshiyan at 2021/11/1 , contact me with email yanshixiong@126.com or phone 15208384257
|
||||||
*/
|
*/
|
||||||
public class IncomeCostBean {
|
public abstract class IncomeCostBean {
|
||||||
/**
|
/**
|
||||||
* 设备类收入含税
|
* 设备类收入含税
|
||||||
*/
|
*/
|
||||||
|
@ -88,7 +88,7 @@ public class IncomeCostBean {
|
||||||
private BigDecimal costCompanyManageTaxExclude;
|
private BigDecimal costCompanyManageTaxExclude;
|
||||||
|
|
||||||
public BigDecimal getIncomeDeviceTaxInclude() {
|
public BigDecimal getIncomeDeviceTaxInclude() {
|
||||||
return incomeDeviceTaxInclude;
|
return handleSpecial(incomeDeviceTaxInclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIncomeDeviceTaxInclude(BigDecimal incomeDeviceTaxInclude) {
|
public void setIncomeDeviceTaxInclude(BigDecimal incomeDeviceTaxInclude) {
|
||||||
|
@ -96,7 +96,7 @@ public class IncomeCostBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getIncomeEngineerTaxInclude() {
|
public BigDecimal getIncomeEngineerTaxInclude() {
|
||||||
return incomeEngineerTaxInclude;
|
return handleSpecial(incomeEngineerTaxInclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIncomeEngineerTaxInclude(BigDecimal incomeEngineerTaxInclude) {
|
public void setIncomeEngineerTaxInclude(BigDecimal incomeEngineerTaxInclude) {
|
||||||
|
@ -104,7 +104,7 @@ public class IncomeCostBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getIncomeServiceTaxInclude() {
|
public BigDecimal getIncomeServiceTaxInclude() {
|
||||||
return incomeServiceTaxInclude;
|
return handleSpecial(incomeServiceTaxInclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIncomeServiceTaxInclude(BigDecimal incomeServiceTaxInclude) {
|
public void setIncomeServiceTaxInclude(BigDecimal incomeServiceTaxInclude) {
|
||||||
|
@ -112,7 +112,7 @@ public class IncomeCostBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getIncomeDeviceTaxExclude() {
|
public BigDecimal getIncomeDeviceTaxExclude() {
|
||||||
return incomeDeviceTaxExclude;
|
return handleSpecial(incomeDeviceTaxExclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIncomeDeviceTaxExclude(BigDecimal incomeDeviceTaxExclude) {
|
public void setIncomeDeviceTaxExclude(BigDecimal incomeDeviceTaxExclude) {
|
||||||
|
@ -120,7 +120,7 @@ public class IncomeCostBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getIncomeEngineerTaxExclude() {
|
public BigDecimal getIncomeEngineerTaxExclude() {
|
||||||
return incomeEngineerTaxExclude;
|
return handleSpecial(incomeEngineerTaxExclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIncomeEngineerTaxExclude(BigDecimal incomeEngineerTaxExclude) {
|
public void setIncomeEngineerTaxExclude(BigDecimal incomeEngineerTaxExclude) {
|
||||||
|
@ -128,7 +128,7 @@ public class IncomeCostBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getIncomeServiceTaxExclude() {
|
public BigDecimal getIncomeServiceTaxExclude() {
|
||||||
return incomeServiceTaxExclude;
|
return handleSpecial(incomeServiceTaxExclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIncomeServiceTaxExclude(BigDecimal incomeServiceTaxExclude) {
|
public void setIncomeServiceTaxExclude(BigDecimal incomeServiceTaxExclude) {
|
||||||
|
@ -136,7 +136,7 @@ public class IncomeCostBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getCostPurchaseDeviceTaxInclude() {
|
public BigDecimal getCostPurchaseDeviceTaxInclude() {
|
||||||
return costPurchaseDeviceTaxInclude;
|
return handleSpecial(costPurchaseDeviceTaxInclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCostPurchaseDeviceTaxInclude(BigDecimal costPurchaseDeviceTaxInclude) {
|
public void setCostPurchaseDeviceTaxInclude(BigDecimal costPurchaseDeviceTaxInclude) {
|
||||||
|
@ -144,7 +144,7 @@ public class IncomeCostBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getCostPurchaseBuildTaxInclude() {
|
public BigDecimal getCostPurchaseBuildTaxInclude() {
|
||||||
return costPurchaseBuildTaxInclude;
|
return handleSpecial(costPurchaseBuildTaxInclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCostPurchaseBuildTaxInclude(BigDecimal costPurchaseBuildTaxInclude) {
|
public void setCostPurchaseBuildTaxInclude(BigDecimal costPurchaseBuildTaxInclude) {
|
||||||
|
@ -152,7 +152,7 @@ public class IncomeCostBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getCostPurchaseServiceTaxInclude() {
|
public BigDecimal getCostPurchaseServiceTaxInclude() {
|
||||||
return costPurchaseServiceTaxInclude;
|
return handleSpecial(costPurchaseServiceTaxInclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCostPurchaseServiceTaxInclude(BigDecimal costPurchaseServiceTaxInclude) {
|
public void setCostPurchaseServiceTaxInclude(BigDecimal costPurchaseServiceTaxInclude) {
|
||||||
|
@ -169,14 +169,14 @@ public class IncomeCostBean {
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
public BigDecimal getCostPurchaseOtherTaxInclude() {
|
public BigDecimal getCostPurchaseOtherTaxInclude() {
|
||||||
return costPurchaseOtherTaxInclude;
|
return handleSpecial(costPurchaseOtherTaxInclude);
|
||||||
}
|
}
|
||||||
public void setCostPurchaseOtherTaxInclude(BigDecimal costPurchaseOtherTaxInclude) {
|
public void setCostPurchaseOtherTaxInclude(BigDecimal costPurchaseOtherTaxInclude) {
|
||||||
this.costPurchaseOtherTaxInclude = costPurchaseOtherTaxInclude;
|
this.costPurchaseOtherTaxInclude = costPurchaseOtherTaxInclude;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getCostOtherOtherTaxInclude() {
|
public BigDecimal getCostOtherOtherTaxInclude() {
|
||||||
return costOtherOtherTaxInclude;
|
return handleSpecial(costOtherOtherTaxInclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCostOtherOtherTaxInclude(BigDecimal costOtherOtherTaxInclude) {
|
public void setCostOtherOtherTaxInclude(BigDecimal costOtherOtherTaxInclude) {
|
||||||
|
@ -184,7 +184,7 @@ public class IncomeCostBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getCostPurchaseDeviceTaxExclude() {
|
public BigDecimal getCostPurchaseDeviceTaxExclude() {
|
||||||
return costPurchaseDeviceTaxExclude;
|
return handleSpecial(costPurchaseDeviceTaxExclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCostPurchaseDeviceTaxExclude(BigDecimal costPurchaseDeviceTaxExclude) {
|
public void setCostPurchaseDeviceTaxExclude(BigDecimal costPurchaseDeviceTaxExclude) {
|
||||||
|
@ -192,7 +192,7 @@ public class IncomeCostBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getCostPurchaseBuildTaxExclude() {
|
public BigDecimal getCostPurchaseBuildTaxExclude() {
|
||||||
return costPurchaseBuildTaxExclude;
|
return handleSpecial(costPurchaseBuildTaxExclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCostPurchaseBuildTaxExclude(BigDecimal costPurchaseBuildTaxExclude) {
|
public void setCostPurchaseBuildTaxExclude(BigDecimal costPurchaseBuildTaxExclude) {
|
||||||
|
@ -200,7 +200,7 @@ public class IncomeCostBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getCostPurchaseServiceTaxExclude() {
|
public BigDecimal getCostPurchaseServiceTaxExclude() {
|
||||||
return costPurchaseServiceTaxExclude;
|
return handleSpecial(costPurchaseServiceTaxExclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCostPurchaseServiceTaxExclude(BigDecimal costPurchaseServiceTaxExclude) {
|
public void setCostPurchaseServiceTaxExclude(BigDecimal costPurchaseServiceTaxExclude) {
|
||||||
|
@ -208,7 +208,7 @@ public class IncomeCostBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getCostPurchaseOtherTaxExclude() {
|
public BigDecimal getCostPurchaseOtherTaxExclude() {
|
||||||
return costPurchaseOtherTaxExclude;
|
return handleSpecial(costPurchaseOtherTaxExclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCostPurchaseOtherTaxExclude(BigDecimal costPurchaseOtherTaxExclude) {
|
public void setCostPurchaseOtherTaxExclude(BigDecimal costPurchaseOtherTaxExclude) {
|
||||||
|
@ -216,7 +216,7 @@ public class IncomeCostBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getCostProjectManageTaxExclude() {
|
public BigDecimal getCostProjectManageTaxExclude() {
|
||||||
return costProjectManageTaxExclude;
|
return handleSpecial(costProjectManageTaxExclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCostProjectManageTaxExclude(BigDecimal costProjectManageTaxExclude) {
|
public void setCostProjectManageTaxExclude(BigDecimal costProjectManageTaxExclude) {
|
||||||
|
@ -224,7 +224,7 @@ public class IncomeCostBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getCostOtherOtherTaxExclude() {
|
public BigDecimal getCostOtherOtherTaxExclude() {
|
||||||
return costOtherOtherTaxExclude;
|
return handleSpecial(costOtherOtherTaxExclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCostOtherOtherTaxExclude(BigDecimal costOtherOtherTaxExclude) {
|
public void setCostOtherOtherTaxExclude(BigDecimal costOtherOtherTaxExclude) {
|
||||||
|
@ -233,7 +233,7 @@ public class IncomeCostBean {
|
||||||
|
|
||||||
|
|
||||||
public BigDecimal getCostExpropriationTaxExclude() {
|
public BigDecimal getCostExpropriationTaxExclude() {
|
||||||
return costExpropriationTaxExclude;
|
return handleSpecial(costExpropriationTaxExclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCostExpropriationTaxExclude(BigDecimal costExpropriationTaxExclude) {
|
public void setCostExpropriationTaxExclude(BigDecimal costExpropriationTaxExclude) {
|
||||||
|
@ -241,7 +241,7 @@ public class IncomeCostBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getCostCompanyManageTaxExclude() {
|
public BigDecimal getCostCompanyManageTaxExclude() {
|
||||||
return costCompanyManageTaxExclude;
|
return handleSpecial(costCompanyManageTaxExclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCostCompanyManageTaxExclude(BigDecimal costCompanyManageTaxExclude) {
|
public void setCostCompanyManageTaxExclude(BigDecimal costCompanyManageTaxExclude) {
|
||||||
|
@ -253,8 +253,11 @@ public class IncomeCostBean {
|
||||||
* 计算所有的含税收入
|
* 计算所有的含税收入
|
||||||
*/
|
*/
|
||||||
public BigDecimal getIncomeTotalTaxInclude() {
|
public BigDecimal getIncomeTotalTaxInclude() {
|
||||||
|
BigDecimal incomeDeviceTaxInclude = getIncomeDeviceTaxInclude();
|
||||||
|
BigDecimal incomeEngineerTaxInclude = getIncomeEngineerTaxInclude();
|
||||||
|
BigDecimal incomeServiceTaxInclude = getIncomeServiceTaxInclude();
|
||||||
if(null == incomeDeviceTaxInclude || null == incomeEngineerTaxInclude || null == incomeServiceTaxInclude){
|
if(null == incomeDeviceTaxInclude || null == incomeEngineerTaxInclude || null == incomeServiceTaxInclude){
|
||||||
return null;
|
return handleSpecial(null);
|
||||||
}
|
}
|
||||||
return incomeDeviceTaxInclude.add(incomeEngineerTaxInclude)
|
return incomeDeviceTaxInclude.add(incomeEngineerTaxInclude)
|
||||||
.add(incomeServiceTaxInclude);
|
.add(incomeServiceTaxInclude);
|
||||||
|
@ -264,8 +267,11 @@ public class IncomeCostBean {
|
||||||
* 计算所有的不含税收入
|
* 计算所有的不含税收入
|
||||||
*/
|
*/
|
||||||
public BigDecimal getIncomeTotalTaxExclude() {
|
public BigDecimal getIncomeTotalTaxExclude() {
|
||||||
if(null == incomeDeviceTaxExclude || null == incomeEngineerTaxExclude || null ==incomeServiceTaxExclude){
|
BigDecimal incomeDeviceTaxExclude = getIncomeDeviceTaxExclude();
|
||||||
return null;
|
BigDecimal incomeEngineerTaxExclude = getIncomeEngineerTaxExclude();
|
||||||
|
BigDecimal incomeServiceTaxExclude = getIncomeServiceTaxExclude();
|
||||||
|
if(null == incomeDeviceTaxExclude || null == incomeEngineerTaxExclude || null == incomeServiceTaxExclude){
|
||||||
|
return handleSpecial(null);
|
||||||
}
|
}
|
||||||
return incomeDeviceTaxExclude.add(incomeEngineerTaxExclude)
|
return incomeDeviceTaxExclude.add(incomeEngineerTaxExclude)
|
||||||
.add(incomeServiceTaxExclude);
|
.add(incomeServiceTaxExclude);
|
||||||
|
@ -275,13 +281,18 @@ public class IncomeCostBean {
|
||||||
* 计算所有的成本含税
|
* 计算所有的成本含税
|
||||||
*/
|
*/
|
||||||
public BigDecimal getCostTotalTaxInclude() {
|
public BigDecimal getCostTotalTaxInclude() {
|
||||||
|
BigDecimal costPurchaseDeviceTaxInclude = getCostPurchaseDeviceTaxInclude();
|
||||||
|
BigDecimal costPurchaseBuildTaxInclude = getCostPurchaseBuildTaxInclude();
|
||||||
|
BigDecimal costPurchaseServiceTaxInclude = getCostPurchaseServiceTaxInclude();
|
||||||
|
BigDecimal costPurchaseOtherTaxInclude = getCostPurchaseOtherTaxInclude();
|
||||||
|
BigDecimal costOtherOtherTaxInclude = getCostOtherOtherTaxInclude();
|
||||||
if(null == costPurchaseDeviceTaxInclude
|
if(null == costPurchaseDeviceTaxInclude
|
||||||
|| null == costPurchaseBuildTaxInclude
|
|| null == costPurchaseBuildTaxInclude
|
||||||
|| null == costPurchaseServiceTaxInclude
|
|| null == costPurchaseServiceTaxInclude
|
||||||
|| null == costPurchaseOtherTaxInclude
|
|| null == costPurchaseOtherTaxInclude
|
||||||
/*|| null == costProjectManageTaxInclude*/
|
/*|| null == costProjectManageTaxInclude*/
|
||||||
|| null == costOtherOtherTaxInclude){
|
|| null == costOtherOtherTaxInclude){
|
||||||
return null;
|
return handleSpecial(null);
|
||||||
}
|
}
|
||||||
return costPurchaseDeviceTaxInclude
|
return costPurchaseDeviceTaxInclude
|
||||||
.add(costPurchaseBuildTaxInclude)
|
.add(costPurchaseBuildTaxInclude)
|
||||||
|
@ -295,13 +306,19 @@ public class IncomeCostBean {
|
||||||
* 计算所有的成本不含税
|
* 计算所有的成本不含税
|
||||||
*/
|
*/
|
||||||
public BigDecimal getCostTotalTaxExclude() {
|
public BigDecimal getCostTotalTaxExclude() {
|
||||||
|
BigDecimal costPurchaseDeviceTaxExclude = getCostPurchaseDeviceTaxExclude();
|
||||||
|
BigDecimal costPurchaseBuildTaxExclude = getCostPurchaseBuildTaxExclude();
|
||||||
|
BigDecimal costPurchaseServiceTaxExclude = getCostPurchaseServiceTaxExclude();
|
||||||
|
BigDecimal costPurchaseOtherTaxExclude = getCostPurchaseOtherTaxExclude();
|
||||||
|
BigDecimal costProjectManageTaxExclude = getCostProjectManageTaxExclude();
|
||||||
|
BigDecimal costOtherOtherTaxExclude = getCostOtherOtherTaxExclude();
|
||||||
if(null == costPurchaseDeviceTaxExclude
|
if(null == costPurchaseDeviceTaxExclude
|
||||||
|| null == costPurchaseBuildTaxExclude
|
|| null == costPurchaseBuildTaxExclude
|
||||||
|| null == costPurchaseServiceTaxExclude
|
|| null == costPurchaseServiceTaxExclude
|
||||||
|| null == costPurchaseOtherTaxExclude
|
|| null == costPurchaseOtherTaxExclude
|
||||||
|| null == costProjectManageTaxExclude
|
|| null == costProjectManageTaxExclude
|
||||||
|| null == costOtherOtherTaxExclude){
|
|| null == costOtherOtherTaxExclude){
|
||||||
return null;
|
return handleSpecial(null);
|
||||||
}
|
}
|
||||||
return costPurchaseDeviceTaxExclude.add(costPurchaseBuildTaxExclude)
|
return costPurchaseDeviceTaxExclude.add(costPurchaseBuildTaxExclude)
|
||||||
.add(costPurchaseServiceTaxExclude)
|
.add(costPurchaseServiceTaxExclude)
|
||||||
|
@ -319,9 +336,11 @@ public class IncomeCostBean {
|
||||||
BigDecimal costTotalTaxExclude = getCostTotalTaxExclude();
|
BigDecimal costTotalTaxExclude = getCostTotalTaxExclude();
|
||||||
BigDecimal costExpropriationTaxExclude = getCostExpropriationTaxExclude();
|
BigDecimal costExpropriationTaxExclude = getCostExpropriationTaxExclude();
|
||||||
if(null == incomeTotalTaxExclude || null == costTotalTaxExclude || null == costExpropriationTaxExclude){
|
if(null == incomeTotalTaxExclude || null == costTotalTaxExclude || null == costExpropriationTaxExclude){
|
||||||
return null;
|
return handleSpecial(null);
|
||||||
}
|
}
|
||||||
return incomeTotalTaxExclude.subtract(costTotalTaxExclude).subtract(costExpropriationTaxExclude);
|
return incomeTotalTaxExclude
|
||||||
|
.subtract(costTotalTaxExclude)
|
||||||
|
.subtract(costExpropriationTaxExclude);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -332,9 +351,15 @@ public class IncomeCostBean {
|
||||||
BigDecimal projectGrossProfit = getProjectGrossProfit();
|
BigDecimal projectGrossProfit = getProjectGrossProfit();
|
||||||
BigDecimal incomeTotalTaxExclude = getIncomeTotalTaxExclude();
|
BigDecimal incomeTotalTaxExclude = getIncomeTotalTaxExclude();
|
||||||
if(null == projectGrossProfit || null == incomeTotalTaxExclude){
|
if(null == projectGrossProfit || null == incomeTotalTaxExclude){
|
||||||
return null;
|
return handleSpecial(null);
|
||||||
}
|
}
|
||||||
return projectGrossProfit.multiply(new BigDecimal(100)).divide(incomeTotalTaxExclude,2,BigDecimal.ROUND_HALF_UP);
|
BigDecimal zero = new BigDecimal(0);
|
||||||
|
if(projectGrossProfit.compareTo(zero) == 0 || incomeTotalTaxExclude.compareTo(zero) == 0){
|
||||||
|
return handleSpecial(null);
|
||||||
|
}
|
||||||
|
return projectGrossProfit
|
||||||
|
.multiply(new BigDecimal(100))
|
||||||
|
.divide(incomeTotalTaxExclude,2,BigDecimal.ROUND_HALF_UP);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -357,8 +382,22 @@ public class IncomeCostBean {
|
||||||
BigDecimal projectContributionProfit = getProjectContributionProfit();
|
BigDecimal projectContributionProfit = getProjectContributionProfit();
|
||||||
BigDecimal incomeTotalTaxExclude = getIncomeTotalTaxExclude();
|
BigDecimal incomeTotalTaxExclude = getIncomeTotalTaxExclude();
|
||||||
if(null == projectContributionProfit || null == incomeTotalTaxExclude){
|
if(null == projectContributionProfit || null == incomeTotalTaxExclude){
|
||||||
return null;
|
return handleSpecial(null);
|
||||||
}
|
}
|
||||||
return projectContributionProfit.multiply(new BigDecimal(100)).divide(incomeTotalTaxExclude, 2,BigDecimal.ROUND_HALF_UP);
|
BigDecimal zero = new BigDecimal(0);
|
||||||
|
if(projectContributionProfit.compareTo(zero) == 0 || incomeTotalTaxExclude.compareTo(zero) == 0){
|
||||||
|
return handleSpecial(null);
|
||||||
}
|
}
|
||||||
|
return projectContributionProfit
|
||||||
|
.multiply(new BigDecimal(100))
|
||||||
|
.divide(incomeTotalTaxExclude, 2,BigDecimal.ROUND_HALF_UP);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对null值如何处理
|
||||||
|
* @param src 原值
|
||||||
|
* @return 特殊处理之后的值
|
||||||
|
*/
|
||||||
|
protected abstract BigDecimal handleSpecial(BigDecimal src);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue