Commit a2d31c906ae6b68e75d47b99029736d660142fd5

Authored by liquanyu
1 parent 92d8b332a5

update

Showing 10 changed files with 197 additions and 18 deletions

platform-biz-service/src/main/java/com/lyms/platform/permission/model/ReportMatdeliver.java View file @ a2d31c9
... ... @@ -17,6 +17,15 @@
17 17 private String sourceId;
18 18 //末次月经
19 19 private Date lastMenses;
  20 + private String fmDoctor;
  21 +
  22 + public String getFmDoctor() {
  23 + return fmDoctor;
  24 + }
  25 +
  26 + public void setFmDoctor(String fmDoctor) {
  27 + this.fmDoctor = fmDoctor;
  28 + }
20 29  
21 30 public Date getLastMenses() {
22 31 return lastMenses;
platform-biz-service/src/main/java/com/lyms/platform/permission/model/UsersQuery.java View file @ a2d31c9
... ... @@ -39,6 +39,16 @@
39 39 private String foreignId;
40 40 private Integer otherAccount; //第三方帐号, 1医院帐号
41 41  
  42 + private List<String> names;
  43 +
  44 + public List<String> getNames() {
  45 + return names;
  46 + }
  47 +
  48 + public void setNames(List<String> names) {
  49 + this.names = names;
  50 + }
  51 +
42 52 public List<Integer> getIds() {
43 53 return ids;
44 54 }
platform-biz-service/src/main/resources/mainOrm/master/MasterMysqlAntexc.xml View file @ a2d31c9
... ... @@ -1225,7 +1225,8 @@
1225 1225 fmHospital,
1226 1226 hospitalId,
1227 1227 sourceId,
1228   - lastMenses
  1228 + lastMenses,
  1229 + fmDoctor
1229 1230 ) VALUES (
1230 1231 #{mid},
1231 1232 #{parentId},
... ... @@ -1235,7 +1236,8 @@
1235 1236 #{fmHospital},
1236 1237 #{hospitalId},
1237 1238 #{sourceId},
1238   - #{lastMenses}
  1239 + #{lastMenses},
  1240 + #{fmDoctor}
1239 1241 )
1240 1242  
1241 1243 </insert>
platform-dal/src/main/java/com/lyms/platform/pojo/BabyCheckModel.java View file @ a2d31c9
... ... @@ -259,6 +259,8 @@
259 259 private Date birth;
260 260 //检查月龄
261 261 private Integer checkMonth;
  262 + //检查天数
  263 + private Integer checkDay;
262 264 //运动测评
263 265 private String sportsEvaluation;
264 266 //心理行为
265 267  
... ... @@ -537,7 +539,13 @@
537 539 //中医指导
538 540 private String tcmGuide;
539 541  
  542 + public Integer getCheckDay() {
  543 + return checkDay;
  544 + }
540 545  
  546 + public void setCheckDay(Integer checkDay) {
  547 + this.checkDay = checkDay;
  548 + }
541 549  
542 550 public String getTcmGuide() {
543 551 return tcmGuide;
platform-dal/src/main/java/com/lyms/platform/query/MatDeliverQuery.java View file @ a2d31c9
... ... @@ -141,6 +141,8 @@
141 141 private String fsHospital;
142 142 private String fsHospitalId;
143 143 private boolean isQueryFsHospitalId;
  144 + //接生医生
  145 + private String deliverDoctor;
144 146 /**
145 147 * 预约联系结果(1-成功、2-失败)
146 148 */
... ... @@ -345,6 +347,15 @@
345 347 this.hospitalIdList = hospitalIdList;
346 348 }
347 349  
  350 +
  351 + public String getDeliverDoctor() {
  352 + return deliverDoctor;
  353 + }
  354 +
  355 + public void setDeliverDoctor(String deliverDoctor) {
  356 + this.deliverDoctor = deliverDoctor;
  357 + }
  358 +
348 359 @Override
349 360 public MongoQuery convertToQuery() {
350 361 MongoCondition condition = MongoCondition.newInstance();
... ... @@ -356,6 +367,10 @@
356 367 }
357 368 if (CollectionUtils.isNotEmpty(hospitalIdList)) {
358 369 condition = condition.and("hospitalId", hospitalIdList, MongoOper.IN);
  370 + }
  371 +
  372 + if (StringUtils.isNotEmpty(deliverDoctor)) {
  373 + condition = condition.and("deliverDoctor", deliverDoctor, MongoOper.IS);
359 374 }
360 375 if (null != rHloseBloodL) {
361 376 condition = condition.and("rHloseBloodL", rHloseBloodL, MongoOper.GT);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java View file @ a2d31c9
... ... @@ -681,5 +681,22 @@
681 681 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
682 682 matDeliverFacade.exporDueOrgCount(time, loginState.getId(), hospitalId, proviceId, cityId, areaId, httpServletResponse);
683 683 }
  684 +
  685 +
  686 + /**
  687 + * 分娩管理统计(产科的)
  688 + * @param request
  689 + * @param time
  690 + * @return
  691 + */
  692 + @TokenRequired
  693 + @ResponseBody
  694 + @RequestMapping(value = "getFmManageCount", method = RequestMethod.GET)
  695 + public BaseObjectResponse getFmManageCount(HttpServletRequest request,
  696 + @RequestParam(required = true) String time) {
  697 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  698 + return matDeliverFacade.getFmManageCount(time, loginState.getId());
  699 + }
  700 +
