|
|
@@ -4,14 +4,12 @@ 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.entity.PrescriptionOrder;
|
|
|
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.service.*;
|
|
|
import org.jeecg.modules.medical.vo.StaticResponse;
|
|
|
import org.jeecg.modules.system.entity.SysDictItem;
|
|
|
import org.jeecg.modules.utils.DateTimeUtil;
|
|
|
@@ -37,11 +35,15 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
private IMidIncidentAuditService midIncidentAuditService;
|
|
|
@Autowired
|
|
|
private IAfterwardsAuditService afterwardsAuditService;
|
|
|
+ @Autowired
|
|
|
+ private IOutpatientSettleBillService outpatientSettleBillService;
|
|
|
+ @Autowired
|
|
|
+ private IPrescriptionOrderService prescriptionOrderService;
|
|
|
|
|
|
@Override
|
|
|
public DashboardStatisticsBarResponse loadStatisticsBar(String startTime, String endTime) {
|
|
|
- DashboardStatisticsBarResponse sourceData = getSourceData();
|
|
|
-
|
|
|
+ //只算当日 数量统计汇总
|
|
|
+ DashboardStatisticsBarResponse sourceData = getSourceData(startTime, endTime);
|
|
|
DashboardStatisticsBarResponse result = new DashboardStatisticsBarResponse();
|
|
|
result.setSwipesTotal(sourceData.getSwipesTotal());
|
|
|
result.setBeforeReminderTotal(sourceData.getBeforeReminderTotal());
|
|
|
@@ -49,42 +51,27 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
result.setMiddleReviewTotal(sourceData.getMiddleReviewTotal());
|
|
|
result.setViolationAmountTotal(sourceData.getViolationAmountTotal());
|
|
|
result.setAfterSupervisoryTotal(sourceData.getAfterSupervisoryTotal());
|
|
|
-
|
|
|
- Date startTimeDate = DateTimeUtil.parse(startTime, DateTimeUtil.FULL_STYLE);
|
|
|
- Date endTimeDate = DateTimeUtil.parse(endTime, DateTimeUtil.FULL_STYLE);
|
|
|
-
|
|
|
- long diffDay = DateTimeUtil.subDay(startTimeDate, endTimeDate);
|
|
|
-
|
|
|
- if (diffDay > 0) {
|
|
|
- for (int i = 0; i <= diffDay; i++) {
|
|
|
- Date ss = DateTimeUtil.addDay(startTimeDate, (long) i);
|
|
|
-
|
|
|
-
|
|
|
- result.setSwipesTotal(result.getSwipesTotal());
|
|
|
-
|
|
|
- result.setBeforeReminderTotal(result.getBeforeReminderTotal());
|
|
|
-
|
|
|
- result.setFormulaTotal(result.getFormulaTotal());
|
|
|
-
|
|
|
- result.setMiddleReviewTotal(result.getMiddleReviewTotal());
|
|
|
-
|
|
|
- result.setViolationAmountTotal(result.getViolationAmountTotal());
|
|
|
-
|
|
|
- result.setAfterSupervisoryTotal(result.getAfterSupervisoryTotal());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+// Date startTimeDate = DateTimeUtil.parse(startTime, DateTimeUtil.FULL_STYLE);
|
|
|
+// Date endTimeDate = DateTimeUtil.parse(endTime, DateTimeUtil.FULL_STYLE);
|
|
|
+// long diffDay = DateTimeUtil.subDay(startTimeDate, endTimeDate);
|
|
|
+ result.setSwipesTotal(result.getSwipesTotal());
|
|
|
+ result.setBeforeReminderTotal(result.getBeforeReminderTotal());
|
|
|
+ result.setFormulaTotal(result.getFormulaTotal());
|
|
|
+ result.setMiddleReviewTotal(result.getMiddleReviewTotal());
|
|
|
+ result.setViolationAmountTotal(result.getViolationAmountTotal());
|
|
|
+ result.setAfterSupervisoryTotal(result.getAfterSupervisoryTotal());
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- private static DashboardStatisticsBarResponse getSourceData() {
|
|
|
+ public DashboardStatisticsBarResponse getSourceData(String startTime, String endTime) {
|
|
|
DashboardStatisticsBarResponse sourceData = new DashboardStatisticsBarResponse();
|
|
|
- sourceData.setSwipesTotal(300);
|
|
|
- sourceData.setBeforeReminderTotal(260);
|
|
|
- sourceData.setFormulaTotal(280);
|
|
|
- sourceData.setMiddleReviewTotal(100);
|
|
|
- sourceData.setViolationAmountTotal(new BigDecimal("2880.05"));
|
|
|
- sourceData.setAfterSupervisoryTotal(90);
|
|
|
+ //只算当日
|
|
|
+ sourceData.setSwipesTotal(outpatientSettleBillService.statisticsVisit(startTime, endTime));
|
|
|
+ sourceData.setBeforeReminderTotal(advanceWarningAuditService.statisticsLine(startTime, endTime).get(0).intValue());
|
|
|
+ sourceData.setFormulaTotal(prescriptionOrderService.statisticsFormula(startTime, endTime));
|
|
|
+ sourceData.setMiddleReviewTotal(midIncidentAuditService.statisticsLine(startTime, endTime).get(0).intValue());
|
|
|
+ sourceData.setViolationAmountTotal(afterwardsAuditService.statisticsAmount(startTime, endTime));
|
|
|
+ sourceData.setAfterSupervisoryTotal(afterwardsAuditService.statisticsLine(startTime, endTime).get(0).intValue());
|
|
|
return sourceData;
|
|
|
}
|
|
|
|
|
|
@@ -139,9 +126,9 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
xDateList.add(xDate);
|
|
|
}
|
|
|
|
|
|
- beforeReminderList = advanceWarningAuditService.statisticsLine(startTimeDate, endTimeDate);
|
|
|
- middleReviewList = midIncidentAuditService.statisticsLine(startTimeDate, endTimeDate);
|
|
|
- afterList = afterwardsAuditService.statisticsLine(startTimeDate, endTimeDate);
|
|
|
+ beforeReminderList = advanceWarningAuditService.statisticsLine(startTime, endTime);
|
|
|
+ middleReviewList = midIncidentAuditService.statisticsLine(startTime, endTime);
|
|
|
+ afterList = afterwardsAuditService.statisticsLine(startTime, endTime);
|
|
|
|
|
|
JSONObject before = new JSONObject();
|
|
|
before.put("title", "事前提醒");
|
|
|
@@ -185,13 +172,13 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
// 生成事前规则类型排名
|
|
|
DashboardStatisticsDetailedItem beforeRulesTop = generateBeforeRuleTop(sourceData);
|
|
|
// 生成事中规则类型排名
|
|
|
- DashboardStatisticsDetailedItem middleRulesTop = generateMiddleRuleTop(startTime,endTime);
|
|
|
+ DashboardStatisticsDetailedItem middleRulesTop = generateMiddleRuleTop(startTime, endTime);
|
|
|
// 生成事后规则类型排名
|
|
|
- DashboardStatisticsDetailedItem afterRulesTop = generateAfterRuleTop(startTime,endTime);
|
|
|
+ DashboardStatisticsDetailedItem afterRulesTop = generateAfterRuleTop(startTime, endTime);
|
|
|
// 生成事中医生违规数排名前五
|
|
|
- DashboardStatisticsDetailedItem middleDoctorsViolateTop = generateMiddleDoctorsViolateTop(startTime,endTime);
|
|
|
+ DashboardStatisticsDetailedItem middleDoctorsViolateTop = generateMiddleDoctorsViolateTop(startTime, endTime);
|
|
|
// 生成事后医生违规数排名前五
|
|
|
- DashboardStatisticsDetailedItem afterDoctorsViolateTop = generateAfterDoctorsViolateTop(startTime,endTime);
|
|
|
+ DashboardStatisticsDetailedItem afterDoctorsViolateTop = generateAfterDoctorsViolateTop(startTime, endTime);
|
|
|
|
|
|
result.setBeforeRulesTop(beforeRulesTop);
|
|
|
result.setMiddleRulesTop(middleRulesTop);
|
|
|
@@ -205,11 +192,10 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
@Override
|
|
|
public List<JSONObject> loadStatisticsPieChart(String startTime, String endTime) {
|
|
|
List<JSONObject> result = new ArrayList<>();
|
|
|
-
|
|
|
- List<StaticResponse> hashMaps = afterwardsAuditService.statisticsProject(startTime, endTime);
|
|
|
- hashMaps.forEach(it->{
|
|
|
+ List<StaticResponse> hashMaps = afterwardsAuditService.statisticsProject(startTime, endTime);
|
|
|
+ hashMaps.forEach(it -> {
|
|
|
JSONObject item = new JSONObject();
|
|
|
- item.put("title",it.getName());
|
|
|
+ item.put("title", it.getName());
|
|
|
item.put("total", it.getNum());
|
|
|
result.add(item);
|
|
|
});
|
|
|
@@ -223,7 +209,7 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
- private DashboardStatisticsDetailedItem generateAfterDoctorsViolateTop(String startTime,String endTime) {
|
|
|
+ private DashboardStatisticsDetailedItem generateAfterDoctorsViolateTop(String startTime, String endTime) {
|
|
|
Integer afterSupervisoryTotal = 121;
|
|
|
DashboardStatisticsDetailedItem afterDoctorsViolateTop = new DashboardStatisticsDetailedItem();
|
|
|
afterDoctorsViolateTop.setTitle("事后医生违规数排名前五");
|
|
|
@@ -231,10 +217,10 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
ArrayList<JSONObject> rule = new ArrayList<>();
|
|
|
|
|
|
|
|
|
- List<StaticResponse> hashMaps = afterwardsAuditService.statisticsDoctorViolate(startTime, endTime);
|
|
|
- hashMaps.forEach(it->{
|
|
|
+ List<StaticResponse> hashMaps = afterwardsAuditService.statisticsDoctorViolate(startTime, endTime);
|
|
|
+ hashMaps.forEach(it -> {
|
|
|
JSONObject item = new JSONObject();
|
|
|
- item.put("title",it.getName());
|
|
|
+ item.put("title", it.getName());
|
|
|
item.put("total", it.getNum());
|
|
|
rule.add(item);
|
|
|
});
|
|
|
@@ -248,7 +234,7 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
- private DashboardStatisticsDetailedItem generateMiddleDoctorsViolateTop(String startTime,String endTime) {
|
|
|
+ private DashboardStatisticsDetailedItem generateMiddleDoctorsViolateTop(String startTime, String endTime) {
|
|
|
// 事中提醒总和
|
|
|
Integer middleReviewTotal = 3456;
|
|
|
DashboardStatisticsDetailedItem middleDoctorsViolateTop = new DashboardStatisticsDetailedItem();
|
|
|
@@ -256,10 +242,10 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
middleDoctorsViolateTop.setTotal(middleReviewTotal);
|
|
|
ArrayList<JSONObject> rule = new ArrayList<>();
|
|
|
|
|
|
- List<StaticResponse> hashMaps = midIncidentAuditService.statisticsDoctorViolate(startTime, endTime);
|
|
|
- hashMaps.forEach(it->{
|
|
|
+ List<StaticResponse> hashMaps = midIncidentAuditService.statisticsDoctorViolate(startTime, endTime);
|
|
|
+ hashMaps.forEach(it -> {
|
|
|
JSONObject item = new JSONObject();
|
|
|
- item.put("title",it.getName());
|
|
|
+ item.put("title", it.getName());
|
|
|
item.put("total", it.getNum());
|
|
|
rule.add(item);
|
|
|
});
|
|
|
@@ -273,7 +259,7 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
- private DashboardStatisticsDetailedItem generateAfterRuleTop(String startTime,String endTime) {
|
|
|
+ private DashboardStatisticsDetailedItem generateAfterRuleTop(String startTime, String endTime) {
|
|
|
DashboardStatisticsDetailedItem afterRulesTop = new DashboardStatisticsDetailedItem();
|
|
|
afterRulesTop.setTitle("事后规则类型排名");
|
|
|
ArrayList<JSONObject> rule = new ArrayList<>();
|
|
|
@@ -281,10 +267,10 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
afterRulesTop.setTotal(afterSupervisoryTotal);
|
|
|
|
|
|
|
|
|
- List<StaticResponse> hashMaps = afterwardsAuditService.statisticsAfterRule(startTime, endTime);
|
|
|
- hashMaps.forEach(it->{
|
|
|
+ List<StaticResponse> hashMaps = afterwardsAuditService.statisticsAfterRule(startTime, endTime);
|
|
|
+ hashMaps.forEach(it -> {
|
|
|
JSONObject item = new JSONObject();
|
|
|
- item.put("title",it.getName());
|
|
|
+ item.put("title", it.getName());
|
|
|
item.put("total", it.getNum());
|
|
|
rule.add(item);
|
|
|
});
|
|
|
@@ -334,10 +320,10 @@ public class HomePageServiceImpl implements IHomePageService {
|
|
|
ArrayList<JSONObject> rule = new ArrayList<>();
|
|
|
Integer total = 345;
|
|
|
middleRulesTop.setTotal(total);
|
|
|
- List<StaticResponse> hashMaps = midIncidentAuditService.statisticsMidRule(startTime, endTime);
|
|
|
- hashMaps.forEach(it->{
|
|
|
+ List<StaticResponse> hashMaps = midIncidentAuditService.statisticsMidRule(startTime, endTime);
|
|
|
+ hashMaps.forEach(it -> {
|
|
|
JSONObject item = new JSONObject();
|
|
|
- item.put("title",it.getName());
|
|
|
+ item.put("title", it.getName());
|
|
|
item.put("total", it.getNum());
|
|
|
rule.add(item);
|
|
|
});
|