|
@@ -188,24 +188,25 @@ public class ExpenseOrderServiceImpl implements ExpenseOrderService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for (ExpenseOrderItemDO orderItem : orderItems) {
|
|
for (ExpenseOrderItemDO orderItem : orderItems) {
|
|
|
|
|
+ String categoryKey = orderItem.getItemCategoryName().replaceAll("-", "").replace("/", "");
|
|
|
if(orderItem.getExpenseSource().equals(BusinessConstants.EXPENSE_ITEM)){
|
|
if(orderItem.getExpenseSource().equals(BusinessConstants.EXPENSE_ITEM)){
|
|
|
if (orderItem.getType() != null && orderItem.getType() == 1) {
|
|
if (orderItem.getType() != null && orderItem.getType() == 1) {
|
|
|
- typeCategoryMap.put(orderItem.getType(),orderItem.getItemCategoryName());
|
|
|
|
|
- categoryAmountMap.put(orderItem.getItemCategoryName(),orderItem.getTotalAmount().setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
|
|
+ typeCategoryMap.put(orderItem.getType(), categoryKey);
|
|
|
|
|
+ categoryAmountMap.put(categoryKey,orderItem.getTotalAmount().setScale(2, RoundingMode.HALF_UP));
|
|
|
} else if (orderItem.getType() != null && orderItem.getType() == 2) {
|
|
} else if (orderItem.getType() != null && orderItem.getType() == 2) {
|
|
|
- typeCategoryMap.put(orderItem.getType(),orderItem.getItemCategoryName());
|
|
|
|
|
- categoryAmountMap.put(orderItem.getItemCategoryName(),orderItem.getTotalAmount().setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
|
|
+ typeCategoryMap.put(orderItem.getType(), categoryKey);
|
|
|
|
|
+ categoryAmountMap.put(categoryKey,orderItem.getTotalAmount().setScale(2, RoundingMode.HALF_UP));
|
|
|
} else if (orderItem.getType() != null && orderItem.getType() == 3) {
|
|
} else if (orderItem.getType() != null && orderItem.getType() == 3) {
|
|
|
- typeCategoryMap.put(orderItem.getType(),orderItem.getItemCategoryName());
|
|
|
|
|
- categoryAmountMap.put(orderItem.getItemCategoryName(),orderItem.getTotalAmount().setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
|
|
+ typeCategoryMap.put(orderItem.getType(), categoryKey);
|
|
|
|
|
+ categoryAmountMap.put(categoryKey,orderItem.getTotalAmount().setScale(2, RoundingMode.HALF_UP));
|
|
|
}else {
|
|
}else {
|
|
|
otherAmount = otherAmount.add(orderItem.getTotalAmount().setScale(2, RoundingMode.HALF_UP));
|
|
otherAmount = otherAmount.add(orderItem.getTotalAmount().setScale(2, RoundingMode.HALF_UP));
|
|
|
otherRoundAmount = otherRoundAmount.add(orderItem.getTotalAmount().setScale(2, RoundingMode.HALF_UP));
|
|
otherRoundAmount = otherRoundAmount.add(orderItem.getTotalAmount().setScale(2, RoundingMode.HALF_UP));
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- BigDecimal categoryAmount = categoryAmountMap.get(orderItem.getItemCategoryName());
|
|
|
|
|
|
|
+ BigDecimal categoryAmount = categoryAmountMap.get(categoryKey);
|
|
|
if(categoryAmount != null){
|
|
if(categoryAmount != null){
|
|
|
- categoryAmountMap.put(orderItem.getItemCategoryName(),categoryAmount.add(orderItem.getTotalAmount().setScale(2, RoundingMode.HALF_UP)));
|
|
|
|
|
|
|
+ categoryAmountMap.put(categoryKey,categoryAmount.add(orderItem.getTotalAmount().setScale(2, RoundingMode.HALF_UP)));
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
otherAmount = otherAmount.add(orderItem.getTotalAmount().setScale(2, RoundingMode.HALF_UP));
|
|
otherAmount = otherAmount.add(orderItem.getTotalAmount().setScale(2, RoundingMode.HALF_UP));
|