684 701 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ a2d31c9
... ... @@ -4414,6 +4414,41 @@
4414 4414 }
4415 4415  
4416 4416  
  4417 + @RequestMapping(value = "/syncBabyCheckDay", method = RequestMethod.GET)
  4418 + @ResponseBody
  4419 + public String syncBabyCheckDay(@RequestParam(required = false) String hospitalId)
  4420 + {
  4421 + BabyCheckModelQuery query = new BabyCheckModelQuery();
  4422 + query.setYn(YnEnums.YES.getId());
  4423 + if (StringUtils.isNotEmpty(hospitalId))
  4424 + {
  4425 + query.setHospitalId(hospitalId);
  4426 + }
  4427 +
  4428 + List<BabyCheckModel> checkModels = babyCheckService.queryBabyCheckRecord(query);
  4429 + System.out.println(checkModels.size());
  4430 + if (CollectionUtils.isNotEmpty(checkModels))
  4431 + {
  4432 + for (BabyCheckModel checkModel : checkModels)
  4433 + {
  4434 + Date babyBirth = checkModel.getBirth();
  4435 + if (babyBirth != null)
  4436 + {
  4437 + BabyModel babyModel = babyBookbuildingService.queryBabyById(checkModel.getBuildId());
  4438 + if (babyModel != null)
  4439 + {
  4440 + babyBirth = babyModel.getBirth();
  4441 + }
  4442 + }
  4443 + checkModel.setCheckDay(DateUtil.getDays(babyBirth, checkModel.getCheckDate()));
  4444 + babyCheckService.updateBabyCheck(checkModel, checkModel.getId());
  4445 + System.out.println("babyId="+checkModel.getId());
  4446 + }
  4447 + }
  4448 + return "syncBabyCheckDay";
  4449 + }
  4450 +
  4451 +
4417 4452  
4418 4453 @RequestMapping(value = "/syncPatientByHospitalId", method = RequestMethod.GET)
4419 4454 @ResponseBody
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java View file @ a2d31c9
... ... @@ -512,6 +512,7 @@
512 512 List <BabyModel> babyModelList = babyBookbuildingService.queryBabyBuildByCond(babyModelQuery);
513 513 if (CollectionUtils.isNotEmpty(babyModelList)) {
514 514 model.setCheckMonth(DateUtil.getBabyAgeMonth(babyModelList.get(0).getBirth(), DateUtil.parseYMD(request.getCheckDate())));
  515 + model.setCheckDay(DateUtil.getDays(babyModelList.get(0).getBirth(), DateUtil.parseYMD(request.getCheckDate())));
515 516 model.setBirth(babyModelList.get(0).getBirth());
516 517 }
517 518 }
518 519  
519 520  
520 521  
521 522  
522 523  
523 524  
524 525  
525 526  
526 527  
527 528  
528 529  
529 530  
... ... @@ -4256,40 +4257,40 @@
4256 4257 startDate = DateUtil.getDayFirstSecond(DateUtil.parseYMD(arrs[0]));
4257 4258 endDate = DateUtil.getDayLastSecond(DateUtil.parseYMD(arrs[1]));
4258 4259 }
4259   - int allBaby = getCheckCount(hospitalId, startDate,endDate,new ArrayList<Integer>());
  4260 + int allBaby = getCheckMonthCount(hospitalId, startDate, endDate, null,null);
4260 4261  
4261 4262 if (allBaby == 0)
4262 4263 {
4263 4264 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setData(datas).setErrormsg("成功");
4264 4265 }
4265 4266  
4266   - int baby42 = getCheckCount(hospitalId, startDate,endDate,Arrays.asList(1));
  4267 + int baby42 = getCheckMonthCount(hospitalId, startDate, endDate, 0,2);
4267 4268 datas.add(getMap(baby42, allBaby));
4268 4269  
4269   - int baby3 = getCheckCount(hospitalId, startDate,endDate,Arrays.asList(3));
  4270 + int baby3 = getCheckMonthCount(hospitalId, startDate, endDate, 3,4);
4270 4271 datas.add(getMap(baby3, allBaby));
4271 4272  
4272   - int baby6 = getCheckCount(hospitalId, startDate,endDate,Arrays.asList(6));
  4273 + int baby6 = getCheckMonthCount(hospitalId, startDate, endDate, 5,6);
