Entity继承的问题
parent
58994ba1e6
commit
df5eb59d35
|
@ -1,129 +1,11 @@
|
|||
package cn.palmte.work.model;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 项目预算成本明细表
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "project_budget_cost_detail")
|
||||
public class ProjectBudgetCostDetail {
|
||||
public static final int TYPE_DEVICE = 1;
|
||||
public static final int TYPE_BUILD = 2;
|
||||
public static final int TYPE_SERVICE = 3;
|
||||
public static final int TYPE_OHTER = 4;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@GenericGenerator(name = "persistenceGenerator", strategy = "increment")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "project_id")
|
||||
private int projectId;
|
||||
|
||||
private int type;
|
||||
private int category;
|
||||
|
||||
private String name;
|
||||
|
||||
private String unit;
|
||||
private int amount;
|
||||
private BigDecimal price;
|
||||
|
||||
@Column(name = "tax_rate")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(int projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(int category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(int amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxRate() {
|
||||
return taxRate;
|
||||
}
|
||||
|
||||
public void setTaxRate(BigDecimal taxRate) {
|
||||
this.taxRate = taxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalTaxInclude(){
|
||||
if(null == price){
|
||||
return null;
|
||||
}
|
||||
return price.multiply(new BigDecimal(amount));
|
||||
}
|
||||
public BigDecimal getTotalTaxExclude(){
|
||||
BigDecimal totalTaxInclude = getTotalTaxInclude();
|
||||
if(null == totalTaxInclude || taxRate == null){
|
||||
return null;
|
||||
}
|
||||
|
||||
//不含税总金额=含税总金额/(1+税率)
|
||||
return totalTaxInclude.divide(taxRate.divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP).add(new BigDecimal(1)), 2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
public class ProjectBudgetCostDetail extends ProjectBudgetCostDetailBase{
|
||||
}
|
|
@ -0,0 +1,125 @@
|
|||
package cn.palmte.work.model;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@MappedSuperclass
|
||||
public class ProjectBudgetCostDetailBase {
|
||||
public static final int TYPE_DEVICE = 1;
|
||||
public static final int TYPE_BUILD = 2;
|
||||
public static final int TYPE_SERVICE = 3;
|
||||
public static final int TYPE_OHTER = 4;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@GenericGenerator(name = "persistenceGenerator", strategy = "increment")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "project_id")
|
||||
private int projectId;
|
||||
|
||||
private int type;
|
||||
private int category;
|
||||
|
||||
private String name;
|
||||
|
||||
private String unit;
|
||||
private int amount;
|
||||
private BigDecimal price;
|
||||
|
||||
@Column(name = "tax_rate")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(int projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(int category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(int amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxRate() {
|
||||
return taxRate;
|
||||
}
|
||||
|
||||
public void setTaxRate(BigDecimal taxRate) {
|
||||
this.taxRate = taxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalTaxInclude(){
|
||||
if(null == price){
|
||||
return null;
|
||||
}
|
||||
return price.multiply(new BigDecimal(amount));
|
||||
}
|
||||
public BigDecimal getTotalTaxExclude(){
|
||||
BigDecimal totalTaxInclude = getTotalTaxInclude();
|
||||
if(null == totalTaxInclude || taxRate == null){
|
||||
return null;
|
||||
}
|
||||
|
||||
//不含税总金额=含税总金额/(1+税率)
|
||||
return totalTaxInclude.divide(taxRate.divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP).add(new BigDecimal(1)), 2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
}
|
|
@ -9,7 +9,7 @@ import javax.persistence.Table;
|
|||
*/
|
||||
@Entity
|
||||
@Table(name = "project_budget_cost_detail_temp")
|
||||
public class ProjectBudgetCostDetailTemp extends ProjectBudgetCostDetail{
|
||||
public class ProjectBudgetCostDetailTemp extends ProjectBudgetCostDetailBase{
|
||||
public ProjectBudgetCostDetail toProjectBudgetCostDetail(){
|
||||
ProjectBudgetCostDetail detail = new ProjectBudgetCostDetail();
|
||||
detail.setProjectId(getProjectId());
|
||||
|
|
|
@ -1,151 +1,12 @@
|
|||
package cn.palmte.work.model;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 项目预算项目管理成本明细表
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "project_budget_cost_project_manage_detail")
|
||||
public class ProjectBudgetCostProjectManageDetail {
|
||||
public static final int TYPE_PERSON = 1;
|
||||
public static final int TYPE_BUSINESS = 2;
|
||||
public static final int TYPE_OHTER = 3;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@GenericGenerator(name = "persistenceGenerator", strategy = "increment")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "project_id")
|
||||
private int projectId;
|
||||
|
||||
private int type;
|
||||
|
||||
private String name;
|
||||
private String detail;
|
||||
|
||||
private String unit;
|
||||
private int amount;
|
||||
private BigDecimal price;
|
||||
|
||||
@Column(name = "predict_method")
|
||||
private String predictMethod;
|
||||
@Column(name = "predict_why")
|
||||
private String predictWhy;
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否可以被删除,有些项是默认的不可删除,用于页面判断是否显示删除按钮
|
||||
*/
|
||||
private int deletable;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(int projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(int amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public String getDetail() {
|
||||
return detail;
|
||||
}
|
||||
|
||||
public void setDetail(String detail) {
|
||||
this.detail = detail;
|
||||
}
|
||||
|
||||
public String getPredictMethod() {
|
||||
return predictMethod;
|
||||
}
|
||||
|
||||
public void setPredictMethod(String predictMethod) {
|
||||
this.predictMethod = predictMethod;
|
||||
}
|
||||
|
||||
public String getPredictWhy() {
|
||||
return predictWhy;
|
||||
}
|
||||
|
||||
public void setPredictWhy(String predictWhy) {
|
||||
this.predictWhy = predictWhy;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public BigDecimal getTotal(){
|
||||
if(null == price){
|
||||
return null;
|
||||
}
|
||||
return price.multiply(new BigDecimal(amount));
|
||||
}
|
||||
|
||||
public int getDeletable() {
|
||||
return deletable;
|
||||
}
|
||||
|
||||
public void setDeletable(int deletable) {
|
||||
this.deletable = deletable;
|
||||
}
|
||||
public class ProjectBudgetCostProjectManageDetail extends ProjectBudgetCostProjectManageDetailBase{
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
package cn.palmte.work.model;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@MappedSuperclass
|
||||
public class ProjectBudgetCostProjectManageDetailBase {
|
||||
public static final int TYPE_PERSON = 1;
|
||||
public static final int TYPE_BUSINESS = 2;
|
||||
public static final int TYPE_OHTER = 3;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@GenericGenerator(name = "persistenceGenerator", strategy = "increment")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "project_id")
|
||||
private int projectId;
|
||||
|
||||
private int type;
|
||||
|
||||
private String name;
|
||||
private String detail;
|
||||
|
||||
private String unit;
|
||||
private int amount;
|
||||
private BigDecimal price;
|
||||
|
||||
@Column(name = "predict_method")
|
||||
private String predictMethod;
|
||||
@Column(name = "predict_why")
|
||||
private String predictWhy;
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否可以被删除,有些项是默认的不可删除,用于页面判断是否显示删除按钮
|
||||
*/
|
||||
private int deletable;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(int projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(int amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public String getDetail() {
|
||||
return detail;
|
||||
}
|
||||
|
||||
public void setDetail(String detail) {
|
||||
this.detail = detail;
|
||||
}
|
||||
|
||||
public String getPredictMethod() {
|
||||
return predictMethod;
|
||||
}
|
||||
|
||||
public void setPredictMethod(String predictMethod) {
|
||||
this.predictMethod = predictMethod;
|
||||
}
|
||||
|
||||
public String getPredictWhy() {
|
||||
return predictWhy;
|
||||
}
|
||||
|
||||
public void setPredictWhy(String predictWhy) {
|
||||
this.predictWhy = predictWhy;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public BigDecimal getTotal(){
|
||||
if(null == price){
|
||||
return null;
|
||||
}
|
||||
return price.multiply(new BigDecimal(amount));
|
||||
}
|
||||
|
||||
public int getDeletable() {
|
||||
return deletable;
|
||||
}
|
||||
|
||||
public void setDeletable(int deletable) {
|
||||
this.deletable = deletable;
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@ import javax.persistence.*;
|
|||
*/
|
||||
@Entity
|
||||
@Table(name = "project_budget_cost_project_manage_detail_temp")
|
||||
public class ProjectBudgetCostProjectManageDetailTemp extends ProjectBudgetCostProjectManageDetail{
|
||||
public class ProjectBudgetCostProjectManageDetailTemp extends ProjectBudgetCostProjectManageDetailBase{
|
||||
public ProjectBudgetCostProjectManageDetail toProjectBudgetCostProjectManageDetail(){
|
||||
ProjectBudgetCostProjectManageDetail detail = new ProjectBudgetCostProjectManageDetail();
|
||||
detail.setProjectId(getProjectId());
|
||||
|
|
|
@ -1,120 +1,11 @@
|
|||
package cn.palmte.work.model;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 项目预算收入明细表
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "project_budget_income_detail")
|
||||
public class ProjectBudgetIncomeDetail {
|
||||
public static final int TYPE_DEVICE = 1;
|
||||
public static final int TYPE_ENGINEER = 2;
|
||||
public static final int TYPE_SERVICE = 3;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@GenericGenerator(name = "persistenceGenerator", strategy = "increment")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "project_id")
|
||||
private int projectId;
|
||||
|
||||
private int type;
|
||||
|
||||
private String name;
|
||||
|
||||
private String unit;
|
||||
private int amount;
|
||||
private BigDecimal price;
|
||||
|
||||
@Column(name = "tax_rate")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(int projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(int amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxRate() {
|
||||
return taxRate;
|
||||
}
|
||||
|
||||
public void setTaxRate(BigDecimal taxRate) {
|
||||
this.taxRate = taxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalTaxInclude(){
|
||||
if(null == price){
|
||||
return null;
|
||||
}
|
||||
return price.multiply(new BigDecimal(amount));
|
||||
}
|
||||
public BigDecimal getTotalTaxExclude(){
|
||||
BigDecimal totalTaxInclude = getTotalTaxInclude();
|
||||
if(null == totalTaxInclude || taxRate == null){
|
||||
return null;
|
||||
}
|
||||
|
||||
//不含税总金额=含税总金额/(1+税率)
|
||||
BigDecimal bigDecimal = taxRate.divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP).add(new BigDecimal(1));
|
||||
return totalTaxInclude.divide(bigDecimal, 2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
public class ProjectBudgetIncomeDetail extends ProjectBudgetIncomeDetailBase{
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
package cn.palmte.work.model;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@MappedSuperclass
|
||||
public class ProjectBudgetIncomeDetailBase {
|
||||
public static final int TYPE_DEVICE = 1;
|
||||
public static final int TYPE_ENGINEER = 2;
|
||||
public static final int TYPE_SERVICE = 3;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@GenericGenerator(name = "persistenceGenerator", strategy = "increment")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "project_id")
|
||||
private int projectId;
|
||||
|
||||
private int type;
|
||||
|
||||
private String name;
|
||||
|
||||
private String unit;
|
||||
private int amount;
|
||||
private BigDecimal price;
|
||||
|
||||
@Column(name = "tax_rate")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(int projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(int amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxRate() {
|
||||
return taxRate;
|
||||
}
|
||||
|
||||
public void setTaxRate(BigDecimal taxRate) {
|
||||
this.taxRate = taxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalTaxInclude(){
|
||||
if(null == price){
|
||||
return null;
|
||||
}
|
||||
return price.multiply(new BigDecimal(amount));
|
||||
}
|
||||
public BigDecimal getTotalTaxExclude(){
|
||||
BigDecimal totalTaxInclude = getTotalTaxInclude();
|
||||
if(null == totalTaxInclude || taxRate == null){
|
||||
return null;
|
||||
}
|
||||
|
||||
//不含税总金额=含税总金额/(1+税率)
|
||||
BigDecimal bigDecimal = taxRate.divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP).add(new BigDecimal(1));
|
||||
return totalTaxInclude.divide(bigDecimal, 2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@ import javax.persistence.Table;
|
|||
*/
|
||||
@Entity
|
||||
@Table(name = "project_budget_income_detail_temp")
|
||||
public class ProjectBudgetIncomeDetailTemp extends ProjectBudgetIncomeDetail{
|
||||
public class ProjectBudgetIncomeDetailTemp extends ProjectBudgetIncomeDetailBase{
|
||||
public ProjectBudgetIncomeDetail toProjectBudgetIncomeDetail(){
|
||||
ProjectBudgetIncomeDetail projectBudgetIncomeDetail = new ProjectBudgetIncomeDetail();
|
||||
projectBudgetIncomeDetail.setProjectId(getProjectId());
|
||||
|
|
|
@ -1,220 +1,11 @@
|
|||
package cn.palmte.work.model;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 资金计划明细表
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "project_budget_plan_detail")
|
||||
public class ProjectBudgetPlanDetail {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@GenericGenerator(name = "persistenceGenerator", strategy = "increment")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "project_id")
|
||||
private int projectId;
|
||||
|
||||
private String month;
|
||||
|
||||
/**
|
||||
* 设备支出
|
||||
*/
|
||||
@Column(name = "device_cost")
|
||||
private BigDecimal deviceCost;
|
||||
/**
|
||||
*工程支出
|
||||
*/
|
||||
@Column(name = "engineer_cost")
|
||||
private BigDecimal engineerCost;
|
||||
/**
|
||||
*经营性开支
|
||||
*/
|
||||
@Column(name = "project_manage_cost")
|
||||
private BigDecimal projectManageCost;
|
||||
/**
|
||||
*保证金支出
|
||||
*/
|
||||
@Column(name = "earnest_money_cost")
|
||||
private BigDecimal earnestMoneyCost;
|
||||
/**
|
||||
*支出合计
|
||||
*/
|
||||
@Column(name = "total_cost")
|
||||
private BigDecimal totalCost;
|
||||
/**
|
||||
*销售收款
|
||||
*/
|
||||
@Column(name = "sale_income")
|
||||
private BigDecimal saleIncome;
|
||||
/**
|
||||
*保证金收款
|
||||
*/
|
||||
@Column(name = "earnest_money_income")
|
||||
private BigDecimal earnestMoneyIncome;
|
||||
/**
|
||||
*收款合计
|
||||
*/
|
||||
@Column(name = "total_income")
|
||||
private BigDecimal totalIncome;
|
||||
/**
|
||||
*资金余额
|
||||
*/
|
||||
@Column(name = "fund_balance")
|
||||
private BigDecimal fundBalance;
|
||||
/**
|
||||
* 项目创建配置的年利率
|
||||
*/
|
||||
@Column(name = "underwritten_tax_rate")
|
||||
private BigDecimal underwrittenTaxRate;
|
||||
/**
|
||||
*资金利息
|
||||
*/
|
||||
@Column(name = "capital_interest")
|
||||
private BigDecimal capitalInterest;
|
||||
/**
|
||||
*垫资计划
|
||||
*/
|
||||
@Column(name = "underwritten_plan")
|
||||
private BigDecimal underwrittenPlan;
|
||||
/**
|
||||
*还款计划
|
||||
*/
|
||||
@Column(name = "repayment_plan")
|
||||
private BigDecimal repaymentPlan;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(int projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public String getMonth() {
|
||||
return month;
|
||||
}
|
||||
|
||||
public void setMonth(String month) {
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
public BigDecimal getDeviceCost() {
|
||||
return deviceCost;
|
||||
}
|
||||
|
||||
public void setDeviceCost(BigDecimal deviceCost) {
|
||||
this.deviceCost = deviceCost;
|
||||
}
|
||||
|
||||
public BigDecimal getEngineerCost() {
|
||||
return engineerCost;
|
||||
}
|
||||
|
||||
public void setEngineerCost(BigDecimal engineerCost) {
|
||||
this.engineerCost = engineerCost;
|
||||
}
|
||||
|
||||
public BigDecimal getProjectManageCost() {
|
||||
return projectManageCost;
|
||||
}
|
||||
|
||||
public void setProjectManageCost(BigDecimal projectManageCost) {
|
||||
this.projectManageCost = projectManageCost;
|
||||
}
|
||||
|
||||
public BigDecimal getEarnestMoneyCost() {
|
||||
return earnestMoneyCost;
|
||||
}
|
||||
|
||||
public void setEarnestMoneyCost(BigDecimal earnestMoneyCost) {
|
||||
this.earnestMoneyCost = earnestMoneyCost;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalCost() {
|
||||
return totalCost;
|
||||
}
|
||||
|
||||
public void setTotalCost(BigDecimal totalCost) {
|
||||
this.totalCost = totalCost;
|
||||
}
|
||||
|
||||
public BigDecimal getSaleIncome() {
|
||||
return saleIncome;
|
||||
}
|
||||
|
||||
public void setSaleIncome(BigDecimal saleIncome) {
|
||||
this.saleIncome = saleIncome;
|
||||
}
|
||||
|
||||
public BigDecimal getEarnestMoneyIncome() {
|
||||
return earnestMoneyIncome;
|
||||
}
|
||||
|
||||
public void setEarnestMoneyIncome(BigDecimal earnestMoneyIncome) {
|
||||
this.earnestMoneyIncome = earnestMoneyIncome;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalIncome() {
|
||||
return totalIncome;
|
||||
}
|
||||
|
||||
public void setTotalIncome(BigDecimal totalIncome) {
|
||||
this.totalIncome = totalIncome;
|
||||
}
|
||||
|
||||
public BigDecimal getFundBalance() {
|
||||
return fundBalance;
|
||||
}
|
||||
|
||||
public void setFundBalance(BigDecimal fundBalance) {
|
||||
this.fundBalance = fundBalance;
|
||||
}
|
||||
|
||||
public BigDecimal getUnderwrittenTaxRate() {
|
||||
return underwrittenTaxRate;
|
||||
}
|
||||
|
||||
public void setUnderwrittenTaxRate(BigDecimal underwrittenTaxRate) {
|
||||
this.underwrittenTaxRate = underwrittenTaxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getCapitalInterest() {
|
||||
return capitalInterest;
|
||||
}
|
||||
|
||||
public void setCapitalInterest(BigDecimal capitalInterest) {
|
||||
this.capitalInterest = capitalInterest;
|
||||
}
|
||||
|
||||
public BigDecimal getUnderwrittenPlan() {
|
||||
return underwrittenPlan;
|
||||
}
|
||||
|
||||
public void setUnderwrittenPlan(BigDecimal underwrittenPlan) {
|
||||
this.underwrittenPlan = underwrittenPlan;
|
||||
}
|
||||
|
||||
public BigDecimal getRepaymentPlan() {
|
||||
return repaymentPlan;
|
||||
}
|
||||
|
||||
public void setRepaymentPlan(BigDecimal repaymentPlan) {
|
||||
this.repaymentPlan = repaymentPlan;
|
||||
}
|
||||
public class ProjectBudgetPlanDetail extends ProjectBudgetPlanDetailBase{
|
||||
}
|
|
@ -0,0 +1,219 @@
|
|||
package cn.palmte.work.model;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 资金计划明细表
|
||||
*/
|
||||
@MappedSuperclass
|
||||
public class ProjectBudgetPlanDetailBase {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@GenericGenerator(name = "persistenceGenerator", strategy = "increment")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "project_id")
|
||||
private int projectId;
|
||||
|
||||
private String month;
|
||||
|
||||
/**
|
||||
* 设备支出
|
||||
*/
|
||||
@Column(name = "device_cost")
|
||||
private BigDecimal deviceCost;
|
||||
/**
|
||||
*工程支出
|
||||
*/
|
||||
@Column(name = "engineer_cost")
|
||||
private BigDecimal engineerCost;
|
||||
/**
|
||||
*经营性开支
|
||||
*/
|
||||
@Column(name = "project_manage_cost")
|
||||
private BigDecimal projectManageCost;
|
||||
/**
|
||||
*保证金支出
|
||||
*/
|
||||
@Column(name = "earnest_money_cost")
|
||||
private BigDecimal earnestMoneyCost;
|
||||
/**
|
||||
*支出合计
|
||||
*/
|
||||
@Column(name = "total_cost")
|
||||
private BigDecimal totalCost;
|
||||
/**
|
||||
*销售收款
|
||||
*/
|
||||
@Column(name = "sale_income")
|
||||
private BigDecimal saleIncome;
|
||||
/**
|
||||
*保证金收款
|
||||
*/
|
||||
@Column(name = "earnest_money_income")
|
||||
private BigDecimal earnestMoneyIncome;
|
||||
/**
|
||||
*收款合计
|
||||
*/
|
||||
@Column(name = "total_income")
|
||||
private BigDecimal totalIncome;
|
||||
/**
|
||||
*资金余额
|
||||
*/
|
||||
@Column(name = "fund_balance")
|
||||
private BigDecimal fundBalance;
|
||||
/**
|
||||
* 项目创建配置的年利率
|
||||
*/
|
||||
@Column(name = "underwritten_tax_rate")
|
||||
private BigDecimal underwrittenTaxRate;
|
||||
/**
|
||||
*资金利息
|
||||
*/
|
||||
@Column(name = "capital_interest")
|
||||
private BigDecimal capitalInterest;
|
||||
/**
|
||||
*垫资计划
|
||||
*/
|
||||
@Column(name = "underwritten_plan")
|
||||
private BigDecimal underwrittenPlan;
|
||||
/**
|
||||
*还款计划
|
||||
*/
|
||||
@Column(name = "repayment_plan")
|
||||
private BigDecimal repaymentPlan;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(int projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public String getMonth() {
|
||||
return month;
|
||||
}
|
||||
|
||||
public void setMonth(String month) {
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
public BigDecimal getDeviceCost() {
|
||||
return deviceCost;
|
||||
}
|
||||
|
||||
public void setDeviceCost(BigDecimal deviceCost) {
|
||||
this.deviceCost = deviceCost;
|
||||
}
|
||||
|
||||
public BigDecimal getEngineerCost() {
|
||||
return engineerCost;
|
||||
}
|
||||
|
||||
public void setEngineerCost(BigDecimal engineerCost) {
|
||||
this.engineerCost = engineerCost;
|
||||
}
|
||||
|
||||
public BigDecimal getProjectManageCost() {
|
||||
return projectManageCost;
|
||||
}
|
||||
|
||||
public void setProjectManageCost(BigDecimal projectManageCost) {
|
||||
this.projectManageCost = projectManageCost;
|
||||
}
|
||||
|
||||
public BigDecimal getEarnestMoneyCost() {
|
||||
return earnestMoneyCost;
|
||||
}
|
||||
|
||||
public void setEarnestMoneyCost(BigDecimal earnestMoneyCost) {
|
||||
this.earnestMoneyCost = earnestMoneyCost;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalCost() {
|
||||
return totalCost;
|
||||
}
|
||||
|
||||
public void setTotalCost(BigDecimal totalCost) {
|
||||
this.totalCost = totalCost;
|
||||
}
|
||||
|
||||
public BigDecimal getSaleIncome() {
|
||||
return saleIncome;
|
||||
}
|
||||
|
||||
public void setSaleIncome(BigDecimal saleIncome) {
|
||||
this.saleIncome = saleIncome;
|
||||
}
|
||||
|
||||
public BigDecimal getEarnestMoneyIncome() {
|
||||
return earnestMoneyIncome;
|
||||
}
|
||||
|
||||
public void setEarnestMoneyIncome(BigDecimal earnestMoneyIncome) {
|
||||
this.earnestMoneyIncome = earnestMoneyIncome;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalIncome() {
|
||||
return totalIncome;
|
||||
}
|
||||
|
||||
public void setTotalIncome(BigDecimal totalIncome) {
|
||||
this.totalIncome = totalIncome;
|
||||
}
|
||||
|
||||
public BigDecimal getFundBalance() {
|
||||
return fundBalance;
|
||||
}
|
||||
|
||||
public void setFundBalance(BigDecimal fundBalance) {
|
||||
this.fundBalance = fundBalance;
|
||||
}
|
||||
|
||||
public BigDecimal getUnderwrittenTaxRate() {
|
||||
return underwrittenTaxRate;
|
||||
}
|
||||
|
||||
public void setUnderwrittenTaxRate(BigDecimal underwrittenTaxRate) {
|
||||
this.underwrittenTaxRate = underwrittenTaxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getCapitalInterest() {
|
||||
return capitalInterest;
|
||||
}
|
||||
|
||||
public void setCapitalInterest(BigDecimal capitalInterest) {
|
||||
this.capitalInterest = capitalInterest;
|
||||
}
|
||||
|
||||
public BigDecimal getUnderwrittenPlan() {
|
||||
return underwrittenPlan;
|
||||
}
|
||||
|
||||
public void setUnderwrittenPlan(BigDecimal underwrittenPlan) {
|
||||
this.underwrittenPlan = underwrittenPlan;
|
||||
}
|
||||
|
||||
public BigDecimal getRepaymentPlan() {
|
||||
return repaymentPlan;
|
||||
}
|
||||
|
||||
public void setRepaymentPlan(BigDecimal repaymentPlan) {
|
||||
this.repaymentPlan = repaymentPlan;
|
||||
}
|
||||
}
|
|
@ -7,7 +7,7 @@ import javax.persistence.*;
|
|||
*/
|
||||
@Entity
|
||||
@Table(name = "project_budget_plan_detail_temp")
|
||||
public class ProjectBudgetPlanDetailTemp extends ProjectBudgetPlanDetail{
|
||||
public class ProjectBudgetPlanDetailTemp extends ProjectBudgetPlanDetailBase{
|
||||
public ProjectBudgetPlanDetail toProjectBudgetPlanDetail(){
|
||||
ProjectBudgetPlanDetail projectBudgetPlanDetail = new ProjectBudgetPlanDetail();
|
||||
projectBudgetPlanDetail.setProjectId(getProjectId());
|
||||
|
|
Loading…
Reference in New Issue