feat(资金计划): 完善资金计划功能并优化界面显示
- 在ProjectFundPlanService中添加payWay和payDate字段映射 - 为资金计划添加项目关联处理 - 优化付款计划表格的列名和显示 - 重构ProjectTabSkinFundPlan的service获取逻辑
This commit is contained in:
@@ -1,14 +1,5 @@
|
||||
package com.ecep.contract.controller.project;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.ecep.contract.ContractPayWay;
|
||||
import com.ecep.contract.controller.tab.TabSkin;
|
||||
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
||||
@@ -23,12 +14,18 @@ import com.ecep.contract.vo.ContractPayPlanVo;
|
||||
import com.ecep.contract.vo.ContractVo;
|
||||
import com.ecep.contract.vo.ProjectFundPlanVo;
|
||||
import com.ecep.contract.vo.ProjectVo;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import lombok.Setter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 项目资金计划
|
||||
@@ -51,19 +48,13 @@ public class ProjectTabSkinFundPlan
|
||||
public TableColumn<ProjectFundPlanViewModel, String> payWayColumn;
|
||||
public Button updatePlanBtn;
|
||||
|
||||
@Setter
|
||||
private ProjectFundPlanService projectFundPlanService;
|
||||
|
||||
public ProjectTabSkinFundPlan(ProjectWindowController controller) {
|
||||
super(controller);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ProjectFundPlanService getViewModelService() {
|
||||
if (projectFundPlanService == null) {
|
||||
projectFundPlanService = getBean(ProjectFundPlanService.class);
|
||||
}
|
||||
return projectFundPlanService;
|
||||
return getProjectFundPlanService();
|
||||
}
|
||||
|
||||
public ContractPayPlanService getContractPayPlanService() {
|
||||
@@ -249,10 +240,7 @@ public class ProjectTabSkinFundPlan
|
||||
}
|
||||
|
||||
private ProjectFundPlanService getProjectFundPlanService() {
|
||||
if (projectFundPlanService == null) {
|
||||
projectFundPlanService = getBean(ProjectFundPlanService.class);
|
||||
}
|
||||
return projectFundPlanService;
|
||||
return getCachedBean(ProjectFundPlanService.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -149,6 +149,7 @@ public class ProjectWindowController extends AbstEntityController<ProjectVo, Pro
|
||||
registerTabSkin(costTab, tab -> new ProjectTabSkinCost(this));
|
||||
registerTabSkin(quotationApprovalTab, tab -> new ProjectTabSkinQuotation(this));
|
||||
registerTabSkin(bidTab, tab -> new ProjectTabSkinBid(this));
|
||||
// 资金计划
|
||||
registerTabSkin(fundPlanTab, tab -> new ProjectTabSkinFundPlan(this));
|
||||
// registerTabSkin(costItemTab, this::createCostItemTabSkin);
|
||||
registerTabSkin(satisfactionTab, tab -> new ProjectTabSkinCustomerSatisfactionSurvey(this));
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
AnchorPane.topAnchor="42.0">
|
||||
<columns>
|
||||
<TableColumn fx:id="idColumn" editable="false" prefWidth="75.0" text="ID"/>
|
||||
<TableColumn fx:id="payDateColumn" editable="false" prefWidth="90.0" text="付款日期" style="-fx-alignment: center;"/>
|
||||
<TableColumn fx:id="payRatioColumn" editable="false" prefWidth="75.0" text="付款比例%" style="-fx-alignment: center-right;"/>
|
||||
<TableColumn fx:id="payCurrencyColumn" editable="false" prefWidth="150.0" text="付款金额" style="-fx-alignment: center-right;"/>
|
||||
<TableColumn fx:id="payDateColumn" editable="false" prefWidth="90.0" text="日期" style="-fx-alignment: center;"/>
|
||||
<TableColumn fx:id="payRatioColumn" editable="false" prefWidth="75.0" text="比例(%)" style="-fx-alignment: center-right;"/>
|
||||
<TableColumn fx:id="payCurrencyColumn" editable="false" prefWidth="150.0" text="金额" style="-fx-alignment: center-right;"/>
|
||||
<TableColumn fx:id="payTermColumn" prefWidth="200.0" text="付款条款" />
|
||||
<TableColumn fx:id="refIdColumn" editable="false" prefWidth="75.0" text="RefId"/>
|
||||
<TableColumn fx:id="refIdColumn" editable="false" prefWidth="75.0" text="RefId" visible="false"/>
|
||||
<TableColumn fx:id="updateDateColumn" prefWidth="130.0" text="更新时间"/>
|
||||
</columns>
|
||||
</TableView>
|
||||
|
||||
@@ -114,10 +114,13 @@ public class ProjectFundPlanService implements IEntityService<ProjectFundPlan>,
|
||||
@Override
|
||||
public void updateByVo(ProjectFundPlan model, ProjectFundPlanVo vo) {
|
||||
// 基本字段映射
|
||||
|
||||
model.setPayRatio(vo.getPayRatio());
|
||||
model.setPayCurrency(vo.getPayCurrency());
|
||||
model.setPayTerm(vo.getPayTerm());
|
||||
model.setUpdateDate(vo.getUpdateDate());
|
||||
model.setPayWay(vo.getPayWay());
|
||||
model.setPayDate(vo.getPayDate());
|
||||
|
||||
// 处理关联实体
|
||||
if (vo.getContractPayPlanId() != null) {
|
||||
@@ -126,5 +129,11 @@ public class ProjectFundPlanService implements IEntityService<ProjectFundPlan>,
|
||||
}else{
|
||||
model.setContractPayPlan(null);
|
||||
}
|
||||
if (vo.getProjectId() != null) {
|
||||
Project project = SpringApp.getBean(ProjectService.class).getById(vo.getProjectId());
|
||||
model.setProject(project);
|
||||
}else{
|
||||
model.setProject(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user