|
@@ -63,7 +63,6 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
@@ -975,16 +974,16 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "出院时间的开始时间必须小于结束时间!");
|
|
|
}
|
|
|
}
|
|
|
- behospitalPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
|
|
|
- behospitalPageVO.setIsPlacefile("1");
|
|
|
- if (null != behospitalPageVO.getStatisticsType()
|
|
|
- && null == behospitalPageVO.getLeaveHosDateStart()
|
|
|
- && null == behospitalPageVO.getLeaveHosDateEnd()) {
|
|
|
- String startDate = filterFacade.getStartDateStr(behospitalPageVO.getStatisticsType(), null);
|
|
|
- String endDate = filterFacade.getEndDateStr(behospitalPageVO.getStatisticsType(), null);
|
|
|
- behospitalPageVO.setLeaveHosDateStart(DateUtil.parseDate(startDate));
|
|
|
- behospitalPageVO.setLeaveHosDateEnd(DateUtil.parseDate(endDate));
|
|
|
- }
|
|
|
+// behospitalPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
|
|
|
+// behospitalPageVO.setIsPlacefile("1");
|
|
|
+// if (null != behospitalPageVO.getStatisticsType()
|
|
|
+// && null == behospitalPageVO.getLeaveHosDateStart()
|
|
|
+// && null == behospitalPageVO.getLeaveHosDateEnd()) {
|
|
|
+// String startDate = filterFacade.getStartDateStr(behospitalPageVO.getStatisticsType(), null);
|
|
|
+// String endDate = filterFacade.getEndDateStr(behospitalPageVO.getStatisticsType(), null);
|
|
|
+// behospitalPageVO.setLeaveHosDateStart(DateUtil.parseDate(startDate));
|
|
|
+// behospitalPageVO.setLeaveHosDateEnd(DateUtil.parseDate(endDate));
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
public void exportExcelFac(HttpServletResponse response) {
|
|
@@ -1000,23 +999,12 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
* @param exportQcresultVO
|
|
|
*/
|
|
|
public void exportQcresult(HttpServletResponse response, ExportQcresultVO exportQcresultVO) {
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
|
|
String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
exportQcresultVO.setHospitalId(hospitalId);
|
|
|
- Date startDate = exportQcresultVO.getLeaveHosDateStart();
|
|
|
- Date endDate = exportQcresultVO.getLeaveHosDateEnd();
|
|
|
- //时间间隔7天
|
|
|
- long interval = 7 * 24 * 60 * 60 * 1000;
|
|
|
- if (endDate.getTime() < startDate.getTime()) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
- }
|
|
|
- if (endDate.getTime() - startDate.getTime() > interval) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
- }
|
|
|
-
|
|
|
- exportQcresultVO.setLeaveHosDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(endDate, 1)));
|
|
|
+ //时间设置
|
|
|
+ exportQcresultVOSet(exportQcresultVO);
|
|
|
List<ExportExcelDTO> res = this.exportQcresult(exportQcresultVO);
|
|
|
- String fileName = dateFormat.format(startDate) + "-" + dateFormat.format(endDate) + "抽查住院病历质量情况.xls";
|
|
|
+ String fileName = "抽查住院病历质量情况.xls";
|
|
|
response.setContentType("text/html;charset=UTF-8");
|
|
|
ExcelUtils.exportExcelUser(res, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
}
|
|
@@ -1028,24 +1016,14 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
* @param exportQcresultVO
|
|
|
*/
|
|
|
public void exportQcresultByDept(HttpServletResponse response, ExportQcresultVO exportQcresultVO) {
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
|
|
String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
String userId = SysUserUtils.getCurrentPrincipleID();
|
|
|
exportQcresultVO.setHospitalId(hospitalId);
|
|
|
exportQcresultVO.setUserId(Long.valueOf(userId));
|
|
|
- Date startDate = exportQcresultVO.getLeaveHosDateStart();
|
|
|
- Date endDate = exportQcresultVO.getLeaveHosDateEnd();
|
|
|
- //时间间隔7天
|
|
|
- long interval = 7 * 24 * 60 * 60 * 1000;
|
|
|
- if (endDate.getTime() < startDate.getTime()) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
- }
|
|
|
- if (endDate.getTime() - startDate.getTime() > interval) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
- }
|
|
|
- exportQcresultVO.setLeaveHosDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(endDate, 1)));
|
|
|
+ //时间设置
|
|
|
+ exportQcresultVOSet(exportQcresultVO);
|
|
|
List<ExportExcelDTO> res = this.exportQcresultByDept(exportQcresultVO);
|
|
|
- String fileName = dateFormat.format(startDate) + "-" + dateFormat.format(endDate) + "抽查住院病历质量情况.xls";
|
|
|
+ String fileName = "抽查住院病历质量情况.xls";
|
|
|
response.setContentType("text/html;charset=UTF-8");
|
|
|
ExcelUtils.exportExcelUser(res, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
}
|
|
@@ -1057,28 +1035,50 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
* @param exportQcresultVO
|
|
|
*/
|
|
|
public void exportQcresultByGroup(HttpServletResponse response, ExportQcresultVO exportQcresultVO) {
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
|
|
String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
String userId = SysUserUtils.getCurrentPrincipleID();
|
|
|
exportQcresultVO.setHospitalId(hospitalId);
|
|
|
exportQcresultVO.setUserId(Long.valueOf(userId));
|
|
|
- Date startDate = exportQcresultVO.getLeaveHosDateStart();
|
|
|
- Date endDate = exportQcresultVO.getLeaveHosDateEnd();
|
|
|
- //时间间隔7天
|
|
|
- long interval = 7 * 24 * 60 * 60 * 1000;
|
|
|
- if (endDate.getTime() < startDate.getTime()) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
- }
|
|
|
- if (endDate.getTime() - startDate.getTime() > interval) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
- }
|
|
|
- exportQcresultVO.setLeaveHosDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(endDate, 1)));
|
|
|
+ //时间设置
|
|
|
+ exportQcresultVOSet(exportQcresultVO);
|
|
|
List<ExportExcelDTO> res = this.exportQcresultByGroup(exportQcresultVO);
|
|
|
- String fileName = dateFormat.format(startDate) + "-" + dateFormat.format(endDate) + "抽查住院病历质量情况.xls";
|
|
|
+ String fileName = "抽查住院病历质量情况.xls";
|
|
|
response.setContentType("text/html;charset=UTF-8");
|
|
|
ExcelUtils.exportExcelUser(res, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
}
|
|
|
|
|
|
+ private void exportQcresultVOSet(ExportQcresultVO exportQcresultVO){
|
|
|
+ //入参验证
|
|
|
+ long interval = 7 * 24 * 60 * 60 * 1000;
|
|
|
+ //入院时间
|
|
|
+ if (null != exportQcresultVO && null != exportQcresultVO.getBehosDateStart() && null != exportQcresultVO.getBehosDateEnd()) {
|
|
|
+ Date startDate = exportQcresultVO.getBehosDateStart();
|
|
|
+ Date endDate = exportQcresultVO.getBehosDateEnd();
|
|
|
+ //时间间隔7天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
+ }
|
|
|
+ exportQcresultVO.setBehosDateStart(DateUtil.getFirstTimeOfDay(exportQcresultVO.getBehosDateStart()));
|
|
|
+ exportQcresultVO.setBehosDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(exportQcresultVO.getBehosDateEnd(), 1)));
|
|
|
+ }
|
|
|
+ //出院时间
|
|
|
+ if (null != exportQcresultVO && null != exportQcresultVO.getLeaveHosDateStart() && null != exportQcresultVO.getLeaveHosDateEnd()) {
|
|
|
+ Date startDate = exportQcresultVO.getLeaveHosDateStart();
|
|
|
+ Date endDate = exportQcresultVO.getLeaveHosDateEnd();
|
|
|
+ //时间间隔7天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
+ }
|
|
|
+ exportQcresultVO.setLeaveHosDateStart(DateUtil.getFirstTimeOfDay(exportQcresultVO.getLeaveHosDateStart()));
|
|
|
+ exportQcresultVO.setLeaveHosDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(exportQcresultVO.getLeaveHosDateEnd(), 1)));
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 设置共用code数据
|