4273 4274 datas.add(getMap(baby6, allBaby));
4274 4275  
4275   - int baby8 = getCheckCount(hospitalId, startDate,endDate,Arrays.asList(8));
  4276 + int baby8 = getCheckMonthCount(hospitalId, startDate, endDate, 7,9);
4276 4277 datas.add(getMap(baby8,allBaby));
4277 4278  
4278   - int baby12 = getCheckCount(hospitalId, startDate,endDate,Arrays.asList(12));
  4279 + int baby12 = getCheckMonthCount(hospitalId, startDate, endDate, 10,14);
4279 4280 datas.add(getMap(baby12, allBaby));
4280   - int baby18 = getCheckCount(hospitalId, startDate,endDate,Arrays.asList(18));
  4281 + int baby18 = getCheckMonthCount(hospitalId, startDate, endDate, 15,20);
4281 4282 datas.add(getMap(baby18, allBaby));
4282   - int baby24 = getCheckCount(hospitalId, startDate,endDate,Arrays.asList(24));
  4283 + int baby24 = getCheckMonthCount(hospitalId, startDate, endDate, 21,28);
4283 4284 datas.add(getMap(baby24, allBaby));
4284   - int baby30 = getCheckCount(hospitalId, startDate,endDate,Arrays.asList(30));
  4285 + int baby30 = getCheckMonthCount(hospitalId, startDate, endDate, 29,34);
4285 4286 datas.add(getMap(baby30, allBaby));
4286   - int baby36 = getCheckCount(hospitalId, startDate,endDate,Arrays.asList(36,37,38,39,40,41,42,43,44,45,46,47));
  4287 + int baby36 = getCheckMonthCount(hospitalId, startDate, endDate, 35,38);
4287 4288 datas.add(getMap(baby36, allBaby));
4288   - int baby40 = getCheckCount(hospitalId, startDate,endDate,Arrays.asList(48,49,50,51,52,53,54,55,56,57,58,59));
  4289 + int baby40 = getCheckMonthCount(hospitalId, startDate, endDate, 39,48);
4289 4290 datas.add(getMap(baby40, allBaby));
4290   - int baby50 = getCheckCount(hospitalId, startDate,endDate,Arrays.asList(60,61,62,63,64,65,66,67,68,69,70,71));
  4291 + int baby50 = getCheckMonthCount(hospitalId, startDate, endDate, 49,65);
4291 4292 datas.add(getMap(baby50, allBaby));
4292   - int baby60 = getCheckCount(hospitalId, startDate,endDate,Arrays.asList(72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99));
  4293 + int baby60 = getCheckMonthCount(hospitalId, startDate, endDate, 66,1000);
