Commit 8c1f79146de6ea992cc962d6f8db086d26725cff
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 10 changed files
- platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/Test.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FollowUpController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HighriskChangeHospitalController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntextDoctorPatient.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntextDoctorResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PostReviewServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java
View file @
8c1f791
| ... | ... | @@ -29,8 +29,35 @@ |
| 29 | 29 | //大于修改时间 |
| 30 | 30 | private Date gteModified; |
| 31 | 31 | private Date gteCreated; |
| 32 | + private List<String> parentIds; | |
| 32 | 33 | private String pid; |
| 34 | + private Date checkTimeStart; | |
| 35 | + private Date checkTimeEnd; | |
| 33 | 36 | |
| 37 | + public List<String> getParentIds() { | |
| 38 | + return parentIds; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public void setParentIds(List<String> parentIds) { | |
| 42 | + this.parentIds = parentIds; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public Date getCheckTimeStart() { | |
| 46 | + return checkTimeStart; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public void setCheckTimeStart(Date checkTimeStart) { | |
| 50 | + this.checkTimeStart = checkTimeStart; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public Date getCheckTimeEnd() { | |
| 54 | + return checkTimeEnd; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public void setCheckTimeEnd(Date checkTimeEnd) { | |
| 58 | + this.checkTimeEnd = checkTimeEnd; | |
| 59 | + } | |
| 60 | + | |
| 34 | 61 | //医院id |
| 35 | 62 | private List<String> hospitalList; |
| 36 | 63 | |
| ... | ... | @@ -143,6 +170,9 @@ |
| 143 | 170 | } |
| 144 | 171 | if (null != pid) { |
| 145 | 172 | condition = condition.and("pid", pid, MongoOper.IS); |
| 173 | + } | |
| 174 | + if(CollectionUtils.isNotEmpty(parentIds)){ | |
| 175 | + condition = condition.and("parentId", parentIds, MongoOper.IN); | |
| 146 | 176 | } |
| 147 | 177 | if(CollectionUtils.isNotEmpty(hospitalList)){ |
| 148 | 178 | condition = condition.and("hospitalId", hospitalList, MongoOper.IN); |
platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java
View file @
8c1f791
| ... | ... | @@ -5,9 +5,11 @@ |
| 5 | 5 | import com.lyms.platform.common.dao.operator.MongoCondition; |
| 6 | 6 | import com.lyms.platform.common.dao.operator.MongoOper; |
| 7 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 8 | +import org.apache.commons.collections.CollectionUtils; | |
| 8 | 9 | import org.springframework.data.mongodb.core.query.Criteria; |
| 9 | 10 | |
| 10 | 11 | import java.util.Date; |
| 12 | +import java.util.List; | |
| 11 | 13 | |
| 12 | 14 | /** |
| 13 | 15 | * 产前检查查询 |
| ... | ... | @@ -19,6 +21,7 @@ |
| 19 | 21 | private Integer yn; |
| 20 | 22 | private String id; |
| 21 | 23 | private String pid; |
| 24 | + private List<String> parentIds; | |
| 22 | 25 | //创建时间 |
| 23 | 26 | private Date start; |
| 24 | 27 | |
| ... | ... | @@ -33,6 +36,14 @@ |
| 33 | 36 | |
| 34 | 37 | private Date gteCreated; |
| 35 | 38 | |
| 39 | + public List<String> getParentIds() { | |
| 40 | + return parentIds; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public void setParentIds(List<String> parentIds) { | |
| 44 | + this.parentIds = parentIds; | |
| 45 | + } | |
| 46 | + | |
| 36 | 47 | public Date getGteCreated() { |
| 37 | 48 | return gteCreated; |
| 38 | 49 | } |
| ... | ... | @@ -108,6 +119,9 @@ |
| 108 | 119 | } |
| 109 | 120 | if(null!=pid){ |
| 110 | 121 | condition= condition.and("pid",pid, MongoOper.IS); |
| 122 | + } | |
| 123 | + if(CollectionUtils.isNotEmpty(parentIds)){ | |
| 124 | + condition = condition.and("parentId", parentIds, MongoOper.IN); | |
| 111 | 125 | } |
| 112 | 126 | if(null!=yn){ |
| 113 | 127 | condition= condition.and("yn",yn, MongoOper.IS); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/Test.java
View file @
8c1f791
| 1 | 1 | package com.lyms.platform.operate.web; |
| 2 | 2 | |
| 3 | +import java.text.DecimalFormat; | |
| 4 | + | |
| 3 | 5 | /** |
| 4 | 6 | * Created by Administrator on 2016/8/22 0022. |
| 5 | 7 | */ |
| ... | ... | @@ -12,11 +14,15 @@ |
| 12 | 14 | // List<String> arrayList = new ArrayList<>(); |
| 13 | 15 | // arrayList.add(3,"aaa"); |
| 14 | 16 | // System.out.println(arrayList.size()); |
| 15 | - String[] strs = new String[4]; | |
| 16 | - strs[0] = "111"; | |
| 17 | - strs[2] = "111"; | |
| 18 | - strs[3] = "111"; | |
| 19 | - strs[1] = "111"; | |
| 17 | + // String[] strs = new String[4]; | |
| 18 | + // strs[0] = "111"; | |
| 19 | + // strs[2] = "111"; | |
| 20 | + // strs[3] = "111"; | |
| 21 | + // strs[1] = "111"; | |
| 22 | + DecimalFormat df = new DecimalFormat("0.0");//格式化小数,不足的补0 | |
| 23 | + String num = df.format((float)56/96*100);//返回的是String类型的 | |
| 24 | + | |
| 25 | + System.out.println(num); | |
| 20 | 26 | |
| 21 | 27 | // ConfirmedEnums [] strs = ConfirmedEnums.values(); |
| 22 | 28 | // String vas = ConfirmedEnums.getTitle(1); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java
View file @
8c1f791
| 1 | +package com.lyms.platform.operate.web.controller; | |
| 2 | + | |
| 3 | +import com.lyms.hospitalapi.pojo.ReportModel; | |
| 4 | +import com.lyms.platform.biz.service.AntenatalExaminationService; | |
| 5 | +import com.lyms.platform.biz.service.YunBookbuildingService; | |
| 6 | +import com.lyms.platform.common.annotation.TokenRequired; | |
| 7 | +import com.lyms.platform.common.base.BaseController; | |
| 8 | +import com.lyms.platform.common.base.LoginContext; | |
| 9 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
| 10 | +import com.lyms.platform.common.utils.BeanUtils; | |
| 11 | +import com.lyms.platform.operate.web.facade.AutoMatchFacade; | |
| 12 | +import com.lyms.platform.operate.web.result.AntextDoctorPatient; | |
| 13 | +import com.lyms.platform.operate.web.result.AntextDoctorResult; | |
| 14 | +import com.lyms.platform.permission.model.Users; | |
| 15 | +import com.lyms.platform.permission.service.UsersService; | |
| 16 | +import com.lyms.platform.pojo.AntExChuModel; | |
| 17 | +import com.lyms.platform.pojo.AntenatalExaminationModel; | |
| 18 | +import com.lyms.platform.pojo.Patients; | |
| 19 | +import com.lyms.platform.query.AntExChuQuery; | |
| 20 | +import com.lyms.platform.query.AntExQuery; | |
| 21 | +import com.lyms.platform.query.PatientsQuery; | |
| 22 | +import org.apache.commons.collections.map.HashedMap; | |
| 23 | +import org.apache.commons.lang.StringUtils; | |
| 24 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 25 | +import org.springframework.stereotype.Controller; | |
| 26 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 27 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 28 | +import org.springframework.web.bind.annotation.ResponseBody; | |
| 29 | + | |
| 30 | +import javax.servlet.http.HttpServletRequest; | |
| 31 | +import java.text.DecimalFormat; | |
| 32 | +import java.util.*; | |
| 33 | + | |
| 34 | +/** | |
| 35 | + * @auther yangfei | |
| 36 | + * @createTime 2017年07月05日 14时55分 | |
| 37 | + * @discription 产检医生统计 | |
| 38 | + */ | |
| 39 | +@Controller | |
| 40 | +public class AntexDoctorStatistController extends BaseController { | |
| 41 | + | |
| 42 | + @Autowired | |
| 43 | + private AntenatalExaminationService antExService; | |
| 44 | + @Autowired | |
| 45 | + private AutoMatchFacade autoMatchFacade; | |
| 46 | + @Autowired | |
| 47 | + private YunBookbuildingService yunBookbuildingService; | |
| 48 | + @Autowired | |
| 49 | + private UsersService usersService; | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * 产检医生统计 | |
| 53 | + * | |
| 54 | + * @param startDate 建档开始时间 | |
| 55 | + * @param endDate 建档结束时间 | |
| 56 | + * @param childBirth 统计范围 1=孕妇 3=产妇 不传=全部 | |
| 57 | + * @return | |
| 58 | + */ | |
| 59 | + @RequestMapping(method = RequestMethod.GET,value = "/getDoctorStatic") | |
| 60 | + @ResponseBody | |
| 61 | + @TokenRequired | |
| 62 | + public BaseObjectResponse getDoctorStatic(Date startDate,Date endDate,Integer childBirth ,HttpServletRequest request){ | |
| 63 | + BaseObjectResponse rest = new BaseObjectResponse(); | |
| 64 | + | |
| 65 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 66 | + //根据当前登录人获取医院id | |
| 67 | + String hospital = autoMatchFacade.getHospitalId(loginState.getId()); | |
| 68 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 69 | + //医院id | |
| 70 | + patientsQuery.setHospitalId(hospital); | |
| 71 | + if(startDate!=null){ | |
| 72 | + //建档开始时间 | |
| 73 | + patientsQuery.setBookbuildingDateStart(startDate); | |
| 74 | + } | |
| 75 | + if(endDate!=null){ | |
| 76 | + //建档结束时间 | |
| 77 | + patientsQuery.setBookbuildingDateEnd(endDate); | |
| 78 | + } | |
| 79 | + //有效 | |
| 80 | + patientsQuery.setYn(1); | |
| 81 | + if(childBirth!=null){ | |
| 82 | + patientsQuery.setType(childBirth); | |
| 83 | + } | |
| 84 | + //获取患者集合 | |
| 85 | + List<Patients> patientss = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); | |
| 86 | + //患者id | |
| 87 | + List<String> pIds = new ArrayList<>(); | |
| 88 | + for(Patients ps : patientss){ | |
| 89 | + pIds.add(ps.getId()); | |
| 90 | + } | |
| 91 | + //根据patientId集合查询产检表、产检复查表,获取医生id、patientId列表 | |
| 92 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 93 | + //患者集合 | |
| 94 | + antExChuQuery.setParentIds(pIds); | |
| 95 | + antExChuQuery.setYn(1); | |
| 96 | + antExChuQuery.setHospitalId(hospital); | |
| 97 | + //初诊集合列表 | |
| 98 | + List<AntExChuModel> antExChuModels = antExService.queryAntExChu(antExChuQuery); | |
| 99 | + AntExQuery antExQuery = new AntExQuery(); | |
| 100 | + antExQuery.setHospitalId(hospital); | |
| 101 | + antExQuery.setParentIds(pIds); | |
| 102 | + antExQuery.setYn(1); | |
| 103 | + //复诊集合列表 | |
| 104 | + List<AntenatalExaminationModel> antenatalExaminationModels = antExService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
| 105 | + | |
| 106 | + List<AntextDoctorPatient> antextDoctorPatient = new ArrayList<>(); | |
| 107 | + for(AntExChuModel ac : antExChuModels){ | |
| 108 | + AntextDoctorPatient adp = new AntextDoctorPatient(); | |
| 109 | + adp.setDoctorId(ac.getProdDoctor()); | |
| 110 | + adp.setpId(ac.getPid()); | |
| 111 | + antextDoctorPatient.add(adp); | |
| 112 | + } | |
| 113 | + for(AntenatalExaminationModel aec : antenatalExaminationModels){ | |
| 114 | + AntextDoctorPatient adp = new AntextDoctorPatient(); | |
| 115 | + adp.setDoctorId(aec.getCheckDoctor()); | |
| 116 | + adp.setpId(aec.getPid()); | |
| 117 | + antextDoctorPatient.add(adp); | |
| 118 | + } | |
| 119 | + Map<String,AntextDoctorResult> adr1 = new HashMap<>(); | |
| 120 | + //医生ID+患者ID 用与医生对于产检人数 + 总人数:患者ID | |
| 121 | + Map<String,Integer> dpm = new HashMap<>(); | |
| 122 | + | |
| 123 | + //产检总人数 | |
| 124 | + int allCount = 0; | |
| 125 | + //产检总人次 | |
| 126 | + int allCjrc = 0; | |
| 127 | + //产检两次及以上 | |
| 128 | + int allDoub = 0; | |
| 129 | + //产检五次及以上; | |
| 130 | + int allFive = 0; | |
| 131 | + | |
| 132 | + for(AntextDoctorPatient adp : antextDoctorPatient){ | |
| 133 | + if(!dpm.containsKey(adp.getpId())){ | |
| 134 | + allCount++; | |
| 135 | + dpm.put(adp.getpId(),1); | |
| 136 | + }else{ | |
| 137 | + Integer cjrc = dpm.get(adp.getpId()); | |
| 138 | + cjrc++; | |
| 139 | + if(cjrc == 2){ | |
| 140 | + allDoub++; | |
| 141 | + } | |
| 142 | + if(cjrc == 5){ | |
| 143 | + allFive++; | |
| 144 | + } | |
| 145 | + dpm.put(adp.getpId(),cjrc); | |
| 146 | + } | |
| 147 | + allCjrc++; | |
| 148 | + | |
| 149 | + if(adr1.containsKey(adp.getDoctorId())){ | |
| 150 | + AntextDoctorResult adr = adr1.get(adp.getDoctorId()); | |
| 151 | + if(!dpm.containsKey(adp.getDoctorId()+adp.getpId())){//如果不存在,产检人数加1 | |
| 152 | + adr.setInspectPeople(adr.getInspectPeople()+1); | |
| 153 | + dpm.put(adp.getDoctorId()+adp.getpId(),1); | |
| 154 | + }else{//如果存在,则检测测试加一 | |
| 155 | + Integer num = dpm.get(adp.getDoctorId()+adp.getpId()); | |
| 156 | + ++num; | |
| 157 | + if(num == 2){ | |
| 158 | + adr.setTwice(adr.getTwice()+1); | |
| 159 | + }else if(num==5){ | |
| 160 | + adr.setFiveTimes(adr.getFiveTimes()+1); | |
| 161 | + } | |
| 162 | + dpm.put(adp.getDoctorId()+adp.getpId(),num); | |
| 163 | + } | |
| 164 | + adr.setInspectTime(adr.getInspectTime()+1); | |
| 165 | + }else{ | |
| 166 | + AntextDoctorResult adr = new AntextDoctorResult(); | |
| 167 | + adr.setDoctorId(adp.getDoctorId()); | |
| 168 | + adr.setInspectPeople(1); | |
| 169 | + adr.setInspectTime(1); | |
| 170 | + adr.setTwice(0); | |
| 171 | + adr.setFiveTimes(0); | |
| 172 | + adr.setTwiceProportion(""); | |
| 173 | + adr.setFiveTimeProportion(""); | |
| 174 | + adr1.put(adp.getDoctorId(),adr); | |
| 175 | + dpm.put(adp.getDoctorId()+adp.getpId(),1); | |
| 176 | + } | |
| 177 | + } | |
| 178 | + | |
| 179 | + List<Map<String,Object>> gridList = new ArrayList<>(); | |
| 180 | + //存总计 | |
| 181 | + gridList.add(new HashedMap()); | |
| 182 | + //表表图数据 | |
| 183 | + List<Object> doctorInfo = new ArrayList<>(); | |
| 184 | + | |
| 185 | + for(Map.Entry<String,AntextDoctorResult> adr : adr1.entrySet()){ | |
| 186 | + // System.out.println(adr.getValue().toString()); | |
| 187 | + AntextDoctorResult ar = adr.getValue(); | |
| 188 | + | |
| 189 | + if(StringUtils.isNotEmpty(ar.getDoctorId())){ | |
| 190 | + Users users = usersService.getUsers(Integer.parseInt(ar.getDoctorId())); | |
| 191 | + if(users!=null){ | |
| 192 | + ar.setDoctorName(users.getName()); | |
| 193 | + }else{ | |
| 194 | + ar.setDoctorName("产检医生"); | |
| 195 | + } | |
| 196 | + }else{ | |
| 197 | + ar.setDoctorName("产检医生"); | |
| 198 | + } | |
| 199 | + if(ar.getTwice()>0){ | |
| 200 | + DecimalFormat df = new DecimalFormat("0.0");//格式化小数,不足的补0 | |
| 201 | + ar.setTwiceProportion(df.format((float)ar.getTwice()/ar.getInspectPeople()*100)+"%"); | |
| 202 | + } | |
| 203 | + if(ar.getFiveTimes()>0){ | |
| 204 | + DecimalFormat df = new DecimalFormat("0.0");//格式化小数,不足的补0 | |
| 205 | + ar.setFiveTimeProportion(df.format((float)ar.getFiveTimes()/ar.getInspectPeople()*100)+"%"); | |
| 206 | + } | |
| 207 | + gridList.add(BeanUtils.objectToObjectMap(ar)); | |
| 208 | + | |
| 209 | + //柱状图图标数据 | |
| 210 | + List<Object> doctorList = new ArrayList<>(); | |
| 211 | + Map<String, Object> doctorMap = new HashMap<>(); | |
| 212 | + doctorList.add(ar.getInspectPeople()); | |
| 213 | + doctorList.add(ar.getTwice()); | |
| 214 | + doctorList.add(ar.getFiveTimes()); | |
| 215 | + doctorMap.put("name", ar.getDoctorName()); | |
| 216 | + doctorMap.put("type", "bar"); | |
| 217 | + doctorMap.put("data", doctorList); | |
| 218 | + doctorInfo.add(doctorMap); | |
| 219 | + | |
| 220 | + // System.out.println(ar.toString()); | |
| 221 | + } | |
| 222 | + | |
| 223 | + DecimalFormat df = new DecimalFormat("0.0");//格式化小数,不足的补0 | |
| 224 | + String allDoubBl = ""; | |
| 225 | + String allFiveBl = ""; | |
| 226 | + | |
| 227 | + if(allDoub>0){ | |
| 228 | + //两次比例 | |
| 229 | + allDoubBl = df.format((float)allDoub/allCount*100)+"%"; | |
| 230 | + } | |
| 231 | + if(allFive>0){ | |
| 232 | + //五次比例 | |
| 233 | + allFiveBl = df.format((float)allFive/allCount*100)+"%"; | |
| 234 | + } | |
| 235 | + | |
| 236 | + // System.out.println("总人数:"+allCount+",总人次:"+allCjrc+",总2次以上:"+allDoub+",总5次以上:"+allFive+",总两次比例:"+allDoubBl+",总五次比例:"+allFiveBl); | |
| 237 | + | |
| 238 | + //填充总计数据 | |
| 239 | + Map<String,Object> allMap = gridList.get(0); | |
| 240 | + allMap.put("doctorName","总计"); | |
| 241 | + allMap.put("inspectTime",allCjrc); | |
| 242 | + allMap.put("inspectPeople",allCount); | |
| 243 | + allMap.put("twice",allDoub); | |
| 244 | + allMap.put("twiceProportion",allDoubBl); | |
| 245 | + allMap.put("fiveTimes",allFive); | |
| 246 | + allMap.put("fiveTimeProportion",allFiveBl); | |
| 247 | + | |
| 248 | + ReportModel reportModel = new ReportModel(); | |
| 249 | + reportModel.setDoctorInfo(doctorInfo); /** 医生数据详情 */ | |
| 250 | + reportModel.setGrid(gridList); /** 表格数据 */ | |
| 251 | + reportModel.setxAxis(Arrays.asList("产检人数", "两次(含)以上人数", "五次(含)以上人数")); | |
| 252 | + rest.setData(reportModel); | |
| 253 | + return rest; | |
| 254 | + } | |
| 255 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FollowUpController.java
View file @
8c1f791
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HighriskChangeHospitalController.java
View file @
8c1f791
| ... | ... | @@ -34,7 +34,7 @@ |
| 34 | 34 | /** |
| 35 | 35 | * @auther yangfei |
| 36 | 36 | * @createTime 2017年05月09日 16时54分 |
| 37 | - * @discription 跟踪相关接口 | |
| 37 | + * @discription 听力转诊相关接口 | |
| 38 | 38 | */ |
| 39 | 39 | @Controller |
| 40 | 40 | @RequestMapping("highrChangeHosp") |
| ... | ... | @@ -127,7 +127,7 @@ |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
| 130 | - * 获取听力转诊列表 分页 | |
| 130 | + * 获取听力转诊详情 | |
| 131 | 131 | * |
| 132 | 132 | * @param chId 随访记录Id |
| 133 | 133 | * @param request |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntextDoctorPatient.java
View file @
8c1f791
| 1 | +package com.lyms.platform.operate.web.result; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * @auther yangfei | |
| 5 | + * @createTime 2017年07月05日 16时58分 | |
| 6 | + * @discription | |
| 7 | + */ | |
| 8 | +public class AntextDoctorPatient { | |
| 9 | + //医生ID | |
| 10 | + private String doctorId; | |
| 11 | + //患者ID | |
| 12 | + private String pId; | |
| 13 | + | |
| 14 | + public String getDoctorId() { | |
| 15 | + return doctorId; | |
| 16 | + } | |
| 17 | + | |
| 18 | + public void setDoctorId(String doctorId) { | |
| 19 | + this.doctorId = doctorId; | |
| 20 | + } | |
| 21 | + | |
| 22 | + public String getpId() { | |
| 23 | + return pId; | |
| 24 | + } | |
| 25 | + | |
| 26 | + public void setpId(String pId) { | |
| 27 | + this.pId = pId; | |
| 28 | + } | |
| 29 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntextDoctorResult.java
View file @
8c1f791
| 1 | +package com.lyms.platform.operate.web.result; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * @auther yangfei | |
| 5 | + * @createTime 2017年07月05日 17时09分 | |
| 6 | + * @discription | |
| 7 | + */ | |
| 8 | +public class AntextDoctorResult { | |
| 9 | + //医生ID | |
| 10 | + public String doctorId; | |
| 11 | + //医生名称 | |
| 12 | + public String doctorName; | |
| 13 | + //产检人次 | |
| 14 | + public int inspectTime; | |
| 15 | + //产检人数 | |
| 16 | + public int inspectPeople; | |
| 17 | + //两次含,以上人数 | |
| 18 | + public int twice; | |
| 19 | + //两次含以上比例 | |
| 20 | + public String twiceProportion; | |
| 21 | + //五次含,以上人数 | |
| 22 | + public int fiveTimes; | |
| 23 | + //五次含以上比例 | |
| 24 | + public String fiveTimeProportion; | |
| 25 | + | |
| 26 | + public String getDoctorId() { | |
| 27 | + return doctorId; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public void setDoctorId(String doctorId) { | |
| 31 | + this.doctorId = doctorId; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public String getDoctorName() { | |
| 35 | + return doctorName; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public void setDoctorName(String doctorName) { | |
| 39 | + this.doctorName = doctorName; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public int getInspectTime() { | |
| 43 | + return inspectTime; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public void setInspectTime(int inspectTime) { | |
| 47 | + this.inspectTime = inspectTime; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public int getInspectPeople() { | |
| 51 | + return inspectPeople; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public void setInspectPeople(int inspectPeople) { | |
| 55 | + this.inspectPeople = inspectPeople; | |
| 56 | + } | |
| 57 | + | |
| 58 | + public int getTwice() { | |
| 59 | + return twice; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public void setTwice(int twice) { | |
| 63 | + this.twice = twice; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public String getTwiceProportion() { | |
| 67 | + return twiceProportion; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public void setTwiceProportion(String twiceProportion) { | |
| 71 | + this.twiceProportion = twiceProportion; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public int getFiveTimes() { | |
| 75 | + return fiveTimes; | |
| 76 | + } | |
| 77 | + | |
| 78 | + public void setFiveTimes(int fiveTimes) { | |
| 79 | + this.fiveTimes = fiveTimes; | |
| 80 | + } | |
| 81 | + | |
| 82 | + public String getFiveTimeProportion() { | |
| 83 | + return fiveTimeProportion; | |
| 84 | + } | |
| 85 | + | |
| 86 | + public void setFiveTimeProportion(String fiveTimeProportion) { | |
| 87 | + this.fiveTimeProportion = fiveTimeProportion; | |
| 88 | + } | |
| 89 | + | |
| 90 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PostReviewServiceImpl.java
View file @
8c1f791
| ... | ... | @@ -75,10 +75,13 @@ |
| 75 | 75 | Map<String, Object> tempMap = new HashMap<>(); |
| 76 | 76 | Patients p = mongoTemplate.findById(model.getParentId(), Patients.class); |
| 77 | 77 | tempMap.put("id", model.getId()); |
| 78 | + tempMap.put("pid", p.getPid()); | |
| 79 | + tempMap.put("patientId", p.getId()); | |
| 78 | 80 | tempMap.put("vcCardNo", p.getVcCardNo()); |
| 81 | + tempMap.put("pcerteTypeId", p.getPcerteTypeId()); | |
| 79 | 82 | tempMap.put("checkTime", model.getCheckTime() == null ? null : DateUtil.getyyyy_MM_dd(model.getCheckTime())); /** 复查日期 */ |
| 80 | 83 | tempMap.put("hcertificateNum", p == null ? null : p.getCardNo()); /** 证件号 */ |
| 81 | - tempMap.put("username", p == null ? null : p.getUsername()); /** 姓名 */ | |
| 84 | + tempMap.put("name", p == null ? null : p.getUsername()); /** 姓名 */ | |
| 82 | 85 | tempMap.put("age", p == null ? null : DateUtil.getAge(p.getBirth())); /** 年龄 */ |
| 83 | 86 | tempMap.put("day", p == null ? null : model.getDay()); /** 产后天数 */ |
| 84 | 87 | tempMap.put("reviewCount", mongoTemplate.count(Query.query(Criteria.where("parentId").is(model.getParentId())), PostReviewModel.class)); /** 复查次数 */ |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
8c1f791
| ... | ... | @@ -1180,6 +1180,9 @@ |
| 1180 | 1180 | |
| 1181 | 1181 | /** 组装数据 */ |
| 1182 | 1182 | doMerge(datas, antExChuModels, antExModels, patients); |
| 1183 | + | |
| 1184 | + /** 拼装好产检次数 */ | |
| 1185 | + List<Map<String, Object>> grid = getCheckNumerGrid(datas); | |
| 1183 | 1186 | } |
| 1184 | 1187 | |
| 1185 | 1188 | // List<AntExChuModel> antExChuModels = mongoTemplate.find(antexcQuery, AntExChuModel.class); |
| 1186 | 1189 | |
| ... | ... | @@ -1199,12 +1202,47 @@ |
| 1199 | 1202 | return rest; |
| 1200 | 1203 | } |
| 1201 | 1204 | |
| 1205 | + private List<Map<String,Object>> getCheckNumerGrid(List<Map<String, Object>> datas) { | |
| 1206 | + /** key = pid, value = 初诊复诊记录 */ | |
| 1207 | + Map<String, List<Map<String, Object>>> userCheckInfo = new HashMap<>(); | |
| 1208 | + for (Map<String, Object> data : datas) { | |
| 1209 | + String patientId = (String) data.get("patientId"); | |
| 1210 | + if(userCheckInfo.containsKey(patientId)) { | |
| 1211 | + List<Map<String, Object>> maps = userCheckInfo.get(patientId); | |
| 1212 | + maps.add(data); | |
| 1213 | + } else { | |
| 1214 | + List<Map<String, Object>> maps = new ArrayList<>(); | |
| 1215 | + maps.add(data); | |
| 1216 | + userCheckInfo.put(patientId, maps); | |
| 1217 | + } | |
| 1218 | + } | |
| 1219 | + System.out.println("==========="); | |
| 1220 | + for (Map.Entry<String, List<Map<String, Object>>> map : userCheckInfo.entrySet()) { | |
| 1221 | + System.out.println(map.getKey() + " : " + map.getValue()); | |
| 1222 | + } | |
| 1223 | + | |
| 1224 | + Map<Integer, Integer> countMap = new HashMap<>(); | |
| 1225 | + for (int i = 1; i < 14; i++) { | |
| 1226 | + countMap.put(i, 0); | |
| 1227 | + } | |
| 1228 | + for (Map<String,Object> map : datas) { | |
| 1229 | + | |
| 1230 | + } | |
| 1231 | + | |
| 1232 | + List<Map<String,Object>> restList = new ArrayList<>(); | |
| 1233 | + Map<String, Object> peoples = new LinkedHashMap<>(); | |
| 1234 | + peoples.put("desc", "产检人数"); | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + return restList; | |
| 1238 | + } | |
| 1239 | + | |
| 1202 | 1240 | private void doMerge(List<Map<String, Object>> datas, List<AntExChuModel> antExChuModels, List<AntenatalExaminationModel> antExModels, List<Patients> patients) { |
| 1203 | 1241 | for (AntExChuModel antExChuModel : antExChuModels) { |
| 1204 | 1242 | for (Patients patient : patients) { |
| 1205 | 1243 | if(patient.getId().equals(antExChuModel.getParentId())) { |
| 1206 | 1244 | Map<String, Object> temp = new HashMap<>(); |
| 1207 | - temp.put("pid", antExChuModel.getPid()); | |
| 1245 | + temp.put("pid", patient.getPid()); | |
| 1208 | 1246 | temp.put("checkTime", antExChuModel.getCheckTime()); |
| 1209 | 1247 | temp.put("patientId", patient.getId()); |
| 1210 | 1248 | temp.put("bookbuildingDate", patient.getBookbuildingDate()); |
| ... | ... | @@ -1219,7 +1257,7 @@ |
| 1219 | 1257 | for (Patients patient : patients) { |
| 1220 | 1258 | if(patient.getId().equals(antExModel.getParentId())) { |
| 1221 | 1259 | Map<String, Object> temp = new HashMap<>(); |
| 1222 | - temp.put("pid", antExModel.getPid()); | |
| 1260 | + temp.put("pid", patient.getPid()); | |
| 1223 | 1261 | temp.put("checkTime", antExModel.getCheckDate()); |
| 1224 | 1262 | temp.put("patientId", antExModel.getId()); |
| 1225 | 1263 | temp.put("bookbuildingDate", patient.getBookbuildingDate()); |
| ... | ... | @@ -1233,7 +1271,11 @@ |
| 1233 | 1271 | System.out.println(antExModels.size()); |
| 1234 | 1272 | System.out.println(datas.size()); |
| 1235 | 1273 | for (Map<String, Object> data : datas) { |
| 1236 | - System.out.println(data); | |
| 1274 | + Set<Map.Entry<String, Object>> entries = data.entrySet(); | |
| 1275 | + for (Map.Entry<String, Object> entry : entries) { | |
| 1276 | + System.out.print(entry.getKey() + " = " + (entry.getValue() instanceof Date ? ((Date) entry.getValue()).toLocaleString(): entry.getValue()) + "\t"); | |
| 1277 | + } | |
| 1278 | + System.out.println(); | |
| 1237 | 1279 | } |
| 1238 | 1280 | } |
| 1239 | 1281 |