|
@@ -1,15 +1,20 @@
|
|
|
package com.diagbot.aggregate;
|
|
|
|
|
|
+import com.diagbot.dto.ReBeHosDTO;
|
|
|
import com.diagbot.facade.BehospitalInfoFacade;
|
|
|
+import com.diagbot.facade.ConsoleFacade;
|
|
|
+import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.vo.FilterVO;
|
|
|
+import com.diagbot.vo.ReBeHosPageVO;
|
|
|
import io.github.lvyahui8.spring.annotation.DataConsumer;
|
|
|
import io.github.lvyahui8.spring.annotation.DataProvider;
|
|
|
import io.github.lvyahui8.spring.annotation.InvokeParameter;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.LinkedHashMap;
|
|
|
-import java.util.Map;
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* @Description:
|
|
@@ -20,6 +25,8 @@ import java.util.Map;
|
|
|
public class LeaveHosStatisticsAggregate {
|
|
|
@Autowired
|
|
|
private BehospitalInfoFacade behospitalInfoFacade;
|
|
|
+ @Autowired
|
|
|
+ private ConsoleFacade consoleFacade;
|
|
|
|
|
|
@DataProvider("setAllLeaveHos")
|
|
|
public Map<String, Object> setAllLeaveHos(
|
|
@@ -105,6 +112,30 @@ public class LeaveHosStatisticsAggregate {
|
|
|
*/
|
|
|
@DataProvider("get31DaysBehospitalCount")
|
|
|
public Integer get31DaysBehospitalCount(@InvokeParameter("filterVO") FilterVO filterVO) {
|
|
|
- return behospitalInfoFacade.get31DaysBehospitalCount(filterVO);
|
|
|
+ ReBeHosPageVO reBeHosPageVO = new ReBeHosPageVO();
|
|
|
+ BeanUtil.copyProperties(filterVO,reBeHosPageVO);
|
|
|
+ reBeHosPageVO.setStartDate(timeTrans(filterVO.getStartDate()));
|
|
|
+ reBeHosPageVO.setEndDate(timeTrans(filterVO.getEndDate()));
|
|
|
+ reBeHosPageVO.setFlag(31);
|
|
|
+ List<ReBeHosDTO> records = consoleFacade.reHos31DaysPage(reBeHosPageVO).getRecords();
|
|
|
+ Set<String> codeList = new HashSet<>();
|
|
|
+ records.forEach(obj->{
|
|
|
+ obj.getDetails().forEach(opj->{
|
|
|
+ codeList.add(opj.getBehospitalCode());
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return codeList.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Date timeTrans(String time){
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ try {
|
|
|
+ Date date = format.parse(time);
|
|
|
+ return date;
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return new Date();
|
|
|
+
|
|
|
}
|
|
|
}
|