是否垫资

master
Harry Yang 2023-01-06 10:24:36 +08:00
parent 2a02a551fd
commit d7fe81fabb
2 changed files with 16 additions and 6 deletions

View File

@ -28,7 +28,7 @@ public class ProcurementDetail {
private String contractParty; private String contractParty;
private int isUnderwritten; private boolean isUnderwritten;
private String isUnderwrittenDesc; private String isUnderwrittenDesc;
private BigDecimal underwrittenAmount; private BigDecimal underwrittenAmount;
@ -60,8 +60,9 @@ public class ProcurementDetail {
private Integer amountId; private Integer amountId;
public void setIsUnderwritten(int isUnderwritten) { public void setIsUnderwritten(boolean isUnderwritten) {
this.isUnderwritten = isUnderwritten; this.isUnderwritten = isUnderwritten;
this.isUnderwrittenDesc = isUnderwritten == 1 ? "是" : "否"; this.isUnderwrittenDesc = isUnderwritten ? "是" : "否";
} }
} }

View File

@ -296,7 +296,7 @@ public class ProjectProcessService {
for (BudgetPurchaseAmount amount : purchaseAmount) { for (BudgetPurchaseAmount amount : purchaseAmount) {
ProjectBudgetCostDetail costDetail = getCostDetailById(amount.getBudgetCostId()); ProjectBudgetCostDetail costDetail = getCostDetailById(amount.getBudgetCostId());
ProcurementDetail detail = new ProcurementDetail(); ProcurementDetail detail = new ProcurementDetail();
BeanUtils.copyProperties(costDetail, detail); BeanUtils.copyProperties(costDetail, detail, "isUnderwritten");
Integer amountId = amount.getId(); Integer amountId = amount.getId();
// 找对应 预算采购明细的数量记录 的采购详情 // 找对应 预算采购明细的数量记录 的采购详情
@ -314,6 +314,7 @@ public class ProjectProcessService {
} }
detail.setAmountLeft(allAmount.subtract(amountAlready)); detail.setAmountLeft(allAmount.subtract(amountAlready));
detail.setAmountCurrent(amount.getAmountCurrent()); detail.setAmountCurrent(amount.getAmountCurrent());
detail.setIsUnderwritten(isProjectPrepaid(projectId));
ret.add(detail); ret.add(detail);
} }
} }
@ -321,7 +322,7 @@ public class ProjectProcessService {
List<ProjectBudgetCostDetail> costDetails = getCostDetails(projectId); List<ProjectBudgetCostDetail> costDetails = getCostDetails(projectId);
for (ProjectBudgetCostDetail costDetail : costDetails) { for (ProjectBudgetCostDetail costDetail : costDetails) {
ProcurementDetail detail = new ProcurementDetail(); ProcurementDetail detail = new ProcurementDetail();
BeanUtils.copyProperties(costDetail, detail); BeanUtils.copyProperties(costDetail, detail, "isUnderwritten");
// 可能为 0 // 可能为 0
BigDecimal amountAlready = getAmountAlready(costDetail.getId()); BigDecimal amountAlready = getAmountAlready(costDetail.getId());
detail.setAmountAlready(amountAlready); detail.setAmountAlready(amountAlready);
@ -333,6 +334,7 @@ public class ProjectProcessService {
// TODO 查询太频繁 // TODO 查询太频繁
detail.setCategory(getCategory(costDetail)); detail.setCategory(getCategory(costDetail));
detail.setBudgetCostId(costDetail.getId()); detail.setBudgetCostId(costDetail.getId());
detail.setIsUnderwritten(isProjectPrepaid(projectId));
ret.add(detail); ret.add(detail);
} }
} }
@ -500,7 +502,14 @@ public class ProjectProcessService {
* *
*/ */
public boolean isProjectPrepaid(Project project) { public boolean isProjectPrepaid(Project project) {
return BigDecimal.ZERO.equals(getProjectRepaidAmount(project.getId())); return isProjectPrepaid(project.getId());
}
/**
*
*/
public boolean isProjectPrepaid(Integer projectId) {
return isProjectPrepaid(getProjectRepaidAmount(projectId));
} }
/** /**