|
|
@@ -1,20 +1,26 @@
|
|
|
package org.jeecg.modules.medical.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import org.aspectj.lang.annotation.Before;
|
|
|
+import org.jeecg.modules.medical.entity.AdvanceWarningAudit;
|
|
|
import org.jeecg.modules.medical.response.DashboardStatisticsBarResponse;
|
|
|
import org.jeecg.modules.medical.response.DashboardStatisticsDetailedItem;
|
|
|
import org.jeecg.modules.medical.response.DashboardStatisticsLineResponse;
|
|
|
import org.jeecg.modules.medical.response.DashboardStatisticsViolateResponse;
|
|
|
+import org.jeecg.modules.medical.service.IAdvanceWarningAuditService;
|
|
|
+import org.jeecg.modules.medical.service.IAfterwardsAuditService;
|
|
|
import org.jeecg.modules.medical.service.IHomePageService;
|
|
|
+import org.jeecg.modules.medical.service.IMidIncidentAuditService;
|
|
|
+import org.jeecg.modules.medical.vo.StaticResponse;
|
|
|
+import org.jeecg.modules.system.entity.SysDictItem;
|
|
|
import org.jeecg.modules.utils.DateTimeUtil;
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* @author Scott
|
|
|
@@ -25,6 +31,13 @@ import java.util.List;
|
|
|
@Service
|
|
|
public class HomePageServiceImpl implements IHomePageService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IAdvanceWarningAuditService advanceWarningAuditService;
|
|
|
+ @Autowired
|
|
|
+ private IMidIncidentAuditService midIncidentAuditService;
|
|
|
+ @Autowired
|
|
|
+ private IAfterwardsAuditService afterwardsAuditService;
|
|
|
+
|
|
|
@Override
|
|
|
public DashboardStatisticsBarResponse loadStatisticsBar(String startTime, String endTime) {
|
|
|
DashboardStatisticsBarResponse sourceData = getSourceData();
|
|
|
@@ -46,28 +59,18 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
for (int i = 0; i <= diffDay; i++) {
|
|
|
Date ss = DateTimeUtil.addDay(startTimeDate, (long) i);
|
|
|
|
|
|
- BigDecimal factor = new BigDecimal("1");
|
|
|
- if (i > 0) {
|
|
|
- factor = getFactoryValue(i);
|
|
|
- }
|
|
|
|
|
|
- int t1 = new BigDecimal(sourceData.getSwipesTotal()).multiply(factor).intValue();
|
|
|
- result.setSwipesTotal(result.getSwipesTotal() + t1);
|
|
|
+ result.setSwipesTotal(result.getSwipesTotal());
|
|
|
|
|
|
- int t2 = new BigDecimal(sourceData.getBeforeReminderTotal()).multiply(factor).intValue();
|
|
|
- result.setBeforeReminderTotal(result.getBeforeReminderTotal() + t2);
|
|
|
+ result.setBeforeReminderTotal(result.getBeforeReminderTotal());
|
|
|
|
|
|
- int t3 = new BigDecimal(sourceData.getFormulaTotal()).multiply(factor).intValue();
|
|
|
- result.setFormulaTotal(result.getFormulaTotal() + t3);
|
|
|
+ result.setFormulaTotal(result.getFormulaTotal());
|
|
|
|
|
|
- int t4 = new BigDecimal(sourceData.getMiddleReviewTotal()).multiply(factor).intValue();
|
|
|
- result.setMiddleReviewTotal(result.getMiddleReviewTotal() + t4);
|
|
|
+ result.setMiddleReviewTotal(result.getMiddleReviewTotal());
|
|
|
|
|
|
- BigDecimal t5 = new BigDecimal(String.valueOf(sourceData.getViolationAmountTotal())).multiply(factor).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
- result.setViolationAmountTotal(result.getViolationAmountTotal().add(t5));
|
|
|
+ result.setViolationAmountTotal(result.getViolationAmountTotal());
|
|
|
|
|
|
- int t6 = new BigDecimal(sourceData.getAfterSupervisoryTotal()).multiply(factor).intValue();
|
|
|
- result.setAfterSupervisoryTotal(result.getAfterSupervisoryTotal() + t6);
|
|
|
+ result.setAfterSupervisoryTotal(result.getAfterSupervisoryTotal());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -85,28 +88,28 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
return sourceData;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- /**
|
|
|
- * 根据天数获取因子数
|
|
|
- * @param diffDay
|
|
|
- * @return
|
|
|
- */
|
|
|
- @NotNull
|
|
|
- public static BigDecimal getFactoryValue(long diffDay) {
|
|
|
- BigDecimal factory1 = new BigDecimal(diffDay).multiply(new BigDecimal("0.12"));
|
|
|
- if ((diffDay % 2) == 0) {
|
|
|
- factory1 = factory1.subtract(new BigDecimal(diffDay).multiply(new BigDecimal("0.10")));
|
|
|
- }
|
|
|
- return factory1;
|
|
|
- }
|
|
|
-
|
|
|
- public static void main(String[] args) {
|
|
|
- for (int i = 0; i < 20; i++) {
|
|
|
- BigDecimal factoryValue = HomePageServiceImpl.getFactoryValue(i);
|
|
|
- System.out.println(i);
|
|
|
- System.out.println(factoryValue);
|
|
|
- }
|
|
|
- }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 根据天数获取因子数
|
|
|
+// * @param diffDay
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// @NotNull
|
|
|
+// public static BigDecimal getFactoryValue(long diffDay) {
|
|
|
+// BigDecimal factory1 = new BigDecimal(diffDay).multiply(new BigDecimal("0.12"));
|
|
|
+// if ((diffDay % 2) == 0) {
|
|
|
+// factory1 = factory1.subtract(new BigDecimal(diffDay).multiply(new BigDecimal("0.10")));
|
|
|
+// }
|
|
|
+// return factory1;
|
|
|
+// }
|
|
|
+//
|
|
|
+// public static void main(String[] args) {
|
|
|
+// for (int i = 0; i < 20; i++) {
|
|
|
+// BigDecimal factoryValue = HomePageServiceImpl.getFactoryValue(i);
|
|
|
+// System.out.println(i);
|
|
|
+// System.out.println(factoryValue);
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
@Override
|
|
|
public DashboardStatisticsLineResponse loadStatisticsLine(String startTime, String endTime) {
|
|
|
@@ -130,29 +133,16 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
|
|
|
List<String> xDateList = new ArrayList<>();
|
|
|
|
|
|
- for (int i = 0; i <= diffDay; i ++) {
|
|
|
+ for (int i = 0; i <= diffDay; i++) {
|
|
|
Date ss = DateTimeUtil.addDay(startTimeDate, (long) i);
|
|
|
-
|
|
|
- BigDecimal factor = new BigDecimal("1");
|
|
|
- if (i > 0) {
|
|
|
- factor = getFactoryValue(i);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- // 事前提醒
|
|
|
- int beforeReminderItem = new BigDecimal(sourceData.getBeforeReminderTotal()).multiply(factor).intValue();
|
|
|
- beforeReminderList.add(beforeReminderItem);
|
|
|
- // 事中审查
|
|
|
- int middleReviewItem = new BigDecimal(sourceData.getMiddleReviewTotal()).multiply(factor).intValue();
|
|
|
- middleReviewList.add(middleReviewItem);
|
|
|
- // 事后监管
|
|
|
- int after = new BigDecimal(sourceData.getAfterSupervisoryTotal()).multiply(factor).intValue();
|
|
|
- afterList.add(after);
|
|
|
-
|
|
|
String xDate = DateTimeUtil.formatterStr(ss, "MM-dd");
|
|
|
xDateList.add(xDate);
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
+ beforeReminderList = advanceWarningAuditService.statisticsLine(startTimeDate, endTimeDate);
|
|
|
+ middleReviewList = midIncidentAuditService.statisticsLine(startTimeDate, endTimeDate);
|
|
|
+ afterList = afterwardsAuditService.statisticsLine(startTimeDate, endTimeDate);
|
|
|
+
|
|
|
JSONObject before = new JSONObject();
|
|
|
before.put("title", "事前提醒");
|
|
|
before.put("yData", beforeReminderList);
|
|
|
@@ -177,6 +167,7 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
|
|
|
/**
|
|
|
* 违规分类明细
|
|
|
+ *
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @return
|
|
|
@@ -184,6 +175,8 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
@Override
|
|
|
public DashboardStatisticsViolateResponse loadStatisticsViolateRulesTop(String startTime, String endTime) {
|
|
|
DashboardStatisticsBarResponse sourceData = this.loadStatisticsBar(startTime, endTime);
|
|
|
+
|
|
|
+
|
|
|
DashboardStatisticsViolateResponse result = new DashboardStatisticsViolateResponse();
|
|
|
// Date startTimeDate = DateTimeUtil.parse(startTime, DateTimeUtil.FULL_STYLE);
|
|
|
// Date endTimeDate = DateTimeUtil.parse(endTime, DateTimeUtil.FULL_STYLE);
|
|
|
@@ -192,13 +185,13 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
// 生成事前规则类型排名
|
|
|
DashboardStatisticsDetailedItem beforeRulesTop = generateBeforeRuleTop(sourceData);
|
|
|
// 生成事中规则类型排名
|
|
|
- DashboardStatisticsDetailedItem middleRulesTop = generateMiddleRuleTop(sourceData);
|
|
|
+ DashboardStatisticsDetailedItem middleRulesTop = generateMiddleRuleTop(startTime,endTime);
|
|
|
// 生成事后规则类型排名
|
|
|
- DashboardStatisticsDetailedItem afterRulesTop = generateAfterRuleTop(sourceData);
|
|
|
+ DashboardStatisticsDetailedItem afterRulesTop = generateAfterRuleTop(startTime,endTime);
|
|
|
// 生成事中医生违规数排名前五
|
|
|
- DashboardStatisticsDetailedItem middleDoctorsViolateTop = generateMiddleDoctorsViolateTop(sourceData);
|
|
|
+ DashboardStatisticsDetailedItem middleDoctorsViolateTop = generateMiddleDoctorsViolateTop(startTime,endTime);
|
|
|
// 生成事后医生违规数排名前五
|
|
|
- DashboardStatisticsDetailedItem afterDoctorsViolateTop = generateAfterDoctorsViolateTop(sourceData);
|
|
|
+ DashboardStatisticsDetailedItem afterDoctorsViolateTop = generateAfterDoctorsViolateTop(startTime,endTime);
|
|
|
|
|
|
result.setBeforeRulesTop(beforeRulesTop);
|
|
|
result.setMiddleRulesTop(middleRulesTop);
|
|
|
@@ -213,227 +206,166 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
public List<JSONObject> loadStatisticsPieChart(String startTime, String endTime) {
|
|
|
List<JSONObject> result = new ArrayList<>();
|
|
|
|
|
|
- DashboardStatisticsBarResponse sourceData = this.loadStatisticsBar(startTime, endTime);
|
|
|
-
|
|
|
- Integer afterSupervisoryTotal = sourceData.getAfterSupervisoryTotal();
|
|
|
-
|
|
|
- BigDecimal top1 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.25")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top2 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.13")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top3 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.15")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top4 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.11")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top5 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.05")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
-
|
|
|
- JSONObject item1 = new JSONObject();
|
|
|
- item1.put("name", "心电图检查");
|
|
|
- item1.put("value", top1);
|
|
|
- result.add(item1);
|
|
|
-
|
|
|
- JSONObject item2 = new JSONObject();
|
|
|
- item2.put("name", "血塞通注射液");
|
|
|
- item2.put("value", top2);
|
|
|
- result.add(item2);
|
|
|
-
|
|
|
- JSONObject item3 = new JSONObject();
|
|
|
- item3.put("name", "血压检查");
|
|
|
- item3.put("value", top3);
|
|
|
- result.add(item3);
|
|
|
-
|
|
|
- JSONObject item4 = new JSONObject();
|
|
|
- item4.put("name", "血常规检查");
|
|
|
- item4.put("value", top4);
|
|
|
- result.add(item4);
|
|
|
-
|
|
|
- JSONObject item5 = new JSONObject();
|
|
|
- item5.put("name", "脉络宁注射液");
|
|
|
- item5.put("value", top5);
|
|
|
- result.add(item5);
|
|
|
+ List<StaticResponse> hashMaps = afterwardsAuditService.statisticsProject(startTime, endTime);
|
|
|
+ hashMaps.forEach(it->{
|
|
|
+ JSONObject item = new JSONObject();
|
|
|
+ item.put("title",it.getName());
|
|
|
+ item.put("total", it.getNum());
|
|
|
+ result.add(item);
|
|
|
+ });
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 事后医生违规数排名前五
|
|
|
- * @param sourceData
|
|
|
+ *
|
|
|
+ * @param
|
|
|
* @return
|
|
|
*/
|
|
|
- private DashboardStatisticsDetailedItem generateAfterDoctorsViolateTop(DashboardStatisticsBarResponse sourceData) {
|
|
|
- Integer afterSupervisoryTotal = sourceData.getAfterSupervisoryTotal();
|
|
|
+ private DashboardStatisticsDetailedItem generateAfterDoctorsViolateTop(String startTime,String endTime) {
|
|
|
+ Integer afterSupervisoryTotal = 121;
|
|
|
DashboardStatisticsDetailedItem afterDoctorsViolateTop = new DashboardStatisticsDetailedItem();
|
|
|
- afterDoctorsViolateTop.setTitle("事中医生违规数排名前五");
|
|
|
+ afterDoctorsViolateTop.setTitle("事后医生违规数排名前五");
|
|
|
afterDoctorsViolateTop.setTotal(afterSupervisoryTotal);
|
|
|
- ArrayList<JSONObject> rule1 = new ArrayList<>();
|
|
|
+ ArrayList<JSONObject> rule = new ArrayList<>();
|
|
|
|
|
|
|
|
|
- BigDecimal top1 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.25")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top2 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.13")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top3 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.15")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top4 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.11")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top5 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.03")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
-
|
|
|
- JSONObject item1 = new JSONObject();
|
|
|
- item1.put("title", "陈晓利");
|
|
|
- item1.put("total", top1);
|
|
|
- rule1.add(item1);
|
|
|
-
|
|
|
- JSONObject item2 = new JSONObject();
|
|
|
- item2.put("title", "赵科林");
|
|
|
- item2.put("total", top2);
|
|
|
- rule1.add(item2);
|
|
|
-
|
|
|
- JSONObject item3 = new JSONObject();
|
|
|
- item3.put("title", "张鸿飞");
|
|
|
- item3.put("total", top3);
|
|
|
- rule1.add(item3);
|
|
|
-
|
|
|
- JSONObject item4 = new JSONObject();
|
|
|
- item4.put("title", "刘晓芳");
|
|
|
- item4.put("total", top4);
|
|
|
- rule1.add(item4);
|
|
|
-
|
|
|
- JSONObject item5 = new JSONObject();
|
|
|
- item5.put("title", "张利");
|
|
|
- item5.put("total", top5);
|
|
|
- rule1.add(item5);
|
|
|
-
|
|
|
- afterDoctorsViolateTop.setList(rule1);
|
|
|
+ List<StaticResponse> hashMaps = afterwardsAuditService.statisticsDoctorViolate(startTime, endTime);
|
|
|
+ hashMaps.forEach(it->{
|
|
|
+ JSONObject item = new JSONObject();
|
|
|
+ item.put("title",it.getName());
|
|
|
+ item.put("total", it.getNum());
|
|
|
+ rule.add(item);
|
|
|
+ });
|
|
|
+ afterDoctorsViolateTop.setList(rule);
|
|
|
return afterDoctorsViolateTop;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 生成事中医生违规数排名
|
|
|
- * @param sourceData
|
|
|
+ *
|
|
|
+ * @param
|
|
|
* @return
|
|
|
*/
|
|
|
- private DashboardStatisticsDetailedItem generateMiddleDoctorsViolateTop(DashboardStatisticsBarResponse sourceData) {
|
|
|
+ private DashboardStatisticsDetailedItem generateMiddleDoctorsViolateTop(String startTime,String endTime) {
|
|
|
// 事中提醒总和
|
|
|
- Integer middleReviewTotal = sourceData.getMiddleReviewTotal();
|
|
|
+ Integer middleReviewTotal = 3456;
|
|
|
DashboardStatisticsDetailedItem middleDoctorsViolateTop = new DashboardStatisticsDetailedItem();
|
|
|
middleDoctorsViolateTop.setTitle("事中医生违规数排名前五");
|
|
|
middleDoctorsViolateTop.setTotal(middleReviewTotal);
|
|
|
- ArrayList<JSONObject> rule1 = new ArrayList<>();
|
|
|
-
|
|
|
- BigDecimal top1 = new BigDecimal(middleReviewTotal).multiply(new BigDecimal("0.25")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top2 = new BigDecimal(middleReviewTotal).multiply(new BigDecimal("0.13")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top3 = new BigDecimal(middleReviewTotal).multiply(new BigDecimal("0.15")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top4 = new BigDecimal(middleReviewTotal).multiply(new BigDecimal("0.11")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top5 = new BigDecimal(middleReviewTotal).multiply(new BigDecimal("0.05")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
-
|
|
|
- JSONObject item1 = new JSONObject();
|
|
|
- item1.put("title", "陈晓利");
|
|
|
- item1.put("total", top1);
|
|
|
- rule1.add(item1);
|
|
|
-
|
|
|
- JSONObject item2 = new JSONObject();
|
|
|
- item2.put("title", "张鸿飞");
|
|
|
- item2.put("total", top2);
|
|
|
- rule1.add(item2);
|
|
|
-
|
|
|
- JSONObject item3 = new JSONObject();
|
|
|
- item3.put("title", "赵科林");
|
|
|
- item3.put("total", top3);
|
|
|
- rule1.add(item3);
|
|
|
-
|
|
|
- JSONObject item4 = new JSONObject();
|
|
|
- item4.put("title", "刘晓芳");
|
|
|
- item4.put("total", top4);
|
|
|
- rule1.add(item4);
|
|
|
-
|
|
|
- JSONObject item5 = new JSONObject();
|
|
|
- item5.put("title", "张利");
|
|
|
- item5.put("total", top5);
|
|
|
- rule1.add(item5);
|
|
|
- middleDoctorsViolateTop.setList(rule1);
|
|
|
+ ArrayList<JSONObject> rule = new ArrayList<>();
|
|
|
+
|
|
|
+ List<StaticResponse> hashMaps = midIncidentAuditService.statisticsDoctorViolate(startTime, endTime);
|
|
|
+ hashMaps.forEach(it->{
|
|
|
+ JSONObject item = new JSONObject();
|
|
|
+ item.put("title",it.getName());
|
|
|
+ item.put("total", it.getNum());
|
|
|
+ rule.add(item);
|
|
|
+ });
|
|
|
+ middleDoctorsViolateTop.setList(rule);
|
|
|
return middleDoctorsViolateTop;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 生成事后规则类型排名
|
|
|
- * @param sourceData
|
|
|
+ *
|
|
|
+ * @param
|
|
|
* @return
|
|
|
*/
|
|
|
- private DashboardStatisticsDetailedItem generateAfterRuleTop(DashboardStatisticsBarResponse sourceData) {
|
|
|
+ private DashboardStatisticsDetailedItem generateAfterRuleTop(String startTime,String endTime) {
|
|
|
DashboardStatisticsDetailedItem afterRulesTop = new DashboardStatisticsDetailedItem();
|
|
|
afterRulesTop.setTitle("事后规则类型排名");
|
|
|
- ArrayList<JSONObject> rule1 = new ArrayList<>();
|
|
|
- Integer afterSupervisoryTotal = sourceData.getAfterSupervisoryTotal();
|
|
|
+ ArrayList<JSONObject> rule = new ArrayList<>();
|
|
|
+ Integer afterSupervisoryTotal = 123;
|
|
|
afterRulesTop.setTotal(afterSupervisoryTotal);
|
|
|
- BigDecimal top1 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.25")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top2 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.13")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top3 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.15")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top4 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.11")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top5 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.05")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
-
|
|
|
- JSONObject item1 = new JSONObject();
|
|
|
- item1.put("title", "不合理住院");
|
|
|
- item1.put("total", top1);
|
|
|
- rule1.add(item1);
|
|
|
|
|
|
- JSONObject item2 = new JSONObject();
|
|
|
- item2.put("title", "仅有I级护理病例统计");
|
|
|
- item2.put("total", top2);
|
|
|
- rule1.add(item2);
|
|
|
-
|
|
|
- JSONObject item3 = new JSONObject();
|
|
|
- item3.put("title", "限生育保险");
|
|
|
- item3.put("total", top3);
|
|
|
- rule1.add(item3);
|
|
|
|
|
|
- JSONObject item4 = new JSONObject();
|
|
|
- item4.put("title", "非医保支付中药引片");
|
|
|
- item4.put("total", top4);
|
|
|
- rule1.add(item4);
|
|
|
-
|
|
|
- JSONObject item5 = new JSONObject();
|
|
|
- item5.put("title", "不合理用药"); //TODO 等待数据
|
|
|
- item5.put("total", top5);
|
|
|
- rule1.add(item5);
|
|
|
- afterRulesTop.setList(rule1);
|
|
|
+ List<StaticResponse> hashMaps = afterwardsAuditService.statisticsAfterRule(startTime, endTime);
|
|
|
+ hashMaps.forEach(it->{
|
|
|
+ JSONObject item = new JSONObject();
|
|
|
+ item.put("title",it.getName());
|
|
|
+ item.put("total", it.getNum());
|
|
|
+ rule.add(item);
|
|
|
+ });
|
|
|
+// BigDecimal top1 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.25")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
+// BigDecimal top2 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.13")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
+// BigDecimal top3 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.15")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
+// BigDecimal top4 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.11")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
+// BigDecimal top5 = new BigDecimal(afterSupervisoryTotal).multiply(new BigDecimal("0.05")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
+//
|
|
|
+// JSONObject item1 = new JSONObject();
|
|
|
+// item1.put("title", "不合理住院");
|
|
|
+// item1.put("total", top1);
|
|
|
+// rule1.add(item1);
|
|
|
+//
|
|
|
+// JSONObject item2 = new JSONObject();
|
|
|
+// item2.put("title", "仅有I级护理病例统计");
|
|
|
+// item2.put("total", top2);
|
|
|
+// rule1.add(item2);
|
|
|
+//
|
|
|
+// JSONObject item3 = new JSONObject();
|
|
|
+// item3.put("title", "限生育保险");
|
|
|
+// item3.put("total", top3);
|
|
|
+// rule1.add(item3);
|
|
|
+//
|
|
|
+// JSONObject item4 = new JSONObject();
|
|
|
+// item4.put("title", "非医保支付中药引片");
|
|
|
+// item4.put("total", top4);
|
|
|
+// rule1.add(item4);
|
|
|
+//
|
|
|
+// JSONObject item5 = new JSONObject();
|
|
|
+// item5.put("title", "不合理用药"); //TODO 等待数据
|
|
|
+// item5.put("total", top5);
|
|
|
+// rule1.add(item5);
|
|
|
+ afterRulesTop.setList(rule);
|
|
|
return afterRulesTop;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 生成事中规则类型排名
|
|
|
- * @param sourceData
|
|
|
+ *
|
|
|
+ * @param
|
|
|
* @return
|
|
|
*/
|
|
|
- private DashboardStatisticsDetailedItem generateMiddleRuleTop(DashboardStatisticsBarResponse sourceData) {
|
|
|
+ private DashboardStatisticsDetailedItem generateMiddleRuleTop(String startTime, String endTime) {
|
|
|
DashboardStatisticsDetailedItem middleRulesTop = new DashboardStatisticsDetailedItem();
|
|
|
middleRulesTop.setTitle("事中规则类型排名");
|
|
|
- ArrayList<JSONObject> rule1 = new ArrayList<>();
|
|
|
-
|
|
|
- Integer middleReviewTotal = sourceData.getMiddleReviewTotal();
|
|
|
- middleRulesTop.setTotal(middleReviewTotal);
|
|
|
- BigDecimal top1 = new BigDecimal(middleReviewTotal).multiply(new BigDecimal("0.23")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top2 = new BigDecimal(middleReviewTotal).multiply(new BigDecimal("0.16")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top3 = new BigDecimal(middleReviewTotal).multiply(new BigDecimal("0.14")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top4 = new BigDecimal(middleReviewTotal).multiply(new BigDecimal("0.11")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
- BigDecimal top5 = new BigDecimal(middleReviewTotal).multiply(new BigDecimal("0.05")).setScale(0, BigDecimal.ROUND_HALF_DOWN);
|
|
|
-
|
|
|
- JSONObject item1 = new JSONObject();
|
|
|
- item1.put("title", "限适应症和支付疗程(药品)");
|
|
|
- item1.put("total", top1);
|
|
|
- rule1.add(item1);
|
|
|
-
|
|
|
- JSONObject item2 = new JSONObject();
|
|
|
- item2.put("title", "限适应症(药品)");
|
|
|
- item2.put("total", top2);
|
|
|
- rule1.add(item2);
|
|
|
-
|
|
|
- JSONObject item3 = new JSONObject();
|
|
|
- item3.put("title", "限医院等级适应症疗程(药品)");
|
|
|
- item3.put("total", top3);
|
|
|
- rule1.add(item3);
|
|
|
-
|
|
|
- JSONObject item4 = new JSONObject();
|
|
|
- item4.put("title", "限病种(药品)");
|
|
|
- item4.put("total", top4);
|
|
|
- rule1.add(item4);
|
|
|
-
|
|
|
- JSONObject item5 = new JSONObject();
|
|
|
- item5.put("title", "限适应症"); //TODO 等待数据
|
|
|
- item5.put("total", top5);
|
|
|
- rule1.add(item5);
|
|
|
- middleRulesTop.setList(rule1);
|
|
|
+ ArrayList<JSONObject> rule = new ArrayList<>();
|
|
|
+ Integer total = 345;
|
|
|
+ middleRulesTop.setTotal(total);
|
|
|
+ List<StaticResponse> hashMaps = midIncidentAuditService.statisticsMidRule(startTime, endTime);
|
|
|
+ hashMaps.forEach(it->{
|
|
|
+ JSONObject item = new JSONObject();
|
|
|
+ item.put("title",it.getName());
|
|
|
+ item.put("total", it.getNum());
|
|
|
+ rule.add(item);
|
|
|
+ });
|
|
|
+// JSONObject item1 = new JSONObject();
|
|
|
+// item1.put("title", "限适应症和支付疗程(药品)");
|
|
|
+// item1.put("total", top1);
|
|
|
+// rule1.add(item1);
|
|
|
+//
|
|
|
+// JSONObject item2 = new JSONObject();
|
|
|
+// item2.put("title", "限适应症(药品)");
|
|
|
+// item2.put("total", top2);
|
|
|
+// rule1.add(item2);
|
|
|
+//
|
|
|
+// JSONObject item3 = new JSONObject();
|
|
|
+// item3.put("title", "限医院等级适应症疗程(药品)");
|
|
|
+// item3.put("total", top3);
|
|
|
+// rule1.add(item3);
|
|
|
+//
|
|
|
+// JSONObject item4 = new JSONObject();
|
|
|
+// item4.put("title", "限病种(药品)");
|
|
|
+// item4.put("total", top4);
|
|
|
+// rule1.add(item4);
|
|
|
+//
|
|
|
+// JSONObject item5 = new JSONObject();
|
|
|
+// item5.put("title", "限适应症"); //TODO 等待数据
|
|
|
+// item5.put("total", top5);
|
|
|
+// rule1.add(item5);
|
|
|
+ middleRulesTop.setList(rule);
|
|
|
return middleRulesTop;
|
|
|
}
|
|
|
|