|
@@ -8,6 +8,7 @@ import thyyxxk.webserver.constants.Capacity;
|
|
|
import thyyxxk.webserver.constants.ResponceType;
|
|
|
import thyyxxk.webserver.dao.his.reports.IllegalChargesAnalysisDao;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
+import thyyxxk.webserver.entity.datamodify.YzActOrder;
|
|
|
import thyyxxk.webserver.entity.dictionary.PureCodeName;
|
|
|
import thyyxxk.webserver.entity.reports.illegalchargesanalysis.IllegalChargeData;
|
|
|
import thyyxxk.webserver.entity.reports.illegalchargesanalysis.IllegalChargeTemplate;
|
|
@@ -17,6 +18,7 @@ import thyyxxk.webserver.utils.ResultVoUtil;
|
|
|
import thyyxxk.webserver.utils.StringUtil;
|
|
|
import thyyxxk.webserver.utils.TokenUtil;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -178,35 +180,35 @@ public class IllegalChargesAnalysisService {
|
|
|
}
|
|
|
|
|
|
private ResultVo<List<IllegalChargeData>> sameTimeCharge(IllegalChargeTemplate template) {
|
|
|
- List<IllegalChargeData> mainList = new ArrayList<>();
|
|
|
- for (PureCodeName mainCharge : template.getMainCharges()) {
|
|
|
- List<IllegalChargeData> temp = dao.selectChargeDataForSameTime(template.getStart(), template.getEnd(), mainCharge.getCode());
|
|
|
- temp.removeIf(item -> !template.getResponces().contains(item.getResponceType()));
|
|
|
- mainList.addAll(temp);
|
|
|
- }
|
|
|
- List<IllegalChargeData> conflictList = new ArrayList<>();
|
|
|
- for (PureCodeName conflictCharge : template.getConflictCharges()) {
|
|
|
- List<IllegalChargeData> temp = dao.selectChargeDataForSameTime(template.getStart(), template.getEnd(), conflictCharge.getCode());
|
|
|
- temp.removeIf(item -> !template.getResponces().contains(item.getResponceType()));
|
|
|
- conflictList.addAll(temp);
|
|
|
- }
|
|
|
- Map<String, IllegalChargeData> map = new HashMap<>(mainList.size());
|
|
|
- for (IllegalChargeData item : mainList) {
|
|
|
- String key = item.getInpatientNo() + "_" + item.getChargeDay();
|
|
|
- map.put(key, item);
|
|
|
- }
|
|
|
List<IllegalChargeData> resultList = new ArrayList<>();
|
|
|
- for (IllegalChargeData item : conflictList) {
|
|
|
- String key = item.getInpatientNo() + "_" + item.getChargeDay();
|
|
|
- if (map.containsKey(key)) {
|
|
|
- IllegalChargeData data = map.get(key);
|
|
|
- data.setConflictChargeCode(item.getChargeCode());
|
|
|
- data.setConflictChargeAmount(item.getChargeAmount());
|
|
|
- data.setConflictChargeDate(item.getChargeDate());
|
|
|
- data.setConflictChargeFee(item.getChargeFee());
|
|
|
- data.setConflictChargeName(item.getChargeName());
|
|
|
- data.setConflictDetailSn(item.getDetailSn());
|
|
|
- resultList.add(data);
|
|
|
+ for (PureCodeName main : template.getMainCharges()) {
|
|
|
+ List<IllegalChargeData> mainList = dao.selectChargeDataForSameTime(template.getStart(),
|
|
|
+ template.getEnd(), main.getCode());
|
|
|
+ mainList.removeIf(item -> !template.getResponces().contains(item.getResponceType()));
|
|
|
+ for (PureCodeName cflct : template.getConflictCharges()) {
|
|
|
+ List<IllegalChargeData> cflctList = dao.selectChargeDataForSameTime(template.getStart(),
|
|
|
+ template.getEnd(), cflct.getCode());
|
|
|
+ cflctList.removeIf(item -> !template.getResponces().contains(item.getResponceType()));
|
|
|
+ Map<String, IllegalChargeData> map = new HashMap<>(mainList.size());
|
|
|
+ for (IllegalChargeData item : mainList) {
|
|
|
+ String key = item.getInpatientNo() + "_" + item.getChargeDay();
|
|
|
+ map.put(key, item);
|
|
|
+ }
|
|
|
+ for (IllegalChargeData item : cflctList) {
|
|
|
+ String key = item.getInpatientNo() + "_" + item.getChargeDay();
|
|
|
+ if (map.containsKey(key)) {
|
|
|
+ IllegalChargeData data = map.get(key);
|
|
|
+ data.setConflictChargeCode(item.getChargeCode());
|
|
|
+ data.setConflictChargeAmount(item.getChargeAmount());
|
|
|
+ data.setConflictChargeDate(item.getChargeDate());
|
|
|
+ data.setConflictChargeFee(item.getChargeFee());
|
|
|
+ data.setConflictChargeName(item.getChargeName());
|
|
|
+ data.setConflictDetailSn(item.getDetailSn());
|
|
|
+ data.setConflictOrderNo(item.getOrderNo());
|
|
|
+ resultList.add(data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
return ResultVoUtil.success(resultList);
|
|
@@ -237,9 +239,29 @@ public class IllegalChargesAnalysisService {
|
|
|
return ResultVoUtil.success(resultList);
|
|
|
}
|
|
|
|
|
|
+ public ResultVo<List<YzActOrder>> selectOrderPair(BigDecimal orderNo, BigDecimal conflictOrderNo) {
|
|
|
+ List<YzActOrder> list = dao.selectYzActOrder(orderNo, conflictOrderNo);
|
|
|
+ if (list.isEmpty()) {
|
|
|
+ list = dao.selectYzInActOrder(orderNo, conflictOrderNo);
|
|
|
+ }
|
|
|
+ if (list.isEmpty()) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
|
|
|
+ }
|
|
|
+ if (list.size() == 1 || list.get(0).getActOrderNo().equals(orderNo)) {
|
|
|
+ return ResultVoUtil.success(list);
|
|
|
+ }
|
|
|
+ List<YzActOrder> tmp = new ArrayList<>();
|
|
|
+ tmp.add(list.get(1));
|
|
|
+ tmp.add(list.get(0));
|
|
|
+ return ResultVoUtil.success(tmp);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public ResultVo<List<IllegalChargeData>> queryHuanZheLiangCiRuYuanRiQi(IllegalChargeTemplate param) {
|
|
|
List<IllegalChargeData> list = dao.queryHuanZheLiangCiRuYuanRiQi(param.getStart(), param.getEnd(), param.getResponces());
|
|
|
+ if (list.isEmpty()) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
|
|
|
+ }
|
|
|
List<IllegalChargeData> illegalChargeData = dao.queryZhenDuan(list);
|
|
|
for (IllegalChargeData chargeData : list) {
|
|
|
for (IllegalChargeData illegalChargeDatum : illegalChargeData) {
|
|
@@ -250,7 +272,6 @@ public class IllegalChargesAnalysisService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
return ResultVoUtil.success(list);
|
|
|
}
|
|
|
}
|