|
@@ -79,16 +79,20 @@ public class MenZhengXiangMuServer {
|
|
|
public List<MzChargeDetail> tcTree(List<MzChargeDetail> tempList) {
|
|
|
List<MzChargeDetail> resultList = new ArrayList<>();
|
|
|
Map<String, MzChargeDetail> treeMap = new HashMap<>(tempList.size());
|
|
|
+ Map<String, MzChargeDetail> 无父级节点 = tempList.stream().collect(
|
|
|
+ Collectors.toMap(item -> item.getPatientId() + item.getTimes() + item.getReceiptNo() + item.getOrderNo() + item.getChargeItemCode(),
|
|
|
+ a -> a, (k1, k2) -> k1)
|
|
|
+ );
|
|
|
for (MzChargeDetail item : tempList) {
|
|
|
String key = item.getPatientId() + item.getTimes() + item.getReceiptNo() + item.getOrderNo() + item.getChargeItemCode();
|
|
|
treeMap.put(key, item);
|
|
|
- if (item.getBillItemCode().equals("TC")) {
|
|
|
+ if ("TC".equals(item.getBillItemCode())) {
|
|
|
if (BigUtils.bigDaYu(item.getUnitPrice(), BigDecimal.ZERO)) {
|
|
|
item.setChargeFee(item.getUnitPrice().multiply(item.getQuantity()).multiply(item.getDrugWin()));
|
|
|
- } else {
|
|
|
- item.setChargeName(item.getTcName() + "(套餐)");
|
|
|
}
|
|
|
+ item.setChargeName(item.getTcName() + "(套餐)");
|
|
|
resultList.add(item);
|
|
|
+ 无父级节点.remove(key);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -104,8 +108,12 @@ public class MenZhengXiangMuServer {
|
|
|
}
|
|
|
template.setChargeFee(template.getChargeFee().add(item.getUnitPrice().multiply(item.getQuantity()).multiply(item.getDrugWin())));
|
|
|
template.getList().add(item);
|
|
|
+ 无父级节点.remove(key);
|
|
|
}
|
|
|
}
|
|
|
+ if (!无父级节点.isEmpty()) {
|
|
|
+ resultList.addAll(无父级节点.values());
|
|
|
+ }
|
|
|
return resultList;
|
|
|
}
|
|
|
|