Commit 895068dc4f417d7b63c8aa48fd6d6274a4350b87

Authored by wtt
1 parent 4b691ce04c

update

Showing 1 changed file with 53 additions and 22 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ 895068d
... ... @@ -180,6 +180,8 @@
180 180  
181 181 @Autowired
182 182 private BabyAfterVisitService babyAfterVisitService;
  183 + @Autowired
  184 + private BabyEarFacade babyEarFacade;
183 185  
184 186 public BaseResponse getBabyBase(String babyId) {
185 187 //查询儿童的基本信息
... ... @@ -774,6 +776,31 @@
774 776 model.setEndCase(0);//秦皇岛,默认未结案
775 777 model = babyBookbuildingService.addBabyBookbuilding(model);
776 778  
  779 + /**
  780 + * start
  781 + * 眼保健保存建档时候,保存听力产筛档案
  782 + * @Author: 武涛涛
  783 + * @Date: 2020/7/22 15:42
  784 + */
  785 + BaseObjectResponse babyEarById = (BaseObjectResponse) babyEarFacade.findBabyEarById(model.getId());
  786 + BabyEarResult babyEarResult = (BabyEarResult) babyEarById.getData();//获取要保存的眼保健档案 /babyear
  787 +
  788 + BabyEarAddRequest babyEarAddRequest = new BabyEarAddRequest();
  789 + babyEarAddRequest.setBase(babyEarResult.getBase());
  790 + babyEarAddRequest.setBabyBirth(babyEarResult.getBabyBirth());
  791 + BabyPatientExtendEarMotherRequest patientExtendEarMother = new BabyPatientExtendEarMotherRequest();
  792 + Map hSTMap = new HashMap();
  793 + List jcsjUnitList = new ArrayList();
  794 + Map map1 = new HashMap();
  795 + map1.put("jcsjUnit", "1");
  796 + jcsjUnitList.add(map1);
  797 + hSTMap.put("lists", jcsjUnitList);
  798 + patientExtendEarMother.setHarmfulSubstanceType(hSTMap);
  799 + babyEarAddRequest.setPatientExtendEarMother(patientExtendEarMother);//数据模仿前端默认数据参数
  800 + babyEarAddRequest.setPatientExtendEarFamily(babyEarResult.getPatientExtendEarFamily());
  801 + babyEarFacade.addOrUpdateBabyEar(babyEarAddRequest, userId);//听力筛查建档/babyear
  802 + /*end */
  803 +
777 804 // 更新追访概况,作废档案转正
778 805 babyAfterVisitService.addOrUpdateAfterVisitData(model, TYPE_STATISTICS, STATUS_TYPE_BUILD);
779 806 //babyAfterVisitService.addOrUpdateAfterVisitData(model, TYPE_BUILD, STATUS_TYPE_NO);
780 807  
... ... @@ -1074,8 +1101,10 @@
1074 1101 patient.setType(3);
1075 1102 return patient;
1076 1103 }
  1104 +
1077 1105 @Autowired
1078 1106 private IBabyBookBuildingDao babyBookBuildingDao;
  1107 +
