Merge branch 'dev_1.0.0' of http://git.unissense.tech/mula/fourcal into Branch_dev_1.0.0

dev_1.0.0
‘wangjiuyun 2024-10-30 14:10:20 +08:00
commit 09680c6b43
3 changed files with 16 additions and 14 deletions

View File

@ -25,7 +25,7 @@ public class ProjectBudgetCostDetailBase {
private int projectId;
private int type;
private int category;
private String category;
private String name;
private String attr;
@ -92,11 +92,11 @@ public class ProjectBudgetCostDetailBase {
this.type = type;
}
public int getCategory() {
public String getCategory() {
return category;
}
public void setCategory(int category) {
public void setCategory(String category) {
this.category = category;
}

View File

@ -1042,15 +1042,16 @@ 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() == huizhiType.getId()).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
BigDecimal huizhi = projectBudgetCostDetails.stream().filter(a ->a.getCategory().equals(huizhiType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
budget.setHuizhiProductAmountBudget(huizhi);
ProcurementType huazhiType = procurementTypeRepository.findByName("华智产品");
BigDecimal huazhi = projectBudgetCostDetails.stream().filter(a -> a.getCategory() == huazhiType.getId()).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
BigDecimal huazhi = projectBudgetCostDetails.stream().filter(a -> a.getCategory().equals(huazhiType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
budget.setHuazhiProductAmountBudget(huazhi);
ProcurementType huasanType = procurementTypeRepository.findByName("华三产品");
BigDecimal huasan = projectBudgetCostDetails.stream().filter(a -> a.getCategory() == huasanType.getId()).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
BigDecimal huasan = projectBudgetCostDetails.stream().filter(a -> a.getCategory().equals(huasanType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
budget.setHuasanProductAmountBudget(huasan);
BigDecimal other = projectBudgetCostDetails.stream().filter(a -> a.getCategory() != huizhiType.getId() && a.getCategory() != huazhiType.getId() && a.getCategory() != huasanType.getId()).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
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);
budget.setZiguangOtherAmountBudget(other);
}
}
@ -1089,15 +1090,16 @@ 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() == huizhiType.getId()).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
BigDecimal huizhi = projectBudgetCostDetails.stream().filter(a -> a.getCategory().equals(huizhiType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
extend.setHuizhiProductAmount(huizhi);
ProcurementType huazhiType = procurementTypeRepository.findByName("华智产品");
BigDecimal huazhi = projectBudgetCostDetails.stream().filter(a -> a.getCategory() == huazhiType.getId()).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
BigDecimal huazhi = projectBudgetCostDetails.stream().filter(a -> a.getCategory().equals(huazhiType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
extend.setHuazhiProductAmount(huazhi);
ProcurementType huasanType = procurementTypeRepository.findByName("华三产品");
BigDecimal huasan = projectBudgetCostDetails.stream().filter(a -> a.getCategory() == huasanType.getId()).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
BigDecimal huasan = projectBudgetCostDetails.stream().filter(a -> a.getCategory().equals(huasanType.getId().toString())).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
extend.setHuasanProductAmount(huasan);
BigDecimal other = projectBudgetCostDetails.stream().filter(a -> a.getCategory() != huizhiType.getId() && a.getCategory() != huazhiType.getId() && a.getCategory() != huasanType.getId()).map(ProjectBudgetCostDetail::getTotalTaxInclude).reduce(new BigDecimal(0), BigDecimal::add);
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);
extend.setZiguangOtherAmount(other);
}
@ -1298,8 +1300,8 @@ public class ProjectBudgetService {
o1 = m.get(key);
String category = (String) o1;
ProcurementType procurementType = procurementTypeRepository.findByName(category);
if (procurementType != null && procurementType.getType() == temp.getType()) {
temp.setCategory(procurementType.getId());
if (procurementType != null && (procurementType.getType() == temp.getType() && temp.getType()!=4)) {
temp.setCategory(procurementType.getId().toString());
} else {
throw new Exception("该采购类别不存在或者与采购成本项目不匹配");
}

View File

@ -342,7 +342,7 @@ public class ProjectProcessService {
}
private String getCategory(ProjectBudgetCostDetail costDetail) {
int category = costDetail.getCategory();
String category = costDetail.getCategory();
TypedQuery<ProcurementType> query = entityManager.createQuery(
"from ProcurementType where id=:category and isDeleted=0 and enabled=1", ProcurementType.class);
query.setParameter("category", category);