Commit 01a8a6a686969404fed5c068f7b8d034919536c8

Authored by liquanyu
1 parent e354382c26

儿童建档

Showing 2 changed files with 25 additions and 10 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ 01a8a6a
... ... @@ -479,7 +479,7 @@
479 479 }
480 480  
481 481 //建档开通增值服务,若前端没有传入服务信息,默认加入标准服务
482   - if (CollectionUtils.isNotEmpty(request.getSerInfos())) {
  482 + if (CollectionUtils.isEmpty(request.getSerInfos())) {
483 483 Map<String, String> serInfo = new HashMap<>();
484 484 serInfo.put("serType",PatientSerEnums.SerTypeEnums.babyBzfw.getId().toString());
485 485 request.setSerInfos(Arrays.asList(serInfo));
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java View file @ 01a8a6a
... ... @@ -256,23 +256,38 @@
256 256 babyBookbuildingAddRequest.setServiceStatus(ServiceStatusEnums.ADD_OPEN.getId());
257 257 babyBookbuildingFacade.updateBabySerInfo(babyBookbuildingAddRequest);
258 258 }else if (PatientSerEnums.SerTypeEnums.babyBzfw.getId().intValue() == Integer.parseInt(serInfo.get("serType"))) {
259   - BabyBookbuildingAddRequest babyBookbuildingAddRequest = new BabyBookbuildingAddRequest();
260   - babyBookbuildingAddRequest.setId(ps.getParentid());
261   - babyBookbuildingAddRequest.setServiceType(ServiceTypeEnums.STANDARD_SERVICE.getId());
262   - babyBookbuildingAddRequest.setServiceStatus(ServiceStatusEnums.STANDARD_OPEN.getId());
263   - babyBookbuildingFacade.updateBabySerInfo(babyBookbuildingAddRequest);
  259 + PatientServiceQuery query = new PatientServiceQuery();
  260 + query.setParentid(ps.getParentid());
  261 + query.setSerType(PatientSerEnums.SerTypeEnums.babyjzzz.getId());
  262 + int count = patientServiceService.queryPatientServiceCount(query);
  263 + //是否有增值服务--没有则处理标准服务
  264 + if (count == 0) {
  265 + BabyBookbuildingAddRequest babyBookbuildingAddRequest = new BabyBookbuildingAddRequest();
  266 + babyBookbuildingAddRequest.setId(ps.getParentid());
  267 + babyBookbuildingAddRequest.setServiceType(ServiceTypeEnums.STANDARD_SERVICE.getId());
  268 + babyBookbuildingAddRequest.setServiceStatus(ServiceStatusEnums.STANDARD_OPEN.getId());
  269 + babyBookbuildingFacade.updateBabySerInfo(babyBookbuildingAddRequest);
  270 + }
264 271 }
265 272 } else {//孕妇建档服务数据处理
266 273 if (PatientSerEnums.SerTypeEnums.yqjzzd.getId() == Integer.parseInt(serInfo.get("serType"))) {//孕期精准指导同步到建档
  274 +
267 275 YunBookbuildingAddRequest yunBookbuildingAddRequest = new YunBookbuildingAddRequest();
268 276 yunBookbuildingAddRequest.setServiceType(ServiceTypeEnums.ADD_SERVICE.getId());
269 277 yunBookbuildingAddRequest.setServiceStatus(ServiceStatusEnums.ADD_OPEN.getId());
270 278 bookbuildingFacade.updatePregnantById(ps.getParentid(), yunBookbuildingAddRequest, userId);
271 279 }else if(PatientSerEnums.SerTypeEnums.bzfw.getId().intValue() == Integer.parseInt(serInfo.get("serType"))){
272   - YunBookbuildingAddRequest yunBookbuildingAddRequest = new YunBookbuildingAddRequest();
273   - yunBookbuildingAddRequest.setServiceType(ServiceTypeEnums.STANDARD_SERVICE.getId());
274   - yunBookbuildingAddRequest.setServiceStatus(ServiceStatusEnums.STANDARD_OPEN.getId());
275   - bookbuildingFacade.updatePregnantById(ps.getParentid(), yunBookbuildingAddRequest, userId);
  280 + PatientServiceQuery query = new PatientServiceQuery();
  281 + query.setParentid(ps.getParentid());
  282 + query.setSerType(PatientSerEnums.SerTypeEnums.yqjzzd.getId());
  283 + int count = patientServiceService.queryPatientServiceCount(query);
  284 + //是否有增值服务--没有则处理标准服务
  285 + if (count == 0) {
  286 + YunBookbuildingAddRequest yunBookbuildingAddRequest = new YunBookbuildingAddRequest();
  287 + yunBookbuildingAddRequest.setServiceType(ServiceTypeEnums.STANDARD_SERVICE.getId());
  288 + yunBookbuildingAddRequest.setServiceStatus(ServiceStatusEnums.STANDARD_OPEN.getId());
  289 + bookbuildingFacade.updatePregnantById(ps.getParentid(), yunBookbuildingAddRequest, userId);
  290 + }
276 291 }
277 292 }
278 293 }