复印记录(统计+明细)、扫描上传(统计和明细)

master
hujl 4 years ago
parent 9a01fce576
commit c871980a65

@ -0,0 +1,107 @@
/**
* Copyright (C), 2015-2019
* Author: HJL
* Date: 2019/7/19 14:39
* Description:
*/
package com.emr.controller;
import com.emr.entity.Archive_Master_Vo;
import com.emr.entity.OffsetLimitPage;
import com.emr.service.Archive_MasterService;
import com.emr.util.DatelUtils;
import com.emr.util.ThreadExcelUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import static com.emr.util.DatelUtils.addDayFun;
import static com.emr.util.DatelUtils.compareDate;
//@PropertySource(value = "classpath:config/jdbc.properties", encoding = "UTF-8")
@Controller
@RequestMapping("/copyInfo")
public class CopyListController {
@Autowired
private Archive_MasterService archiveMasterService;
@RequestMapping(value = "/copyDetailList")
public String faults(Model model) {
return "copyDir/copyDetailList";
}
@ResponseBody
@RequestMapping(value = "/copyDetailPage")
public OffsetLimitPage copyDetailPage(HttpServletRequest request, HttpServletResponse response,Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) throws Exception {
//判断复制时段类型
archiveMasterVo=DatelUtils.setMaterVoFun(archiveMasterVo);
OffsetLimitPage result = (OffsetLimitPage) archiveMasterService.copyDetailList(archiveMasterVo, offset, limit);
return result;
}
@ResponseBody
@RequestMapping(value = "/exportExcel")
public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo) throws Exception {
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
String[] header = {"记帐号","住院号","住院次数","患者姓名","性别","入院日期","出院日期","出院科室","主管医生","复印内容","复印日期"};
String[] fileNames = {"patientId","inpNo","visitId","name","sex","admissionDateTime","dischargeDateTime","deptName","doctorInCharge","content","createTime"};
//文件名
String fileName = "复印记录明细" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
//构造excel的数据beHospList
archiveMasterVo= DatelUtils.setMaterVoFun(archiveMasterVo);
List<Archive_Master_Vo> list = archiveMasterService.copyDetailList(archiveMasterVo);
ThreadExcelUtils utils = new ThreadExcelUtils(fileName, "", header, fileNames);
String result=utils.exportExcelToFilePath(response,utils.listConvert(list));
}
/*
*
* */
@RequestMapping(value = "/copyCountList")
public String faultsLog(Model model) {
return "copyDir/copyCountList";
}
/*
*
* */
@ResponseBody
@RequestMapping(value = "/copyCountPage")
public OffsetLimitPage copyCountPage(HttpServletRequest request, HttpServletResponse response, Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit)throws Exception {
archiveMasterVo=DatelUtils.setMaterVoFun(archiveMasterVo);
OffsetLimitPage result = archiveMasterService.copyCountList(archiveMasterVo, offset, limit);
return result;
}
@ResponseBody
@RequestMapping(value = "/exportCountExcel")
public void exportCountExcel(HttpServletResponse response,Archive_Master_Vo archiveMasterVo) throws Exception {
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
String[] header = {"记帐号","住院号","住院次数","患者姓名","复印日期","复印次数"};
String[] fileNames = {"patientId","inpNo","visitId","name","createTime","numb"};
//文件名
String fileName = "复印记录统计" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
//构造excel的数据beHospList
archiveMasterVo=DatelUtils.setMaterVoFun(archiveMasterVo);
List<Archive_Master_Vo> list = archiveMasterService.copyCountList(archiveMasterVo);
ThreadExcelUtils utils = new ThreadExcelUtils(fileName, "", header, fileNames);
String result=utils.exportExcelToFilePath(response,utils.listConvert(list));
}
}

@ -0,0 +1,99 @@
package com.emr.controller;
import com.emr.entity.Archive_Master_Vo;
import com.emr.entity.OffsetLimitPage;
import com.emr.entity.Zd_Assort;
import com.emr.service.ScanInfoService;
import com.emr.util.DatelUtils;
import com.emr.util.ThreadExcelUtils;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
@Controller
@RequestMapping("/scanInfo")
public class ScanListController {
@Autowired
private ScanInfoService scanInfoService;
/*
*
* */
@RequestMapping(value = "/scanCount")
public String scanCount(Model model) {
return "scanDir/scanCountList";
}
/*
*
* */
@ResponseBody
@RequestMapping(value = "/scanCountPage")
public OffsetLimitPage scanCountPage(HttpServletRequest request, HttpServletResponse response, Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit)throws Exception {
archiveMasterVo= DatelUtils.setMaterVoFun(archiveMasterVo);
OffsetLimitPage result = (OffsetLimitPage) scanInfoService.scanCountPage(archiveMasterVo, offset, limit);
return result;
}
@ResponseBody
@RequestMapping(value = "/exportCountExcel")
public void exportCountExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo) throws Exception {
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
String[] header = {"扫描人","扫描日期","扫描次数","扫描份数"};
String[] fileNames = {"creater","createTime","numb","content"};
//文件名
String fileName = "扫描上传记录统计" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
//构造excel的数据beHospList
archiveMasterVo=DatelUtils.setMaterVoFun(archiveMasterVo);
List<Archive_Master_Vo> list = scanInfoService.scanCountList(archiveMasterVo);
ThreadExcelUtils utils = new ThreadExcelUtils(fileName, "", header, fileNames);
String result=utils.exportExcelToFilePath(response,utils.listConvert(list));
}
/*
*
* */
@RequestMapping(value = "/scanDetailList")
public String scanDetailList(Model model) {
return "scanDir/scanDetailList";
}
/*
*
* */
@ResponseBody
@RequestMapping(value = "/scanDetailPage")
public OffsetLimitPage scanDetailPage(HttpServletRequest request, HttpServletResponse response, Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit)throws Exception {
archiveMasterVo= DatelUtils.setMaterVoFun(archiveMasterVo);
OffsetLimitPage result = (OffsetLimitPage) scanInfoService.scanDetailPage(archiveMasterVo, offset, limit);
return result;
}
@ResponseBody
@RequestMapping(value = "/exportExcel")
public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo) throws Exception {
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
/* String[] header = {"记帐号","住院号","住院次数","患者姓名","性别","入院日期","出院日期","出院科室","主管医生","扫描人","文件名","扫描日期"};
String[] fileNames = {"patientId","inpNo","visitId","name","sex","admissionDateTime","dischargeDateTime","deptName","doctorInCharge","creater","content","createTime"};*/
String[] header = {"记帐号","住院号","住院次数","患者姓名","出院日期","扫描人","文件名","扫描日期"};
String[] fileNames = {"patientId","inpNo","visitId","name","dischargeDateTime","creater","content","createTime"};
//文件名
String fileName = "扫描上传记录明细" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
//构造excel的数据beHospList
archiveMasterVo=DatelUtils.setMaterVoFun(archiveMasterVo);
List<Archive_Master_Vo> list = scanInfoService.scanDetailList(archiveMasterVo);
ThreadExcelUtils utils = new ThreadExcelUtils(fileName, "", header, fileNames);
String result=utils.exportExcelToFilePath(response,utils.listConvert(list));
}
}

@ -169,4 +169,20 @@ public interface Archive_MasterMapper {
* @return
*/
List<Archive_Master_Vo> selectStorageByCol(Archive_Master_Vo record);
/**
*
* @param record
* @return
*/
List<Archive_Master_Vo> copyDetailList(Archive_Master_Vo record);
/**
*
* @param record
* @return
*/
List<Archive_Master_Vo> copyCountList(Archive_Master_Vo record);
}

@ -160,6 +160,12 @@ public class Archive_Master_Vo {
//2021-8-06 ,退回给护士的缺陷数量(出院浏览页面使用)
private String faultNurseNum;
private String creater;
private String updater;
private String remark;
public String getFaultDoctorNum() {
return faultDoctorNum;
}
@ -710,6 +716,30 @@ public class Archive_Master_Vo {
public void setEndSignDate(String endSignDate) {
this.endSignDate = endSignDate;
}
public String getCreater() {
return creater;
}
public void setCreater(String creater) {
this.creater = creater;
}
public String getUpdater() {
return updater;
}
public void setUpdater(String updater) {
this.updater = updater;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}

@ -264,6 +264,37 @@ public interface Archive_MasterService {
List<Archive_Master_Vo> selectStorageByCol(Archive_Master_Vo record);
String returnEmr(Emr_Fault_Detail emrFaultDetail, Archive_Master archiveMaster, HttpServletRequest request);
/**
*
* @param record
* @return
*/
List<Archive_Master_Vo> copyDetailList(Archive_Master_Vo record);
/**
*
* @param archiveMasterVo
* @param offset
* @param limit
* @return
*/
OffsetLimitPage copyDetailList(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit);
/**
*
* @param record
* @return
*/
List<Archive_Master_Vo> copyCountList(Archive_Master_Vo record);
/**
*
* @param archiveMasterVo
* @param offset
* @param limit
* @return
*/
OffsetLimitPage copyCountList(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit);
}

@ -0,0 +1,18 @@
package com.emr.service;
import com.emr.entity.Archive_Master;
import com.emr.entity.Archive_Master_Vo;
import com.emr.entity.OffsetLimitPage;
import com.emr.entity.Zd_Assort;
import java.util.List;
public interface ScanInfoService {
OffsetLimitPage scanCountPage(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit);
List<Archive_Master_Vo> scanCountList(Archive_Master_Vo archiveMasterVo);
OffsetLimitPage scanDetailPage(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit);
List<Archive_Master_Vo> scanDetailList(Archive_Master_Vo archiveMasterVo);
}

@ -641,6 +641,74 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
}
return returnMsg;
}
@Override
public List<Archive_Master_Vo> copyDetailList(Archive_Master_Vo archiveMasterVo) {
List<Archive_Master_Vo> list = archiveMasterMapper.copyDetailList(archiveMasterVo);
//查询用户集合
JSONArray powerUsers = powerUserService.getPowerUserList("1");
List<Power_User_Dto> powerUserList = null;
if (!CollectionUtils.isEmpty(powerUsers)) {
//转换对象
powerUserList = JSONArray.parseArray(powerUsers.toJSONString(), Power_User_Dto.class);
}
//遍历赋值
for (Archive_Master_Vo archiveMaster : list) {
if (null != powerUserList) {
//获取主管医生
String doctorInCharge = archiveMaster.getDoctorInCharge();
//遍历匹配工号赋值姓名
for (Power_User_Dto powerUserDto : powerUserList) {
String name = powerUserDto.getName();
if (StringUtils.isNotBlank(doctorInCharge) && powerUserDto.getUserName().equals(doctorInCharge)) {
archiveMaster.setDoctorInCharge(name);
}
}
}
}
return list;
}
@Override
public OffsetLimitPage copyDetailList(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) {
PageHelper.offsetPage(offset, limit);
List<Archive_Master_Vo> list = archiveMasterMapper.copyDetailList(archiveMasterVo);
//查询用户集合
JSONArray powerUsers = powerUserService.getPowerUserList("1");
List<Power_User_Dto> powerUserList = null;
if (!CollectionUtils.isEmpty(powerUsers)) {
//转换对象
powerUserList = JSONArray.parseArray(powerUsers.toJSONString(), Power_User_Dto.class);
}
//遍历赋值
for (Archive_Master_Vo archiveMaster : list) {
if (null != powerUserList) {
//获取主管医生
String doctorInCharge = archiveMaster.getDoctorInCharge();
//遍历匹配工号赋值姓名
for (Power_User_Dto powerUserDto : powerUserList) {
String name = powerUserDto.getName();
if (StringUtils.isNotBlank(doctorInCharge) && powerUserDto.getUserName().equals(doctorInCharge)) {
archiveMaster.setDoctorInCharge(name);
}
}
}
}
return new OffsetLimitPage((Page) list);
}
@Override
public List<Archive_Master_Vo> copyCountList(Archive_Master_Vo archiveMasterVo) {
List<Archive_Master_Vo> list = archiveMasterMapper.copyCountList(archiveMasterVo);
return list;
}
@Override
public OffsetLimitPage copyCountList(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) {
PageHelper.offsetPage(offset, limit);
List<Archive_Master_Vo> list = archiveMasterMapper.copyCountList(archiveMasterVo);
return new OffsetLimitPage((Page) list);
}
}

