Commit 5d29548a3d714bd4fd2fcc55192045afaee97057
1 parent
3ad11feca2
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 29 additions and 20 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStatisticsFacade.java
View file @
5d29548
... | ... | @@ -109,14 +109,8 @@ |
109 | 109 | |
110 | 110 | } |
111 | 111 | |
112 | - /** | |
113 | - * 获取儿保检查套餐总数1月 3月 6月 8月 12月 18月 24月 30月 36月 4岁 5岁 6岁 | |
114 | - * @param queryRequest | |
115 | - * @param userId | |
116 | - * @Author: 武涛涛 | |
117 | - * @Date: 2021/3/25 19:53 | |
118 | - */ | |
119 | - public BaseResponse monthLists1(BabyStatisticsQueryRequest queryRequest,Integer userId) { | |
112 | + | |
113 | + public BaseResponse monthLists_back(BabyStatisticsQueryRequest queryRequest,Integer userId) { | |
120 | 114 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
121 | 115 | long startTime=System.currentTimeMillis(); //获取开始时间 |
122 | 116 | Map <String, Object> map = new HashMap <>(); |
123 | 117 | |
124 | 118 | |
125 | 119 | |
... | ... | @@ -162,13 +156,24 @@ |
162 | 156 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(map); |
163 | 157 | |
164 | 158 | } |
159 | + /** | |
160 | + * 获取儿保检查套餐1月 3月 6月 8月 12月 18月 24月 30月 36月 4岁 5岁 6岁总数 | |
161 | + * @param queryRequest | |
162 | + * @param userId | |
163 | + * @Author: 武涛涛 | |
164 | + * @Date: 2021/3/25 19:53 | |
165 | + */ | |
165 | 166 | public BaseResponse monthLists(BabyStatisticsQueryRequest queryRequest,Integer userId) { |
166 | 167 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
167 | 168 | List <Map <String, MonthTcType>> listMaps = monthTcTypeInit(); |
168 | - | |
169 | 169 | long startTime=System.currentTimeMillis(); //获取开始时间 |
170 | + | |
170 | 171 | List <String> tcType1 = getCountOne(queryRequest, hospitalId); |
171 | 172 | List <Map> mapList = convertToMonthLists(listMaps, queryRequest, hospitalId, tcType1); |
173 | + Map map = new HashMap(); | |
174 | + map.put("tcType1", tcType1 !=null ? tcType1.size() : null); | |
175 | + mapList.add(map); | |
176 | + | |
172 | 177 | long endTime=System.currentTimeMillis(); //获取结束时间 |
173 | 178 | System.out.println("程序运行毫秒: " + (endTime - startTime) + "ms"); |
174 | 179 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(mapList); |
... | ... | @@ -192,7 +197,7 @@ |
192 | 197 | for (Future f : listFuture) { |
193 | 198 | try { |
194 | 199 | if(f!=null && f.get(85, TimeUnit.SECONDS)!=null){ |
195 | - data.addAll((List <Map>) f.get(300, TimeUnit.SECONDS)); | |
200 | + data.addAll((List <Map>) f.get(90, TimeUnit.SECONDS)); | |
196 | 201 | } |
197 | 202 | } catch (Exception e) { |
198 | 203 | ExceptionUtils.catchException(e, "convertToQuanWeight get result Future error."); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/MonthListsWorker.java
View file @
5d29548
... | ... | @@ -48,18 +48,22 @@ |
48 | 48 | public List <Map> call() throws Exception { |
49 | 49 | List <Map> data = new ArrayList <>(); |
50 | 50 | for (int i = 0; i < mapList.size(); i++) { |
51 | - if (CollectionUtils.isEmpty(countOneList)) { | |
52 | - continue; | |
53 | - } | |
54 | - Map <String, MonthTcType> integerStatisticMap = mapList.get(i); | |
55 | - for (Map.Entry <String, MonthTcType> entry : integerStatisticMap.entrySet()) { | |
56 | - // System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue()); | |
57 | - MonthTcType monthTcType = integerStatisticMap.get(entry.getKey()); | |
58 | - if (monthTcType == null) { | |
51 | + try { | |
52 | + if (CollectionUtils.isEmpty(countOneList)) { | |
59 | 53 | continue; |
60 | 54 | } |
61 | - Map <String, Object> map = monthTcType.getMonthTcType(babyStatisticsQueryRequest, hospitalId, countOneList, null); | |
62 | - data.add(map); | |
55 | + Map <String, MonthTcType> integerStatisticMap = mapList.get(i); | |
56 | + for (Map.Entry <String, MonthTcType> entry : integerStatisticMap.entrySet()) { | |
57 | + // System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue()); | |
58 | + MonthTcType monthTcType = integerStatisticMap.get(entry.getKey()); | |
59 | + if (monthTcType == null) { | |
60 | + continue; | |
61 | + } | |
62 | + Map <String, Object> map = monthTcType.getMonthTcType(babyStatisticsQueryRequest, hospitalId, countOneList, null); | |
63 | + data.add(map); | |
64 | + } | |
65 | + } catch (Exception e) { | |
66 | + e.printStackTrace(); | |
63 | 67 | } |
64 | 68 | } |
65 | 69 | return data; |