Commit ea395fb1cb9ccf8443b899d8e512757e4b7b470e
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 7 changed files
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/LisReportQuery.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/LisServiceImpl.java
- platform-biz-service/src/main/resources/mainOrm/master/MasterLis.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CollectionUtils.java
- platform-operate-api/src/main/webapp/WEB-INF/web.xml
platform-biz-service/src/main/java/com/lyms/platform/permission/model/LisReportQuery.java
View file @
ea395fb
| ... | ... | @@ -37,11 +37,11 @@ |
| 37 | 37 | // 患者性别 |
| 38 | 38 | private String sex; |
| 39 | 39 | // 送检日期 |
| 40 | - private Date applyTime; | |
| 40 | + private String applyTime; | |
| 41 | 41 | // 检验时间 |
| 42 | - private Date checkTime; | |
| 42 | + private String checkTime; | |
| 43 | 43 | // 报告发布时间 |
| 44 | - private Date publishTime; | |
| 44 | + private String publishTime; | |
| 45 | 45 | // 送检医生 |
| 46 | 46 | private String applyDoctor; |
| 47 | 47 | // 送检科室 |
| 48 | 48 | |
| ... | ... | @@ -49,9 +49,9 @@ |
| 49 | 49 | // 检验员 |
| 50 | 50 | private String checker; |
| 51 | 51 | // 最后修改时间 |
| 52 | - private Date modified; | |
| 52 | + private String modified; | |
| 53 | 53 | // 创建时间 |
| 54 | - private Date created; | |
| 54 | + private String created; | |
| 55 | 55 | // 医院id |
| 56 | 56 | private String hospitalId; |
| 57 | 57 | |
| ... | ... | @@ -73,70 +73,6 @@ |
| 73 | 73 | //检验明细json |
| 74 | 74 | private String itemJson; |
| 75 | 75 | |
| 76 | - public List<String> getTitles() { | |
| 77 | - return titles; | |
| 78 | - } | |
| 79 | - | |
| 80 | - public void setTitles(List<String> titles) { | |
| 81 | - this.titles = titles; | |
| 82 | - } | |
| 83 | - | |
| 84 | - public List<String> getPhones() { | |
| 85 | - return phones; | |
| 86 | - } | |
| 87 | - | |
| 88 | - public void setPhones(List<String> phones) { | |
| 89 | - this.phones = phones; | |
| 90 | - } | |
| 91 | - | |
| 92 | - public List<String> getHospitalIds() { | |
| 93 | - return hospitalIds; | |
| 94 | - } | |
| 95 | - | |
| 96 | - public void setHospitalIds(List<String> hospitalIds) { | |
| 97 | - this.hospitalIds = hospitalIds; | |
| 98 | - } | |
| 99 | - | |
| 100 | - public List<String> getVcCardNos() { | |
| 101 | - return vcCardNos; | |
| 102 | - } | |
| 103 | - | |
| 104 | - public void setVcCardNos(List<String> vcCardNos) { | |
| 105 | - this.vcCardNos = vcCardNos; | |
| 106 | - } | |
| 107 | - | |
| 108 | - public Integer getStatus() { | |
| 109 | - return status; | |
| 110 | - } | |
| 111 | - | |
| 112 | - public void setStatus(Integer status) { | |
| 113 | - this.status = status; | |
| 114 | - } | |
| 115 | - | |
| 116 | - public String getItemJson() { | |
| 117 | - return itemJson; | |
| 118 | - } | |
| 119 | - | |
| 120 | - public void setItemJson(String itemJson) { | |
| 121 | - this.itemJson = itemJson; | |
| 122 | - } | |
| 123 | - | |
| 124 | - public String getPhone() { | |
| 125 | - return phone; | |
| 126 | - } | |
| 127 | - | |
| 128 | - public void setPhone(String phone) { | |
| 129 | - this.phone = phone; | |
| 130 | - } | |
| 131 | - | |
| 132 | - public List<LisReportItemModel> getItems() { | |
| 133 | - return items; | |
| 134 | - } | |
| 135 | - | |
| 136 | - public void setItems(List<LisReportItemModel> items) { | |
| 137 | - this.items = items; | |
| 138 | - } | |
| 139 | - | |
| 140 | 76 | public Integer getId() { |
| 141 | 77 | return id; |
| 142 | 78 | } |
| ... | ... | @@ -161,6 +97,14 @@ |
| 161 | 97 | this.title = title; |
| 162 | 98 | } |
| 163 | 99 | |
| 100 | + public List<String> getTitles() { | |
| 101 | + return titles; | |
| 102 | + } | |
| 103 | + | |
| 104 | + public void setTitles(List<String> titles) { | |
| 105 | + this.titles = titles; | |
| 106 | + } | |
| 107 | + | |
| 164 | 108 | public String getType() { |
| 165 | 109 | return type; |
| 166 | 110 | } |
| ... | ... | @@ -177,6 +121,14 @@ |
| 177 | 121 | this.vcCardNo = vcCardNo; |
| 178 | 122 | } |
| 179 | 123 | |
| 124 | + public List<String> getVcCardNos() { | |
| 125 | + return vcCardNos; | |
| 126 | + } | |
| 127 | + | |
| 128 | + public void setVcCardNos(List<String> vcCardNos) { | |
| 129 | + this.vcCardNos = vcCardNos; | |
| 130 | + } | |
| 131 | + | |
| 180 | 132 | public String getName() { |
| 181 | 133 | return name; |
| 182 | 134 | } |
| 183 | 135 | |
| 184 | 136 | |
| 185 | 137 | |
| 186 | 138 | |
| 187 | 139 | |
| ... | ... | @@ -209,27 +161,27 @@ |
| 209 | 161 | this.sex = sex; |
| 210 | 162 | } |
| 211 | 163 | |
| 212 | - public Date getApplyTime() { | |
| 164 | + public String getApplyTime() { | |
| 213 | 165 | return applyTime; |
| 214 | 166 | } |
| 215 | 167 | |
| 216 | - public void setApplyTime(Date applyTime) { | |
| 168 | + public void setApplyTime(String applyTime) { | |
| 217 | 169 | this.applyTime = applyTime; |
| 218 | 170 | } |
| 219 | 171 | |
| 220 | - public Date getCheckTime() { | |
| 172 | + public String getCheckTime() { | |
| 221 | 173 | return checkTime; |
| 222 | 174 | } |
| 223 | 175 | |
| 224 | - public void setCheckTime(Date checkTime) { | |
| 176 | + public void setCheckTime(String checkTime) { | |
| 225 | 177 | this.checkTime = checkTime; |
| 226 | 178 | } |
| 227 | 179 | |
| 228 | - public Date getPublishTime() { | |
| 180 | + public String getPublishTime() { | |
| 229 | 181 | return publishTime; |
| 230 | 182 | } |
| 231 | 183 | |
| 232 | - public void setPublishTime(Date publishTime) { | |
| 184 | + public void setPublishTime(String publishTime) { | |
| 233 | 185 | this.publishTime = publishTime; |
| 234 | 186 | } |
| 235 | 187 | |
| 236 | 188 | |
| 237 | 189 | |
| 238 | 190 | |
| ... | ... | @@ -257,19 +209,19 @@ |
| 257 | 209 | this.checker = checker; |
| 258 | 210 | } |
| 259 | 211 | |
| 260 | - public Date getModified() { | |
| 212 | + public String getModified() { | |
| 261 | 213 | return modified; |
| 262 | 214 | } |
| 263 | 215 | |
| 264 | - public void setModified(Date modified) { | |
| 216 | + public void setModified(String modified) { | |
| 265 | 217 | this.modified = modified; |
| 266 | 218 | } |
| 267 | 219 | |
| 268 | - public Date getCreated() { | |
| 220 | + public String getCreated() { | |
| 269 | 221 | return created; |
| 270 | 222 | } |
| 271 | 223 | |
| 272 | - public void setCreated(Date created) { | |
| 224 | + public void setCreated(String created) { | |
| 273 | 225 | this.created = created; |
| 274 | 226 | } |
| 275 | 227 | |
| ... | ... | @@ -279,6 +231,54 @@ |
| 279 | 231 | |
| 280 | 232 | public void setHospitalId(String hospitalId) { |
| 281 | 233 | this.hospitalId = hospitalId; |
| 234 | + } | |
| 235 | + | |
| 236 | + public List<String> getHospitalIds() { | |
| 237 | + return hospitalIds; | |
| 238 | + } | |
| 239 | + | |
| 240 | + public void setHospitalIds(List<String> hospitalIds) { | |
| 241 | + this.hospitalIds = hospitalIds; | |
| 242 | + } | |
| 243 | + | |
| 244 | + public String getPhone() { | |
| 245 | + return phone; | |
| 246 | + } | |
| 247 | + | |
| 248 | + public void setPhone(String phone) { | |
| 249 | + this.phone = phone; | |
| 250 | + } | |
| 251 | + | |
| 252 | + public List<String> getPhones() { | |
| 253 | + return phones; | |
| 254 | + } | |
| 255 | + | |
| 256 | + public void setPhones(List<String> phones) { | |
| 257 | + this.phones = phones; | |
| 258 | + } | |
| 259 | + | |
| 260 | + public List<LisReportItemModel> getItems() { | |
| 261 | + return items; | |
| 262 | + } | |
| 263 | + | |
| 264 | + public void setItems(List<LisReportItemModel> items) { | |
| 265 | + this.items = items; | |
| 266 | + } | |
| 267 | + | |
| 268 | + public Integer getStatus() { | |
| 269 | + return status; | |
| 270 | + } | |
| 271 | + | |
| 272 | + public void setStatus(Integer status) { | |
| 273 | + this.status = status; | |
| 274 | + } | |
| 275 | + | |
| 276 | + public String getItemJson() { | |
| 277 | + return itemJson; | |
| 278 | + } | |
| 279 | + | |
| 280 | + public void setItemJson(String itemJson) { | |
| 281 | + this.itemJson = itemJson; | |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | @Override |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/LisServiceImpl.java
View file @
ea395fb
platform-biz-service/src/main/resources/mainOrm/master/MasterLis.xml
View file @
ea395fb
| ... | ... | @@ -122,7 +122,7 @@ |
| 122 | 122 | </if> |
| 123 | 123 | |
| 124 | 124 | <if test="checkTime != null"> |
| 125 | - AND date_format(CHECK_TIME,'%Y-%m-%d') = date_format(#{checkTime},'%Y-%m-%d') | |
| 125 | + AND date_format(CHECK_TIME,'%Y-%m-%d') = #{checkTime} | |
| 126 | 126 | </if> |
| 127 | 127 | |
| 128 | 128 | <if test="titles != null and titles.size() !=0 "> |
| ... | ... | @@ -309,7 +309,7 @@ |
| 309 | 309 | #{hospitalId} |
| 310 | 310 | </foreach> |
| 311 | 311 | </if> |
| 312 | - <if test="status != null"> | |
| 312 | + <if test="publishTime != null"> | |
| 313 | 313 | AND PUBLISH_TIME >= date_format(#{publishTime},'%Y-%m-%d') |
| 314 | 314 | </if> |
| 315 | 315 | <if test="status != null"> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java
View file @
ea395fb
| ... | ... | @@ -681,7 +681,7 @@ |
| 681 | 681 | public Map<String,Object> getNoSendLis(Integer page, Integer limit) { |
| 682 | 682 | |
| 683 | 683 | LisReportQuery query = new LisReportQuery(); |
| 684 | - query.setPublishTime(new Date()); | |
| 684 | + query.setPublishTime(DateUtil.getyyyy_MM_dd(new Date())); | |
| 685 | 685 | query.setPage(page); |
| 686 | 686 | query.setLimit(limit); |
| 687 | 687 | query.setNeed("true"); |
| ... | ... | @@ -785,7 +785,7 @@ |
| 785 | 785 | |
| 786 | 786 | query.setTitles(titles); |
| 787 | 787 | query.setHospitalId(hospitalId); |
| 788 | - query.setCheckTime(DateUtil.parseYMD(checkTime)); | |
| 788 | + query.setCheckTime(checkTime); | |
| 789 | 789 | List<LisReportModel> lises = null; |
| 790 | 790 | if ("216".equals(hospitalId)) |
| 791 | 791 | { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
ea395fb
| 1 | 1 | package com.lyms.platform.operate.web.service.impl; |
| 2 | 2 | |
| 3 | 3 | import com.lyms.hospitalapi.pojo.ReportModel; |
| 4 | +import com.lyms.platform.biz.service.CommonService; | |
| 4 | 5 | import com.lyms.platform.common.enums.CouponEnums; |
| 5 | 6 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 6 | 7 | import com.lyms.platform.common.result.PageResult; |
| 7 | 8 | |
| ... | ... | @@ -14,7 +15,9 @@ |
| 14 | 15 | import com.lyms.platform.operate.web.utils.*; |
| 15 | 16 | import com.lyms.platform.permission.dao.master.CouponMapper; |
| 16 | 17 | import com.lyms.platform.permission.model.Organization; |
| 18 | +import com.lyms.platform.permission.model.Users; | |
| 17 | 19 | import com.lyms.platform.permission.service.OrganizationService; |
| 20 | +import com.lyms.platform.permission.service.UsersService; | |
| 18 | 21 | import com.lyms.platform.pojo.*; |
| 19 | 22 | import com.lymsh.platform.reportdata.model.echarts.Series; |
| 20 | 23 | import org.apache.commons.collections.MapUtils; |
| ... | ... | @@ -62,6 +65,12 @@ |
| 62 | 65 | @Autowired |
| 63 | 66 | private OrganizationService organizationService; |
| 64 | 67 | |
| 68 | + @Autowired | |
| 69 | + private UsersService usersService; | |
| 70 | + | |
| 71 | + @Autowired | |
| 72 | + private CommonService commonService; | |
| 73 | + | |
| 65 | 74 | private static final Map<String, String> colorMap = new HashMap<>(); |
| 66 | 75 | |
| 67 | 76 | /** |
| 68 | 77 | |
| 69 | 78 | |
| 70 | 79 | |
| 71 | 80 | |
| 72 | 81 | |
| ... | ... | @@ -1207,31 +1216,82 @@ |
| 1207 | 1216 | |
| 1208 | 1217 | @Override |
| 1209 | 1218 | public BaseObjectResponse getCheckNumberInfo(Integer childBirth, Date startDate, Date endDate, Integer startWeek, Integer endWeek, Integer number, Integer id, Integer currentPage, Integer pageSize) { |
| 1219 | + String hospitalId = autoMatchFacade.getHospitalId(id); | |
| 1210 | 1220 | Map<String, Object> restMap = (Map<String, Object>) getCheckNumber(startDate, endDate, startWeek, endWeek, childBirth, id).getData(); |
| 1211 | 1221 | Map<Integer, List<String>> pidMap = (Map<Integer, List<String>>) restMap.get("pidMap"); |
| 1212 | 1222 | if(number == null) { /** 为null就查询总数 */ |
| 1213 | 1223 | number = 0; |
| 1214 | 1224 | } |
| 1225 | + Integer count = pidMap.get(number).size(); | |
| 1215 | 1226 | List<String> ids = CollectionUtils.getPageIds(pidMap.get(number), currentPage, pageSize); |
| 1216 | - System.out.println(ids); | |
| 1227 | + List<Map<String, Object>> rest = new ArrayList<>(); | |
| 1228 | + PageResult pageResult = new PageResult(count, currentPage, pageSize, rest); | |
| 1229 | + for (String pid : ids) { | |
| 1230 | + Map<String, Object> tempMap = new HashMap<>(); | |
| 1231 | + PersonModel personModel = mongoTemplate.findById(pid, PersonModel.class); | |
| 1232 | + if(personModel != null) { | |
| 1233 | + List<AntenatalExaminationModel> antenatalExaminationModels = mongoTemplate.find(Query.query(Criteria.where("pid").is(pid)).with(new Sort(Sort.Direction.DESC, "checkDate")), AntenatalExaminationModel.class); | |
| 1234 | + List<AntExChuModel> antExChuModels = mongoTemplate.find(Query.query(Criteria.where("pid").is(pid)).with(new Sort(Sort.Direction.DESC, "checkTime")), AntExChuModel.class); | |
| 1235 | + tempMap.put("NAME", personModel.getName()); | |
| 1236 | + tempMap.put("TOTAL_NUM", antenatalExaminationModels.size() + antExChuModels.size()); | |
| 1237 | + Integer benyuan = 0; | |
| 1238 | + for (AntenatalExaminationModel antenatalExaminationModel : antenatalExaminationModels) { | |
| 1239 | + if(antenatalExaminationModel.getHospitalId().equals(hospitalId)) { | |
| 1240 | + benyuan++; | |
| 1241 | + } | |
| 1242 | + } | |
| 1243 | + for (AntExChuModel antExChuModel : antExChuModels) { | |
| 1244 | + if(antExChuModel.getHospitalId().equals(hospitalId)) { | |
| 1245 | + benyuan++; | |
| 1246 | + } | |
| 1247 | + } | |
| 1248 | + tempMap.put("BENYUAN_NUM", benyuan); | |
| 1249 | + if(CollectionUtils.isNotEmpty(antenatalExaminationModels)) { | |
| 1250 | + AntenatalExaminationModel examinationModel = antenatalExaminationModels.get(0); | |
| 1251 | + tempMap.put("YUNZHOU", DateUtil.getWeek(examinationModel.getLastMenses(), examinationModel.getCheckDate())); | |
| 1252 | + tempMap.put("HIGH_RISK_GRADE", mongoUtil.findName(examinationModel.getRiskScore())); | |
| 1253 | + tempMap.put("HIGH_RISK_FACTOR", mongoUtil.findName(examinationModel.getRiskFactor())); | |
| 1254 | +// tempMap.put("EDD_DATE", examinationModel.); | |
| 1255 | + tempMap.put("LAST_EXAMINE_DATE", examinationModel.getLastMenses()); | |
| 1256 | + String prodDoctor = examinationModel.getCheckDoctor(); | |
| 1257 | + if(StringUtils.isNotBlank(prodDoctor)) { | |
| 1258 | + Users users = usersService.getUsers(Integer.parseInt(prodDoctor)); | |
| 1259 | + tempMap.put("LAST_EXAMINE_DATE", users == null ? null : users.getName()); | |
| 1260 | + } | |
| 1261 | + } else if(CollectionUtils.isNotEmpty(antExChuModels)) { | |
| 1262 | + AntExChuModel antExChuModel = antExChuModels.get(0); | |
| 1263 | + tempMap.put("YUNZHOU", DateUtil.getWeek(antExChuModel.getLastMenses(), antExChuModel.getCheckTime())); | |
| 1264 | + List riskLeve = commonService.findRiskLevel(commonService.findRiskLevel(antExChuModel.getHighrisk())); | |
| 1265 | + tempMap.put("HIGH_RISK_GRADE", mongoUtil.findName(antExChuModel.getHighriskSocre())); /** 高危等级 */ | |
| 1266 | + tempMap.put("HIGH_RISK_FACTOR", mongoUtil.findName(antExChuModel.getHighrisk())); /** 风险因素 */ | |
| 1267 | + tempMap.put("EDD_DATE", antExChuModel.getDueDate()); | |
| 1268 | + tempMap.put("LAST_EXAMINE_DATE", antExChuModel.getCheckTime()); | |
| 1269 | + String prodDoctor = antExChuModel.getProdDoctor(); | |
| 1270 | + if(StringUtils.isNotBlank(prodDoctor)) { | |
| 1271 | + Users users = usersService.getUsers(Integer.parseInt(prodDoctor)); | |
| 1272 | + tempMap.put("LAST_EXAMINE_DATE", users == null ? null : users.getName()); | |
| 1273 | + } | |
| 1274 | + } | |
| 1217 | 1275 | |
| 1218 | - | |
| 1219 | - | |
| 1220 | - return null; | |
| 1276 | + rest.add(tempMap); | |
| 1277 | + } | |
| 1278 | + setColor(rest); | |
| 1279 | + pageResult.setGrid(rest); | |
| 1280 | + } | |
| 1281 | + return RespBuilder.buildSuccess(pageResult); | |
| 1221 | 1282 | } |
| 1222 | 1283 | |
| 1223 | 1284 | private List<Map<String,Object>> getCheckNumerGrid(List<Map<String, Object>> datas, List<Object> yData, Map<Integer, List<String>> pidMap) { |
| 1224 | 1285 | /** key = pid, value = 初诊复诊记录 */ |
| 1225 | 1286 | Map<String, List<Map<String, Object>>> userCheckInfo = new HashMap<>(); |
| 1226 | 1287 | for (Map<String, Object> data : datas) { |
| 1227 | - String patientId = (String) data.get("patientId"); | |
| 1228 | - if(userCheckInfo.containsKey(patientId)) { | |
| 1229 | - List<Map<String, Object>> maps = userCheckInfo.get(patientId); | |
| 1230 | - maps.add(data); | |
| 1288 | + String pid = (String) data.get("pid"); | |
| 1289 | + if(userCheckInfo.containsKey(pid)) { | |
| 1290 | + userCheckInfo.get(pid).add(data); | |
| 1231 | 1291 | } else { |
| 1232 | 1292 | List<Map<String, Object>> maps = new ArrayList<>(); |
| 1233 | 1293 | maps.add(data); |
| 1234 | - userCheckInfo.put(patientId, maps); | |
| 1294 | + userCheckInfo.put(pid, maps); | |
| 1235 | 1295 | } |
| 1236 | 1296 | } |
| 1237 | 1297 | Map<Integer, Integer> countMap = new HashMap<>(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CollectionUtils.java
View file @
ea395fb
| ... | ... | @@ -162,7 +162,13 @@ |
| 162 | 162 | public static <T> List<T> getPageIds(List<T> data, Integer page, Integer limit) { |
| 163 | 163 | Integer startIndex = (page - 1) * limit; |
| 164 | 164 | Integer endIndex = startIndex + limit; |
| 165 | - return data.subList(startIndex, endIndex); | |
| 165 | + if(startIndex >= data.size()) { | |
| 166 | + return new ArrayList<>(); | |
| 167 | + } | |
| 168 | + if(endIndex > data.size() - 1) { | |
| 169 | + return data.subList(startIndex, data.size()); | |
| 170 | + } | |
| 171 | + return data.subList(startIndex, endIndex); | |
| 166 | 172 | } |
| 167 | 173 | |
| 168 | 174 | } |
platform-operate-api/src/main/webapp/WEB-INF/web.xml
View file @
ea395fb
| ... | ... | @@ -13,7 +13,6 @@ |
| 13 | 13 | version="2.5" |
| 14 | 14 | xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> |
| 15 | 15 | <!--start跨域开始--> |
| 16 | - | |
| 17 | 16 | <!-- |
| 18 | 17 | <filter> |
| 19 | 18 | <filter-name>CorsFilter</filter-name> |
| ... | ... | @@ -48,7 +47,6 @@ |
| 48 | 47 | <url-pattern>/*</url-pattern> |
| 49 | 48 | </filter-mapping> |
| 50 | 49 | --> |
| 51 | - | |
| 52 | 50 | <!--end跨域结束--> |
| 53 | 51 | |
| 54 | 52 | <servlet-mapping> |