Commit 833e8b474ec9a170c423fd1c7c410ee190fce492
1 parent
0dc20b9af6
Exists in
master
and in
6 other branches
bug修复
Showing 2 changed files with 16 additions and 3 deletions
platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml
View file @
833e8b4
... | ... | @@ -203,8 +203,8 @@ |
203 | 203 | |
204 | 204 | <select id="findHospitals" parameterType="map" resultType="map"> |
205 | 205 | select a.coupon_template_group_id as id, b.name |
206 | - from hospital_coupon_template_group a, organization b | |
207 | - where a.hospital_id = b.id and a.hospital_id in | |
206 | + from hospital_coupon_template_group a, coupon_template_group b | |
207 | + where a.coupon_template_group_id = b.id and a.hospital_id in | |
208 | 208 | <foreach collection="hospitalIds" open="(" close=")" separator="," item="hid"> |
209 | 209 | #{hid} |
210 | 210 | </foreach> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
833e8b4
... | ... | @@ -13,11 +13,14 @@ |
13 | 13 | import com.lyms.platform.operate.web.facade.AutoMatchFacade; |
14 | 14 | import com.lyms.platform.operate.web.service.IReportService; |
15 | 15 | import com.lyms.platform.operate.web.utils.*; |
16 | +import com.lyms.platform.operate.web.utils.CollectionUtils; | |
16 | 17 | import com.lyms.platform.permission.dao.master.CouponMapper; |
17 | 18 | import com.lyms.platform.pojo.*; |
18 | 19 | import com.lymsh.platform.reportdata.model.echarts.Series; |
20 | +import org.apache.commons.collections.*; | |
19 | 21 | import org.apache.commons.lang.StringUtils; |
20 | 22 | import org.springframework.beans.factory.annotation.Autowired; |
23 | +import org.springframework.data.domain.Sort; | |
21 | 24 | import org.springframework.data.mongodb.core.MongoTemplate; |
22 | 25 | import org.springframework.data.mongodb.core.query.Criteria; |
23 | 26 | import org.springframework.data.mongodb.core.query.Query; |
... | ... | @@ -618,7 +621,17 @@ |
618 | 621 | map.put("username", patients.getUsername()); /** 姓名 */ |
619 | 622 | } |
620 | 623 | map.put("week", DateUtil.getWeek(antexc.getLastMenses(), antexc.getCheckTime()));/** 产检孕周 = 产检时间 - 末次月经 */ |
621 | - map.put("number", antexc.getProdTime()); /** 产检第几次 */ | |
624 | + | |
625 | + List<AntExChuModel> antExChuModels = mongoTemplate.find(Query.query(Criteria.where("pid").is(antexc.getPid())).with(new Sort(Sort.Direction.ASC, "checkTime")), AntExChuModel.class); | |
626 | + if(org.apache.commons.collections.CollectionUtils.isNotEmpty(antExChuModels)) { | |
627 | + for(int i = 0; i < antExChuModels.size(); i++) { | |
628 | + if(antExChuModels.get(i).getId().equals(antexc.getId())) { | |
629 | + map.put("number", ++i); /** 产检第几次 */ | |
630 | + return; | |
631 | + } | |
632 | + } | |
633 | + } | |
634 | + | |
622 | 635 | map.put("doctorName", couponMapper.findUserName(antexc.getProdDoctor())); /** 产检医生 */ |
623 | 636 | map.put("operatorOrgName", couponMapper.findUserName(antexc.getOperator() + "")); /** 产检机构 */ |
624 | 637 | PersonModel personModel = mongoTemplate.findById(map.get("user_id"), PersonModel.class); |