Commit 885e49d770e420b7d8984417732ccad466081565

Authored by gengxiaokai
1 parent dc992b27a3

婚检导出

Showing 3 changed files with 170 additions and 11 deletions

platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java View file @ 885e49d
... ... @@ -631,7 +631,7 @@
631 631  
632 632 ws.addCell(new Label(0, values.size()+5, "注:统计时限:"+ time +";分娩方式中其他包括:吸引产、臀助产、臀牵引、产钳产等。", leftFormt));
633 633  
634   - ws.mergeCells(0, values.size()+5, 36, values.size()+5);
  634 + ws.mergeCells(0, values.size() + 5, 36, values.size() + 5);
635 635  
636 636 ws.addCell(new Label(0, values.size()+6, "填报单位:", leftFormt));
637 637 ws.mergeCells(0, values.size()+6, 5, values.size()+6);
638 638  
639 639  
640 640  
... ... @@ -672,18 +672,18 @@
672 672 ws.mergeCells(0, 0, 0, 1);
673 673 ws.addCell(new Label(0, 0, "编号",wcf));
674 674 ws.mergeCells(1, 0, 1, 1);
675   - ws.addCell(new Label(1, 0, "姓名",wcf));
  675 + ws.addCell(new Label(1, 0, "姓名", wcf));
676 676 ws.mergeCells(2, 0, 2, 1);
677 677 ws.addCell(new Label(2, 0, "家庭住址",wcf));
678 678 ws.mergeCells(3, 0, 3, 1);
679   - ws.addCell(new Label(3, 0, "联系电话",wcf));
  679 + ws.addCell(new Label(3, 0, "联系电话", wcf));
680 680 ws.mergeCells(4, 0, 4, 1);
681 681 ws.addCell(new Label(4, 0, "末次月经",wcf));
682 682 ws.mergeCells(5, 0, 9, 0);
683   - ws.addCell(new Label(5, 0, "产前检查",wcf));
684   - ws.addCell(new Label(5, 1, "一",wcf));
  683 + ws.addCell(new Label(5, 0, "产前检查", wcf));
  684 + ws.addCell(new Label(5, 1, "一", wcf));
685 685 ws.addCell(new Label(6,1,"二",wcf));
686   - ws.addCell(new Label(7,1,"三",wcf));
  686 + ws.addCell(new Label(7, 1, "三", wcf));
687 687 ws.addCell(new Label(8,1,"四",wcf));
688 688 ws.addCell(new Label(9, 1, "五",wcf));
689 689 ws.mergeCells(10, 0, 10, 1);
... ... @@ -692,7 +692,7 @@
692 692 ws.addCell(new Label(11, 0, "出院小结",wcf));
693 693 ws.mergeCells(12, 0, 13, 0);
694 694 ws.addCell(new Label(12, 0, "产后访视",wcf));
695   - ws.addCell(new Label(12, 1, "7天内",wcf));
  695 + ws.addCell(new Label(12, 1, "7天内", wcf));
