Merge branch 'dev_1.0.0' of http://git.unissense.tech/mula/fourcal into Branch_dev_1.0.0
commit
09680c6b43
|
@ -25,7 +25,7 @@ public class ProjectBudgetCostDetailBase {
|
||||||
private int projectId;
|
private int projectId;
|
||||||
|
|
||||||
private int type;
|
private int type;
|
||||||
private int category;
|
private String category;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private String attr;
|
private String attr;
|
||||||
|
@ -92,11 +92,11 @@ public class ProjectBudgetCostDetailBase {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCategory() {
|
public String getCategory() {
|
||||||
return category;
|
return category;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCategory(int category) {
|
public void setCategory(String category) {
|
||||||
this.category = category;
|
this.category = category;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1042,15 +1042,16 @@ public class ProjectBudgetService {
|
||||||
List<ProjectBudgetCostDetail> projectBudgetCostDetails = projectBudgetCostDetailRepository.findAllByProjectIdEquals(p.getId());
|
List<ProjectBudgetCostDetail> projectBudgetCostDetails = projectBudgetCostDetailRepository.findAllByProjectIdEquals(p.getId());
|
||||||
if (projectBudgetCostDetails.size() > 0) {
|
if (projectBudgetCostDetails.size() > 0) {
|
||||||
ProcurementType huizhiType = procurementTypeRepository.findByName("汇智产品");
|
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);
|
budget.setHuizhiProductAmountBudget(huizhi);
|
||||||
ProcurementType huazhiType = procurementTypeRepository.findByName("华智产品");
|
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);
|
budget.setHuazhiProductAmountBudget(huazhi);
|
||||||
ProcurementType huasanType = procurementTypeRepository.findByName("华三产品");
|
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);
|
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);
|
budget.setZiguangOtherAmountBudget(other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1089,15 +1090,16 @@ public class ProjectBudgetService {
|
||||||
List<ProjectBudgetCostDetail> projectBudgetCostDetails = projectBudgetCostDetailRepository.findAllByProjectIdEquals(p.getId());
|
List<ProjectBudgetCostDetail> projectBudgetCostDetails = projectBudgetCostDetailRepository.findAllByProjectIdEquals(p.getId());
|
||||||
if (projectBudgetCostDetails.size() > 0) {
|
if (projectBudgetCostDetails.size() > 0) {
|
||||||
ProcurementType huizhiType = procurementTypeRepository.findByName("汇智产品");
|
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);
|
extend.setHuizhiProductAmount(huizhi);
|
||||||
ProcurementType huazhiType = procurementTypeRepository.findByName("华智产品");
|
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);
|
extend.setHuazhiProductAmount(huazhi);
|
||||||
ProcurementType huasanType = procurementTypeRepository.findByName("华三产品");
|
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);
|
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);
|
extend.setZiguangOtherAmount(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1298,8 +1300,8 @@ public class ProjectBudgetService {
|
||||||
o1 = m.get(key);
|
o1 = m.get(key);
|
||||||
String category = (String) o1;
|
String category = (String) o1;
|
||||||
ProcurementType procurementType = procurementTypeRepository.findByName(category);
|
ProcurementType procurementType = procurementTypeRepository.findByName(category);
|
||||||
if (procurementType != null && procurementType.getType() == temp.getType()) {
|
if (procurementType != null && (procurementType.getType() == temp.getType() && temp.getType()!=4)) {
|
||||||
temp.setCategory(procurementType.getId());
|
temp.setCategory(procurementType.getId().toString());
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("该采购类别不存在或者与采购成本项目不匹配");
|
throw new Exception("该采购类别不存在或者与采购成本项目不匹配");
|
||||||
}
|
}
|
||||||
|
|
|
@ -342,7 +342,7 @@ public class ProjectProcessService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getCategory(ProjectBudgetCostDetail costDetail) {
|
private String getCategory(ProjectBudgetCostDetail costDetail) {
|
||||||
int category = costDetail.getCategory();
|
String category = costDetail.getCategory();
|
||||||
TypedQuery<ProcurementType> query = entityManager.createQuery(
|
TypedQuery<ProcurementType> query = entityManager.createQuery(
|
||||||
"from ProcurementType where id=:category and isDeleted=0 and enabled=1", ProcurementType.class);
|
"from ProcurementType where id=:category and isDeleted=0 and enabled=1", ProcurementType.class);
|
||||||
query.setParameter("category", category);
|
query.setParameter("category", category);
|
||||||
|
|
Loading…
Reference in New Issue