Commit fc2c8186c864ece2e7a6adcdb1bf87be5e8594ea
1 parent
50fadd1a05
Exists in
master
and in
6 other branches
儿童首次高危列表- 导出
Showing 3 changed files with 69 additions and 2 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyFirstRistRecordController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AuthenticationFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyFirstRistRecordFacade.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyFirstRistRecordController.java
View file @
fc2c818
... | ... | @@ -45,6 +45,19 @@ |
45 | 45 | return babyFirstRistRecordFacade.queryListPage(ModelQuery,loginState.getId()); |
46 | 46 | } |
47 | 47 | /** |
48 | + * 儿童首次高危列表- 导出 | |
49 | + * @param ModelQuery | |
50 | + * @param request | |
51 | + * @return | |
52 | + */ | |
53 | + @ResponseBody | |
54 | + @TokenRequired | |
55 | + @RequestMapping(value = "/queryListPageExport",method = RequestMethod.GET) | |
56 | + public void queryListPageExport(BabyFirstRistRecordQuery ModelQuery, Integer limit, HttpServletRequest request,HttpServletResponse httpServletResponse) { | |
57 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
58 | + babyFirstRistRecordFacade.queryListPageExport(ModelQuery,limit,loginState.getId(),httpServletResponse); | |
59 | + } | |
60 | + /** | |
48 | 61 | * 儿童档案历史数据执行方法。-儿童首次高危确诊 |
49 | 62 | * 不会影响现有首次高危记录 |
50 | 63 | * hospitalIdList 放多个医院机构的id {n,n..} 必填 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AuthenticationFacade.java
View file @
fc2c818
... | ... | @@ -225,9 +225,9 @@ |
225 | 225 | } |
226 | 226 | |
227 | 227 | public void queryListExport(AuthenticationQuery modelQuery, Integer userid,Integer limit, HttpServletResponse httpServletResponse) { |
228 | - //默认1000条 | |
228 | + //默认10000条 | |
229 | 229 | if (null == limit) { |
230 | - limit=1000; | |
230 | + limit=10000; | |
231 | 231 | } |
232 | 232 | modelQuery.setPage(1); |
233 | 233 | modelQuery.setLimit(limit); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyFirstRistRecordFacade.java
View file @
fc2c818
... | ... | @@ -10,6 +10,7 @@ |
10 | 10 | import com.lyms.platform.common.result.BaseObjectResponse; |
11 | 11 | import com.lyms.platform.common.result.BaseResponse; |
12 | 12 | import com.lyms.platform.common.utils.*; |
13 | +import com.lyms.platform.operate.web.utils.ResponseUtil; | |
13 | 14 | import com.lyms.platform.permission.model.Organization; |
14 | 15 | import com.lyms.platform.permission.model.Users; |
15 | 16 | import com.lyms.platform.permission.service.OrganizationService; |
... | ... | @@ -28,6 +29,8 @@ |
28 | 29 | import org.springframework.data.domain.Sort; |
29 | 30 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
30 | 31 | import org.springframework.stereotype.Component; |
32 | + | |
33 | +import javax.servlet.http.HttpServletResponse; | |
31 | 34 | import java.util.concurrent.Future; |
32 | 35 | import java.util.concurrent.Callable; |
33 | 36 | |
... | ... | @@ -227,6 +230,57 @@ |
227 | 230 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
228 | 231 | br.setErrormsg("成功"); |
229 | 232 | return br; |
233 | + } | |
234 | + | |
235 | + | |
236 | + public void queryListPageExport(BabyFirstRistRecordQuery modelQuery, Integer limit,Integer userid, HttpServletResponse httpServletResponse) { | |
237 | + //默认10000条 | |
238 | + if (null == limit) { | |
239 | + limit=10000; | |
240 | + } | |
241 | + modelQuery.setPage(1); | |
242 | + modelQuery.setLimit(limit); | |
243 | + BaseObjectResponse baseObjectResponse= queryListPage(modelQuery,userid); | |
244 | + List<Map<String,Object>> datas = (List<Map<String, Object>>) baseObjectResponse.getData(); | |
245 | + List<Map<String,Object>> results = new ArrayList<>(); | |
246 | + if(CollectionUtils.isNotEmpty(datas)) { | |
247 | + int i = 0; | |
248 | + for (Map<String, Object> data : datas) { | |
249 | + Map<String, Object> map = new LinkedHashMap<>(); | |
250 | + map.put("id", ++i); | |
251 | + map.put("name", data.get("name")); | |
252 | + map.put("sex", data.get("sex")); | |
253 | + map.put("birth",DateUtil.getYyyyMmDd((Date) data.get("birth"))); | |
254 | + map.put("monthAge", data.get("monthAge")); | |
255 | + List<Map> mapList= (List<Map>) data.get("highRiskInfo"); | |
256 | + String highRiskInfo=""; | |
257 | + for (Map map1 : mapList) { | |
258 | + highRiskInfo+=map1.get("name")+","; | |
259 | + } | |
260 | + map.put("highRiskInfo", highRiskInfo); | |
261 | + map.put("diagnose", data.get("diagnose")); | |
262 | + map.put("diagnosisTime", data.get("diagnosisTime")); | |
263 | + map.put("checkDoctor", data.get("checkDoctor")); | |
264 | + map.put("mName",data.get("mName")); | |
265 | + map.put("fmHospitalName", data.get("fmHospitalName")); | |
266 | + map.put("mPhone", data.get("mPhone")); | |
267 | + results.add(map); | |
268 | + } | |
269 | + } | |
270 | + Map<String, String> cnames = new LinkedHashMap<>(); | |
271 | + cnames.put("id", "#"); | |
272 | + cnames.put("name", "姓名"); | |
273 | + cnames.put("sex", "性别"); | |
274 | + cnames.put("birth", "出生日期"); | |
275 | + cnames.put("monthAge", "月龄"); | |
276 | + cnames.put("highRiskInfo", "高危因素"); | |
277 | + cnames.put("diagnose", "高危诊断"); | |
278 | + cnames.put("diagnosisTime", "高危确定日期"); | |
279 | + cnames.put("checkDoctor", "检查医生"); | |
280 | + cnames.put("mName", "母亲姓名"); | |
281 | + cnames.put("fmHospitalName", "分娩医院"); | |
282 | + cnames.put("mPhone", "联系电话"); | |
283 | + ResponseUtil.responseExcel(cnames, results, httpServletResponse); | |
230 | 284 | } |
231 | 285 | } |