696 696 ws.addCell(new Label(13, 1, "42天内",wcf));
697 697 ws.mergeCells(14, 0, 14, 1);
698 698 ws.addCell(new Label(14,0,"备注",wcf));
... ... @@ -721,6 +721,158 @@
721 721  
722 722 }
723 723 }
  724 +
  725 + wwb.write();
  726 + wwb.close();
  727 +
  728 + }catch (Exception e){
  729 + ExceptionUtils.catchException(e, e.getMessage());
  730 + }
  731 + }
  732 +
  733 +
  734 + /**
  735 + * 婚检导出模板
  736 + * @param out
  737 + * @param data
  738 + */
  739 + public static void WritePremaritalExcel(OutputStream out,Map<String, Object> data){
  740 + WritableWorkbook wwb;
  741 + try{
  742 + wwb = Workbook.createWorkbook(out);
  743 + WritableSheet ws = wwb.createSheet("sheet", 0); // 创建一个工作表
  744 + /**
  745 + * 设置单元格样式
  746 + */
  747 + WritableFont wf = new WritableFont(WritableFont.ARIAL, 12, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
  748 + WritableCellFormat wcf = new WritableCellFormat(wf);
  749 + wcf.setAlignment(jxl.format.Alignment.CENTRE);//水平居中
  750 + ws.setRowView(0, 300); // 设置指定行高
  751 + // 设置列宽
  752 + for (int j = 0; j < 31; j++)
  753 + {
  754 + ws.setColumnView(j, 15);
  755 + }
  756 + //创建Excel标题格式
  757 + ws.mergeCells(0, 0, 0, 3);
  758 + ws.addCell(new Label(0, 0, "填报单位", wcf));
  759 + ws.mergeCells(1, 0, 2, 0);
  760 + ws.addCell(new Label(1, 0, "结婚登记人数", wcf));
  761 + ws.mergeCells(1, 1, 1, 3);
  762 + ws.addCell(new Label(1, 1, "男", wcf));
  763 + ws.mergeCells(2, 1, 2, 3);
  764 + ws.addCell(new Label(2, 1, "女", wcf));
  765 + ws.mergeCells(3, 0, 4, 0);
  766 + ws.addCell(new Label(0, 0, "婚前医学检查人数", wcf));
  767 + ws.mergeCells(3, 1, 3, 3);
  768 + ws.addCell(new Label(3, 1, "男", wcf));
  769 + ws.mergeCells(4, 1, 4, 3);
  770 + ws.addCell(new Label(4, 1, "女", wcf));
  771 + ws.mergeCells(5, 0, 6, 0);
  772 + ws.addCell(new Label(5, 0, "婚前卫生咨询情况", wcf));
  773 + ws.mergeCells(5, 1, 5, 3);
  774 + ws.addCell(new Label(5, 1, "男", wcf));
  775 + ws.mergeCells(6, 1, 6, 3);
  776 + ws.addCell(new Label(6, 1, "女", wcf));
  777 + ws.mergeCells(7, 0, 20, 0);
  778 + ws.addCell(new Label(7, 0, "检出疾病分类情况", wcf));
  779 + ws.mergeCells(7, 1, 8, 1);
  780 + ws.addCell(new Label(7, 1, "检出疾病人数", wcf));
  781 + ws.mergeCells(7, 2, 7, 3);
  782 + ws.addCell(new Label(7, 2, "男", wcf));
  783 + ws.mergeCells(8, 2, 8, 3);
  784 + ws.addCell(new Label(8, 2, "女", wcf));
  785 + ws.mergeCells(9, 1, 12, 1);
  786 + ws.addCell(new Label(9, 1, "指定传染病", wcf));
  787 + ws.mergeCells(9, 2, 9, 3);
  788 + ws.addCell(new Label(9, 2, "男", wcf));
  789 + ws.mergeCells(10, 2, 10, 3);
  790 + ws.addCell(new Label(10, 2, "女", wcf));
  791 + ws.mergeCells(11, 2, 12, 2);
  792 + ws.addCell(new Label(11, 2, "性病", wcf));
  793 + ws.addCell(new Label(11, 3, "男", wcf));
  794 + ws.addCell(new Label(12,3,"女",wcf));
  795 + ws.mergeCells(13, 1, 14, 1);
  796 + ws.addCell(new Label(13, 1, "严重遗传病",wcf));
  797 + ws.mergeCells(13, 2, 13, 3);
  798 + ws.addCell(new Label(13,2,"男",wcf));
  799 + ws.mergeCells(14, 2, 14, 3);
  800 + ws.addCell(new Label(14,2,"女",wcf));
  801 + ws.mergeCells(15, 1, 16, 1);
  802 + ws.addCell(new Label(15,1,"有关精神病",wcf));
  803 + ws.mergeCells(15, 2, 15, 3);
  804 + ws.addCell(new Label(15,2,"男",wcf));
  805 + ws.mergeCells(16, 2, 16, 3);
  806 + ws.addCell(new Label(16,2,"女",wcf));
  807 + ws.mergeCells(17, 1, 18, 1);
  808 + ws.addCell(new Label(17,1,"生殖系统疾病",wcf));
  809 + ws.mergeCells(17, 2, 17, 3);
  810 + ws.addCell(new Label(17,2,"男",wcf));
  811 + ws.mergeCells(18, 2, 18, 3);
  812 + ws.addCell(new Label(18,2,"女",wcf));
  813 + ws.mergeCells(19, 1, 20, 1);
  814 + ws.addCell(new Label(19,1,"内科系统疾病",wcf));
  815 + ws.mergeCells(19, 2, 19, 3);
  816 + ws.addCell(new Label(19,2,"男",wcf));
  817 + ws.mergeCells(20, 2, 20, 3);
  818 + ws.addCell(new Label(20,2,"女",wcf));
  819 + ws.mergeCells(21, 0, 30, 0);
  820 + ws.addCell(new Label(21,0,"对影响婚育疾病的医学指导意见",wcf));
  821 + ws.mergeCells(21, 1, 22, 1);
  822 + ws.addCell(new Label(21,1,"对影响婚育疾病的医学意见总人数",wcf));
  823 + ws.mergeCells(21, 2, 21, 3);
  824 + ws.addCell(new Label(21, 2, "男", wcf));
  825 + ws.mergeCells(22, 2, 22, 3);
  826 + ws.addCell(new Label(22,2,"女",wcf));
  827 + ws.mergeCells(23, 1, 24, 1);
  828 + ws.addCell(new Label(23,1,"不宜结婚",wcf));
  829 + ws.mergeCells(23, 2, 23, 3);
  830 + ws.addCell(new Label(23,2,"男",wcf));
  831 + ws.mergeCells(24, 2, 24, 3);
  832 + ws.addCell(new Label(24,2,"女",wcf));
  833 + ws.mergeCells(25, 1, 26, 1);
  834 + ws.addCell(new Label(25,1,"不宜生育",wcf));
  835 + ws.mergeCells(25, 2, 25, 3);
  836 + ws.addCell(new Label(25,2,"男",wcf));
  837 + ws.mergeCells(26, 2, 26, 3);
  838 + ws.addCell(new Label(26,2,"女",wcf));
  839 + ws.mergeCells(27, 1, 28, 1);
  840 + ws.addCell(new Label(27,1,"暂缓结婚",wcf));
  841 + ws.mergeCells(27, 2, 27, 3);
  842 + ws.addCell(new Label(27,2,"男",wcf));
  843 + ws.mergeCells(28, 2, 28, 3);
  844 + ws.addCell(new Label(28,2,"女",wcf));
  845 + ws.mergeCells(29, 1, 30, 1);
  846 + ws.addCell(new Label(29,1,"尊重受检者意愿",wcf));
  847 + ws.mergeCells(29, 2, 29, 3);
  848 + ws.addCell(new Label(29,2,"男",wcf));
  849 + ws.mergeCells(30, 2, 30, 3);
  850 + ws.addCell(new Label(30,2,"女",wcf));
  851 +
  852 + /*int k = 0;
  853 + //填充数据
  854 + if(data != null && data.size() > 0) {
  855 + for (int i = 0; i < data.size(); i++) {
  856 + int l = i + 1;
  857 + ws.addCell(new Label(k, i + 2, String.valueOf(l)));
  858 + ws.addCell(new Label(k + 1, i + 2, data.get(i).get("name") == null ? "" : data.get(i).get("name").toString()));
  859 + ws.addCell(new Label(k + 2, i + 2, data.get(i).get("address") == null ? "" : data.get(i).get("address").toString()));
  860 + ws.addCell(new Label(k + 3, i + 2, data.get(i).get("phone") == null ? "" : data.get(i).get("phone").toString()));
  861 + ws.addCell(new Label(k + 4, i + 2, data.get(i).get("lastMenses") == null ? "" : data.get(i).get("lastMenses").toString()));
  862 + ws.addCell(new Label(k + 5, i + 2, data.get(i).get("yi") == null ? "" : data.get(i).get("yi").toString()));
  863 + ws.addCell(new Label(k + 6, i + 2, data.get(i).get("er") == null ? "" : data.get(i).get("er").toString()));
  864 + ws.addCell(new Label(k + 7, i + 2, data.get(i).get("san") == null ? "" : data.get(i).get("san").toString()));
  865 + ws.addCell(new Label(k + 8, i + 2, data.get(i).get("si") == null ? "" : data.get(i).get("si").toString()));
  866 + ws.addCell(new Label(k + 9, i + 2, data.get(i).get("wu") == null ? "" : data.get(i).get("wu").toString()));
  867 + ws.addCell(new Label(k + 10, i + 2, data.get(i).get("total") == null ? "" : data.get(i).get("total").toString()));
  868 +
  869 + ws.addCell(new Label(k + 11, i + 2, data.get(i).get("cyxj") == null ? "" : data.get(i).get("cyxj").toString()));
  870 + ws.addCell(new Label(k + 12, i + 2, data.get(i).get("chfs") == null ? "" : data.get(i).get("chfs").toString()));
  871 + ws.addCell(new Label(k + 13, i + 2, data.get(i).get("chfc") == null ? "" : data.get(i).get("chfc").toString()));
  872 + ws.addCell(new Label(k + 14, i + 2, data.get(i).get("remarks") == null ? "" : data.get(i).get("remarks").toString()));
  873 +
  874 + }
  875 + }*/
724 876  
725 877 wwb.write();
726 878 wwb.close();
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PremaritalCheckupController.java View file @ 885e49d
... ... @@ -126,9 +126,9 @@
126 126 @RequestMapping(value = "/queryPremaritalExcel", method = RequestMethod.GET)
127 127 @ResponseBody
128 128 @TokenRequired
129   - public BaseResponse queryPremaritalExcel(String provinceId,String cityId,String areaId,String streetId,String time,HttpServletRequest request){
  129 + public void queryPremaritalExcel(String provinceId,String cityId,String areaId,String streetId,String time,HttpServletRequest request,HttpServletResponse response){
130 130 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
131   - return premaritalCheckupFacade.queryPremaritalExcel(provinceId, cityId, areaId, streetId, time, loginState.getId());
  131 + premaritalCheckupFacade.queryPremaritalExcel(provinceId, cityId, areaId, streetId, time, loginState.getId(),response);
132 132 }
133 133  
134 134  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PremaritalCheckupFacade.java View file @ 885e49d
... ... @@ -2191,7 +2191,7 @@
2191 2191  
2192 2192  
2193 2193 //婚检导出
2194   - public BaseResponse queryPremaritalExcel(String provinceId,String cityId,String areaId,String streetId,String time,Integer userId){
  2194 + public void queryPremaritalExcel(String provinceId,String cityId,String areaId,String streetId,String time,Integer userId,HttpServletResponse response){
2195 2195 //获取用户权限医院和筛选条件的交集
2196 2196 List<String> currentUserHospPermissions = areaCountFacade.getCurrentUserHospPermissions2(userId, provinceId,
2197 2197 cityId, areaId);
... ... @@ -2480,7 +2480,14 @@
2480 2480 datas.put("series", series);
2481 2481 datas.put("tableDatas",result);
2482 2482 datas.put("xAxis", xAxis);
2483   - return new BaseObjectResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(datas);
  2483 + //return new BaseObjectResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(datas);
  2484 + OutputStream out = null;
  2485 + try{
  2486 + out = response.getOutputStream();
  2487 + }catch (Exception e){
  2488 + e.printStackTrace();
  2489 + }
  2490 + ExcelUtil.WritePremaritalExcel(out,datas);
2484 2491  
2485 2492 }
2486 2493