是否垫资 重新判断
parent
2cbe6902ed
commit
418ba023f3
|
@ -189,8 +189,8 @@ public class ProcessController {
|
||||||
model.addAttribute("cooperationType", Enumerable.of(CooperationType.class, project.getCooperateType()).getDescription());
|
model.addAttribute("cooperationType", Enumerable.of(CooperationType.class, project.getCooperateType()).getDescription());
|
||||||
List<ProcessAttachment> attachments = JSONArray.parseArray(process.getAttachmentUri(), ProcessAttachment.class);
|
List<ProcessAttachment> attachments = JSONArray.parseArray(process.getAttachmentUri(), ProcessAttachment.class);
|
||||||
model.addAttribute("attachments", attachments);
|
model.addAttribute("attachments", attachments);
|
||||||
model.addAttribute("isPrepaid", isPrepaid(project));
|
|
||||||
BigDecimal repaidAmount = getRepaidAmount(process.getProjectId());
|
BigDecimal repaidAmount = getRepaidAmount(process.getProjectId());
|
||||||
|
model.addAttribute("isPrepaid", isPrepaid(repaidAmount));
|
||||||
model.addAttribute("repaidAmount", repaidAmount);
|
model.addAttribute("repaidAmount", repaidAmount);
|
||||||
|
|
||||||
if (isAdministrator(getLoginUser())) {
|
if (isAdministrator(getLoginUser())) {
|
||||||
|
@ -324,7 +324,7 @@ public class ProcessController {
|
||||||
BudgetBean budgetBean = projectBudgetService.getBudget(project);
|
BudgetBean budgetBean = projectBudgetService.getBudget(project);
|
||||||
|
|
||||||
return ProjectReturnValue.builder()
|
return ProjectReturnValue.builder()
|
||||||
.isPrepaid(isPrepaid(project))
|
.isPrepaid(isPrepaid(repaidAmount))
|
||||||
.projectId(project.getId())
|
.projectId(project.getId())
|
||||||
.incomeDetails(incomeDetails)
|
.incomeDetails(incomeDetails)
|
||||||
.procurementDetails(procurementDetails)
|
.procurementDetails(procurementDetails)
|
||||||
|
@ -340,8 +340,8 @@ public class ProcessController {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String isPrepaid(Project project) {
|
private String isPrepaid(BigDecimal repaidAmount) {
|
||||||
return processService.isProjectPrepaid(project) ? "是" : "否";
|
return processService.isProjectPrepaid(repaidAmount) ? "是" : "否";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -378,7 +378,7 @@ public class ProcessController {
|
||||||
procurementDetails = processService.getProcurementDetails(project.getId(), id);
|
procurementDetails = processService.getProcurementDetails(project.getId(), id);
|
||||||
}
|
}
|
||||||
|
|
||||||
detail.setIsPrepaid(isPrepaid(project));
|
detail.setIsPrepaid(isPrepaid(repaidAmount));
|
||||||
detail.setContract(contract);
|
detail.setContract(contract);
|
||||||
detail.setIncomeDetails(incomeDetails);
|
detail.setIncomeDetails(incomeDetails);
|
||||||
detail.setSupplierMaterials(supplierMaterials);
|
detail.setSupplierMaterials(supplierMaterials);
|
||||||
|
|
|
@ -456,7 +456,14 @@ public class ProjectProcessService {
|
||||||
* 是否垫资
|
* 是否垫资
|
||||||
*/
|
*/
|
||||||
public boolean isProjectPrepaid(Project project) {
|
public boolean isProjectPrepaid(Project project) {
|
||||||
return project.getUnderwrittenMode() == 2 || project.getUnderwrittenMode() == 3;
|
return BigDecimal.ZERO.equals(getProjectRepaidAmount(project.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否垫资
|
||||||
|
*/
|
||||||
|
public boolean isProjectPrepaid(BigDecimal repaidAmount) {
|
||||||
|
return BigDecimal.ZERO.equals(repaidAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue