Commit 0b4254f3a7ec3cc41ef03fe0bbbd1a7f2a46d9da

Authored by yangfei

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java

Showing 3 changed files

platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml View file @ 0b4254f
... ... @@ -244,6 +244,7 @@
244 244 from organization a, coupon_info b, coupon_template c, coupon_type d
245 245 where a.id = b.used_hospital_id and b.coupon_template_id = c.id and c.type_id = d.id
246 246 and a.id = #{hid}
  247 + and b.status = 2
247 248 and d.type in
248 249 <foreach collection="couponType" open="(" close=")" separator="," item="type">
249 250 #{type}
... ... @@ -261,6 +262,7 @@
261 262 from organization a, coupon_info b, coupon_template c, coupon_type d
262 263 where a.id = b.used_hospital_id and b.coupon_template_id = c.id and c.type_id = d.id
263 264 and a.id = #{hid}
  265 + and b.status = 2
264 266 and d.type in
265 267 <foreach collection="couponType" open="(" close=")" separator="," item="type">
266 268 #{type}
... ... @@ -337,6 +339,7 @@
337 339 select a.used_hospital_id, c.type, b.coupon_order, a.sequence_id, d.name as send_hospital, a.use_date, a.used_id, a.operator_use_id
338 340 from coupon_info a, coupon_template b, coupon_type c, organization d
339 341 where a.coupon_template_id = b.id and b.type_id = c.id and a.create_hospital_id = d.id
  342 + and a.status = 2
