Commit f19c1702c2e4827aa89a26eb978fbb9e90bb50f4

Authored by jiangjiazhi
1 parent 01050976b8

增加需求

Showing 20 changed files with 396 additions and 50 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/AntExChuModel.java View file @ f19c170
... ... @@ -301,8 +301,16 @@
301 301 private String ydqjd;
302 302  
303 303 private Date modified;
  304 + //操作人
  305 + private Integer operator;
304 306  
  307 + public Integer getOperator() {
  308 + return operator;
  309 + }
305 310  
  311 + public void setOperator(Integer operator) {
  312 + this.operator = operator;
  313 + }
306 314  
307 315 public String getCestationInfo() {
308 316 return cestationInfo;
platform-dal/src/main/java/com/lyms/platform/pojo/AntenatalExaminationModel.java View file @ f19c170
... ... @@ -92,6 +92,16 @@
92 92 private Date modified;
93 93 private String hospitalId;
94 94 private String cDueWeek;
  95 + //操作人
  96 + private Integer operator;
  97 +
  98 + public Integer getOperator() {
  99 + return operator;
  100 + }
  101 +
  102 + public void setOperator(Integer operator) {
  103 + this.operator = operator;
  104 + }
95 105  
96 106 public String getPid() {
97 107 return pid;
platform-dal/src/main/java/com/lyms/platform/pojo/MaternalDeliverModel.java View file @ f19c170
... ... @@ -30,14 +30,25 @@
30 30 //胎盘
31 31 private String placenta;
32 32 private String deathCauseText;
  33 + //操作人
  34 + private Integer operator;
  35 +
  36 + public Integer getOperator() {
  37 + return operator;
  38 + }
  39 +
  40 + public void setOperator(Integer operator) {
  41 + this.operator = operator;
  42 + }
  43 +
33 44 /*//心率
34   - private double heartRate;
35   - //胎方位
36   - private String fetalPosition;
37   - //胎先露
38   - private String fetalPresentation;
39   - // 衔接
40   - private String join;*/
  45 + private double heartRate;
  46 + //胎方位
  47 + private String fetalPosition;
  48 + //胎先露
  49 + private String fetalPresentation;
  50 + // 衔接
  51 + private String join;*/
41 52 //存放胎盘信息
42 53 private List placentas;
43 54 //分娩方式
platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java View file @ f19c170
... ... @@ -227,6 +227,37 @@
227 227 private String enable;
228 228 //最后一次高危时间
229 229 private Date lastRhTime;
  230 + //本院最后一次产检时间
  231 + private Date lastCTime;
  232 + //本院产后复查次数
  233 + private Integer postViewTimes;
  234 + //操作人
  235 + private Integer operator;
  236 +
  237 +
  238 + public Date getLastCTime() {
  239 + return lastCTime;
  240 + }
  241 +
  242 + public void setLastCTime(Date lastCTime) {
  243 + this.lastCTime = lastCTime;
  244 + }
  245 +
  246 + public Integer getPostViewTimes() {
  247 + return postViewTimes;
  248 + }
  249 +
  250 + public void setPostViewTimes(Integer postViewTimes) {
  251 + this.postViewTimes = postViewTimes;
  252 + }
  253 +
  254 + public Integer getOperator() {
  255 + return operator;
  256 + }
  257 +
  258 + public void setOperator(Integer operator) {
  259 + this.operator = operator;
  260 + }
230 261  
231 262 public Date getLastRhTime() {
232 263 return lastRhTime;
platform-dal/src/main/java/com/lyms/platform/pojo/PostReviewModel.java View file @ f19c170
... ... @@ -93,7 +93,16 @@
93 93 private Date modified;
94 94 private String hospitalId;
95 95  
  96 + //操作人
  97 + private Integer operator;
96 98  
  99 + public Integer getOperator() {
  100 + return operator;
  101 + }
  102 +
  103 + public void setOperator(Integer operator) {
  104 + this.operator = operator;
  105 + }
97 106  
98 107 public String getPid() {
99 108 return pid;
platform-dal/src/main/java/com/lyms/platform/pojo/ReferralApplyOrderModel.java View file @ f19c170
... ... @@ -83,6 +83,16 @@
83 83 private Integer type;
84 84  
85 85 private Integer serviceType;
  86 + //操作人
  87 + private String operator;
  88 +
  89 + public String getOperator() {
  90 + return operator;
  91 + }
  92 +
  93 + public void setOperator(String operator) {
  94 + this.operator = operator;
  95 + }
86 96  
87 97 public Integer getDays() {
88 98 return days;
platform-dal/src/main/java/com/lyms/platform/pojo/SieveApplyOrderModel.java View file @ f19c170
... ... @@ -26,7 +26,16 @@
26 26 private Integer status;
27 27 private String hospitalId;
28 28 private Integer yn;
  29 + //操作人
  30 + private String operator;
29 31  
  32 + public String getOperator() {
  33 + return operator;
  34 + }
  35 +
  36 + public void setOperator(String operator) {
  37 + this.operator = operator;
  38 + }
30 39 private Date modified;
31 40  
32 41 public String getHospitalId() {
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java View file @ f19c170
... ... @@ -80,6 +80,10 @@
80 80 private Date lastRhTimeEnd;
81 81 private Date lastMensesNeEnd;
82 82  
  83 + //本院最后一次产检时间
  84 + private Date lastCTimeStart;
  85 + private Date lastCTimeEnd;
  86 +
83 87 public Date getLastMensesNeEnd() {
84 88 return lastMensesNeEnd;
85 89 }
... ... @@ -127,7 +131,7 @@
127 131 */
128 132 private String phone;
129 133 /**
130   - * 产妇分娩日
  134 + * 预产
131 135 */
132 136 private Date dueDateStart;
133 137  
... ... @@ -226,6 +230,23 @@
226 230 //大于创建时间
227 231 //大于创建时间
228 232 private Date gteCreated;
  233 +
  234 +
  235 + public Date getLastCTimeStart() {
  236 + return lastCTimeStart;
  237 + }
  238 +
  239 + public void setLastCTimeStart(Date lastCTimeStart) {
  240 + this.lastCTimeStart = lastCTimeStart;
  241 + }
  242 +
  243 + public Date getLastCTimeEnd() {
  244 + return lastCTimeEnd;
  245 + }
  246 +
  247 + public void setLastCTimeEnd(Date lastCTimeEnd) {
  248 + this.lastCTimeEnd = lastCTimeEnd;
  249 + }
229 250  
230 251 public Date getGteCreated() {
231 252 return gteCreated;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java View file @ f19c170
... ... @@ -58,13 +58,15 @@
58 58 */
59 59 @RequestMapping(method = RequestMethod.POST, value = "/addOrUpdateYunBuild")
60 60 @ResponseBody
61   - public BaseResponse addOrUpdateYunBuild(@RequestBody YunBookbuildingAddRequest yunBookbuildingAddRequest) {
  61 + @TokenRequired
  62 + public BaseResponse addOrUpdateYunBuild(@RequestBody YunBookbuildingAddRequest yunBookbuildingAddRequest,HttpServletRequest request) {
  63 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
62 64 if (yunBookbuildingAddRequest != null && !StringUtils.isEmpty(yunBookbuildingAddRequest.getId()) )
63 65 {
64   - return bookbuildingFacade.updatePregnantById(yunBookbuildingAddRequest.getId(), yunBookbuildingAddRequest);
  66 + return bookbuildingFacade.updatePregnantById(yunBookbuildingAddRequest.getId(), yunBookbuildingAddRequest,loginState.getId());
65 67  
66 68 }
67   - BaseObjectResponse p = bookbuildingFacade.addPregnantBookbuilding(yunBookbuildingAddRequest);
  69 + BaseObjectResponse p = bookbuildingFacade.addPregnantBookbuilding(yunBookbuildingAddRequest,loginState.getId());
68 70 return p;
69 71 }
70 72  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ f19c170
... ... @@ -58,7 +58,59 @@
58 58 @Autowired
59 59 private DeleteProcessHandler deleteProcessHandler;
60 60  
  61 + /**
  62 + * 修改最后一次产检时间
  63 + * @param hospitalId
  64 + * @param id
  65 + * @param type 1 初诊 2 复诊
  66 + */
  67 + private void setLashCTimes(String hospitalId,String id,int type){
61 68  
  69 + Patients patients = patientsService.findOnePatientById(id);
  70 + List<Date> list = new ArrayList<>();
  71 + if(type==2){
  72 + AntExQuery antExQuery=new AntExQuery();
  73 + antExQuery.setYn(YnEnums.YES.getId());
  74 + antExQuery.setHospitalId(hospitalId);
  75 + antExQuery.setParentId(id);
  76 + List<AntenatalExaminationModel> antExList= antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery());
  77 + if(CollectionUtils.isNotEmpty(antExList)){
  78 + for (AntenatalExaminationModel antEx : antExList) {
  79 + list.add(antEx.getCheckDate());
  80 + }
  81 + }
  82 + }else if(type==1) {
  83 + AntExChuQuery antExChuQuery=new AntExChuQuery();
  84 + antExChuQuery.setYn(YnEnums.YES.getId());
  85 + antExChuQuery.setHospitalId(hospitalId);
  86 + antExChuQuery.setParentId(id);
  87 + List<AntExChuModel> antExChu = antenatalExaminationService.queryAntExChu(antExChuQuery.convertToQuery());
  88 + if(CollectionUtils.isNotEmpty(antExChu)){
  89 + for (AntExChuModel antEx : antExChu) {
  90 + list.add(antEx.getCheckTime());
  91 + }
  92 + }
  93 + }
  94 +
  95 + if(CollectionUtils.isNotEmpty(list)){
  96 + Collections.sort(list, new Comparator<Date>() {
  97 + @Override
  98 + public int compare(Date o1, Date o2) {
  99 + if (o1 != null && o1.after(o2)) {
  100 + return -1;
  101 + }
  102 + if (o1 != null && o1.before(o2)) {
  103 + return 1;
  104 + }
  105 + return 0;
  106 + }
  107 + });
  108 + Patients patients1=new Patients();
  109 + patients1.setLastCTime(list.get(0));
  110 + patients1.setId(patients.getId());
  111 + patientsService.updatePatient(patients1);
  112 + }
  113 + }
62 114 /**
63 115 * 增加一条产前检查
64 116 *
65 117  
66 118  
67 119  
68 120  
69 121  
... ... @@ -70,22 +122,27 @@
70 122 if (StringUtils.isNotEmpty(antExAddRequest.getId())) {
71 123 AntenatalExaminationModel antenatalExamination = antExAddRequest.convertToDataModel();
72 124 antenatalExamination.setHospitalId(hospitalId);
  125 + antenatalExamination.setOperator(userId);
73 126 antenatalExaminationService.updateOneAnt(antenatalExamination, antExAddRequest.getId());
74 127 //修改申请单状态
75 128 updateApplyOrder(antenatalExamination, antExAddRequest.getParentId());
76   - //修改孕妇高危等级
  129 +
77 130 Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId());
  131 +
  132 + //修改最后一次检查时间
  133 + setLashCTimes(hospitalId,antExAddRequest.getParentId(),2);
  134 +
78 135 patients.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor());
79 136  
80   -// updatePatientRiskLevel(antenatalExamination, patients);
81 137 patientsService.updatePatient(patients);
82   -
  138 + //修改孕妇高危等级
83 139 updateLastRisk(antExAddRequest.getParentId());
84 140  
85 141 //修改本院最后一次定义高危
86 142 updateLastRhTime(patients.getId(), hospitalId);
87 143 } else {
88 144 AntenatalExaminationModel model = antExAddRequest.convertToDataModel();
  145 + model.setOperator(userId);
89 146 model.setYn(YnEnums.YES.getId());
90 147 model.setHospitalId(hospitalId);
91 148 AntExQuery antExQuery = new AntExQuery();
... ... @@ -104,6 +161,9 @@
104 161 }
105 162 patientsService.updatePatient(patients);
106 163 antenatalExaminationService.addOneBabyAnt(model);
  164 +
  165 + //修改最后一次检查时间
  166 + setLashCTimes(hospitalId, antExAddRequest.getParentId(),2);
107 167 //修改申请单状态
108 168 updateApplyOrder(model, antExAddRequest.getParentId());
109 169 //修改孕妇高危等级
... ... @@ -111,6 +171,7 @@
111 171  
112 172 updateLastRisk(antExAddRequest.getParentId());
113 173  
  174 +
114 175 //修改本院最后一次定义高危
115 176 updateLastRhTime(patients.getId(), hospitalId);
116 177 if (null != patients.getBuildType() && patients.getBuildType() == 3) {
... ... @@ -174,6 +235,7 @@
174 235 public BaseResponse addOneAnetExChu(AntExcAddRequest excAddRequest, Integer userId) {
175 236 AntExChuModel antExChuModel = excAddRequest.convertToDataModel();
176 237 String hospitalId = autoMatchFacade.getHospitalId(userId);
  238 + antExChuModel.setOperator(userId);
177 239 if (StringUtils.isNotEmpty(antExChuModel.getId()) && StringUtils.isNotEmpty(antExChuModel.getParentId())) {
178 240 antExChuModel.setHospitalId(hospitalId);
179 241 antenatalExaminationService.updateAntExChu(antExChuModel, antExChuModel.getId());
... ... @@ -192,6 +254,8 @@
192 254 //修改本院最后一次定义高危
193 255 updateLastRhTime(patients.getId(), hospitalId);
194 256  
  257 + setLashCTimes(hospitalId,antExChuModel.getParentId(),1);
  258 +
195 259 } else {
196 260 AntExChuQuery antExChuQuery1 = new AntExChuQuery();
197 261 antExChuQuery1.setParentId(excAddRequest.getParentId());
... ... @@ -229,7 +293,7 @@
229 293  
230 294 //修改本院最后一次定义高危
231 295 updateLastRhTime(patients.getId(), hospitalId);
232   -
  296 + setLashCTimes(hospitalId,antExChuModel.getParentId(),1);
233 297 if (null != patients.getBuildType() && patients.getBuildType() == 3) {
234 298 Patients patients1 = new Patients();
235 299 patients1.setEnable("1");
236 300  
... ... @@ -1294,9 +1358,11 @@
1294 1358 if (deleteProcessHandler.deleteAntEx(localAntModel.getPid(), localAntModel.getCheckDate(), hospital, true)) {
1295 1359 antenatalExaminationService.updateOneAnt(antEx, antExQueryRequest.getId());
1296 1360  
1297   -
  1361 + //修改最后一次检查时间
1298 1362 AntenatalExaminationModel antenatalExaminationModel = antenatalExaminationService.findOneById(antExQueryRequest.getId());
1299 1363  
  1364 + setLashCTimes(hospital,antenatalExaminationModel.getParentId(),2);
  1365 +
1300 1366 updateLastRisk(antenatalExaminationModel.getParentId());
1301 1367  
1302 1368 } else {
... ... @@ -1344,7 +1410,7 @@
1344 1410 antenatalExaminationService.updateAntExChu(antExChuModel, antExQueryRequest.getId());
1345 1411  
1346 1412 AntExChuModel antExChuModel1 = antenatalExaminationService.findOne(antExQueryRequest.getId());
1347   -
  1413 + setLashCTimes(hospital,antExChuModel1.getParentId(),1);
1348 1414 updateLastRisk(antExChuModel1.getParentId());
1349 1415  
1350 1416 } else {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java View file @ f19c170
... ... @@ -104,7 +104,7 @@
104 104 * @return
105 105 */
106 106 public BaseObjectResponse addPregnantBookbuilding(
107   - YunBookbuildingAddRequest yunRequest) {
  107 + YunBookbuildingAddRequest yunRequest,Integer userId) {
108 108  
109 109 BaseObjectResponse br = new BaseObjectResponse();
110 110 PatientsQuery patientsQuery = new PatientsQuery();
... ... @@ -226,6 +226,7 @@
226 226  
227 227 patient.setCreated(new Date());
228 228 patient.setModified(new Date());
  229 + patient.setOperator(userId);
229 230 Patients p = yunBookbuildingService.addPregnantBookbuilding(patient);
230 231  
231 232 if (p == null || p.getId() == null)
... ... @@ -397,7 +398,7 @@
397 398 * @param id
398 399 * @param yunRequest
399 400 */
400   - public BaseResponse updatePregnantById(String id, YunBookbuildingAddRequest yunRequest) {
  401 + public BaseResponse updatePregnantById(String id, YunBookbuildingAddRequest yunRequest,Integer userId) {
401 402  
402 403  
403 404 BaseResponse br = new BaseResponse();
... ... @@ -509,7 +510,7 @@
509 510 }
510 511 }
511 512  
512   -
  513 + patient.setOperator(userId);
513 514 yunBookbuildingService.updatePregnant(patient, id);
514 515  
515 516 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ f19c170
... ... @@ -136,6 +136,7 @@
136 136 }
137 137 MaternalDeliverModel maternalDeliverModel = deliverAddRequest.convertToDataModel();
138 138 //获取到小孩信息
  139 + maternalDeliverModel.setOperator(userId);
139 140 List<MatDeliverAddRequest.Baby> list = deliverAddRequest.getBabies();
140 141 List<String> babyIds = new ArrayList<>();
141 142 String parentId = maternalDeliverModel.getParentId();
... ... @@ -205,7 +206,7 @@
205 206 } else if (StringUtils.isNotEmpty(deliverAddRequest.getId()) && StringUtils.isNotEmpty(deliverAddRequest.getParentId())) {
206 207 MaternalDeliverModel maternalDeliverModel = deliverAddRequest.convertToDataModel();
207 208 MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
208   -
  209 + maternalDeliverModel.setOperator(userId);
209 210 Patients patients2 = patientsService.findOnePatientById(deliverAddRequest.getParentId());
210 211 matDeliverQuery.setPid(patients2.getPid());
211 212 matDeliverQuery.setYn(YnEnums.YES.getId());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java View file @ f19c170
... ... @@ -200,15 +200,7 @@
200 200 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
201 201 }
202 202  
203   - /**
204   - * 查询高危孕妇
205   - *
206   - * @param riskPatientsQueryRequest
207   - * @param isHighRisk 控制是否是高危
208   - * @param type 控制类型 1孕妇 3产妇
209   - * @return
210   - */
211   - public BaseResponse queryHighRisk(RiskPatientsQueryRequest riskPatientsQueryRequest, Boolean isHighRisk, int type, Integer userId, String needPage) {
  203 + private PatientsQuery complayRequest(RiskPatientsQueryRequest riskPatientsQueryRequest, Boolean isHighRisk, int type, Integer userId, String needPage) {
212 204 PatientsQuery patientsQuery = new PatientsQuery();
213 205 patientsQuery.setPhone(riskPatientsQueryRequest.getPhone());
214 206 patientsQuery.setCardNo(riskPatientsQueryRequest.getCardNo());
... ... @@ -233,6 +225,26 @@
233 225  
234 226 }
235 227  
  228 + //最后一次检查时间
  229 + if (StringUtils.isNotEmpty(riskPatientsQueryRequest.getLastCTime())) {
  230 + String nextDateStr = riskPatientsQueryRequest.getLastCTime();
  231 + String[] dates = nextDateStr.split(" - ");
  232 +
  233 + patientsQuery.setLastCTimeStart(DateUtil.parseYMD(dates[0]));
  234 + if (dates.length == 2) {
  235 + patientsQuery.setLastCTimeEnd(DateUtil.parseYMD(dates[1]));
  236 + }
  237 + }
  238 + //预产期
  239 + if (StringUtils.isNotEmpty(riskPatientsQueryRequest.getDueDate())) {
  240 + String nextDateStr = riskPatientsQueryRequest.getDueDate();
  241 + String[] dates = nextDateStr.split(" - ");
  242 + patientsQuery.setDueDateStart(DateUtil.parseYMD(dates[0]));
  243 + if (dates.length == 2) {
  244 + patientsQuery.setDueDateEnd(DateUtil.parseYMD(dates[1]));
  245 + }
  246 + }
  247 +
236 248 patientsQuery.setrLevel(riskPatientsQueryRequest.getrLevel());
237 249 patientsQuery.setLastMensesStart(riskPatientsQueryRequest.capEnd());
238 250 patientsQuery.setLastMensesEnd(riskPatientsQueryRequest.capStart());
... ... @@ -290,6 +302,23 @@
290 302 String hospital = autoMatchFacade.getHospitalId(userId);
291 303 patientsQuery.setHospitalId(hospital);
292 304 patientsQuery.setNeed(needPage);
  305 + return patientsQuery;
  306 + }
  307 +
  308 +
  309 + /**
  310 + * 查询高危孕妇
  311 + *
  312 + * @param riskPatientsQueryRequest
  313 + * @param isHighRisk 控制是否是高危
  314 + * @param type 控制类型 1孕妇 3产妇
  315 + * @return
  316 + */
  317 + public BaseResponse queryHighRisk(RiskPatientsQueryRequest riskPatientsQueryRequest, Boolean isHighRisk, int type, Integer userId, String needPage) {
  318 + //组合请求
  319 + PatientsQuery patientsQuery = complayRequest(riskPatientsQueryRequest, isHighRisk, type, userId, needPage);
  320 +
  321 + String hospital = autoMatchFacade.getHospitalId(userId);
293 322 //查询符合条件的孕妇
294 323 StopWatch stopWatch = new StopWatch("queryPatient1 -" + hospital);
295 324 stopWatch.start();
... ... @@ -352,7 +381,7 @@
352 381 if (end > patientses.size()) {
353 382 end = patientses.size();
354 383 }
355   - listFuture.add(threadPoolExecutor.submit(new QuanChanPatientWorker(patientses.subList(i, end), hospital, usersService, postReviewService, matDeliverService)));
  384 + listFuture.add(threadPoolExecutor.submit(new QuanChanPatientWorker(patientses.subList(i, end), hospital, usersService, postReviewService, matDeliverService,patientsService)));
356 385 }
357 386 for (Future f : listFuture) {
358 387 try {
... ... @@ -375,7 +404,7 @@
375 404 if (end > patientses.size()) {
376 405 end = patientses.size();
377 406 }
378   - listFuture.add(threadPoolExecutor.submit(new QuanPatientWorker(patientses.subList(i, end), usersService, hospital, antExService, basicConfigService)));
  407 + listFuture.add(threadPoolExecutor.submit(new QuanPatientWorker(patientses.subList(i, end), usersService, hospital, antExService, basicConfigService,patientsService)));
379 408 }
380 409 for (Future f : listFuture) {
381 410 try {
... ... @@ -403,7 +432,7 @@
403 432 if (end > patientses.size()) {
404 433 end = patientses.size();
405 434 }
406   - listFuture.add(threadPoolExecutor.submit(new WorkHR(patientses.subList(i, end), usersService, hospital, basicConfigService, antExService)));
  435 + listFuture.add(threadPoolExecutor.submit(new WorkHR(patientses.subList(i, end), usersService, hospital, basicConfigService, antExService,patientsService)));
407 436 }
408 437 for (Future f : listFuture) {
409 438 try {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java View file @ f19c170
... ... @@ -79,6 +79,7 @@
79 79 Patients patients1 = patientsService.findOnePatientById(postReviewRequest.getParentId());
80 80 String hospital= autoMatchFacade.getHospitalId(userId);
81 81 PostReviewModel postReviewModel = postReviewRequest.convertToDataModel();
  82 + postReviewModel.setOperator(userId);
82 83 //判断是否是同一个医院
83 84 if(!patients1.getHospitalId().equals(hospital)){
84 85 patients1.setId(null);
85 86  
86 87  
... ... @@ -105,9 +106,23 @@
105 106 patientsService.updatePatient(patients);
106 107 }
107 108 postReviewModel.setPid(patients.getPid());
  109 +
108 110 postReviewService.addPostReview(postReviewModel);
109 111  
  112 + if(null!=patients1.getPostViewTimes()){
  113 + Patients patients2=new Patients();
  114 + patients2.setPostViewTimes(patients1.getPostViewTimes()+1);
  115 + patients2.setId(patients1.getId());
  116 + patientsService.updatePatient(patients2);
  117 + }else{
  118 + Patients patients2=new Patients();
  119 + patients2.setPostViewTimes(1);
  120 + patients2.setId(patients1.getId());
  121 + patientsService.updatePatient(patients2);
  122 + }
110 123  
  124 +
  125 +
111 126 if (null != patients.getBuildType() && patients.getBuildType() == 3) {
112 127 ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery();
113 128 referralApplyOrderQuery.setParentId(patients.getId());
... ... @@ -295,7 +310,27 @@
295 310 PostReviewModel postReviewModel=new PostReviewModel();
296 311 postReviewModel.setYn(YnEnums.NO.getId());
297 312 postReviewModel.setId(id);
298   - postReviewService.updatePostById(postReviewModel,id);
  313 + postReviewModel.setOperator(userId);
  314 + postReviewService.updatePostById(postReviewModel, id);
  315 +
  316 +
  317 + PostReviewModel postReviewModel1 = postReviewService.findOneById(id);
  318 + if(null!=postReviewModel1){
  319 + Patients patients=patientsService.findOnePatientById(postReviewModel1.getParentId());
  320 + if(null!=patients){
  321 + if(null!=patients.getPostViewTimes()){
  322 + Patients patients2=new Patients();
  323 + patients2.setPostViewTimes(patients.getPostViewTimes()+1);
  324 + patients2.setId(patients.getId());
  325 + patientsService.updatePatient(patients2);
  326 + }else{
  327 + Patients patients2=new Patients();
  328 + patients2.setPostViewTimes(list.size());
  329 + patients2.setId(patients.getId());
  330 + patientsService.updatePatient(patients2);
  331 + }
  332 + }
  333 + }
299 334 return new BaseResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS);
300 335 }else{
301 336 return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("当前复查记录不是本院最新的复查记录,不能删除");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/RiskPatientsQueryRequest.java View file @ f19c170
... ... @@ -65,9 +65,30 @@
65 65 private String buildTime;
66 66 //最后一次医院定义的高危
67 67 private String lastRhTime;
  68 + //本院最后一次产检时间
  69 + private String lastCTime;
  70 + //预产期
  71 + private String dueDate;
68 72  
69 73 // 0 高危孕妇 1 全部孕妇 2全部产妇
70 74 private Integer queryType;
  75 +
  76 +
  77 + public String getLastCTime() {
  78 + return lastCTime;
  79 + }
  80 +
  81 + public void setLastCTime(String lastCTime) {
  82 + this.lastCTime = lastCTime;
  83 + }
  84 +
  85 + public String getDueDate() {
  86 + return dueDate;
  87 + }
  88 +
  89 + public void setDueDate(String dueDate) {
  90 + this.dueDate = dueDate;
  91 + }
71 92  
72 93 public String getLastRhTime() {
73 94 return lastRhTime;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanChanResult.java View file @ f19c170
... ... @@ -45,6 +45,16 @@
45 45  
46 46 //服务状态
47 47 private String serviceStatus;
  48 + //操纵者
  49 + private String operator;
  50 +
  51 + public String getOperator() {
  52 + return operator;
  53 + }
  54 +
  55 + public void setOperator(String operator) {
  56 + this.operator = operator;
  57 + }
48 58  
49 59 public String getServiceType() {
50 60 return serviceType;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanPatientsResult.java View file @ f19c170
... ... @@ -55,6 +55,18 @@
55 55  
56 56 private String pid;
57 57  
  58 +
  59 + //操纵者
  60 + private String operator;
  61 +
  62 + public String getOperator() {
  63 + return operator;
  64 + }
  65 +
  66 + public void setOperator(String operator) {
  67 + this.operator = operator;
  68 + }
  69 +
58 70 public String getServiceStatus() {
59 71 return serviceStatus;
60 72 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java View file @ f19c170
1 1 package com.lyms.platform.operate.web.worker;
2 2  
3   -import com.lyms.platform.biz.service.AntenatalExaminationService;
4   -import com.lyms.platform.biz.service.BasicConfigService;
5   -import com.lyms.platform.biz.service.MatDeliverService;
6   -import com.lyms.platform.biz.service.PostReviewService;
  3 +import com.lyms.platform.biz.service.*;
7 4 import com.lyms.platform.common.enums.ServiceStatusEnums;
8 5 import com.lyms.platform.common.enums.ServiceTypeEnums;
9 6 import com.lyms.platform.common.enums.YnEnums;
... ... @@ -42,6 +39,8 @@
42 39 private static final Logger logger = LoggerFactory.getLogger(PatientFacade.class);
43 40 private List<Patients> patientses;
44 41  
  42 + private PatientsService patientsService;
  43 +
45 44 private UsersService usersService;
46 45 private PostReviewService postReviewService;
47 46  
48 47  
... ... @@ -52,10 +51,11 @@
52 51 String hospital,
53 52 UsersService usersService,
54 53 PostReviewService postReviewService,
55   - MatDeliverService matDeliverService) {
  54 + MatDeliverService matDeliverService,PatientsService patientsService) {
56 55 this.patientses = patientses;
57 56 this.matDeliverService = matDeliverService;
58 57 this.postReviewService = postReviewService;
  58 + this.patientsService=patientsService;
59 59 this.hospital = hospital;
60 60 this.usersService = usersService;
61 61 }
... ... @@ -111,6 +111,13 @@
111 111 withList = postReviewService.findWithList(postReviewQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
112 112 if (CollectionUtils.isNotEmpty(withList)) {
113 113 chanResult.setcHTimes(withList.size());
  114 + if(null==patients.getPostViewTimes()){
  115 + Patients patients1=new Patients();
  116 + patients1.setPostViewTimes(withList.size());
  117 + patients1.setId(patients.getId());
  118 + patientsService.updatePatient(patients1);
  119 + }
  120 +
114 121 if (StringUtils.isNotEmpty(withList.get(0).getProdDoctor())) {
115 122 Users users = usersService.getUsers(NumberUtils.toInt(withList.get(0).getProdDoctor()));
116 123 if (null != users) {
... ... @@ -123,6 +130,8 @@
123 130 chanResult.setServiceType(ServiceTypeEnums.getTitleById(patients.getServiceType()));
124 131 chanResult.setServiceStatus(ServiceStatusEnums.getNameById(patients.getServiceStatus()));
125 132 chanResult.setNextCheckTime(nextCheckTime);
  133 + //操作者
  134 +// chanResult.setOperator();
126 135 data.add(chanResult);
127 136 logger.debug(stopWatch.toString());
128 137 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanPatientWorker.java View file @ f19c170
... ... @@ -2,6 +2,7 @@
2 2  
3 3 import com.lyms.platform.biz.service.AntenatalExaminationService;
4 4 import com.lyms.platform.biz.service.BasicConfigService;
  5 +import com.lyms.platform.biz.service.PatientsService;
5 6 import com.lyms.platform.common.enums.RiskDefaultTypeEnum;
6 7 import com.lyms.platform.common.enums.ServiceStatusEnums;
7 8 import com.lyms.platform.common.enums.ServiceTypeEnums;
... ... @@ -28,10 +29,7 @@
28 29 import org.springframework.data.domain.Sort;
29 30 import org.springframework.util.StopWatch;
30 31  
31   -import java.util.ArrayList;
32   -import java.util.HashMap;
33   -import java.util.List;
34   -import java.util.Map;
  32 +import java.util.*;
35 33 import java.util.concurrent.Callable;
36 34  
37 35 /**
38 36  
39 37  
... ... @@ -47,17 +45,19 @@
47 45 private UsersService usersService;
48 46 private AntenatalExaminationService antExService;
49 47 private BasicConfigService basicConfigService;
  48 + private PatientsService patientsService;
50 49  
51 50 public QuanPatientWorker(List<Patients> patientses,
52 51 UsersService usersService,
53 52 String hospital,
54 53 AntenatalExaminationService antExService,
55   - BasicConfigService basicConfigService) {
  54 + BasicConfigService basicConfigService,PatientsService patientsService) {
56 55 this.patientses = patientses;
57 56 this.usersService = usersService;
58 57 this.antExService = antExService;
59 58 this.hospital = hospital;
60 59 this.basicConfigService = basicConfigService;
  60 + this.patientsService=patientsService;
61 61 }
62 62  
63 63 @Override
... ... @@ -110,6 +110,31 @@
110 110 stopWatch.start("query antex list");
111 111 List<AntenatalExaminationModel> examinationModels = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
112 112 if (CollectionUtils.isNotEmpty(examinationModels)) {
  113 + //设置最后一次检查时间
  114 + if (null == patients.getLastCTime()) {
  115 + List<Date> list = new ArrayList<>();
  116 + for (AntenatalExaminationModel antEx : examinationModels) {
  117 + list.add(antEx.getCheckDate());
  118 + }
  119 +
  120 + Collections.sort(list, new Comparator<Date>() {
  121 + @Override
  122 + public int compare(Date o1, Date o2) {
  123 + if (o1 != null && o1.after(o2)) {
  124 + return -1;
  125 + }
  126 + if (o1 != null && o1.before(o2)) {
  127 + return 1;
  128 + }
  129 + return 0;
  130 + }
  131 + });
  132 + Patients patients1=new Patients();
  133 + patients1.setId(patients.getId());
  134 + patients1.setLastCTime(list.get(0));
  135 + patientsService.updatePatient(patients1);
  136 + }
  137 +
113 138 nextCheckTime = DateUtil.getyyyy_MM_dd(examinationModels.get(0).getNextCheckTime());
114 139  
115 140 if (StringUtils.isNotEmpty(examinationModels.get(0).getCheckDoctor())) {
... ... @@ -162,7 +187,7 @@
162 187 if (name.indexOf("预警") > -1) {
163 188 name = name.replace("预警", "");
164 189 }
165   - map.put("name",name);
  190 + map.put("name", name);
166 191 map.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name));
167 192 level.add(map);
168 193 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/WorkHR.java View file @ f19c170
... ... @@ -2,6 +2,7 @@
2 2  
3 3 import com.lyms.platform.biz.service.AntenatalExaminationService;
4 4 import com.lyms.platform.biz.service.BasicConfigService;
  5 +import com.lyms.platform.biz.service.PatientsService;
5 6 import com.lyms.platform.common.enums.RiskDefaultTypeEnum;
6 7 import com.lyms.platform.common.enums.ServiceStatusEnums;
7 8 import com.lyms.platform.common.enums.ServiceTypeEnums;
... ... @@ -28,10 +29,7 @@
28 29 import org.springframework.data.domain.Sort;
29 30 import org.springframework.util.StopWatch;
30 31  
31   -import java.util.ArrayList;
32   -import java.util.HashMap;
33   -import java.util.List;
34   -import java.util.Map;
  32 +import java.util.*;
35 33 import java.util.concurrent.Callable;
36 34  
37 35 /**
38 36  
39 37  
... ... @@ -48,15 +46,17 @@
48 46 private AntenatalExaminationService antExService;
49 47 private UsersService usersService;
50 48 private String hospital;
  49 + private PatientsService patientsService;
51 50  
52 51 public WorkHR(List<Patients> patientses, UsersService usersService, String hospital,
53 52 BasicConfigService basicConfigService,
54   - AntenatalExaminationService antExService) {
  53 + AntenatalExaminationService antExService,PatientsService patientsService) {
55 54 this.patientses = patientses;
56 55 this.usersService = usersService;
57 56 this.hospital = hospital;
58 57 this.basicConfigService = basicConfigService;
59 58 this.antExService = antExService;
  59 + this.patientsService=patientsService;
60 60 }
61 61  
62 62 public List<RiskPatientsResult> call() {
... ... @@ -106,6 +106,32 @@
106 106  
107 107 List<AntenatalExaminationModel> examinationModels = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
108 108 if (CollectionUtils.isNotEmpty(examinationModels)) {
  109 +
  110 + //设置最后一次检查时间
  111 + if (null == patients.getLastCTime()) {
  112 + List<Date> list = new ArrayList<>();
  113 + for (AntenatalExaminationModel antEx : examinationModels) {
  114 + list.add(antEx.getCheckDate());
  115 + }
  116 +
  117 + Collections.sort(list, new Comparator<Date>() {
  118 + @Override
  119 + public int compare(Date o1, Date o2) {
  120 + if (o1 != null && o1.after(o2)) {
  121 + return -1;
  122 + }
  123 + if (o1 != null && o1.before(o2)) {
  124 + return 1;
  125 + }
  126 + return 0;
  127 + }
  128 + });
  129 + Patients patients1=new Patients();
  130 + patients1.setId(patients.getId());
  131 + patients1.setLastCTime(list.get(0));
  132 + patientsService.updatePatient(patients1);
  133 + }
  134 +
109 135 if (NumberUtils.isNumber(examinationModels.get(0).getCheckDoctor())) {
110 136 Users users = usersService.getUsers(NumberUtils.toInt(examinationModels.get(0).getCheckDoctor()));
111 137 if (null != users) {