@ -0,0 +1,490 @@
package com.emr.service.ipml;
import com.emr.entity.Archive_Master_Vo;
import com.emr.entity.OffsetLimitPage;
import com.emr.entity.Zd_Assort;
import com.emr.service.ScanInfoService;
import com.emr.util.JdbcUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
@Service
@Transactional
public class ScanInfoServiceImpl implements ScanInfoService {
@Override
public OffsetLimitPage scanCountPage(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) {
PageHelper.offsetPage(offset, limit);
//开始和结束行数
Integer stratRow=(offset/10)*limit;
Integer endRow=(offset/10)*limit+limit;
Connection con = null;
PreparedStatement stmt = null;
ResultSet rs = null;
int rowTotal=0;
List<Archive_Master_Vo> list=new ArrayList<>();
int a=0,b=0,c=0,d=0;
try {
con = JdbcUtil.getConnection();
String sql = "";//"select * from [zd_Assort] where print_flag=?";
/*select c.patient_id,c.numb,a.assort_name,a.assort_date,content from(
select patient_id,assort_id,COUNT(*) numb from t_scan_assort where patient_id is not null and patient_id!='' group by patient_id,assort_id
)c
LEFT JOIN(
select patient_id,assort_name,convert(varchar(10), assort_date,23) assort_date from t_gdh_index where patient_id is not null and patient_id!=''
)a
on c.patient_id=a.patient_id
LEFT JOIN(
select patient_id,COUNT(*) content from t_scan_assort where patient_id is not null and patient_id!='' group by patient_id
)b
on a.patient_id=b.patient_id*/
//查询总记录数
sql = "select count(*) from( " +
" select c.patient_id,c.numb,a.assort_name creater,a.create_time,content from( " +
" select patient_id,assort_id,COUNT(*) numb from t_scan_assort where patient_id is not null and patient_id!='' group by patient_id,assort_id " +
" )c " +
" LEFT JOIN( " +
" select patient_id,assort_name,convert(varchar(10), assort_date,23) create_time from t_gdh_index where patient_id is not null and patient_id!='' " +
" )a " +
" on c.patient_id=a.patient_id " +
" LEFT JOIN( " +
" select patient_id,COUNT(*) content from t_scan_assort where patient_id is not null and patient_id!='' group by patient_id " +
" )b " +
" on a.patient_id=b.patient_id " +
" )m group by creater,create_time having 1=1 ";
if(StringUtils.isNotBlank(archiveMasterVo.getInpNo())){
sql+=" and inp_no like '%'+?+'%'" ;
a=1;
}
if(StringUtils.isNotBlank(archiveMasterVo.getInpNo())){
sql+=" and inp_no like '%'+?+'%'" ;
a=1;
}
if(StringUtils.isNotBlank(archiveMasterVo.getCreater())){
sql+=" and creater like '%'+?+'%'" ;
b=1;
}
if(StringUtils.isNotBlank(archiveMasterVo.getStartDate()) && StringUtils.isNotBlank(archiveMasterVo.getEndDate())){
sql+=" and CONVERT (VARCHAR(10), create_time, 23) between ? and ? " ;
c=1;d=1;
}else if(StringUtils.isNotBlank(archiveMasterVo.getStartDate())){
c=1;
sql+=" and CONVERT (VARCHAR(10), create_time, 23)>=?" ;
}else if(StringUtils.isNotBlank(archiveMasterVo.getEndDate())){
d=1;
sql+=" and CONVERT (VARCHAR(10), create_time, 23)>=?" ;
}
stmt = con.prepareStatement(sql);
if(a==1){
stmt.setString(a, archiveMasterVo.getInpNo());
}
if(b==1) {
stmt.setString(a+b, archiveMasterVo.getCreater());
}
if(c==1) {
stmt.setString(a+b+c, archiveMasterVo.getStartDate());
}
if(d==1) {
stmt.setString(a+b+c+d, archiveMasterVo.getEndDate());
}
rs = stmt.executeQuery();
rs.next();
rowTotal=rs.getInt(1);
sql="select * from(" +
"select ROW_NUMBER() over(order by creater desc) RowNum,creater,create_time,sum(numb) numb ,sum(content) content from( " +
" select c.patient_id,c.numb,a.assort_name creater,a.create_time,content from( " +
" select patient_id,assort_id,COUNT(*) numb from t_scan_assort where patient_id is not null and patient_id!='' group by patient_id,assort_id " +
" )c " +
" LEFT JOIN( " +
" select patient_id,assort_name,convert(varchar(10), assort_date,23) create_time from t_gdh_index where patient_id is not null and patient_id!='' " +
" )a " +
" on c.patient_id=a.patient_id " +
" LEFT JOIN( " +
" select patient_id,COUNT(*) content from t_scan_assort where patient_id is not null and patient_id!='' group by patient_id " +
" )b " +
" on a.patient_id=b.patient_id " +
" )m group by creater,create_time having 1=1 ";
if(StringUtils.isNotBlank(archiveMasterVo.getInpNo())){
sql+=" and inp_no like '%'+?+'%'" ;
a=1;
}
if(StringUtils.isNotBlank(archiveMasterVo.getCreater())){
sql+=" and creater like '%'+?+'%'" ;
b=1;
}
if(StringUtils.isNotBlank(archiveMasterVo.getStartDate()) && StringUtils.isNotBlank(archiveMasterVo.getEndDate())){
sql+=" and CONVERT (VARCHAR(10), create_time, 23) between ? and ? " ;
c=1;d=1;
}else if(StringUtils.isNotBlank(archiveMasterVo.getStartDate())){
c=1;
sql+=" and CONVERT (VARCHAR(10), create_time, 23)>=?" ;
}else if(StringUtils.isNotBlank(archiveMasterVo.getEndDate())){
d=1;
sql+=" and CONVERT (VARCHAR(10), create_time, 23)>=?" ;
}
sql+= " ) as t1 " +
" where 1=1 and RowNum>"+stratRow+" and RowNum<="+endRow ;
stmt = con.prepareStatement(sql);
if(a==1){
stmt.setString(a, archiveMasterVo.getInpNo());
}
if(b==1) {
stmt.setString(a+b, archiveMasterVo.getCreater());
}
if(c==1) {
stmt.setString(a+b+c, archiveMasterVo.getStartDate());
}
if(d==1) {
stmt.setString(a+b+c+d, archiveMasterVo.getEndDate());
}
rs = stmt.executeQuery();
Archive_Master_Vo archiveMasterVo1=new Archive_Master_Vo();
while(rs.next())
{
archiveMasterVo1=new Archive_Master_Vo();
String creater = rs.getString("creater");//扫描人
String createTime = rs.getString("create_time");//扫描时间
int numb=Integer.parseInt(rs.getString("numb"));//扫描次数
String content=rs.getString("content");//扫描份数
archiveMasterVo1.setCreater(creater);
archiveMasterVo1.setCreateTime(createTime);
archiveMasterVo1.setNumb(numb);
archiveMasterVo1.setContent(content);
list.add(archiveMasterVo1);
}
} catch (Exception w) {
w.printStackTrace();
}finally{
JdbcUtil.close(rs, stmt, con);
}
OffsetLimitPage offsetLimitPage=new OffsetLimitPage();
offsetLimitPage.setTotal((long) rowTotal);
offsetLimitPage.setRows(list);
return offsetLimitPage;
}
@Override
public List<Archive_Master_Vo> scanCountList(Archive_Master_Vo archiveMasterVo) {
Connection con = null;
PreparedStatement stmt = null;
ResultSet rs = null;
List<Archive_Master_Vo> list=new ArrayList<>();
int a=0,b=0,c=0,d=0;
try {
con = JdbcUtil.getConnection();
String sql = "";
sql = "select creater,create_time,sum(numb) numb ,sum(content) content from( " +
" select c.patient_id,c.numb,a.assort_name creater,a.create_time,content from( " +
" select patient_id,assort_id,COUNT(*) numb from t_scan_assort where patient_id is not null and patient_id!='' group by patient_id,assort_id " +
" )c " +
" LEFT JOIN( " +
" select patient_id,assort_name,convert(varchar(10), assort_date,23) create_time from t_gdh_index where patient_id is not null and patient_id!='' " +
" )a " +
" on c.patient_id=a.patient_id " +
" LEFT JOIN( " +
" select patient_id,COUNT(*) content from t_scan_assort where patient_id is not null and patient_id!='' group by patient_id " +
" )b " +
" on a.patient_id=b.patient_id " +
" )m group by creater,create_time having 1=1 ";
if(StringUtils.isNotBlank(archiveMasterVo.getInpNo())){
sql+=" and inp_no like '%'+?+'%'" ;
a=1;
}
if(StringUtils.isNotBlank(archiveMasterVo.getCreater())){
sql+=" and creater like '%'+?+'%'" ;
b=1;
}
if(StringUtils.isNotBlank(archiveMasterVo.getStartDate()) && StringUtils.isNotBlank(archiveMasterVo.getEndDate())){
sql+=" and CONVERT (VARCHAR(10), create_time, 23) between ? and ? " ;
c=1;d=1;
}else if(StringUtils.isNotBlank(archiveMasterVo.getStartDate())){
c=1;
sql+=" and CONVERT (VARCHAR(10), create_time, 23)>=?" ;
}else if(StringUtils.isNotBlank(archiveMasterVo.getEndDate())){
d=1;
sql+=" and CONVERT (VARCHAR(10), create_time, 23)>=?" ;
}
stmt = con.prepareStatement(sql);
if(a==1){
stmt.setString(a, archiveMasterVo.getInpNo());
}
if(b==1) {
stmt.setString(a+b, archiveMasterVo.getCreater());
}
if(c==1) {
stmt.setString(a+b+c, archiveMasterVo.getStartDate());
}
if(d==1) {
stmt.setString(a+b+c+d, archiveMasterVo.getEndDate());
}
rs = stmt.executeQuery();
Archive_Master_Vo archiveMasterVo1=new Archive_Master_Vo();
while(rs.next())
{
archiveMasterVo1=new Archive_Master_Vo();
String creater = rs.getString("creater");//扫描人
String createTime = rs.getString("create_time");//扫描时间
int numb=Integer.parseInt(rs.getString("numb"));//扫描次数
String content=rs.getString("content");//扫描份数
archiveMasterVo1.setCreater(creater);
archiveMasterVo1.setCreateTime(createTime);
archiveMasterVo1.setNumb(numb);
archiveMasterVo1.setContent(content);
list.add(archiveMasterVo1);
}
} catch (Exception e) {
e.printStackTrace();
}finally{
JdbcUtil.close(rs, stmt, con);
}
return list;
}
@Override
public OffsetLimitPage scanDetailPage(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) {
PageHelper.offsetPage(offset, limit);
//开始和结束行数
Integer stratRow=(offset/10)*limit;
Integer endRow=(offset/10)*limit+limit;
Connection con = null;
PreparedStatement stmt = null;
ResultSet rs = null;
int rowTotal=0;
int a=0,b=0,c=0,d=0;
List<Archive_Master_Vo> list=new ArrayList<>();;
try {
con = JdbcUtil.getConnection();
String sql = "";//"select * from [zd_Assort] where print_flag=?";
//查询总记录数
sql = "select count(*) from(" +
" select patient_id patient_id2,assort_id,scan_page from t_scan_assort where patient_id is not null and patient_id!=''" +
" )a" +
" left join (" +
" select patient_id,inpatient_no inp_no,admiss_times visit_id,name,convert(varchar(19), dis_date,120) discharge_date_time,assort_name creater,convert(varchar(10), assort_date,23) create_time " +
" from t_gdh_index where patient_id is not null and patient_id!=''" +
" )b" +
" on a.patient_id2=b.patient_id" +
" where 1=1";
if(StringUtils.isNotBlank(archiveMasterVo.getInpNo())){
sql+=" and inp_no like '%'+?+'%'" ;
a=1;
}
if(StringUtils.isNotBlank(archiveMasterVo.getCreater())){
sql+=" and creater like '%'+?+'%'" ;
b=1;
}
if(StringUtils.isNotBlank(archiveMasterVo.getStartDate()) && StringUtils.isNotBlank(archiveMasterVo.getEndDate())){
sql+=" and CONVERT (VARCHAR(10), b.create_time, 23) between ? and ? " ;
c=1;d=1;
}else if(StringUtils.isNotBlank(archiveMasterVo.getStartDate())){
c=1;
sql+=" and CONVERT (VARCHAR(10), b.create_time, 23)>=?" ;
}else if(StringUtils.isNotBlank(archiveMasterVo.getEndDate())){
d=1;
sql+=" and CONVERT (VARCHAR(10), b.create_time, 23)>=?" ;
}
stmt = con.prepareStatement(sql);
if(a==1){
stmt.setString(a, archiveMasterVo.getInpNo());
}
if(b==1) {
stmt.setString(a+b, archiveMasterVo.getCreater());
}
if(c==1) {
stmt.setString(a+b+c, archiveMasterVo.getStartDate());
}
if(d==1) {
stmt.setString(a+b+c+d, archiveMasterVo.getEndDate());
}
rs = stmt.executeQuery();
rs.next();
rowTotal=rs.getInt(1);
sql="select * from (" +
"select ROW_NUMBER() over(order by assort_id desc) RowNum ,b.*,a.scan_page content from(" +
" select patient_id patient_id2,assort_id,scan_page from t_scan_assort where patient_id is not null and patient_id!=''" +
" )a" +
" left join (" +
" select patient_id,inpatient_no inp_no,admiss_times visit_id,name,convert(varchar(19), dis_date,120) discharge_date_time,assort_name creater,convert(varchar(10), assort_date,23) create_time " +
" from t_gdh_index where patient_id is not null and patient_id!=''" +
" )b" +
" on a.patient_id2=b.patient_id" +
" where 1=1 ";
if(StringUtils.isNotBlank(archiveMasterVo.getInpNo())){
sql+=" and inp_no like '%'+?+'%'" ;
a=1;
}
if(StringUtils.isNotBlank(archiveMasterVo.getCreater())){
sql+=" and creater like '%'+?+'%'" ;
b=1;
}
if(StringUtils.isNotBlank(archiveMasterVo.getStartDate()) && StringUtils.isNotBlank(archiveMasterVo.getEndDate())){
sql+=" and CONVERT (VARCHAR(10), b.create_time, 23) between ? and ? " ;
c=1;d=1;
}else if(StringUtils.isNotBlank(archiveMasterVo.getStartDate())){
c=1;
sql+=" and CONVERT (VARCHAR(10), b.create_time, 23)>=?" ;
}else if(StringUtils.isNotBlank(archiveMasterVo.getEndDate())){
d=1;
sql+=" and CONVERT (VARCHAR(10), b.create_time, 23)>=?" ;
}
sql+=" ) as t1 "
+ " where 1=1 and RowNum>"+stratRow+" and RowNum<="+endRow ;
stmt = con.prepareStatement(sql);
if(a==1){
stmt.setString(a, archiveMasterVo.getInpNo());
}
if(b==1) {
stmt.setString(a+b, archiveMasterVo.getCreater());
}
if(c==1) {
stmt.setString(a+b+c, archiveMasterVo.getStartDate());
}
if(d==1) {
stmt.setString(a+b+c+d, archiveMasterVo.getEndDate());
}
rs = stmt.executeQuery();
Archive_Master_Vo archiveMasterVo1=new Archive_Master_Vo();
while(rs.next())
{
archiveMasterVo1=new Archive_Master_Vo();
String patientId = rs.getString("patient_id");
String inpNo = rs.getString("inp_no");
String visitId = rs.getString("visit_id");
String name = rs.getString("name");
// String sex = rs.getString("sex");
//String admissionDateTime = rs.getString("admission_date_time");
String dischargeDateTime = rs.getString("discharge_date_time");
// String deptName = rs.getString("dept_name");
// String doctorInCharge = rs.getString("doctor_in_charge");
String creater = rs.getString("creater");//扫描人
String content = rs.getString("content");//文件名
String createTime = rs.getString("create_time");//扫描时间
archiveMasterVo1.setPatientId(patientId);
archiveMasterVo1.setInpNo(inpNo);
archiveMasterVo1.setVisitId(visitId);
archiveMasterVo1.setName(name);
//archiveMasterVo1.setSex(sex);
//archiveMasterVo1.setAdmissionDateTime(admissionDateTime);
archiveMasterVo1.setDischargeDateTime(dischargeDateTime);
// archiveMasterVo1.setDeptName(deptName);
// archiveMasterVo1.setDoctorInCharge(doctorInCharge);
archiveMasterVo1.setCreater(creater);
archiveMasterVo1.setContent(content);
archiveMasterVo1.setCreateTime(createTime);
list.add(archiveMasterVo1);
}
} catch (Exception e) {
e.printStackTrace();
}finally{
JdbcUtil.close(rs, stmt, con);
}
OffsetLimitPage offsetLimitPage=new OffsetLimitPage();
offsetLimitPage.setTotal((long) rowTotal);
offsetLimitPage.setRows(list);
return offsetLimitPage;
}
@Override
public List<Archive_Master_Vo> scanDetailList(Archive_Master_Vo archiveMasterVo) {
Connection con = null;
PreparedStatement stmt = null;
ResultSet rs = null;
List<Archive_Master_Vo> list=new ArrayList<>();;
try {
con = JdbcUtil.getConnection();
int a=0,b=0,c=0,d=0;
String sql = "select b.*,a.scan_page content from(" +
" select patient_id patient_id2,assort_id,scan_page from t_scan_assort where patient_id is not null and patient_id!=''" +
" )a" +
" left join (" +
" select patient_id,inpatient_no inp_no,admiss_times visit_id,name,convert(varchar(19), dis_date,120) discharge_date_time,assort_name creater,convert(varchar(10), assort_date,23) create_time " +
" from t_gdh_index where patient_id is not null and patient_id!=''" +
" )b" +
" on a.patient_id2=b.patient_id" +
" where 1=1";
if(StringUtils.isNotBlank(archiveMasterVo.getInpNo())){
sql+=" and inp_no like '%'+?+'%'" ;
a=1;
}
if(StringUtils.isNotBlank(archiveMasterVo.getCreater())){
sql+=" and creater like '%'+?+'%'" ;
b=1;
}
if(StringUtils.isNotBlank(archiveMasterVo.getStartDate()) && StringUtils.isNotBlank(archiveMasterVo.getEndDate())){
sql+=" and CONVERT (VARCHAR(10), b.create_time, 23) between ? and ? " ;
c=1;d=1;
}else if(StringUtils.isNotBlank(archiveMasterVo.getStartDate())){
c=1;
sql+=" and CONVERT (VARCHAR(10), b.create_time, 23)>=?" ;
}else if(StringUtils.isNotBlank(archiveMasterVo.getEndDate())){
d=1;
sql+=" and CONVERT (VARCHAR(10), b.create_time, 23)>=?" ;
}
stmt = con.prepareStatement(sql);
if(a==1){
stmt.setString(a, archiveMasterVo.getInpNo());
}
if(b==1) {
stmt.setString(a+b, archiveMasterVo.getCreater());
}
if(c==1) {
stmt.setString(a+b+c, archiveMasterVo.getStartDate());
}
if(d==1) {
stmt.setString(a+b+c+d, archiveMasterVo.getEndDate());
}
rs = stmt.executeQuery();
Archive_Master_Vo archiveMasterVo1=new Archive_Master_Vo();
while(rs.next())
{
archiveMasterVo1=new Archive_Master_Vo();
String patientId = rs.getString("patient_id");
String inpNo = rs.getString("inp_no");
String visitId = rs.getString("visit_id");
String name = rs.getString("name");
// String sex = rs.getString("sex");
// String admissionDateTime = rs.getString("admission_date_time");
String dischargeDateTime = rs.getString("discharge_date_time");
// String deptName = rs.getString("dept_name");
// String doctorInCharge = rs.getString("doctor_in_charge");
String creater = rs.getString("creater");//扫描人
String content = rs.getString("content");//文件名
String createTime = rs.getString("create_time");//扫描时间
archiveMasterVo1.setPatientId(patientId);
archiveMasterVo1.setInpNo(inpNo);
archiveMasterVo1.setVisitId(visitId);
archiveMasterVo1.setName(name);
//archiveMasterVo1.setSex(sex);
//archiveMasterVo1.setAdmissionDateTime(admissionDateTime);
archiveMasterVo1.setDischargeDateTime(dischargeDateTime);
//archiveMasterVo1.setDeptName(deptName);
// archiveMasterVo1.setDoctorInCharge(doctorInCharge);
archiveMasterVo1.setCreater(creater);
archiveMasterVo1.setContent(content);
archiveMasterVo1.setCreateTime(createTime);
list.add(archiveMasterVo1);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
JdbcUtil.close(rs, stmt, con);
}
return list;
}
}

@ -0,0 +1,139 @@
package com.emr.util;
import com.emr.entity.Archive_Master_Vo;
import org.apache.commons.lang.StringUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
/**
* 线sheet
*/
public class DatelUtils {
/**
*
* @param time1
* @param time2
* @return
* @throws ParseException
*/
public static boolean compareDate(String time1,String time2) throws ParseException{
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
Date a=sdf.parse(time1);
Date b=sdf.parse(time2);
//a早于b返回true
if(a.before(b)){
return true;
}else{
return false;
}
}
/**
*
* @param dayStr str
* @return
*/
public static String addDayFun(String dayStr, String dayType, int i) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date dt=null;
if(StringUtils.isBlank(dayStr)){
//系统时间
dt=sdf.parse(sdf.format(new Date()));
}else{
dt=sdf.parse(dayStr);
}
Calendar rightNow=Calendar.getInstance();
rightNow.setTime(dt);
if(dayType=="year") {
rightNow.add(Calendar.YEAR, i);//-1 日期减1年
}else if(dayType=="month") {
rightNow.add(Calendar.MONTH, i);//3 日期加三个月
}else if(dayType=="day") {
rightNow.add(Calendar.DAY_OF_YEAR, i);//15 日期加15天
}
Date dt1=rightNow.getTime();
String reStr=sdf.format(dt1);
//System.out.println(reStr);
return reStr;
} catch (ParseException e) {
e.printStackTrace();
}
return null;
}
public static Archive_Master_Vo setMaterVoFun(Archive_Master_Vo archiveMasterVo) throws Exception {
//判断复制时段类型
String endDateStr="";
if(org.apache.commons.lang3.StringUtils.isNotBlank(archiveMasterVo.getLockinfo())){
//day_7 month_day_15 month_1 month_3
if(org.apache.commons.lang3.StringUtils.isNotBlank(archiveMasterVo.getStartDate()) && org.apache.commons.lang3.StringUtils.isBlank(archiveMasterVo.getEndDate())){
//复印时间的截至日期,不得超过
endDateStr=getDateFun(archiveMasterVo.getLockinfo(),archiveMasterVo.getStartDate(),"A",0);
archiveMasterVo.setEndDate(endDateStr);
}else if(org.apache.commons.lang3.StringUtils.isNotBlank(archiveMasterVo.getStartDate()) && org.apache.commons.lang3.StringUtils.isNotBlank(archiveMasterVo.getEndDate())){
endDateStr=getDateFun(archiveMasterVo.getLockinfo(),archiveMasterVo.getStartDate(),"A",0);
if(!compareDate(archiveMasterVo.getStartDate(),endDateStr)){
archiveMasterVo.setEndDate(endDateStr);
}
}else if(org.apache.commons.lang3.StringUtils.isBlank(archiveMasterVo.getStartDate()) && org.apache.commons.lang3.StringUtils.isNotBlank(archiveMasterVo.getEndDate())){
//反向扣除s
endDateStr=getDateFun(archiveMasterVo.getLockinfo(),archiveMasterVo.getEndDate(),"B",0);
archiveMasterVo.setStartDate(endDateStr);
}else if(org.apache.commons.lang3.StringUtils.isBlank(archiveMasterVo.getStartDate()) && org.apache.commons.lang3.StringUtils.isBlank(archiveMasterVo.getEndDate())){
//系统时间
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String nowDate= String.valueOf(sdf.format(new Date()));
endDateStr=getDateFun(archiveMasterVo.getLockinfo(),nowDate,"B",0);
archiveMasterVo.setStartDate(endDateStr);
archiveMasterVo.setEndDate(nowDate);
}
}
archiveMasterVo.setLockinfo(null);
return archiveMasterVo;
}
public static String getDateFun(String dayType,String currDate,String dayFlag,int numb){
String endDateStr="";
if(dayFlag.equals("A")) { //加
if (dayType.equals("day_7")) {
endDateStr = addDayFun(currDate, "day", 7);
} else if (dayType.equals("month_day_15")) {
endDateStr = addDayFun(currDate, "day", 15);
} else if (dayType.equals("month_1")) {
endDateStr = addDayFun(currDate, "month", 1);
} else if (dayType.equals("month_3")) {
endDateStr = addDayFun(currDate, "month", 3);
} else if (dayType.equals("day")) {
endDateStr = addDayFun(currDate, "day", numb);
} else if (dayType.equals("month")) {
endDateStr = addDayFun(currDate, "month", numb);
}
}else if(dayFlag.equals("B")) { //减
if (dayType.equals("day_7")) {
endDateStr = addDayFun(currDate, "day", -7);
} else if (dayType.equals("month_day_15")) {
endDateStr = addDayFun(currDate, "day", -15);
} else if (dayType.equals("month_1")) {
endDateStr = addDayFun(currDate, "month", -1);
} else if (dayType.equals("month_3")) {
endDateStr = addDayFun(currDate, "month", -3);
}else if (dayType.equals("day")) {
endDateStr = addDayFun(currDate, "day", -1*numb);
} else if (dayType.equals("month")) {
endDateStr = addDayFun(currDate, "month", -1*numb);
}
}
return endDateStr;
}
public static void main(String[] args) throws Exception {
System.out.println(addDayFun( "2021-12-21", "day", -15));
}
}

