Commit 348779884882c0ec494cd25a3af0446717be9fef

Authored by jiangjiazhi
1 parent 4dc4d05422

增加设置parentid

Showing 5 changed files with 75 additions and 8 deletions

platform-dal/src/main/java/com/lyms/platform/query/PostReviewQuery.java View file @ 3487798
... ... @@ -22,6 +22,16 @@
22 22 private Date end;
23 23 private String pid;
24 24  
  25 + private String hospitalId;
  26 +
  27 + public String getHospitalId() {
  28 + return hospitalId;
  29 + }
  30 +
  31 + public void setHospitalId(String hospitalId) {
  32 + this.hospitalId = hospitalId;
  33 + }
  34 +
25 35 public String getPid() {
26 36 return pid;
27 37 }
... ... @@ -85,7 +95,9 @@
85 95 if(null!=parentId){
86 96 mongoCondition= mongoCondition.and("parentId",parentId, MongoOper.IS);
87 97 }
88   -
  98 + if(null!=hospitalId){
  99 + mongoCondition=mongoCondition.and("hospitalId",hospitalId,MongoOper.IS);
  100 + }
89 101 boolean isAddStart = Boolean.FALSE;
90 102 Criteria c = null;
91 103 if (null != start) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java View file @ 3487798
... ... @@ -221,13 +221,13 @@
221 221 if (CollectionUtils.isNotEmpty(patientses)) {
222 222 //如果是查高危孕妇
223 223 if (null != isHighRisk && Boolean.TRUE.equals(isHighRisk)) {
224   - data = convertToHighRisk(patientses);
  224 + data = convertToHighRisk(patientses,userId);
225 225 } else if (type == 1) {
226 226 //处理全部孕妇的情况
227   - data = convertToQuanPatient(patientses);
  227 + data = convertToQuanPatient(patientses,userId);
228 228 //处理全部产妇
229 229 } else if (type == 3) {
230   - data = convertToQuanCPatient(patientses);
  230 + data = convertToQuanCPatient(patientses,userId);
231 231 }
232 232 }
233 233 return new BaseObjectResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data);
234 234  
235 235  
... ... @@ -260,10 +260,10 @@
260 260 * @param patientses 符合条件的产妇
261 261 * @return
262 262 */
263   - private List convertToQuanCPatient(List<Patients> patientses) {
  263 + private List convertToQuanCPatient(List<Patients> patientses,Integer userId) {
264 264 List data = new ArrayList<>();
265   - AntExChuQuery antExChuQuery = new AntExChuQuery();
266 265 AntExQuery antExQuery = new AntExQuery();
  266 + String hospital=autoMatchFacade.getHospitalId(userId);
267 267 for (Patients patients : patientses) {
268 268 QuanChanResult chanResult = new QuanChanResult();
269 269 chanResult.convertToResult(patients);
... ... @@ -305,6 +305,8 @@
305 305 if (CollectionUtils.isNotEmpty(withList)) {
306 306 chanResult.setcTimes(withList.size());
307 307 nextCheckTime = withList.get(0).getNextCheckTime();
  308 + postReviewQuery.setHospitalId(hospital);
  309 + chanResult.setcHTimes(postReviewService.count(postReviewQuery));
308 310 if(StringUtils.isNotEmpty(withList.get(0).getProdDoctor())){
309 311 Users users = usersService.getUsers(NumberUtils.toInt(withList.get(0).getProdDoctor()));
310 312 if(null!=users){
311 313  
... ... @@ -319,10 +321,11 @@
319 321 }
320 322  
321 323  
322   - private List convertToQuanPatient(List<Patients> patientses) {
  324 + private List convertToQuanPatient(List<Patients> patientses,Integer userId) {
323 325 AntExChuQuery antExChuQuery = new AntExChuQuery();
324 326 AntExQuery antExQuery = new AntExQuery();
325 327 List data = new ArrayList<>();
  328 + String hospital=autoMatchFacade.getHospitalId(userId);
326 329 for (Patients patients : patientses) {
327 330 QuanPatientsResult quanPatientsResult = new QuanPatientsResult();
328 331 quanPatientsResult.convertToResult(patients);
... ... @@ -360,6 +363,18 @@
360 363 //初诊次数
361 364 int b = antExService.queryAntExChuCount(antExChuQuery.convertToQuery());
362 365 quanPatientsResult.setcTimes(i + b);
  366 +
  367 +
  368 + antExChuQuery.setHospitalId(hospital);
  369 +
  370 + antExQuery.setHospitalId(hospital);
  371 + //本院初诊
  372 + int chi= antExService.queryAntExChuCount(antExChuQuery.convertToQuery());
  373 +
  374 + //本院复诊
  375 + int chb= antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery());
  376 + quanPatientsResult.setcHTimes(chi+chb);
  377 +
363 378 String nextCheckTime = "";
364 379 List<AntenatalExaminationModel> examinationModels = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
365 380 if (CollectionUtils.isNotEmpty(examinationModels)) {
366 381  
... ... @@ -384,10 +399,11 @@
384 399 * @param patientses
385 400 * @return
386 401 */
387   - private List convertToHighRisk(List<Patients> patientses) {
  402 + private List convertToHighRisk(List<Patients> patientses,Integer userId) {
388 403 AntExChuQuery antExChuQuery = new AntExChuQuery();
389 404 AntExQuery antExQuery = new AntExQuery();
390 405 List data = new ArrayList<>();
  406 + String hospital=autoMatchFacade.getHospitalId(userId);
391 407 for (Patients patients : patientses) {
392 408 RiskPatientsResult riskPatientsResult = new RiskPatientsResult();
393 409 riskPatientsResult.convertToResult(patients);
394 410  
395 411  
... ... @@ -423,8 +439,16 @@
423 439 antExChuQuery.setParentId(patients.getId());
424 440 antExChuQuery.setYn(YnEnums.YES.getId());
425 441 //初诊次数
  442 +
426 443 int b = antExService.queryAntExChuCount(antExChuQuery.convertToQuery());
  444 + antExQuery.setHospitalId(hospital);
  445 + //本院的复诊记录
  446 + int chi=antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery());
  447 + antExChuQuery.setHospitalId(hospital);
  448 + //本院的初诊记录
  449 + int chb = antExService.queryAntExChuCount(antExChuQuery.convertToQuery());
427 450 riskPatientsResult.setcTimes(i + b);
  451 + riskPatientsResult.setcHTimes(chi+chb);
428 452 String nextCheckTime = "";
429 453 List<AntenatalExaminationModel> examinationModels = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
430 454 if (CollectionUtils.isNotEmpty(examinationModels)) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanChanResult.java View file @ 3487798
... ... @@ -24,6 +24,9 @@
24 24 //产检次数
25 25 private int cTimes=0;
26 26  
  27 + //产检次数
  28 + private int cHTimes=0;
  29 +
27 30 //产检医生
28 31 private String checkDoctor;
29 32 //登记人
... ... @@ -33,6 +36,14 @@
33 36 private String phone;
34 37 private String nextCheckTime;
35 38 private String pid;
  39 +
  40 + public int getcHTimes() {
  41 + return cHTimes;
  42 + }
  43 +
  44 + public void setcHTimes(int cHTimes) {
  45 + this.cHTimes = cHTimes;
  46 + }
36 47  
37 48 public String getPid() {
38 49 return pid;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanPatientsResult.java View file @ 3487798
... ... @@ -28,6 +28,9 @@
28 28  
29 29 //产检次数
30 30 private int cTimes;
  31 +
  32 + //产检次数
  33 + private int cHTimes;
31 34 //预产期
32 35 private String dueDate;
33 36 //产检医生
... ... @@ -42,6 +45,14 @@
42 45 //服务类型
43 46 private String serviceType;
44 47 private String pid;
  48 +
  49 + public int getcHTimes() {
  50 + return cHTimes;
  51 + }
  52 +
  53 + public void setcHTimes(int cHTimes) {
  54 + this.cHTimes = cHTimes;
  55 + }
45 56  
46 57 public String getPid() {
47 58 return pid;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/RiskPatientsResult.java View file @ 3487798
... ... @@ -36,6 +36,8 @@
36 36 private Integer hScore;
37 37 //产检次数
38 38 private int cTimes;
  39 + //本院产检次数
  40 + private int cHTimes;
39 41 //预产期
40 42 private String dueDate;
41 43 //产检医生
... ... @@ -74,6 +76,13 @@
74 76 }
75 77  
76 78  
  79 + public int getcHTimes() {
  80 + return cHTimes;
  81 + }
  82 +
  83 + public void setcHTimes(int cHTimes) {
  84 + this.cHTimes = cHTimes;
  85 + }
77 86  
78 87 public String getcTime() {
79 88 if(null==cTime){