|
@@ -421,17 +421,18 @@ public class XiangMuLuRuService {
|
|
|
// 用map 来保存正数的信息,但是有可能匹配的条件中map 的 key会一致 所以在这里使用 java8 的新特性 stream 流来进行分组 这样就不会因为key 一样导致数据被覆盖了
|
|
|
// 第一次 匹配 根据 医嘱号 收费时间 项目编码 数量 账页号
|
|
|
Map<String, List<ZyDetailCharge>> zhenShuMap = getYiZhuFeiYongZhenShu.stream().collect(
|
|
|
- Collectors.groupingBy(item -> item.getOrderNo() + DateUtil.formatDatetime(item.getChargeDate()) + item.getChargeCodeMx() + item.getChargeAmount() + item.getLedgerSn())
|
|
|
+ Collectors.groupingBy(item -> item.getOrderNo() + DateUtil.formatDatetime(item.getChargeDate()) + item.getChargeCodeMx() + item.getChargeAmount() + item.getChargeFee() + item.getLedgerSn())
|
|
|
);
|
|
|
// 用负数拼接的 key 去查找
|
|
|
for (ZyDetailCharge fuShu : getYiZhuFeiYongFuShu) {
|
|
|
- String key = fuShu.getOrderNo() + DateUtil.formatDatetime(fuShu.getChargeDate()) + fuShu.getChargeCodeMx() + fuShu.getChargeAmount().negate() + fuShu.getLedgerSn();
|
|
|
+ String key = fuShu.getOrderNo() + DateUtil.formatDatetime(fuShu.getChargeDate()) + fuShu.getChargeCodeMx() + fuShu.getChargeAmount().negate() + fuShu.getChargeFee().negate() + fuShu.getLedgerSn();
|
|
|
if (zhenShuMap.containsKey(key)) {
|
|
|
for (ZyDetailCharge zyDetailCharge : zhenShuMap.get(key)) {
|
|
|
if (zyDetailCharge.getTuiFeiFlag() == null && zyDetailCharge.getOriDetailSn() == null) {
|
|
|
fuShu.setOriDetailSn(zyDetailCharge.getDetailSn());
|
|
|
zyDetailCharge.setTuiFeiFlag(1);
|
|
|
piPei.add(fuShu);
|
|
|
+ log.info("第一次匹配==》流水{},匹配流水:{},", fuShu.getDetailSn(), fuShu.getOriDetailSn());
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -444,17 +445,18 @@ public class XiangMuLuRuService {
|
|
|
if (erCiPiPei.size() > 0) {
|
|
|
// 二次匹配 条件为 执行科室 项目编码 数量 账页号
|
|
|
Map<String, List<ZyDetailCharge>> erCiPiPeiZhenShu = getYiZhuFeiYongZhenShu.stream().collect(
|
|
|
- Collectors.groupingBy(item -> item.getExecUnit() + item.getChargeCodeMx() + item.getChargeAmount() + item.getLedgerSn())
|
|
|
+ Collectors.groupingBy(item -> item.getExecUnit() + item.getChargeCodeMx() + item.getChargeAmount() + item.getChargeFee() + item.getLedgerSn())
|
|
|
);
|
|
|
// 开始二次匹配
|
|
|
for (ZyDetailCharge zyDetailCharge : erCiPiPei) {
|
|
|
- String key = zyDetailCharge.getExecUnit() + zyDetailCharge.getChargeCodeMx() + zyDetailCharge.getChargeAmount().negate() + zyDetailCharge.getLedgerSn();
|
|
|
+ String key = zyDetailCharge.getExecUnit() + zyDetailCharge.getChargeCodeMx() + zyDetailCharge.getChargeAmount().negate() + zyDetailCharge.getChargeFee().negate() + zyDetailCharge.getLedgerSn();
|
|
|
if (erCiPiPeiZhenShu.containsKey(key)) {
|
|
|
for (ZyDetailCharge detailCharge : erCiPiPeiZhenShu.get(key)) {
|
|
|
if (detailCharge.getTuiFeiFlag() == null && detailCharge.getOriDetailSn() == null) {
|
|
|
zyDetailCharge.setOriDetailSn(detailCharge.getDetailSn());
|
|
|
- piPei.add(zyDetailCharge);
|
|
|
detailCharge.setTuiFeiFlag(1);
|
|
|
+ piPei.add(zyDetailCharge);
|
|
|
+ log.info("第二次匹配==》流水{},匹配流水:{},", zyDetailCharge.getDetailSn(), zyDetailCharge.getOriDetailSn());
|
|
|
break;
|
|
|
}
|
|
|
}
|