@ -0,0 +1,122 @@
package com.emr.util;
import com.emr.entity.Zd_Assort;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
public class JdbcUtil {
private static String className;
private static String url;
private static String user;
private static String password;
static
{
try {
InputStream in = JdbcUtil.class.getClassLoader().getResourceAsStream("config/config.properties");
Properties props = new Properties();
props.load(in);
className = props.getProperty("sqlServerClassName");
url = props.getProperty("sqlServerUrl");
user = props.getProperty("sqlServerUserName");
password = props.getProperty("sqlServerPassword");
//System.out.println(className);
//System.out.println(url);
//注册驱动
Class.forName(className);
} catch (Exception e) {
e.printStackTrace();
}
}
public static Connection getConnection() throws Exception
{
return DriverManager.getConnection(url, user, password);
}
public static void close(ResultSet rs, Statement stmt,Connection con)
{
if(rs!=null)
{
try {
rs.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
rs= null;
}
if(stmt!=null)
{
try {
stmt.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
stmt= null;
}
if(con!=null)
{
try {
con.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
con= null;
}
}
//查询
public List<Zd_Assort> select(Statement stmt) throws SQLException {
List<Zd_Assort> list=new ArrayList<>();
ResultSet rs = stmt.executeQuery("select * from [zd_assort] ");
Zd_Assort zd_assort=null;
while(rs.next()){
zd_assort=new Zd_Assort();
//如果对象中有数据,就会循环打印出来
//System.out.println("类型ID="+rs.getString("assort_id"));
zd_assort.setAssortId(rs.getString("assort_id"));
zd_assort.setAssortName(rs.getString("assort_name"));
list.add(zd_assort);
//System.out.println(rs.getInt("教师编号")+","+rs.getString("姓名")+","+rs.getInt("专业"));
}
return list;
}
//测试用例
public static void main(String[] args) throws Exception{
JdbcUtil d = new JdbcUtil();
//3.通过数据库的连接操作数据库,实现增删改查
Connection conn=d.getConnection();
Statement stmt = conn.createStatement();
//ResultSet executeQuery(String sqlString)执行查询数据库的SQL语句 返回一个结果集ResultSet对象。
//d.insert(stmt);
//d.update(stmt);
List<Zd_Assort> list=d.select(stmt);
System.out.println(list.get(0).getAssortName()+"==================");
}
}

@ -1,6 +1,15 @@
#留观推送第三方接口地址
#\u7559\u89C2\u63A8\u9001\u7B2C\u4E09\u65B9\u63A5\u53E3\u5730\u5740
observationRecordRequestUrl = http://10.162.0.51:8091/sanshuyun-ems-function/file/away/updateStatus
#模块打回第三方接口地址
#\u6A21\u5757\u6253\u56DE\u7B2C\u4E09\u65B9\u63A5\u53E3\u5730\u5740
returnUrl = http://10.6.1.152:8085/SignWebService.asmx/PartrePair
#模块打回第三方接口参数
returnParam = strJson
#\u6A21\u5757\u6253\u56DE\u7B2C\u4E09\u65B9\u63A5\u53E3\u53C2\u6570
returnParam = strJson
#\u6A21\u5757\u626B\u63CF\u4E0A\u4F20\u62A5\u8868
sqlServerClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
sqlServerUrl=jdbc:sqlserver://10.3.6.94:1433;DatabaseName=headpage_gyfs_1
sqlServerUserName=sa
sqlServerPassword=xjgs+docus911

File diff suppressed because it is too large Load Diff

@ -0,0 +1,384 @@
<%@ page import="java.util.ResourceBundle" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set value="${pageContext.request.contextPath}" var="path" scope="page"/>
<%
ResourceBundle res = ResourceBundle.getBundle("config.jdbc");
%>
<%--<%@ include file="/WEB-INF/jspf/common.jspf" %>--%>
<html>
<head>
<title>复印记录统计</title>
<meta charset="utf-8">
<!-- 解决部分兼容性问题如果安装了GCF则使用GCF来渲染页面如果未安装GCF则使用最高版本的IE内核进行渲染。 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- 页面按原比例显示 -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<%@include file="../../jspf/comm.jspf" %>
</head>
<style>
.modal-header2 {
text-align: center !important;
vertical-align: middle !important;
background-color: #3c8dbc !important;
color: #fff;
font-size: 16px;
font-weight: bold;
padding: 5px 5px 5px 5px !important;
}
/*.modal-header {*/
/*padding: 5px 5px 5px 5px !important;*/
/*}*/
.modal-footer{
padding: 5px;
}
.divCss {
margin-top: 5px;
}
.divCss2 {
margin-top: 5px;
margin-left: 20px;
}
.divCss8 {
margin-top: 5px;
margin-right: 20px;
}
/* dataTables表头居中 */
.table > thead:first-child > tr:first-child > th {
text-align: center !important;
}
.enterCss2{
height: 160px;
width: 500px;
}
.toolbarCss {
margin-right: 20px;
margin-bottom: 0px;
!important;
}
.fixed-table-toolbar .bs-bars .pull-right{
height: 20px;
!important;
}
/*选中行颜色*/
.fixed-table-container tbody .selected td {
background-color: #9acfea;
}
</style>
<body>
<div style="margin-left:30px;margin-right:10px;height:auto">
<!--搜索-->
<form style="margin-top:20px;">
<div class="form-inline">
<div class="form-group divCss8">
<label for="inpNo">住院号:</label>
<input type="text" class="input-sm form-control" id="inpNo" placeholder="请输入住院号">
</div>
<div class="form-group divCss8">
<label>操作人:</label>
<input type="text" class="input-sm form-control" id="creater" placeholder="请输入操作人">
</div>
<div class="form-group divCss8">
<label>复印日期:</label>
<div class="input-daterange input-group" id="datepicker">
<input type="text" class="input-sm form-control" name="start" id="startDate"/>
<span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" name="end" id="endDate"/>
</div>
</div>
<div class="form-group divCss">
<label>复印时段 :</label>
<select class="input-sm form-control" id="copyTimeType">
<option value="">不限</option>
<option value="day_7">7天内</option>
<option value="month_day_15">半个月内</option>
<option value="month_1">一个月内</option>
<option value="month_3">三个月内</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>
<!--数据表格-->
<table id="table" class="table text-nowrap table-striped" ></table>
<div id="toolbar" class="btn-group pull-right toolbarCss" >
<div class="columns columns-right btn-group pull-right" style="margin-top:0px;">
<div class="btn-group btn-info">
<select id="sel_exportoption" class="form-control">                
<option value="">导出当前页面数据</option>                
<option value="all">导出全部数据</option>              
<option value="selected">导出选中数据</option>
</select>
</div>
<button class=" btn btn-success btn-sm" style="height: 34px" type="button" id="refreshBtn" name="refresh" aria-label="Refresh"
title="Refresh">
<i class="glyphicon glyphicon-refresh icon-refresh"></i>
</button>
</div>
</div>
</div>
</body>
<script>
var tipLoad = 1;
$(function () {
var url = window.location.href;
var index = url.substring(url.lastIndexOf('?') + 1).replace("num=", "");
if (index != null && index != "" && index.indexOf("excel") != -1) {
$("#excelBtn").show();
$("#toolbar").show();
} else {
$("#excelBtn").hide();
$(".columns-right").hide();
}
});
//日期控件
$(".input-daterange").datepicker({
format: "yyyy-mm-dd",
language: "zh-CN"
});
/* var currDate=getCurrDate();
var currDate30=getCurrDay30();
$('#startDate').val(currDate30);
$('#endDate').val(currDate);*/
//处理导出内容,这个方法可以自定义某一行、某一列、甚至某个单元格的内容,也就是将其值设置为自己想要的内容
function DoOnCellHtmlData(cell, row, col, data) {
if (row == 0) {
return data;
}
//由于备注列超过6个字的话,通过span标签处理只显示前面6个字,如果直接导出的话会导致内容不完整,因此要将携带完整内容的span标签中title属性的值替换
if (col == 4 || col == 11 || col == 7) {
var spanObj = $(data);//将带 <span title="val"></span> 标签的字符串转换为jQuery对象
var title = spanObj.attr("title");//读取<span title="val"></span>中title属性的值
//var span = cell[0].firstElementChild;//读取cell数组中的第一个值下的第一个元素
if (typeof (title) != 'undefined') {
return title;
}
}
return data;
}
function initTable() {
if(tipLoad == 1){
$("#table").bootstrapTable({ // 对应table标签的id
//method: 'POST',
url: "${path}/copyInfo/copyCountPage", // 获取表格数据的url
contentType: "application/x-www-form-urlencoded",//一种编码。好像在post请求的时候需要用到。这里用的get请求注释掉这句话也能拿到数据
//dataField: "data",//这是返回的json数组的key.默认是"rows".这里只有前后端约定好就行
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
paginationShowPageGo: true,
pageList: [10, 20, 50, 100], // 如果设置了分页设置可供选择的页面数据条数。设置为All 则显示所有记录。
smartDisplay: false,
pageSize: 2, // 页面数据条数
pageNumber: 1, // 初始化加载第一页,默认第一页
sidePagination: 'server', // 设置为服务器端分页 客户端client
search: false,
showColumns: true,
// sortable: true,
// sortOrder: "asc",
toolbar: '#toolbar',//指定工具栏
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: true,
//导出表格方式默认basic只导出当前页的表格数据all导出所有数据selected导出选中的数据
exportDataType: "basic",
//导出文件类型
exportTypes: ['json', 'xml', 'csv', 'txt', 'sql', 'excel'],
exportOptions: {
fileName: document.title
},
// showToggle: false, //是否显示详细视图和列表视图的切换按钮
// cardView: false, //是否显示详细视图
// detailView: false, //是否显示父子表
queryParams: function (params) {
var currPageSize = this.pageSize;
if (currPageSize == 2) {
currPageSize = 10;
}
var limit= null;
var offset= params.offset;
//判断是否导出全部all
if ($("#sel_exportoption").val() == "all") {
offset=0;
limit=this.totalRows;
this.pageSize= limit;
}else{
limit = currPageSize;
this.pageSize = currPageSize;
}
//var url = window.location.href;
// var deptName = url.substring(url.lastIndexOf('&') + 1).replace("depts=", "");
// var len = ($("#deptName").val()).length;
// if (len > 0) {
// var deptNameT = $("#deptName").val();
// if (deptNameT.indexOf("") == -1) {
// deptName = $("#deptName").val().toString();
// }
// }
var temp = {
limit: limit, //页面大小
offset: offset, //页码
order: params.order, //排位命令descasc
inpNo: "" + $("#inpNo").val(),
creater:""+$("#creater").val(),
startDate: $("#startDate").val(),
endDate: $("#endDate").val(),
lockinfo: "" + $("#copyTimeType").val()
};
return temp;
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [{
title: '全选',
field: 'select', //复选框
checkbox: true,
width: 25,
align: 'center',
valign: 'middle'
},
{
title: '序号',
field: 'id',
align: 'center',
valign: 'middle',
//sortable: true,
visible: false,
formatter: function (value, row, index) {
return index + 1;
}
},
{
title: '记账号',
field: 'patientId',
align: 'left',
valign: 'middle'
},
{
title: '住院号',
field: 'inpNo',
align: 'center',
valign: 'middle'
},
{
title: '住院次数',
field: 'visitId',
align: 'center',
valign: 'middle'
},
{
title: '患者姓名',
field: 'name',
align: 'left',
valign: 'middle'
},
{
title: '复印日期',
field: 'createTime',
align: 'center',
valign: 'middle'
}, {
title: '操作人',
field: 'creater',
align: 'left',
valign: 'middle'
},{
title: '复印次数',
field: 'numb',
align: 'center',
valign: 'middle'
},
],
onLoadSuccess: function (result) { //加载成功时执行
//console.info("加载成功");
console.log(result)
tipLoad = 0;
},
onLoadError: function () { //加载失败时执行
//console.info("加载数据失败");
tipLoad = 0;
}
});
}
}
//查询
$('#searchBtn').click(function () {
if (tipLoad == 0) {
$("#table").bootstrapTable("refreshOptions", {pageNumber: 1});
} else {
toastr.warning("正在查询,请稍等...");
}
//$("#deptName").val([]);
});
//获取table的高度
function getHeight() {
return $(window).height() - 100;
}
initTable();
//2.初始化select的change事件
$("#sel_exportoption").change(function () {
$('#table').bootstrapTable('refreshOptions', {
exportDataType: $(this).val()
});
});
$("#refreshBtn").click(function () {
//刷新
$('#table').bootstrapTable('refresh');
});
//导出excel功能
$("#excelBtn").click(function () {
var inpNo = "" + $("#inpNo").val();
//var creater=""+$("#creater").val();//操作人
var startDate= $("#startDate").val();
var endDate= $("#endDate").val();
var lockinfo= "" + $("#copyTimeType").val();
window.location.href = "${path}/copyInfo/exportExcel?inpNo=" + inpNo + "&startDate=" + startDate +
"&endDate=" + endDate + "&lockinfo=" + lockinfo;
});
</script>
</html>

@ -0,0 +1,422 @@
<%@ page import="java.util.ResourceBundle" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set value="${pageContext.request.contextPath}" var="path" scope="page"/>
<%
ResourceBundle res = ResourceBundle.getBundle("config.jdbc");
%>
<%--<%@ include file="/WEB-INF/jspf/common.jspf" %>--%>
<html>
<head>
<title>复印记录明细</title>
<meta charset="utf-8">
<!-- 解决部分兼容性问题如果安装了GCF则使用GCF来渲染页面如果未安装GCF则使用最高版本的IE内核进行渲染。 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- 页面按原比例显示 -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<%@include file="../../jspf/comm.jspf" %>
</head>
<style>
.modal-header2 {
text-align: center !important;
vertical-align: middle !important;
background-color: #3c8dbc !important;
color: #fff;
font-size: 16px;
font-weight: bold;
padding: 5px 5px 5px 5px !important;
}
/*.modal-header {*/
/*padding: 5px 5px 5px 5px !important;*/
/*}*/
.modal-footer{
padding: 5px;
}
.divCss {
margin-top: 5px;
}
.divCss2 {
margin-top: 5px;
margin-left: 20px;
}
.divCss8 {
margin-top: 5px;
margin-right: 20px;
}
/* dataTables表头居中 */
.table > thead:first-child > tr:first-child > th {
text-align: center !important;
}
.enterCss2{
height: 160px;
width: 500px;
}
.toolbarCss {
margin-right: 20px;
margin-bottom: 0px;
!important;
}
.fixed-table-toolbar .bs-bars .pull-right{
height: 20px;
!important;
}
/*选中行颜色*/
.fixed-table-container tbody .selected td {
background-color: #9acfea;
}
</style>
<body>
<div style="margin-left:30px;margin-right:10px;height:auto">
<!--搜索-->
<form style="margin-top:20px;">
<div class="form-inline">
<div class="form-group divCss8">
<label for="inpNo">住院号:</label>
<input type="text" class="input-sm form-control" id="inpNo" placeholder="请输入住院号">
</div>
<%--<div class="form-group divCss8">
<label>操作人:</label>
<input type="text" class="input-sm form-control" id="creater" placeholder="请输入操作人">
</div>--%>
<div class="form-group divCss8">
<label>复印日期:</label>
<div class="input-daterange input-group" id="datepicker">
<input type="text" class="input-sm form-control" name="start" id="startDate"/>
<span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" name="end" id="endDate"/>
</div>
</div>
<div class="form-group divCss">
<label>复印时段 :</label>
<select class="input-sm form-control" id="copyTimeType">
<option value="">不限</option>
<option value="day_7">7天内</option>
<option value="month_day_15">半个月内</option>
<option value="month_1">一个月内</option>
<option value="month_3">三个月内</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>
<!--数据表格-->
<table id="table" class="table text-nowrap table-striped" ></table>
<div id="toolbar" class="btn-group pull-right toolbarCss" >
<div class="columns columns-right btn-group pull-right" style="margin-top:0px;">
<div class="btn-group btn-info">
<select id="sel_exportoption" class="form-control">                
<option value="">导出当前页面数据</option>                
<option value="all">导出全部数据</option>              
<option value="selected">导出选中数据</option>
</select>
</div>
<button class=" btn btn-success btn-sm" style="height: 34px" type="button" id="refreshBtn" name="refresh" aria-label="Refresh"
title="Refresh">
<i class="glyphicon glyphicon-refresh icon-refresh"></i>
</button>
</div>
</div>
</div>
</body>
<script>
var tipLoad = 1;
$(function () {
var url = window.location.href;
var index = url.substring(url.lastIndexOf('?') + 1).replace("num=", "");
if (index != null && index != "" && index.indexOf("excel") != -1) {
$("#excelBtn").show();
$("#toolbar").show();
} else {
$("#excelBtn").hide();
$(".columns-right").hide();
}
});
//日期控件
$(".input-daterange").datepicker({
format: "yyyy-mm-dd",
language: "zh-CN"
});
/* var currDate=getCurrDate();
var currDate30=getCurrDay30();
$('#startDate').val(currDate30);
$('#endDate').val(currDate);*/
//处理导出内容,这个方法可以自定义某一行、某一列、甚至某个单元格的内容,也就是将其值设置为自己想要的内容
function DoOnCellHtmlData(cell, row, col, data) {
if (row == 0) {
return data;
}
//由于备注列超过6个字的话,通过span标签处理只显示前面6个字,如果直接导出的话会导致内容不完整,因此要将携带完整内容的span标签中title属性的值替换
if (col == 4 || col == 11 || col == 7) {
var spanObj = $(data);//将带 <span title="val"></span> 标签的字符串转换为jQuery对象
var title = spanObj.attr("title");//读取<span title="val"></span>中title属性的值
//var span = cell[0].firstElementChild;//读取cell数组中的第一个值下的第一个元素
if (typeof (title) != 'undefined') {
return title;
}
}
return data;
}
function initTable() {
if(tipLoad == 1){
$("#table").bootstrapTable({ // 对应table标签的id
//method: 'POST',
url: "${path}/copyInfo/copyDetailPage", // 获取表格数据的url
contentType: "application/x-www-form-urlencoded",//一种编码。好像在post请求的时候需要用到。这里用的get请求注释掉这句话也能拿到数据
//dataField: "data",//这是返回的json数组的key.默认是"rows".这里只有前后端约定好就行
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
paginationShowPageGo: true,
pageList: [10, 20, 50, 100], // 如果设置了分页设置可供选择的页面数据条数。设置为All 则显示所有记录。
smartDisplay: false,
pageSize: 2, // 页面数据条数
pageNumber: 1, // 初始化加载第一页,默认第一页
sidePagination: 'server', // 设置为服务器端分页 客户端client
search: false,
showColumns: true,
// sortable: true,
// sortOrder: "asc",
toolbar: '#toolbar',//指定工具栏
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: true,
//导出表格方式默认basic只导出当前页的表格数据all导出所有数据selected导出选中的数据
exportDataType: "basic",
//导出文件类型
exportTypes: ['json', 'xml', 'csv', 'txt', 'sql', 'excel'],
exportOptions: {
fileName: document.title
},
// showToggle: false, //是否显示详细视图和列表视图的切换按钮
// cardView: false, //是否显示详细视图
// detailView: false, //是否显示父子表
queryParams: function (params) {
var currPageSize = this.pageSize;
if (currPageSize == 2) {
currPageSize = 10;
}
var limit= null;
var offset= params.offset;
//判断是否导出全部all
if ($("#sel_exportoption").val() == "all") {
offset=0;
limit=this.totalRows;
this.pageSize= limit;
}else{
limit = currPageSize;
this.pageSize = currPageSize;
}
//var url = window.location.href;
// var deptName = url.substring(url.lastIndexOf('&') + 1).replace("depts=", "");
// var len = ($("#deptName").val()).length;
// if (len > 0) {
// var deptNameT = $("#deptName").val();
// if (deptNameT.indexOf("") == -1) {
// deptName = $("#deptName").val().toString();
// }
// }
var temp = {
limit: limit, //页面大小
offset: offset, //页码
order: params.order, //排位命令descasc
inpNo: "" + $("#inpNo").val(),
//creater:""+$("#creater").val(),
startDate: $("#startDate").val(),
endDate: $("#endDate").val(),
lockinfo: "" + $("#copyTimeType").val()
};
return temp;
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [{
title: '全选',
field: 'select', //复选框
checkbox: true,
width: 25,
align: 'center',
valign: 'middle',
},
{
title: '序号',
field: 'id',
align: 'center',
valign: 'middle',
//sortable: true,
visible: false,
formatter: function (value, row, index) {
return index + 1;
}
},
{
title: '记账号',
field: 'patientId',
align: 'left',
valign: 'middle'
},
{
title: '住院号',
field: 'inpNo',
align: 'center',
valign: 'middle'
},
{
title: '住院次数',
field: 'visitId',
align: 'center',
valign: 'middle'
},
{
title: '患者姓名',
field: 'name',
align: 'left',
valign: 'middle'
},
{
title: '性别',
field: 'sex',
align: 'center',
valign: 'middle'
},
{
title: '入院时间',
field: 'admissionDateTime',
align: 'center'
/* formatter: function (value, row, index) {
if (value != null && value != "") {
value = value.substring(0, 20);
}
return value;
}*/
},
{
title: '出院时间',
field: 'dischargeDateTime',
align: 'center'
},{
title: '出院科室',
field: 'deptName',
align: 'left',
valign: 'middle'
},{
title: '主管医生',
field: 'doctorInCharge',
align: 'center',
valign: 'middle'
},{
title: '复印内容',
field: 'content',
align: 'left',
valign: 'middle'
},
/*{
title: '操作人',
field: 'creater',
align: 'left',
valign: 'middle'
},*/
{
title: '复印日期',
field: 'createTime',
align: 'center',
valign: 'middle'
}
/*,{
title: '修改标志',
field: 'remark',
align: 'center',
valign: 'middle'
}*/
],
onLoadSuccess: function (result) { //加载成功时执行
//console.info("加载成功");
//console.log(result)
tipLoad = 0;
},
onLoadError: function () { //加载失败时执行
//console.info("加载数据失败");
tipLoad = 0;
}
});
}
}
//查询
$('#searchBtn').click(function () {
if (tipLoad == 0) {
$("#table").bootstrapTable("refreshOptions", {pageNumber: 1});
} else {
toastr.warning("正在查询,请稍等...");
}
//$("#deptName").val([]);
});
//获取table的高度
function getHeight() {
return $(window).height() - 100;
}
initTable();
//2.初始化select的change事件
$("#sel_exportoption").change(function () {
$('#table').bootstrapTable('refreshOptions', {
exportDataType: $(this).val()
});
});
$("#refreshBtn").click(function () {
//刷新
$('#table').bootstrapTable('refresh');
});
//导出excel功能
$("#excelBtn").click(function () {
var inpNo = "" + $("#inpNo").val();
//var creater=""+$("#creater").val();//操作人
var startDate= $("#startDate").val();
var endDate= $("#endDate").val();
var lockinfo= "" + $("#copyTimeType").val();
window.location.href = "${path}/copyInfo/exportExcel?inpNo=" + inpNo + "&startDate=" + startDate +
"&endDate=" + endDate + "&lockinfo=" + lockinfo;
});
</script>
</html>

@ -366,7 +366,7 @@
limit = currPageSize;
this.pageSize = currPageSize;
}
console.log("-=======startDate===="+$("#startDateTo").val());
//console.log("-=======startDate===="+$("#startDateTo").val());
var temp = {
limit: limit, //页面大小

@ -0,0 +1,392 @@
<%@ page import="java.util.ResourceBundle" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set value="${pageContext.request.contextPath}" var="path" scope="page"/>
<%
ResourceBundle res = ResourceBundle.getBundle("config.jdbc");
%>
<%--<%@ include file="/WEB-INF/jspf/common.jspf" %>--%>
<html>
<head>
<title>复印记录统计</title>
<meta charset="utf-8">
<!-- 解决部分兼容性问题如果安装了GCF则使用GCF来渲染页面如果未安装GCF则使用最高版本的IE内核进行渲染。 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- 页面按原比例显示 -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<%@include file="../../jspf/comm.jspf" %>
</head>
<style>
.modal-header2 {
text-align: center !important;
vertical-align: middle !important;
background-color: #3c8dbc !important;
color: #fff;
font-size: 16px;
font-weight: bold;
padding: 5px 5px 5px 5px !important;
}
/*.modal-header {*/
/*padding: 5px 5px 5px 5px !important;*/
/*}*/
.modal-footer{
padding: 5px;
}
.divCss {
margin-top: 5px;
}
.divCss2 {
margin-top: 5px;
margin-left: 20px;
}
.divCss8 {
margin-top: 5px;
margin-right: 20px;
}
/* dataTables表头居中 */
.table > thead:first-child > tr:first-child > th {
text-align: center !important;
}
.enterCss2{
height: 160px;
width: 500px;
}
.toolbarCss {
margin-right: 20px;
margin-bottom: 0px;
!important;
}
.fixed-table-toolbar .bs-bars .pull-right{
height: 20px;
!important;
}
/*选中行颜色*/
.fixed-table-container tbody .selected td {
background-color: #9acfea;
}
</style>
<body>
<div style="margin-left:30px;margin-right:10px;height:auto">
<!--搜索-->
<form style="margin-top:20px;">
<div class="form-inline">
<%--<div class="form-group divCss8">
<label>出院日期:</label>
<select class="input-sm form-control" id="remark">
<option value="day">按日查询</option>
<option value="month">按月查询</option>
</select>
<div class="input-daterange input-group" id="datepicker2">
<input type="text" class="input-sm form-control" name="start" id="startDateTo"/>
<span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" name="end" id="endDateTo"/>
</div>
</div>--%>
<div class="form-group divCss8">
<label>扫描日期:</label>
<div class="input-daterange input-group" id="datepicker">
<input type="text" class="input-sm form-control" name="start" id="startDate"/>
<span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" name="end" id="endDate"/>
</div>
</div>
<div class="form-group divCss8">
<label>扫描时段 :</label>
<select class="input-sm form-control" id="copyTimeType">
<option value="">不限</option>
<option value="day_7">7天内</option>
<option value="month_day_15">半个月内</option>
<option value="month_1">一个月内</option>
<option value="month_3">三个月内</option>
</select>
</div>
<div class="form-group divCss">
<label>扫描人:</label>
<input type="text" class="input-sm form-control" id="creater" placeholder="请输入扫描人">
</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>
<!--数据表格-->
<table id="table" class="table text-nowrap table-striped" ></table>
<div id="toolbar" class="btn-group pull-right toolbarCss" >
<div class="columns columns-right btn-group pull-right" style="margin-top:0px;">
<div class="btn-group btn-info">
<select id="sel_exportoption" class="form-control">                
<option value="">导出当前页面数据</option>                
<option value="all">导出全部数据</option>              
<option value="selected">导出选中数据</option>
</select>
</div>
<button class=" btn btn-success btn-sm" style="height: 34px" type="button" id="refreshBtn" name="refresh" aria-label="Refresh"
title="Refresh">
<i class="glyphicon glyphicon-refresh icon-refresh"></i>
</button>
</div>
</div>
</div>
</body>
<script>
var tipLoad = 1;
$(function () {
var url = window.location.href;
var index = url.substring(url.lastIndexOf('?') + 1).replace("num=", "");
if (index != null && index != "" && index.indexOf("excel") != -1) {
$("#excelBtn").show();
$("#toolbar").show();
} else {
$("#excelBtn").hide();
$(".columns-right").hide();
}
});
//日期控件
$(".input-daterange").datepicker({
format: "yyyy-mm-dd",
language: "zh-CN"
});
/* var currDate=getCurrDate();
var currDate30=getCurrDay30();
$('#startDate').val(currDate30);
$('#endDate').val(currDate);*/
//处理导出内容,这个方法可以自定义某一行、某一列、甚至某个单元格的内容,也就是将其值设置为自己想要的内容
function DoOnCellHtmlData(cell, row, col, data) {
if (row == 0) {
return data;
}
//由于备注列超过6个字的话,通过span标签处理只显示前面6个字,如果直接导出的话会导致内容不完整,因此要将携带完整内容的span标签中title属性的值替换
if (col == 4 || col == 11 || col == 7) {
var spanObj = $(data);//将带 <span title="val"></span> 标签的字符串转换为jQuery对象
var title = spanObj.attr("title");//读取<span title="val"></span>中title属性的值
//var span = cell[0].firstElementChild;//读取cell数组中的第一个值下的第一个元素
if (typeof (title) != 'undefined') {
return title;
}
}
return data;
}
function initTable() {
if(tipLoad == 1){
$("#table").bootstrapTable({ // 对应table标签的id
//method: 'POST',
url: "${path}/scanInfo/scanCountPage", // 获取表格数据的url
contentType: "application/x-www-form-urlencoded",//一种编码。好像在post请求的时候需要用到。这里用的get请求注释掉这句话也能拿到数据
//dataField: "data",//这是返回的json数组的key.默认是"rows".这里只有前后端约定好就行
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: true,
// sortable: true,
// sortOrder: "asc",
toolbar: '#toolbar',//指定工具栏
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: true,
//导出表格方式默认basic只导出当前页的表格数据all导出所有数据selected导出选中的数据
exportDataType: "basic",
//导出文件类型
exportTypes: ['json', 'xml', 'csv', 'txt', 'sql', 'excel'],
exportOptions: {
fileName: document.title
},
// showToggle: false, //是否显示详细视图和列表视图的切换按钮
// cardView: false, //是否显示详细视图
// detailView: false, //是否显示父子表
queryParams: function (params) {
var currPageSize = this.pageSize;
if (currPageSize == 2) {
currPageSize = 10;
}
var limit= null;
var offset= params.offset;
//判断是否导出全部all
if ($("#sel_exportoption").val() == "all") {
offset=0;
limit=this.totalRows;
this.pageSize= limit;
}else{
limit = currPageSize;
this.pageSize = currPageSize;
}
//var url = window.location.href;
// var deptName = url.substring(url.lastIndexOf('&') + 1).replace("depts=", "");
// var len = ($("#deptName").val()).length;
// if (len > 0) {
// var deptNameT = $("#deptName").val();
// if (deptNameT.indexOf("") == -1) {
// deptName = $("#deptName").val().toString();
// }
// }
var temp = {
limit: limit, //页面大小
offset: offset, //页码
order: params.order, //排位命令descasc
creater:""+$("#creater").val(),
startDate: $("#startDate").val(),
//remark:$("#remark").val(),
endDate: $("#endDate").val(),
lockinfo: "" + $("#copyTimeType").val()
};
return temp;
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [{
title: '全选',
field: 'select', //复选框
checkbox: true,
width: 25,
align: 'center',
valign: 'middle'
},
/*{
title: '序号',
field: 'id',
align: 'center',
valign: 'middle',
//sortable: true,
visible: false,
formatter: function (value, row, index) {
return index + 1;
}
},*/
{
title: '扫描人',
field: 'creater',
width: 200,
align: 'left',
valign: 'middle'
},
{
title: '扫描日期',
field: 'createTime',
align: 'center',
valign: 'middle',
width: 500,
},
{
title: '扫描次数',
field: 'numb',
align: 'center',
valign: 'middle'
},
{
title: '扫描份数',
field: 'content',
align: 'center',
valign: 'middle'
}/*,
{
title: '复印日期',
field: 'createTime',
align: 'center',
valign: 'middle'
}, {
title: '操作人',
field: 'creater',
align: 'left',
valign: 'middle'
},{
title: '复印次数',
field: 'numb',
align: 'center',
valign: 'middle'
},*/
],
onLoadSuccess: function (result) { //加载成功时执行
//console.info("加载成功");
console.log(result);
tipLoad = 0;
},
onLoadError: function () { //加载失败时执行
//console.info("加载数据失败");
tipLoad = 0;
}
});
}
}
//查询
$('#searchBtn').click(function () {
if (tipLoad == 0) {
$("#table").bootstrapTable("refreshOptions", {pageNumber: 1});
} else {
toastr.warning("正在查询,请稍等...");
}
//$("#deptName").val([]);
});
//获取table的高度
function getHeight() {
return $(window).height() - 100;
}
initTable();
//2.初始化select的change事件
$("#sel_exportoption").change(function () {
$('#table').bootstrapTable('refreshOptions', {
exportDataType: $(this).val()
});
});
$("#refreshBtn").click(function () {
//刷新
$('#table').bootstrapTable('refresh');
});
//导出excel功能
$("#excelBtn").click(function () {
var creater=""+$("#creater").val();//操作人
var startDate= $("#startDate").val();
var endDate= $("#endDate").val();
var lockinfo= "" + $("#copyTimeType").val();
//var remark=$("#remark").val();
window.location.href = "${path}/scanInfo/exportCountExcel?startDate=" + startDate +
"&endDate=" + endDate + "&lockinfo=" + lockinfo+ "&creater=" + creater;
});
</script>
</html>

@ -0,0 +1,423 @@
<%@ page import="java.util.ResourceBundle" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set value="${pageContext.request.contextPath}" var="path" scope="page"/>
<%
ResourceBundle res = ResourceBundle.getBundle("config.jdbc");
%>
<%--<%@ include file="/WEB-INF/jspf/common.jspf" %>--%>
<html>
<head>
<title>复印记录统计</title>
<meta charset="utf-8">
<!-- 解决部分兼容性问题如果安装了GCF则使用GCF来渲染页面如果未安装GCF则使用最高版本的IE内核进行渲染。 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- 页面按原比例显示 -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<%@include file="../../jspf/comm.jspf" %>
</head>
<style>
.modal-header2 {
text-align: center !important;
vertical-align: middle !important;
background-color: #3c8dbc !important;
color: #fff;
font-size: 16px;
font-weight: bold;
padding: 5px 5px 5px 5px !important;
}
/*.modal-header {*/
/*padding: 5px 5px 5px 5px !important;*/
/*}*/
.modal-footer{
padding: 5px;
}
.divCss {
margin-top: 5px;
}
.divCss2 {
margin-top: 5px;
margin-left: 20px;
}
.divCss8 {
margin-top: 5px;
margin-right: 20px;
}
/* dataTables表头居中 */
.table > thead:first-child > tr:first-child > th {
text-align: center !important;
}
.enterCss2{
height: 160px;
width: 500px;
}
.toolbarCss {
margin-right: 20px;
margin-bottom: 0px;
!important;
}
.fixed-table-toolbar .bs-bars .pull-right{
height: 20px;
!important;
}
/*选中行颜色*/
.fixed-table-container tbody .selected td {
background-color: #9acfea;
}
</style>
<body>
<div style="margin-left:30px;margin-right:10px;height:auto">
<!--搜索-->
<form style="margin-top:20px;">
<div class="form-inline">
<div class="form-group divCss8">
<label for="inpNo">住院号:</label>
<input type="text" class="input-sm form-control" id="inpNo" placeholder="请输入住院号">
</div>
<div class="form-group divCss8">
<label>扫描人:</label>
<input type="text" class="input-sm form-control" id="creater" placeholder="请输入扫描人">
</div>
<div class="form-group divCss8">
<label>扫描日期:</label>
<div class="input-daterange input-group" id="datepicker">
<input type="text" class="input-sm form-control" name="start" id="startDate"/>
<span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" name="end" id="endDate"/>
</div>
</div>
<div class="form-group divCss">
<label>扫描时段 :</label>
<select class="input-sm form-control" id="copyTimeType">
<option value="">不限</option>
<option value="day_7">7天内</option>
<option value="month_day_15">半个月内</option>
<option value="month_1">一个月内</option>
<option value="month_3">三个月内</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>
<!--数据表格-->
<table id="table" class="table text-nowrap table-striped" ></table>
<div id="toolbar" class="btn-group pull-right toolbarCss" >
<div class="columns columns-right btn-group pull-right" style="margin-top:0px;">
<div class="btn-group btn-info">
<select id="sel_exportoption" class="form-control">                
<option value="">导出当前页面数据</option>                
<option value="all">导出全部数据</option>              
<option value="selected">导出选中数据</option>
</select>
</div>
<button class=" btn btn-success btn-sm" style="height: 34px" type="button" id="refreshBtn" name="refresh" aria-label="Refresh"
title="Refresh">
<i class="glyphicon glyphicon-refresh icon-refresh"></i>
</button>
</div>
</div>
</div>
</body>
<script>
var tipLoad = 1;
$(function () {
var url = window.location.href;
var index = url.substring(url.lastIndexOf('?') + 1).replace("num=", "");
if (index != null && index != "" && index.indexOf("excel") != -1) {
$("#excelBtn").show();
$("#toolbar").show();
} else {
$("#excelBtn").hide();
$(".columns-right").hide();
}
});
//日期控件
$(".input-daterange").datepicker({
format: "yyyy-mm-dd",
language: "zh-CN"
});
/* var currDate=getCurrDate();
var currDate30=getCurrDay30();
$('#startDate').val(currDate30);
$('#endDate').val(currDate);*/
//处理导出内容,这个方法可以自定义某一行、某一列、甚至某个单元格的内容,也就是将其值设置为自己想要的内容
function DoOnCellHtmlData(cell, row, col, data) {
if (row == 0) {
return data;
}
//由于备注列超过6个字的话,通过span标签处理只显示前面6个字,如果直接导出的话会导致内容不完整,因此要将携带完整内容的span标签中title属性的值替换
if (col == 4 || col == 11 || col == 7) {
var spanObj = $(data);//将带 <span title="val"></span> 标签的字符串转换为jQuery对象
var title = spanObj.attr("title");//读取<span title="val"></span>中title属性的值
//var span = cell[0].firstElementChild;//读取cell数组中的第一个值下的第一个元素
if (typeof (title) != 'undefined') {
return title;
}
}
return data;
}
function initTable() {
if(tipLoad == 1){
$("#table").bootstrapTable({ // 对应table标签的id
//method: 'POST',
url: "${path}/scanInfo/scanDetailPage", // 获取表格数据的url
contentType: "application/x-www-form-urlencoded",//一种编码。好像在post请求的时候需要用到。这里用的get请求注释掉这句话也能拿到数据
//dataField: "data",//这是返回的json数组的key.默认是"rows".这里只有前后端约定好就行
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
paginationShowPageGo: true,
pageList: [10, 20, 50, 100], // 如果设置了分页设置可供选择的页面数据条数。设置为All 则显示所有记录。
smartDisplay: false,
pageSize: 2, // 页面数据条数
pageNumber: 1, // 初始化加载第一页,默认第一页
sidePagination: 'server', // 设置为服务器端分页 客户端client
search: false,
showColumns: true,
// sortable: true,
// sortOrder: "asc",
toolbar: '#toolbar',//指定工具栏
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: true,
//导出表格方式默认basic只导出当前页的表格数据all导出所有数据selected导出选中的数据
exportDataType: "basic",
//导出文件类型
exportTypes: ['json', 'xml', 'csv', 'txt', 'sql', 'excel'],
exportOptions: {
fileName: document.title
},
// showToggle: false, //是否显示详细视图和列表视图的切换按钮
// cardView: false, //是否显示详细视图
// detailView: false, //是否显示父子表
queryParams: function (params) {
var currPageSize = this.pageSize;
if (currPageSize == 2) {
currPageSize = 10;
}
var limit= null;
var offset= params.offset;
//判断是否导出全部all
if ($("#sel_exportoption").val() == "all") {
offset=0;
limit=this.totalRows;
this.pageSize= limit;
}else{
limit = currPageSize;
this.pageSize = currPageSize;
}
//var url = window.location.href;
// var deptName = url.substring(url.lastIndexOf('&') + 1).replace("depts=", "");
// var len = ($("#deptName").val()).length;
// if (len > 0) {
// var deptNameT = $("#deptName").val();
// if (deptNameT.indexOf("") == -1) {
// deptName = $("#deptName").val().toString();
// }
// }
var temp = {
limit: limit, //页面大小
offset: offset, //页码
order: params.order, //排位命令descasc
inpNo: "" + $("#inpNo").val(),
creater:""+$("#creater").val(),
startDate: $("#startDate").val(),
endDate: $("#endDate").val(),
lockinfo: "" + $("#copyTimeType").val()
};
return temp;
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [{
title: '全选',
field: 'select', //复选框
checkbox: true,
width: 25,
align: 'center',
valign: 'middle',
},
{
title: '序号',
field: 'id',
align: 'center',
valign: 'middle',
//sortable: true,
visible: false,
formatter: function (value, row, index) {
return index + 1;
}
},
{
title: '记账号',
field: 'patientId',
align: 'left',
valign: 'middle',
width: 300
},
{
title: '住院号',
field: 'inpNo',
align: 'center',
valign: 'middle'
},
{
title: '住院次数',
field: 'visitId',
align: 'center',
valign: 'middle',
width: 120
},
{
title: '患者姓名',
field: 'name',
align: 'left',
valign: 'middle',
width: 120
},
/* {
title: '性别',
field: 'sex',
align: 'center',
valign: 'middle'
},*/
/*{
title: '入院时间',
field: 'admissionDateTime',
align: 'center'
},*/
{
title: '出院时间',
field: 'dischargeDateTime',
align: 'center',
width: 200
}
/*,{
title: '出院科室',
field: 'deptName',
align: 'left',
valign: 'middle'
},{
title: '主管医生',
field: 'doctorInCharge',
align: 'left',
valign: 'middle'
}*/
,{
title: '扫描人',
field: 'creater',
align: 'left',
valign: 'middle'
},
{
title: '文件名',
field: 'content',
align: 'left',
valign: 'middle'
},
{
title: '扫描日期',
field: 'createTime',
align: 'center',
valign: 'middle'
}
/*,{
title: '修改标志',
field: 'remark',
align: 'center',
valign: 'middle'
}*/
],
onLoadSuccess: function (result) { //加载成功时执行
//console.info("加载成功");
console.log(result)
tipLoad = 0;
},
onLoadError: function () { //加载失败时执行
//console.info("加载数据失败");
tipLoad = 0;
}
});
}
}
//查询
$('#searchBtn').click(function () {
if (tipLoad == 0) {
$("#table").bootstrapTable("refreshOptions", {pageNumber: 1});
} else {
toastr.warning("正在查询,请稍等...");
}
//$("#deptName").val([]);
});
//获取table的高度
function getHeight() {
return $(window).height() - 100;
}
initTable();
//2.初始化select的change事件
$("#sel_exportoption").change(function () {
$('#table').bootstrapTable('refreshOptions', {
exportDataType: $(this).val()
});
});
$("#refreshBtn").click(function () {
//刷新
$('#table').bootstrapTable('refresh');
});
//导出excel功能
$("#excelBtn").click(function () {
var inpNo = "" + $("#inpNo").val();
var creater=""+$("#creater").val();//扫描人
var startDate= $("#startDate").val();
var endDate= $("#endDate").val();
var lockinfo= "" + $("#copyTimeType").val();
window.location.href = "${path}/scanInfo/exportExcel?inpNo=" + inpNo + "&startDate=" + startDate +
"&endDate=" + endDate + "&lockinfo=" + lockinfo+ "&creater=" + creater;
});
</script>
</html>
Loading…
Cancel
Save