Commit baf34c9faa57d724b0b67dabd7860cc0017c72a4

Authored by jiangjiazhi

Merge remote-tracking branch 'origin/master'

Showing 14 changed files

platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml View file @ baf34c9
... ... @@ -300,7 +300,7 @@
300 300 </select>
301 301  
302 302 <select id="couponInfo" parameterType="map" resultType="map">
303   - select a.used_hospital_id, c.type, b.coupon_order, a.sequence_id, d.name as send_hospital, a.use_date, a.used_id
  303 + 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
304 304 from coupon_info a, coupon_template b, coupon_type c, organization d
305 305 where a.coupon_template_id = b.id and b.type_id = c.id and a.create_hospital_id = d.id
306 306 and a.used_hospital_id in
... ... @@ -311,6 +311,9 @@
311 311 <foreach collection="couponType" open="(" close=")" separator="," item="type">
312 312 #{type}
313 313 </foreach>
  314 + <if test="coupon_order != null">
  315 + and b.coupon_order = #{coupon_order}
  316 + </if>
314 317 <if test="startDate != null">
315 318 and a.use_date >= #{startDate}
316 319 </if>
317 320  
... ... @@ -422,11 +425,10 @@
422 425 </select>
423 426  
424 427 <select id="findUserSendInfo" parameterType="map" resultType="map">
425   - select a.user_id, a.create_date, e.name as username, d.name as send_hospital, f.name as doctoer_name
  428 + select a.create_hospital_id, a.user_id, a.create_date ,d.name as send_hospital, e.name as doctoer_name
426 429 from
427   - coupon_info a, coupon_template b, coupon_type c, organization d, users e, users f
428   - where a.coupon_template_id = b.id and b.type_id = c.id
429   - and a.create_hospital_id = d.id and a.user_id = e.id and a.create_user_id = f.id
  430 + coupon_info a, coupon_template b, coupon_type c, organization d, users e
  431 + where a.coupon_template_id = b.id and b.type_id = c.id and a.create_hospital_id = d.id and a.create_user_id = e.id