1079 1108 /**
1080 1109 * 封装保存对象
1081 1110 *
... ... @@ -1092,7 +1121,7 @@
1092 1121 }
1093 1122  
1094 1123 // 编码,新增时候增加修改不做处理
1095   - if(StringUtils.isEmpty(b.getId())){
  1124 + if (StringUtils.isEmpty(b.getId())) {
1096 1125 bm.setEncoded(getEncodedUtil());
1097 1126 }
1098 1127 //新生儿民族Id
... ... @@ -1303,7 +1332,7 @@
1303 1332  
1304 1333 /**
1305 1334 * 编码生成
1306   - *
  1335 + * <p>
1307 1336 * 生成规则20200721后面加001以此累加
1308 1337 * 先获取已使用的累加序号,递增生成。
1309 1338 * 如果当天没有序号那就从当前时间+001开始
1310 1339  
1311 1340  
1312 1341  
... ... @@ -1321,14 +1350,14 @@
1321 1350 babyQuery.setEncoded(true);
1322 1351 MongoQuery query = babyQuery.convertToQuery();
1323 1352 List<BabyModel> list = babyBookBuildingDao.queryBabyWithQuery(query.addOrder(Sort.Direction.DESC, "created"));
1324   - if(CollectionUtils.isNotEmpty(list)){
  1353 + if (CollectionUtils.isNotEmpty(list)) {
1325 1354 BabyModel babyModel = list.get(0);
1326   - if(StringUtils.isNotEmpty(babyModel.getEncoded()) && babyModel.getEncoded().length()>8){
  1355 + if (StringUtils.isNotEmpty(babyModel.getEncoded()) && babyModel.getEncoded().length() > 8) {
1327 1356 String encoded = babyModel.getEncoded().substring(8, babyModel.getEncoded().length());//20200721003
1328   - return DateUtil.getDateNumber(encoded);
  1357 + return DateUtil.getDateNumber(encoded);
1329 1358 }
1330 1359 }
1331   - return DateUtil.getDateNumber("0");
  1360 + return DateUtil.getDateNumber("0");
1332 1361 } catch (Exception e) {
1333 1362 e.printStackTrace();
1334 1363 }
... ... @@ -1441,7 +1470,7 @@
1441 1470 result.setBabyHighRiskReason(mongoUtil.findColor(model.getBabyHighRiskReason()));
1442 1471 List<Map> highRiskInfos = basicConfigFacade.queryBaseInfoByMap(model.getHighRiskInfo());
1443 1472 result.setHighRiskInfo(highRiskInfos);
1444   - if(CollectionUtils.isEmpty(highRiskInfos)){//支持秦皇岛儿保高危手动录入展示
  1473 + if (CollectionUtils.isEmpty(highRiskInfos)) {//支持秦皇岛儿保高危手动录入展示
1445 1474 result.setHighRiskInfo(model.getHighRiskInfo());
1446 1475 }
1447 1476  
... ... @@ -2351,6 +2380,7 @@
2351 2380 objectResponse.setErrormsg("成功");
2352 2381 return objectResponse;
2353 2382 }
  2383 +
2354 2384 public BaseListResponse queryObstetricDiagnosisQhdList(BabyManageRequest request, Integer userId) {
2355 2385  
2356 2386 String hospitalName = "";
2357 2387  
... ... @@ -2390,10 +2420,10 @@
2390 2420 }
2391 2421 models = babyBookbuildingService.queryBabyBuildByCond(babyQuery, "created", Sort.Direction.DESC);
2392 2422 //如果有高危儿多项就加一下
2393   - if(CollectionUtils.isNotEmpty(request.getHighRiskInfos())){
  2423 + if (CollectionUtils.isNotEmpty(request.getHighRiskInfos())) {
2394 2424 List<String> parentids = new ArrayList<>();
2395   - for (BabyModel model: models) {
2396   - if(StringUtils.isNotEmpty(model.getParentId())){
  2425 + for (BabyModel model : models) {
  2426 + if (StringUtils.isNotEmpty(model.getParentId())) {
2397 2427 parentids.add(model.getParentId());
2398 2428 }
2399 2429 }
2400 2430  
2401 2431  
... ... @@ -2403,16 +2433,16 @@
2403 2433 antExRecordQuery.setrFactorList(request.getHighRiskInfos());//高危儿多项
2404 2434 List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery, Sort.Direction.DESC, "created");
2405 2435 List<String> antExRecordModelparentids = new ArrayList<>();
2406   - for (AntExRecordModel antExRecordModel: antExRecordModelList) {
2407   - if(StringUtils.isNotEmpty(antExRecordModel.getParentId())){
  2436 + for (AntExRecordModel antExRecordModel : antExRecordModelList) {
  2437 + if (StringUtils.isNotEmpty(antExRecordModel.getParentId())) {
2408 2438 antExRecordModelparentids.add(antExRecordModel.getParentId());
2409 2439 }
2410 2440 }
2411 2441 //如果有高危条件,没有查询到高危信息,那就返回null
2412   - if(CollectionUtils.isEmpty(antExRecordModelparentids)){
  2442 + if (CollectionUtils.isEmpty(antExRecordModelparentids)) {
2413 2443 models = null;
2414 2444 babyQuery.mysqlBuild(0);
2415   - }else {
  2445 + } else {
2416 2446 babyQuery.setParentIds(antExRecordModelparentids);
2417 2447 models = babyBookbuildingService.queryBabyBuildByCond(babyQuery, "created", Sort.Direction.DESC);
2418 2448  
... ... @@ -4347,6 +4377,7 @@
4347 4377 objectResponse.setErrormsg("成功");
4348 4378 return objectResponse;
4349 4379 }
  4380 +
4350 4381 /**
4351 4382 * 秦皇岛 诊断(新生儿,产科)管理查询 list
4352 4383 *
4353 4384  
... ... @@ -4357,14 +4388,14 @@
4357 4388 * @Author: 武涛涛
4358 4389 * @Date: 2020/7/14 11:31
4359 4390 */
4360   - public BaseListResponse getBabyDiacrisisListQhd(BabyDiagnoseQuery babyDiagnoseQuery, Integer page, Integer limit,String type) {
  4391 + public BaseListResponse getBabyDiacrisisListQhd(BabyDiagnoseQuery babyDiagnoseQuery, Integer page, Integer limit, String type) {
4361 4392 List<Map<String, Object>> result = new ArrayList<>();
4362 4393  
4363 4394 babyDiagnoseQuery.setLimit(limit);
4364 4395 babyDiagnoseQuery.setPage(page);
4365 4396 babyDiagnoseQuery.setNeed("true");
4366 4397 babyDiagnoseQuery.setSort(" cyrq desc ");
4367   - if(StringUtils.isNotEmpty(type)){
  4398 + if (StringUtils.isNotEmpty(type)) {
4368 4399 babyDiagnoseQuery.setType(type);
4369 4400 }
4370 4401 if (StringUtils.isNotEmpty(babyDiagnoseQuery.getStartDischargeDate()) && StringUtils.isNotEmpty(babyDiagnoseQuery.getEndDischargeDate())) {
... ... @@ -4435,7 +4466,7 @@
4435 4466  
4436 4467 public BaseObjectResponse queryNewBabyDiagnoseQhd(String lrrqStart, String lrrqEnd, String type) {
4437 4468  
4438   - int size = handleBabyDiagnoseQhd(lrrqStart, lrrqEnd,type);
  4469 + int size = handleBabyDiagnoseQhd(lrrqStart, lrrqEnd, type);
4439 4470 return new BaseObjectResponse()
4440 4471 .setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(size);
4441 4472 }
4442 4473  
... ... @@ -4477,12 +4508,12 @@
4477 4508 *
4478 4509 * @param lrrqStart
4479 4510 * @param lrrqEnd
4480   - * @param type 1 新生儿科、2 产科住院数据
  4511 + * @param type 1 新生儿科、2 产科住院数据
4481 4512 * @Author: 武涛涛
4482 4513 * @Date: 2020/7/14 10:13
4483 4514 */
4484 4515 public int handleBabyDiagnoseQhd(String lrrqStart, String lrrqEnd, String type) {
4485   - List<BabyDischargeDiagnosisModel> list = qhdfyHisService.queryNewBabyDiagnoseQhd(lrrqStart, lrrqEnd,type);
  4516 + List<BabyDischargeDiagnosisModel> list = qhdfyHisService.queryNewBabyDiagnoseQhd(lrrqStart, lrrqEnd, type);
4486 4517  
4487 4518 if (CollectionUtils.isNotEmpty(list)) {
4488 4519 Map param = new HashMap();
... ... @@ -4495,7 +4526,7 @@
4495 4526 /* 注意:会有个问题,就是以前历史数据会不能区分是1 新生儿科或2 产科住院数据*/
4496 4527 babyDiagnoseModel.setType(type);
4497 4528 babyDiagnoseService.addBabyDiagnose(babyDiagnoseModel);
4498   - }else if (CollectionUtils.isNotEmpty(dbList)) {
  4529 + } else if (CollectionUtils.isNotEmpty(dbList)) {
4499 4530 BabyDiagnoseModel babyDiagnoseModel = dbList.get(0);
4500 4531 babyDiagnoseModel.setType(type);
4501 4532 babyDiagnoseService.updateBabyDiagnoseType(babyDiagnoseModel);
4502 4533  
... ... @@ -4524,9 +4555,9 @@
4524 4555 System.out.println("lrrqEnd =" + lrrqEnd);
4525 4556 // int size = handleBabyDiagnose(lrrqStart, lrrqEnd);
4526 4557 //秦皇岛诊断数据定时同步到mysql数据库中
4527   - int size1 = handleBabyDiagnoseQhd(lrrqStart, lrrqEnd,"1");
  4558 + int size1 = handleBabyDiagnoseQhd(lrrqStart, lrrqEnd, "1");
4528 4559 System.out.println("autoGetBabyDiagnose size1 " + size1);
4529   - int size2 = handleBabyDiagnoseQhd(lrrqStart, lrrqEnd,"2");
  4560 + int size2 = handleBabyDiagnoseQhd(lrrqStart, lrrqEnd, "2");
4530 4561 System.out.println("autoGetBabyDiagnose size2 " + size2);
4531 4562  
4532 4563 }