Commit c6fa34ce1c7eaa1dbf635739d0b321af82a8fa28
1 parent
29be2bcf0d
Exists in
master
and in
6 other branches
bug
Showing 2 changed files with 7 additions and 7 deletions
platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml
View file @
c6fa34c
... | ... | @@ -585,7 +585,7 @@ |
585 | 585 | |
586 | 586 | <select id="findUnUsedInfo" parameterType="map" resultType="map"> |
587 | 587 | select a.user_id, b.coupon_order, c.type from coupon_info a, coupon_template b, coupon_type c |
588 | - where a.coupon_template_id = b.id and b.type_id = c.id and a.status = 1 | |
588 | + where a.coupon_template_id = b.id and b.type_id = c.id and a.status = 1 and a.create_hospital_id = #{hospitalId} | |
589 | 589 | and a.user_id in |
590 | 590 | <foreach collection="userIds" open="(" close=")" separator="," item="uid"> |
591 | 591 | #{uid} |
... | ... | @@ -598,7 +598,7 @@ |
598 | 598 | <select id="findUnUsedInfoCount" parameterType="map" resultType="integer"> |
599 | 599 | select count(1) from ( |
600 | 600 | select a.user_id, b.coupon_order, c.type from coupon_info a, coupon_template b, coupon_type c |
601 | - where a.coupon_template_id = b.id and b.type_id = c.id and a.status = 1 | |
601 | + where a.coupon_template_id = b.id and b.type_id = c.id and a.status = 1 and a.create_hospital_id = #{hospitalId} | |
602 | 602 | and a.user_id in |
603 | 603 | <foreach collection="userIds" open="(" close=")" separator="," item="uid"> |
604 | 604 | #{uid} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
c6fa34c
... | ... | @@ -512,7 +512,7 @@ |
512 | 512 | Map<String, Integer> hospitalPatientCount = new HashMap<>(); |
513 | 513 | |
514 | 514 | if(CollectionUtils.isNotEmpty(hospitalIds)) { |
515 | - List<Patients> patients = getPatients(hospitalIds, datas, startDate, endDate, provinceId, cityId, areaId, false); | |
515 | + List<Patients> patients = getPatients(hospitalIds, datas, startDate, endDate, provinceId, cityId, areaId, null); | |
516 | 516 | for (Patients patient : patients) { |
517 | 517 | if(hospitalPatientCount.containsKey(patient.getHospitalId())) { |
518 | 518 | hospitalPatientCount.put(patient.getHospitalId(), hospitalPatientCount.get(patient.getHospitalId()) + 1); |
... | ... | @@ -578,7 +578,7 @@ |
578 | 578 | for (Patients patient : patients) { |
579 | 579 | userIds.add(patient.getPid()); |
580 | 580 | } |
581 | - List<Map<String, Object>> list = couponMapper.findUnUsedInfo(CollectionUtils.createMap("userIds", userIds, "page", (page - 1) * limit, "limit", limit)); | |
581 | + List<Map<String, Object>> list = couponMapper.findUnUsedInfo(CollectionUtils.createMap("hospitalId", hospitalId, "userIds", userIds, "page", (page - 1) * limit, "limit", limit)); | |
582 | 582 | List<Map<String, Object>> restList = new ArrayList<>(); |
583 | 583 | for (Map<String, Object> map : list) { |
584 | 584 | map.put("couponName", (couponReportMap.get(map.get("type") + "_" + map.get("coupon_order"))).toString() |
... | ... | @@ -764,7 +764,7 @@ |
764 | 764 | List<String> hospitalIds = getHospitalIds(userId, hospitalId); |
765 | 765 | List<Map<String, Object>> datas = couponMapper.findHospitalInfoByIds(hospitalIds); |
766 | 766 | if(CollectionUtils.isNotEmpty(hospitalIds)) { |
767 | - List<Patients> patients = getPatients(hospitalIds, datas, startDate, endDate, provinceId, cityId, areaId, false); | |
767 | + List<Patients> patients = getPatients(hospitalIds, datas, startDate, endDate, provinceId, cityId, areaId, null); | |
768 | 768 | List<Map<String, Object>> restList = new ArrayList<>(); |
769 | 769 | List<Patients> pageRows = CollectionUtils.getPageIds(patients, page, limit); |
770 | 770 | for (Patients patient : pageRows) { |
... | ... | @@ -789,7 +789,7 @@ |
789 | 789 | } |
790 | 790 | return RespBuilder.buildSuccess("hospitalIds为null"); |
791 | 791 | } |
792 | - private List<Patients> getPatients(List<String> hospitalIds, List<Map<String, Object>> datas, Date startDate, Date endDate, String provinceId, String cityId, String areaId, boolean isSendCoupon) { | |
792 | + private List<Patients> getPatients(List<String> hospitalIds, List<Map<String, Object>> datas, Date startDate, Date endDate, String provinceId, String cityId, String areaId, Object isSendCoupon) { | |
793 | 793 | Iterator<String> iterator = hospitalIds.iterator(); |
794 | 794 | while (iterator.hasNext()) { |
795 | 795 | String id = iterator.next(); |
... | ... | @@ -813,7 +813,7 @@ |
813 | 813 | } |
814 | 814 | } |
815 | 815 | Criteria c = new Criteria(); |
816 | - c.and("hospitalId").in(hospitalIds).and("isSendCoupon").ne(!isSendCoupon).and("yn").ne(0).and("enable").ne("2"); | |
816 | + c.and("hospitalId").in(hospitalIds).and("isSendCoupon").is(isSendCoupon).and("yn").ne(0).and("enable").ne("2"); | |
817 | 817 | if(startDate != null && endDate != null) { |
818 | 818 | c.and("bookbuildingDate").gte(startDate).lt(DateUtil.addDay(endDate, 1)); |
819 | 819 | } |