430 432 and a.create_hospital_id in
431 433 <foreach collection="hospitalId" open="(" close=")" separator="," item="hid">
432 434 #{hid}
433 435  
... ... @@ -446,11 +448,10 @@
446 448  
447 449 <select id="findUserSendInfoCount" parameterType="map" resultType="integer">
448 450 select count(1) from (
449   - select a.user_id, a.create_date, e.name as username, d.name as send_hospital, f.name as doctoer_name
  451 + select a.create_hospital_id, a.user_id, a.create_date ,d.name as send_hospital, e.name as doctoer_name
450 452 from
451   - coupon_info a, coupon_template b, coupon_type c, organization d, users e, users f
452   - where a.coupon_template_id = b.id and b.type_id = c.id
453   - and a.create_hospital_id = d.id and a.user_id = e.id and a.create_user_id = f.id
  453 + coupon_info a, coupon_template b, coupon_type c, organization d, users e
  454 + where a.coupon_template_id = b.id and b.type_id = c.id and a.create_hospital_id = d.id and a.create_user_id = e.id
454 455 and a.create_hospital_id in
455 456 <foreach collection="hospitalId" open="(" close=")" separator="," item="hid">
456 457 #{hid}
platform-dal/src/main/java/com/lyms/platform/query/AntExRecordQuery.java View file @ baf34c9
... ... @@ -64,12 +64,30 @@
64 64 private String provinceRegisterId;
65 65 private String cityRegisterId;
66 66 private String areaRegisterId;
  67 + private String streetRegisterId;
67 68  
68 69 //居住地
69 70 private String provinceId;
70 71 private String cityId;
71 72 private String areaId;
  73 + private String streetId;
72 74  
  75 + public String getStreetRegisterId() {
  76 + return streetRegisterId;
  77 + }
  78 +
  79 + public void setStreetRegisterId(String streetRegisterId) {
  80 + this.streetRegisterId = streetRegisterId;
  81 + }
  82 +
  83 + public String getStreetId() {
  84 + return streetId;
  85 + }
  86 +
  87 + public void setStreetId(String streetId) {
  88 + this.streetId = streetId;
  89 + }
  90 +
73 91 public boolean isNeNullCheckDoctor() {
74 92 return NeNullCheckDoctor;
75 93 }
... ... @@ -402,6 +420,9 @@
402 420 if (StringUtils.isNotEmpty(provinceId)) {
403 421 condition = condition.and("provinceId", provinceId, MongoOper.IS);
404 422 }
  423 + if (StringUtils.isNotEmpty(streetId)) {
  424 + condition = condition.and("streetId", streetId, MongoOper.IS);
  425 + }
405 426 //户籍地
406 427 if (StringUtils.isNotEmpty(provinceRegisterId)) {
407 428 condition = condition.and("provinceRegisterId", provinceRegisterId, MongoOper.IS);
... ... @@ -412,6 +433,11 @@
412 433 if (StringUtils.isNotEmpty(areaRegisterId)) {
413 434 condition = condition.and("areaRegisterId", areaRegisterId, MongoOper.IS);
414 435 }
  436 +
  437 + if (StringUtils.isNotEmpty(streetRegisterId)) {
  438 + condition = condition.and("streetRegisterId", streetRegisterId, MongoOper.IS);
  439 + }
  440 +
415 441  
416 442 if (null != hospitalId) {
417 443 condition = condition.and("hospitalId", hospitalId, MongoOper.IS);
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java View file @ baf34c9
... ... @@ -101,11 +101,13 @@
101 101 private String provinceRegisterId;
102 102 private String cityRegisterId;
103 103 private String areaRegisterId;
  104 + private String streetRegisterId;
104 105  
105 106 //居住地
106 107 private String provinceId;
107 108 private String cityId;
108 109 private String areaId;
  110 + private String streetId;
109 111 //医院id
110 112 private List<String> hospitalList;
111 113  
... ... @@ -891,6 +893,22 @@
891 893 this.pid = pid;
892 894 }
893 895  
  896 + public String getStreetRegisterId() {
  897 + return streetRegisterId;
  898 + }
  899 +
  900 + public void setStreetRegisterId(String streetRegisterId) {
  901 + this.streetRegisterId = streetRegisterId;
  902 + }
  903 +
  904 + public String getStreetId() {
  905 + return streetId;
  906 + }
  907 +
  908 + public void setStreetId(String streetId) {
  909 + this.streetId = streetId;
  910 + }
  911 +
894 912 public MongoQuery convertToQuery() {
895 913 MongoCondition condition = MongoCondition.newInstance();
896 914  
... ... @@ -964,6 +982,9 @@
964 982 if(StringUtils.isNotEmpty(provinceId)){
965 983 condition = condition.and("provinceId", provinceId, MongoOper.IS);
966 984 }
  985 + if(StringUtils.isNotEmpty(streetId)){
  986 + condition = condition.and("streetId", streetId, MongoOper.IS);
  987 + }
967 988 //户籍地
968 989 if(StringUtils.isNotEmpty(provinceRegisterId)){
969 990 condition = condition.and("provinceRegisterId", provinceRegisterId, MongoOper.IS);
... ... @@ -973,6 +994,9 @@
973 994 }
974 995 if(StringUtils.isNotEmpty(areaRegisterId)){
975 996 condition = condition.and("areaRegisterId", areaRegisterId, MongoOper.IS);
  997 + }
  998 + if(StringUtils.isNotEmpty(streetRegisterId)){
  999 + condition = condition.and("streetRegisterId", streetRegisterId, MongoOper.IS);
976 1000 }
977 1001  
978 1002 // 分娩信息
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java View file @ baf34c9
... ... @@ -237,7 +237,7 @@
237 237 Integer page, Integer limit) {
238 238 Map<String, Object> param = CollectionUtils.createMap("userId", getUserId(request), "startDate", startDate,
239 239 "endDate", endDate != null ? DateUtil.addDay(endDate, 1) : endDate, "hospitalId", CollectionUtils.asList(hospitalId), "provinceId", provinceId, "cityId", cityId, "areaId", areaId, "type", type,
240   - "tempId", tempId, "couponType", CollectionUtils.asList(couponType), "currentPage", page, "pageSize", limit);
  240 + "tempId", tempId, "couponType",couponType, "currentPage", page, "pageSize", limit);
241 241 return reportService.couponInfo(param);
242 242 }
243 243  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java View file @ baf34c9
... ... @@ -98,9 +98,12 @@
98 98 antExRecordQuery.setProvinceRegisterId(antExManagerQueryRequest.getProvinceRegisterId());
99 99 antExRecordQuery.setCityRegisterId(antExManagerQueryRequest.getCityRegisterId());
100 100 antExRecordQuery.setAreaRegisterId(antExManagerQueryRequest.getAreaRegisterId());
  101 + antExRecordQuery.setStreetRegisterId(antExManagerQueryRequest.getStreetRegisterId());
  102 +
101 103 antExRecordQuery.setProvinceId(antExManagerQueryRequest.getProvinceId());
102 104 antExRecordQuery.setCityId(antExManagerQueryRequest.getCityId());
103 105 antExRecordQuery.setAreaId(antExManagerQueryRequest.getAreaId());
  106 + antExRecordQuery.setStreetId(antExManagerQueryRequest.getStreetId());
104 107  
105 108  
106 109 //产检日期
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ baf34c9
... ... @@ -1159,9 +1159,14 @@
1159 1159 patientsQuery.setProvinceId(StringUtils.isEmpty(childbirthManagerRequest.getRegisterProvinceId()) ? null : childbirthManagerRequest.getRegisterProvinceId());
1160 1160 patientsQuery.setCityId(StringUtils.isEmpty(childbirthManagerRequest.getRegisterCityId()) ? null : childbirthManagerRequest.getRegisterCityId());
1161 1161 patientsQuery.setAreaId(StringUtils.isEmpty(childbirthManagerRequest.getRegisterAreaId()) ? null : childbirthManagerRequest.getRegisterAreaId());
  1162 + patientsQuery.setStreetId(StringUtils.isEmpty(childbirthManagerRequest.getRegisterStreetId()) ? null : childbirthManagerRequest.getRegisterStreetId());
  1163 +
1162 1164 patientsQuery.setProvinceRegisterId(StringUtils.isEmpty(childbirthManagerRequest.getLivingProvinceId()) ? null : childbirthManagerRequest.getLivingProvinceId());
1163 1165 patientsQuery.setCityRegisterId(StringUtils.isEmpty(childbirthManagerRequest.getLivingCityId()) ? null : childbirthManagerRequest.getLivingCityId());
1164 1166 patientsQuery.setAreaRegisterId(StringUtils.isEmpty(childbirthManagerRequest.getLivingAreaId()) ? null : childbirthManagerRequest.getLivingAreaId());
  1167 +
  1168 + patientsQuery.setStreetRegisterId(StringUtils.isEmpty(childbirthManagerRequest.getLivingStreetId()) ? null : childbirthManagerRequest.getLivingStreetId());
  1169 +
1165 1170 patientsQuery.setHusbandPhone(StringUtils.isEmpty(childbirthManagerRequest.getHusbandPhone()) ? null : childbirthManagerRequest.getHusbandPhone());
1166 1171 patientsQuery.setQueryNo(StringUtils.isEmpty(childbirthManagerRequest.getQueryNo()) ? null : childbirthManagerRequest.getQueryNo());
1167 1172 patientsQuery.setFmHospitalQueryList(hospitalList);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java View file @ baf34c9
... ... @@ -356,10 +356,13 @@
356 356 patientsQuery.setAreaRegisterId(riskPatientsQueryRequest.getAreaId());
357 357 patientsQuery.setCityRegisterId(riskPatientsQueryRequest.getCityId());
358 358 patientsQuery.setProvinceRegisterId(riskPatientsQueryRequest.getProvinceId());
  359 + patientsQuery.setStreetRegisterId(riskPatientsQueryRequest.getStreetId());
  360 +
359 361 //户籍地
360 362 patientsQuery.setAreaId(riskPatientsQueryRequest.getAreaRegisterId());
361 363 patientsQuery.setProvinceId(riskPatientsQueryRequest.getProvinceRegisterId());
362 364 patientsQuery.setCityId(riskPatientsQueryRequest.getCityRegisterId());
  365 + patientsQuery.setStreetId(riskPatientsQueryRequest.getStreetRegisterId());
363 366 List<String> hospitalList = null;
364 367 //区域范围内孕妇
365 368 if (isRegion) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsFacade.java View file @ baf34c9
... ... @@ -101,11 +101,13 @@
101 101 query.setProvinceRegisterId(request.getProvinceRegisterId());
102 102 query.setCityRegisterId(request.getCityRegisterId());
103 103 query.setAreaRegisterId(request.getAreaRegisterId());
  104 + query.setStreetRegisterId(request.getStreetRegisterId());
104 105  
105 106 //居住地
106 107 query.setProvinceId(request.getProvinceId());
107 108 query.setCityId(request.getCityId());
108 109 query.setAreaId(request.getAreaId());
  110 + query.setStreetId(request.getStreetId());
109 111  
110 112 List<Map<String,Object>> list = new ArrayList<>();
111 113  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExManagerQueryRequest.java View file @ baf34c9
... ... @@ -52,6 +52,8 @@
52 52 private String cityRegisterId;
53 53 @FormParam("registerAreaId")
54 54 private String areaRegisterId;
  55 + @FormParam("registerStreetId")
  56 + private String streetRegisterId;
55 57  
56 58 //居住地
57 59 @FormParam("livingProvinceId")
... ... @@ -60,6 +62,8 @@
60 62 private String cityId;
61 63 @FormParam("livingAreaId")
62 64 private String areaId;
  65 + @FormParam("livingStreetId")
  66 + private String streetId;
63 67  
64 68 //产检医院
65 69 @FormParam("hospitalProvinceId")
... ... @@ -88,6 +92,22 @@
88 92 return (end*7)+6;
89 93 }
90 94 return null;
  95 + }
  96 +
  97 + public String getStreetRegisterId() {
  98 + return streetRegisterId;
  99 + }
  100 +
  101 + public void setStreetRegisterId(String streetRegisterId) {
  102 + this.streetRegisterId = streetRegisterId;
  103 + }
  104 +
  105 + public String getStreetId() {
  106 + return streetId;
  107 + }
  108 +
  109 + public void setStreetId(String streetId) {
  110 + this.streetId = streetId;
91 111 }
92 112  
93 113 public String getStartDueWeek() {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChildbirthManagerRequest.java View file @ baf34c9
... ... @@ -66,6 +66,8 @@
66 66 */
67 67 private String registerAreaId;
68 68  
  69 + private String registerStreetId;
  70 +
69 71 /**
70 72 * @auther HuJiaqi
71 73 * @createTime 2016年12月21日 10时56分
... ... @@ -87,6 +89,9 @@
87 89 */
88 90 private String livingAreaId;
89 91  
  92 +
  93 + private String livingStreetId;
  94 +
90 95 /**
91 96 * @auther HuJiaqi
92 97 * @createTime 2016年12月21日 10时56分
... ... @@ -149,6 +154,22 @@
149 154 * @discription 自定义查询
150 155 */
151 156 private String initQuery;
  157 +
  158 + public String getLivingStreetId() {
  159 + return livingStreetId;
  160 + }
  161 +
  162 + public void setLivingStreetId(String livingStreetId) {
  163 + this.livingStreetId = livingStreetId;
  164 + }
  165 +
  166 + public String getRegisterStreetId() {
  167 + return registerStreetId;
  168 + }
  169 +
  170 + public void setRegisterStreetId(String registerStreetId) {
  171 + this.registerStreetId = registerStreetId;
  172 + }
152 173  
153 174 private Map<String, String> initQueryMap;
154 175  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ResidentsArchiveQueryRequest.java View file @ baf34c9
... ... @@ -35,15 +35,36 @@
35 35 private String cityId;
36 36 //区县
37 37 private String areaId;
38   - /* 户籍地址省市区 */
  38 +
  39 + //街道
  40 + private String streetId;
  41 +
  42 + /* 户籍地址省市区街道 */
39 43 private String provinceRegisterId;
40 44 private String cityRegisterId;
41 45 private String areaRegisterId;
  46 + private String streetRegisterId;
42 47  
43 48 //年龄(如: 24 - 26)
44 49 private String age;
45 50 //出生日期(范围值 1991-01-01 - 1994-02-02 )
46 51 private String birthday;
  52 +
  53 + public String getStreetId() {
  54 + return streetId;
  55 + }
  56 +
  57 + public void setStreetId(String streetId) {
  58 + this.streetId = streetId;
  59 + }
  60 +
  61 + public String getStreetRegisterId() {
  62 + return streetRegisterId;
  63 + }
  64 +
  65 + public void setStreetRegisterId(String streetRegisterId) {
  66 + this.streetRegisterId = streetRegisterId;
  67 + }
47 68  
48 69 public String getBuildProvinceId() {
49 70 return buildProvinceId;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/RiskPatientsQueryRequest.java View file @ baf34c9
... ... @@ -79,11 +79,13 @@
79 79 private String provinceRegisterId;
80 80 private String cityRegisterId;
81 81 private String areaRegisterId;
  82 + private String streetRegisterId;
82 83  
83 84 //居住地
84 85 private String provinceId;
85 86 private String cityId;
86 87 private String areaId;
  88 + private String streetId;
87 89  
88 90 //产检医院
89 91 private String cprovinceId;
... ... @@ -109,6 +111,22 @@
109 111  
110 112 //1. 全部孕产妇 2.全部孕妇 3. 全部产妇
111 113 private String type;
  114 +
  115 + public String getStreetRegisterId() {
  116 + return streetRegisterId;
  117 + }
  118 +
  119 + public void setStreetRegisterId(String streetRegisterId) {
  120 + this.streetRegisterId = streetRegisterId;
  121 + }
  122 +
  123 + public String getStreetId() {
  124 + return streetId;
  125 + }
  126 +
  127 + public void setStreetId(String streetId) {
  128 + this.streetId = streetId;
  129 + }
112 130  
113 131 public String getType() {
114 132 return type;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ baf34c9
... ... @@ -675,10 +675,27 @@
675 675 }
676 676 Integer type = (Integer) param.get("type");
677 677  
  678 + String coupon = (String) param.get("couponType"); /** 选中单个优惠券类型查询时 前端传的是 type_order 目前传入这种的只有使用统计 */
  679 + if(StringUtils.isNotEmpty(coupon)) {
  680 + if(coupon.contains("_")) {
  681 + String[] split = (coupon + "").split("_"); /** type_order */
  682 + List<String> couponType = CollectionUtils.asList(split[0]);
  683 + String order = split[1];
  684 + param.put("couponType", couponType);
  685 + param.put("coupon_order", order);
  686 + type = 4;
  687 + } else {
  688 + param.put("couponType", CollectionUtils.asList(coupon));
  689 + }
  690 + }
  691 +
678 692 Assert.notNull(type, "type must not be null!");
679 693  
680 694 if(type == 4) { /** 使用详情统计 */
681 695 List<Map<String, Object>> couponInfos = couponMapper.couponInfo(param);
  696 + String subTitle = null;
  697 + Set<String> subTitleTempSet = new HashSet<>();
  698 +
682 699 if(CollectionUtils.isNotEmpty(couponInfos)) {
683 700 for (Map<String, Object> couponInfo : couponInfos) {
684 701 String desc = (String) couponReportMap.get(couponInfo.get("type") + "_" + couponInfo.get("coupon_order"));
685 702  
686 703  
... ... @@ -688,18 +705,25 @@
688 705 .replace("<div class='ag-double-line'>", "")
689 706 .replace("<div>", "")
690 707 .replace("</div>", "");
  708 + if(subTitleTempSet.add(s)) {
  709 + if(StringUtils.isEmpty(subTitle)) {
  710 + subTitle = s;
  711 + } else {
  712 + subTitle += "/" + s;
  713 + }
  714 + }
691 715 couponInfo.put("type_desc", s);
692 716 }
693 717 Date useDate = (Date) couponInfo.get("use_date");
694 718 couponInfo.put("use_date", DateUtil.getyyyy_MM_dd(useDate));
695 719 /** 设置产检日期、姓名、产检孕周、产检第次、产检机构、产检医生、联系电话 */
696 720 setUsedInfo((Integer) couponInfo.get("type"), (String) couponInfo.get("used_id"),
697   - (String) couponInfo.get("sequence_id"), useDate, couponInfo
  721 + (String) couponInfo.get("sequence_id"), useDate, (String) couponInfo.get("operator_use_id"), couponInfo
698 722 );
699 723 }
700 724 }
701 725 int count = couponMapper.findCouponInfoCount(param);
702   - PageResult pageResult = new PageResult(count, (Integer) param.get("currentPage") ,(Integer) param.get("pageSize"), CollectionUtils.createMap("couponInfos", couponInfos));
  726 + PageResult pageResult = new PageResult(count, (Integer) param.get("currentPage") ,(Integer) param.get("pageSize"), CollectionUtils.createMap("couponInfos", couponInfos, "subTitle", subTitle));
703 727 return RespBuilder.buildSuccess(pageResult);
704 728 } if(type == 1) { /** 发放人数统计 */
705 729 List<Map<String,Object>> userSendInfo = couponMapper.findUserSendInfo(param);
706 730  
707 731  
708 732  
... ... @@ -707,21 +731,23 @@
707 731 for (Map<String, Object> map : userSendInfo) {
708 732 String userId = (String) map.get("user_id");
709 733 if(StringUtils.isNotEmpty(userId)) {
710   - setUserSendInfo(userId, map); /** 设置居住地、户籍地、电话 */
  734 + setUserSendInfo(userId, map); /** 设置姓名、居住地、户籍地、电话 */
711 735 }
712 736 map.put("create_date", DateUtil.getyyyy_MM_dd((Date) map.get("create_date")));
713 737 }
714 738 PageResult pageResult = new PageResult(count, (Integer) param.get("currentPage") ,(Integer) param.get("pageSize"), CollectionUtils.createMap("userSendInfos", userSendInfo));
715 739 return RespBuilder.buildSuccess(pageResult);
  740 + } else if(type == 999) { /** 先占位置 */
  741 +
716 742 }
717 743 return RespBuilder.buildSuccess();
718 744 }
719 745  
720   -
721 746 private void setUserSendInfo(String userId, Map<String, Object> map) {
722 747 Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(userId)), Patients.class);
723 748 if(patients != null) {
724 749 map.put("phone", patients.getPhone());
  750 + map.put("username", patients.getUsername());
725 751  
726 752 String residenceAddress = findName(patients.getProvinceRegisterId()) + findName(patients.getCityRegisterId()) + findName(patients.getAreaRegisterId());
727 753 map.put("residenceAddress", residenceAddress.replace("null", "")); /** 居住地 */
728 754  
729 755  
730 756  
731 757  
... ... @@ -742,28 +768,21 @@
742 768 * 7=儿童建档 lyms_baby
743 769 * 8=儿童保健 lyms_babycheck
744 770 */
745   - private void setUsedInfo(Integer type, String usedId, String sequence_id, Date useDate, Map<String, Object> map) {
  771 + private void setUsedInfo(Integer type, String usedId, String sequence_id, Date useDate, String operatorUserId, Map<String, Object> map) {
746 772 Date checkDate = null; /** 产检日期 */
747 773 String username = null; /** 姓名 */
748 774 String week = null; /** 产检孕周 = 产检时间 - 末次月经 */
749 775 Integer number = null; /** 产检第次 */
750 776 String operatorOrgName = null; /** 产检机构 */
751   - String doctorName = null; /** 产检医生 */
752 777 String phone = null; /** 联系电话 */
  778 + String doctorName = couponMapper.findUserName(operatorUserId); /** 使用医生 */
753 779 if(type == 1) {
754 780 Patients patients = mongoTemplate.findById(usedId, Patients.class);
755 781 if(patients != null) {
756 782 checkDate = patients.getCreated();
757 783 username = patients.getUsername();
758 784 week = DateUtil.getWeekDesc(patients.getLastMenses(), checkDate);
759   - List<Patients> patientsList = mongoTemplate.find(Query.query(Criteria.where("pid").is(patients.getPid())).with(new Sort(Sort.Direction.ASC, "created")), Patients.class);
760   - for(int i = 0; i < patientsList.size(); i++) {
761   - if(patientsList.get(i).getId().equals(patients.getId())) {
762   -// number = ++i;
763   - }
764   - }
765 785 operatorOrgName = couponMapper.findHospitalNameById(patients.getHospitalId());
766   - doctorName = couponMapper.findUserName(patients.getLastCheckEmployeeId());
767 786 phone = patients.getPhone();
768 787 }
769 788 } else if(type == 2) {
770 789  
771 790  
... ... @@ -774,16 +793,19 @@
774 793 week = DateUtil.getWeekDesc(antexc.getLastMenses(), antexc.getCheckTime());
775 794 number = findNumberByList("checkTime", "pid", antexc.getPid(), antexc, AntExChuModel.class);
776 795 operatorOrgName = couponMapper.findHospitalNameById(antexc.getHospitalId());
777   - doctorName = couponMapper.findUserName(antexc.getProdDoctor());
778 796 phone = findPhoneByPid(antexc.getPid());
779 797 } else {
780   -// AntenatalExaminationModel antenatal = mongoTemplate.findOne(Query.query(Criteria.where("barCode").is(sequence_id)), AntenatalExaminationModel.class);
781 798 AntenatalExaminationModel antenatal = mongoTemplate.findById(usedId, AntenatalExaminationModel.class);
782 799 if(antenatal != null) {
783 800 checkDate = antenatal.getCheckDate();
784 801 username = findUserNameByPid(antenatal.getPid());
785 802 week = antenatal.getCurrentDueDate();
786 803 List<AntenatalExaminationModel> antExChuModels = mongoTemplate.find(Query.query(Criteria.where("pid").is(antenatal.getPid())).with(new Sort(Sort.Direction.ASC, "created")), AntenatalExaminationModel.class);
  804 + List<AntExChuModel> antexcs = mongoTemplate.find(Query.query(Criteria.where("pid").is(antenatal.getPid())), AntExChuModel.class);
  805 + if(CollectionUtils.isNotEmpty(antexcs)) {
  806 +
  807 + }
  808 +
787 809 if(CollectionUtils.isNotEmpty(antExChuModels)) {
788 810 for(int i = 0; i < antExChuModels.size(); i++) {
789 811 if(antExChuModels.get(i).getId().equals(antenatal.getId())) {
... ... @@ -791,7 +813,6 @@
791 813 }
792 814 }
793 815 }
794   - doctorName = couponMapper.findUserName(antenatal.getCheckDoctor());
795 816 operatorOrgName = couponMapper.findHospitalNameById(antenatal.getHospitalId());
796 817 phone = findPhoneByPid(antenatal.getPid());
797 818 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CollectionUtils.java View file @ baf34c9
... ... @@ -141,5 +141,14 @@
141 141  
142 142 }
143 143  
  144 + public static boolean isNotEmpty(Collection ... collections) {
  145 + Assert.notNull(collections, "collections must not be null!");
  146 + for (Collection collection : collections) {
  147 + if(isEmpty(collection)) {
  148 + return false;
  149 + }
  150 + }
  151 + return true;
  152 + }
144 153 }