Commit 6972f917d888217f1d8d0ca10cbbf5a86c66f73b
1 parent
8963986c38
Exists in
master
and in
6 other branches
bug
Showing 3 changed files with 26 additions and 11 deletions
platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml
View file @
6972f91
... | ... | @@ -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> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java
View file @
6972f91
... | ... | @@ -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/service/impl/ReportServiceImpl.java
View file @
6972f91
... | ... | @@ -675,6 +675,20 @@ |
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) { /** 使用详情统计 */ |
... | ... | @@ -694,7 +708,7 @@ |
694 | 708 | couponInfo.put("use_date", DateUtil.getyyyy_MM_dd(useDate)); |
695 | 709 | /** 设置产检日期、姓名、产检孕周、产检第次、产检机构、产检医生、联系电话 */ |
696 | 710 | setUsedInfo((Integer) couponInfo.get("type"), (String) couponInfo.get("used_id"), |
697 | - (String) couponInfo.get("sequence_id"), useDate, couponInfo | |
711 | + (String) couponInfo.get("sequence_id"), useDate, (String) couponInfo.get("operator_use_id"), couponInfo | |
698 | 712 | ); |
699 | 713 | } |
700 | 714 | } |
... | ... | @@ -713,6 +727,8 @@ |
713 | 727 | } |
714 | 728 | PageResult pageResult = new PageResult(count, (Integer) param.get("currentPage") ,(Integer) param.get("pageSize"), CollectionUtils.createMap("userSendInfos", userSendInfo)); |
715 | 729 | return RespBuilder.buildSuccess(pageResult); |
730 | + } else if(type == 999) { /** 先占位置 */ | |
731 | + | |
716 | 732 | } |
717 | 733 | return RespBuilder.buildSuccess(); |
718 | 734 | } |
719 | 735 | |
720 | 736 | |
721 | 737 | |
722 | 738 | |
723 | 739 | |
... | ... | @@ -742,28 +758,27 @@ |
742 | 758 | * 7=儿童建档 lyms_baby |
743 | 759 | * 8=儿童保健 lyms_babycheck |
744 | 760 | */ |
745 | - private void setUsedInfo(Integer type, String usedId, String sequence_id, Date useDate, Map<String, Object> map) { | |
761 | + private void setUsedInfo(Integer type, String usedId, String sequence_id, Date useDate, String operatorUserId, Map<String, Object> map) { | |
746 | 762 | Date checkDate = null; /** 产检日期 */ |
747 | 763 | String username = null; /** 姓名 */ |
748 | 764 | String week = null; /** 产检孕周 = 产检时间 - 末次月经 */ |
749 | 765 | Integer number = null; /** 产检第次 */ |
750 | 766 | String operatorOrgName = null; /** 产检机构 */ |
751 | - String doctorName = null; /** 产检医生 */ | |
752 | 767 | String phone = null; /** 联系电话 */ |
768 | + String doctorName = couponMapper.findUserName(operatorUserId); /** 使用医生 */ | |
753 | 769 | if(type == 1) { |
754 | 770 | Patients patients = mongoTemplate.findById(usedId, Patients.class); |
755 | 771 | if(patients != null) { |
756 | 772 | checkDate = patients.getCreated(); |
757 | 773 | username = patients.getUsername(); |
758 | 774 | 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); | |
775 | + /* List<Patients> patientsList = mongoTemplate.find(Query.query(Criteria.where("pid").is(patients.getPid())).with(new Sort(Sort.Direction.ASC, "created")), Patients.class); | |
760 | 776 | for(int i = 0; i < patientsList.size(); i++) { |
761 | 777 | if(patientsList.get(i).getId().equals(patients.getId())) { |
762 | 778 | // number = ++i; |
763 | 779 | } |
764 | - } | |
780 | + }*/ | |
765 | 781 | operatorOrgName = couponMapper.findHospitalNameById(patients.getHospitalId()); |
766 | - doctorName = couponMapper.findUserName(patients.getLastCheckEmployeeId()); | |
767 | 782 | phone = patients.getPhone(); |
768 | 783 | } |
769 | 784 | } else if(type == 2) { |
770 | 785 | |
... | ... | @@ -774,10 +789,8 @@ |
774 | 789 | week = DateUtil.getWeekDesc(antexc.getLastMenses(), antexc.getCheckTime()); |
775 | 790 | number = findNumberByList("checkTime", "pid", antexc.getPid(), antexc, AntExChuModel.class); |
776 | 791 | operatorOrgName = couponMapper.findHospitalNameById(antexc.getHospitalId()); |
777 | - doctorName = couponMapper.findUserName(antexc.getProdDoctor()); | |
778 | 792 | phone = findPhoneByPid(antexc.getPid()); |
779 | 793 | } else { |
780 | -// AntenatalExaminationModel antenatal = mongoTemplate.findOne(Query.query(Criteria.where("barCode").is(sequence_id)), AntenatalExaminationModel.class); | |
781 | 794 | AntenatalExaminationModel antenatal = mongoTemplate.findById(usedId, AntenatalExaminationModel.class); |
782 | 795 | if(antenatal != null) { |
783 | 796 | checkDate = antenatal.getCheckDate(); |
... | ... | @@ -791,7 +804,6 @@ |
791 | 804 | } |
792 | 805 | } |
793 | 806 | } |
794 | - doctorName = couponMapper.findUserName(antenatal.getCheckDoctor()); | |
795 | 807 | operatorOrgName = couponMapper.findHospitalNameById(antenatal.getHospitalId()); |
796 | 808 | phone = findPhoneByPid(antenatal.getPid()); |
797 | 809 | } |