|
@@ -1192,23 +1192,26 @@ public class SiQueryService {
|
|
|
public ResultVo<List<SetlStatisticResult>> selectSetlinfoStatistics(SetlCondition condition) {
|
|
|
String begntime = condition.getMonth() + "-01 00:00:00.000";
|
|
|
String endtime = DateUtil.getMonthEndtime(condition.getMonth());
|
|
|
+ String insutype = condition.getInsutype();
|
|
|
+ if (StringUtil.isBlank(insutype)) {
|
|
|
+ insutype = "%%";
|
|
|
+ }
|
|
|
List<BaseSetlStatistics> baseStatistics;
|
|
|
-
|
|
|
switch (condition.getAdmdvsType()) {
|
|
|
case 1:
|
|
|
- baseStatistics = dao.selectBaseSetlStatisticsInProvinceLevel(begntime, endtime, condition.getInsutype());
|
|
|
+ baseStatistics = dao.selectBaseSetlStatisticsInProvinceLevel(begntime, endtime, insutype);
|
|
|
break;
|
|
|
case 2:
|
|
|
- baseStatistics = dao.selectBaseSetlStatisticsInChangshaCity(begntime, endtime, condition.getInsutype());
|
|
|
+ baseStatistics = dao.selectBaseSetlStatisticsInChangshaCity(begntime, endtime, insutype);
|
|
|
break;
|
|
|
case 3:
|
|
|
- baseStatistics = dao.selectBaseSetlStatisticsInProvinceOtherCities(begntime, endtime, condition.getInsutype());
|
|
|
+ baseStatistics = dao.selectBaseSetlStatisticsInProvinceOtherCities(begntime, endtime, insutype);
|
|
|
break;
|
|
|
case 4:
|
|
|
- baseStatistics = dao.selectBaseSetlStatisticsOutProvince(begntime, endtime, condition.getInsutype());
|
|
|
+ baseStatistics = dao.selectBaseSetlStatisticsOutProvince(begntime, endtime, insutype);
|
|
|
break;
|
|
|
default:
|
|
|
- baseStatistics = dao.selectBaseSetlStatisticsInAllPlaces(begntime, endtime, condition.getInsutype());
|
|
|
+ baseStatistics = dao.selectBaseSetlStatisticsInAllPlaces(begntime, endtime, insutype);
|
|
|
}
|
|
|
|
|
|
if (null == baseStatistics || baseStatistics.isEmpty()) {
|
|
@@ -1216,9 +1219,10 @@ public class SiQueryService {
|
|
|
}
|
|
|
|
|
|
Map<String, String> regionMap = new HashMap<>();
|
|
|
- Map<String, List<BaseSetlStatistics>> tempMap = new HashMap<>();
|
|
|
+ Map<String, List<BaseSetlStatistics>> admdvsSetldataMap = new HashMap<>();
|
|
|
|
|
|
baseStatistics.forEach(itm -> {
|
|
|
+ itm.setInsutypeName(Insutype.getName(itm.getInsutype()));
|
|
|
if (null != itm.getHospPay()) {
|
|
|
itm.setFundPaySumamt(DecimalUtil.minus(itm.getFundPaySumamt(), itm.getHospPay()));
|
|
|
}
|
|
@@ -1232,29 +1236,37 @@ public class SiQueryService {
|
|
|
admdvsName = region.getCode() + region.getName();
|
|
|
regionMap.put(key, admdvsName);
|
|
|
}
|
|
|
- if (tempMap.containsKey(admdvsName)) {
|
|
|
- tempMap.get(admdvsName).add(itm);
|
|
|
+ if (admdvsSetldataMap.containsKey(admdvsName)) {
|
|
|
+ admdvsSetldataMap.get(admdvsName).add(itm);
|
|
|
} else {
|
|
|
List<BaseSetlStatistics> tempList = new ArrayList<>();
|
|
|
tempList.add(itm);
|
|
|
- tempMap.put(admdvsName, tempList);
|
|
|
+ admdvsSetldataMap.put(admdvsName, tempList);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
List<SetlStatisticResult> resultList = new ArrayList<>();
|
|
|
- for (Map.Entry<String, List<BaseSetlStatistics>> entry : tempMap.entrySet()) {
|
|
|
- List<BaseSetlStatistics> mapStatistics = entry.getValue();
|
|
|
+ for (Map.Entry<String, List<BaseSetlStatistics>> entry : admdvsSetldataMap.entrySet()) {
|
|
|
+ List<BaseSetlStatistics> admdvsSetldataList = entry.getValue();
|
|
|
SetlStatisticResult resultItem = new SetlStatisticResult();
|
|
|
resultItem.setAdmdvsName(entry.getKey());
|
|
|
resultItem.setInsuplcAdmdvs(entry.getValue().get(0).getInsuplcAdmdvs().substring(0, 4) + "00");
|
|
|
- resultItem.setPsnSumamt(mapStatistics.size());
|
|
|
+ resultItem.setPsnSumamt(admdvsSetldataList.size());
|
|
|
+ if (StringUtil.notBlank(condition.getInsutype())) {
|
|
|
+ resultItem.setInsutype(condition.getInsutype());
|
|
|
+ resultItem.setInsutypeName(Insutype.getName(condition.getInsutype()));
|
|
|
+ resultItem.setChildKey(entry.getKey() + "-" + resultItem.getInsutypeName());
|
|
|
+ } else {
|
|
|
+ resultItem.setInsutypeName("-");
|
|
|
+ resultItem.setChildKey(entry.getKey());
|
|
|
+ }
|
|
|
String medfeeSumamt = "0";
|
|
|
String baseMedFundpaySumamt = "0";
|
|
|
String bigDssFundpaySumamt = "0";
|
|
|
String clvFundpaySumamt = "0";
|
|
|
String othFundpaySumamt = "0";
|
|
|
String fundpaySumamt = "0";
|
|
|
- for (BaseSetlStatistics itm : mapStatistics) {
|
|
|
+ for (BaseSetlStatistics itm : admdvsSetldataList) {
|
|
|
medfeeSumamt = DecimalUtil.add(medfeeSumamt, itm.getMedfeeSumamt());
|
|
|
baseMedFundpaySumamt = DecimalUtil.add(baseMedFundpaySumamt, itm.getHifpPay());
|
|
|
bigDssFundpaySumamt = DecimalUtil.add(bigDssFundpaySumamt, itm.getHifmiPay());
|
|
@@ -1272,6 +1284,65 @@ public class SiQueryService {
|
|
|
resultItem.setFundpaySumamt(fundpaySumamt);
|
|
|
resultList.add(resultItem);
|
|
|
}
|
|
|
+
|
|
|
+ if (StringUtil.isBlank(condition.getInsutype())) {
|
|
|
+ for (SetlStatisticResult resultItem : resultList) {
|
|
|
+ Map<String, List<BaseSetlStatistics>> insutypeSetldataMap = new HashMap<>();
|
|
|
+ String admdvsName = resultItem.getAdmdvsName();
|
|
|
+ List<BaseSetlStatistics> admdvsSetldataList = admdvsSetldataMap.get(admdvsName);
|
|
|
+ for (BaseSetlStatistics baseSetlStatistics : admdvsSetldataList) {
|
|
|
+ if (insutypeSetldataMap.containsKey(baseSetlStatistics.getInsutypeName())) {
|
|
|
+ insutypeSetldataMap.get(baseSetlStatistics.getInsutypeName()).add(baseSetlStatistics);
|
|
|
+ } else {
|
|
|
+ List<BaseSetlStatistics> tmpList = new ArrayList<>();
|
|
|
+ tmpList.add(baseSetlStatistics);
|
|
|
+ insutypeSetldataMap.put(baseSetlStatistics.getInsutypeName(), tmpList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (insutypeSetldataMap.size() == 1) {
|
|
|
+ resultItem.setInsutype(admdvsSetldataList.get(0).getInsutype());
|
|
|
+ resultItem.setInsutypeName(admdvsSetldataList.get(0).getInsutypeName());
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ List<SetlStatisticResult> children = new ArrayList<>();
|
|
|
+ for (Map.Entry<String, List<BaseSetlStatistics>> entry : insutypeSetldataMap.entrySet()) {
|
|
|
+ List<BaseSetlStatistics> insutypeSetldataList = entry.getValue();
|
|
|
+ SetlStatisticResult result = new SetlStatisticResult();
|
|
|
+ result.setAdmdvsName(resultItem.getAdmdvsName());
|
|
|
+ result.setInsuplcAdmdvs(resultItem.getInsuplcAdmdvs());
|
|
|
+ result.setPsnSumamt(insutypeSetldataList.size());
|
|
|
+ result.setInsutype(entry.getValue().get(0).getInsutype());
|
|
|
+ result.setInsutypeName(entry.getValue().get(0).getInsutypeName());
|
|
|
+ result.setChildKey(resultItem.getAdmdvsName() + "-" + result.getInsutypeName());
|
|
|
+ result.setIsChildren(true);
|
|
|
+ String medfeeSumamt = "0";
|
|
|
+ String baseMedFundpaySumamt = "0";
|
|
|
+ String bigDssFundpaySumamt = "0";
|
|
|
+ String clvFundpaySumamt = "0";
|
|
|
+ String othFundpaySumamt = "0";
|
|
|
+ String fundpaySumamt = "0";
|
|
|
+ for (BaseSetlStatistics itm : insutypeSetldataList) {
|
|
|
+ medfeeSumamt = DecimalUtil.add(medfeeSumamt, itm.getMedfeeSumamt());
|
|
|
+ baseMedFundpaySumamt = DecimalUtil.add(baseMedFundpaySumamt, itm.getHifpPay());
|
|
|
+ bigDssFundpaySumamt = DecimalUtil.add(bigDssFundpaySumamt, itm.getHifmiPay());
|
|
|
+ clvFundpaySumamt = DecimalUtil.add(clvFundpaySumamt, itm.getCvlservPay());
|
|
|
+ fundpaySumamt = DecimalUtil.add(fundpaySumamt, itm.getFundPaySumamt());
|
|
|
+ String othpay = DecimalUtil.minusLink(itm.getFundPaySumamt(), itm.getHifpPay(),
|
|
|
+ itm.getHifmiPay(), itm.getCvlservPay());
|
|
|
+ othFundpaySumamt = DecimalUtil.add(othFundpaySumamt, othpay);
|
|
|
+ }
|
|
|
+ result.setMedfeeSumamt(medfeeSumamt);
|
|
|
+ result.setBaseMedFundpaySumamt(baseMedFundpaySumamt);
|
|
|
+ result.setBigDssFundpaySumamt(bigDssFundpaySumamt);
|
|
|
+ result.setClvFundpaySumamt(clvFundpaySumamt);
|
|
|
+ result.setOthFundpaySumamt(othFundpaySumamt);
|
|
|
+ result.setFundpaySumamt(fundpaySumamt);
|
|
|
+ children.add(result);
|
|
|
+ }
|
|
|
+ resultItem.setChildren(children);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return ResultVoUtil.success(resultList);
|
|
|
}
|
|
|
|
|
@@ -1279,13 +1350,17 @@ public class SiQueryService {
|
|
|
String begntime = condition.getMonth() + "-01 00:00:00.000";
|
|
|
String endtime = DateUtil.getMonthEndtime(condition.getMonth());
|
|
|
String insuplcAdmdvs = condition.getInsuplcAdmdvs().substring(0, 4) + "%";
|
|
|
+ String insutype = condition.getInsutype();
|
|
|
+ if (StringUtil.isBlank(insutype)) {
|
|
|
+ insutype = "%%";
|
|
|
+ }
|
|
|
QueryWrapper<SiSetlinfo> wrapper = new QueryWrapper<>();
|
|
|
- wrapper.eq("insutype", condition.getInsutype());
|
|
|
wrapper.eq("setl_type", ClrType.INPATIENT.getCode());
|
|
|
wrapper.eq("revoked", YesOrNo.NO.getCode());
|
|
|
+ wrapper.like("insutype", insutype);
|
|
|
+ wrapper.like("insuplc_admdvs", insuplcAdmdvs);
|
|
|
wrapper.apply("setl_time>='" + begntime + "'");
|
|
|
wrapper.apply("setl_time<='" + endtime + "'");
|
|
|
- wrapper.apply("insuplc_admdvs like'" + insuplcAdmdvs + "'");
|
|
|
List<SiSetlinfo> list = setlinfoDao.selectList(wrapper);
|
|
|
Map<String, String> regionMap = new HashMap<>();
|
|
|
list.forEach(item -> {
|