4293 4294 datas.add(getMap(baby60, allBaby));
4294 4295  
4295 4296 datas.add(getMap(baby42+baby3+baby6+baby8+baby12+baby18+baby24+baby30+baby36+baby40+baby50+baby60, allBaby));
4296 4297  
4297 4298  
... ... @@ -4311,12 +4312,28 @@
4311 4312 }
4312 4313  
4313 4314  
4314   - private int getCheckCount(String hospitalId, Date start, Date end,List<Integer> checkMonths) {
  4315 + private int getCheckDayCount(String hospitalId, Date start, Date end,Integer startDay,Integer endDay) {
4315 4316  
4316 4317 Criteria ca = Criteria.where("hospitalId").is(hospitalId).and("checkDate").gte(start).lte(end);
4317   - if (CollectionUtils.isNotEmpty(checkMonths))
  4318 + if (startDay != null && end != null)
4318 4319 {
4319   - ca.and("checkMonth").in(checkMonths);
  4320 + ca.and("checkDay").gte(startDay).and("checkDay").lte(endDay);
  4321 + }
  4322 + Aggregation aggregation4 =
  4323 + Aggregation.newAggregation(
  4324 + Aggregation.match(ca),
  4325 + Aggregation.group("buildId").count().as("总人数"));
  4326 + AggregationResults <BasicDBObject> outputTypeCount4 =
  4327 + mongoTemplate.aggregate(aggregation4, "lyms_babycheck", BasicDBObject.class);
  4328 + return outputTypeCount4.getMappedResults().size();
  4329 + }
  4330 +
  4331 + private int getCheckMonthCount(String hospitalId, Date start, Date end,Integer startMonth,Integer endMonth) {
  4332 +
  4333 + Criteria ca = Criteria.where("hospitalId").is(hospitalId).and("checkDate").gte(start).lte(end);
  4334 + if (startMonth != null)
  4335 + {
  4336 + ca.and("checkMonth").gte(startMonth).and("checkMonth").lte(endMonth);
4320 4337 }
4321 4338 Aggregation aggregation4 =
4322 4339 Aggregation.newAggregation(
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ a2d31c9
... ... @@ -23,6 +23,7 @@
23 23 import com.lyms.platform.permission.model.Organization;
24 24 import com.lyms.platform.permission.model.OrganizationQuery;
25 25 import com.lyms.platform.permission.model.Users;
  26 +import com.lyms.platform.permission.model.UsersQuery;
26 27 import com.lyms.platform.permission.service.CouponService;
27 28 import com.lyms.platform.permission.service.OrganizationService;
28 29 import com.lyms.platform.permission.service.UsersService;
... ... @@ -3641,6 +3642,70 @@
3641 3642 BaseResponse baseResponse = new BaseResponse();
3642 3643 baseResponse.setObject("updateSize:" + updateSize + ";" + "find size:" + deliverModels.size());
3643 3644 return baseResponse;
  3645 + }
  3646 +
  3647 + public void getFmManageCount() {
  3648 + }
  3649 +
  3650 + public BaseObjectResponse getFmManageCount(String time, Integer userId) {
  3651 + String hospitalId = autoMatchFacade.getHospitalId(userId);
  3652 +
  3653 + UsersQuery usersQuery = new UsersQuery();
  3654 + usersQuery.setOrgId(Integer.parseInt(hospitalId));
  3655 + usersQuery.setNames(Arrays.asList("刘桂芬", "贾淑平", "付冬华", "宋伟", "俢素英", "李雅玲", "郝艳清", "李彩岩", "魏秀丽"));
  3656 + List<Users> users = usersService.queryUsers(usersQuery);
  3657 +
  3658 +
  3659 + MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
  3660 + matDeliverQuery.setYn(YnEnums.YES.getId());
  3661 + matDeliverQuery.setFmHospital(hospitalId);
  3662 + if (StringUtils.isNotEmpty(time))
  3663 + {
  3664 + matDeliverQuery.setCreatedStart(DateUtil.getSNDate(time)[0]);
  3665 + matDeliverQuery.setEndStart(DateUtil.getSNDate(time)[1]);
  3666 + }
  3667 + int allFmCount = matDeliverService.count(matDeliverQuery);
  3668 +
  3669 + List<Map> datas = new ArrayList<>();
  3670 + int fmNameCount = 0;
  3671 + int buildNameCount = 0;
  3672 + PatientsQuery patientsQuery = new PatientsQuery();
  3673 + patientsQuery.setHospitalId(hospitalId);
  3674 + int allBuildCount = patientsService.queryPatientCount(patientsQuery);
  3675 +
  3676 + for (Users user : users)
  3677 + {
  3678 + Map data = new HashMap();
  3679 + matDeliverQuery.setDeliverDoctor(String.valueOf(user.getId()));
  3680 + int fmCount = matDeliverService.count(matDeliverQuery);
  3681 + fmNameCount+=fmCount;
  3682 +
  3683 + data.put("name",user.getName());
  3684 + data.put("fmCount", fmCount);
  3685 +
  3686 + patientsQuery.setBookbuildingDoctor(String.valueOf(user.getId()));
  3687 +
  3688 + int buildCount = patientsService.queryPatientCount(patientsQuery);
  3689 + buildNameCount+=buildCount;
  3690 +
  3691 + data.put("buildCount", buildCount);
  3692 + data.put("buildAndFmCount", 0);
  3693 +
  3694 + datas.add(data);
  3695 + }
  3696 +
  3697 + Map data = new HashMap();
  3698 + data.put("name","本院其他医生");
  3699 + data.put("fmCount",allFmCount - fmNameCount);
  3700 + data.put("buildCount",allBuildCount - buildNameCount);
  3701 + data.put("buildAndFmCount", "-");
  3702 +
  3703 +
  3704 + BaseObjectResponse objectResponse = new BaseObjectResponse();
  3705 + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
  3706 + objectResponse.setErrormsg("成功");
  3707 + objectResponse.setData(datas);
  3708 + return objectResponse;
3644 3709 }
3645 3710 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientSyncMysqlFacade.java View file @ a2d31c9
... ... @@ -1579,6 +1579,7 @@
1579 1579 reportMatdeliver.setSourceId(StringUtils.isNotEmpty(pat.getSource()) ? pat.getSource() : maternalDeliverModel.getParentId());
1580 1580 reportMatdeliver.setMid(maternalDeliverModel.getId());
1581 1581 reportMatdeliver.setLastMenses(pat.getLastMenses());
  1582 + reportMatdeliver.setFmDoctor(maternalDeliverModel.getDeliverDoctor());
1582 1583 try {
1583 1584 ConvertUtils.register(new DateLocaleConverter(), Date.class);
1584 1585 BeanUtils.copyProperties(reportMatdeliver,maternalDeliverModel);