Commit a63723a3cf6f861576739c234d5b4284d37ad0e4

Authored by litao@lymsh.com
1 parent 224a1e86ed

改bug

Showing 5 changed files with 78 additions and 9 deletions

platform-common/src/main/java/com/lyms/platform/common/enums/RemoteServerEnmus.java View file @ a63723a
... ... @@ -3,7 +3,7 @@
3 3 public enum RemoteServerEnmus {
4 4 // LOCAL("http://localhost:9091", "本地环境"),
5 5 // TEST("https://dev-rp-api.healthbaby.com.cn", "测试环境"),
6   - ON_LINE("https://rp-api.healthbaby.com.cn", "线上"),
  6 +// ON_LINE("https://rp-api.healthbaby.com.cn", "线上"),
7 7 LC("https://area-lc-api.healthbaby.com.cn:55581", "聊城"),
8 8 DZ("https://area-dz-api.healthbaby.com.cn:12356", "德州"),
9 9 QHD("https://area-qhd-api.healthbaby.com.cn:18019", "秦皇岛"),
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java View file @ a63723a
... ... @@ -31,6 +31,17 @@
31 31 private IReportService reportService;
32 32  
33 33 /**
  34 + * 未发放优惠券统计
  35 + */
  36 + @RequestMapping(value = "/unissued", method = RequestMethod.POST)
  37 + @ResponseBody
  38 + @TokenRequired
  39 + public BaseObjectResponse unissued(Date startDate, Date endDate, String provinceId, String cityId, String areaId, String hospitalId, HttpServletRequest request) {
  40 + return reportService.unissued(startDate, endDate, provinceId, cityId, areaId, hospitalId, getUserId(request));
  41 + }
  42 +
  43 +
  44 + /**
34 45 * 产检次数分布统计(已废弃 采用 getCheckNumber)
35 46 *
36 47 * @param startDate 建档开始时间
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IReportService.java View file @ a63723a
... ... @@ -83,5 +83,7 @@
83 83 BaseObjectResponse getCheckNumberInfo(Integer childBirth, Date startDate, Date endDate, Integer startWeek, Integer endWeek, Integer number, Integer id, Integer currentPage, Integer pageSize);
84 84  
85 85 void checkNumberInfoExport(Integer childBirth, Date startDate, Date endDate, Integer startWeek, Integer endWeek, Integer number, Integer id, HttpServletResponse resp);
  86 +
  87 + BaseObjectResponse unissued(Date startDate, Date endDate, String provinceId, String cityId, String areaId, String hospitalId, Integer userId);
86 88 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ a63723a
... ... @@ -155,6 +155,16 @@
155 155 patientWeight.setDayWeights2(dayWeights2);
156 156  
157 157 patientWeightService2.add(patientWeight);
  158 +
  159 + // 绑定医生和患者的关系
  160 + String patSerSyncUrl = Config.getItem("patSer_sync_url", "0");
  161 + Map<String, String> param = new HashMap<>();
  162 + param.put("doctorId", userId + "");
  163 + param.put("patientId", patients.getId());
  164 + patSerSyncUrl = "http://localhost:9092";
  165 +// String s = HttpClientUtil.doPost(patSerSyncUrl + "/grWeContr/bindDoctorUser", param, "UTF-8");
  166 + String s = HttpClientUtil.doPost("http://localhost:9092/grWeContr/bindDoctorUser", param, "UTF-8");
  167 + System.out.println("绑定医生和患者的关系>>. " + s + " param: " + param);
158 168 return RespBuilder.buildSuccess(patientWeight.getId());
159 169 } else {
160 170 patientWeight.setOperaterId(userId.toString());
161 171  
162 172  
163 173  
164 174  
... ... @@ -361,26 +371,58 @@
361 371 Patients patients = mongoTemplate.findById(patientWeight.getPatientId(), Patients.class);
362 372 PatientWeight pw = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(patientWeight.getPid())), PatientWeight.class);
363 373 Map<String, String> dayWeights = new LinkedHashMap<>();
  374 + List<Map<String, Object>> dayWeights2 = new ArrayList<>();
  375 + String ymdDate = DateUtil.getyyyy_MM_dd(new Date());
  376 + String hospitalId = patientWeight.getHospitalId();
  377 +
364 378 if(pw == null && StringUtils.isEmpty(patientWeight.getBeforeWeight())) {
365 379 return RespBuilder.buildErro(ResponseCode.NEED_ADD_PATIENT_WEIGHT);
366 380 }
367 381 if(pw != null && StringUtils.isNotEmpty(patientWeight.getBeforeWeight())) {
368 382 return RespBuilder.buildErro(ResponseCode.PATIENT_WEIGHT_IS_EXIST);
369 383 }
370   - if(pw != null) {
  384 + if(pw != null) { // 修改
371 385 if(MapUtils.isNotEmpty(pw.getDayWeights())) {
372 386 dayWeights = pw.getDayWeights();
373 387 }
374 388 dayWeights.put(DateUtil.getyyyy_MM_dd(new Date()), nowWeight);
375 389 pw.setNowWeight(nowWeight);
376 390 pw.setDayWeights(dayWeights);
377   -// Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(pw));
378   -// mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(pw.getId())), update, PatientWeight.class);
  391 +
  392 + if(CollectionUtils.isNotEmpty(pw.getDayWeights2())) {
  393 + dayWeights2 = pw.getDayWeights2();
  394 + }
  395 + boolean flag = true;
  396 + for (Map<String, Object> map : dayWeights2) {
  397 + if(map.get("date").equals(ymdDate)) {
  398 + flag = false;
  399 + if(hospitalId.equals(map.get("hospitalId") + "")) {
  400 + map.put("hospitalId", hospitalId);
  401 + map.put("hospitalName", couponMapper.getHospitalName(hospitalId));
  402 + map.put("date", ymdDate);
  403 + map.put("nowWeight", nowWeight);
  404 + }
  405 + }
  406 + }
  407 + if(flag) {
  408 + Map<String, Object> m = new HashMap<>();
  409 + m.put("hospitalId", hospitalId);
  410 + m.put("hospitalName", couponMapper.getHospitalName(hospitalId));
  411 + m.put("date", ymdDate);
  412 + m.put("nowWeight", nowWeight);
  413 + dayWeights2.add(m);
  414 + }
379 415 patientWeightService2.update(Query.query(Criteria.where("id").is(pw.getId())), pw);
380   -// return RespBuilder.buildSuccess(pw.getId());
381 416 return RespBuilder.buildSuccess(pw);
382 417 }
383 418  
  419 +
  420 + Map<String, Object> m = new HashMap<>();
  421 + m.put("hospitalId", hospitalId);
  422 + m.put("hospitalName", couponMapper.getHospitalName(hospitalId));
  423 + m.put("date", ymdDate);
  424 + m.put("nowWeight", nowWeight);
  425 + dayWeights2.add(m);
384 426 if(StringUtils.isEmpty(patientWeight.getId()) && patients != null) {
385 427 patientWeight.setCreated(new Date());
386 428 patientWeight.setHospitalId(patients.getHospitalId());
387 429  
... ... @@ -389,13 +431,10 @@
389 431 }
390 432 patientWeight.setYn("1");
391 433 patientWeight.setPid(patients.getPid());
  434 + pw.setDayWeights2(dayWeights2);
392 435 patientWeightService2.add(patientWeight);
393 436 return RespBuilder.buildSuccess(patientWeight);
394 437 } else {
395   -// Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(patientWeight));
396   -// mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(patientWeight.getId())), update, PatientWeight.class);
397   - /* patientWeightService2.update(Query.query(Criteria.where("id").is(patientWeight.getId())), patientWeight);
398   - return RespBuilder.buildSuccess(patientWeight.getId());*/
399 438 patientWeight.setCreated(new Date());
400 439 patientWeight.setHospitalId(patients.getHospitalId());
401 440 if(StringUtils.isNotBlank(patientWeight.getBeforeWeight()) && patientWeight.getBeforeHeight() != null) {
... ... @@ -473,6 +512,7 @@
473 512  
474 513 patientWeight.setDayWeights2(dayWeights2);
475 514 patientWeight.setDayWeights(dayWeights);
  515 + patientWeight.setBmi(getBmi(beforeWeight, beforeHeight));
476 516 }
477 517 patientWeightService2.update(Query.query(Criteria.where("id").is(id)), patientWeight);
478 518  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ a63723a
... ... @@ -487,6 +487,22 @@
487 487 }
488 488  
489 489 @Override
  490 + public BaseObjectResponse unissued(Date startDate, Date endDate, String provinceId, String cityId, String areaId, String hospitalId, Integer userId) {
  491 + List<String> hospitalIds = new ArrayList<>();
  492 + if(StringUtils.isEmpty(hospitalId)) {
  493 + hospitalIds.addAll(accessPermissionFacade.getCurrentUserHospPermissions(userId));
  494 + } else {
  495 + hospitalIds.add(hospitalId);
  496 + }
  497 +
  498 + if(CollectionUtils.isNotEmpty(hospitalIds)) {
  499 +
  500 + }
  501 +
  502 + return RespBuilder.buildSuccess();
  503 + }
  504 +
  505 + @Override
490 506 public BaseObjectResponse coupon(Map<String ,Object> param) {
491 507 if(StringUtils.isBlank((String) param.get("hospitalId"))) {
492 508 param.put("hospitalId", accessPermissionFacade.getCurrentUserHospPermissions(Integer.parseInt(param.get("userId") + ""))); /** 模拟根据登陆人id 查询出来的医院 */