缺陷导出异常(排除作废病历)

master
hujl 4 years ago
parent 2fe0c5619e
commit d5bd7a63ec

@ -15,6 +15,7 @@ import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
@ -32,6 +33,9 @@ import java.util.*;
@RequestMapping("fault")
public class faultController {
@Value("${backFee}")
private String backFee;
@Autowired
private Emr_Fault_DetailService emrFaultDetailService;
@ -53,57 +57,94 @@ public class faultController {
return result;
}
@ResponseBody
@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 = {"id","inpNo","visitId","name","deptName","dischargeDateTime","archivestate","score","backContent","typeName","content","createTime"};
String[] header = {"病历清单id","住院号","住院次数","姓名","出院科室","出院日期","归档状态","评分","退回总次数","退回总费用(元)","当前退回次数","退回费用","退回人","退回时间","回退内容","缺陷选项","缺陷评分","缺陷内容","创建人","创建时间"};
String[] fileNames = {"ArchiveDetailId","inpNo","visitId","name","deptName","dischargeDateTime","archivestate","price","totalBackNum","totalBackFee","backNum","backFee","updater","updateTime","backContent","assortName","score","content","creater","createTime"};
//文件名
String fileName = "缺陷信息数据" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
//构造excel的数据
List<Emr_Fault_Vo> list = emrFaultDetailService.getQualityControlList(emrFaultVo);
/*Emr_Dictionary dic = new Emr_Dictionary();
dic.setEffective(1);
dic.setTypecode("dept_code");
//科室列表
List<Emr_Dictionary> dicList = emrDictionaryService.dicByTypeCode(dic);
//获取缺陷类别列表
Emr_Fault_Type obj = new Emr_Fault_Type();
obj.setEffective(1);
//缺陷选项
List<Emr_Fault_Type> typeLis = emrFaultTypeService.selectByCol(obj);
for (int i = 0; i < list.size(); i++) {
String assortId = list.get(i).getAssortId();
if (assortId != "" && assortId != null) {
String[] assorArr = assortId.split(",");
//替换类别
for (int j = 0; j < typeLis.size(); j++) {
String id = String.valueOf(typeLis.get(j).getId());
if (Arrays.asList(assorArr).contains(id)) {
assortId = assortId.replace(id, typeLis.get(j).getTypeName());
list.get(i).setAssortId(assortId);
// List<Emr_Fault_Vo> list = emrFaultDetailService.getQualityControlList(emrFaultVo);
//获取病案室退回医生或护士的缺陷列表
List<Emr_Fault_Vo> list = emrFaultDetailService.selByCol(emrFaultVo);
//获取病案退回是第几次 updater为退回人
List<Emr_Fault_Vo> backList =emrFaultDetailService.faultBackScoreList(emrFaultVo);
//获取病案信息
String priceVal="";
if(backFee!=null && backFee!=""){
priceVal=backFee;
}else{
//默认退回一次扣30元
priceVal="30";
}
emrFaultVo.setBackFee(priceVal);
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){
for (Emr_Fault_Vo faultInfo : list) {
for (Emr_Fault_Vo masertInfo : masterList) {
if(faultInfo.getArchiveDetailId().equals(masertInfo.getArchiveDetailId())) {
faultInfo.setInpNo(masertInfo.getInpNo());
faultInfo.setVisitId(masertInfo.getVisitId());
faultInfo.setName(masertInfo.getName());
faultInfo.setDeptName(masertInfo.getDeptName());
faultInfo.setDischargeDateTime(masertInfo.getDischargeDateTime());
faultInfo.setArchiveState(masertInfo.getArchiveState());
faultInfo.setPrice(masertInfo.getScore());
faultInfo.setTotalBackNum(masertInfo.getTotalBackNum());
faultInfo.setTotalBackFee(masertInfo.getTotalBackFee());
}
}
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 startTime = ft.parse(backInfo.getStartDateTo());
Date endTime = ft.parse(backInfo.getEndDateTo());
if( isEffectiveDate(nowTime,startTime,endTime)){
faultInfo.setStartDateTo(backInfo.getStartDateTo());
faultInfo.setEndDateTo(backInfo.getEndDateTo());
faultInfo.setBackNum(backInfo.getBackNum());
faultInfo.setUpdater(backInfo.getCreater());
faultInfo.setUpdateTime(backInfo.getCreateTime());
faultInfo.setContent(backInfo.getContent());
}
}
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());
}
}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());
}
}
}
}
}
}
}
}
//替换科室
for (int k = 0; k < dicList.size(); k++) {
String deptName = list.get(i).getDeptName();
//入院科室dept_admission_to
String dept2 = list.get(i).getDeptAdmissionTo();
if ((deptName != null && deptName.equals(dicList.get(k).getCode()))) {
//出院科室
deptName = deptName.replace(deptName, dicList.get(k).getName());
list.get(i).setDeptName(deptName);
}
if(dept2 != null && dept2.equals(dicList.get(k).getCode())) {
//入院科室
dept2 = dept2.replace(dept2, dicList.get(k).getName());
list.get(i).setDeptAdmissionTo(dept2);
}
}
}*/
}
ThreadExcelUtils utils = new ThreadExcelUtils(fileName, "", header, fileNames);
/* System.out.println("开始执行导出.......");
long start = System.currentTimeMillis();*/
@ -414,6 +455,49 @@ public class faultController {
OffsetLimitPage result = emrFaultDetailService.getQualityControlList(emrFaultVo, offset, limit);
return result;
}
@ResponseBody
@RequestMapping(value = "/faultBackScoreList")
public OffsetLimitPage faultBackScoreList(HttpServletRequest request, HttpServletResponse response, Emr_Fault_Vo emrFaultVo, Integer offset, Integer limit) {
OffsetLimitPage result = emrFaultDetailService.faultBackScoreList(emrFaultVo, offset, limit);
return result;
}
/*@ResponseBody
@RequestMapping(value = "/exportExcel2")
public void exportExcel2(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","score","backNum","createTime","creater"};
//文件名
String fileName = "病案退回次数及评分信息" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
//构造excel的数据
List<Emr_Fault_Vo> list = emrFaultDetailService.faultBackScoreList(emrFaultVo);
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 + "秒");*//*
}*/
@ResponseBody
@RequestMapping(value = "/faultListByTj")
public OffsetLimitPage faultListByTj(HttpServletRequest request, HttpServletResponse response, Emr_Fault_Vo emrFaultVo, Integer offset, Integer limit) {
OffsetLimitPage result = emrFaultDetailService.selByCol(emrFaultVo, offset, limit);
return result;
}
@ResponseBody
@RequestMapping(value = "/masterTotalList")
public OffsetLimitPage masterTotalList(HttpServletRequest request, HttpServletResponse response, Emr_Fault_Vo emrFaultVo, Integer offset, Integer limit) {
emrFaultVo.setBackFee(backFee);
OffsetLimitPage result = emrFaultDetailService.masterTotalList(emrFaultVo, offset, limit);
return result;
}
}

