feat(资金计划): 完善资金计划功能并优化界面显示

- 在ProjectFundPlanService中添加payWay和payDate字段映射
- 为资金计划添加项目关联处理
- 优化付款计划表格的列名和显示
- 重构ProjectTabSkinFundPlan的service获取逻辑
This commit is contained in:
2025-10-16 18:25:28 +08:00
parent 71a358fa77
commit eea4d93ae1
4 changed files with 24 additions and 26 deletions

View File

@@ -1,14 +1,5 @@
package com.ecep.contract.controller.project; 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.ContractPayWay;
import com.ecep.contract.controller.tab.TabSkin; import com.ecep.contract.controller.tab.TabSkin;
import com.ecep.contract.controller.table.EditableEntityTableTabSkin; 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.ContractVo;
import com.ecep.contract.vo.ProjectFundPlanVo; import com.ecep.contract.vo.ProjectFundPlanVo;
import com.ecep.contract.vo.ProjectVo; import com.ecep.contract.vo.ProjectVo;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
import javafx.scene.control.Button; import javafx.scene.control.Button;
import javafx.scene.control.Tab; import javafx.scene.control.Tab;
import javafx.scene.control.TableColumn; 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 TableColumn<ProjectFundPlanViewModel, String> payWayColumn;
public Button updatePlanBtn; public Button updatePlanBtn;
@Setter
private ProjectFundPlanService projectFundPlanService;
public ProjectTabSkinFundPlan(ProjectWindowController controller) { public ProjectTabSkinFundPlan(ProjectWindowController controller) {
super(controller); super(controller);
} }
@Override @Override
protected ProjectFundPlanService getViewModelService() { protected ProjectFundPlanService getViewModelService() {
if (projectFundPlanService == null) { return getProjectFundPlanService();
projectFundPlanService = getBean(ProjectFundPlanService.class);
}
return projectFundPlanService;
} }
public ContractPayPlanService getContractPayPlanService() { public ContractPayPlanService getContractPayPlanService() {
@@ -249,10 +240,7 @@ public class ProjectTabSkinFundPlan
} }
private ProjectFundPlanService getProjectFundPlanService() { private ProjectFundPlanService getProjectFundPlanService() {
if (projectFundPlanService == null) { return getCachedBean(ProjectFundPlanService.class);
projectFundPlanService = getBean(ProjectFundPlanService.class);
}
return projectFundPlanService;
} }
@Override @Override

View File

@@ -149,6 +149,7 @@ public class ProjectWindowController extends AbstEntityController<ProjectVo, Pro
registerTabSkin(costTab, tab -> new ProjectTabSkinCost(this)); registerTabSkin(costTab, tab -> new ProjectTabSkinCost(this));
registerTabSkin(quotationApprovalTab, tab -> new ProjectTabSkinQuotation(this)); registerTabSkin(quotationApprovalTab, tab -> new ProjectTabSkinQuotation(this));
registerTabSkin(bidTab, tab -> new ProjectTabSkinBid(this)); registerTabSkin(bidTab, tab -> new ProjectTabSkinBid(this));
// 资金计划
registerTabSkin(fundPlanTab, tab -> new ProjectTabSkinFundPlan(this)); registerTabSkin(fundPlanTab, tab -> new ProjectTabSkinFundPlan(this));
// registerTabSkin(costItemTab, this::createCostItemTabSkin); // registerTabSkin(costItemTab, this::createCostItemTabSkin);
registerTabSkin(satisfactionTab, tab -> new ProjectTabSkinCustomerSatisfactionSurvey(this)); registerTabSkin(satisfactionTab, tab -> new ProjectTabSkinCustomerSatisfactionSurvey(this));

View File

@@ -20,11 +20,11 @@
AnchorPane.topAnchor="42.0"> AnchorPane.topAnchor="42.0">
<columns> <columns>
<TableColumn fx:id="idColumn" editable="false" prefWidth="75.0" text="ID"/> <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="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="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="payCurrencyColumn" editable="false" prefWidth="150.0" text="金额" style="-fx-alignment: center-right;"/>
<TableColumn fx:id="payTermColumn" prefWidth="200.0" text="付款条款" /> <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="更新时间"/> <TableColumn fx:id="updateDateColumn" prefWidth="130.0" text="更新时间"/>
</columns> </columns>
</TableView> </TableView>

View File

@@ -114,10 +114,13 @@ public class ProjectFundPlanService implements IEntityService<ProjectFundPlan>,
@Override @Override
public void updateByVo(ProjectFundPlan model, ProjectFundPlanVo vo) { public void updateByVo(ProjectFundPlan model, ProjectFundPlanVo vo) {
// 基本字段映射 // 基本字段映射
model.setPayRatio(vo.getPayRatio()); model.setPayRatio(vo.getPayRatio());
model.setPayCurrency(vo.getPayCurrency()); model.setPayCurrency(vo.getPayCurrency());
model.setPayTerm(vo.getPayTerm()); model.setPayTerm(vo.getPayTerm());
model.setUpdateDate(vo.getUpdateDate()); model.setUpdateDate(vo.getUpdateDate());
model.setPayWay(vo.getPayWay());
model.setPayDate(vo.getPayDate());
// 处理关联实体 // 处理关联实体
if (vo.getContractPayPlanId() != null) { if (vo.getContractPayPlanId() != null) {
@@ -126,5 +129,11 @@ public class ProjectFundPlanService implements IEntityService<ProjectFundPlan>,
}else{ }else{
model.setContractPayPlan(null); model.setContractPayPlan(null);
} }
if (vo.getProjectId() != null) {
Project project = SpringApp.getBean(ProjectService.class).getById(vo.getProjectId());
model.setProject(project);
}else{
model.setProject(null);
}
} }
} }