Commit 0c7bc7f40d6b899f529685893478b8eed6ee4158
1 parent
9d4196fe61
Exists in
master
and in
6 other branches
update
Showing 7 changed files with 221 additions and 27 deletions
- platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RiskReportController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyManageRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/BabyQhdHiskCountTask.java
platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
View file @
0c7bc7f
| ... | ... | @@ -140,7 +140,6 @@ |
| 140 | 140 | |
| 141 | 141 | //高危ID |
| 142 | 142 | private String highRiskInfo; |
| 143 | - private String diagnosehighRiskInfo; | |
| 144 | 143 | |
| 145 | 144 | //体弱ID |
| 146 | 145 | private String weakSonInfo; |
| 147 | 146 | |
| ... | ... | @@ -1029,11 +1028,7 @@ |
| 1029 | 1028 | if (!StringUtils.isEmpty(lastDiagnose)) { |
| 1030 | 1029 | condition = condition.and("lastDiagnose", lastDiagnose, MongoOper.IN); |
| 1031 | 1030 | } |
| 1032 | - if (!StringUtils.isEmpty(diagnosehighRiskInfo)) { | |
| 1033 | - condition = condition.and("diagnose", diagnosehighRiskInfo, MongoOper.IS); | |
| 1034 | - } | |
| 1035 | 1031 | |
| 1036 | - | |
| 1037 | 1032 | if (!StringUtils.isEmpty(highRiskInfo)) { |
| 1038 | 1033 | condition = condition.and("highRiskInfo", highRiskInfo, MongoOper.IN); |
| 1039 | 1034 | } |
| ... | ... | @@ -1351,14 +1346,6 @@ |
| 1351 | 1346 | |
| 1352 | 1347 | public void setNextDateStart(Date nextDateStart) { |
| 1353 | 1348 | this.nextDateStart = nextDateStart; |
| 1354 | - } | |
| 1355 | - | |
| 1356 | - public String getDiagnosehighRiskInfo() { | |
| 1357 | - return diagnosehighRiskInfo; | |
| 1358 | - } | |
| 1359 | - | |
| 1360 | - public void setDiagnosehighRiskInfo(String diagnosehighRiskInfo) { | |
| 1361 | - this.diagnosehighRiskInfo = diagnosehighRiskInfo; | |
| 1362 | 1349 | } |
| 1363 | 1350 | |
| 1364 | 1351 | public Date getNextDateEnd() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
View file @
0c7bc7f
| ... | ... | @@ -220,7 +220,6 @@ |
| 220 | 220 | @RequestParam(value = "name", required = false) String name, |
| 221 | 221 | @RequestParam(value = "highRiskType", required = false) Integer highRiskType, |
| 222 | 222 | @RequestParam(value = "diagnose", required = false) String diagnose, |
| 223 | - @RequestParam(value = "diagnosehighRiskInfo", required = false) String diagnosehighRiskInfo, | |
| 224 | 223 | @RequestParam(value = "dateRange", required = false) String dateRange, |
| 225 | 224 | @RequestParam(value = "highRiskInfos", required = false) List highRiskInfos, |
| 226 | 225 | @RequestParam(value = "weakSonInfos", required = false) List weakSonInfos, |
| ... | ... | @@ -258,7 +257,6 @@ |
| 258 | 257 | request.setVcCardNo(vcCardNo); |
| 259 | 258 | request.setWeakSonInfos(weakSonInfos); |
| 260 | 259 | request.setHighRiskInfos(highRiskInfos); |
| 261 | - request.setDiagnosehighRiskInfo(diagnosehighRiskInfo); | |
| 262 | 260 | request.setShowDetail(showDetail); |
| 263 | 261 | request.setBuildDoctor(buildDoctor); |
| 264 | 262 | request.setQueryNo(queryNo); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RiskReportController.java
View file @
0c7bc7f
| ... | ... | @@ -37,7 +37,13 @@ |
| 37 | 37 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 38 | 38 | return riskReportFacade.queryBabyRiskReport(babysQueryRequest,loginState.getId()); |
| 39 | 39 | } |
| 40 | - | |
| 40 | + @RequestMapping(method = RequestMethod.GET, value = "/queryBabyRiskReportQhd") | |
| 41 | + @ResponseBody | |
| 42 | + @TokenRequired | |
| 43 | + public BaseResponse queryBabyRiskReportQhd(@Valid RiskBabysQueryRequest babysQueryRequest, HttpServletRequest request) { | |
| 44 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 45 | + return riskReportFacade.queryBabyRiskReportQhd(babysQueryRequest,loginState.getId()); | |
| 46 | + } | |
| 41 | 47 | /** |
| 42 | 48 | * 院内高危统计报表 |
| 43 | 49 | * @return |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
0c7bc7f
| ... | ... | @@ -2194,7 +2194,6 @@ |
| 2194 | 2194 | babyQuery.setWeakSonInfo(request.getWeakSonInfo()); |
| 2195 | 2195 | //高危儿详情 |
| 2196 | 2196 | babyQuery.setHighRiskInfo(request.getHighRiskInfo()); |
| 2197 | - babyQuery.setDiagnosehighRiskInfo(request.getDiagnosehighRiskInfo()); | |
| 2198 | 2197 | //多项体弱儿因素查询条件 |
| 2199 | 2198 | babyQuery.setWeakSonInfos(request.getWeakSonInfos()); |
| 2200 | 2199 | //多项体弱儿因素查询 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java
View file @
0c7bc7f
| ... | ... | @@ -225,6 +225,141 @@ |
| 225 | 225 | return new BaseListResponse() |
| 226 | 226 | .setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(results); |
| 227 | 227 | } |
| 228 | + public BaseListResponse queryBabyRiskReportQhd(RiskBabysQueryRequest riskBabysQueryRequest, Integer userId) { | |
| 229 | + | |
| 230 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 231 | + BabyModelQuery babyModelQuery = new BabyModelQuery(); | |
| 232 | + babyModelQuery.setYn(YnEnums.YES.getId()); | |
| 233 | + babyModelQuery.setHospitalId(hospitalId); | |
| 234 | + | |
| 235 | + //建档时间 | |
| 236 | + if (StringUtils.isNotEmpty(riskBabysQueryRequest.getBuildTime())) { | |
| 237 | + String nextDateStr = riskBabysQueryRequest.getBuildTime(); | |
| 238 | + String[] dates = nextDateStr.split(" - "); | |
| 239 | + babyModelQuery.setBuildDateStart(DateUtil.parseYMD(dates[0])); | |
| 240 | + if (dates.length == 2) { | |
| 241 | + babyModelQuery.setBuildDateEnd(DateUtil.parseYMD(dates[1])); | |
| 242 | + } | |
| 243 | + } | |
| 244 | + | |
| 245 | + if (StringUtils.isNotEmpty(riskBabysQueryRequest.getBirth())) | |
| 246 | + { | |
| 247 | + String birthStr = riskBabysQueryRequest.getBirth(); | |
| 248 | + String[] dates = birthStr.split(" - "); | |
| 249 | + babyModelQuery.setBirthStart(DateUtil.parseYMD(dates[0])); | |
| 250 | + babyModelQuery.setBirthEnd(new Date(DateUtil.parseYMD(dates[1]).getTime()+24*60*60*1000 -1 )); | |
| 251 | + } | |
| 252 | + | |
| 253 | + Date currentDate = DateUtil.formatDate(new Date());if (riskBabysQueryRequest.getMonthAgeStart() != null && riskBabysQueryRequest.getMonthAgeEnd() != null) | |
| 254 | + { | |
| 255 | + Date start = DateUtil.addMonth(currentDate, -riskBabysQueryRequest.getMonthAgeStart()); | |
| 256 | + babyModelQuery.setBirthEnd(start); | |
| 257 | + | |
| 258 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -riskBabysQueryRequest.getMonthAgeEnd() - 1), 1); | |
| 259 | + babyModelQuery.setBirthStart(end); | |
| 260 | + } | |
| 261 | + | |
| 262 | + BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); | |
| 263 | + BabyModelQuery query = new BabyModelQuery(); | |
| 264 | + query.setYn(YnEnums.YES.getId()); | |
| 265 | + query.setBuildTypeList(babyModelQuery.getBuildTypeList()); | |
| 266 | + query.setHospitalId(babyModelQuery.getHospitalId()); | |
| 267 | + if (riskBabysQueryRequest.getType() == 1) { | |
| 268 | + query.setHighRisk(1); | |
| 269 | + basicConfigQuery.setParentId(SystemConfig.BABY_HIGH_RISK_ID); | |
| 270 | + } else if (riskBabysQueryRequest.getType() == 2) { | |
| 271 | + query.setWeakSon(1); | |
| 272 | + basicConfigQuery.setParentId(SystemConfig.BABY_WEAK_SON_ID); | |
| 273 | + } else return null; | |
| 274 | + | |
| 275 | + // System.out.println(query.convertToQuery().convertToMongoQuery()); | |
| 276 | + | |
| 277 | + int riskPatientCount = babyService.queryBabyCount(query); | |
| 278 | + | |
| 279 | + // int allPatientCount = babyService.queryBabyCount(babyModelQuery); | |
| 280 | + | |
| 281 | + basicConfigQuery.setYn(YnEnums.YES.getId()); | |
| 282 | + basicConfigQuery.setEnable(1); | |
| 283 | + List<Future> futures = new ArrayList<>(); | |
| 284 | + List<RiskReportResult> results = new ArrayList<>(); | |
| 285 | + List<BasicConfig> riskLevelConfig = basicConfigService.queryBasicConfig(basicConfigQuery); | |
| 286 | + if (CollectionUtils.isNotEmpty(riskLevelConfig)) { | |
| 287 | + List<RiskReportResult> mainRiskReportResults = new ArrayList<>(); | |
| 288 | + for (BasicConfig levelConfig : riskLevelConfig) { | |
| 289 | + RiskReportResult risk = new RiskReportResult(); | |
| 290 | + risk.setLevel(1); | |
| 291 | + risk.setHighRiskId(levelConfig.getId()); | |
| 292 | + risk.setHighRisk(levelConfig.getName()); | |
| 293 | + risk.setPid(levelConfig.getpId()); | |
| 294 | + mainRiskReportResults.add(risk); | |
| 295 | + } | |
| 296 | + if (riskBabysQueryRequest.getType() == 1) { | |
| 297 | + for (BasicConfig levelConfig : riskLevelConfig) { | |
| 298 | + RiskReportResult risk = new RiskReportResult(); | |
| 299 | + risk.setLevel(1); | |
| 300 | + risk.setHighRiskId(levelConfig.getId()); | |
| 301 | + risk.setHighRisk(levelConfig.getName()); | |
| 302 | + risk.setPid(levelConfig.getpId()); | |
| 303 | + Callable c = new BabyQhdHiskCountTask(basicConfigService, | |
| 304 | + babyService, levelConfig, | |
| 305 | + babyModelQuery, | |
| 306 | + riskPatientCount, riskBabysQueryRequest.getType()); | |
| 307 | + Future f = commonThreadPool.submit(c); | |
| 308 | + futures.add(f); | |
| 309 | + } | |
| 310 | + results.addAll(mainRiskReportResults); | |
| 311 | + } else if (riskBabysQueryRequest.getType() == 2) { | |
| 312 | + BasicConfig levelConfig = riskLevelConfig.get(0); | |
| 313 | + RiskReportResult risk = new RiskReportResult(); | |
| 314 | + risk.setLevel(1); | |
| 315 | + risk.setHighRiskId(levelConfig.getId()); | |
| 316 | + risk.setHighRisk(levelConfig.getName()); | |
| 317 | + risk.setPid(levelConfig.getpId()); | |
| 318 | + Callable c = new BabyHiskCountTask(basicConfigService, | |
| 319 | + babyService, levelConfig, | |
| 320 | + babyModelQuery, | |
| 321 | + riskPatientCount, riskBabysQueryRequest.getType()); | |
| 322 | + Future f = commonThreadPool.submit(c); | |
| 323 | + futures.add(f); | |
| 324 | + } | |
| 325 | + | |
| 326 | + if (CollectionUtils.isNotEmpty(futures)) { | |
| 327 | + for (Future f : futures) { | |
| 328 | + try { | |
| 329 | + results.addAll((List<RiskReportResult>) f.get()); | |
| 330 | + } catch (Exception e) { | |
| 331 | + ExceptionUtils.catchException(e, "high risk count error."); | |
| 332 | + } | |
| 333 | + } | |
| 334 | + } | |
| 335 | + Map<String, List<RiskReportResult>> slaveBasicConfigMap = new HashMap<>(); | |
| 336 | + for (RiskReportResult bc : results) { | |
| 337 | + if (riskBabysQueryRequest.getType() == 1) { | |
| 338 | + if (bc.getPid() != null) { | |
| 339 | + if (slaveBasicConfigMap.containsKey(bc.getPid())) { | |
| 340 | + slaveBasicConfigMap.get(bc.getPid()).add(bc); | |
| 341 | + } else { | |
| 342 | + List<RiskReportResult> basicConfigs = new ArrayList<>(); | |
| 343 | + basicConfigs.add(bc); | |
| 344 | + slaveBasicConfigMap.put(bc.getPid(), basicConfigs); | |
| 345 | + } | |
| 346 | + } | |
| 347 | + } | |
| 348 | + } | |
| 349 | + | |
| 350 | + if (riskBabysQueryRequest.getType() == 1) { | |
| 351 | + for (RiskReportResult bs : mainRiskReportResults) { | |
| 352 | + configData(bs, slaveBasicConfigMap, riskPatientCount); | |
| 353 | + } | |
| 354 | + } else if (riskBabysQueryRequest.getType() == 2) { | |
| 355 | + for (RiskReportResult bs : results) { | |
| 356 | + configSignData(bs, riskPatientCount); | |
| 357 | + } | |
| 358 | + } | |
| 359 | + } | |
| 360 | + return new BaseListResponse() | |
| 361 | + .setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(results); | |
| 362 | + } | |
| 228 | 363 | |
| 229 | 364 | |
| 230 | 365 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyManageRequest.java
View file @
0c7bc7f
| ... | ... | @@ -46,8 +46,6 @@ |
| 46 | 46 | private String highRiskInfo; |
| 47 | 47 | //高危儿多项 |
| 48 | 48 | private List highRiskInfos; |
| 49 | - //高危儿统计秦皇岛数据处理 | |
| 50 | - private String diagnosehighRiskInfo; | |
| 51 | 49 | //体弱儿多项 |
| 52 | 50 | private List weakSonInfos; |
| 53 | 51 | //建档医生id |
| ... | ... | @@ -425,13 +423,5 @@ |
| 425 | 423 | this.hospitalId = hospitalId; |
| 426 | 424 | } |
| 427 | 425 | |
| 428 | - | |
| 429 | - public String getDiagnosehighRiskInfo() { | |
| 430 | - return diagnosehighRiskInfo; | |
| 431 | - } | |
| 432 | - | |
| 433 | - public void setDiagnosehighRiskInfo(String diagnosehighRiskInfo) { | |
| 434 | - this.diagnosehighRiskInfo = diagnosehighRiskInfo; | |
| 435 | - } | |
| 436 | 426 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/BabyQhdHiskCountTask.java
View file @
0c7bc7f
| 1 | +package com.lyms.platform.operate.web.utils; | |
| 2 | + | |
| 3 | +import com.lyms.platform.biz.service.BabyService; | |
| 4 | +import com.lyms.platform.biz.service.BasicConfigService; | |
| 5 | +import com.lyms.platform.common.enums.YnEnums; | |
| 6 | +import com.lyms.platform.operate.web.result.RiskReportResult; | |
| 7 | +import com.lyms.platform.pojo.BasicConfig; | |
| 8 | +import com.lyms.platform.query.BabyModelQuery; | |
| 9 | +import com.lyms.platform.query.BasicConfigQuery; | |
| 10 | +import org.apache.commons.collections.CollectionUtils; | |
| 11 | + | |
| 12 | +import java.util.ArrayList; | |
| 13 | +import java.util.List; | |
| 14 | +import java.util.concurrent.Callable; | |
| 15 | +import java.util.concurrent.ExecutorService; | |
| 16 | +import java.util.concurrent.Executors; | |
| 17 | + | |
| 18 | + | |
| 19 | +public class BabyQhdHiskCountTask implements Callable { | |
| 20 | + | |
| 21 | + private static ExecutorService pool = Executors.newFixedThreadPool(6); | |
| 22 | + | |
| 23 | + private BabyService babyService; | |
| 24 | + private BasicConfigService basicConfigService; | |
| 25 | + private BasicConfig levelConfig; | |
| 26 | + private BabyModelQuery babyModelQuery; | |
| 27 | + private int allPatientCount; | |
| 28 | + private int type; | |
| 29 | + | |
| 30 | + public BabyQhdHiskCountTask(BasicConfigService basicConfigService, | |
| 31 | + BabyService babyService, BasicConfig levelConfig, | |
| 32 | + BabyModelQuery babyModelQuery, | |
| 33 | + int allPatientCount, int type) { | |
| 34 | + this.basicConfigService = basicConfigService; | |
| 35 | + this.babyService = babyService; | |
| 36 | + this.levelConfig = levelConfig; | |
| 37 | + this.babyModelQuery = babyModelQuery; | |
| 38 | + this.allPatientCount = allPatientCount; | |
| 39 | + this.type = type; | |
| 40 | + } | |
| 41 | + | |
| 42 | + @Override | |
| 43 | + public List<RiskReportResult> call() throws Exception { | |
| 44 | + BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); | |
| 45 | + basicConfigQuery.setYn(YnEnums.YES.getId()); | |
| 46 | + basicConfigQuery.setEnable(1); | |
| 47 | + if (type == 1) { | |
| 48 | + basicConfigQuery.setParentId(levelConfig.getId()); | |
| 49 | + } else if (type == 2) { | |
| 50 | + basicConfigQuery.setParentId(levelConfig.getParentId()); | |
| 51 | + } | |
| 52 | + List<RiskReportResult> results = new ArrayList<>(); | |
| 53 | + List<BasicConfig> riskConfig = basicConfigService.queryBasicConfig(basicConfigQuery); | |
| 54 | + if (CollectionUtils.isNotEmpty(riskConfig)) { | |
| 55 | + for (int i = 0; i < riskConfig.size(); i++) { | |
| 56 | + BasicConfig config = riskConfig.get(i); | |
| 57 | + babyModelQuery.setYn(YnEnums.YES.getId()); | |
| 58 | + if (type == 1) { | |
| 59 | + babyModelQuery.setLastDiagnose(config.getName());//处理秦皇岛数据,只能用name | |
| 60 | + } else if (type == 2) { | |
| 61 | + babyModelQuery.setWeakSonInfo(config.getId()); | |
| 62 | + } | |
| 63 | + int riskPatientCount = babyService.queryBabyCount(babyModelQuery); | |
| 64 | + System.out.println("name:" + config.getName() + ",riskPatientCount:" + riskPatientCount); | |
| 65 | + RiskReportResult risk = new RiskReportResult(); | |
| 66 | + risk.setHighRiskId(config.getId()); | |
| 67 | + risk.setHighRisk(config.getName()); | |
| 68 | + risk.setPid(config.getpId()); | |
| 69 | + risk.setRiskCount(riskPatientCount); | |
| 70 | + results.add(risk); | |
| 71 | + } | |
| 72 | + } | |
| 73 | + return results; | |
| 74 | + } | |
| 75 | + | |
| 76 | + | |
| 77 | +} |