@ -1409,113 +1409,112 @@
</if>
ORDER BY f.handle_time desc
</select>
<!--初次提交归档-->
<select id="selectOverdue" parameterType="com.emr.entity.Archive_Master_Vo" resultMap="BaseResultMap2">
select m.id,m.patient_id, m.inp_no,m.visit_id,m.name,m.discharge_date_time
,CONVERT(varchar(10),m.admission_date_time, 120)admission_date_time,t.name dept_admission_to,g.name dept_name,m.DOCTOR_IN_CHARGE,m.death_flag,
d.*,[dbo].[getWorkday](m.discharge_date_time,d.create_time) overdue from
(select
id, patient_id, inp_no, visit_id, name, sex, dept_name, CONVERT(varchar(10),discharge_date_time, 120)discharge_date_time, ArchiveState,
admission_date_time, dept_admission_to, check_doctor, check_datetime, checked_doctor, transfer_dept,
checked_datetime, LockInfo, DOCTOR_IN_CHARGE, ID_NO, DISCHARGE_DISPOSITION, dept_code_lend,isscaned,is_scanning,
cmt_doctor,cmt_nurse,doctor_name,nurse_name,cmt_doctor_date,cmt_nurse_date,emr_doctor_cmt,emr_nure_cmt,death_flag,
bed_number,is_sign,signer,sign_time from archive_master) m
LEFT JOIN(select master_id archive_detail_id,CONVERT(varchar(10),handle_time, 120) create_time,handle_name first_instance from (
select ROW_NUMBER() over(partition by master_id order by handle_time asc) RowNum
,Archive_Master_Following.*
from Archive_Master_Following where 1=1 and following_type ='5' ) as t1 where 1=1 and RowNum = 1
) d
on m.id=d.archive_detail_id
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
typeCode='dept_code' )) t
on m.dept_admission_to=t.code
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
typeCode='dept_code' )) g
on m.dept_name=g.code
where 1=1
<if test="id != null and id != ''">
and m.id = #{id,jdbcType=NVARCHAR}
</if>
<if test="inpNo != null and inpNo != ''">
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
</if>
<if test="visitId != null and visitId != ''">
and m.visit_id=#{visitId,jdbcType=NCHAR}
</if>
<if test="name != null and name != ''">
and m.name like '%'+#{name,jdbcType=NCHAR}+'%'
select f.id,f.handle_name,f.handle_id,f.handle_time,ISNULL(DATEDIFF(dd,CONVERT(VARCHAR(20),m.discharge_date_time,23),CONVERT(VARCHAR(20),f.handle_time,23)), 0) diffDay,
<if test="overdueDays != null and overdueDays != ''">
case when ISNULL(dbo.f_WorkDay(DATEADD(DAY,1,substring(m.discharge_date_time,1,10)),f.handle_time) , 0)-#{overdueDays,jdbcType=NCHAR}>0 then ISNULL(dbo.f_WorkDay(DATEADD(DAY,1,substring(m.discharge_date_time,1,10)),f.handle_time) , 0)-#{overdueDays,jdbcType=NCHAR}
</if>
<if test="deptName!= null and deptName!= ''">
and m.dept_name in
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
<if test="overdueDays == null or overdueDays == ''">
case when ISNULL(dbo.f_WorkDay(DATEADD(DAY,1,substring(m.discharge_date_time,1,10)),f.handle_time) , 0)-3>0 then ISNULL(dbo.f_WorkDay(DATEADD(DAY,1,substring(m.discharge_date_time,1,10)),f.handle_time) , 0)-3
</if>
<if test="deptAdmissionTo != null and deptAdmissionTo!=''">
and m.dept_admission_to in
<foreach item="item" collection="deptAdmissionTo.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
else 0
end overdue
,m.master_id,m.patient_id,m.inp_no,m.visit_id,m.name,ISNULL(c.name,m.dept_name) dept_name,m.discharge_date_time,m.DOCTOR_IN_CHARGE,m.first_instance,m.death_flag,ISNULL(e.name,m.dept_admission_to) dept_admission_to,admission_date_time
from (
select id,master_id ,convert(varchar,handle_time,120) handle_time ,handle_id,handle_name,following_type from (
select ROW_NUMBER() over(partition by master_id order by handle_time asc) RowNum
,Archive_Master_Following.*
from Archive_Master_Following where 1=1 and following_type='5') as t1 where 1=1 and RowNum = 1
) f
LEFT JOIN (
select id master_id,patient_id,inp_no,visit_id,name,dept_name,convert(varchar,discharge_date_time,120) discharge_date_time,check_doctor,first_instance,DOCTOR_IN_CHARGE,death_flag,dept_admission_to,convert(varchar,admission_date_time,120) admission_date_time from archive_master where archiveState!='作废'
) m
on f.master_id=m.master_id
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where typeCode='dept_code' )) c
on m.dept_name=c.code
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where typeCode='dept_code' )) e
on m.dept_admission_to=e.code
<where> 1=1 and m.master_id!=''
<if test="id != null and id != ''">
and m.id = #{id,jdbcType=NVARCHAR}
</if>
<if test="inpNo != null and inpNo != ''">
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
</if>
<if test="visitId != null and visitId != ''">
and m.visit_id=#{visitId,jdbcType=NCHAR}
</if>
<if test="name != null and name != ''">
and m.name like '%'+#{name,jdbcType=NCHAR}+'%'
</if>
<if test="deptName!= null and deptName!= ''">
and m.dept_name in
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="deptAdmissionTo != null and deptAdmissionTo!=''">
and m.dept_admission_to in
<foreach item="item" collection="deptAdmissionTo.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<choose>
<when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
and CONVERT(VARCHAR(20),m.discharge_date_time,23) between #{startDate,jdbcType=NCHAR} and #{endDate,jdbcType=NCHAR}
</when>
<when test="startDate != null and startDate != ''">
and CONVERT(VARCHAR(20),m.discharge_date_time,23) >=#{startDate,jdbcType=NCHAR}
</when>
<when test="endDate != null and endDate != ''">
and CONVERT(VARCHAR(20),m.discharge_date_time,23) &lt;= #{endDate,jdbcType=NCHAR}
</when>
</choose>
<choose>
<when test="createTimeStart != null and createTimeStart != '' and createTimeEnd != null and createTimeEnd != ''">
and CONVERT(VARCHAR(20),f.handle_time,23) between #{createTimeStart,jdbcType=NCHAR} and #{createTimeEnd,jdbcType=NCHAR}
</when>
<when test="createTimeStart != null and createTimeStart != ''">
and CONVERT(VARCHAR(20),f.handle_time,23) >= #{createTimeStart,jdbcType=NCHAR}
</when>
<when test="createTimeEnd != null and createTimeEnd != ''">
and CONVERT(VARCHAR(20),f.handle_time,23) &lt;= #{createTimeEnd,jdbcType=NCHAR}
</when>
</choose>
</where>
ORDER BY m.master_id,m.discharge_date_time,f.handle_time asc
</select>
<!-- 住院返修病历 -->
<select id="selectOverdue2" parameterType="com.emr.entity.Archive_Master_Vo" resultMap="BaseResultMap2">
select f1.id,f1.following_content,f1.handle_name,CONVERT(VARCHAR(20),f1.handle_time,120) handle_time,ISNULL(DATEDIFF(dd,CONVERT(VARCHAR(20),f1.handle_time,23),CONVERT(VARCHAR(20),f2.handle_time,23)), 0) diffDay,
<if test="overdueDays != null and overdueDays != ''">
case when ISNULL(dbo.f_WorkDay(f1.handle_time,f2.handle_time) , 0)-#{overdueDays,jdbcType=NCHAR}>0 then ISNULL(dbo.f_WorkDay(f1.handle_time,f2.handle_time) , 0)-#{overdueDays,jdbcType=NCHAR}
</if>
<if test="dischargeDateTime != null">
and m.discharge_date_time = #{dischargeDateTime,jdbcType=NVARCHAR}
<if test="overdueDays == null or overdueDays == ''">
case when ISNULL(dbo.f_WorkDay(f1.handle_time,f2.handle_time) , 0)-'3'>0 then ISNULL(dbo.f_WorkDay(f1.handle_time,f2.handle_time) , 0)-'3'
</if>
<choose>
<when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
and m.discharge_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and
#{endDate,jdbcType=NCHAR}+ ' 23:59:59'
else 0
end overdue
,m.master_id,m.patient_id,m.inp_no,m.visit_id,m.name,ISNULL(c.name,m.dept_name) dept_name,m.discharge_date_time,m.DOCTOR_IN_CHARGE,m.first_instance,m.death_flag,ISNULL(e.name,m.dept_admission_to) dept_admission_to,admission_date_time
from(
select id,master_id,following_type,following_content,handle_name,handle_time,ROW_NUMBER() OVER (partition by master_id ORDER BY master_id,handle_time) as rowNumb from Archive_Master_Following where following_type='9'
)f1
LEFT JOIN (
select *,ROW_NUMBER() OVER (partition by master_id ORDER BY master_id,handle_time) as rowNumb from Archive_Master_Following where following_type='5'
)f2
on f1.master_id=f2.master_id and f1.rowNumb=f2.rowNumb-1
LEFT JOIN (
select id master_id,patient_id,inp_no,visit_id,name,dept_name,convert(varchar,discharge_date_time,120) discharge_date_time,check_doctor,first_instance,DOCTOR_IN_CHARGE,death_flag,dept_admission_to,convert(varchar,admission_date_time,120) admission_date_time from archive_master where archiveState!='作废'
) m
on f1.master_id=m.master_id
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where typeCode='dept_code' )) c
on m.dept_name=c.code
and m.discharge_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and
#{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</when>
<when test="startDate != null and startDate != ''">
and m.discharge_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)
</when>
<when test="endDate != null and endDate != ''">
and m.discharge_date_time &lt;= #{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
<if test="createTime != null">
and d.create_time = #{createTime,jdbcType=NVARCHAR}
</if>
<choose>
<when test="createTimeStart != null and createTimeStart != '' and createTimeEnd != null and createTimeEnd != ''">
and d.create_time between CONVERT(VARCHAR(10),#{createTimeStart,jdbcType=NCHAR},120) and
#{createTimeEnd,jdbcType=NCHAR}+ ' 23:59:59'
</when>
<when test="createTimeStart != null and createTimeStart != ''">
and d.create_time >= CONVERT(VARCHAR(10),#{createTimeStart,jdbcType=NCHAR},120)
</when>
<when test="createTimeEnd != null and createTimeEnd != ''">
and d.create_time &lt;= #{createTimeEnd,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
<if test="overdueDays != null and overdueDays != ''">
and m.death_flag ='0'
and convert(int,[dbo].[getWorkday](m.discharge_date_time,d.create_time))-convert(int,#{overdueDays,jdbcType=INTEGER})>0
union
select m.id,m.patient_id, m.inp_no,m.visit_id,m.name,m.discharge_date_time
,CONVERT(varchar(10),m.admission_date_time, 120)admission_date_time,t.name dept_admission_to,g.name dept_name,m.DOCTOR_IN_CHARGE,m.death_flag,
d.*,[dbo].[getWorkday](m.discharge_date_time,d.create_time) overdue from
(select
id, patient_id, inp_no, visit_id, name, sex, dept_name, CONVERT(varchar(10),discharge_date_time, 120)discharge_date_time, ArchiveState,
admission_date_time, dept_admission_to, check_doctor, check_datetime, checked_doctor, transfer_dept,
checked_datetime, LockInfo, DOCTOR_IN_CHARGE, ID_NO, DISCHARGE_DISPOSITION, dept_code_lend,isscaned,is_scanning,
cmt_doctor,cmt_nurse,doctor_name,nurse_name,cmt_doctor_date,cmt_nurse_date,emr_doctor_cmt,emr_nure_cmt,death_flag,
bed_number,is_sign,signer,sign_time from archive_master) m
LEFT JOIN(select master_id archive_detail_id,CONVERT(varchar(10),handle_time, 120) create_time,handle_name first_instance from (
select ROW_NUMBER() over(partition by master_id order by handle_time asc) RowNum
,Archive_Master_Following.*
from Archive_Master_Following where 1=1 and following_type ='5' ) as t1 where 1=1 and RowNum = 1
) d
on m.id=d.archive_detail_id
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
typeCode='dept_code' )) t
on m.dept_admission_to=t.code
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
typeCode='dept_code' )) g
on m.dept_name=g.code
where 1=1
and m.death_flag ='1'
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where typeCode='dept_code' )) e
on m.dept_admission_to=e.code
<where> 1=1
<if test="id != null and id != ''">
and m.id = #{id,jdbcType=NVARCHAR}
</if>
@ -1540,38 +1539,30 @@
#{item}
</foreach>
</if>
<if test="dischargeDateTime != null">
and m.discharge_date_time = #{dischargeDateTime,jdbcType=NVARCHAR}
</if>
<choose>
<when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
and m.discharge_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and
#{endDate,jdbcType=NCHAR}+ ' 23:59:59'
and CONVERT(VARCHAR(20),m.discharge_date_time,23) between #{startDate,jdbcType=NCHAR} and #{endDate,jdbcType=NCHAR}
</when>
<when test="startDate != null and startDate != ''">
and m.discharge_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)
and CONVERT(VARCHAR(20),m.discharge_date_time,23) >=#{startDate,jdbcType=NCHAR}
</when>
<when test="endDate != null and endDate != ''">
and m.discharge_date_time &lt;= #{endDate,jdbcType=NCHAR}+ ' 23:59:59'
and CONVERT(VARCHAR(20),m.discharge_date_time,23) &lt;= #{endDate,jdbcType=NCHAR}
</when>
</choose>
<if test="createTime != null">
and d.create_time = #{createTime,jdbcType=NVARCHAR}
</if>
<choose>
<when test="createTimeStart != null and createTimeStart != '' and createTimeEnd != null and createTimeEnd != ''">
and d.create_time between CONVERT(VARCHAR(10),#{createTimeStart,jdbcType=NCHAR},120) and
#{createTimeEnd,jdbcType=NCHAR}+ ' 23:59:59'
and CONVERT(VARCHAR(20),f1.handle_time,23) between #{createTimeStart,jdbcType=NCHAR} and #{createTimeEnd,jdbcType=NCHAR}
</when>
<when test="createTimeStart != null and createTimeStart != ''">
and d.create_time >= CONVERT(VARCHAR(10),#{createTimeStart,jdbcType=NCHAR},120)
and CONVERT(VARCHAR(20),f1.handle_time,23) >= #{createTimeStart,jdbcType=NCHAR}
</when>
<when test="createTimeEnd != null and createTimeEnd != ''">
and d.create_time &lt;= #{createTimeEnd,jdbcType=NCHAR}+ ' 23:59:59'
and CONVERT(VARCHAR(20),f1.handle_time,23) &lt;= #{createTimeEnd,jdbcType=NCHAR}
</when>
</choose>
and [dbo].[getWorkday](m.discharge_date_time,d.create_time)>7
</if>
</where>
ORDER BY m.master_id,m.discharge_date_time,f1.handle_time asc
</select>
<!--封存日志-->
<select id="selectByFollowinglog" parameterType="com.emr.entity.Archive_Master_Vo" resultMap="BaseResultMap2">

@ -71,90 +71,218 @@
id, archive_detail_id, assort_id, parent_id, content,price, score, back_content, first_trial,state,recall_reason
creater, create_time, updater, update_time,back_flag,deal_flag,deal_person,deal_time,archive_state
</sql>
<select id="selectById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from emr_fault_detail
where 1=1 and id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByDept" parameterType="com.emr.entity.Emr_Fault_Detail" resultMap="BaseResultMap">
select ISNULL(100-sum(minus_point),0) price from emr_fault_detail
where 1=1 and deal_flag='0'
<if test="archiveDetailId != null">
and archive_detail_id = #{archiveDetailId,jdbcType=NVARCHAR}
</if>
<if test="backFlag==1">
and back_flag in(1,2,5,6)
</if>
<if test="backFlag==2">
and back_flag in(5,6)
</if>
</select>
<select id="selectByColumn" parameterType="com.emr.entity.Emr_Fault_Detail" resultMap="BaseResultMap2">
select
d.*,m.ArchiveState,m.cmt_nurse,m.cmt_doctor,t.type_name assort_name
from emr_fault_detail d
LEFT JOIN emr_fault_type t
on d.assort_id=convert(varchar(50),t.id)
left JOIN archive_master m
on m.id=d.archive_detail_id
where 1=1
<!-- <if test="backFlag!= null and backFlag!= '' and backFlag!= 1 and backFlag!= 2">
and d.back_flag in
<foreach item="item" collection="backFlag.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>-->
<if test="backFlag==1">
and d.back_flag in (1,2,5,6)
</if>
<if test="backFlag==2">
and d.back_flag in(5,6)
</if>
<if test="backFlag== 3">
and d.back_flag in (1,5)
</if>
<if test="backFlag== 4">
and d.back_flag in (2,6)
</if>
<if test="dealFlag!= null and dealFlag!=''">
and d.deal_flag = #{dealFlag,jdbcType=NVARCHAR}
</if>
<if test="id != null">
and d.id = #{id,jdbcType=INTEGER}
</if>
<if test="archiveDetailId != null">
and d.archive_detail_id = #{archiveDetailId,jdbcType=NVARCHAR}
</if>
<if test="assortId != null">
and d.assort_id = #{assortId,jdbcType=NVARCHAR}
</if>
<if test="backContent != null and backContent!=''">
and t.type_name like '%'+#{backContent,jdbcType=NVARCHAR}+'%'
</if>
<if test="content != null">
and d.content = #{content,jdbcType=NVARCHAR}
</if>
<if test="price != null">
and d.price = #{price,jdbcType=DECIMAL}
</if>
<if test="creater != null">
and d.creater = #{creater,jdbcType=NVARCHAR}
</if>
<if test="createTime != null">
and d.create_time = #{createTime,jdbcType=NCHAR}
</if>
<if test="updater != null">
and d.updater = #{updater,jdbcType=NVARCHAR}
</if>
<if test="updateTime != null">
and d.update_time = #{updateTime,jdbcType=NCHAR}
</if>
<!--<if test="backFlag != null and backFlag!=''">-->
<!--and d.back_flag= #{backFlag,jdbcType=NCHAR}-->
<!--</if>order by d.update_time,d.create_time desc-->
ORDER BY case WHEN( d.update_time is not null) THEN d.update_time ELSE d.create_time END desc
</select>
<select id="selectById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from emr_fault_detail
where 1=1 and id = #{id,jdbcType=INTEGER}
</select>
<select id="selByCol" parameterType="com.emr.entity.Emr_Fault_Vo" resultMap="BaseResultMap2">
select f.archive_detail_id,f.assort_id,t.type_name assort_name,f.content,f.back_content,f.creater,f.create_time,isnull(f.score,0) score,
m.inp_no,m.visit_id,m.name,convert(varchar,m.discharge_date_time,120) discharge_date_time,m.dept_name dept_name,m.ArchiveState,m.DOCTOR_IN_CHARGE
from emr_fault_detail f
LEFT JOIN Archive_Master m
on f.archive_detail_id=m.id
LEFT JOIN emr_fault_type t
on f.assort_id=convert(varchar(50),t.id)
<where> 1=1 and ArchiveState!='作废'
<if test="archiveDetailId != null and archiveDetailId != '' ">
and f.archive_detail_id = #{archiveDetailId,jdbcType=NVARCHAR}
</if>
<if test="inpNo != null and inpNo != ''">
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
</if>
<if test="visitId != null and visitId != ''">
and m.visit_id=#{visitId,jdbcType=NCHAR}
</if>
<if test="name != null and name != ''">
and m.name like '%'+#{name,jdbcType=NCHAR}+'%'
</if>
<!--<if test="archivestate != null and archivestate != ''">-->
<!--and m.ArchiveState=#{archivestate,jdbcType=NCHAR}-->
<!--</if>-->
<if test="archivestate!= null and archivestate!= ''">
and m.ArchiveState in
<foreach item="item" collection="archivestate.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="deptName!= null and deptName!= ''">
and m.dept_name in
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="creater != null and creater != ''">
and m.creater like '%'+#{creater,jdbcType=NCHAR}+'%'
</if>
<if test="doctorInCharge != null and doctorInCharge != ''">
and m.DOCTOR_IN_CHARGE like '%'+#{doctorInCharge,jdbcType=NCHAR}+'%'
</if>
<choose>
<when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
and CONVERT(VARCHAR(20),m.discharge_date_time,23) between CONVERT(VARCHAR(20),#{startDate,jdbcType=NCHAR},23) and
CONVERT(VARCHAR(20),#{endDate,jdbcType=NCHAR},23)
</when>
<when test="startDate != null and startDate != ''">
and CONVERT(VARCHAR(20),m.discharge_date_time,23) >= CONVERT(VARCHAR(20),#{startDate,jdbcType=NCHAR},23)
</when>
<when test="endDate != null and endDate != ''">
and CONVERT(VARCHAR(20),m.discharge_date_time,23) &lt;=CONVERT(VARCHAR(20),#{endDate,jdbcType=NCHAR},23)
</when>
</choose>
<if test="assortId!= null and assortId!= ''">
and f.assort_id in
<foreach item="item" collection="assortId.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="content != null and content != '' ">
and f.content = #{content,jdbcType=NVARCHAR}
</if>
<if test="price != null ">
and f.price = #{price,jdbcType=DECIMAL}
</if>
<if test="score != null">
and f.score = #{score,jdbcType=DECIMAL}
</if>
<if test="backContent != null and backContent != '' ">
and f.back_content = #{backContent,jdbcType=NVARCHAR}
</if>
<if test="firstTrial != null and firstTrial != ''">
and f.first_trial = #{firstTrial,jdbcType=NVARCHAR}
</if>
<if test="state != null and state != ''">
and f.state = #{state,jdbcType=NVARCHAR}
</if>
<if test="recallReason != null and recallReason != ''">
and f.recall_reason = #{recallReason,jdbcType=VARCHAR}
</if>
<!--<if test="creater != null and creater != ''">
and f.creater = #{creater,jdbcType=NVARCHAR}
</if>-->
<if test="creater!= null and creater!= ''">
and f.creater in
<foreach item="item" collection="creater.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<choose>
<when test="startDateTo != null and startDateTo != '' and endDateTo != null and endDateTo != ''">
and CONVERT(VARCHAR(20),f.create_time,120) between #{startDateTo,jdbcType=NCHAR} and #{endDateTo,jdbcType=NCHAR}
</when>
<when test="startDateTo != null and startDateTo != ''">
and CONVERT(VARCHAR(20),f.create_time,120) >= #{startDateTo,jdbcType=NCHAR}
</when>
<when test="endDateTo != null and endDateTo != ''">
and CONVERT(VARCHAR(20),f.create_time,120) &lt;=#{endDateTo,jdbcType=NCHAR}
</when>
</choose>
<if test="backFlag!= null and backFlag!= ''">
and f.back_flag in
<foreach item="item" collection="backFlag.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="updater != null and updater != ''">
and f.updater = #{updater,jdbcType=NVARCHAR}
</if>
<if test="updateTime != null and updateTime != ''">
and f.update_time = #{updateTime,jdbcType=NCHAR}
</if>
<if test="dealFlag != null and dealFlag!=''">
and f.deal_flag= #{dealFlag,jdbcType=NVARCHAR}
</if>
<if test="dealPerson != null and dealPerson != '' ">
and f.deal_person= #{dealPerson,jdbcType=NVARCHAR}
</if>
<if test="dealTime != null and dealTime != ''">
and f.deal_time= #{dealTime,jdbcType=NVARCHAR}
</if>
<if test="archiveState != null and archiveState!=''">
and f.archive_state=#{archiveState,jdbcType=NVARCHAR}
</if>
</where>
</select>
<select id="selectByDept" parameterType="com.emr.entity.Emr_Fault_Detail" resultMap="BaseResultMap">
select ISNULL(100-sum(minus_point),0) price from emr_fault_detail
where 1=1 and deal_flag='0'
<if test="archiveDetailId != null">
and archive_detail_id = #{archiveDetailId,jdbcType=NVARCHAR}
</if>
<if test="backFlag==1">
and back_flag in(1,2,5,6)
</if>
<if test="backFlag==2">
and back_flag in(5,6)
</if>
</select>
<select id="selectByColumn" parameterType="com.emr.entity.Emr_Fault_Detail" resultMap="BaseResultMap2">
select
d.*,m.ArchiveState,m.cmt_nurse,m.cmt_doctor,t.type_name assort_name
from emr_fault_detail d
LEFT JOIN emr_fault_type t
on d.assort_id=convert(varchar(50),t.id)
left JOIN archive_master m
on m.id=d.archive_detail_id
where 1=1
<!-- <if test="backFlag!= null and backFlag!= '' and backFlag!= 1 and backFlag!= 2">
and d.back_flag in
<foreach item="item" collection="backFlag.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>-->
<if test="backFlag==1">
and d.back_flag in (1,2,5,6)
</if>
<if test="backFlag==2">
and d.back_flag in(5,6)
</if>
<if test="backFlag== 3">
and d.back_flag in (1,5)
</if>
<if test="backFlag== 4">
and d.back_flag in (2,6)
</if>
<if test="dealFlag!= null and dealFlag!=''">
and d.deal_flag = #{dealFlag,jdbcType=NVARCHAR}
</if>
<if test="id != null">
and d.id = #{id,jdbcType=INTEGER}
</if>
<if test="archiveDetailId != null">
and d.archive_detail_id = #{archiveDetailId,jdbcType=NVARCHAR}
</if>
<if test="assortId != null">
and d.assort_id = #{assortId,jdbcType=NVARCHAR}
</if>
<if test="backContent != null and backContent!=''">
and t.type_name like '%'+#{backContent,jdbcType=NVARCHAR}+'%'
</if>
<if test="content != null">
and d.content = #{content,jdbcType=NVARCHAR}
</if>
<if test="price != null">
and d.price = #{price,jdbcType=DECIMAL}
</if>
<if test="creater != null">
and d.creater = #{creater,jdbcType=NVARCHAR}
</if>
<if test="createTime != null">
and d.create_time = #{createTime,jdbcType=NCHAR}
</if>
<if test="updater != null">
and d.updater = #{updater,jdbcType=NVARCHAR}
</if>
<if test="updateTime != null">
and d.update_time = #{updateTime,jdbcType=NCHAR}
</if>
<!--<if test="backFlag != null and backFlag!=''">-->
<!--and d.back_flag= #{backFlag,jdbcType=NCHAR}-->
<!--</if>order by d.update_time,d.create_time desc-->
ORDER BY case WHEN( d.update_time is not null) THEN d.update_time ELSE d.create_time END desc
</select>
<select id="selectByArchiveDetailId" parameterType="com.emr.entity.Emr_Fault_Detail" resultMap="BaseResultMap">
select top 1 m.* from emr_fault_detail m where 1=1
@ -565,6 +693,7 @@
</foreach>
</if>
</select>
<!--缺陷列表-->
<select id="getQualityControlList" parameterType="com.emr.entity.Emr_Fault_Vo" resultMap="BaseResultMap2">
select m.inp_no,m.visit_id,m.name,m.discharge_date_time,m.ArchiveState,ISNULL(m.score, 100) score,m.content,m.back_content,m.DOCTOR_IN_CHARGE,m.creater,m.create_time,ISNULL(t.price, 0) price,t.type_flag,t.type_name,g.code dept_code,ISNULL(g.Name, m.dept_name) dept_name
from(
@ -625,4 +754,132 @@
</where>
order by m.create_time desc
</select>
<!--退回总次数、总费用和总评分-->
<select id="masterTotalList" parameterType="com.emr.entity.Emr_Fault_Vo" resultMap="BaseResultMap2">
select m.id archive_detail_id,m.inp_no,m.visit_id,m.name,convert(varchar,m.discharge_date_time,120) discharge_date_time,a.total_back_fee,a.total_back_num,#{backFee,jdbcType=NCHAR} back_fee,
m.dept_name dept_admission_to,ISNULL(d.name,m.dept_name) dept_name,m.ArchiveState,isnull(m.score,0) score,m.DOCTOR_IN_CHARGE
from(
select master_id,count(*) total_back_num,count(*)* #{backFee,jdbcType=NCHAR} total_back_fee from Archive_Master_Following where following_type=9 group by master_id
) a
LEFT JOIN Archive_Master m
on a.master_id=m.id
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where typeCode='dept_code' )) d
on m.dept_name=d.code
<where> 1=1
<if test="inpNo != null and inpNo != ''">
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
</if>
<if test="visitId != null and visitId != ''">
and m.visit_id=#{visitId,jdbcType=NCHAR}
</if>
<if test="name != null and name != ''">
and m.name like '%'+#{name,jdbcType=NCHAR}+'%'
</if>
<!--<if test="archivestate != null and archivestate != ''">-->
<!--and m.ArchiveState=#{archivestate,jdbcType=NCHAR}-->
<!--</if>-->
<if test="archivestate!= null and archivestate!= ''">
and m.ArchiveState in
<foreach item="item" collection="archivestate.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="deptName!= null and deptName!= ''">
and m.dept_name in
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="dischargeDateTime != null">
and m.discharge_date_time = #{dischargeDateTime,jdbcType=NVARCHAR}
</if>
<if test="creater != null and creater != ''">
and m.creater like '%'+#{creater,jdbcType=NCHAR}+'%'
</if>
<if test="doctorInCharge != null and doctorInCharge != ''">
and m.DOCTOR_IN_CHARGE like '%'+#{doctorInCharge,jdbcType=NCHAR}+'%'
</if>
<choose>
<when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
and CONVERT(VARCHAR(20),m.discharge_date_time,23) between CONVERT(VARCHAR(20),#{startDate,jdbcType=NCHAR},23) and
CONVERT(VARCHAR(20),#{endDate,jdbcType=NCHAR},23)
</when>
<when test="startDate != null and startDate != ''">
and CONVERT(VARCHAR(20),m.discharge_date_time,23) >= CONVERT(VARCHAR(20),#{startDate,jdbcType=NCHAR},23)
</when>
<when test="endDate != null and endDate != ''">
and CONVERT(VARCHAR(20),m.discharge_date_time,23) &lt;=CONVERT(VARCHAR(20),#{endDate,jdbcType=NCHAR},23)
</when>
</choose>
<if test="updater!= null and updater!= ''">
and t.id in
<foreach item="item" collection="updater.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
order by m.discharge_date_time desc
</select>
<!--退回次数和评分-->
<select id="faultBackScoreList" parameterType="com.emr.entity.Emr_Fault_Vo" resultMap="BaseResultMap2">
select a.archive_detail_id,a.creater,convert(varchar,create_time,120) create_time,m.inp_no,m.visit_id,m.name,convert(varchar,m.discharge_date_time,120)
discharge_date_time,m.dept_name,m.ArchiveState,isnull(m.score,0) score,m.DOCTOR_IN_CHARGE
from(
select DISTINCT archive_detail_id,creater,create_time from emr_fault_detail
where 1=1 and back_flag in(5,6)
)a
left join(
select m.id,m.inp_no,m.visit_id,m.name,m.discharge_date_time,m.dept_name,m.ArchiveState, score,m.DOCTOR_IN_CHARGE
from Archive_Master m where ArchiveState!='作废'
)m
on a.archive_detail_id=m.id
<where> 1=1 and m.ArchiveState!='作废'
<if test="archiveDetailId != null and archiveDetailId != ''">
and a.archive_detail_id=#{archiveDetailId,jdbcType=NCHAR}
</if>
<if test="updater!= null and updater!= ''">
and a.creater in
<foreach item="item" collection="updater.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="inpNo != null and inpNo != ''">
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
</if>
<if test="visitId != null and visitId != ''">
and m.visit_id=#{visitId,jdbcType=NCHAR}
</if>
<if test="name != null and name != ''">
and m.name like '%'+#{name,jdbcType=NCHAR}+'%'
</if>
<if test="deptName!= null and deptName!= ''">
and m.dept_name in
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="deptAdmissionTo != null and deptAdmissionTo!=''">
and m.dept_admission_to in
<foreach item="item" collection="deptAdmissionTo.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<choose>
<when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
and CONVERT(VARCHAR(20),m.discharge_date_time,23) between #{startDate,jdbcType=NCHAR} and #{endDate,jdbcType=NCHAR}
</when>
<when test="startDate != null and startDate != ''">
and CONVERT(VARCHAR(20),m.discharge_date_time,23) >=#{startDate,jdbcType=NCHAR}
</when>
<when test="endDate != null and endDate != ''">
and CONVERT(VARCHAR(20),m.discharge_date_time,23) &lt;= #{endDate,jdbcType=NCHAR}
</when>
</choose>
</where>
order by create_time desc
</select>
<!--<select id="faultBackList" parameterType="com.emr.entity.Emr_Fault_Detail" resultMap="BaseResultMap">
</select>-->
</mapper>

@ -96,58 +96,67 @@
<%--&lt;%&ndash;<option value="已认证">已认证</option>&ndash;%&gt;--%>
<%--&lt;%&ndash;<option value="已归档">已归档</option>&ndash;%&gt;--%>
<%--</select>--%>
<select class="selectpicker bla bla bli" multiple data-live-search="true" name="deptName"
id="deptName" data-actions-box="true" data-deselect-all-text="取消全选" data-select-all-text="全选"
title="请输入出院科室" data-none-results-text="没找到相应记录{0}">
<option value="">全部</option>
</select>
</div>
<div class="form-group divCss8">
<label for="name">主管医生:</label>
<select class="selectpicker bla bla bli" multiple data-live-search="true" name="doctorInCharge" id="doctorInCharge" title="请输入主管医生"
data-actions-box="true" data-deselect-all-text="取消全选" data-select-all-text="全选" data-none-results-text="没找到相应记录{0}">
<option value="--">全部</option>
</select>
<%-- <input type="text" class="input-sm form-control" id="doctorInCharge" placeholder="请输入主管医生">--%>
</div>
<div class="form-group divCss8">
<label for="name">创建人:</label>
<select class="selectpicker bla bla bli" multiple data-live-search="true" name="creater" id="creater" title="请输入创建人"
data-actions-box="true" data-deselect-all-text="取消全选" data-select-all-text="全选" data-none-results-text="没找到相应记录{0}">
<option value="--">全部</option>
</select>
<%-- <input type="text" class="input-sm form-control" id="creater" placeholder="请输入创建人">--%>
</div>
<label class="form-group">缺陷选项:</label>
<div class="form-group divCss8">
<%-- <label for="name">缺陷选项:</label>
<select id="typeFlag" multiple="multiple" title="请输入选项" name="typeFlag" >
<option value="">全部</option>
</select>--%>
<select class="selectpicker bla bla bli" multiple data-live-search="true" name="deptName"
id="deptName" data-actions-box="true" data-deselect-all-text="取消全选" data-select-all-text="全选"
title="请输入出院科室" data-none-results-text="没找到相应记录{0}">
<option value="">全部</option>
</select>
</div>
<div class="form-group divCss8">
<label for="name">主管医生:</label>
<select class="selectpicker bla bla bli" multiple data-live-search="true" name="doctorInCharge" id="doctorInCharge" title="请输入主管医生"
data-actions-box="true" data-deselect-all-text="取消全选" data-select-all-text="全选" data-none-results-text="没找到相应记录{0}">
<option value="--">全部</option>
</select>
<%-- <input type="text" class="input-sm form-control" id="doctorInCharge" placeholder="请输入主管医生">--%>
</div>
<%--<div class="form-group divCss8">
<label for="name">退回人:</label>
<select class="selectpicker bla bla bli" multiple data-live-search="true" name="backer" id="backer" title="请输入退回人"
data-actions-box="true" data-deselect-all-text="取消全选" data-select-all-text="全选" data-none-results-text="没找到相应记录{0}">
<option value="--">全部</option>
</select>
&lt;%&ndash;<input type="text" class="input-sm form-control" id="backer" placeholder="请输入退回人">&ndash;%&gt;
</div>--%>
<div class="form-group divCss8">
<label for="name">创建人:</label>
<select class="selectpicker bla bla bli" multiple data-live-search="true" name="creater" id="creater" title="请输入创建人"
data-actions-box="true" data-deselect-all-text="取消全选" data-select-all-text="全选" data-none-results-text="没找到相应记录{0}">
<option value="--">全部</option>
</select>
<%--<input type="text" class="input-sm form-control" id="creater" placeholder="请输入创建人">--%>
</div>
<label class="form-group">缺陷选项:</label>
<div class="form-group divCss8">
<%-- <label for="name">缺陷选项:</label>
<select id="typeFlag" multiple="multiple" title="请输入选项" name="typeFlag" >
<option value="">全部</option>
</select>--%>
<%--<div class="col-lg-3 form-group divCss8" ><label>缺陷选项:</label></div>--%>
<div id="mulDiv">
</div>
</div>
<div class="form-group divCss">
<label for="archivestate">归档状态 :</label>
<select class="input-sm form-control" id="archivestate">
<option value="">全部</option>
<%--<option value="在院">在院</option>--%>
<%--<option value="未归档">未归档</option>--%>
<%--<option value="归档中">归档中</option>--%>
<option value="初审">初审</option>
<%--<option value="已认证">已认证</option>--%>
<option value="已归档">已归档</option>
<%--<option value="复审退回">复审退回</option>--%>
</select>
</div>
<button type="button" class="btn btn-primary btn-sm divCss" id="searchBtn">查询</button>
<button type="button" class="btn btn-info btn-sm divCss" id="excelBtn">条件导出</button>
</div>
</form>
<div class="form-group divCss">
<label for="archivestate">归档状态 :</label>
<select class="selectpicker bla bla bli" multiple data-live-search="true" name="doctorInCharge" id="archivestate" title="请输入归档状态"
data-actions-box="true" data-deselect-all-text="取消全选" data-select-all-text="全选" data-none-results-text="没找到相应记录{0}">
<option value="">全部</option>
<option value="在院">在院</option>
<option value="未归档">未归档</option>
<option value="归档中">归档中</option>
<option value="初审">初审</option>
<option value="已认证">已认证</option>
<option value="已归档">已归档</option>
<option value="复审退回">复审退回</option>
</select>
</div>
<button type="button" class="btn btn-primary btn-sm divCss" id="searchBtn">查询</button>
<button type="button" class="btn btn-info btn-sm divCss" id="excelBtn">条件导出</button>
</div>
</form>
</div>
<!--数据表格-->
<table id="table" class="table text-nowrap table-striped"></table>
@ -277,9 +286,10 @@
if(tipLoad==1){
$("#table").bootstrapTable({ // 对应table标签的id
//method: 'POST',
url: "${path}/fault/getQualityControlList", // 获取表格数据的url
url: "${path}/fault/masterTotalList", // 获取表格数据的url getQualityControlList
contentType: "application/x-www-form-urlencoded",//一种编码。好像在post请求的时候需要用到。这里用的get请求注释掉这句话也能拿到数据
//dataField: "data",//这是返回的json数组的key.默认是"rows".这里只有前后端约定好就行
detailView: true,//父子表为true会在父数据前添加 “+”
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
@ -346,27 +356,21 @@
deptName = $("#deptName").val().toString();
}
var typeFlag = $("#typeFlag").val();
if (typeFlag== undefined ||typeFlag== null ||typeFlag== "undefined") {
typeFlag = "";
} else {
typeFlag = $("#typeFlag").val().toString();
}
var temp = {
limit: limit, //页面大小
offset: offset, //页码
order: params.order, //排位命令descasc
startDate: $("#startDate").val(),
endDate: $("#endDate").val(),
inpNo: "" + $("#inpNo").val(),
visitId:""+$("#visitId").val(),
name:""+$("#name").val(),
doctorInCharge:""+$("#doctorInCharge").val(),
updater:""+typeFlag,
creater:""+$("#creater").val(),
archivestate:"" + $("#archivestate").val(),
deptName: deptName
var temp = {
limit: limit, //页面大小
offset: offset, //页码
order: params.order, //排位命令descasc
startDate: $("#startDate").val(),
endDate: $("#endDate").val(),
inpNo: "" + $("#inpNo").val(),
visitId:""+$("#visitId").val(),
name:""+$("#name").val(),
doctorInCharge:""+$("#doctorInCharge").val(),
//creater:""+$("#creater").val(),
archivestate:"" + $("#archivestate").val(),
deptName: deptName
};
return temp;
@ -478,57 +482,37 @@
title: '评分(分)',
//sortable: true,
align: 'center',
valign: 'middle',
formatter: function (value, row, index) {
return value;
//return changeDateFormat(value)
}
valign: 'middle'
},
{
field: 'price',
title: '扣分项',
//sortable: true,
title: '主管医生',
field: 'doctorInCharge',
align: 'center',
valign: 'middle',
formatter: function (value, row, index) {
return value;
//return changeDateFormat(value)
}
},
{
field: 'backContent',
title: '退回内容',
visible: false,
formatter: function (value, row, index) {
return value;
//return changeDateFormat(value)
}
},
{
field: 'typeName',
title: '缺陷选项',
valign: 'middle',
formatter: function (value, row, index) {
return value;
//return changeDateFormat(value)
}
},
{
field: 'content',
title: '缺陷自定内容',
},{
field: 'totalBackNum',
title: '退回总次数',
//sortable: true,
align: 'center',
valign: 'middle'
},{
field: 'backFee',
title: '退回单价',
//sortable: true,
align: 'center',
valign: 'middle'
},{
field: 'totalBackFee',
title: '退回总费用(元)',
align: 'center',
valign: 'middle',
formatter: function (value, row, index) {
//console.log(row);
return value;
//return changeDateFormat(value)
}
},
{
title: '主管医生',
field: 'doctorInCharge',
align: 'center',
valign: 'middle',
},
{
}
/*{
field: 'createTime',
title: '创建时间',
valign: 'middle',
@ -545,7 +529,7 @@
return value;
//return changeDateFormat(value)
}
},
},*/
// {
// field: 'updater',
// title: '修改人',
@ -585,8 +569,336 @@
onLoadError: function () { //加载失败时执行
//console.info("加载数据失败");
tipLoad = 0;
},onExpandRow: function (index, row, $detail) {
InitSubTable(index, row, $detail);
}
});
//初始化子表格(无线循环)
InitSubTable = function (index, row, $detail) {
//console.log(row);
if(row.backNum=="异常"){
toastr.warning("退回次数为异常,请先纠正!");
return;
}
var archiveDetailId = row.archiveDetailId;
var cur_table = $detail.html('<table id="backTable"></table>').find('table');
//console.log(endDateTo+"========================"+startDateTo);
$(cur_table).bootstrapTable({
//method: 'POST',
url: "${path}/fault/faultBackScoreList", // 获取表格数据的url
contentType: "application/x-www-form-urlencoded",//一种编码。好像在post请求的时候需要用到。这里用的get请求注释掉这句话也能拿到数据
//dataField: "data",//这是返回的json数组的key.默认是"rows".这里只有前后端约定好就行
detailView: true,//父子表为true会在父数据前添加 “+”
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
paginationShowPageGo: true,
pageList: [10, 20,50,100], // 如果设置了分页设置可供选择的页面数据条数。设置为All 则显示所有记录。
smartDisplay: false,
pageSize: 10, // 页面数据条数
pageNumber: 1, // 初始化加载第一页,默认第一页
sidePagination: 'server', // 设置为服务器端分页 客户端client
search: false,
showColumns: false,
// toolbar: '#toolbar2',//指定工具栏
// searchOnEnterKey: true, //设置为 true时按回车触发搜索方法否则自动触发搜索方法
// undefinedText: '---', //当数据为 undefined 时显示的字符
singleSelect: false,//设置True 将禁止多选
// clickToSelect: true,//设置true 将在点击行时自动选择rediobox 和 checkbox
//height: 560, //定义表格的高度。
searchTimeOut: 500,// 默认500 设置搜索超时时间。
toolbarAlign: 'right',// 指定 toolbar 水平方向的位置。'left' 或 'right'
paginationDetailHAlign: 'left',//指定 分页详细信息 在水平方向的位置。'left' 或 'right'。
showHeader: true,//是否显示列头。
trimOnSearch: true,//设置为 true 将自动去掉搜索字符的前后空格。
//是否显示导出按钮
showExport: false,
queryParams: function (params) {
var currPageSize= this.pageSize;
if(currPageSize==2){
currPageSize=10;
}
var limit= null;
var offset= params.offset;
//判断是否导出全部all
if ($("#sel_exportoption2").val() == "all") {
offset=0;
limit=this.totalRows;
this.pageSize= limit;
}else{
limit = currPageSize;
this.pageSize = currPageSize;
}
var temp = {
limit: limit, //页面大小
offset: offset, //页码
order: params.order, //排位命令descasc
archiveDetailId:archiveDetailId
//updater:""+$("#backer").val()
};
return temp;
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
/*{
title: '全选',
field: 'select', //复选框
checkbox: true,
width: 25,
align: 'left',
valign: 'middle',
},*/
{
title: '序号',
field: 'id',
align: 'center',
valign: 'middle',
//field: 'ID',
// visible: false,
formatter: function (value, row, index) {
return index + 1;
}
},
{
title: '病案清单id',
field: 'archiveDetailId',
valign: 'middle',
visible: false
//sortable: true,
},
{
title: '退回开始时间',
field: 'startDateTo',
align: 'center',
valign: 'middle',
},
{
title: '退回结束时间',
field: 'endDateTo',
align: 'center',
valign: 'middle',
},
{
field: 'score',
title: '评分(分)',
//sortable: true,
align: 'center',
valign: 'middle'
},
{
field: 'backNum',
title: '退回次数',
//sortable: true,
align: 'center',
valign: 'middle',
formatter: function (value, row, index) {
var a ='';
if(value=="异常"){
a ='<span style="color:red"><i class="fa fa-check-circle-o" aria-hidden="true"></i>' + value + '</span>';
}else{
a=value;
}
return a;
}
},
{
field: 'createTime',
title: '退回时间',
valign: 'middle',
align: 'center',
},
{
field: 'creater',
title: '退回人',
valign: 'middle',
align: 'left',
}
], //无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $Subdetail) {
InitSubTable2(index, row, $Subdetail);
}
});
}
//初始化子表格(无线循环)
InitSubTable2 = function (index, row, $detail) {
if(row.backNum=="异常"){
toastr.warning("退回次数为异常,请先纠正!");
return;
}
var archiveDetailId = row.archiveDetailId;
var startDateTo=row.startDateTo;
var endDateTo=row.endDateTo;
var cur_table2 = $detail.html('<table id="faultTable"></table>').find('table');
console.log(archiveDetailId+"========"+archiveDetailId+"====="+startDateTo+"======="+endDateTo);
$(cur_table2).bootstrapTable({
//method: 'POST',
url: "${path}/fault/faultListByTj", // 获取表格数据的url
contentType: "application/x-www-form-urlencoded",//一种编码。好像在post请求的时候需要用到。这里用的get请求注释掉这句话也能拿到数据
//dataField: "data",//这是返回的json数组的key.默认是"rows".这里只有前后端约定好就行
detailView: false,//父子表为true会在父数据前添加 “+”
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
paginationShowPageGo: true,
pageList: [10, 20,50,100], // 如果设置了分页设置可供选择的页面数据条数。设置为All 则显示所有记录。
smartDisplay: false,
pageSize: 10, // 页面数据条数
pageNumber: 1, // 初始化加载第一页,默认第一页
sidePagination: 'server', // 设置为服务器端分页 客户端client
search: false,
showColumns: false,
// toolbar: '#toolbar2',//指定工具栏
// searchOnEnterKey: true, //设置为 true时按回车触发搜索方法否则自动触发搜索方法
// undefinedText: '---', //当数据为 undefined 时显示的字符
singleSelect: false,//设置True 将禁止多选
// clickToSelect: true,//设置true 将在点击行时自动选择rediobox 和 checkbox
//height: 560, //定义表格的高度。
searchTimeOut: 500,// 默认500 设置搜索超时时间。
toolbarAlign: 'right',// 指定 toolbar 水平方向的位置。'left' 或 'right'
paginationDetailHAlign: 'left',//指定 分页详细信息 在水平方向的位置。'left' 或 'right'。
showHeader: true,//是否显示列头。
trimOnSearch: true,//设置为 true 将自动去掉搜索字符的前后空格。
//是否显示导出按钮
showExport: false,
queryParams: function (params) {
var currPageSize= this.pageSize;
if(currPageSize==2){
currPageSize=10;
}
var limit= null;
var offset= params.offset;
//判断是否导出全部all
if ($("#sel_exportoption2").val() == "all") {
offset=0;
limit=this.totalRows;
this.pageSize= limit;
}else{
limit = currPageSize;
this.pageSize = currPageSize;
}
var typeFlag = $("#typeFlag").val();
if (typeFlag== undefined ||typeFlag== null ||typeFlag== "undefined") {
typeFlag = "";
} else {
typeFlag = $("#typeFlag").val().toString();
}
var temp = {
limit: limit, //页面大小
offset: offset, //页码
order: params.order, //排位命令descasc
archiveDetailId: archiveDetailId,
startDateTo: startDateTo,
creater:""+$("#creater").val(),
endDateTo: endDateTo,
backFlag:"5,6",
assortId:""+typeFlag
};
return temp;
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
/*{
title: '全选',
field: 'select', //复选框
checkbox: true,
width: 25,
align: 'left',
valign: 'middle',
},*/
{
title: '序号',
field: 'id',
align: 'center',
valign: 'middle',
//field: 'ID',
// visible: false,
formatter: function (value, row, index) {
return index + 1;
}
},
{
title: '病案清单id',
field: 'archiveDetailId',
valign: 'middle',
visible: false
//sortable: true,
},
{
field: 'assortName',
title: '缺陷选项',
valign: 'middle',
formatter: function (value, row, index) {
// console.log(row);
return value;
//return changeDateFormat(value)
}
},{
field: 'score',
title: '扣分(分)',
//sortable: true,
align: 'center',
valign: 'middle',
formatter: function (value, row, index) {
if(value==null){
value=0;
}
return value;
//return changeDateFormat(value)
}
},
{
field: 'content',
title: '缺陷自定内容',
valign: 'middle',
formatter: function (value, row, index) {
return value;
//return changeDateFormat(value)
}
},
{
field: 'backContent',
title: '退回内容',
//visible: false,
formatter: function (value, row, index) {
return value;
//return changeDateFormat(value)
}
},{
field: 'createTime',
title: '创建时间',
valign: 'middle',
formatter: function (value, row, index) {
return value;
//return changeDateFormat(value)
}
},
{
field: 'creater',
title: '创建人',
valign: 'middle',
formatter: function (value, row, index) {
return value;
//return changeDateFormat(value)
}
}
], //无线循环取子表,直到子表里面没有记录
//onExpandRow: function (index, row, $Subdetail) {
//InitSubTable2(index, row, $Subdetail);
//}
});
}
}
}
@ -594,7 +906,30 @@
$('#searchBtn').click(function () {
//查询之后重新从第一页算起
if (tipLoad == 0) {
$("#table").bootstrapTable("refreshOptions", {pageNumber: 1}); //刷新
var startDate2=$("#startDate").val(),
endDate2= $("#endDate").val(),
inpNo2="" + $("#inpNo").val(),
visitId2=""+$("#visitId").val(),
name2=""+$("#name").val(),
doctorInCharge2=""+$("#doctorInCharge").val(),
typeFlag2 = $("#typeFlag").val(),
creater2=""+$("#creater").val(),
//backer2=""+$("#backer").val(),
archivestate2="" + $("#archivestate").val(),
deptName2= $("#archivestate").val();
if((startDate2==null || startDate2=="") && (endDate2==null || endDate2=="")&& (inpNo2==null || inpNo2=="") && (visitId2==null || visitId2=="")
&& (name2==null || name2=="") && (doctorInCharge2==null || doctorInCharge2=="") && (archivestate2==null || archivestate2=="") && (deptName2==null || deptName2=="")){
if((typeFlag2!=null && typeFlag2!="") || (creater2!=null || creater2!="") ){
$("#faultTable").bootstrapTable("refreshOptions", {pageNumber: 1}); //刷新
}else{
$("#backTable").bootstrapTable("refreshOptions", {pageNumber: 1}); //刷新
}
}else{
$("#table").bootstrapTable("refreshOptions", {pageNumber: 1}); //刷新
}
//$('#table').bootstrapTable('refresh');
} else {
toastr.warning("正在查询,请稍等...");
@ -618,6 +953,8 @@
for (var i = 0; i < data.length; i++) {
$("#doctorInCharge").append("<option value=" + data[i].userName + ">" + data[i].name + "</option>");
$("#creater").append("<option value=" + data[i].userName + ">" + data[i].name + "</option>");
//$("#backer").append("<option value=" + data[i].userName + ">" + data[i].name + "</option>");
}
}
$(".selectpicker").selectpicker('refresh');
@ -719,6 +1056,7 @@
//导出excel功能
$("#excelBtn").click(function () {
var backFlag = "5,6";
var inpNo = "" + $("#inpNo").val();
var visitId = "" + $("#visitId").val();
var name = "" + $("#name").val();
@ -744,21 +1082,23 @@
}
//主管医生、创建人、缺陷选项
/*var doctorInCharge=""+$("#doctorInCharge").val();
var doctorInCharge=""+$("#doctorInCharge").val();
var typeFlag = $("#typeFlag").val();
if (typeFlag== undefined ||typeFlag== null ||typeFlag== "undefined") {
typeFlag = "";
} else {
typeFlag = $("#typeFlag").val().toString();
}
var updater=""+typeFlag;
var creater=""+$("#creater").val();*/
var assortId=""+typeFlag;
var creater=""+$("#creater").val();
//var backer=""+$("#backer").val();
//导出ArchiveState in('已归档','已认证','初审')
window.location.href = "${path}/fault/exportExcel?inpNo=" + inpNo + "&visitId=" + visitId +
"&name=" + name + "&startDate=" + startDate + "&endDate=" + endDate + "&archivestate=" + archivestate+
"&deptName="+ deptName;
//+ "&doctorInCharge=" + doctorInCharge ;
//+ "&updater=" + updater + "&creater=" + creater;
"&deptName="+ deptName + "&doctorInCharge=" + doctorInCharge
+ "&assortId=" + assortId + "&creater=" + creater+"&backFlag="+backFlag;
});
</script>

Loading…
Cancel
Save