Merge branch 'temp'
commit
3f406e603b
|
@ -36,6 +36,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||||
@RequestMapping("/project")
|
@RequestMapping("/project")
|
||||||
public class ProjectController extends BaseController {
|
public class ProjectController extends BaseController {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ProjectController.class);
|
private static final Logger logger = LoggerFactory.getLogger(ProjectController.class);
|
||||||
|
private static final String PROJECT_ID = "projectId";
|
||||||
|
private static final String DETAILS = "details";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DeptService deptService;
|
private DeptService deptService;
|
||||||
|
@ -230,16 +232,16 @@ public class ProjectController extends BaseController {
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ResponseMsg budgetEditSaveIncomeDetail(@RequestBody String body) {
|
public ResponseMsg budgetEditSaveIncomeDetail(@RequestBody String body) {
|
||||||
JSONObject jsonObject = JSON.parseObject(body);
|
JSONObject jsonObject = JSON.parseObject(body);
|
||||||
JSONArray details = jsonObject.getJSONArray("details");
|
JSONArray details = jsonObject.getJSONArray(DETAILS);
|
||||||
List<ProjectBudgetIncomeDetail> detailList = new ArrayList<>(details.size());
|
List<ProjectBudgetIncomeDetailTemp> detailList = new ArrayList<>(details.size());
|
||||||
for (int i = 0; i < details.size(); i++) {
|
for (int i = 0; i < details.size(); i++) {
|
||||||
ProjectBudgetIncomeDetail detail = details.getObject(i, ProjectBudgetIncomeDetail.class);
|
ProjectBudgetIncomeDetailTemp detail = details.getObject(i, ProjectBudgetIncomeDetailTemp.class);
|
||||||
detailList.add(detail);
|
detailList.add(detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
Project project = projectService.getProject(jsonObject.getInteger("projectId"));
|
Project project = projectService.getProject(jsonObject.getInteger(PROJECT_ID));
|
||||||
|
|
||||||
projectBudgetService.saveBudgetIncomeDetail(project, detailList);
|
projectBudgetService.saveBudgetIncomeDetailTemp(project, detailList);
|
||||||
|
|
||||||
return ResponseMsg.buildSuccessMsg("成功");
|
return ResponseMsg.buildSuccessMsg("成功");
|
||||||
}
|
}
|
||||||
|
@ -251,16 +253,16 @@ public class ProjectController extends BaseController {
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ResponseMsg budgetEditSaveCostDetail(@RequestBody String body) {
|
public ResponseMsg budgetEditSaveCostDetail(@RequestBody String body) {
|
||||||
JSONObject jsonObject = JSON.parseObject(body);
|
JSONObject jsonObject = JSON.parseObject(body);
|
||||||
JSONArray details = jsonObject.getJSONArray("details");
|
JSONArray details = jsonObject.getJSONArray(DETAILS);
|
||||||
List<ProjectBudgetCostDetail> detailList = new ArrayList<>(details.size());
|
List<ProjectBudgetCostDetailTemp> detailList = new ArrayList<>(details.size());
|
||||||
for (int i = 0; i < details.size(); i++) {
|
for (int i = 0; i < details.size(); i++) {
|
||||||
ProjectBudgetCostDetail detail = details.getObject(i, ProjectBudgetCostDetail.class);
|
ProjectBudgetCostDetailTemp detail = details.getObject(i, ProjectBudgetCostDetailTemp.class);
|
||||||
detailList.add(detail);
|
detailList.add(detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
Project project = projectService.getProject(jsonObject.getInteger("projectId"));
|
Project project = projectService.getProject(jsonObject.getInteger(PROJECT_ID));
|
||||||
|
|
||||||
projectBudgetService.saveBudgetCostDetail(project, detailList);
|
projectBudgetService.saveBudgetCostDetailTemp(project, detailList);
|
||||||
|
|
||||||
return ResponseMsg.buildSuccessMsg("成功");
|
return ResponseMsg.buildSuccessMsg("成功");
|
||||||
}
|
}
|
||||||
|
@ -272,16 +274,16 @@ public class ProjectController extends BaseController {
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ResponseMsg budgetEditSaveCostProjectManageDetail(@RequestBody String body) {
|
public ResponseMsg budgetEditSaveCostProjectManageDetail(@RequestBody String body) {
|
||||||
JSONObject jsonObject = JSON.parseObject(body);
|
JSONObject jsonObject = JSON.parseObject(body);
|
||||||
JSONArray details = jsonObject.getJSONArray("details");
|
JSONArray details = jsonObject.getJSONArray(DETAILS);
|
||||||
List<ProjectBudgetCostProjectManageDetail> detailList = new ArrayList<>(details.size());
|
List<ProjectBudgetCostProjectManageDetailTemp> detailList = new ArrayList<>(details.size());
|
||||||
for (int i = 0; i < details.size(); i++) {
|
for (int i = 0; i < details.size(); i++) {
|
||||||
ProjectBudgetCostProjectManageDetail detail = details.getObject(i, ProjectBudgetCostProjectManageDetail.class);
|
ProjectBudgetCostProjectManageDetailTemp detail = details.getObject(i, ProjectBudgetCostProjectManageDetailTemp.class);
|
||||||
detailList.add(detail);
|
detailList.add(detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
Project project = projectService.getProject(jsonObject.getInteger("projectId"));
|
Project project = projectService.getProject(jsonObject.getInteger(PROJECT_ID));
|
||||||
|
|
||||||
projectBudgetService.saveBudgetCostProjectManageDetail(project, detailList);
|
projectBudgetService.saveBudgetCostProjectManageDetailTemp(project, detailList);
|
||||||
|
|
||||||
return ResponseMsg.buildSuccessMsg("成功");
|
return ResponseMsg.buildSuccessMsg("成功");
|
||||||
}
|
}
|
||||||
|
@ -293,16 +295,16 @@ public class ProjectController extends BaseController {
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ResponseMsg budgetEditSaveBudgetPlanDetail(@RequestBody String body) {
|
public ResponseMsg budgetEditSaveBudgetPlanDetail(@RequestBody String body) {
|
||||||
JSONObject jsonObject = JSON.parseObject(body);
|
JSONObject jsonObject = JSON.parseObject(body);
|
||||||
JSONArray details = jsonObject.getJSONArray("details");
|
JSONArray details = jsonObject.getJSONArray(DETAILS);
|
||||||
List<ProjectBudgetPlanDetail> detailList = new ArrayList<>(details.size());
|
List<ProjectBudgetPlanDetailTemp> detailList = new ArrayList<>(details.size());
|
||||||
for (int i = 0; i < details.size(); i++) {
|
for (int i = 0; i < details.size(); i++) {
|
||||||
ProjectBudgetPlanDetail detail = details.getObject(i, ProjectBudgetPlanDetail.class);
|
ProjectBudgetPlanDetailTemp detail = details.getObject(i, ProjectBudgetPlanDetailTemp.class);
|
||||||
detailList.add(detail);
|
detailList.add(detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
Project project = projectService.getProject(jsonObject.getInteger("projectId"));
|
Project project = projectService.getProject(jsonObject.getInteger(PROJECT_ID));
|
||||||
|
|
||||||
projectBudgetService.saveBudgetPlanDetail(project, detailList);
|
projectBudgetService.saveBudgetPlanDetailTemp(project, detailList);
|
||||||
|
|
||||||
return ResponseMsg.buildSuccessMsg("成功");
|
return ResponseMsg.buildSuccessMsg("成功");
|
||||||
}
|
}
|
||||||
|
@ -426,7 +428,7 @@ public class ProjectController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/taskRecords/{projectId}")
|
@RequestMapping("/taskRecords/{projectId}")
|
||||||
public String taskRecords(@PathVariable int projectId, Map<String, Object> model) {
|
public String taskRecords(@PathVariable int projectId, Map<String, Object> model) {
|
||||||
model.put("projectId", projectId);
|
model.put(PROJECT_ID, projectId);
|
||||||
List<ProjectTaskRecord> list = projectTaskRecordService.list(projectId);
|
List<ProjectTaskRecord> list = projectTaskRecordService.list(projectId);
|
||||||
if (list != null && !list.isEmpty()) {
|
if (list != null && !list.isEmpty()) {
|
||||||
model.put("list", list);
|
model.put("list", list);
|
||||||
|
@ -452,7 +454,7 @@ public class ProjectController extends BaseController {
|
||||||
* 流程实列图片
|
* 流程实列图片
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/procInsPng/{projectId}")
|
@RequestMapping("/procInsPng/{projectId}")
|
||||||
public void png(HttpServletResponse response, @PathVariable("projectId") int projectId) throws Exception {
|
public void png(HttpServletResponse response, @PathVariable(PROJECT_ID) int projectId) throws Exception {
|
||||||
List<ProjectInstanceRelation> relationList = projectInstanceRelationRepository.findByProjectIdOrderByCreateTimeDesc(projectId);
|
List<ProjectInstanceRelation> relationList = projectInstanceRelationRepository.findByProjectIdOrderByCreateTimeDesc(projectId);
|
||||||
if (relationList == null || relationList.isEmpty()) {
|
if (relationList == null || relationList.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
|
@ -499,7 +501,7 @@ public class ProjectController extends BaseController {
|
||||||
{ id:22, pId:2, name:"随意勾选 2-2", open:true},
|
{ id:22, pId:2, name:"随意勾选 2-2", open:true},
|
||||||
{ id:23, pId:2, name:"随意勾选 2-3"}*/
|
{ id:23, pId:2, name:"随意勾选 2-3"}*/
|
||||||
JSONObject jsonObject = JSON.parseObject(body);
|
JSONObject jsonObject = JSON.parseObject(body);
|
||||||
Integer projectId = jsonObject.getInteger("projectId");
|
Integer projectId = jsonObject.getInteger(PROJECT_ID);
|
||||||
JSONArray array = jsonObject.getJSONArray("ids");
|
JSONArray array = jsonObject.getJSONArray("ids");
|
||||||
String[] ids = new String[array.size()];
|
String[] ids = new String[array.size()];
|
||||||
for (int i = 0; i < array.size(); i++) {
|
for (int i = 0; i < array.size(); i++) {
|
||||||
|
|
|
@ -1,129 +1,11 @@
|
||||||
package cn.palmte.work.model;
|
package cn.palmte.work.model;
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目预算成本明细表
|
* 项目预算成本明细表
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "project_budget_cost_detail")
|
@Table(name = "project_budget_cost_detail")
|
||||||
public class ProjectBudgetCostDetail {
|
public class ProjectBudgetCostDetail extends 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);
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package cn.palmte.work.model;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预算成本明细临时表
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "project_budget_cost_detail_temp")
|
||||||
|
public class ProjectBudgetCostDetailTemp extends ProjectBudgetCostDetailBase{
|
||||||
|
public ProjectBudgetCostDetail toProjectBudgetCostDetail(){
|
||||||
|
ProjectBudgetCostDetail detail = new ProjectBudgetCostDetail();
|
||||||
|
detail.setProjectId(getProjectId());
|
||||||
|
detail.setType(getType());
|
||||||
|
detail.setCategory(getCategory());
|
||||||
|
detail.setName(getName());
|
||||||
|
detail.setUnit(getUnit());
|
||||||
|
detail.setAmount(getAmount());
|
||||||
|
detail.setPrice(getPrice());
|
||||||
|
detail.setTaxRate(getTaxRate());
|
||||||
|
return detail;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package cn.palmte.work.model;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ProjectBudgetCostDetailTempRepository extends JpaRepository<ProjectBudgetCostDetailTemp,Integer> {
|
||||||
|
List<ProjectBudgetCostDetailTemp> findAllByProjectIdEquals(int id);
|
||||||
|
}
|
|
@ -1,151 +1,12 @@
|
||||||
package cn.palmte.work.model;
|
package cn.palmte.work.model;
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目预算项目管理成本明细表
|
* 项目预算项目管理成本明细表
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "project_budget_cost_project_manage_detail")
|
@Table(name = "project_budget_cost_project_manage_detail")
|
||||||
public class ProjectBudgetCostProjectManageDetail {
|
public class ProjectBudgetCostProjectManageDetail extends 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package cn.palmte.work.model;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预算项目管理成本明细临时表
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "project_budget_cost_project_manage_detail_temp")
|
||||||
|
public class ProjectBudgetCostProjectManageDetailTemp extends ProjectBudgetCostProjectManageDetailBase{
|
||||||
|
public ProjectBudgetCostProjectManageDetail toProjectBudgetCostProjectManageDetail(){
|
||||||
|
ProjectBudgetCostProjectManageDetail detail = new ProjectBudgetCostProjectManageDetail();
|
||||||
|
detail.setProjectId(getProjectId());
|
||||||
|
detail.setType(getType());
|
||||||
|
detail.setName(getName());
|
||||||
|
detail.setDetail(getDetail());
|
||||||
|
detail.setUnit(getUnit());
|
||||||
|
detail.setAmount(getAmount());
|
||||||
|
detail.setPrice(getPrice());
|
||||||
|
detail.setPredictMethod(getPredictMethod());
|
||||||
|
detail.setPredictWhy(getPredictWhy());
|
||||||
|
detail.setRemark(getRemark());
|
||||||
|
detail.setDeletable(getDeletable());
|
||||||
|
return detail;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package cn.palmte.work.model;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ProjectBudgetCostProjectManageDetailTempRepository extends JpaRepository<ProjectBudgetCostProjectManageDetailTemp,Integer> {
|
||||||
|
List<ProjectBudgetCostProjectManageDetailTemp> findAllByProjectIdEquals(int id);
|
||||||
|
}
|
|
@ -1,120 +1,11 @@
|
||||||
package cn.palmte.work.model;
|
package cn.palmte.work.model;
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目预算收入明细表
|
* 项目预算收入明细表
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "project_budget_income_detail")
|
@Table(name = "project_budget_income_detail")
|
||||||
public class ProjectBudgetIncomeDetail {
|
public class ProjectBudgetIncomeDetail extends 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);
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package cn.palmte.work.model;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预算收入明细临时表
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "project_budget_income_detail_temp")
|
||||||
|
public class ProjectBudgetIncomeDetailTemp extends ProjectBudgetIncomeDetailBase{
|
||||||
|
public ProjectBudgetIncomeDetail toProjectBudgetIncomeDetail(){
|
||||||
|
ProjectBudgetIncomeDetail projectBudgetIncomeDetail = new ProjectBudgetIncomeDetail();
|
||||||
|
projectBudgetIncomeDetail.setProjectId(getProjectId());
|
||||||
|
projectBudgetIncomeDetail.setName(getName());
|
||||||
|
projectBudgetIncomeDetail.setType(getType());
|
||||||
|
projectBudgetIncomeDetail.setUnit(getUnit());
|
||||||
|
projectBudgetIncomeDetail.setAmount(getAmount());
|
||||||
|
projectBudgetIncomeDetail.setPrice(getPrice());
|
||||||
|
projectBudgetIncomeDetail.setTaxRate(getTaxRate());
|
||||||
|
return projectBudgetIncomeDetail;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package cn.palmte.work.model;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ProjectBudgetIncomeDetailTempRepository extends JpaRepository<ProjectBudgetIncomeDetailTemp,Integer> {
|
||||||
|
List<ProjectBudgetIncomeDetailTemp> findAllByProjectIdEquals(int id);
|
||||||
|
}
|
|
@ -1,220 +1,11 @@
|
||||||
package cn.palmte.work.model;
|
package cn.palmte.work.model;
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资金计划明细表
|
* 资金计划明细表
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "project_budget_plan_detail")
|
@Table(name = "project_budget_plan_detail")
|
||||||
public class ProjectBudgetPlanDetail {
|
public class ProjectBudgetPlanDetail extends 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package cn.palmte.work.model;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资金计划明细临时表
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "project_budget_plan_detail_temp")
|
||||||
|
public class ProjectBudgetPlanDetailTemp extends ProjectBudgetPlanDetailBase{
|
||||||
|
public ProjectBudgetPlanDetail toProjectBudgetPlanDetail(){
|
||||||
|
ProjectBudgetPlanDetail projectBudgetPlanDetail = new ProjectBudgetPlanDetail();
|
||||||
|
projectBudgetPlanDetail.setProjectId(getProjectId());
|
||||||
|
projectBudgetPlanDetail.setMonth(getMonth());
|
||||||
|
projectBudgetPlanDetail.setDeviceCost(getDeviceCost());
|
||||||
|
projectBudgetPlanDetail.setEngineerCost(getEngineerCost());
|
||||||
|
projectBudgetPlanDetail.setProjectManageCost(getProjectManageCost());
|
||||||
|
projectBudgetPlanDetail.setEarnestMoneyCost(getEarnestMoneyCost());
|
||||||
|
projectBudgetPlanDetail.setTotalCost(getTotalCost());
|
||||||
|
projectBudgetPlanDetail.setSaleIncome(getSaleIncome());
|
||||||
|
projectBudgetPlanDetail.setEarnestMoneyIncome(getEarnestMoneyIncome());
|
||||||
|
projectBudgetPlanDetail.setTotalIncome(getTotalIncome());
|
||||||
|
projectBudgetPlanDetail.setFundBalance(getFundBalance());
|
||||||
|
projectBudgetPlanDetail.setUnderwrittenTaxRate(getUnderwrittenTaxRate());
|
||||||
|
projectBudgetPlanDetail.setCapitalInterest(getCapitalInterest());
|
||||||
|
projectBudgetPlanDetail.setUnderwrittenPlan(getUnderwrittenPlan());
|
||||||
|
projectBudgetPlanDetail.setRepaymentPlan(getRepaymentPlan());
|
||||||
|
return projectBudgetPlanDetail;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package cn.palmte.work.model;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ProjectBudgetPlanDetailTempRepository extends JpaRepository<ProjectBudgetPlanDetailTemp,Integer> {
|
||||||
|
List<ProjectBudgetPlanDetailTemp> findAllByProjectIdEquals(int id);
|
||||||
|
|
||||||
|
@Query(value = "select * from project_budget_plan_detail_temp where project_id in ?1", nativeQuery = true)
|
||||||
|
List<ProjectBudgetPlanDetailTemp> findAllByProjectIds(List<Integer> projectInt);
|
||||||
|
}
|
|
@ -28,12 +28,20 @@ public class ProjectBudgetService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProjectBudgetIncomeDetailRepository projectBudgetIncomeDetailRepository;
|
private ProjectBudgetIncomeDetailRepository projectBudgetIncomeDetailRepository;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private ProjectBudgetIncomeDetailTempRepository projectBudgetIncomeDetailTempRepository;
|
||||||
|
@Autowired
|
||||||
private ProjectBudgetCostDetailRepository projectBudgetCostDetailRepository;
|
private ProjectBudgetCostDetailRepository projectBudgetCostDetailRepository;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private ProjectBudgetCostDetailTempRepository projectBudgetCostDetailTempRepository;
|
||||||
|
@Autowired
|
||||||
private ProjectBudgetCostProjectManageDetailRepository projectBudgetCostProjectManageDetailRepository;
|
private ProjectBudgetCostProjectManageDetailRepository projectBudgetCostProjectManageDetailRepository;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private ProjectBudgetCostProjectManageDetailTempRepository projectBudgetCostProjectManageDetailTempRepository;
|
||||||
|
@Autowired
|
||||||
private ProjectBudgetPlanDetailRepository projectBudgetPlanDetailRepository;
|
private ProjectBudgetPlanDetailRepository projectBudgetPlanDetailRepository;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private ProjectBudgetPlanDetailTempRepository projectBudgetPlanDetailTempRepository;
|
||||||
|
@Autowired
|
||||||
private ProjectInstanceService projectInstanceService;
|
private ProjectInstanceService projectInstanceService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActTaskDefService actTaskDefService;
|
private ActTaskDefService actTaskDefService;
|
||||||
|
@ -321,6 +329,12 @@ public class ProjectBudgetService {
|
||||||
projectBudgetIncomeDetailRepository.deleteInBatch(incomeDetails);
|
projectBudgetIncomeDetailRepository.deleteInBatch(incomeDetails);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void clearBudgetIncomeDetailTemp(Project project){
|
||||||
|
List<ProjectBudgetIncomeDetailTemp> incomeDetails = projectBudgetIncomeDetailTempRepository.findAllByProjectIdEquals(project.getId());
|
||||||
|
if(CollectionUtil.isNotEmpty(incomeDetails)){
|
||||||
|
projectBudgetIncomeDetailTempRepository.deleteInBatch(incomeDetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存项目的收入明细
|
* 保存项目的收入明细
|
||||||
|
@ -335,6 +349,17 @@ public class ProjectBudgetService {
|
||||||
projectBudgetIncomeDetailRepository.save(detailList);
|
projectBudgetIncomeDetailRepository.save(detailList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public void saveBudgetIncomeDetailTemp(Project project, List<ProjectBudgetIncomeDetailTemp> detailList){
|
||||||
|
clearBudgetIncomeDetailTemp(project);
|
||||||
|
if(CollectionUtil.isNotEmpty(detailList)){
|
||||||
|
for (ProjectBudgetIncomeDetailTemp projectBudgetIncomeDetail : detailList) {
|
||||||
|
projectBudgetIncomeDetail.setProjectId(project.getId());
|
||||||
|
}
|
||||||
|
projectBudgetIncomeDetailTempRepository.save(detailList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取项目的收入明细
|
* 获取项目的收入明细
|
||||||
|
@ -351,6 +376,12 @@ public class ProjectBudgetService {
|
||||||
projectBudgetCostDetailRepository.deleteInBatch(costDetails);
|
projectBudgetCostDetailRepository.deleteInBatch(costDetails);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void clearBudgetCostDetailTemp(Project project){
|
||||||
|
List<ProjectBudgetCostDetailTemp> costDetails = projectBudgetCostDetailTempRepository.findAllByProjectIdEquals(project.getId());
|
||||||
|
if(CollectionUtil.isNotEmpty(costDetails)){
|
||||||
|
projectBudgetCostDetailTempRepository.deleteInBatch(costDetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存项目的成本明细
|
* 保存项目的成本明细
|
||||||
|
@ -366,6 +397,17 @@ public class ProjectBudgetService {
|
||||||
projectBudgetCostDetailRepository.save(detailList);
|
projectBudgetCostDetailRepository.save(detailList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public void saveBudgetCostDetailTemp(Project project, List<ProjectBudgetCostDetailTemp> detailList){
|
||||||
|
clearBudgetCostDetailTemp(project);
|
||||||
|
|
||||||
|
if(CollectionUtil.isNotEmpty(detailList)){
|
||||||
|
for (ProjectBudgetCostDetailTemp projectBudgetCostDetail : detailList) {
|
||||||
|
projectBudgetCostDetail.setProjectId(project.getId());
|
||||||
|
}
|
||||||
|
projectBudgetCostDetailTempRepository.save(detailList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取项目的成本明细
|
* 获取项目的成本明细
|
||||||
|
@ -382,6 +424,12 @@ public class ProjectBudgetService {
|
||||||
projectBudgetCostProjectManageDetailRepository.deleteInBatch(costDetails);
|
projectBudgetCostProjectManageDetailRepository.deleteInBatch(costDetails);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void clearBudgetCostProjectManageDetailTemp(Project project){
|
||||||
|
List<ProjectBudgetCostProjectManageDetailTemp> costDetails = projectBudgetCostProjectManageDetailTempRepository.findAllByProjectIdEquals(project.getId());
|
||||||
|
if(CollectionUtil.isNotEmpty(costDetails)){
|
||||||
|
projectBudgetCostProjectManageDetailTempRepository.deleteInBatch(costDetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存项目的项目管理成本明细
|
* 保存项目的项目管理成本明细
|
||||||
|
@ -396,6 +444,16 @@ public class ProjectBudgetService {
|
||||||
projectBudgetCostProjectManageDetailRepository.save(detailList);
|
projectBudgetCostProjectManageDetailRepository.save(detailList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public void saveBudgetCostProjectManageDetailTemp(Project project, List<ProjectBudgetCostProjectManageDetailTemp> detailList){
|
||||||
|
clearBudgetCostProjectManageDetailTemp(project);
|
||||||
|
if(CollectionUtil.isNotEmpty(detailList)){
|
||||||
|
for (ProjectBudgetCostProjectManageDetailTemp projectBudgetCostProjectManageDetail : detailList) {
|
||||||
|
projectBudgetCostProjectManageDetail.setProjectId(project.getId());
|
||||||
|
}
|
||||||
|
projectBudgetCostProjectManageDetailTempRepository.save(detailList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取项目管理明细
|
* 获取项目管理明细
|
||||||
|
@ -435,6 +493,12 @@ public class ProjectBudgetService {
|
||||||
projectBudgetPlanDetailRepository.deleteInBatch(costDetails);
|
projectBudgetPlanDetailRepository.deleteInBatch(costDetails);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void clearBudgetPlanDetailTemp(Project project){
|
||||||
|
List<ProjectBudgetPlanDetailTemp> costDetails = projectBudgetPlanDetailTempRepository.findAllByProjectIdEquals(project.getId());
|
||||||
|
if(CollectionUtil.isNotEmpty(costDetails)){
|
||||||
|
projectBudgetPlanDetailTempRepository.deleteInBatch(costDetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存项目的资金计划明细
|
* 保存项目的资金计划明细
|
||||||
|
@ -450,6 +514,17 @@ public class ProjectBudgetService {
|
||||||
projectBudgetPlanDetailRepository.save(detailList);
|
projectBudgetPlanDetailRepository.save(detailList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public void saveBudgetPlanDetailTemp(Project project, List<ProjectBudgetPlanDetailTemp> detailList){
|
||||||
|
clearBudgetPlanDetailTemp(project);
|
||||||
|
if(CollectionUtil.isNotEmpty(detailList)){
|
||||||
|
for (ProjectBudgetPlanDetailTemp projectBudgetPlanDetail : detailList) {
|
||||||
|
projectBudgetPlanDetail.setProjectId(project.getId());
|
||||||
|
projectBudgetPlanDetail.setUnderwrittenTaxRate(project.getUnderwrittenTaxRate());
|
||||||
|
}
|
||||||
|
projectBudgetPlanDetailTempRepository.save(detailList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取资金计划数据
|
* 获取资金计划数据
|
||||||
|
@ -553,7 +628,7 @@ public class ProjectBudgetService {
|
||||||
|
|
||||||
|
|
||||||
ProjectBudgetPlanDetail projectBudgetPlanDetail = new ProjectBudgetPlanDetail();
|
ProjectBudgetPlanDetail projectBudgetPlanDetail = new ProjectBudgetPlanDetail();
|
||||||
projectBudgetPlanDetail.setMonth("合计");
|
projectBudgetPlanDetail.setMonth("数据代入");
|
||||||
projectBudgetPlanDetail.setDeviceCost(deviceCost);
|
projectBudgetPlanDetail.setDeviceCost(deviceCost);
|
||||||
projectBudgetPlanDetail.setEngineerCost(engineerCost);
|
projectBudgetPlanDetail.setEngineerCost(engineerCost);
|
||||||
projectBudgetPlanDetail.setProjectManageCost(projectManageCost);
|
projectBudgetPlanDetail.setProjectManageCost(projectManageCost);
|
||||||
|
@ -707,6 +782,56 @@ public class ProjectBudgetService {
|
||||||
//清空重新保存概算信息
|
//清空重新保存概算信息
|
||||||
clearBudget(p);
|
clearBudget(p);
|
||||||
saveBudget(p, budgetBean);
|
saveBudget(p, budgetBean);
|
||||||
|
|
||||||
|
clearBudgetDetail(p);
|
||||||
|
saveBudgetDetail(p);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void saveBudgetDetail(Project p) {
|
||||||
|
//临时表中始终是最新的详情,不管是本次修改还是以前保持的
|
||||||
|
//收入明细
|
||||||
|
List<ProjectBudgetIncomeDetailTemp> projectBudgetIncomeDetailTemps = projectBudgetIncomeDetailTempRepository.findAllByProjectIdEquals(p.getId());
|
||||||
|
if(CollectionUtil.isNotEmpty(projectBudgetIncomeDetailTemps)){
|
||||||
|
List<ProjectBudgetIncomeDetail> incomeDetails = projectBudgetIncomeDetailTemps.stream()
|
||||||
|
.map(ProjectBudgetIncomeDetailTemp::toProjectBudgetIncomeDetail)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
projectBudgetIncomeDetailRepository.save(incomeDetails);
|
||||||
|
}
|
||||||
|
//成本明细
|
||||||
|
List<ProjectBudgetCostDetailTemp> projectBudgetCostDetailTemps = projectBudgetCostDetailTempRepository.findAllByProjectIdEquals(p.getId());
|
||||||
|
if(CollectionUtil.isNotEmpty(projectBudgetCostDetailTemps)){
|
||||||
|
List<ProjectBudgetCostDetail> costDetails = projectBudgetCostDetailTemps.stream()
|
||||||
|
.map(ProjectBudgetCostDetailTemp::toProjectBudgetCostDetail)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
projectBudgetCostDetailRepository.save(costDetails);
|
||||||
|
}
|
||||||
|
//项目管理明细
|
||||||
|
List<ProjectBudgetCostProjectManageDetailTemp> projectBudgetCostProjectManageDetailTemps = projectBudgetCostProjectManageDetailTempRepository.findAllByProjectIdEquals(p.getId());
|
||||||
|
if(CollectionUtil.isNotEmpty(projectBudgetCostProjectManageDetailTemps)){
|
||||||
|
List<ProjectBudgetCostProjectManageDetail> costProjectManageDetails = projectBudgetCostProjectManageDetailTemps.stream()
|
||||||
|
.map(ProjectBudgetCostProjectManageDetailTemp::toProjectBudgetCostProjectManageDetail)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
projectBudgetCostProjectManageDetailRepository.save(costProjectManageDetails);
|
||||||
|
}
|
||||||
|
//资金计划明细
|
||||||
|
List<ProjectBudgetPlanDetailTemp> projectBudgetPlanDetailTemps = projectBudgetPlanDetailTempRepository.findAllByProjectIdEquals(p.getId());
|
||||||
|
if(CollectionUtil.isNotEmpty(projectBudgetPlanDetailTemps)){
|
||||||
|
List<ProjectBudgetPlanDetail> budgetPlanDetails = projectBudgetPlanDetailTemps.stream()
|
||||||
|
.map(ProjectBudgetPlanDetailTemp::toProjectBudgetPlanDetail)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
projectBudgetPlanDetailRepository.save(budgetPlanDetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void clearBudgetDetail(Project p) {
|
||||||
|
//收入明细
|
||||||
|
clearBudgetIncomeDetail(p);
|
||||||
|
//成本明细
|
||||||
|
clearBudgetCostDetail(p);
|
||||||
|
//项目管理明细
|
||||||
|
clearBudgetCostProjectManageDetail(p);
|
||||||
|
//资金计划明细
|
||||||
|
clearBudgetPlanDetail(p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue