|
|
|
@ -16,6 +16,7 @@ import com.emr.service.PowerUserService;
|
|
|
|
|
import com.emr.util.ThreadExcelUtils;
|
|
|
|
|
import com.google.common.base.Function;
|
|
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
|
|
import org.apache.shiro.session.Session;
|
|
|
|
|
import org.apache.shiro.subject.Subject;
|
|
|
|
@ -62,8 +63,8 @@ public class faultController {
|
|
|
|
|
@RequestMapping(value = "/exportExcel")
|
|
|
|
|
public void exportExcel(HttpServletResponse response, Emr_Fault_Vo emrFaultVo) throws Exception {
|
|
|
|
|
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
|
|
|
|
String[] header = {"病历清单id","住院号","住院次数","姓名","出院科室","出院日期","归档状态","评分","主管医生","退回总次数","退回总费用(元)","当前退回次数","退回费用","退回人","退回时间","回退内容","缺陷选项","缺陷评分","缺陷内容","创建人","创建时间"};
|
|
|
|
|
String[] fileNames = {"archiveDetailId","inpNo","visitId","name","deptName","dischargeDateTime","archivestate","price","doctorInCharge","totalBackNum","totalBackFee","backNum","backFee","updater","updateTime","backContent","assortName","score","content","creater","createTime"};
|
|
|
|
|
String[] header = {"病历清单id","住院号","住院次数","姓名","出院科室","出院日期","归档状态","评分","主管医生","退回总次数","退回总费用(元)","当前退回次数","退回费用","退回人","退回时间","缺陷选项","缺陷评分","缺陷内容","创建人","创建时间"};//,"回退内容"
|
|
|
|
|
String[] fileNames = {"archiveDetailId","inpNo","visitId","name","deptName","dischargeDateTime","archivestate","price","doctorInCharge","totalBackNum","totalBackFee","backNum","backFee","updater","updateTime","assortName","score","content","creater","createTime"};//,"backContent"
|
|
|
|
|
//文件名
|
|
|
|
|
String fileName = "缺陷信息数据" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
|
|
|
|
|
//构造excel的数据
|
|
|
|
@ -74,6 +75,7 @@ public class faultController {
|
|
|
|
|
List<Emr_Fault_Vo> backList =emrFaultDetailService.faultBackScoreList(emrFaultVo);
|
|
|
|
|
//退回总次数、总费用和总评分
|
|
|
|
|
List<Emr_Fault_Vo> masterList=emrFaultDetailService.masterTotalList(emrFaultVo);
|
|
|
|
|
|
|
|
|
|
if(list!=null && list.size()>0){
|
|
|
|
|
if(backList!=null && backList.size()>0){
|
|
|
|
|
if(masterList!=null && masterList.size()>0){
|
|
|
|
@ -82,8 +84,6 @@ public class faultController {
|
|
|
|
|
faultInfo.setBackFee("0");
|
|
|
|
|
faultInfo.setBackNum("0");
|
|
|
|
|
faultInfo.setUpdater(null);
|
|
|
|
|
faultInfo.setUpdateTime(null);
|
|
|
|
|
faultInfo.setContent(null);
|
|
|
|
|
faultInfo.setTotalBackNum("0");
|
|
|
|
|
faultInfo.setTotalBackFee("0");
|
|
|
|
|
//退回总次数、总费用和总评分
|
|
|
|
@ -104,13 +104,14 @@ public class faultController {
|
|
|
|
|
faultInfo.setPrice(new BigDecimal(100));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取病案退回是第几次 updater为退回人
|
|
|
|
|
for (Emr_Fault_Vo backInfo : backList) {
|
|
|
|
|
if(faultInfo.getArchiveDetailId().equals(backInfo.getArchiveDetailId())) {
|
|
|
|
|
if(backInfo.getCreateTime()!=null && backInfo.getCreateTime()!=""){
|
|
|
|
|
if(backInfo.getStartDateTo()!=null && backInfo.getStartDateTo()!="" && backInfo.getEndDateTo()!=null && backInfo.getEndDateTo()!=""){
|
|
|
|
|
SimpleDateFormat ft = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
Date nowTime = ft.parse(backInfo.getCreateTime());
|
|
|
|
|
Date nowTime = ft.parse(faultInfo.getCreateTime());
|
|
|
|
|
Date startTime = ft.parse(backInfo.getStartDateTo());
|
|
|
|
|
Date endTime = ft.parse(backInfo.getEndDateTo());
|
|
|
|
|
if( isEffectiveDate(nowTime,startTime,endTime)){
|
|
|
|
@ -118,40 +119,65 @@ public class faultController {
|
|
|
|
|
faultInfo.setEndDateTo(backInfo.getEndDateTo());
|
|
|
|
|
faultInfo.setBackNum(backInfo.getBackNum());
|
|
|
|
|
faultInfo.setUpdater(backInfo.getCreater());
|
|
|
|
|
faultInfo.setUpdateTime(backInfo.getCreateTime());
|
|
|
|
|
faultInfo.setContent(backInfo.getContent());
|
|
|
|
|
//System.out.println(backInfo.getCreateTime());
|
|
|
|
|
if(StringUtils.isNotBlank(backInfo.getEndDateTo())){
|
|
|
|
|
faultInfo.setUpdateTime(backInfo.getEndDateTo());
|
|
|
|
|
}else{
|
|
|
|
|
faultInfo.setUpdateTime(backInfo.getStartDateTo());
|
|
|
|
|
}
|
|
|
|
|
faultInfo.setBackContent(backInfo.getContent());
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(faultInfo.getEndDateTo()!=null && faultInfo.getEndDateTo()!=""){
|
|
|
|
|
}else if(faultInfo.getEndDateTo()!=null && faultInfo.getEndDateTo()!=""){
|
|
|
|
|
if(compare(backInfo.getCreateTime(),faultInfo.getEndDateTo())){
|
|
|
|
|
faultInfo.setBackNum(backInfo.getBackNum());
|
|
|
|
|
faultInfo.setUpdater(backInfo.getCreater());
|
|
|
|
|
faultInfo.setUpdateTime(backInfo.getCreateTime());
|
|
|
|
|
faultInfo.setContent(backInfo.getContent());
|
|
|
|
|
//System.out.println(backInfo.getCreateTime());
|
|
|
|
|
if(StringUtils.isNotBlank(backInfo.getEndDateTo())){
|
|
|
|
|
faultInfo.setUpdateTime(backInfo.getEndDateTo());
|
|
|
|
|
}else{
|
|
|
|
|
faultInfo.setUpdateTime(backInfo.getStartDateTo());
|
|
|
|
|
}
|
|
|
|
|
faultInfo.setBackContent(backInfo.getContent());
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}else if(faultInfo.getStartDateTo()!=null && faultInfo.getStartDateTo()!=""){
|
|
|
|
|
if(compare(faultInfo.getStartDateTo(),backInfo.getCreateTime())){
|
|
|
|
|
faultInfo.setBackNum(backInfo.getBackNum());
|
|
|
|
|
faultInfo.setUpdater(backInfo.getCreater());
|
|
|
|
|
faultInfo.setUpdateTime(backInfo.getCreateTime());
|
|
|
|
|
faultInfo.setContent(backInfo.getContent());
|
|
|
|
|
if(StringUtils.isNotBlank(backInfo.getEndDateTo())){
|
|
|
|
|
faultInfo.setUpdateTime(backInfo.getEndDateTo());
|
|
|
|
|
}else{
|
|
|
|
|
faultInfo.setUpdateTime(backInfo.getStartDateTo());
|
|
|
|
|
}
|
|
|
|
|
faultInfo.setBackContent(backInfo.getContent());
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(backList.size()>0) {
|
|
|
|
|
ThreadExcelUtils utils = new ThreadExcelUtils(fileName, "", header, fileNames);
|
|
|
|
|
/* System.out.println("开始执行导出.......");
|
|
|
|
|
long start = System.currentTimeMillis();*/
|
|
|
|
|
String result = utils.exportExcelToFilePath(response, utils.listConvert(list));
|
|
|
|
|
/* long end = System.currentTimeMillis();
|
|
|
|
|
System.out.println("耗时:" + (end - start) / 1000 + "秒");*/
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ThreadExcelUtils utils = new ThreadExcelUtils(fileName, "", header, fileNames);
|
|
|
|
|
/* System.out.println("开始执行导出.......");
|
|
|
|
|
long start = System.currentTimeMillis();*/
|
|
|
|
|
String result=utils.exportExcelToFilePath(response,utils.listConvert(list));
|
|
|
|
|
/* long end = System.currentTimeMillis();
|
|
|
|
|
System.out.println("耗时:" + (end - start) / 1000 + "秒");*/
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
public boolean compare(String time1,String time2) throws ParseException {
|
|
|
|
|
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
@ -186,7 +212,7 @@ public class faultController {
|
|
|
|
|
|
|
|
|
|
Calendar end = Calendar.getInstance();
|
|
|
|
|
end.setTime(endTime);
|
|
|
|
|
|
|
|
|
|
// end.add(end.DATE,-1);
|
|
|
|
|
if (date.after(begin) && date.before(end)) {
|
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|