Commit 9361b336e56c3c7fb1acffe6382e6998fa9c8a05
1 parent
48f93ed148
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 14 additions and 18 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java
View file @
9361b33
| ... | ... | @@ -745,7 +745,7 @@ |
| 745 | 745 | public void childbirthManagerExcel2(HttpServletRequest httpServletRequest, @RequestBody ChildbirthManagerRequest childbirthManagerRequest, HttpServletResponse httpServletResponse) { |
| 746 | 746 | try { |
| 747 | 747 | childbirthManagerRequest.setOperatorId(((LoginContext) httpServletRequest.getAttribute("loginContext")).getId()); |
| 748 | - matDeliverFacade.childbirthManagerExcel2(childbirthManagerRequest, httpServletResponse); | |
| 748 | + matDeliverFacade.fmManagerExcel2(childbirthManagerRequest, httpServletResponse); | |
| 749 | 749 | } catch (Exception e) { |
| 750 | 750 | ExceptionUtils.catchException(e, "childbirthManagerExcel2异常"); |
| 751 | 751 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
9361b33
| ... | ... | @@ -3876,23 +3876,24 @@ |
| 3876 | 3876 | return objectResponse; |
| 3877 | 3877 | } |
| 3878 | 3878 | |
| 3879 | - public void childbirthManagerExcel2(ChildbirthManagerRequest childbirthManagerRequest, HttpServletResponse httpServletResponse)throws Exception { | |
| 3879 | + public void fmManagerExcel2(ChildbirthManagerRequest childbirthManagerRequest, HttpServletResponse httpServletResponse)throws Exception { | |
| 3880 | 3880 | try { |
| 3881 | 3881 | childbirthManagerRequest.setExcel(true); |
| 3882 | 3882 | childbirthManagerRequest.setLimit(10000);//导出数量 |
| 3883 | 3883 | @SuppressWarnings("unchecked") |
| 3884 | - List<Map<String, Object>> initQueryMapqhdkyList = childbirthManager2(childbirthManagerRequest).getData(); | |
| 3884 | + List<Map<String, Object>> fmResult = fmManager2(childbirthManagerRequest); | |
| 3885 | 3885 | Map<String, String> header = childbirthManagerRequest.getInitQueryMapqhdky(); |
| 3886 | 3886 | |
| 3887 | 3887 | httpServletResponse.setContentType("application/force-download"); |
| 3888 | 3888 | httpServletResponse.setHeader("Content-Disposition", "attachment;filename=" + new String(("科研导出.xls").getBytes("UTF-8"), "ISO-8859-1")); |
| 3889 | - ExcelUtil.toExcel(httpServletResponse.getOutputStream(), initQueryMapqhdkyList, header); | |
| 3889 | + ExcelUtil.toExcel(httpServletResponse.getOutputStream(), fmResult, header); | |
| 3890 | 3890 | } catch (Exception e) { |
| 3891 | 3891 | ExceptionUtils.catchException(e, "childbirthManagerExcel异常"); |
| 3892 | 3892 | } |
| 3893 | 3893 | } |
| 3894 | 3894 | |
| 3895 | - public ChildbirthManagerResult childbirthManager2(ChildbirthManagerRequest childbirthManagerRequest) { | |
| 3895 | + public List<Map<String, Object>> fmManager2(ChildbirthManagerRequest childbirthManagerRequest) { | |
| 3896 | + List<Map<String, Object>> data = new LinkedList<>(); | |
| 3896 | 3897 | Date dateStart=null; |
| 3897 | 3898 | Date dateEnd=null; |
| 3898 | 3899 | if (StringUtils.isNotEmpty(childbirthManagerRequest.getBirthDate())) { |
| 3899 | 3900 | |
| 3900 | 3901 | |
| ... | ... | @@ -3903,10 +3904,9 @@ |
| 3903 | 3904 | // 什么都不做,这里是数据传入错误了 |
| 3904 | 3905 | } |
| 3905 | 3906 | } |
| 3906 | - ChildbirthManagerResult childbirthManagerResult = new ChildbirthManagerResult(); | |
| 3907 | 3907 | String hid = autoMatchFacade.getHospitalId(childbirthManagerRequest.getOperatorId()); |
| 3908 | - List<String> parentIdList = new ArrayList<>(); | |
| 3909 | 3908 | //这里查询档案信息太费时。在没有这个筛选需求的时候不去查询 |
| 3909 | + List<String> parentIdList = new ArrayList<>(); | |
| 3910 | 3910 | if(StringUtils.isNotEmpty(childbirthManagerRequest.getQueryNo())) { |
| 3911 | 3911 | PatientsQuery patientsQuery = new PatientsQuery(); |
| 3912 | 3912 | patientsQuery.setFmDateStart(dateStart); |
| ... | ... | @@ -3926,9 +3926,7 @@ |
| 3926 | 3926 | |
| 3927 | 3927 | if (CollectionUtils.isEmpty(patientsList)) { |
| 3928 | 3928 | // 没有查到,直接抛出 |
| 3929 | - childbirthManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 3930 | - childbirthManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); | |
| 3931 | - return childbirthManagerResult; | |
| 3929 | + return data; | |
| 3932 | 3930 | } |
| 3933 | 3931 | //组装查询到的档案 |
| 3934 | 3932 | for (Patients patients : patientsList) { |
| ... | ... | @@ -3951,7 +3949,7 @@ |
| 3951 | 3949 | |
| 3952 | 3950 | List <MaternalDeliverModel> maternalDeliverModelList = matDeliverService.pageQuery(matDeliverQuery); |
| 3953 | 3951 | |
| 3954 | - List<Map> data = new LinkedList<>(); | |
| 3952 | + | |
| 3955 | 3953 | int batchSize = 4; |
| 3956 | 3954 | int end = 0; |
| 3957 | 3955 | List <Future> listFuture = new ArrayList <>(); |
| 3958 | 3956 | |
| 3959 | 3957 | |
| 3960 | 3958 | |
| 3961 | 3959 | |
| ... | ... | @@ -3960,27 +3958,25 @@ |
| 3960 | 3958 | if (end > maternalDeliverModelList.size()) { |
| 3961 | 3959 | end = maternalDeliverModelList.size(); |
| 3962 | 3960 | } |
| 3963 | - List <MaternalDeliverModel> mlist = maternalDeliverModelList.subList(i, end); | |
| 3961 | + List <MaternalDeliverModel> fmlist = maternalDeliverModelList.subList(i, end); | |
| 3964 | 3962 | Callable c = new MaterDeliverWorker2(recordService, babyService,antExService, |
| 3965 | - mlist,mongoTemplate); | |
| 3963 | + fmlist,mongoTemplate); | |
| 3966 | 3964 | Future f = commonThreadPool.submit(c); |
| 3967 | 3965 | if (f != null) { |
| 3968 | 3966 | listFuture.add(f); |
| 3969 | 3967 | } |
| 3970 | 3968 | } |
| 3969 | + | |
| 3971 | 3970 | if (CollectionUtils.isNotEmpty(listFuture)) { |
| 3972 | 3971 | for (Future f : listFuture) { |
| 3973 | 3972 | try { |
| 3974 | - data.addAll((List<Map>) f.get(30, TimeUnit.SECONDS)); | |
| 3973 | + data.addAll((List<Map<String, Object>>) f.get(30, TimeUnit.SECONDS)); | |
| 3975 | 3974 | } catch (Exception e) { |
| 3976 | 3975 | ExceptionUtils.catchException(e, "fm list error."); |
| 3977 | 3976 | } |
| 3978 | 3977 | } |
| 3979 | 3978 | } |
| 3980 | - childbirthManagerResult.setData(data); | |
| 3981 | - childbirthManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 3982 | - childbirthManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); | |
| 3983 | - return childbirthManagerResult; | |
| 3979 | + return data; | |
| 3984 | 3980 | } |
| 3985 | 3981 | |
| 3986 | 3982 | public BaseObjectResponse getLhByFmManageCount(Date startTime, Date endTime, Integer userId) { |