|
|
|
@ -1052,20 +1052,28 @@ public class ProjectBudgetService {
|
|
|
|
|
List<ProjectBudgetCostDetail> projectBudgetCostDetails = projectBudgetCostDetailRepository.findAllByProjectIdEquals(p.getId());
|
|
|
|
|
if (projectBudgetCostDetails.size() > 0) {
|
|
|
|
|
ProcurementType huizhiType = procurementTypeRepository.findByName("汇智产品");
|
|
|
|
|
BigDecimal huizhi = projectBudgetCostDetails.stream().filter(a ->a.getCategory().equals(huizhiType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
|
|
|
BigDecimal huizhi = projectBudgetCostDetails.stream().filter(a ->(a.getCategory().equals(huizhiType.getId().toString()))||("汇智产品".equals(a.getCategory())))
|
|
|
|
|
.map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
|
|
|
budget.setHuizhiProductAmountBudget(huizhi);
|
|
|
|
|
ProcurementType huazhiType = procurementTypeRepository.findByName("华智产品");
|
|
|
|
|
BigDecimal huazhi = projectBudgetCostDetails.stream().filter(a -> a.getCategory().equals(huazhiType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
|
|
|
BigDecimal huazhi = projectBudgetCostDetails.stream().filter(a -> (a.getCategory().equals(huazhiType.getId().toString()))||("华智产品".equals(a.getCategory())))
|
|
|
|
|
.map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
|
|
|
budget.setHuazhiProductAmountBudget(huazhi);
|
|
|
|
|
ProcurementType huasanType = procurementTypeRepository.findByName("华三产品");
|
|
|
|
|
BigDecimal huasan = projectBudgetCostDetails.stream().filter(a -> a.getCategory().equals(huasanType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
|
|
|
BigDecimal huasan = projectBudgetCostDetails.stream().filter(a ->( a.getCategory().equals(huasanType.getId().toString()))||( "华三产品".equals(a.getCategory())))
|
|
|
|
|
.map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
|
|
|
budget.setHuasanProductAmountBudget(huasan);
|
|
|
|
|
BigDecimal other = projectBudgetCostDetails.stream().filter(a -> !a.getCategory().equals( huizhiType.getId().toString()) && !a.getCategory().equals(huazhiType.getId().toString())
|
|
|
|
|
&& !a.getCategory().equals(huasanType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
|
|
|
BigDecimal other = projectBudgetCostDetails.stream().filter(a -> isABoolean(a, huizhiType, huazhiType, huasanType)).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
|
|
|
budget.setZiguangOtherAmountBudget(other);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static boolean isABoolean(ProjectBudgetCostDetail a, ProcurementType huizhiType, ProcurementType huazhiType, ProcurementType huasanType) {
|
|
|
|
|
return !a.getCategory().equals(huizhiType.getId().toString()) &&!"汇智产品".equals(a.getCategory())
|
|
|
|
|
&& !a.getCategory().equals(huazhiType.getId().toString()) && !"华智产品".equals(a.getCategory())
|
|
|
|
|
&& !a.getCategory().equals(huasanType.getId().toString()) && !"华三产品".equals(a.getCategory());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void saveProjectExtend(Project p) {
|
|
|
|
|
ProjectExtend extend = projectExtendRepository.findByProjectId(p.getId());
|
|
|
|
|
if (extend == null) {
|
|
|
|
@ -1100,16 +1108,18 @@ public class ProjectBudgetService {
|
|
|
|
|
List<ProjectBudgetCostDetail> projectBudgetCostDetails = projectBudgetCostDetailRepository.findAllByProjectIdEquals(p.getId());
|
|
|
|
|
if (projectBudgetCostDetails.size() > 0) {
|
|
|
|
|
ProcurementType huizhiType = procurementTypeRepository.findByName("汇智产品");
|
|
|
|
|
BigDecimal huizhi = projectBudgetCostDetails.stream().filter(a -> a.getCategory().equals(huizhiType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
|
|
|
BigDecimal huizhi = projectBudgetCostDetails.stream().filter(a -> (a.getCategory().equals(huizhiType.getId().toString()) )||("汇智产品".equals(a.getCategory())) )
|
|
|
|
|
.map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
|
|
|
extend.setHuizhiProductAmount(huizhi);
|
|
|
|
|
ProcurementType huazhiType = procurementTypeRepository.findByName("华智产品");
|
|
|
|
|
BigDecimal huazhi = projectBudgetCostDetails.stream().filter(a -> a.getCategory().equals(huazhiType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
|
|
|
BigDecimal huazhi = projectBudgetCostDetails.stream().filter(a -> (a.getCategory().equals(huazhiType.getId().toString()))||("华智产品".equals(a.getCategory())))
|
|
|
|
|
.map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
|
|
|
extend.setHuazhiProductAmount(huazhi);
|
|
|
|
|
ProcurementType huasanType = procurementTypeRepository.findByName("华三产品");
|
|
|
|
|
BigDecimal huasan = projectBudgetCostDetails.stream().filter(a -> a.getCategory().equals(huasanType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
|
|
|
BigDecimal huasan = projectBudgetCostDetails.stream().filter(a ->(a.getCategory().equals(huasanType.getId().toString()))||( "华三产品".equals(a.getCategory())))
|
|
|
|
|
.map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
|
|
|
extend.setHuasanProductAmount(huasan);
|
|
|
|
|
BigDecimal other = projectBudgetCostDetails.stream().filter(a -> !a.getCategory().equals( huizhiType.getId().toString()) && !a.getCategory().equals(huazhiType.getId().toString())
|
|
|
|
|
&& !a.getCategory().equals(huasanType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
|
|
|
BigDecimal other = projectBudgetCostDetails.stream().filter(a -> isABoolean(a, huizhiType, huazhiType, huasanType)).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
|
|
|
|
|
extend.setZiguangOtherAmount(other);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|