340 343 and a.used_hospital_id in
341 344 <foreach collection="hospitalId" open="(" close=")" separator="," item="hid">
342 345 #{hid}
... ... @@ -363,7 +366,7 @@
363 366 select count(1) from (
364 367 select a.used_hospital_id, c.type, b.coupon_order, a.sequence_id, d.name as send_hospital, a.use_date, a.used_id, a.operator_use_id
365 368 from coupon_info a, coupon_template b, coupon_type c, organization d
366   - where a.coupon_template_id = b.id and b.type_id = c.id and a.create_hospital_id = d.id
  369 + where a.coupon_template_id = b.id and b.type_id = c.id and a.create_hospital_id = d.id and a.status = 2
367 370 and a.used_hospital_id in
368 371 <foreach collection="hospitalId" open="(" close=")" separator="," item="hid">
369 372 #{hid}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java View file @ 0b4254f
... ... @@ -246,9 +246,9 @@
246 246 public BaseResponse addBabyCheck(BabyCheckRequest request, Integer userId) {
247 247  
248 248 /** 验证产检券是否可用 可用就改为已使用状态 */
249   - if (org.apache.commons.lang3.StringUtils.isNotBlank(request.getCouponCode()) && request.getCouponType() != null) {
  249 + if(org.apache.commons.lang3.StringUtils.isNotBlank(request.getCouponCode()) && request.getCouponType() != null) {
250 250 BaseObjectResponse resp = couponService.validate(request.getCouponCode(), request.getCouponType(), autoMatchFacade.getHospitalId(userId));
251   - if (resp.getErrorcode() != 0) {
  251 + if(resp.getErrorcode() != 0) {
252 252 return resp;
253 253 }
254 254 }
... ... @@ -297,7 +297,7 @@
297 297 model = babyCheckService.addBabyCheck(model);
298 298  
299 299 /** 使用优惠券 */
300   - if (org.apache.commons.lang3.StringUtils.isNotBlank(request.getCouponCode()) && request.getCouponType() != null) {
  300 + if(org.apache.commons.lang3.StringUtils.isNotBlank(request.getCouponCode()) && request.getCouponType() != null) {
301 301 couponService.use(autoMatchFacade.getHospitalId(userId), request.getCouponCode(), userId, model.getId());
302 302 }
303 303  
... ... @@ -480,27 +480,7 @@
480 480 BaseObjectResponse br = new BaseObjectResponse();
481 481 BabyBasicResult base = new BabyBasicResult();
482 482 Map<String, Object> resMap = new HashMap<>();
483   -
484   - BabyModel model = getBabyModel(id, base);
485   - BabyModelQuery babyQuery = new BabyModelQuery();
486   - babyQuery.setPid(model.getPid());
487   - babyQuery.setYn(YnEnums.YES.getId());
488   -
489   - //查询儿童的基本信息
490   - List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery);
491   -
492   - if (CollectionUtils.isNotEmpty(models)) {
493   -
494   - PatientsQuery patientsQuery = new PatientsQuery();
495   - patientsQuery.setId(model.getParentId());
496   - patientsQuery.setYn(YnEnums.YES.getId());
497   -
498   - List<Patients> personModels = patientsService.queryPatient(patientsQuery);
499   - if (CollectionUtils.isNotEmpty(personModels)) {
500   - Patients personModel = personModels.get(0);
501   - base.setPregnantCertificateTypeId(personModel.getHcertificateTypeId());
502   - }
503   - }
  483 + getBabyModel(id, base);
504 484 resMap.put("baseInfo", base);
505 485 br.setData(resMap);
506 486 br.setErrorcode(ErrorCodeConstants.SUCCESS);
... ... @@ -619,7 +599,7 @@
619 599 base.setCardNo(model.getMcertNo());
620 600 base.setMonthAge(DateUtil.getBabyMonthAge(model.getBirth(), new Date()));
621 601 base.setBirthday(DateUtil.getyyyy_MM_dd(model.getBirth()));
622   - base.setSourceId(org.apache.commons.lang.StringUtils.isNotEmpty(model.getSource()) ? model.getSource() : model.getId());
  602 + base.setSourceId(org.apache.commons.lang.StringUtils.isNotEmpty(model.getSource())?model.getSource():model.getId());
623 603 if (model.getPid() != null) {
624 604 //诊断
625 605 List list = getBabyLastDiagnose(model.getPid());
626 606  
... ... @@ -812,10 +792,10 @@
812 792 babyQuery.setYn(YnEnums.YES.getId());
813 793  
814 794 /** 处理优惠券查询 */
815   - if (StringUtils.isNotEmpty(coupon)) {
  795 + if(StringUtils.isNotEmpty(coupon)) {
816 796 Map<String, Object> m = couponMapper.findUrl(coupon);
817 797 Object personId = m.get("user_id");
818   - if (personId != null) {
  798 + if(personId != null) {
819 799 babyQuery.setPid(personId.toString());
820 800 }
821 801 }
822 802  
823 803  
... ... @@ -833,23 +813,25 @@
833 813  
834 814 List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery);
835 815  
836   - if (CollectionUtils.isEmpty(models) && StringUtils.isNotEmpty(vcCardNo)) {
837   - if ("4".equals(HIS_VERSION)) {
838   - List<Map<String, Object>> hisPatient = qhdfyHisService.getPatientInfoList(vcCardNo);
  816 + if (CollectionUtils.isEmpty(models) && StringUtils.isNotEmpty(vcCardNo))
  817 + {
  818 + if ("4".equals(HIS_VERSION)) {
  819 + List<Map<String,Object>> hisPatient = qhdfyHisService.getPatientInfoList(vcCardNo);
839 820  
840   - if (CollectionUtils.isNotEmpty(hisPatient)) {
841   - Map<String, Object> babyHis = hisPatient.get(0);
842   - if (babyHis != null && babyHis.get("phone") != null && StringUtils.isNotEmpty(babyHis.get("phone").toString())) {
843   - babyQuery.setPhoneOrcardNo(null); //手机号码或者身份证号码
844   - babyQuery.setVcCardNo(null);
845   - babyQuery.setMphone(babyHis.get("phone").toString());
846   - models = babyBookbuildingService.queryBabyBuildByCond(babyQuery);
847   - }
848   - }
849   - }
  821 + if (CollectionUtils.isNotEmpty(hisPatient)) {
  822 + Map<String, Object> babyHis = hisPatient.get(0);
  823 + if (babyHis != null && babyHis.get("phone") != null && StringUtils.isNotEmpty(babyHis.get("phone").toString())) {
  824 + babyQuery.setPhoneOrcardNo(null); //手机号码或者身份证号码
  825 + babyQuery.setVcCardNo(null);
  826 + babyQuery.setMphone(babyHis.get("phone").toString());
  827 + models = babyBookbuildingService.queryBabyBuildByCond(babyQuery);
  828 + }
  829 + }
  830 + }
850 831 }
851 832  
852   - if (CollectionUtils.isNotEmpty(models)) {
  833 + if (CollectionUtils.isNotEmpty(models))
  834 + {
853 835 for (BabyModel model : models) {
854 836 if (model != null && model.getHospitalId() != null && hList.contains(hospitalId)) {
855 837 isBuild = true;
... ... @@ -900,6 +882,7 @@
900 882 }
901 883  
902 884  
  885 +
903 886 br.setData(result);
904 887 br.setErrorcode(ErrorCodeConstants.SUCCESS);
905 888 br.setErrormsg("成功");
... ... @@ -1159,7 +1142,6 @@
1159 1142 * 身高别体重》M-2s && 年龄别身高小于M-2s
1160 1143 * 4.慢性严重营养不良
1161 1144 * 身高别体重小于M-2s && 年龄别身高小于M-2s。
1162   - *
1163 1145 * @return
1164 1146 */
1165 1147 public List<String> getBabyGrowthEvaluate(Double height, Integer sex, String birth, Double weight) {
1166 1148  
... ... @@ -1253,17 +1235,18 @@
1253 1235 date = DateUtil.parseYMD(checkDate);
1254 1236 }
1255 1237  
1256   - boolean isShowNavel = false;
1257   - int monthes = DateUtil.getBabyAgeMonth(birthDate, date);
1258   - if (monthes == 1 || monthes == 3) {
1259   - isShowNavel = true;
  1238 + boolean isShowNavel = false;
  1239 + int monthes = DateUtil.getBabyAgeMonth(birthDate,date);
  1240 + if (monthes == 0 || monthes == 1 || monthes == 3)
  1241 + {
  1242 + isShowNavel = true;
1260 1243 }
1261 1244  
1262 1245 String ageStr = DateUtil.getBabyMonthAge(birthDate, date);
1263 1246 BaseObjectResponse objectResponse = new BaseObjectResponse();
1264   - Map<String, Object> map = new HashMap<>();
1265   - map.put("monthAge", ageStr);
1266   - map.put("isShowNavel", isShowNavel);
  1247 + Map<String,Object> map = new HashMap<>();
  1248 + map.put("monthAge",ageStr);
  1249 + map.put("isShowNavel",isShowNavel);
1267 1250 objectResponse.setData(map);
1268 1251 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
1269 1252 objectResponse.setErrormsg("成功");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ 0b4254f
... ... @@ -1256,7 +1256,7 @@
1256 1256 tempMap.put("HIGH_RISK_GRADE", mongoUtil.findName(examinationModel.getRiskScore()));
1257 1257 tempMap.put("HIGH_RISK_FACTOR", mongoUtil.findName(examinationModel.getRiskFactor()));
1258 1258 // tempMap.put("EDD_DATE", examinationModel.);
1259   - tempMap.put("LAST_EXAMINE_DATE", examinationModel.getLastMenses());
  1259 + tempMap.put("LAST_EXAMINE_DATE", DateUtil.getyyyy_MM_dd(examinationModel.getLastMenses()));
1260 1260 String prodDoctor = examinationModel.getCheckDoctor();
1261 1261 if(StringUtils.isNotBlank(prodDoctor)) {
1262 1262 Users users = usersService.getUsers(Integer.parseInt(prodDoctor));
... ... @@ -1269,7 +1269,7 @@
1269 1269 tempMap.put("HIGH_RISK_GRADE", mongoUtil.findName(antExChuModel.getHighriskSocre())); /** 高危等级 */
1270 1270 tempMap.put("HIGH_RISK_FACTOR", mongoUtil.findName(antExChuModel.getHighrisk())); /** 风险因素 */
1271 1271 tempMap.put("EDD_DATE", antExChuModel.getDueDate());
1272   - tempMap.put("LAST_EXAMINE_DATE", antExChuModel.getCheckTime());
  1272 + tempMap.put("LAST_EXAMINE_DATE", DateUtil.getyyyy_MM_dd(antExChuModel.getCheckTime()));
1273 1273 String prodDoctor = antExChuModel.getProdDoctor();
1274 1274 if(StringUtils.isNotBlank(prodDoctor)) {
1275 1275 Users users = usersService.getUsers(Integer.parseInt(prodDoctor));