diff --git a/src/main/java/com/emr/controller/ArchiveFlowInfoController.java b/src/main/java/com/emr/controller/ArchiveFlowInfoController.java index 8461966..e916b1c 100644 --- a/src/main/java/com/emr/controller/ArchiveFlowInfoController.java +++ b/src/main/java/com/emr/controller/ArchiveFlowInfoController.java @@ -1,8 +1,8 @@ package com.emr.controller; -import com.emr.entity.Archive_Master_Vo; import com.emr.entity.OffsetLimitPage; import com.emr.service.ipml.ArchiveFlowInfoService; +import com.emr.util.ExceptionPrintUtil; import com.emr.util.ExportExcelUtil1; import com.emr.vo.ArchiveFlowInfoVo; import com.github.pagehelper.Page; @@ -55,7 +55,7 @@ public class ArchiveFlowInfoController { */ @RequestMapping(value = "selectFlowInfoList") @ResponseBody - public OffsetLimitPage selectFlowInfoList(Integer offset, Integer limit, ArchiveFlowInfoVo flowInfoVo,Integer isSearch) throws Exception{ + public OffsetLimitPage selectFlowInfoList(Integer offset, Integer limit, ArchiveFlowInfoVo flowInfoVo,Integer isSearch){ //判断是否是初始化查询,是初始化查询把开始结束时间置空 if(isSearch == 0){ flowInfoVo.setDisStartDate(null); @@ -64,8 +64,14 @@ public class ArchiveFlowInfoController { flowInfoVo.setEndDate(null); } PageHelper.offsetPage(offset,limit); - List list = flowInfoService.selectFlowInfoList(flowInfoVo,null); - return new OffsetLimitPage((Page) list); + try { + List list = flowInfoService.selectFlowInfoList(flowInfoVo,null); + return new OffsetLimitPage((Page) list); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } /** @@ -78,7 +84,7 @@ public class ArchiveFlowInfoController { */ @RequestMapping("exportExcel") @ResponseBody - public void exportExcel(HttpServletResponse response, ArchiveFlowInfoVo flowInfoVo,String sql, Integer isSearch) throws Exception{ + public void exportExcel(HttpServletResponse response, ArchiveFlowInfoVo flowInfoVo,String sql, Integer isSearch){ //全部明细 String tableThNames = ""; String fieldCns = ""; @@ -92,12 +98,17 @@ public class ArchiveFlowInfoController { flowInfoVo.setStartDate(null); flowInfoVo.setEndDate(null); } - List list = flowInfoService.selectFlowInfoList(flowInfoVo,sql); - //文件名 - String fileName = "审核流程明细(" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ").xls"; - //ExportExcelUtil - ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + try { + List list = flowInfoService.selectFlowInfoList(flowInfoVo,sql); + //文件名 + String fileName = "审核流程明细(" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ").xls"; + //ExportExcelUtil + ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } } } diff --git a/src/main/java/com/emr/controller/DictionaryController.java b/src/main/java/com/emr/controller/DictionaryController.java index ee02641..30d0197 100644 --- a/src/main/java/com/emr/controller/DictionaryController.java +++ b/src/main/java/com/emr/controller/DictionaryController.java @@ -8,12 +8,12 @@ package com.emr.controller; import com.emr.entity.Emr_Dictionary; import com.emr.service.Emr_DictionaryService; +import com.emr.util.ExceptionPrintUtil; 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.stereotype.Controller; -import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -28,23 +28,34 @@ public class DictionaryController { private Emr_DictionaryService emrDictionaryService; @RequestMapping(value = "/dictionarys") - public String inHospitals(Model model) { + public String inHospitals() { return "dictionaryDir/dictionary"; } @ResponseBody @RequestMapping(value = "/dicList") - public List dicList(Emr_Dictionary emrDictionary) { - return emrDictionaryService.dicByClo(emrDictionary); + public List dicList(Emr_Dictionary emrDictionary){ + try { + return emrDictionaryService.dicByClo(emrDictionary); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @ResponseBody @RequestMapping(value = "/delById") public int delById(Integer id) { int bol = 0; - if (id != null) { - //删除 - bol = emrDictionaryService.delById(id); + try { + if (id != null) { + //删除 + bol = emrDictionaryService.delById(id); + } + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); } return bol; } @@ -62,61 +73,61 @@ public class DictionaryController { SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String nowTime = format1.format(new Date()); - - if(emrDictionary.getId()!=null){ - //判断类别代码或代码是否已经存在 - //存在修改 - emrDictionary.setUpdater(username); - emrDictionary.setUpdateTime(nowTime); - try{ + try{ + if(emrDictionary.getId()!=null){ + //判断类别代码或代码是否已经存在 + //存在修改 + emrDictionary.setUpdater(username); + emrDictionary.setUpdateTime(nowTime); bol=emrDictionaryService.updateCloById(emrDictionary); - }catch (Exception e){ - e.printStackTrace(); - } - if (bol == 1) { - result = "修改成功!"; - } else { - result = "修改失败!"; - } - }else{ - emrDictionary.setCreater(username); - emrDictionary.setCreateTime(nowTime); - //判断类别代码或代码是否已经存在 - if(emrDictionary.getCode()!=null && emrDictionary.getCode()!=""){ - dic2.setCode(emrDictionary.getCode()); - dic2.setParentId(emrDictionary.getParentId()); - //根据代码查询该父类下是否存在是否已经存在 - List list = emrDictionaryService.dicByClo(dic2); - //添加叶子节点 - if(list.size()<=0){ - //添加叶子 - bol = emrDictionaryService.insertSel(emrDictionary); - if(bol==1){ - result = "添加成功!"; + if (bol == 1) { + result = "修改成功!"; + } else { + result = "修改失败!"; + } + }else{ + emrDictionary.setCreater(username); + emrDictionary.setCreateTime(nowTime); + //判断类别代码或代码是否已经存在 + if(emrDictionary.getCode()!=null && emrDictionary.getCode()!=""){ + dic2.setCode(emrDictionary.getCode()); + dic2.setParentId(emrDictionary.getParentId()); + //根据代码查询该父类下是否存在是否已经存在 + List list = emrDictionaryService.dicByClo(dic2); + //添加叶子节点 + if(list.size()<=0){ + //添加叶子 + bol = emrDictionaryService.insertSel(emrDictionary); + if(bol==1){ + result = "添加成功!"; + }else{ + result = "添加失败!"; + } }else{ - result = "添加失败!"; + result="代码已存在!"; } }else{ - result="代码已存在!"; - } - }else{ - dic2.setTypecode(emrDictionary.getTypecode()); - //根据代码查询是否已经存在 - List list = emrDictionaryService.dicByClo(dic2); - //添加叶子节点 - if (list.size() <= 0) { - //emrDictionary.setEffective(1); - //添加类别 - bol = emrDictionaryService.insertSel(emrDictionary); - if (bol == 1) { - result = "添加成功!"; + dic2.setTypecode(emrDictionary.getTypecode()); + //根据代码查询是否已经存在 + List list = emrDictionaryService.dicByClo(dic2); + //添加叶子节点 + if (list.size() <= 0) { + //emrDictionary.setEffective(1); + //添加类别 + bol = emrDictionaryService.insertSel(emrDictionary); + if (bol == 1) { + result = "添加成功!"; + } else { + result = "添加失败!"; + } } else { - result = "添加失败!"; + result = "代码已存在!"; } - } else { - result = "代码已存在!"; } } + }catch (Exception e){ + ExceptionPrintUtil.printException(e); + e.printStackTrace(); } return result; } diff --git a/src/main/java/com/emr/controller/FontController.java b/src/main/java/com/emr/controller/FontController.java index 93804ab..1fc8b85 100644 --- a/src/main/java/com/emr/controller/FontController.java +++ b/src/main/java/com/emr/controller/FontController.java @@ -8,6 +8,7 @@ import com.emr.service.Archive_MasterService; import com.emr.service.ipml.ArchiveOtherService; import com.emr.service.ipml.TPrintinfoService; import com.emr.service.ipml.ZdAssortService; +import com.emr.util.ExceptionPrintUtil; import com.emr.util.Msg; import net.sf.json.JSONObject; import org.apache.commons.lang3.StringUtils; @@ -24,6 +25,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; @@ -53,21 +56,18 @@ public class FontController { private ArchiveOtherService archiveOtherService; @RequestMapping("selectIsPrintByPatienId") @ResponseBody - public Msg selectIsPrintByPatienId(String patientId){ + public Msg selectIsPrintByPatienId(String patientId) throws Exception{ if(StringUtils.isBlank(patientId)){ return Msg.fail("参数patientId不能为空"); } return printinfoService.selectIsPrintByPatienId(patientId); } - - - /***************************提供第三方按多个分段id和记账号查询病历pdf***********************************/ /** * 提供第三方按多个分段id和记账号查询病历pdf * */ @RequestMapping("showRecordByPatientId") - public String showRecordByPatientId(String userName, String assortIds, String patientId, Model model) throws Exception{ + public String showRecordByPatientId(String userName, String assortIds, String patientId, Model model){ //判断各参数 if(StringUtils.isBlank(userName)){ return retrunErrorPage(model,"工号不能为空!"); @@ -80,23 +80,28 @@ public class FontController { } List list = new ArrayList<>(); //判断工号是否存在 - String checkUserName = checkUserName(userName); - if(StringUtils.isNotBlank(checkUserName)){ - return retrunErrorPage(model,checkUserName); - } - //判断分类id是否存在,协商assortIds = "00000000"为查询全部 - if(!allAddortIds.equals(assortIds)) { - String checkAssortIds = checkAssortIds(assortIds); - if (StringUtils.isNotBlank(checkAssortIds)) { - return retrunErrorPage(model, checkAssortIds); + try { + String checkUserName = checkUserName(userName); + if(StringUtils.isNotBlank(checkUserName)){ + return retrunErrorPage(model,checkUserName); } - } - //判断记账号是否存在 - Archive_Master master = new Archive_Master(); - master.setPatientId(patientId); - list = archiveMasterService.selectByObject(master); - if(null == list || list.isEmpty()){ - return retrunErrorPage(model,"记账号不存在!"); + //判断分类id是否存在,协商assortIds = "00000000"为查询全部 + if(!allAddortIds.equals(assortIds)) { + String checkAssortIds = checkAssortIds(assortIds); + if (StringUtils.isNotBlank(checkAssortIds)) { + return retrunErrorPage(model, checkAssortIds); + } + } + //判断记账号是否存在 + Archive_Master master = new Archive_Master(); + master.setPatientId(patientId); + list = archiveMasterService.selectByObject(master); + if(null == list || list.isEmpty()){ + return retrunErrorPage(model,"记账号不存在!"); + } + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); } model.addAttribute("patientId",list.get(0).getId()); model.addAttribute("accountNumber",list.get(0).getPatientId()); @@ -107,24 +112,29 @@ public class FontController { /** * 判断工号是否存在 */ - private String checkUserName(String userName) throws Exception{ + private String checkUserName(String userName){ String resultString = ""; String url = powerUrlHead + "/font/checkUserName?userName=" + userName; - // 执行请求 - CloseableHttpResponse response = HttpClients.createDefault().execute(new HttpGet(url)); - // 判断返回状态是否为200 - int temp = 200; - if (response.getStatusLine().getStatusCode() == temp) { - resultString = EntityUtils.toString(response.getEntity(), "UTF-8"); - } - if (StringUtils.isNoneBlank(resultString)) { - JSONObject jsonObject = JSONObject.fromObject(resultString); - Integer code = jsonObject.getInt("code"); - //code==200有错误信息 - if(code == temp){ - JSONObject extendObject1 = JSONObject.fromObject(jsonObject); - return extendObject1.getString("msg"); + try { + // 执行请求 + CloseableHttpResponse response = HttpClients.createDefault().execute(new HttpGet(url)); + // 判断返回状态是否为200 + int temp = 200; + if (response.getStatusLine().getStatusCode() == temp) { + resultString = EntityUtils.toString(response.getEntity(), "UTF-8"); } + if (StringUtils.isNoneBlank(resultString)) { + JSONObject jsonObject = JSONObject.fromObject(resultString); + int code = jsonObject.getInt("code"); + //code==200有错误信息 + if(code == temp){ + JSONObject extendObject1 = JSONObject.fromObject(jsonObject); + return extendObject1.getString("msg"); + } + } + } catch (IOException e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); } return null; } @@ -135,21 +145,27 @@ public class FontController { private String checkAssortIds(String assortIds){ Zd_Assort assort = new Zd_Assort(); assort.setPrintFlag("0"); - List assortList = assortService.selectAll(assort); + List assortList = null; + try { + assortList = assortService.selectAll(assort); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } if(null != assortList && !assortList.isEmpty()){ String[] split = assortIds.split(","); - for (int i = 0; i < split.length; i++) { + for (String s : split) { //定义分类存在 boolean exist = false; - if(StringUtils.isNotBlank(split[i])){ - for (int j = 0; j < assortList.size(); j++) { - if(split[i].equals(assortList.get(j).getAssortId())){ + if (StringUtils.isNotBlank(s)) { + for (Zd_Assort assort1 : assortList) { + if (s.equals(assort1.getAssortId())) { exist = true; break; } } } - if(!exist){ + if (!exist) { return "病案分类Id有误!"; } } @@ -174,28 +190,34 @@ public class FontController { */ @ResponseBody @RequestMapping(value = "/getRecord") - public String getPdfToPdf(String masterId) throws Exception{ - Archive_Master archiveMaster = archiveMasterService.selectByPrimaryKey(masterId); - //转换科室数据字典 - if(StringUtils.isNotBlank(archiveMaster.getDeptName())){ - Emr_Dictionary dictionary = new Emr_Dictionary(); - dictionary.setCode(archiveMaster.getDeptName()); - dictionary.setTypecode("dept_code"); - List dictionaries = dictionaryMapper.dicByTypeCode(dictionary); - if(null != dictionaries && !dictionaries.isEmpty()){ - archiveMaster.setDeptName(dictionaries.get(0).getName()); - } - //判断出院日期 - String dischargeDateTime = archiveMaster.getDischargeDateTime(); - if(StringUtils.isNotBlank(dischargeDateTime)){ - SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); - String time = fmt.format(fmt.parse(dischargeDateTime)); - if("1801-02-03".equals(time)){ - archiveMaster.setDischargeDateTime(null); + public String getPdfToPdf(String masterId){ + try { + Archive_Master archiveMaster = archiveMasterService.selectByPrimaryKey(masterId); + //转换科室数据字典 + if(StringUtils.isNotBlank(archiveMaster.getDeptName())){ + Emr_Dictionary dictionary = new Emr_Dictionary(); + dictionary.setCode(archiveMaster.getDeptName()); + dictionary.setTypecode("dept_code"); + List dictionaries = dictionaryMapper.dicByTypeCode(dictionary); + if(null != dictionaries && !dictionaries.isEmpty()){ + archiveMaster.setDeptName(dictionaries.get(0).getName()); + } + //判断出院日期 + String dischargeDateTime = archiveMaster.getDischargeDateTime(); + if(StringUtils.isNotBlank(dischargeDateTime)){ + SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); + String time = fmt.format(fmt.parse(dischargeDateTime)); + if("1801-02-03".equals(time)){ + archiveMaster.setDischargeDateTime(null); + } } } + return JSON.toJSONString(archiveMaster); + } catch (ParseException e) { + ExceptionPrintUtil.printException(e); + //e.printStackTrace(); + return null; } - return JSON.toJSONString(archiveMaster); } /** @@ -210,19 +232,24 @@ public class FontController { if(StringUtils.isNotBlank(patientId) && StringUtils.isNotBlank(assortIds)){ List list = new ArrayList<>(); //assortIds等于协商的全查的分类id,全查 - if(allAddortIds.equals(assortIds)){ - list = archiveDetailService.selectTypeTreeByPatientIdAndAssortIds(patientId, null); - }else{ - //否则按条件查 - //分类id分别以单引号隔开 - String assortIdStr = ""; - String[] split = assortIds.split(","); - for (int i = 0; i < split.length; i++) { - assortIdStr += "'" + split[i] + "',"; + try { + if(allAddortIds.equals(assortIds)){ + list = archiveDetailService.selectTypeTreeByPatientIdAndAssortIds(patientId, null); + }else{ + //否则按条件查 + //分类id分别以单引号隔开 + StringBuilder assortIdStr = new StringBuilder(); + String[] split = assortIds.split(","); + for (String s : split) { + assortIdStr.append("'").append(s).append("',"); + } + //去掉最后一个逗号 + assortIdStr = new StringBuilder(assortIdStr.substring(0, assortIdStr.length() - 1)); + list = archiveDetailService.selectTypeTreeByPatientIdAndAssortIds(patientId, assortIdStr.toString()); } - //去掉最后一个逗号 - assortIdStr = assortIdStr.substring(0,assortIdStr.length()-1); - list = archiveDetailService.selectTypeTreeByPatientIdAndAssortIds(patientId,assortIdStr); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); } if(null != list && !list.isEmpty()){ Set assortList = new LinkedHashSet<>(); @@ -289,7 +316,12 @@ public class FontController { @ResponseBody @RequestMapping(value = "/getPdfToPdf/{masterId}/{detailIds}") public void getPdfToPdf(HttpServletResponse response,@PathVariable("detailIds") String detailIds, @PathVariable("masterId") String masterId){ - archiveDetailService.selectPdfPathByIds(response, detailIds, masterId,pdfWater); + try { + archiveDetailService.selectPdfPathByIds(response, detailIds, masterId,pdfWater); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + //e.printStackTrace(); + } } /** * 返回错误页面 diff --git a/src/main/java/com/emr/controller/GlobalExceptionHandler.java b/src/main/java/com/emr/controller/GlobalExceptionHandler.java index 814162b..e289cf5 100644 --- a/src/main/java/com/emr/controller/GlobalExceptionHandler.java +++ b/src/main/java/com/emr/controller/GlobalExceptionHandler.java @@ -13,20 +13,17 @@ package com.emr.controller; * @Version: 1.0 */ import com.alibaba.fastjson.support.spring.FastJsonJsonView; -import org.apache.log4j.Logger; +import com.emr.util.ExceptionPrintUtil; import org.apache.shiro.authz.UnauthorizedException; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.servlet.ModelAndView; -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; import java.util.HashMap; import java.util.Map; @ControllerAdvice public class GlobalExceptionHandler { - private static Logger log = Logger.getLogger("errorMsg"); @ExceptionHandler(value = Exception.class)//指定拦截的异常 public ModelAndView errorHandler(Exception e){ return returnMv(e,"服务器出错了,请联系系统管理员"); @@ -48,11 +45,7 @@ public class GlobalExceptionHandler { attributes.put("msg", msg); view.setAttributesMap(attributes); mv.setView(view); - //方法名 - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - e.printStackTrace(new PrintStream(baos)); - String exception = baos.toString(); - log.error(exception); + ExceptionPrintUtil.printException(e); e.printStackTrace(); return mv; } diff --git a/src/main/java/com/emr/controller/HolidaySetController.java b/src/main/java/com/emr/controller/HolidaySetController.java index f111df2..805f288 100644 --- a/src/main/java/com/emr/controller/HolidaySetController.java +++ b/src/main/java/com/emr/controller/HolidaySetController.java @@ -3,6 +3,7 @@ package com.emr.controller; import com.emr.entity.EmrHolidaySetVo; import com.emr.entity.OffsetLimitPage; import com.emr.service.ipml.HolidaySetService; +import com.emr.util.ExceptionPrintUtil; import com.emr.util.Msg; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -22,7 +23,13 @@ public class HolidaySetController { @ResponseBody @RequestMapping(value = "getHolidaySetList") public OffsetLimitPage getHolidaySetList(EmrHolidaySetVo holidaySetVo) { - return holidaySetService.selectByColumn(holidaySetVo); + try { + return holidaySetService.selectByColumn(holidaySetVo); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @RequestMapping("save") diff --git a/src/main/java/com/emr/controller/JAXDynamicClientFactory.java b/src/main/java/com/emr/controller/JAXDynamicClientFactory.java index de83943..bf16514 100644 --- a/src/main/java/com/emr/controller/JAXDynamicClientFactory.java +++ b/src/main/java/com/emr/controller/JAXDynamicClientFactory.java @@ -34,10 +34,6 @@ public class JAXDynamicClientFactory extends DynamicClientFactory { return true; } - public static JAXDynamicClientFactory newInstance(Bus b) { - return new JAXDynamicClientFactory(b); - } - public static JAXDynamicClientFactory newInstance() { Bus bus = CXFBusFactory.getThreadDefaultBus(); return new JAXDynamicClientFactory(bus); diff --git a/src/main/java/com/emr/controller/LoginController.java b/src/main/java/com/emr/controller/LoginController.java index 328da1b..c3c168e 100644 --- a/src/main/java/com/emr/controller/LoginController.java +++ b/src/main/java/com/emr/controller/LoginController.java @@ -49,15 +49,25 @@ public class LoginController { String requestUrl = POWER_URLHEAD + "/font/getToken?userName="+userName+"&password="+token; JSONObject obj = HttpClientUtils.httpGet(requestUrl); if(obj!=null) { - if ((obj.getString("code")).equals("100")) { + if ("100".equals(obj.getString("code"))) { JSONObject extend = obj.getJSONObject("extend"); token = extend.getString("token"); } } } - JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance(); - Client client = dcf.createClient(POWER_URLHEAD + "/WebService/PowerWebService?wsdl"); - Object[] objects = client.invoke("getInfosByUserId", token, "emr_medical_record"); + Object[] objects = new Object[0]; + Client client = null; + try { + JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance(); + client = dcf.createClient(POWER_URLHEAD + "/WebService/PowerWebService?wsdl"); + objects = client.invoke("getInfosByUserId", token, "emr_medical_record"); + } catch (Exception e) { + e.printStackTrace(); + } finally { + if(null != client) { + client.destroy(); + } + } ObjectMapper mapper = new ObjectMapper(); Power_User powerUser = mapper.readValue(objects[0].toString(), Power_User.class); //设置进session diff --git a/src/main/java/com/emr/controller/MedicalRecallController.java b/src/main/java/com/emr/controller/MedicalRecallController.java index 83eb1e9..5f013d5 100644 --- a/src/main/java/com/emr/controller/MedicalRecallController.java +++ b/src/main/java/com/emr/controller/MedicalRecallController.java @@ -10,6 +10,7 @@ import com.emr.dao.Archive_MasterMapper; import com.emr.entity.*; import com.emr.service.Archive_MasterService; import com.emr.service.ipml.ArchiveCallbackInfoService; +import com.emr.util.ExceptionPrintUtil; import com.emr.util.ExportExcelUtil; import com.emr.util.Msg; import org.apache.commons.lang3.StringUtils; @@ -55,21 +56,32 @@ public class MedicalRecallController { @RequestMapping(value = "/recallList") public OffsetLimitPage recallList(Archive_Master_Vo master, Integer offset, Integer limit) { //查询已归档记录 - return archiveMasterService.selectFiled(master, offset, limit); + try { + return archiveMasterService.selectFiled(master, offset, limit); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @ResponseBody @RequestMapping(value = "/exportExcel") - public void exportExcel(HttpServletResponse response, Archive_Master_Vo master) throws Exception { + public void exportExcel(HttpServletResponse response, Archive_Master_Vo master){ String tableThNames = "住院号,住院次数,名字,性别,入院科室,入院日期,出院科室,出院日期,上次召回状态,归档状态"; String fieldCns = "inpNo,visitId,name,sex,deptAdmissionTo,admissionDateTime,deptName,dischargeDateTime,status,archivestate"; - List list = archiveMasterMapper.selectFiled(master); - //文件名 - String fileName = "归档记录" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; - //ExportExcelUtil - ExportExcelUtil exportExcelUtil = new ExportExcelUtil(); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + try { + List list = archiveMasterMapper.selectFiled(master); + //文件名 + String fileName = "归档记录" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; + //ExportExcelUtil + ExportExcelUtil exportExcelUtil = new ExportExcelUtil(); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } } @ResponseBody diff --git a/src/main/java/com/emr/controller/StatisticsController.java b/src/main/java/com/emr/controller/StatisticsController.java index 78d19e4..b909e99 100644 --- a/src/main/java/com/emr/controller/StatisticsController.java +++ b/src/main/java/com/emr/controller/StatisticsController.java @@ -3,6 +3,7 @@ package com.emr.controller; import com.emr.entity.Archive_Master_Vo; import com.emr.entity.OffsetLimitPage; import com.emr.service.ipml.StatisticsService; +import com.emr.util.ExceptionPrintUtil; import com.emr.util.ExportExcelUtil1; import com.emr.vo.FinalAndFirstStatistics; import com.emr.vo.TUuInfoVo; @@ -89,14 +90,20 @@ public class StatisticsController { //终审按天统计 @RequestMapping("getFinalStatistics") @ResponseBody - public OffsetLimitPage getFinalStatistics(HttpServletRequest request,Integer offset, Integer limit, String startDate, String endDate,Integer isSearch){ + public OffsetLimitPage getFinalStatistics(Integer offset, Integer limit, String startDate, String endDate,Integer isSearch){ //判断是否是初始化查询,是初始化查询把开始结束时间置空 if(isSearch == 0){ startDate = null; endDate = null; } - List list = statisticsService.getFinalStatistics(offset, limit, startDate, endDate,null); - return new OffsetLimitPage((Page)list); + try { + List list = statisticsService.getFinalStatistics(offset, limit, startDate, endDate,null); + return new OffsetLimitPage((Page)list); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } //初审按天统计 @@ -108,11 +115,16 @@ public class StatisticsController { startDate = null; endDate = null; } - List list = statisticsService.getFirstStatistics(request, offset, limit, startDate, endDate,null); - return new OffsetLimitPage((Page) list); + try { + List list = statisticsService.getFirstStatistics( offset, limit, startDate, endDate,null); + return new OffsetLimitPage((Page) list); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } - //审核明细 @RequestMapping("getStatisticsDetail") @ResponseBody @@ -124,13 +136,19 @@ public class StatisticsController { archiveMasterVo.setStartDate(null); archiveMasterVo.setEndDate(null); } - return statisticsService.getStatisticsDetail(offset,limit,disStartDate,disEndDate,archiveMasterVo,flag); + try { + return statisticsService.getStatisticsDetail(offset,limit,disStartDate,disEndDate,archiveMasterVo,flag); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } //导出终审统计 @RequestMapping("exportExcelFinalStatistics") @ResponseBody - public void exportExcelFinalStatistics(HttpServletResponse response,Integer offset, Integer limit, String startDate, String endDate,String sql,Integer isSearch) throws Exception{ + public void exportExcelFinalStatistics(HttpServletResponse response,Integer offset, Integer limit, String startDate, String endDate,String sql,Integer isSearch){ //全部明细 String tableThNames = "工号,姓名,终审日期,终审数量"; String fieldCns = "checkCode,checkName,createTime,count"; @@ -139,19 +157,24 @@ public class StatisticsController { startDate = null; endDate = null; } - List list = statisticsService.getFinalStatistics(offset, limit, startDate, endDate,sql); - //文件名 - String fileName = "终审记录统计报表(" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ").xls"; - //ExportExcelUtil - ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + try { + List list = statisticsService.getFinalStatistics(offset, limit, startDate, endDate,sql); + //文件名 + String fileName = "终审记录统计报表(" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ").xls"; + //ExportExcelUtil + ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } } //导出初审统计 @RequestMapping("exportExcelFirstStatistics") @ResponseBody - public void exportExcelFirstStatistics(HttpServletRequest request,HttpServletResponse response,Integer offset, Integer limit, String startDate, String endDate,String sql,Integer isSearch) throws Exception{ + public void exportExcelFirstStatistics(HttpServletRequest request,HttpServletResponse response,Integer offset, Integer limit, String startDate, String endDate,String sql,Integer isSearch){ //全部明细 String tableThNames = "工号,姓名,审核日期,审核数量"; String fieldCns = "checkCode,checkName,createTime,count"; @@ -160,19 +183,24 @@ public class StatisticsController { startDate = null; endDate = null; } - List list = statisticsService.getFirstStatistics(request, offset, limit, startDate, endDate,sql); - //文件名 - String fileName = "病案室审核记录统计表(" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ").xls"; - //ExportExcelUtil - ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + try { + List list = statisticsService.getFirstStatistics(offset, limit, startDate, endDate,sql); + //文件名 + String fileName = "病案室审核记录统计表(" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ").xls"; + //ExportExcelUtil + ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } } //导出审核明细 @RequestMapping("exportExcelDetail") @ResponseBody - public void exportExcelDetail(HttpServletResponse response,String disStartDate, String disEndDate, Archive_Master_Vo archiveMasterVo, Integer flag,String sql,Integer isSearch) throws Exception{ + public void exportExcelDetail(HttpServletResponse response,String disStartDate, String disEndDate, Archive_Master_Vo archiveMasterVo, Integer flag,String sql,Integer isSearch){ //全部明细 String tableThNames = ""; String fieldCns = ""; @@ -191,13 +219,18 @@ public class StatisticsController { archiveMasterVo.setStartDate(null); archiveMasterVo.setEndDate(null); } - List list = statisticsService.getDetailList(disStartDate, disEndDate, archiveMasterVo,flag,sql); - //文件名 - String fileName = "病案室审核记录明细报表(" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ").xls"; - //ExportExcelUtil - ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + try { + List list = statisticsService.getDetailList(disStartDate, disEndDate, archiveMasterVo,flag,sql); + //文件名 + String fileName = "病案室审核记录明细报表(" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ").xls"; + //ExportExcelUtil + ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } } //复印记录报表 @@ -208,8 +241,14 @@ public class StatisticsController { PageHelper.offsetPage(offset, limit); } judgeIsSearch(search, isSearch); - List list = statisticsService.getPrintCount(search); - return new OffsetLimitPage((Page)list); + try { + List list = statisticsService.getPrintCount(search); + return new OffsetLimitPage((Page)list); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } //判断初始化查询是否按时间条件查询 @@ -228,8 +267,14 @@ public class StatisticsController { PageHelper.offsetPage(offset, limit); } judgeIsSearch(search, isSearch); - List list = statisticsService.getPrintInfo(search); - return new OffsetLimitPage((Page)list); + try { + List list = statisticsService.getPrintInfo(search); + return new OffsetLimitPage((Page)list); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } //扫描记录报表 @@ -240,8 +285,14 @@ public class StatisticsController { PageHelper.offsetPage(offset, limit); } judgeIsSearch(search, isSearch); - List list = statisticsService.getScanCount(search); - return new OffsetLimitPage((Page)list); + try { + List list = statisticsService.getScanCount(search); + return new OffsetLimitPage((Page)list); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } //扫描记录明细 @@ -252,75 +303,101 @@ public class StatisticsController { PageHelper.offsetPage(offset, limit); } judgeIsSearch(search, isSearch); - List list = statisticsService.getScanInfo(search); - return new OffsetLimitPage((Page)list); + try { + List list = statisticsService.getScanInfo(search); + return new OffsetLimitPage((Page)list); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } //导出复印记录报表 @RequestMapping("exportExcelPrintCount") @ResponseBody - public void exportExcelPrintCount(HttpServletResponse response,TUuPrintSearch search,Integer isSearch) throws Exception{ + public void exportExcelPrintCount(HttpServletResponse response,TUuPrintSearch search,Integer isSearch){ judgeIsSearch(search, isSearch); //全部明细 String tableThNames = "记账号,住院号,住院次数,患者,复印日期,操作人,复印次数"; String fieldCns = "patientId,inpNo,visitId,hzname,printTime,cpyuser,printCount"; - List list = statisticsService.getPrintCount(search); - //文件名 - String fileName = "复印记录报表(" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ").xls"; - //ExportExcelUtil - ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + try { + List list = statisticsService.getPrintCount(search); + //文件名 + String fileName = "复印记录报表(" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ").xls"; + //ExportExcelUtil + ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } } //导出复印记录明细 @RequestMapping("exportExcelPrintInfo") @ResponseBody - public void exportExcelPrintInfo(HttpServletResponse response,TUuPrintSearch search,Integer isSearch) throws Exception{ + public void exportExcelPrintInfo(HttpServletResponse response,TUuPrintSearch search,Integer isSearch){ judgeIsSearch(search, isSearch); //全部明细 String tableThNames = "记账号,住院号,住院次数,患者姓名,性别,入院时间,出院时间,出院科室,主管医生,复印内容,操作人,复印日期,修改标志"; String fieldCns = "patientId,inpNo,visitId,hzname,sex,admissionDateTime,dischargeDateTime,name,doctorInCharge,filetitle,cpyuser,printTime,flagCn"; - List list = statisticsService.getPrintInfo(search); - //文件名 - String fileName = "复印记录明细(" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ").xls"; - //ExportExcelUtil - ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + try { + List list = statisticsService.getPrintInfo(search); + //文件名 + String fileName = "复印记录明细(" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ").xls"; + //ExportExcelUtil + ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } } //导出扫描记录报表 @RequestMapping("exportExcelScanCount") @ResponseBody - public void exportExcelScanCount(HttpServletResponse response,TUuPrintSearch search,Integer isSearch) throws Exception{ + public void exportExcelScanCount(HttpServletResponse response,TUuPrintSearch search,Integer isSearch){ judgeIsSearch(search, isSearch); //全部明细 String tableThNames = "扫描人,扫描日期,扫描次数"; String fieldCns = "uuname,uploaddatetime,scanCount"; - List list = statisticsService.getScanCount(search); - //文件名 - String fileName = "扫描上传记录报表(" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ").xls"; - //ExportExcelUtil - ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + try { + List list = statisticsService.getScanCount(search); + //文件名 + String fileName = "扫描上传记录报表(" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ").xls"; + //ExportExcelUtil + ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } } //导出扫描记录明细 @RequestMapping("exportExcelScanInfo") @ResponseBody - public void exportExcelScanInfo(HttpServletResponse response,TUuPrintSearch search,Integer isSearch) throws Exception{ + public void exportExcelScanInfo(HttpServletResponse response,TUuPrintSearch search,Integer isSearch){ judgeIsSearch(search, isSearch); //全部明细 String tableThNames = "记账号,住院号,住院次数,患者姓名,性别,入院时间,出院时间,出院科室,主管医生,扫描人,扫描时间"; String fieldCns = "patientId,inpNo,visitId,hzname,sex,admissionDateTime,dischargeDateTime,doctorDept,doctorInCharge,uuname,uploaddatetime"; - List list = statisticsService.getScanInfo(search); - //文件名 - String fileName = "扫描上传记录明细(" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ").xls"; - //ExportExcelUtil - ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + try { + List list = statisticsService.getScanInfo(search); + //文件名 + String fileName = "扫描上传记录明细(" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ").xls"; + //ExportExcelUtil + ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } } } diff --git a/src/main/java/com/emr/controller/UploadFilesController.java b/src/main/java/com/emr/controller/UploadFilesController.java index 75e91b1..0079724 100644 --- a/src/main/java/com/emr/controller/UploadFilesController.java +++ b/src/main/java/com/emr/controller/UploadFilesController.java @@ -6,6 +6,7 @@ */ package com.emr.controller; +import com.emr.util.ExceptionPrintUtil; import org.apache.log4j.Logger; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -32,80 +33,92 @@ public class UploadFilesController { * @throws IOException */ @RequestMapping(value = "/uploadImg", method = RequestMethod.POST) - public void uploadImg(HttpServletResponse resp, HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file) throws IOException { + public void uploadImg(HttpServletResponse resp, HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file){ resp.setContentType("text/json"); resp.setCharacterEncoding("utf-8"); PrintWriter pw = null; - pw = resp.getWriter(); - if (!file.isEmpty()) { - logger.info("成功获取照片"); - String fileName = file.getOriginalFilename(); - String path = null; - String type = null; - if (fileName != null) { - type = fileName.contains(".") ? fileName.substring(fileName.lastIndexOf(".") + 1) : null; - } - logger.info("图片初始名称为:" + fileName + " 类型为:" + type); - if (type != null) { - if ("PDF".equals(type.toUpperCase())) { - // 项目在容器中实际发布运行的根路径 - String realPath = request.getSession().getServletContext().getRealPath("/"); - // 自定义的文件名称 - String trueFileName = System.currentTimeMillis() + fileName; - // 设置存放图片文件的路径 - path = realPath + "/static/img/uploads/" + trueFileName; - logger.info("存放图片文件的路径:" + path); - file.transferTo(new File(path)); - logger.info("文件成功上传到指定目录下"); + try { + pw = resp.getWriter(); + if (!file.isEmpty()) { + logger.info("成功获取照片"); + String fileName = file.getOriginalFilename(); + String type = null; + if (fileName != null) { + type = fileName.contains(".") ? fileName.substring(fileName.lastIndexOf(".") + 1) : null; + } + logger.info("图片初始名称为:" + fileName + " 类型为:" + type); + if (type != null) { + if ("PDF".equals(type.toUpperCase())) { + // 项目在容器中实际发布运行的根路径 + String realPath = request.getSession().getServletContext().getRealPath("/"); + // 自定义的文件名称 + String trueFileName = System.currentTimeMillis() + fileName; + // 设置存放图片文件的路径 + String path = realPath + "/static/img/uploads/" + trueFileName; + logger.info("存放图片文件的路径:" + path); + file.transferTo(new File(path)); + logger.info("文件成功上传到指定目录下"); + } else { + logger.info("不是PDF文件类型,请按要求重新上传"); + pw.print("文件类型有误,请重新上传"); + } } else { - logger.info("不是PDF文件类型,请按要求重新上传"); - pw.print("文件类型有误,请重新上传"); + logger.info("文件类型为空"); + pw.print("文件类型为空"); } } else { - logger.info("文件类型为空"); - pw.print("文件类型为空"); + logger.info("没有找到相对应的文件"); + pw.print("没有找到相对应的文件"); + } + } catch (IOException e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + }finally { + if(null != pw) { + pw.flush(); + pw.close(); } - } else { - logger.info("没有找到相对应的文件"); - pw.print("没有找到相对应的文件"); } - pw.flush(); + } @ResponseBody @RequestMapping("upload") - public String upload(HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file) throws IOException { - request.setCharacterEncoding("UTF-8"); + public String upload(HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file){ logger.info("执行图片上传"); String userId = request.getParameter("userId"); logger.info("userId:" + userId); if (!file.isEmpty()) { logger.info("成功获取照片"); String fileName = file.getOriginalFilename(); - String path = null; String type = null; - if (fileName != null) { - type = fileName.contains(".") ? fileName.substring(fileName.lastIndexOf(".") + 1) : null; - } - logger.info("图片初始名称为:" + fileName + " 类型为:" + type); - if (type != null) { - if ("GIF".equals(type.toUpperCase()) || "PNG".equals(type.toUpperCase()) || "JPG".equals(type.toUpperCase())) { - // 项目在容器中实际发布运行的根路径 - String realPath = request.getSession().getServletContext().getRealPath("/"); - // 自定义的文件名称 - String trueFileName = System.currentTimeMillis() + fileName; - // 设置存放图片文件的路径 - path = realPath + "/uploads/" + trueFileName; - logger.info("存放图片文件的路径:" + path); - file.transferTo(new File(path)); - logger.info("文件成功上传到指定目录下"); + try { + if (fileName != null) { + type = fileName.contains(".") ? fileName.substring(fileName.lastIndexOf(".") + 1) : null; + } + logger.info("图片初始名称为:" + fileName + " 类型为:" + type); + if (type != null) { + if ("GIF".equals(type.toUpperCase()) || "PNG".equals(type.toUpperCase()) || "JPG".equals(type.toUpperCase())) { + // 项目在容器中实际发布运行的根路径 + String realPath = request.getSession().getServletContext().getRealPath("/"); + // 自定义的文件名称 + String trueFileName = System.currentTimeMillis() + fileName; + // 设置存放图片文件的路径 + String path = realPath + "/uploads/" + trueFileName; + logger.info("存放图片文件的路径:" + path); + file.transferTo(new File(path)); + logger.info("文件成功上传到指定目录下"); + } else { + logger.info("不是我们想要的文件类型,请按要求重新上传"); + return "error"; + } } else { - logger.info("不是我们想要的文件类型,请按要求重新上传"); + logger.info("文件类型为空"); return "error"; } - } else { - logger.info("文件类型为空"); - return "error"; + } catch (IOException e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); } } else { logger.info("没有找到相对应的文件"); diff --git a/src/main/java/com/emr/controller/UrlInterceptor.java b/src/main/java/com/emr/controller/UrlInterceptor.java index 857ed52..9392402 100644 --- a/src/main/java/com/emr/controller/UrlInterceptor.java +++ b/src/main/java/com/emr/controller/UrlInterceptor.java @@ -6,7 +6,10 @@ */ package com.emr.controller; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.emr.entity.Power_User; +import com.emr.util.HttpClientTool; import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.commons.lang3.StringUtils; import org.apache.cxf.endpoint.Client; @@ -15,6 +18,8 @@ import org.springframework.web.servlet.HandlerInterceptor; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; +import java.util.Map; public class UrlInterceptor implements HandlerInterceptor { @Value("${POWER_URLHEAD}") @@ -29,29 +34,30 @@ public class UrlInterceptor implements HandlerInterceptor { String token = (String) request.getSession().getAttribute("token"); if (!"/login".equals(url) && StringUtils.isNoneBlank(token)) { try { - JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance(); - Client client = dcf.createClient(POWER_URLHEAD + "/WebService/PowerWebService?wsdl"); - Object[] objects = client.invoke("getInfosByUserId", token, "emr_medical_record"); - ObjectMapper mapper = new ObjectMapper(); - Power_User powerUser = mapper.readValue(objects[0].toString(), Power_User.class); - //设置进session - request.getSession().setAttribute("CURRENT_USER", powerUser); - if (null == powerUser.getUserId()) { - response.sendRedirect( "/emr_medical_record/error.jsp"); - return false; + // 创建url + String requestUrl = POWER_URLHEAD + "/font/checkToken"; + // 执行请求 + Map params = new HashMap<>(); + params.put("token", token); + String resultString = HttpClientTool.doPost(requestUrl, params); + String code = JSONArray.toJSONString(JSON.parseObject(resultString).get("code")); + if ("200".equals(code)) { + response.sendRedirect(POWER_URLHEAD + "/login"); } + //更新session + Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER"); + request.getSession().setAttribute("CURRENT_USER", user); } catch (Exception e) { - try { - response.sendRedirect("/emr_medical_record/error.jsp"); - }catch (Exception e1){} e.printStackTrace(); - return false; + try { + response.sendRedirect(POWER_URLHEAD + "/login"); + }catch (Exception e1){ + e1.printStackTrace(); + } } } return true; } - - } diff --git a/src/main/java/com/emr/controller/VCountController.java b/src/main/java/com/emr/controller/VCountController.java index ecf5fa8..3baeb2d 100644 --- a/src/main/java/com/emr/controller/VCountController.java +++ b/src/main/java/com/emr/controller/VCountController.java @@ -9,6 +9,7 @@ package com.emr.controller; import com.emr.dao.Archive_MasterMapper; import com.emr.entity.*; import com.emr.service.*; +import com.emr.util.ExceptionPrintUtil; import com.emr.util.ExportExcelUtil; import com.emr.util.ExportExcelUtil1; import com.emr.vo.DeptStatistics; @@ -48,83 +49,105 @@ public class VCountController { @ResponseBody @RequestMapping(value = "/vCountList") public OffsetLimitPage faultList(V_CountVo vCount, Integer offset, Integer limit) { - return v_countService.selectPageByClo(vCount,offset, limit); + try { + return v_countService.selectPageByClo(vCount,offset, limit); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @ResponseBody @RequestMapping(value = "/vCountNumList") public List medicalCountDayList(V_CountVo vCount){ - //统计列表 - return v_countService.selectByCol(vCount); + try { + //统计列表 + return v_countService.selectByCol(vCount); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @ResponseBody @RequestMapping(value = "/exportExcel") - public void exportExcel(HttpServletResponse response, V_CountVo vCount) throws Exception { + public void exportExcel(HttpServletResponse response, V_CountVo vCount){ String tableThNames = "科室代码,科室名称,出院人数,已归档,未归档,死亡人数,归档率(%),2日率(%),3日率(%),7日率(%)"; String fieldCns = "deptCode,deptName,outNum,fileNum,unfileNum,deathNum,fileRate,day2Rate,day3Rate,day7Rate"; //构造excel的数据 - List list = v_countService.selectByCol(vCount); - if(null != list && !list.isEmpty()){ - for (V_Count count : list) { - Double fileRate = Double.valueOf(count.getFileRate())*100; - Double day2Rate = Double.valueOf(count.getDay2Rate())*100; - Double day3Rate = Double.valueOf(count.getDay3Rate())*100; - Double day7Rate = Double.valueOf(count.getDay7Rate())*100; - count.setFileRate(fileRate.intValue()+"%"); - count.setDay2Rate(day2Rate.intValue()+"%"); - count.setDay3Rate(day3Rate.intValue()+"%"); - count.setDay7Rate(day7Rate.intValue()+"%"); + try { + List list = v_countService.selectByCol(vCount); + if(null != list && !list.isEmpty()){ + for (V_Count count : list) { + Double fileRate = Double.valueOf(count.getFileRate())*100; + Double day2Rate = Double.valueOf(count.getDay2Rate())*100; + Double day3Rate = Double.valueOf(count.getDay3Rate())*100; + Double day7Rate = Double.valueOf(count.getDay7Rate())*100; + count.setFileRate(fileRate.intValue()+"%"); + count.setDay2Rate(day2Rate.intValue()+"%"); + count.setDay3Rate(day3Rate.intValue()+"%"); + count.setDay7Rate(day7Rate.intValue()+"%"); + } } + //文件名 + String fileName = "统计数据" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ".xls"; + //ExportExcelUtil + ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames, fieldCns, list, fileName, response); + } catch (NumberFormatException e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); } - //文件名 - String fileName = "统计数据" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ".xls"; - //ExportExcelUtil - ExportExcelUtil1 exportExcelUtil = new ExportExcelUtil1(); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames, fieldCns, list, fileName, response); } @ResponseBody @RequestMapping(value = "/exportExcel2") - public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo) throws Exception { + public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo){ String tableThNames = "名字,入院科室,入院日期,出院科室,出院日期,主管医生"; String fieldCns = "name,deptAdmissionTo,admissionDateTime,deptName,dischargeDateTime,doctorInCharge"; //构造excel的数据 - List list = archiveMasterService.selectByUnfile(archiveMasterVo); - Emr_Dictionary dic = new Emr_Dictionary(); - dic.setEffective(1); - dic.setTypecode("dept_code"); - //科室列表 - List dicList = emrDictionaryService.dicByTypeCode(dic); - for (int i = 0; i < list.size(); i++) { - //替换科室 - 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())) || (dept2 != null && dept2.equals(dicList.get(k).getCode()))) { - //出院科室 - if(deptName != null) { - deptName = deptName.replace(deptName, dicList.get(k).getName()); - list.get(i).setDeptName(deptName); + try { + List list = archiveMasterService.selectByUnfile(archiveMasterVo); + Emr_Dictionary dic = new Emr_Dictionary(); + dic.setEffective(1); + dic.setTypecode("dept_code"); + //科室列表 + List dicList = emrDictionaryService.dicByTypeCode(dic); + for (int i = 0; i < list.size(); i++) { + //替换科室 + 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())) || (dept2 != null && dept2.equals(dicList.get(k).getCode()))) { + //出院科室 + if(deptName != null) { + deptName = deptName.replace(deptName, dicList.get(k).getName()); + list.get(i).setDeptName(deptName); + } + dept2 = dept2.replace(dept2, dicList.get(k).getName()); + list.get(i).setDeptAdmissionTo(dept2); } - dept2 = dept2.replace(dept2, dicList.get(k).getName()); - list.get(i).setDeptAdmissionTo(dept2); } } - } - //文件名 - String fileName = "未归档病历列表" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; - //ExportExcelUtil - ExportExcelUtil exportExcelUtil = new ExportExcelUtil(); - response.setContentType("application/ms-excel;charset=gbk"); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames, fieldCns, list, fileName, response); + //文件名 + String fileName = "未归档病历列表" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; + //ExportExcelUtil + ExportExcelUtil exportExcelUtil = new ExportExcelUtil(); + response.setContentType("application/ms-excel;charset=gbk"); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames, fieldCns, list, fileName, response); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } } //跳转医生统计页面 @@ -137,7 +160,13 @@ public class VCountController { @RequestMapping("/getDoctorFileInfoIframe") public String getDoctorFileInfoIframe(String deptCode,String doctor,String startTime,String endTime,Model model){ //科室医师明细 - List list = archiveMasterMapper.getDoctorFileInfo(deptCode, doctor, startTime, endTime); + List list = null; + try { + list = archiveMasterMapper.getDoctorFileInfo(deptCode, doctor, startTime, endTime); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } //定义返回结果 List deptList = new ArrayList<>(); if(null != list && !list.isEmpty()){ diff --git a/src/main/java/com/emr/controller/WebServiceLoad.java b/src/main/java/com/emr/controller/WebServiceLoad.java index e2b8c1b..514520f 100644 --- a/src/main/java/com/emr/controller/WebServiceLoad.java +++ b/src/main/java/com/emr/controller/WebServiceLoad.java @@ -31,9 +31,13 @@ public class WebServiceLoad { Client client = dcf.createClient(POWER_URLHEAD + "/WebService/PowerWebService?wsdl"); try { //动态调用getInfosByUserId方法 - Object[] objects = client.invoke("getInfosByUserId", token, "emr_medical_record"); + client.invoke("getInfosByUserId", token, "emr_medical_record"); } catch (Exception e) { e.printStackTrace(); + }finally { + if(null != client) { + client.destroy(); + } } }).start(); } diff --git a/src/main/java/com/emr/controller/beHospitaledController.java b/src/main/java/com/emr/controller/beHospitaledController.java index 1cd79ff..7524cda 100644 --- a/src/main/java/com/emr/controller/beHospitaledController.java +++ b/src/main/java/com/emr/controller/beHospitaledController.java @@ -13,6 +13,7 @@ import com.emr.entity.Archive_Master_Vo; import com.emr.entity.OffsetLimitPage; import com.emr.service.Archive_MasterService; import com.emr.service.ipml.ArchiveFlowInfoService; +import com.emr.util.ExceptionPrintUtil; import com.emr.util.ExportExcelUtil; import com.emr.util.Msg; import com.emr.util.OracleConnect; @@ -52,7 +53,7 @@ public class beHospitaledController { @RequestMapping("getChecker") @ResponseBody - public Msg getChecker(){ + public Msg getChecker() throws Exception{ Msg role = archiveMasterService.getRole(); return Msg.success().add("checker",role.getCode()); } @@ -62,11 +63,10 @@ public class beHospitaledController { */ @RequestMapping("/getCurrentCodes") @ResponseBody - public Msg getCurrentCodes(){ - String result = ""; + public Msg getCurrentCodes() throws Exception{ + StringBuilder result = new StringBuilder(); Integer roleIndex = 0; - Msg role = new Msg(); - role = archiveMasterService.getRole(); + Msg role = archiveMasterService.getRole(); String currentCodes = role.getMsg(); if(StringUtils.isNotBlank(currentCodes)){ //查询集合 @@ -78,16 +78,16 @@ public class beHospitaledController { if(StringUtils.isNotBlank(code)) { for (ArchiveFlowRole flowRole : archiveFlowRoles) { if (StringUtils.isNotBlank(flowRole.getCode()) && code.equals(flowRole.getCode())) { - result += flowRole.getId() + ","; + result.append(flowRole.getId()).append(","); roleIndex = flowRole.getStepIndex(); break; } } } } - if(result.endsWith(",")){ - result = result.substring(0,result.length()-1); - role.setMsg(result); + if(result.toString().endsWith(",")){ + result = new StringBuilder(result.substring(0, result.length() - 1)); + role.setMsg(result.toString()); } } @@ -97,18 +97,24 @@ public class beHospitaledController { @ResponseBody @RequestMapping(value = "/beHospList") - public OffsetLimitPage beHospList(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit,Integer isSearch) { + public OffsetLimitPage beHospList(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit,Integer isSearch){ //判断是否是初始化查询,是初始化查询把开始结束时间置空 if(isSearch == 0){ archiveMasterVo.setStartDateTo(null); archiveMasterVo.setEndDateTo(null); } - return archiveMasterService.selectByColumn(archiveMasterVo, offset, limit); + try { + return archiveMasterService.selectByColumn(archiveMasterVo, offset, limit); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @ResponseBody @RequestMapping(value = "/exportExcel") - public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo,Integer isSearch) throws Exception { + public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo,Integer isSearch){ String tableThNames = "住院号,住院次数,名字,性别,出院科室,出院日期,主管医生,状态"; String fieldCns = "inpNo,visitId,name,sex,deptName,dischargeDateTime,doctorInCharge,status"; //构造excel的数据 @@ -116,13 +122,18 @@ public class beHospitaledController { archiveMasterVo.setStartDateTo(null); archiveMasterVo.setEndDateTo(null); } - List list = archiveMasterService.selectByColumn(archiveMasterVo); - //文件名 - String fileName = "出院浏览" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; - //ExportExcelUtil - ExportExcelUtil exportExcelUtil = new ExportExcelUtil(); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + try { + List list = archiveMasterService.selectByColumn(archiveMasterVo); + //文件名 + String fileName = "出院浏览" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; + //ExportExcelUtil + ExportExcelUtil exportExcelUtil = new ExportExcelUtil(); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + }catch (Exception e){ + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } } /** @@ -140,122 +151,57 @@ public class beHospitaledController { return archiveMasterService.updateStateByArchivId(master); } -/* - @ResponseBody - @RequestMapping(value = "/updateStateByArchivId") - public String updateStateByArchivId(Emr_Fault_Detail emrFaultDetail) { - String result = ""; - try{ - //result = checkSuccessMethod(emrFaultDetail.getArchiveDetailId()); - // 从session获取用户名 - Subject currentUser = SecurityUtils.getSubject(); - Session session = currentUser.getSession(); - String username = (String) session.getAttribute("userSession");//获取前面登录的用户名 - SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - if(result.equals("完整")) { - //修改病案归档状态 - Archive_Master archiveMaster = new Archive_Master(); - archiveMaster.setId(emrFaultDetail.getArchiveDetailId()); - archiveMaster.setArchivestate(emrFaultDetail.getState()); - //设置审核时间 - archiveMaster.setCheckDatetime(format1.format(new Date())); - //设置审核人 - archiveMaster.setCheckDoctor(username); - archiveMaster.setLockinfo(result); - int bol = archiveMasterService.updateByClo(archiveMaster); - - //添加初审内容 - if (bol == 1) { - String nowTime = format1.format(new Date()); - - //参数输入 - emrFaultDetail.setCreater(username); - emrFaultDetail.setCreateTime(nowTime); - emrFaultDetail.setState("未召回"); - bol = emrFaultDetailService.insertSel(emrFaultDetail); - } - }else{ - //修改病案归档完整内容Lockinfo - Archive_Master archiveMaster = new Archive_Master(); - archiveMaster.setId(emrFaultDetail.getArchiveDetailId()); - //设置审核时间 - archiveMaster.setCheckDatetime(format1.format(new Date())); - //设置审核人 - archiveMaster.setCheckDoctor(username); - archiveMaster.setLockinfo(result); - archiveMasterService.updateByClo(archiveMaster); - } - return result; - }catch (Exception e){ - e.printStackTrace(); - } - return result; - } -*/ //校验完整性方法 //校验完整性 @ResponseBody @RequestMapping(value = "/checkSuccess") - private String checkSuccessMethod(String archiveDetailId) throws Exception{ + private String checkSuccessMethod(String archiveDetailId){ String result = ""; String endpoint = HomepageDictionary; //String endpoint = "http://localhost:8080/ca3/services/caSynrochnized?wsdl"; String method = HomepageMethod; JAXDynamicClientFactory factory = JAXDynamicClientFactory.newInstance(); - Client client = factory.createClient(endpoint); - Object[] res = null; - res = client.invoke(method, archiveDetailId); - result = (String) res[0]; - //更新master表完整性字段 - if(StringUtils.isNotBlank(result)){ - //更新表 - Archive_Master master = new Archive_Master(); - master.setId(archiveDetailId); - master.setLockinfo(result); - archiveMasterService.updateByClo(master); + Client client = null; + try { + client = factory.createClient(endpoint); + Object[] res = client.invoke(method, archiveDetailId); + result = (String) res[0]; + //更新master表完整性字段 + if(StringUtils.isNotBlank(result)){ + //更新表 + Archive_Master master = new Archive_Master(); + master.setId(archiveDetailId); + master.setLockinfo(result); + archiveMasterService.updateByClo(master); + } + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + }finally { + if(null != client){ + client.destroy(); + } } return result; } - /*@ResponseBody - @RequestMapping(value = "/forceWZ") - public String forceWZ(Emr_Fault_Detail emrFaultDetail) { - //修改病案归档状态 - Archive_Master archiveMaster = new Archive_Master(); - archiveMaster.setId(emrFaultDetail.getArchiveDetailId()); - archiveMaster.setArchivestate("初审"); - archiveMaster.setLockinfo(emrFaultDetail.getContent()); - try{ - int bol = archiveMasterService.updateByClo(archiveMaster); - // 从session获取用户名 - Subject currentUser = SecurityUtils.getSubject(); - Session session = currentUser.getSession(); - String username = (String) session.getAttribute("userSession");//获取前面登录的用户名 - - SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String nowTime = format1.format(new Date()); - - //参数输入 - emrFaultDetail.setCreater(username); - emrFaultDetail.setCreateTime(nowTime); - emrFaultDetail.setState("未召回"); - bol = emrFaultDetailService.insertSel(emrFaultDetail); - }catch (Exception e){ - e.printStackTrace(); - } - return "1"; - }*/ //出院初审先查询his是否医生护士全部提交 @RequestMapping("getInfoFromHis") @ResponseBody //@DataSource(dataSource = "dataSource1") - public int getInfoFromHis(String patientId) throws Exception{ + public int getInfoFromHis(String patientId){ String sql = "select fpatno from pacs.v_emrpatient where fpatno = '"+patientId+"'"; - String str = OracleConnect.select(sql); - if(StringUtils.isNoneBlank(str)){ - return 1; - }else{ + try { + String str = OracleConnect.select(sql); + if(StringUtils.isNoneBlank(str)){ + return 1; + }else{ + return 0; + } + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); return 0; } } @@ -267,10 +213,16 @@ public class beHospitaledController { * @return */ @RequestMapping("toShowFlowInfo") - private String toShowFlowInfo(Archive_Master_Vo master,Model model){ + private String toShowFlowInfo(Archive_Master_Vo master, Model model){ model.addAttribute("master",master); //查询流程信息集合 - List list = flowInfoService.selectFlowInfoByMasterId(master.getId()); + List list = null; + try { + list = flowInfoService.selectFlowInfoByMasterId(master.getId()); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } model.addAttribute("list",list); return "beHospitaledDir/timeLine"; } diff --git a/src/main/java/com/emr/controller/faultController.java b/src/main/java/com/emr/controller/faultController.java index db4972d..317f27a 100644 --- a/src/main/java/com/emr/controller/faultController.java +++ b/src/main/java/com/emr/controller/faultController.java @@ -8,10 +8,10 @@ package com.emr.controller; import com.emr.entity.*; import com.emr.service.Emr_Fault_DetailService; +import com.emr.util.ExceptionPrintUtil; import com.emr.util.ExportExcelUtil; 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; @@ -38,11 +38,17 @@ public class faultController { emrFaultVo.setStartDate(null); emrFaultVo.setEndDate(null); } - return emrFaultDetailService.selectByCol(emrFaultVo,offset, limit); + try { + return emrFaultDetailService.selectByCol(emrFaultVo,offset, limit); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @ResponseBody @RequestMapping(value = "/exportExcel") - public void exportExcel(HttpServletResponse response, Emr_Fault_Vo emrFaultVo,Integer isSearch) throws Exception{ + public void exportExcel(HttpServletResponse response, Emr_Fault_Vo emrFaultVo,Integer isSearch){ String tableThNames = "住院号,住院次数,姓名,出院科室,出院日期,归档状态,评分,回退内容,缺陷选项,缺陷内容,创建时间,创建人"; String fieldCns = "inpNo,visitId,name,deptName,dischargeDateTime,archivestate,score,backContent,assortId,content,createTime,creater"; //构造excel的数据 @@ -51,13 +57,18 @@ public class faultController { emrFaultVo.setStartDate(null); emrFaultVo.setEndDate(null); } - List list = emrFaultDetailService.selectByCol(emrFaultVo); - //文件名 - String fileName = "缺陷信息数据" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; - //ExportExcelUtil - ExportExcelUtil exportExcelUtil = new ExportExcelUtil(); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames, fieldCns, list, fileName, response); + try { + List list = emrFaultDetailService.selectByCol(emrFaultVo); + //文件名 + String fileName = "缺陷信息数据" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; + //ExportExcelUtil + ExportExcelUtil exportExcelUtil = new ExportExcelUtil(); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames, fieldCns, list, fileName, response); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } } } diff --git a/src/main/java/com/emr/controller/faultTypeController.java b/src/main/java/com/emr/controller/faultTypeController.java index 45f69c7..bc6f7e3 100644 --- a/src/main/java/com/emr/controller/faultTypeController.java +++ b/src/main/java/com/emr/controller/faultTypeController.java @@ -8,6 +8,7 @@ package com.emr.controller; import com.emr.entity.Emr_Fault_Type; import com.emr.service.Emr_Fault_TypeService; +import com.emr.util.ExceptionPrintUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -29,7 +30,13 @@ public class faultTypeController { @ResponseBody @RequestMapping(value = "/faultTypeList") public List faultTypeList(Emr_Fault_Type emrFaultType) { - return emrFaultTypeService.selectByCol(emrFaultType); + try { + return emrFaultTypeService.selectByCol(emrFaultType); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @ResponseBody @@ -37,16 +44,21 @@ public class faultTypeController { public int updateByClo(Emr_Fault_Type emrFaultType) { int bol=0; //判断id是否存在 - if(emrFaultType.getId()!=null){ - //判断是否存在记录 - if (emrFaultTypeService.selectById(emrFaultType.getId()) != null) { - bol = emrFaultTypeService.updateByClo(emrFaultType); + try { + if(emrFaultType.getId()!=null){ + //判断是否存在记录 + if (emrFaultTypeService.selectById(emrFaultType.getId()) != null) { + bol = emrFaultTypeService.updateByClo(emrFaultType); + } + }else{ + //不存在则添加缺陷类别记录 + bol= emrFaultTypeService.insertClo(emrFaultType); } - }else{ - //不存在则添加缺陷类别记录 - bol= emrFaultTypeService.insertClo(emrFaultType); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); } - return bol; + return bol; } @@ -54,10 +66,15 @@ public class faultTypeController { @RequestMapping(value = "/delById") public int delById(Integer id) { int bol = 0; - //判断id是否存在 - if (id!= null) { - //判断是否存在记录 - bol = emrFaultTypeService.delById(id); + try { + //判断id是否存在 + if (id!= null) { + //判断是否存在记录 + bol = emrFaultTypeService.delById(id); + } + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); } return bol; } diff --git a/src/main/java/com/emr/controller/inHospitalController.java b/src/main/java/com/emr/controller/inHospitalController.java index 7971375..9e6cd25 100644 --- a/src/main/java/com/emr/controller/inHospitalController.java +++ b/src/main/java/com/emr/controller/inHospitalController.java @@ -12,6 +12,7 @@ import com.emr.service.Archive_MasterService; import com.emr.service.Emr_DictionaryService; import com.emr.service.Emr_PictureService; import com.emr.service.ipml.ZdAssortService; +import com.emr.util.ExceptionPrintUtil; import com.emr.util.ExportExcelUtil; import com.emr.util.Jpg2PdfUtil; import com.emr.util.PrintToPdfUtil; @@ -33,6 +34,7 @@ import java.io.File; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Date; import java.util.List; @@ -79,12 +81,18 @@ public class inHospitalController { archiveMasterVo.setStartDateTo(null); archiveMasterVo.setEndDateTo(null); } - return archiveMasterService.selectByCol(archiveMasterVo, offset, limit); + try { + return archiveMasterService.selectByCol(archiveMasterVo, offset, limit); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @ResponseBody @RequestMapping(value = "/exportExcel") - public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo,Integer isSearch) throws Exception { + public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo,Integer isSearch){ String tableThNames = "住院号,住院次数,姓名,性别,入院科室,入院日期,主管医生,状态"; String fieldCns = "inpNo,visitId,name,sex,deptAdmissionTo,admissionDateTime,doctorInCharge,archivestate"; //构造excel的数据 @@ -93,15 +101,20 @@ public class inHospitalController { archiveMasterVo.setStartDateTo(null); archiveMasterVo.setEndDateTo(null); } - List list = archiveMasterService.selectByCol(archiveMasterVo); - - //文件名 - String fileName = "在院浏览" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; - //ExportExcelUtil - ExportExcelUtil exportExcelUtil = new ExportExcelUtil(); - response.setContentType("application/ms-excel;charset=gbk"); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames, fieldCns, list, fileName, response); + try { + List list = archiveMasterService.selectByCol(archiveMasterVo); + + //文件名 + String fileName = "在院浏览" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; + //ExportExcelUtil + ExportExcelUtil exportExcelUtil = new ExportExcelUtil(); + response.setContentType("application/ms-excel;charset=gbk"); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames, fieldCns, list, fileName, response); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } } @ResponseBody @@ -109,7 +122,13 @@ public class inHospitalController { public List getDept(Emr_Dictionary emrDictionary){ emrDictionary.setEffective(1); emrDictionary.setTypecode("dept_code"); - return emrDictionaryService.dicByTypeCode(emrDictionary); + try { + return emrDictionaryService.dicByTypeCode(emrDictionary); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @ResponseBody @@ -121,7 +140,13 @@ public class inHospitalController { if(null != checker && checker == 2){ archiveDetailVo.setAssortid(NURSEASSORTIDS); } - return archiveDetailService.selectByClo(archiveDetailVo); + try { + return archiveDetailService.selectByClo(archiveDetailVo); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @ResponseBody @@ -130,7 +155,13 @@ public class inHospitalController { //分段列表 Zd_Assort assort = new Zd_Assort(); assort.setPrintFlag("0"); - return zdAssortService.selectAll(assort); + try { + return zdAssortService.selectAll(assort); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @ResponseBody @@ -141,33 +172,50 @@ public class inHospitalController { if(null != checker && checker == 2){ archiveDetailVo.setAssortName(NURSEASSORTIDS); } - return archiveDetailService.detailByClo(archiveDetailVo, offset, limit); + try { + return archiveDetailService.detailByClo(archiveDetailVo, offset, limit); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @ResponseBody @RequestMapping(value = "/updateState") - public int updateState(HttpServletRequest request,HttpServletResponse response, Archive_Detail archiveDetail) throws Exception{ - request.setCharacterEncoding("utf-8"); + public int updateState(HttpServletRequest request,HttpServletResponse response, Archive_Detail archiveDetail){ response.setCharacterEncoding("utf-8"); archiveDetail.setFlag("1"); //修改状态分段信息 - return archiveDetailService.updateCloById(archiveDetail); + try { + request.setCharacterEncoding("utf-8"); + return archiveDetailService.updateCloById(archiveDetail); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return 0; + } } @ResponseBody @RequestMapping(value = "/updateStateAll") - public int updateStateAll(HttpServletRequest request,HttpServletResponse response, Archive_Detail archiveDetail) throws Exception { - request.setCharacterEncoding("utf-8"); + public int updateStateAll(HttpServletRequest request,HttpServletResponse response, Archive_Detail archiveDetail){ response.setCharacterEncoding("utf-8"); int bol=0; String idStr=archiveDetail.getId(); if(idStr.length()>0){ String[] idArr = idStr.split(","); //archiveDetail.setFlag("1"); - for(int i=0;i 0) { - for (int i = 0; i < imgArr.length; i++) { - imgList.add(imgArr[i]); - } - } - } - -// if(imgList.size()==1){ -// result= masterId.trim() + "/"+ imgList.get(0) +"/"+ imgList.get(0)+".pdf"; -// }else{ - String pdfPath = realPath+"pdfFiles\\" + "typesPdf\\"+ pdfFileName + ".pdf"; - String imgPath= realPath + "pdfFiles\\"+masterId.trim()+"\\"; - //获取废除的pdf文件名列表archive_detail - List pdfList=new ArrayList(); - Archive_Detail archiveDetail = new Archive_Detail(); - archiveDetail.setFlag("0"); - archiveDetail.setMasterid(masterId.trim()); - archiveDetail.setTitle(imgStr); - List arList=archiveDetailService.selectByCol(archiveDetail); - if(arList!=null) { - for (int m = 0; m < arList.size(); m++) { - String str = arList.get(m).getPdfPath(); - if (str.indexOf("..\\static\\img\\pdfFiles\\") != -1) { - str = str.split("pdfFiles")[1]; - str = realPath + "pdfFiles" + str; - } - // str= str.substring(str.lastIndexOf("\\") + 1); - pdfList.add(str); - } - } - - //PrintToPdfUtil.pdtToPdf(imgPath,pdfPath, imgList,pdfList); - PDFUtils.getPdf(pdfPath, pdfList); - result = "typesPdf/"+pdfFileName + ".pdf"; -// } - } else { - result = "a000000.pdf"; + try { + archiveDetailService.getPdfToPdf(response,imgStr, masterId,pdfWater); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + //e.printStackTrace(); } - return result; } -*/ /** * 根据病案号或类别或图片id获取图片列表,并生成PDF并返回pdf文件名 - * @param response * @param request * @param imgStr * @param masterId @@ -302,9 +291,7 @@ public class inHospitalController { */ @ResponseBody @RequestMapping(value = "/getPdf") - public String getPdf(HttpServletResponse response, HttpServletRequest request,String imgStr, String masterId) throws Exception { - request.setCharacterEncoding("utf-8"); - response.setCharacterEncoding("utf-8"); + public String getPdf(HttpServletRequest request,String imgStr, String masterId){ String result=""; // 项目在容器中实际发布运行的根路径 String realPath = request.getSession().getServletContext().getRealPath("/"); @@ -312,29 +299,32 @@ public class inHospitalController { String pdfFile = String.valueOf(System.currentTimeMillis()); String pdfPath = pictureUrl + "\\" + pdfFile + ".pdf"; //病案号文件夹 - if(StringUtils.isNotBlank(masterId)){ - realPath = realPath+ masterId+"\\"; - //判断文件夹是否存在 - File fileDic = new File(realPath ); - if (!fileDic.exists() && !fileDic.isDirectory()) { - fileDic.mkdirs(); - } - //病案号/类别/id文件夹(图片路径下的子文件夹名称) - //生成pdf(图片路径,pdf生成路径,图片路径文件夹列表) - List imgList=new ArrayList(); - if(StringUtils.isNotBlank(imgStr)) { - String[] imgArr = imgStr.split(","); - if (imgArr.length > 0) { - for (int i = 0; i < imgArr.length; i++) { - imgList.add(imgArr[i]); + try { + if(StringUtils.isNotBlank(masterId)){ + realPath = realPath+ masterId+"\\"; + //判断文件夹是否存在 + File fileDic = new File(realPath); + if (!fileDic.exists() && !fileDic.isDirectory()) { + fileDic.mkdirs(); + } + //病案号/类别/id文件夹(图片路径下的子文件夹名称) + //生成pdf(图片路径,pdf生成路径,图片路径文件夹列表) + List imgList=new ArrayList(); + if(StringUtils.isNotBlank(imgStr)) { + String[] imgArr = imgStr.split(","); + if (imgArr.length > 0) { + imgList.addAll(Arrays.asList(imgArr)); } } + //imgList.add(imgStr.split())imgStr.split(",")); + PrintToPdfUtil.toPdf(realPath, pdfPath, imgList); + result= pdfFile + ".pdf"; + }else{ + result="a000000.pdf"; } - //imgList.add(imgStr.split())imgStr.split(",")); - PrintToPdfUtil.toPdf(realPath, pdfPath, imgList); - result= pdfFile + ".pdf"; - }else{ - result="a000000.pdf"; + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); } return result; } @@ -343,74 +333,40 @@ public class inHospitalController { * 根据病案号或类别或图片id获取图片列表,并生成PDF并返回pdf文件名 * * @param response - * @param request * @param idStr * * @return * @throws Exception */ @ResponseBody @RequestMapping(value = "/getPdfById/{idStr}") - public void getPdfById(HttpServletResponse response, HttpServletRequest request, @PathVariable("idStr") String idStr) throws Exception { - Archive_Detail detail=new Archive_Detail(); - detail.setTitle(idStr); - //根据所有id获取PDF列表 - List arList = archiveDetailService.selectByIdStr(detail); - //获取废除的pdf文件名列表archive_detail - List pdfList = new ArrayList(); - //将所有记录的pdf数组里面\static\img\pdfFiles\typesPdf - if(arList!=null && arList.size()>0){ - for(int m=0;m arList = archiveDetailService.selectByIdStr(detail); - //获取废除的pdf文件名列表archive_detail - List pdfList = new ArrayList(); - //将所有记录的pdf数组里面\static\img\pdfFiles\typesPdf - if(arList!=null && arList.size()>0){ - for(int m=0;m arList = archiveDetailService.selectByIdStr(detail); + //获取废除的pdf文件名列表archive_detail + List pdfList = new ArrayList(); + //将所有记录的pdf数组里面\static\img\pdfFiles\typesPdf + if(arList!=null && arList.size()>0){ + for (Archive_Detail detail1 : arList) { + String str = detail1.getPdfPath(); + if (StringUtils.isNotBlank(str)) { + pdfList.add(str); + } } - pdfList.add(str); + //对所有地址的pdf进行合成 + Jpg2PdfUtil.mulFile2One(response,pdfList,pdfWater); } - //对所有地址的pdf进行合成 - PrintToPdfUtil.mergePdfFiles(pdfList, pdfPath); - result = pdfFile + ".pdf"; - }else{ - result=""; + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + //e.printStackTrace(); } - return result; } -*/ @ResponseBody @RequestMapping(value = "/delPdf") - public String delPdf(HttpServletResponse response, HttpServletRequest request,String pdfName) throws Exception { + public String delPdf(String pdfName){ String msg = ""; // 项目在容器中实际发布运行的根路径 String realPath= pictureUrl + "\\" + pdfName + ".pdf"; @@ -425,48 +381,50 @@ public class inHospitalController { @ResponseBody @RequestMapping(value = "/delImg") - public String delImg(HttpServletResponse response, HttpServletRequest request,Emr_Picture emrPicture) throws Exception { - request.setCharacterEncoding("utf-8"); - response.setCharacterEncoding("utf-8"); + public String delImg(HttpServletRequest request,Emr_Picture emrPicture){ String msg = ""; int bol =0; String id = emrPicture.getId(); if (StringUtils.isNotBlank(id) && !"-1".equals(id)) { - //判断记录是否存在 - Emr_Picture entity=emrPictureService.selectByid(emrPicture.getId()); - if(entity!=null){ - String realPath = request.getSession().getServletContext().getRealPath("/"); - realPath = realPath.split("target")[0] + pictureUrl; - String imgPath=entity.getMaxPicture().replace("..",realPath); - //将之前图片文件删除 - File file1 = new File(imgPath); - if (file1.exists() && file1.isFile()) { - file1.delete(); - // 设置存放图片文件的路径 - String path2 = "\\static\\img\\uploads\\"; - //病案号 - if (entity.getRelationId() != null && entity.getRelationId() != "") { - path2 = path2 + entity.getRelationId() + "\\"; - } - //类型 - if (entity.getAssortId() != null && entity.getAssortId() != "") { - path2 = path2 + entity.getAssortId() + "\\"; - } - String pdfPath= pictureUrl + "\\pdfFiles\\" + entity.getRelationId() + "\\" + entity.getAssortId()+"\\"+ entity.getAssortId() + ".pdf"; - //将之前文件删除 - File file = new File(pdfPath); + try { + //判断记录是否存在 + Emr_Picture entity=emrPictureService.selectByid(emrPicture.getId()); + if(entity!=null){ + String realPath = request.getSession().getServletContext().getRealPath("/"); + realPath = realPath.split("target")[0] + pictureUrl; + String imgPath=entity.getMaxPicture().replace("..",realPath); + //将之前图片文件删除 + File file1 = new File(imgPath); if (file1.exists() && file1.isFile()) { file1.delete(); + // 设置存放图片文件的路径 + String path2 = "\\static\\img\\uploads\\"; + //病案号 + if (entity.getRelationId() != null && !"".equals(entity.getRelationId())) { + path2 = path2 + entity.getRelationId() + "\\"; + } + //类型 + if (entity.getAssortId() != null && !"".equals(entity.getAssortId())) { + path2 = path2 + entity.getAssortId() + "\\"; + } + String pdfPath= pictureUrl + "\\pdfFiles\\" + entity.getRelationId() + "\\" + entity.getAssortId()+"\\"+ entity.getAssortId() + ".pdf"; + //将之前文件删除 + if (file1.exists() && file1.isFile()) { + file1.delete(); + } + //重新生成pdf + //读取指定路径下的文件名和目录名 + List arr = new ArrayList(); + //arr.add(pathType); + //图片转PDF(病案号文件夹+类别文件夹) + PrintToPdfUtil.toPdf(realPath + path2 , pdfPath , arr); } - //重新生成pdf - //读取指定路径下的文件名和目录名 - List arr = new ArrayList(); - //arr.add(pathType); - //图片转PDF(病案号文件夹+类别文件夹) - PrintToPdfUtil.toPdf(realPath + path2 , pdfPath , arr); + //存在删除 + bol = emrPictureService.deleteById(emrPicture.getId()); } - //存在删除 - bol = emrPictureService.deleteById(emrPicture.getId()); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); } } if(bol==1) { @@ -479,7 +437,6 @@ public class inHospitalController { /** * 图片列表查询 - * @param response * @param * @param emrPicture * @return @@ -487,12 +444,16 @@ public class inHospitalController { */ @ResponseBody @RequestMapping(value = "/getPicList") - public List getPicList(HttpServletResponse response, Emr_Picture emrPicture){ - return emrPictureService.selectByClo(emrPicture); + public List getPicList(Emr_Picture emrPicture){ + try { + return emrPictureService.selectByClo(emrPicture); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } - - /** * 批量图片上传 * @@ -504,10 +465,9 @@ public class inHospitalController { */ @ResponseBody @RequestMapping(value = "/uploadImgS", method = RequestMethod.POST) - public String uploadImgS(HttpServletResponse resp, HttpServletRequest request, @RequestParam MultipartFile[] imgs) throws Exception { + public String uploadImgS(HttpServletResponse resp, HttpServletRequest request, @RequestParam MultipartFile[] imgs){ resp.setContentType("text/json"); resp.setCharacterEncoding("utf-8"); - request.setCharacterEncoding("utf-8"); String firstFile =request.getParameter("fileName"); String list = request.getParameter("list"); String masterId = request.getParameter("masterID"); @@ -552,130 +512,135 @@ public class inHospitalController { entity.setUpdater(username); int bol = 0; String id= obj.get("id").toString(); - if (StringUtils.isNotBlank(id) && !"-1".equals(id)) { - Emr_Picture picList = emrPictureService.selectByid(id); - //判断记录是否已经存在 - if (picList!=null) { - entity.setId(id); - //图片是否有改动有改动则删除之前重新上传 - if(!picList.getAssortId().equals(entity.getAssortId()) || !picList.getRelationId().equals(entity.getRelationId())){ - if(!picList.getMaxPicture().contains(path2 + pathType)){ - // 移动图片 - String startPath= picList.getMaxPicture(); - startPath = startPath.substring(startPath.indexOf("\\"), startPath.length()); - String endPath= pictureUrl + path2 + pathType; - PrintToPdfUtil.moveTotherFolders(pictureUrl + startPath, endPath); - String[] oldName= picList.getMaxPicture().split("\\\\"); - //新的图片地址 - entity.setMaxPicture(picSrc + path2 + pathType + oldName[oldName.length - 1]); - } - //被修改的类别重新生成pdf,查询出pdf记录 - //根据病案号和类别查询是否存在 - Archive_Detail detail = new Archive_Detail(); - detail.setMasterid(masterId); - detail.setAssortid(picList.getAssortId()); - List detailList = archiveDetailService.selectByColm(detail); - //判断pdf是否存在,将之前文件删除 - File file1 = new File(detailList.get(0).getPdfPath()); - if (file1.exists() && file1.isFile()) { - file1.delete(); - } - //读取指定路径下的文件名和目录名 - List arr = new ArrayList(); - arr.add(picList.getAssortId()); - //图片转PDF(病案号文件夹+类别文件夹) - PrintToPdfUtil.toPdf(pictureUrl + path2 + picList.getAssortId(), detailList.get(0).getPdfPath(), arr); - //判断pdf文件大小等于了则删除,并删除pdf记录 - File file = new File(detailList.get(0).getPdfPath()); - if (file.exists() && file.isFile()) { - if(file.length()==0){ - String pdfPathVal = pictureUrl + "\\pdfFiles\\"+ detail.getMasterid() +"\\"+ picList.getAssortId() + "\\" + picList.getAssortId() + ".pdf"; - detail.setPdfPath(pdfPathVal); - archiveDetailService.deleteByClo(detail); - file.delete(); - detail.setPdfPath(""); + try { + if (StringUtils.isNotBlank(id) && !"-1".equals(id)) { + Emr_Picture picList = emrPictureService.selectByid(id); + //判断记录是否已经存在 + if (picList!=null) { + entity.setId(id); + //图片是否有改动有改动则删除之前重新上传 + if(!picList.getAssortId().equals(entity.getAssortId()) || !picList.getRelationId().equals(entity.getRelationId())){ + if(!picList.getMaxPicture().contains(path2 + pathType)){ + // 移动图片 + String startPath= picList.getMaxPicture(); + startPath = startPath.substring(startPath.indexOf("\\"), startPath.length()); + String endPath= pictureUrl + path2 + pathType; + PrintToPdfUtil.moveTotherFolders(pictureUrl + startPath, endPath); + String[] oldName= picList.getMaxPicture().split("\\\\"); + //新的图片地址 + entity.setMaxPicture(picSrc + path2 + pathType + oldName[oldName.length - 1]); + } + //被修改的类别重新生成pdf,查询出pdf记录 + //根据病案号和类别查询是否存在 + Archive_Detail detail = new Archive_Detail(); + detail.setMasterid(masterId); + detail.setAssortid(picList.getAssortId()); + List detailList = archiveDetailService.selectByColm(detail); + //判断pdf是否存在,将之前文件删除 + File file1 = new File(detailList.get(0).getPdfPath()); + if (file1.exists() && file1.isFile()) { + file1.delete(); + } + //读取指定路径下的文件名和目录名 + List arr = new ArrayList(); + arr.add(picList.getAssortId()); + //图片转PDF(病案号文件夹+类别文件夹) + PrintToPdfUtil.toPdf(pictureUrl + path2 + picList.getAssortId(), detailList.get(0).getPdfPath(), arr); + //判断pdf文件大小等于了则删除,并删除pdf记录 + File file = new File(detailList.get(0).getPdfPath()); + if (file.exists() && file.isFile()) { + if(file.length()==0){ + String pdfPathVal = pictureUrl + "\\pdfFiles\\"+ detail.getMasterid() +"\\"+ picList.getAssortId() + "\\" + picList.getAssortId() + ".pdf"; + detail.setPdfPath(pdfPathVal); + archiveDetailService.deleteByClo(detail); + file.delete(); + detail.setPdfPath(""); + } + } + //根据id修改记录 + bol = emrPictureService.updateCloByIdOrFlay(entity); + //} + if (bol == 1) { + result = "批量上传成功!"; + } else { + result = "批量上传失败!"; } } - //根据id修改记录 - bol = emrPictureService.updateCloByIdOrFlay(entity); - //} - if (bol == 1) { - result = "批量上传成功!"; - } else { - result = "批量上传失败!"; + } else { + //得到图片名 + String oldName = imgs[t].getOriginalFilename();// 如apple1.jpg + String lasName = oldName.substring(oldName.lastIndexOf(".") + 1); + if ("GIF".equals(lasName.toUpperCase()) || "JPEG".equals(lasName.toUpperCase()) || "PNG".equals(lasName.toUpperCase()) || "JPG".equals(lasName.toUpperCase())) { + // 自定义的文件名称String.valueOf(System.currentTimeMillis()) + trueFileName = firstFile + idTime + oldName; + //上传图片 + imgs[t].transferTo(new File( pictureUrl+path2 + pathType + trueFileName)); + entity.setId(idTime); + entity.setCreater(username); + entity.setCreateTime(nowTime); + entity.setEffective(1); + entity.setMaxPicture(picSrc + path2 + pathType + trueFileName); + //插入记录 + emrPictureService.insertSel(entity); } + t++; } } else { //得到图片名 String oldName = imgs[t].getOriginalFilename();// 如apple1.jpg - String lasName = oldName.substring(oldName.lastIndexOf(".") + 1); - if ("GIF".equals(lasName.toUpperCase()) || "JPEG".equals(lasName.toUpperCase()) || "PNG".equals(lasName.toUpperCase()) || "JPG".equals(lasName.toUpperCase())) { + String lasName= null; + if (oldName != null) { + lasName = oldName.substring(oldName.lastIndexOf(".") + 1); + } + if (lasName != null && ("GIF".equals(lasName.toUpperCase()) || "JPEG".equals(lasName.toUpperCase()) || "PNG".equals(lasName.toUpperCase()) || "JPG".equals(lasName.toUpperCase()))) { // 自定义的文件名称String.valueOf(System.currentTimeMillis()) trueFileName = firstFile + idTime + oldName; //上传图片 - imgs[t].transferTo(new File( pictureUrl+path2 + pathType + trueFileName)); + imgs[t].transferTo(new File(pictureUrl + path2 + pathType + trueFileName)); + //新的图片地址 + entity.setMaxPicture(picSrc + path2 + pathType + trueFileName); entity.setId(idTime); entity.setCreater(username); entity.setCreateTime(nowTime); entity.setEffective(1); - entity.setMaxPicture(picSrc + path2 + pathType + trueFileName); //插入记录 - bol = emrPictureService.insertSel(entity); + emrPictureService.insertSel(entity); } - t++; + t = t + 1; } - } else { - //得到图片名 - String oldName = imgs[t].getOriginalFilename();// 如apple1.jpg - String lasName= null; - if (oldName != null) { - lasName = oldName.substring(oldName.lastIndexOf(".") + 1); + //根据类别生成pdf:pathType(String.valueOf(System.currentTimeMillis()) ) + String pdfFile = pathType.replace("\\", "") + ".pdf"; + //根据病案号和类别查询是否存在 + Archive_Detail detail = new Archive_Detail(); + detail.setMasterid(masterId); + detail.setAssortid(pathType.replace("\\","")); + detail.setPdfPath(pictureUrl + "\\pdfFiles\\" + masterId + "\\"+ pathType.replace("\\", "")+"\\" + pathType.replace("\\", ".pdf")); + List voList=archiveDetailService.selectByColm(detail); + //pdf存在则删除记录和文件 + if(voList.size()<=0){ + //不存在添加记录和转换pdf + detail.setFlag("0");//显示 + detail.setSource("后台"); + detail.setSys("emr_medical_record"); + detail.setUploaddatetime(nowTime); + detail.setPdfPath(pictureUrl + "\\pdfFiles\\" + masterId + "\\" + pathType + pdfFile); + archiveDetailService.insertSel(detail); } - if (lasName != null && ("GIF".equals(lasName.toUpperCase()) || "JPEG".equals(lasName.toUpperCase()) || "PNG".equals(lasName.toUpperCase()) || "JPG".equals(lasName.toUpperCase()))) { - // 自定义的文件名称String.valueOf(System.currentTimeMillis()) - trueFileName = firstFile + idTime + oldName; - //上传图片 - imgs[t].transferTo(new File(pictureUrl + path2 + pathType + trueFileName)); - //新的图片地址 - entity.setMaxPicture(picSrc + path2 + pathType + trueFileName); - entity.setId(idTime); - entity.setCreater(username); - entity.setCreateTime(nowTime); - entity.setEffective(1); - //插入记录 - bol = emrPictureService.insertSel(entity); + //判断pdf是否存在,将之前文件删除 + File file1 = new File(pictureUrl + "\\pdfFiles\\" + masterId + "\\" + pathType + pdfFile); + if (file1.exists() && file1.isFile()) { + file1.delete(); } - t = t + 1; - } - //根据类别生成pdf:pathType(String.valueOf(System.currentTimeMillis()) ) - String pdfFile = pathType.replace("\\", "") + ".pdf"; - //根据病案号和类别查询是否存在 - Archive_Detail detail = new Archive_Detail(); - detail.setMasterid(masterId); - detail.setAssortid(pathType.replace("\\","")); - detail.setPdfPath(pictureUrl + "\\pdfFiles\\" + masterId + "\\"+ pathType.replace("\\", "")+"\\" + pathType.replace("\\", ".pdf")); - List voList=archiveDetailService.selectByColm(detail); - //pdf存在则删除记录和文件 - if(voList.size()<=0){ - //不存在添加记录和转换pdf - detail.setFlag("0");//显示 - detail.setSource("后台"); - detail.setSys("emr_medical_record"); - detail.setUploaddatetime(nowTime); - detail.setPdfPath(pictureUrl + "\\pdfFiles\\" + masterId + "\\" + pathType + pdfFile); - int b = archiveDetailService.insertSel(detail); - } - //判断pdf是否存在,将之前文件删除 - File file1 = new File(pictureUrl + "\\pdfFiles\\" + masterId + "\\" + pathType + pdfFile); - if (file1.exists() && file1.isFile()) { - file1.delete(); + //读取指定路径下的文件名和目录名 + List arr = new ArrayList(); + arr.add(pathType.replace("\\", "")); + //图片转PDF(病案号文件夹+类别文件夹) + PrintToPdfUtil.toPdf(pictureUrl + path2 + pathType, pictureUrl + "\\pdfFiles\\" + masterId + "\\" + pathType + pdfFile, arr); + result = "批量上传成功!"; + } catch (IOException | IllegalStateException e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); } - //读取指定路径下的文件名和目录名 - List arr = new ArrayList(); - arr.add(pathType.replace("\\", "")); - //图片转PDF(病案号文件夹+类别文件夹) - PrintToPdfUtil.toPdf(pictureUrl + path2 + pathType, pictureUrl + "\\pdfFiles\\" + masterId + "\\" + pathType + pdfFile, arr); - result = "批量上传成功!"; } else { result = "没有找到相对应的文件!"; } @@ -696,10 +661,9 @@ public class inHospitalController { */ @ResponseBody @RequestMapping(value = "/uploadImg", method = RequestMethod.POST) - public String uploadImg(HttpServletResponse resp, HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file) throws IOException { + public String uploadImg(HttpServletResponse resp, HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file){ resp.setContentType("text/json"); resp.setCharacterEncoding("utf-8"); - request.setCharacterEncoding("utf-8"); String firstFile = request.getParameter("fileName"); String id = request.getParameter("id"); String masterId = request.getParameter("masterID"); @@ -736,7 +700,7 @@ public class inHospitalController { path2= path2+ assortId+"\\"; } //图片id - if (id != null && id != "") { + if (id != null && !"".equals(id)) { path2 = path2 + id + "\\"; }else{ path2 = path2 + idTime + "\\"; @@ -761,41 +725,46 @@ public class inHospitalController { String username = (String) session.getAttribute("userSession");//获取前面登录的用户名 entity.setUpdater(username); int bol = 0; - if (StringUtils.isNotBlank(id)) { - Emr_Picture pic = new Emr_Picture(); - pic.setTypeFlag(id); - List list = emrPictureService.selectByClo(pic); - entity.setTypeFlag(id); - if(list.size()>0){ - //将之前文件删除 - File file1 = new File(realPath + "/static" + list.get(0).getMaxPicture().split("static")[1]); - if (file1.exists() && file1.isFile()) { - file1.delete(); + try { + if (StringUtils.isNotBlank(id)) { + Emr_Picture pic = new Emr_Picture(); + pic.setTypeFlag(id); + List list = emrPictureService.selectByClo(pic); + entity.setTypeFlag(id); + if(list.size()>0){ + //将之前文件删除 + File file1 = new File(realPath + "/static" + list.get(0).getMaxPicture().split("static")[1]); + if (file1.exists() && file1.isFile()) { + file1.delete(); + } + //根据id修改记录 + bol = emrPictureService.updateCloByIdOrFlay(entity); + }else{ + entity.setId(idTime); + entity.setCreater(username); + entity.setCreateTime(nowTime); + entity.setEffective(1); + //插入记录 + emrPictureService.insertSel(entity); } - //根据id修改记录 - bol = emrPictureService.updateCloByIdOrFlay(entity); - }else{ + } else { entity.setId(idTime); entity.setCreater(username); entity.setCreateTime(nowTime); entity.setEffective(1); //插入记录 bol = emrPictureService.insertSel(entity); + if (bol == 1) { + //文件成功上传到指定目录下 + file.transferTo(new File(path)); + result = entity.getMaxPicture(); + } else { + result = "保存文件信息失败!"; + } } - } else { - entity.setId(idTime); - entity.setCreater(username); - entity.setCreateTime(nowTime); - entity.setEffective(1); - //插入记录 - bol = emrPictureService.insertSel(entity); - } - if (bol == 1) { - //文件成功上传到指定目录下 - file.transferTo(new File(path)); - result = entity.getMaxPicture(); - } else { - result = "保存文件信息失败!"; + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); } } else { result = "文件类型有误,请重新上传!"; @@ -819,10 +788,9 @@ public class inHospitalController { * @throws IOException */ @RequestMapping(value = "/uploadPdf", method = RequestMethod.POST) - public String uploadPdf(HttpServletResponse resp, HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file) throws IOException { + public String uploadPdf(HttpServletResponse resp, HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file){ resp.setContentType("text/json"); resp.setCharacterEncoding("utf-8"); - request.setCharacterEncoding("utf-8"); String firstFile = request.getParameter("fileName"); String id = request.getParameter("id"); String masterId = request.getParameter("masterID"); @@ -831,7 +799,6 @@ public class inHospitalController { if (!file.isEmpty()) { // 成功获取照片原名字 String fileName = file.getOriginalFilename(); - String path = null; String type = null; if (fileName != null) { type = fileName.contains(".") ? fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length()) : null; @@ -845,7 +812,7 @@ public class inHospitalController { // 自定义的文件名称String.valueOf(System.currentTimeMillis()) String trueFileName = firstFile + fileName; // 设置存放图片文件的路径 - path = realPath + "\\static\\img\\uploads\\" + trueFileName; + String path = realPath + "\\static\\img\\uploads\\" + trueFileName; SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String nowTime = format1.format(new Date()); @@ -858,29 +825,34 @@ public class inHospitalController { entity.setPdfPath("../static/img/uploads/" + trueFileName); Archive_Detail detail = new Archive_Detail(); int bol = 0; - if (StringUtils.isNotBlank(id)) { - entity.setId(id); - detail = archiveDetailService.selectByid(id); - if (detail != null) { - - //根据id修改记录 - bol = archiveDetailService.updateCloById(entity); + try { + if (StringUtils.isNotBlank(id)) { + entity.setId(id); + detail = archiveDetailService.selectByid(id); + if (detail != null) { + + //根据id修改记录 + bol = archiveDetailService.updateCloById(entity); + } + } else { + //插入记录 + bol = archiveDetailService.insertSel(entity); } - } else { - //插入记录 - bol = archiveDetailService.insertSel(entity); - } - if (bol == 1) { - //将之前文件删除 - File file1 = new File(realPath + "/static/uploads/" + detail.getPdfPath().split("/")[3]); - if (file1.exists() && file1.isFile()) { - file1.delete(); + if (bol == 1) { + //将之前文件删除 + File file1 = new File(realPath + "/static/uploads/" + detail.getPdfPath().split("/")[3]); + if (file1.exists() && file1.isFile()) { + file1.delete(); + } + file.transferTo(new File(path)); + //文件成功上传到指定目录下 + result = entity.toString(); + } else { + result = "保存文件信息失败!"; } - file.transferTo(new File(path)); - //文件成功上传到指定目录下 - result = entity.toString(); - } else { - result = "保存文件信息失败!"; + } catch (IOException e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); } } else { result = "文件类型有误,请重新上传!"; diff --git a/src/main/java/com/emr/controller/lastVerifyController.java b/src/main/java/com/emr/controller/lastVerifyController.java index 07551c3..8cb953f 100644 --- a/src/main/java/com/emr/controller/lastVerifyController.java +++ b/src/main/java/com/emr/controller/lastVerifyController.java @@ -10,11 +10,11 @@ import com.emr.entity.*; import com.emr.service.Archive_MasterService; import com.emr.service.Emr_Fault_DetailService; import com.emr.service.Emr_Fault_TypeService; +import com.emr.util.ExceptionPrintUtil; import com.emr.util.ExportExcelUtil; import com.emr.util.Msg; 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; @@ -36,7 +36,7 @@ public class lastVerifyController { private Emr_Fault_DetailService emrFaultDetailService; @RequestMapping(value = "/lastVerifys") - public String faults(Model model){ + public String faults(){ return "lastVerifyDir/lastVerifyList"; } @@ -52,13 +52,18 @@ public class lastVerifyController { archiveMasterVo.setStartDateTo(null); archiveMasterVo.setEndDateTo(null); } - OffsetLimitPage result = archiveMasterService.selectByLast(archiveMasterVo, offset, limit); - return result; + try { + return archiveMasterService.selectByLast(archiveMasterVo, offset, limit); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @ResponseBody @RequestMapping(value = "/exportExcel") - public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo,Integer isSearch) throws Exception { + public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo,Integer isSearch){ //判断是否是初始化查询,是初始化查询把开始结束时间置空 if(isSearch == 0){ archiveMasterVo.setStartDateTo(null); @@ -66,30 +71,47 @@ public class lastVerifyController { } String tableThNames = "住院号,住院次数,名字,性别,出院科室,出院日期,主管医生,状态"; String fieldCns = "inpNo,visitId,name,sex,deptName,dischargeDateTime,doctorInCharge,status"; - //构造excel的数据 - List list = archiveMasterService.selectLastVerifyList(archiveMasterVo); - - //文件名 - String fileName = "病案室终审" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; - //ExportExcelUtil - ExportExcelUtil exportExcelUtil = new ExportExcelUtil(); - response.setContentType("application/ms-excel;charset=gbk"); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames, fieldCns, list, fileName, response); + try { + //构造excel的数据 + List list = archiveMasterService.selectLastVerifyList(archiveMasterVo); + + //文件名 + String fileName = "病案室终审" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; + //ExportExcelUtil + ExportExcelUtil exportExcelUtil = new ExportExcelUtil(); + response.setContentType("application/ms-excel;charset=gbk"); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames, fieldCns, list, fileName, response); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } } @ResponseBody @RequestMapping(value = "/getFaultType") public List getFaultType(Emr_Fault_Type emrFaultType) { - return emrFaultTypeService.selectByCol(emrFaultType); + try { + return emrFaultTypeService.selectByCol(emrFaultType); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @ResponseBody @RequestMapping(value = "/getDetailByArchId") public Emr_Fault_Detail getDetailByArchId(Emr_Fault_Detail emrFaultDetail) { - return emrFaultDetailService.selectByArchiveDetailId(emrFaultDetail); + try { + return emrFaultDetailService.selectByArchiveDetailId(emrFaultDetail); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } /** @@ -110,39 +132,6 @@ public class lastVerifyController { return Msg.success(); } -/* - @ResponseBody - @RequestMapping(value = "/updateDetailByArchivId") - public int updateDetailByArchivId(HttpServletRequest request, HttpServletResponse response, Emr_Fault_Detail emrFaultDetail) { - - //修改病案归档状态:复审退回 - Archive_Master archiveMaster = new Archive_Master(); - archiveMaster.setId(emrFaultDetail.getArchiveDetailId()); - archiveMaster.setArchivestate("复审退回"); - int bol = archiveMasterService.updateByClo(archiveMaster); - - //修改复审内容 - if (bol == 1) { - // 从session获取用户名 - Subject currentUser = SecurityUtils.getSubject(); - Session session = currentUser.getSession(); - String username = (String) session.getAttribute("userSession");//获取前面登录的用户名 - - //参数输入 - SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String nowTime = format1.format(new Date()); - emrFaultDetail.setUpdater(username); - emrFaultDetail.setUpdateTime(nowTime); - //修改复审内容 - //1、查询出该病案的创建时间最近的缺陷记录 - Emr_Fault_Detail entity= emrFaultDetailService.selectByArchiveDetailId(emrFaultDetail); - emrFaultDetail.setId(entity.getId()); - //2、修改缺陷记录 - bol = emrFaultDetailService.updateCloByPrimaryKey(emrFaultDetail); - } - return bol; - } -*/ //终审 @ResponseBody @RequestMapping(value = "/updateStateByArchivId") diff --git a/src/main/java/com/emr/controller/medicalRecallDateController.java b/src/main/java/com/emr/controller/medicalRecallDateController.java index 970039d..c309588 100644 --- a/src/main/java/com/emr/controller/medicalRecallDateController.java +++ b/src/main/java/com/emr/controller/medicalRecallDateController.java @@ -9,6 +9,7 @@ package com.emr.controller; import com.alibaba.fastjson.JSON; import com.emr.entity.OffsetLimitPage; import com.emr.service.ipml.ArchiveCallbackInfoService; +import com.emr.util.ExceptionPrintUtil; import com.emr.util.ExportExcelUtil; import com.emr.vo.ArchiveCallbackInfoVo; import org.springframework.beans.factory.annotation.Autowired; @@ -43,31 +44,42 @@ public class medicalRecallDateController { @ResponseBody @RequestMapping(value = "/recallDateList") public OffsetLimitPage recallDateList(ArchiveCallbackInfoVo callbackInfo, Integer offset, Integer limit) { - return callbackInfoService.selectAll(callbackInfo,offset,limit); + try { + return callbackInfoService.selectAll(callbackInfo,offset,limit); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @ResponseBody @RequestMapping(value = "/exportExcel") - public void exportExcel(HttpServletResponse response,ArchiveCallbackInfoVo callbackInfo) throws Exception { + public void exportExcel(HttpServletResponse response,ArchiveCallbackInfoVo callbackInfo){ String tableThNames = "住院号,住院次数,姓名,出院科室,召回人,召回时间,召回原因,状态,归档状态"; String fieldCns = "inpNo,visitId,name,deptName,callbackUserName,startDate,callbackReason,status,archivestate"; - List list = callbackInfoService.selectCallBackInfo(callbackInfo); - SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - if(!CollectionUtils.isEmpty(list)){ - for(ArchiveCallbackInfoVo callbackInfoVo : list){ - Date callbackTime = callbackInfoVo.getCallbackTime(); - if(null != callbackTime){ - String date = fmt.format(callbackTime); - callbackInfoVo.setStartDate(date); + try { + List list = callbackInfoService.selectCallBackInfo(callbackInfo); + SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + if(!CollectionUtils.isEmpty(list)){ + for(ArchiveCallbackInfoVo callbackInfoVo : list){ + Date callbackTime = callbackInfoVo.getCallbackTime(); + if(null != callbackTime){ + String date = fmt.format(callbackTime); + callbackInfoVo.setStartDate(date); + } } } + //文件名 + String fileName = "召回记录" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; + //ExportExcelUtil + ExportExcelUtil exportExcelUtil = new ExportExcelUtil(); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); } - //文件名 - String fileName = "召回记录" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; - //ExportExcelUtil - ExportExcelUtil exportExcelUtil = new ExportExcelUtil(); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response); } @ResponseBody @@ -75,8 +87,14 @@ public class medicalRecallDateController { public String lastBylogTitle(String id) { ArchiveCallbackInfoVo vo = new ArchiveCallbackInfoVo(); vo.setMasterId(id); - List callbackInfoVos = callbackInfoService.selectCallBackInfo(vo); - return JSON.toJSONString(callbackInfoVos.get(0)); + try { + List callbackInfoVos = callbackInfoService.selectCallBackInfo(vo); + return JSON.toJSONString(callbackInfoVos.get(0)); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } } diff --git a/src/main/java/com/emr/controller/unfileMedicalController.java b/src/main/java/com/emr/controller/unfileMedicalController.java index 62a2c61..0ee302c 100644 --- a/src/main/java/com/emr/controller/unfileMedicalController.java +++ b/src/main/java/com/emr/controller/unfileMedicalController.java @@ -9,6 +9,7 @@ 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.ExceptionPrintUtil; import com.emr.util.ExportExcelUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -38,13 +39,19 @@ public class unfileMedicalController { archiveMasterVo.setStartDateTo(null); archiveMasterVo.setEndDateTo(null); } - return archiveMasterService.selectByUnfile(archiveMasterVo, offset, limit); + try { + return archiveMasterService.selectByUnfile(archiveMasterVo, offset, limit); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + return null; + } } @ResponseBody @RequestMapping(value = "/exportExcel") - public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo,Integer isSearch) throws Exception { + public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo,Integer isSearch){ String tableThNames = "住院号,住院次数,姓名,性别,入院科室,入院日期,出院科室,出院日期,主管医生,状态"; String fieldCns = "inpNo,visitId,name,sex,deptAdmissionTo,admissionDateTime,deptName,dischargeDateTime,doctorInCharge,status"; //构造excel的数据 @@ -53,13 +60,18 @@ public class unfileMedicalController { archiveMasterVo.setStartDateTo(null); archiveMasterVo.setEndDateTo(null); } - List list = archiveMasterService.selectByUnfile(archiveMasterVo); - //文件名 - String fileName = "未归档病历列表" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; - //ExportExcelUtil - ExportExcelUtil exportExcelUtil = new ExportExcelUtil(); - //导出excel的操作 - exportExcelUtil.expordExcel(tableThNames, fieldCns, list, fileName, response); + try { + List list = archiveMasterService.selectByUnfile(archiveMasterVo); + //文件名 + String fileName = "未归档病历列表" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; + //ExportExcelUtil + ExportExcelUtil exportExcelUtil = new ExportExcelUtil(); + //导出excel的操作 + exportExcelUtil.expordExcel(tableThNames, fieldCns, list, fileName, response); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } } } diff --git a/src/main/java/com/emr/service/Archive_MasterService.java b/src/main/java/com/emr/service/Archive_MasterService.java index e3df236..3a1e566 100644 --- a/src/main/java/com/emr/service/Archive_MasterService.java +++ b/src/main/java/com/emr/service/Archive_MasterService.java @@ -30,14 +30,6 @@ public interface Archive_MasterService { */ List selectByCol(Archive_Master_Vo archiveMasterVo); - /** - * 根据条件查找病案终审列表分页 - * - * @param archiveMasterVo - * @return - */ - List selectByLast(Archive_Master_Vo archiveMasterVo); - /** * 根据条件查找'归档中','复审退回'病案列表 * diff --git a/src/main/java/com/emr/service/Emr_Fault_DetailService.java b/src/main/java/com/emr/service/Emr_Fault_DetailService.java index e36247d..1ab4c25 100644 --- a/src/main/java/com/emr/service/Emr_Fault_DetailService.java +++ b/src/main/java/com/emr/service/Emr_Fault_DetailService.java @@ -20,21 +20,14 @@ public interface Emr_Fault_DetailService { * @param limit * @return */ - OffsetLimitPage selectByCol(Emr_Fault_Vo emrFaultVo, Integer offset, Integer limit); + OffsetLimitPage selectByCol(Emr_Fault_Vo emrFaultVo, Integer offset, Integer limit) throws Exception; /** * 根据查询条件导出 * @param emrFaultVo * @return */ - List selectByCol(Emr_Fault_Vo emrFaultVo); - - /** - * 根据id修改相应的字段 - * @param emrFaultDetail - * @return - */ - int updateCloByPrimaryKey(Emr_Fault_Detail emrFaultDetail); + List selectByCol(Emr_Fault_Vo emrFaultVo) throws Exception; /** * 根据病案号查询缺陷退回审核内容 diff --git a/src/main/java/com/emr/service/ipml/ArchiveCallbackInfoService.java b/src/main/java/com/emr/service/ipml/ArchiveCallbackInfoService.java index 8d56dbd..4f9947f 100644 --- a/src/main/java/com/emr/service/ipml/ArchiveCallbackInfoService.java +++ b/src/main/java/com/emr/service/ipml/ArchiveCallbackInfoService.java @@ -77,7 +77,7 @@ public class ArchiveCallbackInfoService { callbackInfoMapper.deleteRecordByRecall(masterId); } - private String getAddressIp(){ + private String getAddressIp() throws Exception{ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); // 获取访问真实IP String ipAddress = request.getHeader("x-forwarded-for"); @@ -91,12 +91,7 @@ public class ArchiveCallbackInfoService { ipAddress = request.getRemoteAddr(); if(ipAddress.equals("127.0.0.1") || ipAddress.equals("0:0:0:0:0:0:0:1")){ //根据网卡取本机配置的IP - InetAddress inet=null; - try { - inet = InetAddress.getLocalHost(); - } catch (UnknownHostException e) { - e.printStackTrace(); - } + InetAddress inet = InetAddress.getLocalHost(); ipAddress= inet.getHostAddress(); } } @@ -116,13 +111,13 @@ public class ArchiveCallbackInfoService { * @param limit * @return */ - public OffsetLimitPage selectAll(ArchiveCallbackInfoVo callbackInfoVo, Integer offset, Integer limit) { + public OffsetLimitPage selectAll(ArchiveCallbackInfoVo callbackInfoVo, Integer offset, Integer limit) throws Exception{ PageHelper.offsetPage(offset, limit); List list = selectCallBackInfo(callbackInfoVo); return new OffsetLimitPage((Page) list); } - public List selectCallBackInfo(ArchiveCallbackInfoVo callbackInfoVo){ + public List selectCallBackInfo(ArchiveCallbackInfoVo callbackInfoVo) throws Exception{ List list = callbackInfoMapper.selectAll(callbackInfoVo); if (!CollectionUtils.isEmpty(list)) { //转换状态 diff --git a/src/main/java/com/emr/service/ipml/ArchiveFlowInfoService.java b/src/main/java/com/emr/service/ipml/ArchiveFlowInfoService.java index 2c97846..33c98bf 100644 --- a/src/main/java/com/emr/service/ipml/ArchiveFlowInfoService.java +++ b/src/main/java/com/emr/service/ipml/ArchiveFlowInfoService.java @@ -5,11 +5,9 @@ import com.emr.dao.ArchiveFlowRoleMapper; import com.emr.dao.Archive_MasterMapper; import com.emr.dao.EmrHolidaySetMapper; import com.emr.entity.*; -import com.emr.service.Emr_Fault_DetailService; import com.emr.service.Emr_Fault_TypeService; import com.emr.vo.ArchiveFlowInfoVo; import com.emr.vo.User; -import com.github.pagehelper.PageHelper; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.SecurityUtils; import org.apache.shiro.util.CollectionUtils; @@ -198,7 +196,7 @@ public class ArchiveFlowInfoService { * @param id * @return */ - public List selectFlowInfoByMasterId(String id) { + public List selectFlowInfoByMasterId(String id) throws Exception{ List list = flowInfoMapper.selectFlowInfoByMasterId(id); if(!CollectionUtils.isEmpty(list)) { //获取缺陷类别列表 @@ -208,8 +206,7 @@ public class ArchiveFlowInfoService { List userList = statisticsService.getUserList(); //替换姓名 if (!CollectionUtils.isEmpty(userList)) { - for (int i = 0;i selectFlowInfoList(ArchiveFlowInfoVo flowInfoVo,String sql) { + public List selectFlowInfoList(ArchiveFlowInfoVo flowInfoVo,String sql) throws Exception{ //模糊搜索审核姓名转换工号 String checkName = flowInfoVo.getUserName(); if(StringUtils.isNoneBlank(checkName)){ //转换姓名 List userList = statisticsService.getUserList(); - String checkNames = ""; + StringBuilder checkNames = new StringBuilder(); for(User user:userList){ if(StringUtils.isNoneBlank(user.getName()) && user.getName().contains(checkName)){ - checkNames += "'" + user.getUserName() + "',"; + checkNames.append("'").append(user.getUserName()).append("',"); } } if(StringUtils.isNotBlank(checkNames)){ - checkNames = checkNames.substring(0,checkNames.length()-1); - flowInfoVo.setUserName(checkNames); + checkNames = new StringBuilder(checkNames.substring(0,checkNames.length()-1)); + flowInfoVo.setUserName(checkNames.toString()); }else{ flowInfoVo.setUserName("'" + checkName + "'"); } @@ -271,8 +268,7 @@ public class ArchiveFlowInfoService { if(!CollectionUtils.isEmpty(list)) { List userList = statisticsService.getUserList(); if (!CollectionUtils.isEmpty(userList)) { - for (int i = 0; i < list.size(); i++) { - ArchiveFlowInfoVo infoVo = list.get(i); + for (ArchiveFlowInfoVo infoVo : list) { //转换姓名 String userName = infoVo.getUserName(); for (User user : userList) { diff --git a/src/main/java/com/emr/service/ipml/Archive_DetailServiceImpl.java b/src/main/java/com/emr/service/ipml/Archive_DetailServiceImpl.java index 168ecb1..541d0db 100644 --- a/src/main/java/com/emr/service/ipml/Archive_DetailServiceImpl.java +++ b/src/main/java/com/emr/service/ipml/Archive_DetailServiceImpl.java @@ -77,49 +77,41 @@ public class Archive_DetailServiceImpl implements Archive_DetailService { @Override public void getPdfToPdf(HttpServletResponse response, String imgStr, String masterId,String pdfWater) { - if (masterId != "" && masterId != null) { + if (StringUtils.isNotBlank(masterId)) { //获取废除的pdf文件名列表archive_detail List pdfList = new ArrayList(); Archive_Detail archiveDetail = new Archive_Detail(); archiveDetail.setFlag("0"); archiveDetail.setMasterid(masterId.trim()); archiveDetail.setTitle(imgStr); - try { - List arList = selectByCol(archiveDetail); - if (arList != null && !arList.isEmpty()) { - for (int m = 0; m < arList.size(); m++) { - String str = arList.get(m).getPdfPath(); - if (StringUtils.isNoneBlank(str)) { - pdfList.add(str); - } + List arList = selectByCol(archiveDetail); + if (arList != null && !arList.isEmpty()) { + for (Archive_Detail detail : arList) { + String str = detail.getPdfPath(); + if (StringUtils.isNoneBlank(str)) { + pdfList.add(str); } } - Jpg2PdfUtil.mulFile2One(response, pdfList, pdfWater); - } catch (Exception e) { - e.printStackTrace(); } + Jpg2PdfUtil.mulFile2One(response, pdfList, pdfWater); } } @Override public void selectPdfPathByIds(HttpServletResponse response, String detailIds, String masterId,String pdfWater) { - if (masterId != "" && masterId != null) { + if (StringUtils.isNotBlank(masterId)) { //获取废除的pdf文件名列表archive_detail List pdfList = new ArrayList(); - try { - List arList = archiveDetailMapper.selectPdfPathByIds(masterId,detailIds); - if (arList != null && !arList.isEmpty()) { - for (int m = 0; m < arList.size(); m++) { - String str = arList.get(m).getPdfPath(); - if (StringUtils.isNoneBlank(str)) { - pdfList.add(str); - } + List arList = archiveDetailMapper.selectPdfPathByIds(masterId,detailIds); + if (arList != null && !arList.isEmpty()) { + for (Archive_Detail detail : arList) { + String str = detail.getPdfPath(); + if (StringUtils.isNoneBlank(str)) { + pdfList.add(str); } } - Jpg2PdfUtil.mulFile2One(response, pdfList, pdfWater); - } catch (Exception e) { - e.printStackTrace(); } + Jpg2PdfUtil.mulFile2One(response, pdfList, pdfWater); } } diff --git a/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java b/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java index 3b0f321..4c62037 100644 --- a/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java +++ b/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java @@ -132,18 +132,18 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { //计算属于哪种审核角色 Msg role = getRole(); if(null != role) { - for (int i = 0; i < list.size(); i++) { - String archivestate = list.get(i).getArchivestate(); + for (Archive_Master_Vo master_vo : list) { + String archivestate = master_vo.getArchivestate(); if (StringUtils.isNotBlank(archivestate)) { //转换中文状态 boolean numeric = isNumeric(archivestate); - if(numeric) { + if (numeric) { Integer status = Integer.valueOf(archivestate); archivestate = EnumVerify.DocState.GetStepName(status, role.getCode()); - list.get(i).setStatus(archivestate); + master_vo.setStatus(archivestate); //获取审核按钮和退回按钮集合 - String btns = getBtns(status, flowRoles, list.get(i).getId()); - list.get(i).setBtns(btns); + String btns = getBtns(status, flowRoles, master_vo.getId()); + master_vo.setBtns(btns); } } } @@ -198,24 +198,24 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { //计算属于哪种审核角色 Msg role = getRole(); if(null != role) { - for (int i = 0; i < list.size(); i++) { - String archivestate = list.get(i).getArchivestate(); - String dischargeDateTime = list.get(i).getDischargeDateTime(); + for (Archive_Master_Vo master_vo : list) { + String archivestate = master_vo.getArchivestate(); + String dischargeDateTime = master_vo.getDischargeDateTime(); //年份是1801定义为在院 //定义是否是在院病历 boolean flag = false; - if(StringUtils.isNotBlank(dischargeDateTime) && dischargeDateTime.length() >= 4){ + if (StringUtils.isNotBlank(dischargeDateTime) && dischargeDateTime.length() >= 4) { String year = dischargeDateTime.substring(0, 4); - if("1801".equals(year)){ + if ("1801".equals(year)) { flag = true; - list.get(i).setStatus("在院"); + master_vo.setStatus("在院"); } } if (StringUtils.isNotBlank(archivestate) && !flag) { //转换中文状态 Integer status = Integer.valueOf(archivestate); archivestate = EnumVerify.DocState.GetStepName(status, role.getCode()); - list.get(i).setStatus(archivestate); + master_vo.setStatus(archivestate); } } } @@ -223,11 +223,6 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { return list; } - @Override - public List selectByLast(Archive_Master_Vo archiveMasterVo) { - return archiveMasterMapper.selectByLast(archiveMasterVo); - } - /** * 获取审核按钮和退回按钮集合 * */ @@ -339,7 +334,7 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { //护士长 String masterId = '"' + id + '"'; //定义下个节点code - Integer targetCode = 0; + int targetCode = 0; if(!EnumVerify.DocState.HasCurrentState(status,EnumVerify.DocState.HeadNurseCheck)){ //判断是否护士长审核 boolean headNurseCheckFlag = getHeadNurseCheckFlag(status,roles); @@ -721,41 +716,41 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { String nurseCheckSumbit = "/beHosp/nurseCheckSumbit"; int genegrateRole = 0; //拼接有权限的code - String powerCode = ""; + StringBuilder powerCode = new StringBuilder(); Integer role = 0; //遍历,判断拥有权限,拥有护士长权限立即返回4,拥有医生支线赋值doctorRole=1,拥有护士支线赋值nurseRole=1 for (String menu : menus) { if(StringUtils.isNotBlank(menu)){ if(menu.equals(doctorSumbit)){ doctorRole = 1; - powerCode += EnumVerify.DocState.DortorSubmit.getCode() + ","; + powerCode.append(EnumVerify.DocState.DortorSubmit.getCode()).append(","); } if(menu.equals(doctorCheckSumbit)){ doctorRole = 1; - powerCode += EnumVerify.DocState.DortorCheck.getCode() + ","; + powerCode.append(EnumVerify.DocState.DortorCheck.getCode()).append(","); } if(menu.equals(directorCheckSumbit)){ doctorRole = 1; - powerCode += EnumVerify.DocState.DirectorCheck.getCode() + ","; + powerCode.append(EnumVerify.DocState.DirectorCheck.getCode()).append(","); } if(menu.equals(nurseSumbit)){ nurseRole = 1; - powerCode += EnumVerify.DocState.NurseSubmit.getCode() + ","; + powerCode.append(EnumVerify.DocState.NurseSubmit.getCode()).append(","); } if(menu.equals(nurseCheckSumbit)){ nurseRole = 1; - powerCode += EnumVerify.DocState.NurseCheck.getCode() + ","; + powerCode.append(EnumVerify.DocState.NurseCheck.getCode()).append(","); } if(menu.equals(headNurseCheck)){ genegrateRole = 1; - powerCode += EnumVerify.DocState.HeadNurseCheck.getCode() + ","; + powerCode.append(EnumVerify.DocState.HeadNurseCheck.getCode()).append(","); } } } - if(powerCode.endsWith(",")){ - powerCode = powerCode.substring(0,powerCode.length()-1); + if(powerCode.toString().endsWith(",")){ + powerCode = new StringBuilder(powerCode.substring(0, powerCode.length() - 1)); } - msg.setMsg(powerCode); + msg.setMsg(powerCode.toString()); //判断属于哪个支线权限 if(doctorRole == 1 && nurseRole == 0){ msg.setCode(1); diff --git a/src/main/java/com/emr/service/ipml/Emr_Archive_DetailServiceImpl.java b/src/main/java/com/emr/service/ipml/Emr_Archive_DetailServiceImpl.java index ba215e1..8e143a5 100644 --- a/src/main/java/com/emr/service/ipml/Emr_Archive_DetailServiceImpl.java +++ b/src/main/java/com/emr/service/ipml/Emr_Archive_DetailServiceImpl.java @@ -6,16 +6,11 @@ */ package com.emr.service.ipml; -import com.emr.dao.Emr_Archive_DetailMapper; import com.emr.service.Emr_Archive_DetailService; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class Emr_Archive_DetailServiceImpl implements Emr_Archive_DetailService { - - @Autowired - private Emr_Archive_DetailMapper emrArchiveDetailMapper; } - + diff --git a/src/main/java/com/emr/service/ipml/Emr_DictionaryServiceImpl.java b/src/main/java/com/emr/service/ipml/Emr_DictionaryServiceImpl.java index f89462a..d658046 100644 --- a/src/main/java/com/emr/service/ipml/Emr_DictionaryServiceImpl.java +++ b/src/main/java/com/emr/service/ipml/Emr_DictionaryServiceImpl.java @@ -6,7 +6,6 @@ */ package com.emr.service.ipml; -import com.emr.dao.Emr_Archive_DetailMapper; import com.emr.dao.Emr_DictionaryMapper; import com.emr.entity.Emr_Dictionary; import com.emr.service.Emr_DictionaryService; diff --git a/src/main/java/com/emr/service/ipml/Emr_Fault_DetailServiceImpl.java b/src/main/java/com/emr/service/ipml/Emr_Fault_DetailServiceImpl.java index 79db32b..c62949a 100644 --- a/src/main/java/com/emr/service/ipml/Emr_Fault_DetailServiceImpl.java +++ b/src/main/java/com/emr/service/ipml/Emr_Fault_DetailServiceImpl.java @@ -48,14 +48,13 @@ public class Emr_Fault_DetailServiceImpl implements Emr_Fault_DetailService { * @return */ @Override - public OffsetLimitPage selectByCol(Emr_Fault_Vo emrFaultVo, Integer offset, Integer limit) { + public OffsetLimitPage selectByCol(Emr_Fault_Vo emrFaultVo, Integer offset, Integer limit) throws Exception{ PageHelper.offsetPage(offset, limit); List list = selectByCol(emrFaultVo); return new OffsetLimitPage((Page) list); } - @Override - public List selectByCol(Emr_Fault_Vo emrFaultVo) { + public List selectByCol(Emr_Fault_Vo emrFaultVo) throws Exception{ List list = emrFaultDetailMapper.selectByCol(emrFaultVo); Emr_Dictionary dic = new Emr_Dictionary(); dic.setEffective(1); @@ -69,51 +68,51 @@ public class Emr_Fault_DetailServiceImpl implements Emr_Fault_DetailService { Msg role = archiveMasterService.getRole(); List userList = statisticsService.getUserList(); if(null != role) { - for (int i = 0; i < list.size(); i++) { + for (Emr_Fault_Vo emr_fault_vo : list) { //根据状态code转换状态及判断显示按钮 //计算属于哪种审核角色 - String archivestate = list.get(i).getArchivestate(); + String archivestate = emr_fault_vo.getArchivestate(); if (StringUtils.isNotBlank(archivestate)) { //转换中文状态 Integer status = Integer.valueOf(archivestate); archivestate = EnumVerify.DocState.GetStepName(status, role.getCode()); - list.get(i).setArchivestate(archivestate); + emr_fault_vo.setArchivestate(archivestate); } //替换科室 - for (int k = 0; k < dicList.size(); k++) { - String deptName = list.get(i).getDeptName(); + for (Emr_Dictionary dictionary : dicList) { + String deptName = emr_fault_vo.getDeptName(); //入院科室dept_admission_to - String dept2 = list.get(i).getDeptAdmissionTo(); + String dept2 = emr_fault_vo.getDeptAdmissionTo(); - if ((deptName != null && deptName.equals(dicList.get(k).getCode())) || (dept2 != null && dept2.equals(dicList.get(k).getCode()))) { + if ((deptName != null && deptName.equals(dictionary.getCode())) || (dept2 != null && dept2.equals(dictionary.getCode()))) { //出院科室 - deptName = deptName.replace(deptName, dicList.get(k).getName()); - list.get(i).setDeptName(deptName); + deptName = deptName.replace(deptName, dictionary.getName()); + emr_fault_vo.setDeptName(deptName); - dept2 = dept2.replace(dept2, dicList.get(k).getName()); - list.get(i).setDeptAdmissionTo(dept2); + dept2 = dept2.replace(dept2, dictionary.getName()); + emr_fault_vo.setDeptAdmissionTo(dept2); } } - String assortId = list.get(i).getAssortId(); - if (assortId != "" && assortId != null) { + String assortId = emr_fault_vo.getAssortId(); + if (StringUtils.isNotBlank(assortId)) { String[] assorArr = assortId.split(","); //替换类别 - for (int j = 0; j < typeLis.size(); j++) { - String id = String.valueOf(typeLis.get(j).getId()); + for (Emr_Fault_Type typeLi : typeLis) { + String id = String.valueOf(typeLi.getId()); if (Arrays.asList(assorArr).contains(id)) { - assortId = assortId.replace(id, typeLis.get(j).getTypeName()); - list.get(i).setAssortId(assortId); + assortId = assortId.replace(id, typeLi.getTypeName()); + emr_fault_vo.setAssortId(assortId); } } } //替换姓名 - if(!CollectionUtils.isEmpty(userList)) { + if (!CollectionUtils.isEmpty(userList)) { //转换姓名 - String userName = list.get(i).getCreater(); + String userName = emr_fault_vo.getCreater(); for (User user : userList) { if (StringUtils.isNotBlank(userName) && userName.equals(user.getUserName())) { - list.get(i).setCreater(user.getName()); + emr_fault_vo.setCreater(user.getName()); break; } } @@ -123,11 +122,6 @@ public class Emr_Fault_DetailServiceImpl implements Emr_Fault_DetailService { return list; } - @Override - public int updateCloByPrimaryKey(Emr_Fault_Detail emrFaultDetail) { - return emrFaultDetailMapper.updateCloByPrimaryKey(emrFaultDetail); - } - @Override public Emr_Fault_Detail selectByArchiveDetailId(Emr_Fault_Detail record) { return emrFaultDetailMapper.selectByArchiveDetailId(record); diff --git a/src/main/java/com/emr/service/ipml/EnumVerify.java b/src/main/java/com/emr/service/ipml/EnumVerify.java index ab2a7e4..9ced380 100644 --- a/src/main/java/com/emr/service/ipml/EnumVerify.java +++ b/src/main/java/com/emr/service/ipml/EnumVerify.java @@ -64,9 +64,6 @@ public class EnumVerify { this.name = name; } - DocState() { - } - public int getCode() { return code; } diff --git a/src/main/java/com/emr/service/ipml/HolidaySetService.java b/src/main/java/com/emr/service/ipml/HolidaySetService.java index 7f5a405..02517f1 100644 --- a/src/main/java/com/emr/service/ipml/HolidaySetService.java +++ b/src/main/java/com/emr/service/ipml/HolidaySetService.java @@ -75,10 +75,10 @@ public class HolidaySetService { //如果存在记录就区分更新部分还是添加部分 if(null != emrHolidaySets && !emrHolidaySets.isEmpty()){ boolean isExist = false; - for (int i = 0; i < emrHolidaySets.size(); i++) { - if(emrHolidaySets.get(i).getDate().equals(date)){ + for (EmrHolidaySet emrHolidaySet : emrHolidaySets) { + if (emrHolidaySet.getDate().equals(date)) { isExist = true; - holidaySet.setId(emrHolidaySets.get(i).getId()); + holidaySet.setId(emrHolidaySet.getId()); break; } } @@ -96,7 +96,7 @@ public class HolidaySetService { } int colCount = holidaySetMapper.selectColByTableName("emr_holiday_set"); int simpleInsertCount = 2100/(colCount); - if(null != insertList && !insertList.isEmpty()){ + if(!insertList.isEmpty()){ List list = new ArrayList<>(); for (int i = 0; i < insertList.size(); i++) { list.add(insertList.get(i)); @@ -106,7 +106,7 @@ public class HolidaySetService { } } } - if(null != updateList && !updateList.isEmpty()){ + if(!updateList.isEmpty()){ List list = new ArrayList<>(); for (int i = 0; i < updateList.size(); i++) { list.add(updateList.get(i)); diff --git a/src/main/java/com/emr/service/ipml/StatisticsService.java b/src/main/java/com/emr/service/ipml/StatisticsService.java index 1939f92..ed2fad7 100644 --- a/src/main/java/com/emr/service/ipml/StatisticsService.java +++ b/src/main/java/com/emr/service/ipml/StatisticsService.java @@ -6,7 +6,6 @@ import com.emr.dao.TUuInfoMapper; import com.emr.dao.TUuPrintMapper; import com.emr.entity.Archive_Master_Vo; import com.emr.entity.OffsetLimitPage; -import com.emr.entity.TUuPrint; import com.emr.vo.*; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; @@ -54,7 +53,7 @@ public class StatisticsService { @Autowired private TUuInfoMapper uuInfoMapper; //终审按天统计 - public List getFinalStatistics(Integer offset, Integer limit, String startDate, String endDate,String sql) { + public List getFinalStatistics(Integer offset, Integer limit, String startDate, String endDate,String sql) throws Exception{ if(null != offset && null != limit){ PageHelper.offsetPage(offset, limit); } @@ -76,7 +75,7 @@ public class StatisticsService { //初审按天统计 - public List getFirstStatistics(HttpServletRequest request, Integer offset, Integer limit, String startDate, String endDate,String sql) { + public List getFirstStatistics(Integer offset, Integer limit, String startDate, String endDate,String sql) throws Exception{ if(null != offset && null != limit){ PageHelper.offsetPage(offset, limit); } @@ -105,7 +104,7 @@ public class StatisticsService { * @param archiveMasterVo * @return */ - public OffsetLimitPage getStatisticsDetail(Integer offset, Integer limit,String disStartDate, String disEndDate, Archive_Master_Vo archiveMasterVo,Integer flag) { + public OffsetLimitPage getStatisticsDetail(Integer offset, Integer limit,String disStartDate, String disEndDate, Archive_Master_Vo archiveMasterVo,Integer flag) throws Exception{ if(null != offset && null != limit){ PageHelper.offsetPage(offset, limit); } @@ -113,21 +112,21 @@ public class StatisticsService { return new OffsetLimitPage((Page) list); } - public List getDetailList(String disStartDate, String disEndDate, Archive_Master_Vo archiveMasterVo,Integer flag,String sql){ + public List getDetailList(String disStartDate, String disEndDate, Archive_Master_Vo archiveMasterVo,Integer flag,String sql) throws Exception{ //转换姓名 List userList = getUserList(); String checkDoctor = archiveMasterVo.getCheckDoctor(); //模糊搜索审核姓名转换工号 if(StringUtils.isNoneBlank(checkDoctor)){ - String checkNames = ""; + StringBuilder checkNames = new StringBuilder(); for(User user:userList){ if(StringUtils.isNoneBlank(user.getName()) && user.getName().contains(checkDoctor)){ - checkNames += "'" + user.getUserName() + "',"; + checkNames.append("'").append(user.getUserName()).append("',"); } } - if(StringUtils.isNotBlank(checkNames)){ - checkNames = checkNames.substring(0,checkNames.length()-1); - archiveMasterVo.setCheckDoctor(checkNames); + if(StringUtils.isNotBlank(checkNames.toString())){ + checkNames = new StringBuilder(checkNames.substring(0, checkNames.length() - 1)); + archiveMasterVo.setCheckDoctor(checkNames.toString()); }else{ archiveMasterVo.setCheckDoctor("'" + checkDoctor + "'"); } @@ -150,8 +149,7 @@ public class StatisticsService { //复印记录报表 public List getPrintCount(TUuPrintSearch search){ - List list = uuPrintMapper.getPrintCount(search); - return list; + return uuPrintMapper.getPrintCount(search); } //复印记录明细 @@ -169,44 +167,36 @@ public class StatisticsService { //扫描记录报表 public List getScanCount(TUuPrintSearch search){ - List list = uuInfoMapper.getScanCount(search); - return list; + return uuInfoMapper.getScanCount(search); } //扫描记录明细 public List getScanInfo(TUuPrintSearch search){ - List list = uuInfoMapper.getScanInfo(search); - return list; + return uuInfoMapper.getScanInfo(search); } - public List getUserList(){ + public List getUserList() throws Exception{ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); - List userList = new ArrayList<>(); - try { - //查询缓存时候存在 - userList = (List)request.getSession().getAttribute("USER_LIST"); - if(null == userList || userList.isEmpty()){ - String userName = (String) request.getSession().getAttribute("userSession"); - //调用接口查询 - String resultString = ""; - // 创建uri - String url = POWER_URLHEAD+"/font/getUserList?userName="+userName; - // 执行请求 - CloseableHttpResponse response = HttpClients.createDefault().execute(new HttpGet(url)); - // 判断返回状态是否为200 - if (response.getStatusLine().getStatusCode() == 200) { - resultString = EntityUtils.toString(response.getEntity(), "UTF-8"); - } - JSONObject jsonObject = JSONObject.fromObject(resultString); - String extend = jsonObject.getString("extend"); - JSONObject extendObject = JSONObject.fromObject(extend); - String userList1 = extendObject.getString("userList"); - userList = (List) JSON.parseArray(userList1,User.class); - //设置进session - request.getSession().setAttribute("USER_LIST",userList); + List userList = (List)request.getSession().getAttribute("USER_LIST"); + if(null == userList || userList.isEmpty()){ + String userName = (String) request.getSession().getAttribute("userSession"); + //调用接口查询 + String resultString = ""; + // 创建uri + String url = POWER_URLHEAD+"/font/getUserList?userName="+userName; + // 执行请求 + CloseableHttpResponse response = HttpClients.createDefault().execute(new HttpGet(url)); + // 判断返回状态是否为200 + if (response.getStatusLine().getStatusCode() == 200) { + resultString = EntityUtils.toString(response.getEntity(), "UTF-8"); } - }catch (Exception e){ - e.printStackTrace(); + JSONObject jsonObject = JSONObject.fromObject(resultString); + String extend = jsonObject.getString("extend"); + JSONObject extendObject = JSONObject.fromObject(extend); + String userList1 = extendObject.getString("userList"); + userList = JSON.parseArray(userList1,User.class); + //设置进session + request.getSession().setAttribute("USER_LIST",userList); } return userList; } diff --git a/src/main/java/com/emr/service/ipml/V_CountServiceImpl.java b/src/main/java/com/emr/service/ipml/V_CountServiceImpl.java index 948154d..b9b93db 100644 --- a/src/main/java/com/emr/service/ipml/V_CountServiceImpl.java +++ b/src/main/java/com/emr/service/ipml/V_CountServiceImpl.java @@ -15,7 +15,6 @@ import com.github.pagehelper.PageHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.Arrays; import java.util.List; @Service @@ -25,8 +24,7 @@ public class V_CountServiceImpl implements V_CountService { @Override public List selectByCol(V_CountVo record) { - List v_counts = vCountMapper.selectByCol(record); - return v_counts; + return vCountMapper.selectByCol(record); } @Override diff --git a/src/main/java/com/emr/util/ActionScopeUtils.java b/src/main/java/com/emr/util/ActionScopeUtils.java deleted file mode 100644 index 90440f6..0000000 --- a/src/main/java/com/emr/util/ActionScopeUtils.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.emr.util; - - -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -/** - * 关于作用域的操作 - * @Author: - * @Date: - * @Version 1.0 - */ -public class ActionScopeUtils { - - public static HttpSession getSession(HttpServletRequest request){ - return request.getSession(); - } - - public static HttpServletRequest getRequest(){ - return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); - } - - public static void setSessionAttribute(String key,Object value){ - getSession(getRequest()).setAttribute(key,value); - } - - public static Object getSessionAttribute(String key){ - return getSession(getRequest()).getAttribute(key); - } - - public static void setRequestAttribute(String key,Object value){ - getRequest().setAttribute(key,value); - } - - public static Object getRequestAttribute(String key){ - return getRequest().getAttribute(key); - } - -} diff --git a/src/main/java/com/emr/util/ExceptionPrintUtil.java b/src/main/java/com/emr/util/ExceptionPrintUtil.java new file mode 100644 index 0000000..d1003b3 --- /dev/null +++ b/src/main/java/com/emr/util/ExceptionPrintUtil.java @@ -0,0 +1,36 @@ +package com.emr.util; + +import org.apache.log4j.Logger; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; + +/** + * @ProjectName: + * @Description: + * @Param 传输参数 + * @Return + * @Author: 曾文和 + * @CreateDate: 2020/8/4 14:18 + * @UpdateUser: 曾文和 + * @UpdateDate: 2020/8/4 14:18 + * @UpdateRemark: 更新说明 + * @Version: 1.0 + */ +public class ExceptionPrintUtil { + private static Logger log = Logger.getLogger("errorMsg"); + public static void printException(Exception e){ + //方法名 + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + e.printStackTrace(new PrintStream(baos)); + String exception = baos.toString(); + log.error(exception); + try { + baos.flush(); + baos.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } +} diff --git a/src/main/java/com/emr/util/ExportExcelUtil.java b/src/main/java/com/emr/util/ExportExcelUtil.java index 351a1c0..93710ed 100644 --- a/src/main/java/com/emr/util/ExportExcelUtil.java +++ b/src/main/java/com/emr/util/ExportExcelUtil.java @@ -10,8 +10,10 @@ import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.util.HSSFColor; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.io.OutputStream; import java.lang.reflect.Field; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -28,20 +30,18 @@ public class ExportExcelUtil { private String fileName; private HSSFWorkbook workBook = null; - public List getFieldName(String tableThNames){ + private List getFieldName(String tableThNames){ String[] names = tableThNames.split(","); List fieldName = new ArrayList<>(); - if (names != null) { - for (int i = 0; i < names.length; i++) { - if (StringUtils.isNoneBlank(names[i])) { - fieldName.add(names[i]); - } + for (String name : names) { + if (StringUtils.isNoneBlank(name)) { + fieldName.add(name); } } return fieldName; } - public List> getFieldData(String fieldCns, Collection list){ + private List> getFieldData(String fieldCns, Collection list){ List> fieldData = new ArrayList>(); String[] fieldList = fieldCns.split(","); Object[] objects = list.toArray(); @@ -56,22 +56,34 @@ public class ExportExcelUtil { } return fieldData; } - public void expordExcel(String tableThNames,String fieldCns,Collection list,String fileName,HttpServletResponse response) throws Exception { - this.fieldName = getFieldName(tableThNames); - this.fieldData = getFieldData(fieldCns,list); + public void expordExcel(String tableThNames,String fieldCns,Collection list,String fileName,HttpServletResponse response){ + fieldName = getFieldName(tableThNames); + fieldData = getFieldData(fieldCns,list); this.fileName = fileName; - OutputStream os = response.getOutputStream(); - response.reset(); - response.setContentType("application/OCTET-STREAM;charset=gbk"); - response.setHeader("pragma", "no-cache"); - fileName = new String(fileName.getBytes("utf-8"), "iso-8859-1"); - response.setHeader("Content-disposition", "attachment;filename=\"" + fileName + "\""); - response.setBufferSize(1024); - workBook = createWorkbook(); - workBook.write(os); - os.close(); + OutputStream os = null; + try { + os = response.getOutputStream(); + response.reset(); + response.setContentType("application/OCTET-STREAM;charset=gbk"); + response.setHeader("pragma", "no-cache"); + fileName = new String(fileName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1); + response.setHeader("Content-disposition", "attachment;filename=\"" + fileName + "\""); + response.setBufferSize(1024); + workBook = createWorkbook(); + workBook.write(os); + } catch (IOException e) { + e.printStackTrace(); + }finally { + try { + if(null != os){ + os.close(); + } + }catch (Exception e){ + e.printStackTrace(); + } + } } - public HSSFWorkbook createWorkbook() { + private HSSFWorkbook createWorkbook() { workBook = new HSSFWorkbook(); int rows = fieldData.size(); int sheetNum = 0; @@ -103,7 +115,7 @@ public class ExportExcelUtil { cell.setCellType(HSSFCell.CELL_TYPE_STRING); if(fieldName.get(j) != null){ cell.setCellStyle(cellStyle); - cell.setCellValue((String) fieldName.get(j)); + cell.setCellValue(fieldName.get(j)); }else{ cell.setCellValue("-"); } @@ -113,15 +125,16 @@ public class ExportExcelUtil { cellStyle1.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); //数字格式 for (int k = 0; k < (rows < SPLIT_COUNT ? rows : SPLIT_COUNT); k++) { - if (((i - 1) * SPLIT_COUNT + k) >= rows) + if (((i - 1) * SPLIT_COUNT + k) >= rows) { break; + } HSSFRow row = sheet.createRow((short) (k + 1)); ArrayList rowList = (ArrayList) fieldData.get((i - 1) * SPLIT_COUNT + k); for (int n = 0; n < rowList.size(); n++) { HSSFCell cell = row.createCell( n); if(rowList.get(n) != null){ cell.setCellStyle(cellStyle1); - cell.setCellValue((String) rowList.get(n).toString()); + cell.setCellValue(rowList.get(n)); }else{ cell.setCellValue(""); } @@ -141,12 +154,12 @@ public class ExportExcelUtil { return workBook; } - public static String fieldToProperty(String field) { + private static String fieldToProperty(String field) { if (null == field) { return ""; } char[] chars = field.toCharArray(); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (int i = 0; i < chars.length; i++) { char c = chars[i]; if (c == '_') { @@ -162,7 +175,7 @@ public class ExportExcelUtil { return sb.toString(); } - public static String getFieldValueByFieldName(String fieldName, Object object) { + private static String getFieldValueByFieldName(String fieldName, Object object) { try { Class clazz = object.getClass(); for (; clazz != Object.class; clazz = clazz.getSuperclass()) { diff --git a/src/main/java/com/emr/util/ExportExcelUtil1.java b/src/main/java/com/emr/util/ExportExcelUtil1.java index 4afa4ac..a385139 100644 --- a/src/main/java/com/emr/util/ExportExcelUtil1.java +++ b/src/main/java/com/emr/util/ExportExcelUtil1.java @@ -9,6 +9,7 @@ import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.util.HSSFColor; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.io.OutputStream; import java.lang.reflect.Field; import java.util.ArrayList; @@ -27,20 +28,18 @@ public class ExportExcelUtil1 { private String fileName; private HSSFWorkbook workBook = null; - public List getFieldName(String tableThNames){ + private List getFieldName(String tableThNames){ String[] names = tableThNames.split(","); List fieldName = new ArrayList<>(); - if (names != null) { - for (int i = 0; i < names.length; i++) { - if (StringUtils.isNoneBlank(names[i])) { - fieldName.add(names[i]); - } + for (String name : names) { + if (StringUtils.isNoneBlank(name)) { + fieldName.add(name); } } return fieldName; } - public List> getFieldData(String fieldCns, Collection list){ + private List> getFieldData(String fieldCns, Collection list){ List> fieldData = new ArrayList>(); String[] fieldList = fieldCns.split(","); Object[] objects = list.toArray(); @@ -55,22 +54,34 @@ public class ExportExcelUtil1 { } return fieldData; } - public void expordExcel(String tableThNames,String fieldCns,Collection list,String fileName,HttpServletResponse response) throws Exception { - this.fieldName = getFieldName(tableThNames); - this.fieldData = getFieldData(fieldCns,list); + public void expordExcel(String tableThNames,String fieldCns,Collection list,String fileName,HttpServletResponse response){ + fieldName = getFieldName(tableThNames); + fieldData = getFieldData(fieldCns,list); this.fileName = fileName; - OutputStream os = response.getOutputStream(); - response.reset(); - response.setContentType("application/OCTET-STREAM;charset=gbk"); - response.setHeader("pragma", "no-cache"); - fileName = new String(fileName.getBytes("utf-8"), "iso-8859-1"); - response.setHeader("Content-disposition", "attachment;filename=\"" + fileName + "\""); - response.setBufferSize(1024); - workBook = createWorkbook(); - workBook.write(os); - os.close(); + OutputStream os = null; + try { + os = response.getOutputStream(); + response.reset(); + response.setContentType("application/OCTET-STREAM;charset=gbk"); + response.setHeader("pragma", "no-cache"); + fileName = new String(fileName.getBytes("utf-8"), "iso-8859-1"); + response.setHeader("Content-disposition", "attachment;filename=\"" + fileName + "\""); + response.setBufferSize(1024); + workBook = createWorkbook(); + workBook.write(os); + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(null != os){ + try { + os.close(); + }catch (Exception e){ + e.printStackTrace(); + } + } + } } - public HSSFWorkbook createWorkbook() { + private HSSFWorkbook createWorkbook() { workBook = new HSSFWorkbook(); int rows = fieldData.size(); int sheetNum = 0; @@ -112,8 +123,9 @@ public class ExportExcelUtil1 { cellStyle1.setAlignment(HSSFCellStyle.ALIGN_CENTER); cellStyle1.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); for (int k = 0; k < (rows < SPLIT_COUNT ? rows : SPLIT_COUNT); k++) { - if (((i - 1) * SPLIT_COUNT + k) >= rows) + if (((i - 1) * SPLIT_COUNT + k) >= rows) { break; + } HSSFRow row = sheet.createRow((short) (k + 1)); ArrayList rowList = (ArrayList) fieldData.get((i - 1) * SPLIT_COUNT + k); for (int n = 0; n < rowList.size(); n++) { @@ -137,12 +149,12 @@ public class ExportExcelUtil1 { return workBook; } - public static String fieldToProperty(String field) { + private static String fieldToProperty(String field) { if (null == field) { return ""; } char[] chars = field.toCharArray(); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (int i = 0; i < chars.length; i++) { char c = chars[i]; if (c == '_') { @@ -158,7 +170,7 @@ public class ExportExcelUtil1 { return sb.toString(); } - public static String getFieldValueByFieldName(String fieldName, Object object) { + private static String getFieldValueByFieldName(String fieldName, Object object) { try { Class clazz = object.getClass(); for (; clazz != Object.class; clazz = clazz.getSuperclass()) { diff --git a/src/main/java/com/emr/util/HttpClientTool.java b/src/main/java/com/emr/util/HttpClientTool.java new file mode 100644 index 0000000..e738c7e --- /dev/null +++ b/src/main/java/com/emr/util/HttpClientTool.java @@ -0,0 +1,139 @@ +package com.emr.util; + +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.ParseException; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 基于 httpclient 4.5版本的 http工具类 + * + * @author + * + */ +public class HttpClientTool { + private static final CloseableHttpClient httpClient; + public static final String CHARSET = "UTF-8"; + // 采用静态代码块,初始化超时时间配置,再根据配置生成默认httpClient对象 + static { + RequestConfig config = RequestConfig.custom().setConnectTimeout(60000).setSocketTimeout(15000).build(); + httpClient = HttpClientBuilder.create().setDefaultRequestConfig(config).build(); + } + + public static String doGet(String url, Map params) { + return doGet(url, params, CHARSET); + } + + public static String doPost(String url, Map params) throws IOException { + return doPost(url, params, CHARSET); + } + + /** + * HTTP Get 获取内容 + * @param url 请求的url地址 ?之前的地址 + * @param params 请求的参数 + * @param charset 编码格式 + * @return 页面内容 + */ + public static String doGet(String url, Map params, String charset) { + if (StringUtils.isBlank(url)) { + return null; + } + try { + if (params != null && !params.isEmpty()) { + List pairs = new ArrayList(params.size()); + for (Map.Entry entry : params.entrySet()) { + String value = entry.getValue(); + if (value != null) { + pairs.add(new BasicNameValuePair(entry.getKey(), value)); + } + } + // 将请求参数和url进行拼接 + url += "?" + EntityUtils.toString(new UrlEncodedFormEntity(pairs, charset)); + } + HttpGet httpGet = new HttpGet(url); + CloseableHttpResponse response = httpClient.execute(httpGet); + int statusCode = response.getStatusLine().getStatusCode(); + if (statusCode != 200) { + httpGet.abort(); + throw new RuntimeException("HttpClient,error status code :" + statusCode); + } + HttpEntity entity = response.getEntity(); + String result = null; + if (entity != null) { + result = EntityUtils.toString(entity, "utf-8"); + } + EntityUtils.consume(entity); + response.close(); + return result; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + /** + * HTTP Post 获取内容 + * @param url 请求的url地址 ?之前的地址 + * @param params 请求的参数 + * @param charset 编码格式 + * @return 页面内容 + * @throws IOException + */ + public static String doPost(String url, Map params, String charset) + throws IOException { + if (StringUtils.isBlank(url)) { + return null; + } + List pairs = null; + if (params != null && !params.isEmpty()) { + pairs = new ArrayList(params.size()); + for (Map.Entry entry : params.entrySet()) { + String value = entry.getValue(); + if (value != null) { + pairs.add(new BasicNameValuePair(entry.getKey(), value)); + } + } + } + HttpPost httpPost = new HttpPost(url); + if (pairs != null && pairs.size() > 0) { + httpPost.setEntity(new UrlEncodedFormEntity(pairs, CHARSET)); + } + CloseableHttpResponse response = null; + try { + response = httpClient.execute(httpPost); + int statusCode = response.getStatusLine().getStatusCode(); + if (statusCode != 200) { + httpPost.abort(); + throw new RuntimeException("HttpClient,error status code :" + statusCode); + } + HttpEntity entity = response.getEntity(); + String result = null; + if (entity != null) { + result = EntityUtils.toString(entity, "utf-8"); + } + EntityUtils.consume(entity); + return result; + } catch (ParseException e) { + e.printStackTrace(); + } finally { + if (response != null) + response.close(); + } + return null; + } +} diff --git a/src/main/java/com/emr/util/Jpg2PdfUtil.java b/src/main/java/com/emr/util/Jpg2PdfUtil.java index afadb9b..f8d2264 100644 --- a/src/main/java/com/emr/util/Jpg2PdfUtil.java +++ b/src/main/java/com/emr/util/Jpg2PdfUtil.java @@ -1,9 +1,7 @@ package com.emr.util; -import com.lowagie.text.Document; -import com.lowagie.text.Element; +import com.lowagie.text.*; import com.lowagie.text.Image; -import com.lowagie.text.Utilities; import com.lowagie.text.pdf.*; import com.lowagie.text.pdf.codec.TiffImage; import org.apache.commons.lang3.StringUtils; @@ -125,19 +123,13 @@ public class Jpg2PdfUtil { * 利用itext打开pdf文档 */ public static boolean check(String file) { - boolean flag1 = false; - int n = 0; - Document document = null; PdfReader pdfReader = null; try { File f = new File(file); if(f.isFile()){ pdfReader = new PdfReader(file); - document = new Document(pdfReader.getPageSize(1)); - document.open(); - n = pdfReader.getNumberOfPages(); - if (n != 0) { - flag1 = true; + if (pdfReader.getNumberOfPages() != 0) { + return true; } } } catch (Exception e) { @@ -145,11 +137,8 @@ public class Jpg2PdfUtil { if(null != pdfReader){ pdfReader.close(); } - if(null != document){ - document.close(); - } } - return flag1; + return false; } public static void mulFile2One(HttpServletResponse response,List files,String waterMarkName) { @@ -160,8 +149,7 @@ public class Jpg2PdfUtil { String fileStr = iterator.next(); File file = new File(fileStr); if(file.isFile()){ - boolean flag = false; - flag = check(fileStr); + boolean flag = check(fileStr); if(!flag){ iterator.remove(); System.out.println(fmt.format(new Date())+":"+file+"文件损坏"); @@ -171,7 +159,7 @@ public class Jpg2PdfUtil { System.out.println(fmt.format(new Date())+":"+file+"文件不存在"); } } - if(null != files && !files.isEmpty()){ + if(!files.isEmpty()){ // pdf合并工具类 Document document = null; ByteArrayOutputStream bos = null; @@ -184,21 +172,21 @@ public class Jpg2PdfUtil { copy = new PdfCopy(document,response.getOutputStream()); document.open(); bos = new ByteArrayOutputStream(); - for (int i = 0; i < files.size(); i++) { + for (String file : files) { bos.flush(); //判断是否加水印 - if(StringUtils.isNotBlank(waterMarkName)){ - setWatermark(bos,files.get(i), waterMarkName, null); + if (StringUtils.isNotBlank(waterMarkName)) { + setWatermark(bos, file, waterMarkName, null); } - reader = new PdfReader(files.get(i)); + reader = new PdfReader(file); int n = reader.getNumberOfPages(); pdfReader = new PdfReader(bos.toByteArray()); for (int j = 1; j <= n; j++) { document.newPage(); PdfImportedPage page = null; - if(StringUtils.isNotBlank(waterMarkName)){ + if (StringUtils.isNotBlank(waterMarkName)) { page = copy.getImportedPage(pdfReader, j); - }else{ + } else { page = copy.getImportedPage(reader, j); } copy.addPage(page); @@ -207,24 +195,25 @@ public class Jpg2PdfUtil { }catch (Exception e){ e.printStackTrace(); }finally { - try{ - if(pdfReader != null){ - pdfReader.close(); - } - if(null != reader){ - reader.close(); - } - if(null != copy){ - copy.close(); - } - if(null != bos){ + if(null != copy){ + copy.close(); + } + if(pdfReader != null){ + pdfReader.close(); + } + if(null != reader){ + reader.close(); + } + if(null != bos){ + try { + bos.flush(); bos.close(); + }catch (Exception e){ + e.printStackTrace(); } - if(null != document){ - document.close(); - } - }catch (Exception e){ - e.printStackTrace(); + } + if(null != document){ + document.close(); } } } @@ -232,50 +221,60 @@ public class Jpg2PdfUtil { //加水印 - private static void setWatermark(ByteArrayOutputStream bos, String input, String waterMarkName, String imgPath) - throws Exception{ - PdfReader reader = new PdfReader(input); - PdfStamper stamper = new PdfStamper(reader, bos); - int total = reader.getNumberOfPages() + 1; - PdfContentByte content; - BaseFont base = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.EMBEDDED); - PdfGState gs = new PdfGState(); - for (int i = 1; i < total; i++) { - content = stamper.getOverContent(i);// 在内容上方加水印 - //加文字水印 - if(StringUtils.isNotBlank(waterMarkName)) { + private static void setWatermark(ByteArrayOutputStream bos, String input, String waterMarkName, String imgPath){ + PdfReader reader = null; + PdfStamper stamper = null; + try { + reader = new PdfReader(input); + stamper = new PdfStamper(reader, bos); + int total = reader.getNumberOfPages() + 1; + PdfContentByte content; + BaseFont base = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.EMBEDDED); + PdfGState gs = new PdfGState(); + for (int i = 1; i < total; i++) { + content = stamper.getOverContent(i);// 在内容上方加水印 + //加文字水印 + if(StringUtils.isNotBlank(waterMarkName)) { - gs.setFillOpacity(0.3f); - gs.setStrokeOpacity(0.3f); - content.setGState(gs); - content.beginText(); - content.setColorFill(Color.LIGHT_GRAY); - content.setFontAndSize(base, 50); - content.setTextMatrix(70, 200); - //v:距左 v1:距下 v2: - content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 300, 600, 40); - content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 300, 200, 40); - content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 800, 600, 40); - content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 800, 200, 40); - content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 300, 1100, 40); - content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 300, 1500, 40); - content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 800, 1100, 40); - content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 800, 1500, 40); - content.endText(); + gs.setFillOpacity(0.3f); + gs.setStrokeOpacity(0.3f); + content.setGState(gs); + content.beginText(); + content.setColorFill(Color.LIGHT_GRAY); + content.setFontAndSize(base, 50); + content.setTextMatrix(70, 200); + //v:距左 v1:距下 v2: + content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 300, 600, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 300, 200, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 800, 600, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 800, 200, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 300, 1100, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 300, 1500, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 800, 1100, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 800, 1500, 40); + content.endText(); + } + if(StringUtils.isNotBlank(imgPath)){ + Image image = Image.getInstance(imgPath); + image.setAbsolutePosition(200, 206); // set the first background + image.scaleToFit(200, 200); + content.addImage(image); + } + content.setColorFill(Color.BLACK); + content.setFontAndSize(base, 8); } - if(StringUtils.isNotBlank(imgPath)){ - Image image = Image.getInstance(imgPath); - image.setAbsolutePosition(200, 206); // set the first background - image.scaleToFit(200, 200); - content.addImage(image); + } catch (IOException | DocumentException e) { + e.printStackTrace(); + } finally { + try { + assert stamper != null; + stamper.close(); + reader.close(); + } catch (DocumentException | IOException e) { + e.printStackTrace(); } - content.setColorFill(Color.BLACK); - content.setFontAndSize(base, 8); } - if(null != reader){ - reader.close(); - } - stamper.close(); + } /** * 在不改变图片形状的同时,判断,如果h>w,则按h压缩,否则在w>h或w=h的情况下,按宽度压缩 @@ -283,7 +282,7 @@ public class Jpg2PdfUtil { * @param w * @return */ - public static int getPercent(float h, float w) { + private static int getPercent(float h, float w) { int p = 0; float p2 = 0.0f; if (h > w) { diff --git a/src/main/java/com/emr/util/OracleConnect.java b/src/main/java/com/emr/util/OracleConnect.java index 3b61ddd..082fa63 100644 --- a/src/main/java/com/emr/util/OracleConnect.java +++ b/src/main/java/com/emr/util/OracleConnect.java @@ -1,17 +1,10 @@ package com.emr.util; - - import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; -import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import com.alibaba.druid.pool.DruidDataSource; @@ -24,13 +17,13 @@ import com.alibaba.druid.pool.DruidDataSource; */ public class OracleConnect { private static DruidDataSource dataSourceTest = null; - public static PreparedStatement pst = null; + private static PreparedStatement pst = null; public static ResultSet rs = null; /** * 构造函数完成数据库的连接和连接对象的生成 */ - public OracleConnect() { + private OracleConnect() { try { if (dataSourceTest == null) { dataSourceTest = new DruidDataSource(); @@ -68,7 +61,7 @@ public class OracleConnect { * @param conn Connection * @throws Exception */ - public static void CloseConn(ResultSet rs, Statement stat, Connection conn) + private static void CloseConn(ResultSet rs, Statement stat, Connection conn) throws Exception { if (rs != null) { rs.close(); @@ -94,11 +87,7 @@ public class OracleConnect { Connection conn = new OracleConnect().getConnect(); pst = conn.prepareStatement(arg0); rs = pst.executeQuery(); - List list = new ArrayList(); if (rs != null) { - ResultSetMetaData md = rs.getMetaData(); - int columnCount = md.getColumnCount(); - Map rowData = new HashMap(); while (rs.next()) { str = rs.getString(1); } diff --git a/src/main/java/com/emr/util/PDFUtils.java b/src/main/java/com/emr/util/PDFUtils.java index b21a71d..2d0c280 100644 --- a/src/main/java/com/emr/util/PDFUtils.java +++ b/src/main/java/com/emr/util/PDFUtils.java @@ -9,14 +9,12 @@ package com.emr.util; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; -import java.util.List; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.pdf.PdfCopy; import com.itextpdf.text.pdf.PdfImportedPage; import com.itextpdf.text.pdf.PdfReader; -import org.springframework.beans.factory.annotation.Value; public class PDFUtils { @@ -44,7 +42,7 @@ public class PDFUtils { } //删除指定文件夹下的所有文件 - public static boolean delAllFile(String path) { + private static boolean delAllFile(String path) { boolean flag = false; File file = new File(path); if (!file.exists()) { @@ -55,17 +53,17 @@ public class PDFUtils { } String[] tempList = file.list(); File temp = null; - for (int i = 0; i < tempList.length; i++) { + for (String s : tempList) { if (path.endsWith(File.separator)) { - temp = new File(path + tempList[i]); + temp = new File(path + s); } else { - temp = new File(path + File.separator + tempList[i]); + temp = new File(path + File.separator + s); } if (temp.isFile()) { temp.delete(); } if (temp.isDirectory()) { - delAllFile(path + "/" + tempList[i]);//先删除文件夹里面的文件 + delAllFile(path + "/" + s);//先删除文件夹里面的文件 //delFolder(path + "/" + tempList[i]);//再删除空文件夹 flag = true; } @@ -73,53 +71,48 @@ public class PDFUtils { return flag; } - public static void getPdf(String filePath, List pathArr){ - if(pathArr!=null) { - File[] pdfs = new File[pathArr.size()]; - for (int i = 0; i < pathArr.size(); i++) { - pdfs[i] = new File(pathArr.get(i).toString()); - } - File mergedPdf = new File(filePath); - try { - merge(pdfs, mergedPdf); - } catch (IOException | DocumentException e) { - e.printStackTrace(); - } - } - } - /** * @param pages * @param pdffile * @throws IOException * @throws DocumentException */ - public static void merge(File[] pages, File pdffile) throws IOException, - DocumentException { - if (!pdffile.exists()) { - pdffile.createNewFile(); - } - if (pages.length < 1) - return; - - Document document = new Document(new PdfReader( - ((File) pages[0]).getAbsolutePath()).getPageSize(1)); - PdfCopy copy = new PdfCopy(document, new FileOutputStream(pdffile)); - document.open(); - for (int i = 0; i < pages.length; i++) { - PdfReader reader = new PdfReader((pages[i]).getAbsolutePath()); - int num = reader.getNumberOfPages(); - for (int j = 1; j <= num; j++) { - document.newPage(); - PdfImportedPage page = copy.getImportedPage(reader, j); - copy.addPage(page); + public static void merge(File[] pages, File pdffile){ + Document document = null; + PdfCopy copy = null; + PdfReader reader = null; + try { + if (!pdffile.exists()) { + pdffile.createNewFile(); + } + if (pages.length < 1) { + return; + } + document = new Document(new PdfReader( + (pages[0]).getAbsolutePath()).getPageSize(1)); + copy = new PdfCopy(document, new FileOutputStream(pdffile)); + document.open(); + for (File page1 : pages) { + reader = new PdfReader((page1).getAbsolutePath()); + int num = reader.getNumberOfPages(); + for (int j = 1; j <= num; j++) { + PdfImportedPage page = copy.getImportedPage(reader, j); + copy.addPage(page); + } + } + } catch (IOException | DocumentException e) { + e.printStackTrace(); + } finally { + if(null != copy){ + copy.close(); + } + if(null != document){ + document.close(); + } + if(null != reader){ + reader.close(); } } - copy.close(); - document.close(); -// for (File page : pages) { -// page.deleteOnExit(); -// } } } diff --git a/src/main/java/com/emr/util/PageBean.java b/src/main/java/com/emr/util/PageBean.java deleted file mode 100644 index eb5a6bd..0000000 --- a/src/main/java/com/emr/util/PageBean.java +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Copyright (C), 2015-2019 - * Author: HJL - * Date: 2019/7/19 19:20 - * Description:分页 - */ -package com.emr.util; - -import java.util.List; - -public class PageBean { - //已知数据 - private int pageNum; //当前页,从请求那边传过来。 - private int pageSize; //每页显示的数据条数。 - private int totalRecord; //总的记录条数。查询数据库得到的数据 - - //需要计算得来 - private int totalPage; //总页数,通过totalRecord和pageSize计算可以得来 - //开始索引,也就是我们在数据库中要从第几行数据开始拿,有了startIndex和pageSize, - //就知道了limit语句的两个数据,就能获得每页需要显示的数据了 - private int startIndex; - - - //将每页要显示的数据放在list集合中 - private List list; - - //分页显示的页数,比如在页面上显示1,2,3,4,5页,start就为1,end就为5,这个也是算过来的 - private int start; - private int end; - - //通过pageNum,pageSize,totalRecord计算得来tatalPage和startIndex - //构造方法中将pageNum,pageSize,totalRecord获得 - public PageBean(int pageNum, int pageSize, int totalRecord) { - this.pageNum = pageNum; - this.pageSize = pageSize; - this.totalRecord = totalRecord; - - //totalPage 总页数 - if (totalRecord % pageSize == 0) { - //说明整除,正好每页显示pageSize条数据,没有多余一页要显示少于pageSize条数据的 - this.totalPage = totalRecord / pageSize; - } else { - //不整除,就要在加一页,来显示多余的数据。 - this.totalPage = totalRecord / pageSize + 1; - } - //开始索引 - this.startIndex = (pageNum - 1) * pageSize; - //显示5页,这里自己可以设置,想显示几页就自己通过下面算法修改 - this.start = 1; - this.end = 5; - //显示页数的算法 - - if (totalPage <= 5) { - //总页数都小于5,那么end就为总页数的值了。 - this.end = this.totalPage; - } else { - //总页数大于5,那么就要根据当前是第几页,来判断start和end为多少了, - this.start = pageNum - 2; - this.end = pageNum + 2; - - if (start < 0) { - //比如当前页是第1页,或者第2页,那么就不如和这个规则, - this.start = 1; - this.end = 5; - } - if (end > this.totalPage) { - //比如当前页是倒数第2页或者最后一页,也同样不符合上面这个规则 - this.end = totalPage; - this.start = end - 5; - } - } - } - - //get、set方法。 - public int getPageNum() { - return pageNum; - } - - public void setPageNum(int pageNum) { - this.pageNum = pageNum; - } - - public int getPageSize() { - return pageSize; - } - - public void setPageSize(int pageSize) { - this.pageSize = pageSize; - } - - public int getTotalRecord() { - return totalRecord; - } - - public void setTotalRecord(int totalRecord) { - this.totalRecord = totalRecord; - } - - public int getTotalPage() { - return totalPage; - } - - public void setTotalPage(int totalPage) { - this.totalPage = totalPage; - } - - public int getStartIndex() { - return startIndex; - } - - public void setStartIndex(int startIndex) { - this.startIndex = startIndex; - } - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - public int getStart() { - return start; - } - - public void setStart(int start) { - this.start = start; - } - - public int getEnd() { - return end; - } - - public void setEnd(int end) { - this.end = end; - } - - -} - diff --git a/src/main/java/com/emr/util/PrintToPdfUtil.java b/src/main/java/com/emr/util/PrintToPdfUtil.java index 586e62b..42dc340 100644 --- a/src/main/java/com/emr/util/PrintToPdfUtil.java +++ b/src/main/java/com/emr/util/PrintToPdfUtil.java @@ -14,7 +14,6 @@ import com.lowagie.text.pdf.PdfImportedPage; import com.lowagie.text.pdf.PdfReader; import com.lowagie.text.pdf.PdfWriter; import org.apache.commons.io.FileUtils; -import org.apache.pdfbox.multipdf.PDFMergerUtility; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; @@ -38,6 +37,7 @@ public class PrintToPdfUtil { public static void toPdf(String imageFolderPath, String pdfPath,List dirList) { // 创建文档 Document doc = new Document(null, 0, 0, 0, 0); + FileOutputStream fos = null; try { //判断文件夹是否存在 String pdfStr = pdfPath.substring(0, pdfPath.lastIndexOf("\\")); @@ -54,36 +54,34 @@ public class PrintToPdfUtil { System.out.println("文件正在被操作"); } file1.delete(); - System.gc(); } // 输入流 - FileOutputStream fos = new FileOutputStream(pdfPath); - + fos = new FileOutputStream(pdfPath); //doc.open(); // 写入PDF文档 PdfWriter.getInstance(doc, fos); - // 获取图片文件夹对象 - File file = new File(imageFolderPath); - //imageFolderPath = file.getAbsolutePath() + "\\"; - imgFun(imageFolderPath,file, dirList, doc); - - + imgFun(new File(imageFolderPath), dirList, doc); } catch (Exception e) { e.printStackTrace(); }finally { - if (doc.isOpen()) { - // 关闭文档 - doc.close(); + try { + assert fos != null; + fos.flush(); + fos.close(); + if(null != doc){ + doc.close(); + } + }catch (Exception e){ + e.printStackTrace(); } } } - public static void imgFun(String imageFolderPath,File file, List dirList, Document doc){ + public static void imgFun(File file, List dirList, Document doc){ // 图片地址 - String imagePath = null; // 读取图片流 BufferedImage img = null; // 实例化图片 @@ -96,7 +94,7 @@ public class PrintToPdfUtil { if (file1.getName().endsWith(".png") || file1.getName().endsWith(".jpg") || file1.getName().endsWith(".gif") || file1.getName().endsWith(".jpeg") || file1.getName().endsWith(".tif")) { - imageFolderPath = file1.getAbsolutePath(); + String imageFolderPath = file1.getAbsolutePath(); // 读取图片流 img = ImageIO.read(new File(imageFolderPath)); @@ -120,117 +118,33 @@ public class PrintToPdfUtil { if (file1.isDirectory()) { if (dirList != null && dirList.size() > 0) { if (dirList.indexOf(file1.getName()) != -1) { - imageFolderPath = file1.getAbsolutePath() + "\\"; - imgFun(imageFolderPath, file1, dirList, doc); + imgFun(file1, dirList, doc); } } else { - imageFolderPath = file1.getAbsolutePath() + "\\"; - imgFun(imageFolderPath, file1, dirList, doc); + imgFun(file1, dirList, doc); } } - } } catch(Exception e){ e.printStackTrace(); } finally { - if (doc.isOpen()) { // 关闭文档 doc.close(); } + if(null != img){ + img.flush(); + } } }else{ System.out.println("空文件夹"); } - } - public static void pdtToPdf(String pdfFolderPath, String pdfPath, List dirList, List pdfList) { - try { - // 输入流 -// FileOutputStream fos = new FileOutputStream(pdfPath); -// // 创建文档 - Document doc = new Document(null, 0, 0, 0, 0); -// //doc.open(); -// // 写入PDF文档 -// PdfWriter.getInstance(doc, fos); -// -// // 获取文件夹对象 - File file = new File(pdfFolderPath); - PDFMergerUtility mergePdf = new PDFMergerUtility(); - - //imageFolderPath = file.getAbsolutePath() + "\\"; - pdfFun(pdfFolderPath, file, dirList, pdfList, mergePdf); - mergePdf.setDestinationFileName(pdfPath); - mergePdf.mergeDocuments(); - System.out.print("done"); -// if (doc.isOpen()) { -// // 关闭文档 -// doc.close(); -// } - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static void pdfFun(String pdfFolderPath, File file, List dirList,List pdfList, PDFMergerUtility mergePdf) { - try { - File[] files = file.listFiles(); - if(file!=null) { - if (files.length > 0) { - // 循环获取图片文件夹内的图片 - for (File file1 : files) { - if (file1.getName().endsWith(".pdf")) { - //System.out.println(file1.length()); - if (pdfList != null && pdfList.size() > 0) { - System.out.println("文件名:" + file1.getName()); - if (pdfList.indexOf(file1.getName()) != -1) { - } else { - if (file1.length() == 0) { - //file.delete(); - } else { - pdfFolderPath = file1.getAbsolutePath(); - mergePdf.addSource(pdfFolderPath); - } - } - } else { - if (file1.length() == 0) { - //file.delete(); - - } else { - pdfFolderPath = file1.getAbsolutePath(); - mergePdf.addSource(pdfFolderPath); - } - } - - } - - if (file1.isDirectory()) { - if (dirList != null && dirList.size() > 0) { - if (dirList.indexOf(file1.getName()) != -1) { - pdfFolderPath = file1.getAbsolutePath() + "\\"; - pdfFun(pdfFolderPath, file1, dirList, pdfList, mergePdf); - - } - } else { - pdfFolderPath = file1.getAbsolutePath() + "\\"; - pdfFun(pdfFolderPath, file1, dirList, pdfList, mergePdf); - } - } - - } - } else { - System.out.println("空文件夹"); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } /** * 保存文件 @@ -241,7 +155,6 @@ public class PrintToPdfUtil { * @return boolean (true:保存成功;false:保存失败) */ public static boolean save(File file, String filename, String savepath) { - filename = filename; File f = new File(savepath, filename); try { FileUtils.copyFile(file, f); @@ -283,27 +196,32 @@ public class PrintToPdfUtil { public static boolean mergePdfFiles(List files, String newfile) { boolean retValue = false; Document document = null; + PdfCopy copy = null; + PdfReader reader = null; try { document = new Document(new PdfReader(files.get(0).toString()).getPageSize(1)); - PdfCopy copy = new PdfCopy(document, new FileOutputStream(newfile)); + copy = new PdfCopy(document, new FileOutputStream(newfile)); document.open(); - for (int i = 0; i < files.size(); i++) { - PdfReader reader = new PdfReader(files.get(i).toString()); + for (Object file : files) { + reader = new PdfReader(file.toString()); int n = reader.getNumberOfPages(); - long start = System.currentTimeMillis(); for (int j = 1; j <= n; j++) { - document.newPage(); PdfImportedPage page = copy.getImportedPage(reader, j); copy.addPage(page); } - long end = System.currentTimeMillis(); - System.out.println("合成pdf时间"); } retValue = true; } catch (Exception e) { e.printStackTrace(); } finally { - document.close(); + assert copy != null; + copy.close(); + if(null != document) { + document.close(); + } + if(null != reader){ + reader.close(); + } } return retValue; } @@ -330,7 +248,6 @@ public class PrintToPdfUtil { String savepath = "C:\\Users\\Administrator\\Desktop\\新建文件夹\\temp.pdf"; mergePdfFiles(list, savepath); } - } diff --git a/src/main/java/com/emr/util/PropertiesUtils.java b/src/main/java/com/emr/util/PropertiesUtils.java index 4c61ed0..b23d53b 100644 --- a/src/main/java/com/emr/util/PropertiesUtils.java +++ b/src/main/java/com/emr/util/PropertiesUtils.java @@ -26,11 +26,4 @@ public class PropertiesUtils { } return props.getProperty(key); } - - public static String getProperty(String key, String defaultValue) { - if (null == props) { - loadProps(); - } - return props.getProperty(key, defaultValue); - } } diff --git a/src/main/java/com/emr/util/ReadFile.java b/src/main/java/com/emr/util/ReadFile.java deleted file mode 100644 index b9e8060..0000000 --- a/src/main/java/com/emr/util/ReadFile.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (C), 2015-2019 - * Author: HJL - * Date: 2019/8/1 10:54 - * Description: - */ -package com.emr.util; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -public class ReadFile { - - /* - * 读取指定路径下的文件名和目录名 - */ - public void getFileList(String path,List divList) { - File file = new File(path); - - File[] fileList = file.listFiles(); - - for (int i = 0; i < fileList.length; i++) { - if (fileList[i].isFile()) { - String fileName = fileList[i].getName(); - System.out.println("文件:" + fileName); - } - - if (fileList[i].isDirectory()) { - //if(divList.indexOf(fileList[i].getName())!=-1) { - String fileName = fileList[i].getName(); - System.out.println("目录:" + fileName); - - // } - } - } - } - - public static void printFile(File file) { - if (file.isFile()) { - System.out.println("您给定的是一个文件"); // 判断给定目录是否是一个合法的目录,如果不是,输出提示 - } else { - File[] fileLists = file.listFiles(); // 如果是目录,获取该目录下的内容集合 - - for (int i = 0; i < fileLists.length; i++) { // 循环遍历这个集合内容 - System.out.println(fileLists[i].getName()); //输出元素名称 - if (fileLists[i].isDirectory()) { //判断元素是不是一个目录 - printFile(fileLists[i]); //如果是目录,继续调用本方法来输出其子目录 - } - } - } - } - - public static void main(String[] args) { - printFile(new File("D:\\")); - -// ReadFile rf = new ReadFile(); -// List list=new ArrayList(); -// list.add("log"); -// list.add("logs"); -// rf.getFileList("D:\\", list); - } -} - - diff --git a/src/main/java/com/emr/util/UrlUtil.java b/src/main/java/com/emr/util/UrlUtil.java deleted file mode 100644 index 265defe..0000000 --- a/src/main/java/com/emr/util/UrlUtil.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Copyright (C), 2015-2019 - * Author: HJL - * Date: 2019/8/14 15:06 - * Description:一个简单的解析url,获取参数的Java工具类 - */ -package com.emr.util; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author - * @description url工具类 - * @date - */ -public class UrlUtil { - - public static class UrlEntity { - /** - * 基础url - */ - public String baseUrl; - /** - * url参数 - */ - public Map params; - } - - /** - * 解析url - * - * @param url - * @return - */ - public static UrlEntity parse(String url) { - UrlEntity entity = new UrlEntity(); - if (url == null) { - return entity; - } - url = url.trim(); - if (url.equals("")) { - return entity; - } - String[] urlParts = url.split("\\?"); - entity.baseUrl = urlParts[0]; - //没有参数 - if (urlParts.length == 1) { - return entity; - } - //有参数 - String[] params = urlParts[1].split("&"); - entity.params = new HashMap<>(); - for (String param : params) { - String[] keyValue = param.split("="); - entity.params.put(keyValue[0], keyValue[1]); - } - - return entity; - } - - /** - * 测试 - * - * @param args - */ - public static void main(String[] args) { - /* - null - null - http://www.123.com - null - http://www.123.com - {id=1} - http://www.123.com - {name=小明, id=1} - */ - UrlEntity entity = parse(null); - System.out.println(entity.baseUrl + "\n" + entity.params); - entity = parse("http://www.123.com"); - System.out.println(entity.baseUrl + "\n" + entity.params); - entity = parse("http://www.123.com?id=1"); - System.out.println(entity.baseUrl + "\n" + entity.params); - entity = parse("http://www.123.com?id=1&name=小明"); - System.out.println(entity.baseUrl + "\n" + entity.params); - } -} - diff --git a/src/main/java/com/emr/util/test.java b/src/main/java/com/emr/util/test.java deleted file mode 100644 index 50361c1..0000000 --- a/src/main/java/com/emr/util/test.java +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Copyright (C), 2015-2019 - * Author: HJL - * Date: 2019/8/1 16:07 - * Description: - */ -package com.emr.util; - -import org.apache.axis.client.Call; -import org.apache.axis.client.Service; -import org.apache.cxf.endpoint.Client; -import org.apache.cxf.endpoint.Endpoint; -import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory; -import org.apache.cxf.service.model.BindingInfo; -import org.apache.cxf.service.model.BindingOperationInfo; -import org.apache.pdfbox.multipdf.PDFMergerUtility; - -import javax.xml.namespace.QName; -import java.io.File; -import java.io.IOException; -public class test { - - private static String[] getFiles(String folder) throws IOException { - File _folder = new File(folder); - String[] filesInFolder; - - if (_folder.isDirectory()) { - filesInFolder = _folder.list(); - return filesInFolder; - } else { - throw new IOException("Path is not a directory"); - } - } - - private static void pdfToPdf(String folder,String fileName) throws Exception { - PDFMergerUtility mergePdf = new PDFMergerUtility(); - String[] filesInFolder = getFiles(folder); - for (int i = 0; i < filesInFolder.length; i++){ - mergePdf.addSource(folder + File.separator + filesInFolder[i]); - System.out.println(filesInFolder[i]); - } - mergePdf.setDestinationFileName(folder + File.separator + fileName); - System.out.println(folder); - mergePdf.mergeDocuments(); - System.out.print("done"); - } - - public static void main(String[] args) throws Exception { - // TODO Auto-generated method stub - // String folder = "D:\\project_js\\EMR_Medical_Record\\src\\main\\webapp\\static\\img\\uploads\\pdfFiles"; - // String fileName = "mergedTest.pdf"; - //pdfToPdf(folder, fileName); - - //String str = "D:\\project_js\\EMR_Medical_Record\\src\\main\\webapp\\static\\img\\uploads\\4\\a.jpg"; - //获得第一个点的位置 - // int index = str.indexOf("\\static"); - //String result = str.substring(0,index+1); - //输出结果 - ///System.out.println(str.substring(index, str.length())); - // JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); - // Client client = dcf.createClient(HomepageDictionary); - // Object[] objects = client.invoke("getInfosByUserId", token, "emr_medical_record"); - // System.out.println(client); -// try { -// String endpoint = "http://120.27.212.36:9999/filing/services/HomepageDictionary?wsdl"; -// //String endpoint = "http://localhost:8080/ca3/services/caSynrochnized?wsdl"; -// //直接引用远程的wsdl文件 -// //以下都是套路 -// Service service = new Service(); -// Call call = (Call) service.createCall(); -// call.setTargetEndpointAddress(endpoint); -// call.setOperationName(new QName("http://interfaces.ann.com/", "CheckData")); -// -// //call.setOperationName("CheckData");//WSDL里面描述的接口名称 -// call.addParameter("masterId", org.apache.axis.encoding.XMLType.XSD_DATE, javax.xml.rpc.ParameterMode.IN);//接口的参数 -// call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);//设置返回类型 -// String temp = "02e4ba493dc643c9926926662327995e"; -// String result = (String) call.invoke(new Object[]{temp}); -// //给方法传递参数,并且调用方法 -// -// System.out.println("result is " + result); -// -// } catch (Exception e) { -// System.err.println(e.toString()); -// -// } - - - String method = "CheckData"; - JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance(); - Client client = factory.createClient("http://120.27.212.36:9999/filing/services/HomepageDictionary?wsdl"); -// Endpoint endpoint2 = client.getEndpoint(); -// QName opName = new QName(endpoint2.getService().getName().getNamespaceURI(), method); -// BindingInfo bindingInfo = endpoint2.getEndpointInfo().getBinding(); -// if (bindingInfo.getOperation(opName) == null) { -// for (BindingOperationInfo operationInfo : bindingInfo.getOperations()) { -// if (method.equals(operationInfo.getName().getLocalPart())) { -// opName = operationInfo.getName(); -// break; -// } -// } -// } - Object[] res = null; - res = client.invoke("CheckData","02e4ba493dc643c9926926662327995e"); - String xml = (String) res[0]; - System.err.println("@@@@@@@@@@@@@@@@@" + xml); - } - -} - - diff --git a/src/main/resources/activiti/leave.bpmn20.xml b/src/main/resources/activiti/leave.bpmn20.xml deleted file mode 100644 index 1803aff..0000000 --- a/src/main/resources/activiti/leave.bpmn20.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - = 3}]]> - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/config/jdbc.properties b/src/main/resources/config/jdbc.properties index 074893c..61a4651 100644 --- a/src/main/resources/config/jdbc.properties +++ b/src/main/resources/config/jdbc.properties @@ -1,7 +1,7 @@ jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver -jdbc.url=jdbc\:sqlserver\://localhost:1433;databaseName=emr_record +jdbc.url=jdbc\:sqlserver\://localhost:1433;databaseName=gm_record jdbc.username=sa -jdbc.password=AbcXyz123 +jdbc.password=docus702 filters=stat maxWait=60000 @@ -24,9 +24,9 @@ hibernate.enable_lazy_load_no_trans=true #powerUrl=http://120.27.212.36:8888/power/font/getMenusByUserIdAndSysFlag #POWER_URLHEAD=http://120.27.212.36:8888/power #power\u6743\u9650\u7CFB\u7EDF\u7684\u670D\u52A1\u5668\u5730\u5740\u5934\u5982\uFF1Ahttp://192.168.1.3:8081/power -powerUrl=http://200.100.104.40:8081/power/font/getMenusByUserIdAndSysFlag -POWER_URLHEAD=http://200.100.104.40:8081/power -POWER_JSP=http://200.100.104.40:8081/power +powerUrl=http://192.168.1.3:8080/power/font/getMenusByUserIdAndSysFlag +POWER_URLHEAD=http://192.168.1.3:8080/power +POWER_JSP=http://192.168.1.3:8080/power recallReason=\u533B\u9662\u9700\u8981\u8FD9\u4EFD\u6587\u6863 HomepageDictionary=http://200.100.104.40:8081/filing/services/HomepageDictionary?wsdl HomepageMethod=CheckData diff --git a/src/main/resources/generatorConfig.xml b/src/main/resources/generatorConfig.xml deleted file mode 100644 index 7adcd18..0000000 --- a/src/main/resources/generatorConfig.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/mapper/ArchiveCallbackInfoMapper.xml b/src/main/resources/mapper/ArchiveCallbackInfoMapper.xml index dfde057..b475765 100644 --- a/src/main/resources/mapper/ArchiveCallbackInfoMapper.xml +++ b/src/main/resources/mapper/ArchiveCallbackInfoMapper.xml @@ -116,7 +116,6 @@ delete from t_basic where patient_id = #{patientId}; delete from t_operate where patient_id = #{patientId}; delete from t_admiss_thing where patient_id = #{patientId}; - delete from archive_archived where patient_id = (select patient_id from archive_master where id = #{patientId}); end \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/beHospitaledDir/beHospList.jsp b/src/main/webapp/WEB-INF/views/beHospitaledDir/beHospList.jsp index f8ca0d4..4af07c3 100644 --- a/src/main/webapp/WEB-INF/views/beHospitaledDir/beHospList.jsp +++ b/src/main/webapp/WEB-INF/views/beHospitaledDir/beHospList.jsp @@ -23,7 +23,7 @@ .divCss2 { margin-top: 5px; - margin-left: 20px; + margin-left: 5px; } .divCss8 { @@ -180,20 +180,19 @@
- +
- +
- +
- +
@@ -205,9 +204,9 @@
- + - - +
@@ -312,7 +311,7 @@
病历清单
-
+
@@ -336,7 +335,7 @@
-
+
@@ -377,7 +376,7 @@
- +
@@ -395,7 +394,7 @@
- +
diff --git a/src/main/webapp/WEB-INF/views/dictionaryDir/dictionary.jsp b/src/main/webapp/WEB-INF/views/dictionaryDir/dictionary.jsp index 565567c..915d195 100644 --- a/src/main/webapp/WEB-INF/views/dictionaryDir/dictionary.jsp +++ b/src/main/webapp/WEB-INF/views/dictionaryDir/dictionary.jsp @@ -86,7 +86,7 @@  字典列表
- +
@@ -115,7 +115,7 @@
- +
@@ -124,7 +124,7 @@
- +
@@ -134,7 +134,7 @@
- +
@@ -143,7 +143,7 @@
- +
@@ -152,7 +152,7 @@
- +
@@ -161,7 +161,7 @@
- +
@@ -170,7 +170,7 @@
- +
@@ -179,7 +179,7 @@
- +
@@ -236,7 +236,7 @@
- +
@@ -245,7 +245,7 @@
- +
diff --git a/src/main/webapp/WEB-INF/views/faultDir/faultList.jsp b/src/main/webapp/WEB-INF/views/faultDir/faultList.jsp index 3d6005d..92757db 100644 --- a/src/main/webapp/WEB-INF/views/faultDir/faultList.jsp +++ b/src/main/webapp/WEB-INF/views/faultDir/faultList.jsp @@ -58,22 +58,22 @@
- +
- +
- +
- + - - +
diff --git a/src/main/webapp/WEB-INF/views/faultTypeDir/faultTypeList.jsp b/src/main/webapp/WEB-INF/views/faultTypeDir/faultTypeList.jsp index 4ea455c..65ea335 100644 --- a/src/main/webapp/WEB-INF/views/faultTypeDir/faultTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/faultTypeDir/faultTypeList.jsp @@ -59,7 +59,7 @@
+ style="width:70%" maxlength="25"/>
@@ -91,7 +91,7 @@
- +
@@ -100,7 +100,7 @@
- +
@@ -109,7 +109,7 @@
- +
@@ -131,7 +131,7 @@
- +
diff --git a/src/main/webapp/WEB-INF/views/flowInfo/flowInfoList.jsp b/src/main/webapp/WEB-INF/views/flowInfo/flowInfoList.jsp index 3dacde2..bd2f91b 100644 --- a/src/main/webapp/WEB-INF/views/flowInfo/flowInfoList.jsp +++ b/src/main/webapp/WEB-INF/views/flowInfo/flowInfoList.jsp @@ -50,14 +50,14 @@
- + - - +
- +
@@ -70,9 +70,9 @@
- + - - +
@@ -86,11 +86,11 @@
- +
- +
diff --git a/src/main/webapp/WEB-INF/views/holidaySetDir/holidaySetList.jsp b/src/main/webapp/WEB-INF/views/holidaySetDir/holidaySetList.jsp index 613493b..fba3ab8 100644 --- a/src/main/webapp/WEB-INF/views/holidaySetDir/holidaySetList.jsp +++ b/src/main/webapp/WEB-INF/views/holidaySetDir/holidaySetList.jsp @@ -49,9 +49,9 @@
- + - - +
@@ -87,9 +87,9 @@
- + - - +
diff --git a/src/main/webapp/WEB-INF/views/inHospitalDir/inHositalList.jsp b/src/main/webapp/WEB-INF/views/inHospitalDir/inHositalList.jsp index fe2952b..d412b3c 100644 --- a/src/main/webapp/WEB-INF/views/inHospitalDir/inHositalList.jsp +++ b/src/main/webapp/WEB-INF/views/inHospitalDir/inHositalList.jsp @@ -23,7 +23,7 @@ .divCss2 { margin-top: 5px; - margin-left: 20px; + margin-left: 5px; } @@ -150,20 +150,19 @@
- +
- +
- +
- +
@@ -175,9 +174,9 @@
- + - - +
@@ -260,7 +259,7 @@
病历清单
-
+
@@ -284,7 +283,7 @@
-
+
@@ -327,7 +326,7 @@
- +
diff --git a/src/main/webapp/WEB-INF/views/index.html b/src/main/webapp/WEB-INF/views/index.html deleted file mode 100644 index 91f953d..0000000 --- a/src/main/webapp/WEB-INF/views/index.html +++ /dev/null @@ -1,2186 +0,0 @@ - - - - - - AdminLTE 2 | Documentation - - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - - -
- -
-

- AdminLTE Documentation - Version 2.3 -

- -
- - -
-

- This documentation is for versions 2.3 and under. - If you are looking for documentation for version 2.4 and above, - please visit our online documentation. -

- -
- -

- AdminLTE is a popular open source WebApp template for admin dashboards and control panels. - It is a responsive HTML template that is based on the CSS framework Bootstrap 3. - It utilizes all of the Bootstrap components in its design and re-styles many - commonly used plugins to create a consistent design that can be used as a user - interface for backend applications. AdminLTE is based on a modular design, which - allows it to be easily customized and built upon. This documentation will guide you through - installing the template and exploring the various components that are bundled with the template. -

-
- - - - -
- -

- AdminLTE can be downloaded in two different versions, each appealing to different skill levels and use case. -

-
-
-
-
-

Ready

- -
-
-

Compiled and ready to use in production. Download this version if you don't want to customize AdminLTE's LESS files.

- Download -
-
-
-
-
-
-

Source Code

- -
-
-

All files including the compiled CSS. Download this version if you plan on customizing the template. Requires a LESS compiler.

- Download -
-
-
-
-
File Hierarchy of the Source Code Package
-
-      AdminLTE/
-      ├── dist/
-      │   ├── CSS/
-      │   ├── JS
-      │   ├── img
-      ├── build/
-      │   ├── less/
-      │   │   ├── AdminLTE's Less files
-      │   └── Bootstrap-less/ (Only for reference. No modifications have been made)
-      │       ├── mixins/
-      │       ├── variables.less
-      │       ├── mixins.less
-      └── plugins/
-          ├── All the customized plugins CSS and JS files
-
- - - - -
- -

AdminLTE depends on two main frameworks. - The downloadable package contains both of these libraries, so you don't have to manually download them.

- -
- - - - -
- -

- Before you go to see your new awesome theme, here are few tips on how to familiarize yourself with it: -

- -
    -
  • AdminLTE is based on Bootstrap 3. If you are unfamiliar with Bootstrap, visit their website and read through the documentation. All of Bootstrap components have been modified to fit the style of AdminLTE and provide a consistent look throughout the template. This way, we guarantee you will get the best of AdminLTE.
  • -
  • Go through the pages that are bundled with the theme. Most of the template example pages contain quick tips on how to create or use a component which can be really helpful when you need to create something on the fly.
  • -
  • Documentation. We are trying our best to make your experience with AdminLTE be smooth. One way to achieve that is to provide documentation and support. If you think that something is missing from the documentation, please do not hesitate to create an issue to tell us about it.
  • -
  • Built with LESS. This theme uses the LESS compiler to make it easier to customize and use. LESS is easy to learn if you know CSS or SASS. It is not necessary to learn LESS but it will benefit you a lot in the future.
  • -
  • Hosted on GitHub. Visit our GitHub repository to view issues, make requests, or contribute to the project.
  • -
-

- Note: LESS files are better commented than the compiled CSS file. -

-
- - - - -
- -

The layout consists of four major parts:

-
    -
  • Wrapper .wrapper. A div that wraps the whole site.
  • -
  • Main Header .main-header. Contains the logo and navbar.
  • -
  • Sidebar .sidebar-wrapper. Contains the user panel and sidebar menu.
  • -
  • Content .content-wrapper. Contains the page header and content.
  • -
-
-

Tip!

-

The starter page is a good place to start building your app if you'd like to start from scratch.

-
- -

Layout Options

-

AdminLTE 2.0 provides a set of options to apply to your main layout. Each one of these classes can be added - to the body tag to get the desired goal.

-
    -
  • Fixed: use the class .fixed to get a fixed header and sidebar.
  • -
  • Collapsed Sidebar: use the class .sidebar-collapse to have a collapsed sidebar upon loading.
  • -
  • Boxed Layout: use the class .layout-boxed to get a boxed layout that stretches only to 1250px.
  • -
  • Top Navigation use the class .layout-top-nav to remove the sidebar and have your links at the top navbar.
  • -
-

Note: you cannot use both layout-boxed and fixed at the same time. Anything else can be mixed together.

- -

Skins

-

Skins can be found in the dist/css/skins folder. - Choose the skin file that you want and then add the appropriate - class to the body tag to change the template's appearance. Here is the list of available skins:

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Skin ClassPreview
skin-blue
skin-blue-light
skin-yellow
skin-yellow-light
skin-green
skin-green-light
skin-purple
skin-purple-light
skin-red
skin-red-light
skin-black
skin-black-light
- - - - - - - -
- -

Modifying the options of AdminLTE's app.js can be done using one of the following ways.

- -

Editing app.js

-

Within the main Javascript file, modify the $.AdminLTE.options object to suit your use case.

- -

Defining AdminLTEOptions

-

Alternatively, you can define a global options variable named AdminLTEOptions and initialize it before loading app.js.

-

Example

-
<script>
-        var AdminLTEOptions = {
-          //Enable sidebar expand on hover effect for sidebar mini
-          //This option is forced to true if both the fixed layout and sidebar mini
-          //are used together
-          sidebarExpandOnHover: true,
-          //BoxRefresh Plugin
-          enableBoxRefresh: true,
-          //Bootstrap.js tooltip
-          enableBSToppltip: true
-        };
-      </script>
-      <script src="dist/js/app.js" type="text/javascript"></script>
- -

Available AdminLTE Options

-
{
-        //Add slimscroll to navbar menus
-        //This requires you to load the slimscroll plugin
-        //in every page before app.js
-        navbarMenuSlimscroll: true,
-        navbarMenuSlimscrollWidth: "3px", //The width of the scroll bar
-        navbarMenuHeight: "200px", //The height of the inner menu
-        //General animation speed for JS animated elements such as box collapse/expand and
-        //sidebar treeview slide up/down. This option accepts an integer as milliseconds,
-        //'fast', 'normal', or 'slow'
-        animationSpeed: 500,
-        //Sidebar push menu toggle button selector
-        sidebarToggleSelector: "[data-toggle='offcanvas']",
-        //Activate sidebar push menu
-        sidebarPushMenu: true,
-        //Activate sidebar slimscroll if the fixed layout is set (requires SlimScroll Plugin)
-        sidebarSlimScroll: true,
-        //Enable sidebar expand on hover effect for sidebar mini
-        //This option is forced to true if both the fixed layout and sidebar mini
-        //are used together
-        sidebarExpandOnHover: false,
-        //BoxRefresh Plugin
-        enableBoxRefresh: true,
-        //Bootstrap.js tooltip
-        enableBSToppltip: true,
-        BSTooltipSelector: "[data-toggle='tooltip']",
-        //Enable Fast Click. Fastclick.js creates a more
-        //native touch experience with touch devices. If you
-        //choose to enable the plugin, make sure you load the script
-        //before AdminLTE's app.js
-        enableFastclick: true,
-        //Control Sidebar Tree Views
-        enableControlTreeView: true,
-        //Control Sidebar Options
-        enableControlSidebar: true,
-        controlSidebarOptions: {
-          //Which button should trigger the open/close event
-          toggleBtnSelector: "[data-toggle='control-sidebar']",
-          //The sidebar selector
-          selector: ".control-sidebar",
-          //Enable slide over content
-          slide: true
-        },
-        //Box Widget Plugin. Enable this plugin
-        //to allow boxes to be collapsed and/or removed
-        enableBoxWidget: true,
-        //Box Widget plugin options
-        boxWidgetOptions: {
-          boxWidgetIcons: {
-            //Collapse icon
-            collapse: 'fa-minus',
-            //Open icon
-            open: 'fa-plus',
-            //Remove icon
-            remove: 'fa-times'
-          },
-          boxWidgetSelectors: {
-            //Remove button selector
-            remove: '[data-widget="remove"]',
-            //Collapse button selector
-            collapse: '[data-widget="collapse"]'
-          }
-        },
-        //Direct Chat plugin options
-        directChat: {
-          //Enable direct chat by default
-          enable: true,
-          //The button to open and close the chat contacts pane
-          contactToggleSelector: '[data-widget="chat-pane-toggle"]'
-        },
-        //Define the set of colors to use globally around the website
-        colors: {
-          lightBlue: "#3c8dbc",
-          red: "#f56954",
-          green: "#00a65a",
-          aqua: "#00c0ef",
-          yellow: "#f39c12",
-          blue: "#0073b7",
-          navy: "#001F3F",
-          teal: "#39CCCC",
-          olive: "#3D9970",
-          lime: "#01FF70",
-          orange: "#FF851B",
-          fuchsia: "#F012BE",
-          purple: "#8E24AA",
-          maroon: "#D81B60",
-          black: "#222222",
-          gray: "#d2d6de"
-        },
-        //The standard screen sizes that bootstrap uses.
-        //If you change these in the variables.less file, change
-        //them here too.
-        screenSizes: {
-          xs: 480,
-          sm: 768,
-          md: 992,
-          lg: 1200
-        }
-      }
-
- - - - -
- -
-

Reminder!

-

- AdminLTE uses all of Bootstrap 3 components. It's a good start to review - the Bootstrap documentation to get an idea of the various components - that this documentation does not cover. -

-
-
-

Tip!

-

- If you go through the example pages and would like to copy a component, right-click on - the component and choose "inspect element" to get to the HTML quicker than scanning - the HTML page. -

-
-

Main Header

-

The main header contains the logo and navbar. Construction of the - navbar differs slightly from Bootstrap because it has components that Bootstrap doesn't provide. - The navbar can be constructed in two ways. This is an example for the normal navbar and next we will provide an example for - the top nav layout.

-
-
- Main Header Example -
- - - - -
-
-
-
<header class="main-header">
-        <a href="../../index2.html" class="logo">
-          <!-- LOGO -->
-          AdminLTE
-        </a>
-        <!-- Header Navbar: style can be found in header.less -->
-        <nav class="navbar navbar-static-top" role="navigation">
-          <!-- Navbar Right Menu -->
-          <div class="navbar-custom-menu">
-            <ul class="nav navbar-nav">
-              <!-- Messages: style can be found in dropdown.less-->
-              <li class="dropdown messages-menu">
-                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
-                  <i class="fa fa-envelope-o"></i>
-                  <span class="label label-success">4</span>
-                </a>
-                <ul class="dropdown-menu">
-                  <li class="header">You have 4 messages</li>
-                  <li>
-                    <!-- inner menu: contains the actual data -->
-                    <ul class="menu">
-                      <li><!-- start message -->
-                        <a href="#">
-                          <div class="pull-left">
-                            <img src="dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
-                          </div>
-                          <h4>
-                            Sender Name
-                            <small><i class="fa fa-clock-o"></i> 5 mins</small>
-                          </h4>
-                          <p>Message Excerpt</p>
-                        </a>
-                      </li><!-- end message -->
-                      ...
-                    </ul>
-                  </li>
-                  <li class="footer"><a href="#">See All Messages</a></li>
-                </ul>
-              </li>
-              <!-- Notifications: style can be found in dropdown.less -->
-              <li class="dropdown notifications-menu">
-                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
-                  <i class="fa fa-bell-o"></i>
-                  <span class="label label-warning">10</span>
-                </a>
-                <ul class="dropdown-menu">
-                  <li class="header">You have 10 notifications</li>
-                  <li>
-                    <!-- inner menu: contains the actual data -->
-                    <ul class="menu">
-                      <li>
-                        <a href="#">
-                          <i class="ion ion-ios-people info"></i> Notification title
-                        </a>
-                      </li>
-                      ...
-                    </ul>
-                  </li>
-                  <li class="footer"><a href="#">View all</a></li>
-                </ul>
-              </li>
-              <!-- Tasks: style can be found in dropdown.less -->
-              <li class="dropdown tasks-menu">
-                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
-                  <i class="fa fa-flag-o"></i>
-                  <span class="label label-danger">9</span>
-                </a>
-                <ul class="dropdown-menu">
-                  <li class="header">You have 9 tasks</li>
-                  <li>
-                    <!-- inner menu: contains the actual data -->
-                    <ul class="menu">
-                      <li><!-- Task item -->
-                        <a href="#">
-                          <h3>
-                            Design some buttons
-                            <small class="pull-right">20%</small>
-                          </h3>
-                          <div class="progress xs">
-                            <div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
-                              <span class="sr-only">20% Complete</span>
-                            </div>
-                          </div>
-                        </a>
-                      </li><!-- end task item -->
-                      ...
-                    </ul>
-                  </li>
-                  <li class="footer">
-                    <a href="#">View all tasks</a>
-                  </li>
-                </ul>
-              </li>
-              <!-- User Account: style can be found in dropdown.less -->
-              <li class="dropdown user user-menu">
-                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
-                  <img src="dist/img/user2-160x160.jpg" class="user-image" alt="User Image">
-                  <span class="hidden-xs">Alexander Pierce</span>
-                </a>
-                <ul class="dropdown-menu">
-                  <!-- User image -->
-                  <li class="user-header">
-                    <img src="dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
-                    <p>
-                      Alexander Pierce - Web Developer
-                      <small>Member since Nov. 2012</small>
-                    </p>
-                  </li>
-                  <!-- Menu Body -->
-                  <li class="user-body">
-                    <div class="col-xs-4 text-center">
-                      <a href="#">Followers</a>
-                    </div>
-                    <div class="col-xs-4 text-center">
-                      <a href="#">Sales</a>
-                    </div>
-                    <div class="col-xs-4 text-center">
-                      <a href="#">Friends</a>
-                    </div>
-                  </li>
-                  <!-- Menu Footer-->
-                  <li class="user-footer">
-                    <div class="pull-left">
-                      <a href="#" class="btn btn-default btn-flat">Profile</a>
-                    </div>
-                    <div class="pull-right">
-                      <a href="#" class="btn btn-default btn-flat">Sign out</a>
-                    </div>
-                  </li>
-                </ul>
-              </li>
-            </ul>
-          </div>
-        </nav>
-      </header>
-

Top Nav Layout. Main Header Example.

-
-

Reminder!

-

To use this main header instead of the regular one, you must add the layout-top-nav class to the body tag.

-
-
-
- Top Nav Example -
- -
-
-
-
-      <header class="main-header">
-        <nav class="navbar navbar-static-top">
-          <div class="container-fluid">
-          <div class="navbar-header">
-            <a href="../../index2.html" class="navbar-brand"><b>Admin</b>LTE</a>
-            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
-              <i class="fa fa-bars"></i>
-            </button>
-          </div>
-
-          <!-- Collect the nav links, forms, and other content for toggling -->
-          <div class="collapse navbar-collapse" id="navbar-collapse">
-            <ul class="nav navbar-nav">
-              <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
-              <li><a href="#">Link</a></li>
-              <li class="dropdown">
-                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <span class="caret"></span></a>
-                <ul class="dropdown-menu" role="menu">
-                  <li><a href="#">Action</a></li>
-                  <li><a href="#">Another action</a></li>
-                  <li><a href="#">Something else here</a></li>
-                  <li class="divider"></li>
-                  <li><a href="#">Separated link</a></li>
-                  <li class="divider"></li>
-                  <li><a href="#">One more separated link</a></li>
-                </ul>
-              </li>
-            </ul>
-            <form class="navbar-form navbar-left" role="search">
-              <div class="form-group">
-                <input type="text" class="form-control" id="navbar-search-input" placeholder="Search">
-              </div>
-            </form>
-            <ul class="nav navbar-nav navbar-right">
-              <li><a href="#">Link</a></li>
-              <li class="dropdown">
-                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <span class="caret"></span></a>
-                <ul class="dropdown-menu" role="menu">
-                  <li><a href="#">Action</a></li>
-                  <li><a href="#">Another action</a></li>
-                  <li><a href="#">Something else here</a></li>
-                  <li class="divider"></li>
-                  <li><a href="#">Separated link</a></li>
-                </ul>
-              </li>
-            </ul>
-          </div><!-- /.navbar-collapse -->
-          </div><!-- /.container-fluid -->
-        </nav>
-      </header>
- - - -

Sidebar

-

- The sidebar used in this page to the left provides an example of what your sidebar should like. - Construction of a sidebar: -

-
-      <div class="main-sidebar">
-        <!-- Inner sidebar -->
-        <div class="sidebar">
-          <!-- user panel (Optional) -->
-          <div class="user-panel">
-            <div class="pull-left image">
-              <img src="dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
-            </div>
-            <div class="pull-left info">
-              <p>User Name</p>
-
-              <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
-            </div>
-          </div><!-- /.user-panel -->
-
-          <!-- Search Form (Optional) -->
-          <form action="#" method="get" class="sidebar-form">
-            <div class="input-group">
-              <input type="text" name="q" class="form-control" placeholder="Search...">
-              <span class="input-group-btn">
-                <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i></button>
-              </span>
-            </div>
-          </form><!-- /.sidebar-form -->
-
-          <!-- Sidebar Menu -->
-          <ul class="sidebar-menu">
-            <li class="header">HEADER</li>
-            <!-- Optionally, you can add icons to the links -->
-            <li class="active"><a href="#"><span>Link</span></a><</li>
-            <li><a href="#"><span>Another Link</span></a></li>
-            <li class="treeview">
-              <a href="#"><span>Multilevel</span> <i class="fa fa-angle-left pull-right"></i></a>
-              <ul class="treeview-menu">
-                <li><a href="#">Link in level 2</a></li>
-                <li><a href="#">Link in level 2</a></li>
-              </ul>
-            </li>
-          </ul><!-- /.sidebar-menu -->
-
-        </div><!-- /.sidebar -->
-      </div><!-- /.main-sidebar -->
- -

Control Sidebar

-

Control sidebar is the right side bar. It can be used for many purposes and is extremely easy - to create. The sidebar ships with two different show/hide styles. The first allows the sidebar to - slide over the content. The second pushes the content to make space for the sidebar. Either of - these methods can be set through the Javascript options.

-

The following code should be placed within the .wrapper div. I prefer - to place it right after the footer.

-

Dark Sidebar Markup

-
<!-- The Right Sidebar -->
-      <aside class="control-sidebar control-sidebar-dark">
-        <!-- Content of the sidebar goes here -->
-      </aside>
-      <!-- The sidebar's background -->
-      <!-- This div must placed right after the sidebar for it to work-->
-      <div class="control-sidebar-bg"></div>
- -

Light Sidebar Markup

-
<!-- The Right Sidebar -->
-      <aside class="control-sidebar control-sidebar-light">
-        <!-- Content of the sidebar goes here -->
-      </aside>
-      <!-- The sidebar's background -->
-      <!-- This div must placed right after the sidebar for it to work-->
-      <div class="control-sidebar-bg"></div>
- -

Once you create the sidebar, you will need a toggle button to open/close it. - By adding the attribute data-toggle="control-sidebar" to any button, it will - automatically act as the toggle button.

- -

Toggle Button Example

-

- -

Sidebar Toggle Markup

-
<button class="btn btn-default" data-toggle="control-sidebar">Toggle Right Sidebar</button>
- - -

Info Box

-

Info boxes are used to display statistical snippets. There are two types of info boxes.

-

First Type of Info Boxes

- -
-
-
- -
- Messages - 1,410 -
-
-
-
-
- -
- Bookmarks - 410 -
-
-
-
-
- -
- Uploads - 13,648 -
-
-
-
-
- -
- Likes - 93,139 -
-
-
-
-

Markup

-
<div class="info-box">
-        <!-- Apply any bg-* class to to the icon to color it -->
-        <span class="info-box-icon bg-red"><i class="fa fa-star-o"></i></span>
-        <div class="info-box-content">
-          <span class="info-box-text">Likes</span>
-          <span class="info-box-number">93,139</span>
-        </div><!-- /.info-box-content -->
-      </div><!-- /.info-box -->
- -

Second Type of Info Boxes

-
-
-
- -
- Bookmarks - 41,410 -
-
-
- - 70% Increase in 30 Days - -
-
-
-
-
- -
- Likes - 41,410 -
-
-
- - 70% Increase in 30 Days - -
-
-
-
-
- -
- Events - 41,410 -
-
-
- - 70% Increase in 30 Days - -
-
-
-
-
- -
- Comments - 41,410 -
-
-
- - 70% Increase in 30 Days - -
-
-
-
-

Markup

-
<!-- Apply any bg-* class to to the info-box to color it -->
-      <div class="info-box bg-red">
-        <span class="info-box-icon"><i class="fa fa-comments-o"></i></span>
-        <div class="info-box-content">
-          <span class="info-box-text">Likes</span>
-          <span class="info-box-number">41,410</span>
-          <!-- The progress section is optional -->
-          <div class="progress">
-            <div class="progress-bar" style="width: 70%"></div>
-          </div>
-          <span class="progress-description">
-            70% Increase in 30 Days
-          </span>
-        </div><!-- /.info-box-content -->
-      </div><!-- /.info-box -->
-

The only thing you need to change to alternate between these style is change the placement of the bg-* class. For the - first style apply any bg-* class to the icon itself. For the other style, apply the bg-* class to the info-box div.

- - -

Box

-

The box component is the most widely used component through out this template. You can - use it for anything from displaying charts to just blocks of text. It comes in many different - styles that we will explore below.

-

Default Box Markup

-
-
-

Default Box Example

-
- - - Label -
-
-
- The body of the box -
- -
-
<div class="box">
-        <div class="box-header with-border">
-          <h3 class="box-title">Default Box Example</h3>
-          <div class="box-tools pull-right">
-            <!-- Buttons, labels, and many other things can be placed here! -->
-            <!-- Here is a label for example -->
-            <span class="label label-primary">Label</span>
-          </div><!-- /.box-tools -->
-        </div><!-- /.box-header -->
-        <div class="box-body">
-          The body of the box
-        </div><!-- /.box-body -->
-        <div class="box-footer">
-          The footer of the box
-        </div><!-- box-footer -->
-      </div><!-- /.box -->
-

Box Variants

-

You can change the style of the box by adding any of the contextual classes.

-
-
-
-
-

Default Box Example

-
-
- The body of the box -
-
-
-
-
-
-

Primary Box Example

-
-
- The body of the box -
-
-
-
-
-
-

Info Box Example

-
-
- The body of the box -
-
-
-
-
-
-
-

Warning Box Example

-
-
- The body of the box -
-
-
-
-
-
-

Success Box Example

-
-
- The body of the box -
-
-
-
-
-
-

Danger Box Example

-
-
- The body of the box -
-
-
-
-
<div class="box box-default">...</div>
-      <div class="box box-primary">...</div>
-      <div class="box box-info">...</div>
-      <div class="box box-warning">...</div>
-      <div class="box box-success">...</div>
-      <div class="box box-danger">...</div>
- -

Solid Box

-

Solid Boxes are alternative ways to display boxes. - They can be created by simply adding the box-solid class to the box component. - You may also use contextual classes with you solid boxes.

-
-
-
-
-

Default Solid Box Example

-
-
- The body of the box -
-
-
-
-
-
-

Primary Solid Box Example

-
-
- The body of the box -
-
-
-
-
-
-

Info Solid Box Example

-
-
- The body of the box -
-
-
-
-
-
-
-

Warning Solid Box Example

-
-
- The body of the box -
-
-
-
-
-
-

Success Solid Box Example

-
-
- The body of the box -
-
-
-
-
-
-

Danger Solid Box Example

-
-
- The body of the box -
-
-
-
-
-      <div class="box box-solid box-default">...</div>
-      <div class="box box-solid box-primary">...</div>
-      <div class="box box-solid box-info">...</div>
-      <div class="box box-solid box-warning">...</div>
-      <div class="box box-solid box-success">...</div>
-      <div class="box box-solid box-danger">...</div>
-

Box Tools

-

Boxes can contain tools to deploy a specific event or provide simple info. The following examples makes use - of multiple AdminLTE components within the header of the box.

-

AdminLTE data-widget attribute provides boxes with the ability to collapse or be removed. The buttons - are placed in the box-tools which is placed in the box-header.

-
-      <!-- This will cause the box to be removed when clicked -->
-      <button class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove"><i class="fa fa-times"></i></button>
-      <!-- This will cause the box to collapse when clicked -->
-      <button class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse"><i class="fa fa-minus"></i></button>
-
-
-
-
-

Collapsable

-
- -
-
-
- The body of the box -
-
-
-      <div class="box box-default">
-        <div class="box-header with-border">
-          <h3 class="box-title">Collapsable</h3>
-          <div class="box-tools pull-right">
-            <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
-          </div><!-- /.box-tools -->
-        </div><!-- /.box-header -->
-        <div class="box-body">
-          The body of the box
-        </div><!-- /.box-body -->
-      </div><!-- /.box -->
-
-
-
-
-

Removable

-
- -
-
-
- The body of the box -
-
-
-      <div class="box box-default">
-        <div class="box-header with-border">
-          <h3 class="box-title">Removable</h3>
-          <div class="box-tools pull-right">
-            <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
-          </div><!-- /.box-tools -->
-        </div><!-- /.box-header -->
-        <div class="box-body">
-          The body of the box
-        </div><!-- /.box-body -->
-      </div><!-- /.box -->
-
-
-
-
-

Expandable

-
- -
-
-
- The body of the box -
-
-
-      <div class="box box-default collapsed-box">
-        <div class="box-header with-border">
-          <h3 class="box-title">Expandable</h3>
-          <div class="box-tools pull-right">
-            <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button>
-          </div><!-- /.box-tools -->
-        </div><!-- /.box-header -->
-        <div class="box-body">
-          The body of the box
-        </div><!-- /.box-body -->
-      </div><!-- /.box -->
-
-
-

We can also add labels, badges, pagination, tooltips, inputs and many more in the box tools. A few examples:

-
-
-
-
-

Labels

-
- Some Label -
-
-
- The body of the box -
-
-
-      <div class="box box-default">
-        <div class="box-header with-border">
-          <h3 class="box-title">Labels</h3>
-          <div class="box-tools pull-right">
-            <span class="label label-default">8 New Messages</span>
-          </div><!-- /.box-tools -->
-        </div><!-- /.box-header -->
-        <div class="box-body">
-          The body of the box
-        </div><!-- /.box-body -->
-      </div><!-- /.box -->
-
-
-
-
-

Input

-
-
- - -
-
-
-
- The body of the box -
-
-
-      <div class="box box-default">
-        <div class="box-header with-border">
-          <h3 class="box-title">Input</h3>
-          <div class="box-tools pull-right">
-            <div class="has-feedback">
-              <input type="text" class="form-control input-sm" placeholder="Search...">
-              <span class="glyphicon glyphicon-search form-control-feedback"></span>
-            </div>
-          </div><!-- /.box-tools -->
-        </div><!-- /.box-header -->
-        <div class="box-body">
-          The body of the box
-        </div><!-- /.box-body -->
-      </div><!-- /.box -->
-
-
-
-
-

Tootips on buttons

-
- - -
-
-
- The body of the box -
-
-
-      <div class="box box-default">
-        <div class="box-header with-border">
-          <h3 class="box-title">Tooltips on buttons</h3>
-          <div class="box-tools pull-right">
-            <button class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse"><i class="fa fa-minus"></i></button>
-            <button class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove"><i class="fa fa-times"></i></button>
-          </div><!-- /.box-tools -->
-        </div><!-- /.box-header -->
-        <div class="box-body">
-          The body of the box
-        </div><!-- /.box-body -->
-      </div><!-- /.box -->
-
-
-

- If you inserted a box into the document after app.js was loaded, you have to activate - the collapse/remove buttons explicitly by calling .activateBox(): -

-
<script>
-          $("#box-widget").activateBox();
-      </script>
- -

Loading States

-
-
-
-
-

Loading state

-
-
- The body of the box -
- -
- -
- -
-
- -
-
-
-

Loading state (.box-solid)

-
-
- The body of the box -
- -
- -
- -
-
-
-

- To simulate a loading state, simply place this code before the .box closing tag. -

-
<div class="overlay">
-        <i class="fa fa-refresh fa-spin"></i>
-      </div>
-      
-

Direct Chat

-

The direct chat widget extends the box component to create a beautiful chat interface. This widget - consists of a required messages pane and an optional contacts pane. Examples:

- -
-
- -
-
-

Direct Chat

-
- 3 - - - -
-
-
- -
- -
-
- Alexander Pierce - 23 Jan 2:00 pm -
- message user image -
- Is this template really for free? That's unbelievable! -
-
- - -
-
- Sarah Bullock - 23 Jan 2:05 pm -
- message user image -
- You better believe it! -
-
-
- - - -
- -
-
- -
- -
-
-

Direct Chat

-
- 3 - - - -
-
-
- -
- -
-
- Alexander Pierce - 23 Jan 2:00 pm -
- message user image -
- Is this template really for free? That's unbelievable! -
-
- - -
-
- Sarah Bullock - 23 Jan 2:05 pm -
- message user image -
- You better believe it! -
-
-
- - - -
- -
-
- -
- -
-
-

Direct Chat

-
- 3 - - - -
-
-
- -
- -
-
- Alexander Pierce - 23 Jan 2:00 pm -
- message user image -
- Is this template really for free? That's unbelievable! -
-
- - -
-
- Sarah Bullock - 23 Jan 2:05 pm -
- message user image -
- You better believe it! -
-
-
- - - -
- -
-
- -
- -
-
-

Direct Chat

-
- 3 - - - -
-
-
- -
- -
-
- Alexander Pierce - 23 Jan 2:00 pm -
- message user image -
- Is this template really for free? That's unbelievable! -
-
- - -
-
- Sarah Bullock - 23 Jan 2:05 pm -
- message user image -
- You better believe it! -
-
-
- - - -
- -
-
-
-

Direct Chat Markup

-

-      <!-- Construct the box with style you want. Here we are using box-danger -->
-      <!-- Then add the class direct-chat and choose the direct-chat-* contexual class -->
-      <!-- The contextual class should match the box, so we are using direct-chat-danger -->
-      <div class="box box-danger direct-chat direct-chat-danger">
-        <div class="box-header with-border">
-          <h3 class="box-title">Direct Chat</h3>
-          <div class="box-tools pull-right">
-            <span data-toggle="tooltip" title="3 New Messages" class="badge bg-red">3</span>
-            <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
-            <!-- In box-tools add this button if you intend to use the contacts pane -->
-            <button class="btn btn-box-tool" data-toggle="tooltip" title="Contacts" data-widget="chat-pane-toggle"><i class="fa fa-comments"></i></button>
-            <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
-          </div>
-        </div><!-- /.box-header -->
-        <div class="box-body">
-          <!-- Conversations are loaded here -->
-          <div class="direct-chat-messages">
-            <!-- Message. Default to the left -->
-            <div class="direct-chat-msg">
-              <div class="direct-chat-info clearfix">
-                <span class="direct-chat-name pull-left">Alexander Pierce</span>
-                <span class="direct-chat-timestamp pull-right">23 Jan 2:00 pm</span>
-              </div><!-- /.direct-chat-info -->
-              <img class="direct-chat-img" src="../dist/img/user1-128x128.jpg" alt="message user image"><!-- /.direct-chat-img -->
-              <div class="direct-chat-text">
-                Is this template really for free? That's unbelievable!
-              </div><!-- /.direct-chat-text -->
-            </div><!-- /.direct-chat-msg -->
-
-            <!-- Message to the right -->
-            <div class="direct-chat-msg right">
-              <div class="direct-chat-info clearfix">
-                <span class="direct-chat-name pull-right">Sarah Bullock</span>
-                <span class="direct-chat-timestamp pull-left">23 Jan 2:05 pm</span>
-              </div><!-- /.direct-chat-info -->
-              <img class="direct-chat-img" src="../dist/img/user3-128x128.jpg" alt="message user image"><!-- /.direct-chat-img -->
-              <div class="direct-chat-text">
-                You better believe it!
-              </div><!-- /.direct-chat-text -->
-            </div><!-- /.direct-chat-msg -->
-          </div><!--/.direct-chat-messages-->
-
-          <!-- Contacts are loaded here -->
-          <div class="direct-chat-contacts">
-            <ul class="contacts-list">
-              <li>
-                <a href="#">
-                  <img class="contacts-list-img" src="../dist/img/user1-128x128.jpg" alt="Contact Avatar">
-                  <div class="contacts-list-info">
-                    <span class="contacts-list-name">
-                      Count Dracula
-                      <small class="contacts-list-date pull-right">2/28/2015</small>
-                    </span>
-                    <span class="contacts-list-msg">How have you been? I was...</span>
-                  </div><!-- /.contacts-list-info -->
-                </a>
-              </li><!-- End Contact Item -->
-            </ul><!-- /.contatcts-list -->
-          </div><!-- /.direct-chat-pane -->
-        </div><!-- /.box-body -->
-        <div class="box-footer">
-          <div class="input-group">
-            <input type="text" name="message" placeholder="Type Message ..." class="form-control">
-            <span class="input-group-btn">
-              <button type="button" class="btn btn-danger btn-flat">Send</button>
-            </span>
-          </div>
-        </div><!-- /.box-footer-->
-      </div><!--/.direct-chat -->
-      
- -

Of course you can use direct chat with a solid box by adding the class solid-box to the box. Here are a couple of examples:

- - -
-
- -
-
-

Direct Chat in a Solid Box

-
- 3 - - - -
-
-
- -
- -
-
- Alexander Pierce - 23 Jan 2:00 pm -
- message user image -
- Is this template really for free? That's unbelievable! -
-
- - -
-
- Sarah Bullock - 23 Jan 2:05 pm -
- message user image -
- You better believe it! -
-
-
- - - -
- -
-
- -
- -
-
-

Direct Chat in a Solid Box

-
- 3 - - - -
-
-
- -
- -
-
- Alexander Pierce - 23 Jan 2:00 pm -
- message user image -
- Is this template really for free? That's unbelievable! -
-
- - -
-
- Sarah Bullock - 23 Jan 2:05 pm -
- message user image -
- You better believe it! -
-
-
- - - -
- -
-
-
-
- - - - -
- -

AdminLTE makes use of the following plugins. For documentation, updates or license information, please visit the provided links.

- -
- - - - -
- -

AdminLTE supports the following browsers:

-
    -
  • IE9+
  • -
  • Firefox (latest)
  • -
  • Safari (latest)
  • -
  • Chrome (latest)
  • -
  • Opera (latest)
  • -
-

Note: IE9 does not support transitions or animations. The template will function properly but it won't use animations/transitions on IE9.

-
- - - - -
- -

To upgrade from version 1.x to the lateset version, follow this guide.

-

New Files

-

Make sure you update all CSS and JS files that are related to AdminLTE. Otherwise, the layout will not - function properly. Most important files are AdminLTE.css, skins CSS files, and app.js.

-

Layout Changes

-
    -
  1. The .wrapper div must be placed immediately after the body tag rather than after the header
  2. -
  3. Change the .header div to .main-header <div class="main-header">
  4. -
  5. Change the .right-side class to .content-wrapper <div class="content-wrapper">
  6. -
  7. Change the .left-side class to .main-sidebar <div class="main-sidebar">
  8. -
  9. In the navbar, change .navbar-right to .navbar-custom-menu <div class="navbar-custom-menu">
  10. -
-

Navbar Custom Dropdown Menus

-
    -
  1. The icons in the notification menu do not need bg-* classes. They should be replaced with contextual text color class such as text-aqua or text-red.
  2. -
-

Login, Registration and Lockscreen Pages

-

There are major changes to the HTML markup and style to these pages. The best way is to copy the page's code and customize it.

-

And you should be set to go!

-

Mailbox

-

Mailbox got an upgrade to include three different views. The views are inbox, read mail, and compose new email. To use these views, - you should use the provided HTML files in the pages/mailbox folder.

-

Note: the old mailbox layout has been deprecated in favor of the new one and will be removed by the next release.

-
- - - - -
- -

Thanks to many of AdminLTE users, there are multiple implementations of the template - for easy integration with back-end frameworks. The following are some of them:

- - - -

Note: these implementations are not supported by Almsaeed Studio. However, - they do provide a good example of how to integrate AdminLTE into different frameworks. For the latest release - of AdminLTE, please visit our repository or website

-
- - - - -
- -

Can AdminLTE be used with Wordpress?

-

AdminLTE is an HTML template that can be used for any purpose. However, it is not made to be easily installed on Wordpress. It will require some effort and enough knowledge of the Wordpress script to do so.

- -

Is there an integration guide for PHP frameworks such as Yii or Symfony?

-

Short answer, no. However, there are forks and tutorials around the web that provide info on how to integrate with many different frameworks. There are even versions of AdminLTE that are integrated with jQuery ajax, AngularJS and/or MVC5 ASP .NET.

- -

How do I get notified of new AdminLTE versions?

-

The best option is to subscribe to our mailing list using the subscription form on Almsaeed Studio. - If that's not appealing to you, you may watch the repository on Github or visit Almsaeed Studio every now and then for updates and announcements.

-
- - - - -
- -

AdminLTE

-

- AdminLTE is an open source project that is licensed under the MIT license. - This allows you to do pretty much anything you want as long as you include - the copyright in "all copies or substantial portions of the Software." - Attribution is not required (though very much appreciated). -

-
- - - - - -
- - Copyright © 2014-2016 Almsaeed Studio. All rights - reserved. -
- - - - -
- - - - - - - - - - - - - - - - - - diff --git a/src/main/webapp/WEB-INF/views/lastVerifyDir/lastVerifyList.jsp b/src/main/webapp/WEB-INF/views/lastVerifyDir/lastVerifyList.jsp index 1a625f7..f4f09cd 100644 --- a/src/main/webapp/WEB-INF/views/lastVerifyDir/lastVerifyList.jsp +++ b/src/main/webapp/WEB-INF/views/lastVerifyDir/lastVerifyList.jsp @@ -24,7 +24,7 @@ .divCss2 { margin-top: 5px; - margin-left: 20px; + margin-left: 5px; } .divCss22 { @@ -181,20 +181,19 @@
- +
- +
- +
- +
@@ -207,9 +206,9 @@
- + - - +
@@ -309,7 +308,7 @@
病历清单
-
+
@@ -333,7 +332,7 @@
-
+
@@ -375,7 +374,7 @@
- +
diff --git a/src/main/webapp/WEB-INF/views/medicalRecallDateDir/recallDateList.jsp b/src/main/webapp/WEB-INF/views/medicalRecallDateDir/recallDateList.jsp index 6a8a7fc..d727f5d 100644 --- a/src/main/webapp/WEB-INF/views/medicalRecallDateDir/recallDateList.jsp +++ b/src/main/webapp/WEB-INF/views/medicalRecallDateDir/recallDateList.jsp @@ -93,9 +93,9 @@
- + - - +
diff --git a/src/main/webapp/WEB-INF/views/medicalRecallDir/medicalRecallList.jsp b/src/main/webapp/WEB-INF/views/medicalRecallDir/medicalRecallList.jsp index abcc432..53a8b2f 100644 --- a/src/main/webapp/WEB-INF/views/medicalRecallDir/medicalRecallList.jsp +++ b/src/main/webapp/WEB-INF/views/medicalRecallDir/medicalRecallList.jsp @@ -63,19 +63,19 @@
- +
- +
- +
- +
<%--
diff --git a/src/main/webapp/WEB-INF/views/pdf.jsp b/src/main/webapp/WEB-INF/views/pdf.jsp deleted file mode 100644 index e9d7839..0000000 --- a/src/main/webapp/WEB-INF/views/pdf.jsp +++ /dev/null @@ -1,42 +0,0 @@ -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - - - - ${name} - - - - <%@ include file="/WEB-INF/jspf/common.jspf" %> - - - - - - - - - - - - - diff --git a/src/main/webapp/WEB-INF/views/statistics/finalStatistics.jsp b/src/main/webapp/WEB-INF/views/statistics/finalStatistics.jsp index 7431ce2..1697833 100644 --- a/src/main/webapp/WEB-INF/views/statistics/finalStatistics.jsp +++ b/src/main/webapp/WEB-INF/views/statistics/finalStatistics.jsp @@ -51,11 +51,10 @@
- + - + maxlength="10" style="text-align: center" autocomplete="off"/>
diff --git a/src/main/webapp/WEB-INF/views/statistics/finalStatisticsDetail.jsp b/src/main/webapp/WEB-INF/views/statistics/finalStatisticsDetail.jsp index 3ff30ee..08ca0ed 100644 --- a/src/main/webapp/WEB-INF/views/statistics/finalStatisticsDetail.jsp +++ b/src/main/webapp/WEB-INF/views/statistics/finalStatisticsDetail.jsp @@ -47,14 +47,14 @@
- + - - +
- +
@@ -83,11 +83,11 @@
- +
- +
diff --git a/src/main/webapp/WEB-INF/views/statistics/firstStatistics.jsp b/src/main/webapp/WEB-INF/views/statistics/firstStatistics.jsp index 8cac5bb..b18c3c3 100644 --- a/src/main/webapp/WEB-INF/views/statistics/firstStatistics.jsp +++ b/src/main/webapp/WEB-INF/views/statistics/firstStatistics.jsp @@ -38,9 +38,9 @@
- + - - +
diff --git a/src/main/webapp/WEB-INF/views/statistics/printCount.jsp b/src/main/webapp/WEB-INF/views/statistics/printCount.jsp index df6f7dc..cfda8c0 100644 --- a/src/main/webapp/WEB-INF/views/statistics/printCount.jsp +++ b/src/main/webapp/WEB-INF/views/statistics/printCount.jsp @@ -38,9 +38,9 @@
- + - - +
@@ -54,7 +54,7 @@
- +
diff --git a/src/main/webapp/WEB-INF/views/statistics/printInfo.jsp b/src/main/webapp/WEB-INF/views/statistics/printInfo.jsp index 051386d..66296e3 100644 --- a/src/main/webapp/WEB-INF/views/statistics/printInfo.jsp +++ b/src/main/webapp/WEB-INF/views/statistics/printInfo.jsp @@ -38,9 +38,9 @@
- + - - +
@@ -54,7 +54,7 @@
- +
diff --git a/src/main/webapp/WEB-INF/views/statistics/scanCount.jsp b/src/main/webapp/WEB-INF/views/statistics/scanCount.jsp index 2f5fdd1..0a0201b 100644 --- a/src/main/webapp/WEB-INF/views/statistics/scanCount.jsp +++ b/src/main/webapp/WEB-INF/views/statistics/scanCount.jsp @@ -38,9 +38,9 @@
- + - - +
@@ -54,7 +54,7 @@
- +
diff --git a/src/main/webapp/WEB-INF/views/statistics/scanInfo.jsp b/src/main/webapp/WEB-INF/views/statistics/scanInfo.jsp index 789c034..f1993b6 100644 --- a/src/main/webapp/WEB-INF/views/statistics/scanInfo.jsp +++ b/src/main/webapp/WEB-INF/views/statistics/scanInfo.jsp @@ -38,9 +38,9 @@
- + - - +
@@ -54,7 +54,7 @@
- +
diff --git a/src/main/webapp/WEB-INF/views/statistics/statisticsDetail.jsp b/src/main/webapp/WEB-INF/views/statistics/statisticsDetail.jsp index 9f95a2e..4eb0806 100644 --- a/src/main/webapp/WEB-INF/views/statistics/statisticsDetail.jsp +++ b/src/main/webapp/WEB-INF/views/statistics/statisticsDetail.jsp @@ -47,14 +47,14 @@
- + - - +
- +
@@ -67,9 +67,9 @@
- + - - +
@@ -83,11 +83,11 @@
- +
- +
diff --git a/src/main/webapp/WEB-INF/views/unfileMedicalDir/unfileMedicalList.jsp b/src/main/webapp/WEB-INF/views/unfileMedicalDir/unfileMedicalList.jsp index 4f16ecc..05902be 100644 --- a/src/main/webapp/WEB-INF/views/unfileMedicalDir/unfileMedicalList.jsp +++ b/src/main/webapp/WEB-INF/views/unfileMedicalDir/unfileMedicalList.jsp @@ -23,7 +23,7 @@ .divCss2 { margin-top: 5px; - margin-left: 20px; + margin-left: 5px; } @@ -170,42 +170,40 @@
- +
- +
- +
- +
-
- + - - +
@@ -218,9 +216,9 @@
- + - - +
@@ -329,7 +327,7 @@
病历清单
-
+
@@ -353,7 +351,7 @@
-
+
@@ -673,7 +671,7 @@ undefinedText: '---', //当数据为 undefined 时显示的字符 singleSelect: false,//设置True 将禁止多选 clickToSelect: true,//设置true 将在点击行时,自动选择rediobox 和 checkbox - height: getHeight(220), //定义表格的高度。 + height: getHeight(260), //定义表格的高度。 searchTimeOut: 500,// 默认500 设置搜索超时时间。 toolbarAlign: 'right',// 指定 toolbar 水平方向的位置。'left' 或 'right' paginationDetailHAlign: 'left',//指定 分页详细信息 在水平方向的位置。'left' 或 'right'。 diff --git a/src/main/webapp/WEB-INF/views/vCountDir/doctorFileList.jsp b/src/main/webapp/WEB-INF/views/vCountDir/doctorFileList.jsp index 852f906..5f76e24 100644 --- a/src/main/webapp/WEB-INF/views/vCountDir/doctorFileList.jsp +++ b/src/main/webapp/WEB-INF/views/vCountDir/doctorFileList.jsp @@ -67,9 +67,9 @@
- + - - +
diff --git a/src/main/webapp/WEB-INF/views/vCountDir/vCountList.jsp b/src/main/webapp/WEB-INF/views/vCountDir/vCountList.jsp index d1efcb7..16370c6 100644 --- a/src/main/webapp/WEB-INF/views/vCountDir/vCountList.jsp +++ b/src/main/webapp/WEB-INF/views/vCountDir/vCountList.jsp @@ -73,9 +73,9 @@
- + - - +
diff --git a/src/main/webapp/static/bootstrap-3.3.7/plugins/bootstrap-select/bootstrap-select.min.css b/src/main/webapp/static/bootstrap-3.3.7/plugins/bootstrap-select/bootstrap-select.min.css index 2bbc461..7e726de 100644 --- a/src/main/webapp/static/bootstrap-3.3.7/plugins/bootstrap-select/bootstrap-select.min.css +++ b/src/main/webapp/static/bootstrap-3.3.7/plugins/bootstrap-select/bootstrap-select.min.css @@ -3,4 +3,4 @@ * * Copyright 2013-2017 bootstrap-select * Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE) - */select.bs-select-hidden,select.selectpicker{display:none!important}.bootstrap-select{width:220px\9}.bootstrap-select>.dropdown-toggle{width:100%;padding-right:25px;z-index:1}.bootstrap-select>.dropdown-toggle.bs-placeholder,.bootstrap-select>.dropdown-toggle.bs-placeholder:active,.bootstrap-select>.dropdown-toggle.bs-placeholder:focus,.bootstrap-select>.dropdown-toggle.bs-placeholder:hover{color:#999}.bootstrap-select>select{position:absolute!important;bottom:0;left:50%;display:block!important;width:.5px!important;height:100%!important;padding:0!important;opacity:0!important;border:none}.bootstrap-select>select.mobile-device{top:0;left:0;display:block!important;width:100%!important;z-index:2}.error .bootstrap-select .dropdown-toggle,.has-error .bootstrap-select .dropdown-toggle{border-color:#b94a48}.bootstrap-select.fit-width{width:auto!important}.bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn){width:220px}.bootstrap-select .dropdown-toggle:focus{outline:thin dotted #333!important;outline:5px auto -webkit-focus-ring-color!important;outline-offset:-2px}.bootstrap-select.form-control{margin-bottom:0;padding:0;border:none}.bootstrap-select.form-control:not([class*=col-]){width:100%}.bootstrap-select.form-control.input-group-btn{z-index:auto}.bootstrap-select.form-control.input-group-btn:not(:first-child):not(:last-child)>.btn{border-radius:0}.bootstrap-select.btn-group:not(.input-group-btn),.bootstrap-select.btn-group[class*=col-]{float:none;display:inline-block;margin-left:0}.bootstrap-select.btn-group.dropdown-menu-right,.bootstrap-select.btn-group[class*=col-].dropdown-menu-right,.row .bootstrap-select.btn-group[class*=col-].dropdown-menu-right{float:right}.form-group .bootstrap-select.btn-group,.form-horizontal .bootstrap-select.btn-group,.form-inline .bootstrap-select.btn-group{margin-bottom:0}.form-group-lg .bootstrap-select.btn-group.form-control,.form-group-sm .bootstrap-select.btn-group.form-control{padding:0}.form-group-lg .bootstrap-select.btn-group.form-control .dropdown-toggle,.form-group-sm .bootstrap-select.btn-group.form-control .dropdown-toggle{height:100%;font-size:inherit;line-height:inherit;border-radius:inherit}.form-inline .bootstrap-select.btn-group .form-control{width:100%}.bootstrap-select.btn-group.disabled,.bootstrap-select.btn-group>.disabled{cursor:not-allowed}.bootstrap-select.btn-group.disabled:focus,.bootstrap-select.btn-group>.disabled:focus{outline:0!important}.bootstrap-select.btn-group.bs-container{position:absolute;height:0!important;padding:0!important}.bootstrap-select.btn-group.bs-container .dropdown-menu{z-index:1060}.bootstrap-select.btn-group .dropdown-toggle .filter-option{display:inline-block;overflow:hidden;width:100%;text-align:left}.bootstrap-select.btn-group .dropdown-toggle .caret{position:absolute;top:50%;right:12px;margin-top:-2px;vertical-align:middle}.bootstrap-select.btn-group[class*=col-] .dropdown-toggle{width:100%}.bootstrap-select.btn-group .dropdown-menu{min-width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-select.btn-group .dropdown-menu.inner{position:static;float:none;border:0;padding:0;margin:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none}.bootstrap-select.btn-group .dropdown-menu li{position:relative}.bootstrap-select.btn-group .dropdown-menu li.active small{color:#fff}.bootstrap-select.btn-group .dropdown-menu li.disabled a{cursor:not-allowed}.bootstrap-select.btn-group .dropdown-menu li a{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bootstrap-select.btn-group .dropdown-menu li a.opt{position:relative;padding-left:2.25em}.bootstrap-select.btn-group .dropdown-menu li a span.check-mark{display:none}.bootstrap-select.btn-group .dropdown-menu li a span.text{display:inline-block}.bootstrap-select.btn-group .dropdown-menu li small{padding-left:.5em}.bootstrap-select.btn-group .dropdown-menu .notify{position:absolute;bottom:5px;width:96%;margin:0 2%;min-height:26px;padding:3px 5px;background:#f5f5f5;border:1px solid #e3e3e3;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05);pointer-events:none;opacity:.9;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-select.btn-group .no-results{padding:3px;background:#f5f5f5;margin:0 5px;white-space:nowrap}.bootstrap-select.btn-group.fit-width .dropdown-toggle .filter-option{position:static}.bootstrap-select.btn-group.fit-width .dropdown-toggle .caret{position:static;top:auto;margin-top:-1px}.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a span.check-mark{position:absolute;display:inline-block;right:15px;margin-top:5px}.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text{margin-right:34px}.bootstrap-select.show-menu-arrow.open>.dropdown-toggle{z-index:1061}.bootstrap-select.show-menu-arrow .dropdown-toggle:before{content:'';border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid rgba(204,204,204,.2);position:absolute;bottom:-4px;left:9px;display:none}.bootstrap-select.show-menu-arrow .dropdown-toggle:after{content:'';border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;bottom:-4px;left:10px;display:none}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before{bottom:auto;top:-3px;border-top:7px solid rgba(204,204,204,.2);border-bottom:0}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after{bottom:auto;top:-3px;border-top:6px solid #fff;border-bottom:0}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before{right:12px;left:auto}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after{right:13px;left:auto}.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:after,.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:before{display:block}.bs-actionsbox,.bs-donebutton,.bs-searchbox{padding:4px 8px}.bs-actionsbox{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bs-actionsbox .btn-group button{width:50%}.bs-donebutton{float:left;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bs-donebutton .btn-group button{width:100%}.bs-searchbox+.bs-actionsbox{padding:0 8px 4px}.bs-searchbox .form-control{margin-bottom:0;width:100%;float:none} \ No newline at end of file + */select.bs-select-hidden,select.selectpicker{display:none!important}.bootstrap-select{width:220px\9}.bootstrap-select>.dropdown-toggle{width:100%;padding-right:25px;z-index:1}.bootstrap-select>.dropdown-toggle.bs-placeholder,.bootstrap-select>.dropdown-toggle.bs-placeholder:active,.bootstrap-select>.dropdown-toggle.bs-placeholder:focus,.bootstrap-select>.dropdown-toggle.bs-placeholder:hover{color:#999;height: 30px;font-size: 12px}.bootstrap-select>select{position:absolute!important;bottom:0;left:50%;display:block!important;width:.5px!important;height:100%!important;padding:0!important;opacity:0!important;border:none}.bootstrap-select>select.mobile-device{top:0;left:0;display:block!important;width:100%!important;z-index:2}.error .bootstrap-select .dropdown-toggle,.has-error .bootstrap-select .dropdown-toggle{border-color:#b94a48}.bootstrap-select.fit-width{width:auto!important}.bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn){width:220px}.bootstrap-select .dropdown-toggle:focus{outline:thin dotted #333!important;outline:5px auto -webkit-focus-ring-color!important;outline-offset:-2px}.bootstrap-select.form-control{margin-bottom:0;padding:0;border:none}.bootstrap-select.form-control:not([class*=col-]){width:100%}.bootstrap-select.form-control.input-group-btn{z-index:auto}.bootstrap-select.form-control.input-group-btn:not(:first-child):not(:last-child)>.btn{border-radius:0}.bootstrap-select.btn-group:not(.input-group-btn),.bootstrap-select.btn-group[class*=col-]{float:none;display:inline-block;margin-left:0}.bootstrap-select.btn-group.dropdown-menu-right,.bootstrap-select.btn-group[class*=col-].dropdown-menu-right,.row .bootstrap-select.btn-group[class*=col-].dropdown-menu-right{float:right}.form-group .bootstrap-select.btn-group,.form-horizontal .bootstrap-select.btn-group,.form-inline .bootstrap-select.btn-group{margin-bottom:0}.form-group-lg .bootstrap-select.btn-group.form-control,.form-group-sm .bootstrap-select.btn-group.form-control{padding:0}.form-group-lg .bootstrap-select.btn-group.form-control .dropdown-toggle,.form-group-sm .bootstrap-select.btn-group.form-control .dropdown-toggle{height:100%;font-size:inherit;line-height:inherit;border-radius:inherit}.form-inline .bootstrap-select.btn-group .form-control{width:100%}.bootstrap-select.btn-group.disabled,.bootstrap-select.btn-group>.disabled{cursor:not-allowed}.bootstrap-select.btn-group.disabled:focus,.bootstrap-select.btn-group>.disabled:focus{outline:0!important}.bootstrap-select.btn-group.bs-container{position:absolute;height:0!important;padding:0!important}.bootstrap-select.btn-group.bs-container .dropdown-menu{z-index:1060}.bootstrap-select.btn-group .dropdown-toggle .filter-option{display:inline-block;overflow:hidden;width:100%;text-align:left}.bootstrap-select.btn-group .dropdown-toggle .caret{position:absolute;top:50%;right:12px;margin-top:-2px;vertical-align:middle}.bootstrap-select.btn-group[class*=col-] .dropdown-toggle{width:100%}.bootstrap-select.btn-group .dropdown-menu{min-width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-select.btn-group .dropdown-menu.inner{position:static;float:none;border:0;padding:0;margin:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none}.bootstrap-select.btn-group .dropdown-menu li{position:relative}.bootstrap-select.btn-group .dropdown-menu li.active small{color:#fff}.bootstrap-select.btn-group .dropdown-menu li.disabled a{cursor:not-allowed}.bootstrap-select.btn-group .dropdown-menu li a{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bootstrap-select.btn-group .dropdown-menu li a.opt{position:relative;padding-left:2.25em}.bootstrap-select.btn-group .dropdown-menu li a span.check-mark{display:none}.bootstrap-select.btn-group .dropdown-menu li a span.text{display:inline-block}.bootstrap-select.btn-group .dropdown-menu li small{padding-left:.5em}.bootstrap-select.btn-group .dropdown-menu .notify{position:absolute;bottom:5px;width:96%;margin:0 2%;min-height:26px;padding:3px 5px;background:#f5f5f5;border:1px solid #e3e3e3;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05);pointer-events:none;opacity:.9;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-select.btn-group .no-results{padding:3px;background:#f5f5f5;margin:0 5px;white-space:nowrap}.bootstrap-select.btn-group.fit-width .dropdown-toggle .filter-option{position:static}.bootstrap-select.btn-group.fit-width .dropdown-toggle .caret{position:static;top:auto;margin-top:-1px}.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a span.check-mark{position:absolute;display:inline-block;right:15px;margin-top:5px}.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text{margin-right:34px}.bootstrap-select.show-menu-arrow.open>.dropdown-toggle{z-index:1061}.bootstrap-select.show-menu-arrow .dropdown-toggle:before{content:'';border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid rgba(204,204,204,.2);position:absolute;bottom:-4px;left:9px;display:none}.bootstrap-select.show-menu-arrow .dropdown-toggle:after{content:'';border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;bottom:-4px;left:10px;display:none}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before{bottom:auto;top:-3px;border-top:7px solid rgba(204,204,204,.2);border-bottom:0}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after{bottom:auto;top:-3px;border-top:6px solid #fff;border-bottom:0}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before{right:12px;left:auto}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after{right:13px;left:auto}.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:after,.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:before{display:block}.bs-actionsbox,.bs-donebutton,.bs-searchbox{padding:4px 8px}.bs-actionsbox{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bs-actionsbox .btn-group button{width:50%}.bs-donebutton{float:left;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bs-donebutton .btn-group button{width:100%}.bs-searchbox+.bs-actionsbox{padding:0 8px 4px}.bs-searchbox .form-control{margin-bottom:0;width:100%;float:none} \ No newline at end of file