Commit d136fe994422d20ade7b69d437e7b3b98beebdee
1 parent
39946cd6b5
Exists in
master
and in
6 other branches
增值服务统计-优化增值服务统计,增加开通人的数据输入和查询
Showing 3 changed files with 164 additions and 8 deletions
platform-biz-service/src/main/java/com/lyms/platform/permission/model/ServiceListQuery.java
View file @
d136fe9
... | ... | @@ -28,6 +28,58 @@ |
28 | 28 | |
29 | 29 | private Date endTime; |
30 | 30 | |
31 | + /** | |
32 | + * 孕妇服务类型(1-孕期精准医疗、2-体重管理、3-血糖管理、4-血压管理、5-专家咨询、6-标准服务、7-体温管理)、儿童服务类型(10-精准指导、11-标准服务) | |
33 | + */ | |
34 | + private String serType; | |
35 | + | |
36 | + /** | |
37 | + * 开通人 | |
38 | + */ | |
39 | + private String createUser; | |
40 | + | |
41 | + /** | |
42 | + * 操作员 | |
43 | + */ | |
44 | + private String operator; | |
45 | + | |
46 | + /** | |
47 | + * 指定医生 | |
48 | + */ | |
49 | + private String serDoct; | |
50 | + | |
51 | + public String getSerType() { | |
52 | + return serType; | |
53 | + } | |
54 | + | |
55 | + public void setSerType(String serType) { | |
56 | + this.serType = serType; | |
57 | + } | |
58 | + | |
59 | + public String getCreateUser() { | |
60 | + return createUser; | |
61 | + } | |
62 | + | |
63 | + public void setCreateUser(String createUser) { | |
64 | + this.createUser = createUser; | |
65 | + } | |
66 | + | |
67 | + public String getOperator() { | |
68 | + return operator; | |
69 | + } | |
70 | + | |
71 | + public void setOperator(String operator) { | |
72 | + this.operator = operator; | |
73 | + } | |
74 | + | |
75 | + public String getSerDoct() { | |
76 | + return serDoct; | |
77 | + } | |
78 | + | |
79 | + public void setSerDoct(String serDoct) { | |
80 | + this.serDoct = serDoct; | |
81 | + } | |
82 | + | |
31 | 83 | public Date getEndTime() { |
32 | 84 | return endTime; |
33 | 85 | } |
platform-biz-service/src/main/resources/mainOrm/master/PatientService.xml
View file @
d136fe9
... | ... | @@ -410,6 +410,18 @@ |
410 | 410 | <if test="query.endTime != null "> |
411 | 411 | AND ps.create_date <= #{query.endTime} |
412 | 412 | </if> |
413 | + <if test="query.serType != null and query.serType != '' "> | |
414 | + AND ps.ser_type = #{query.serType} | |
415 | + </if> | |
416 | + <if test="query.createUser != null and query.createUser != '' "> | |
417 | + AND ps.create_user = #{query.createUser} | |
418 | + </if> | |
419 | + <if test="query.operator != null and query.operator != '' "> | |
420 | + AND ps.update_user = #{query.operator} | |
421 | + </if> | |
422 | + <if test="query.serDoct != null and query.serDoct != '' "> | |
423 | + AND ps.ser_doct = #{query.serDoct} | |
424 | + </if> | |
413 | 425 | <if test="query.provinceId != null and query.provinceId != '' "> |
414 | 426 | and o.province_id = #{query.provinceId} |
415 | 427 | </if> |
... | ... | @@ -446,6 +458,18 @@ |
446 | 458 | #{item} |
447 | 459 | </foreach> |
448 | 460 | </if> |
461 | + <if test="param.serType != null and param.serType != ''"> | |
462 | + AND ps.ser_type = #{param.serType} | |
463 | + </if> | |
464 | + <if test="param.createUser != null and param.createUser != '' "> | |
465 | + AND ps.create_user = #{param.createUser} | |
466 | + </if> | |
467 | + <if test="param.operator != null and param.operator != '' "> | |
468 | + AND ps.update_user = #{param.operator} | |
469 | + </if> | |
470 | + <if test="param.serDoct != null and param.serDoct != '' "> | |
471 | + AND ps.ser_doct = #{param.serDoct} | |
472 | + </if> | |
449 | 473 | </select> |
450 | 474 | <select id="getServeDetailList" parameterType="com.lyms.platform.permission.model.ServiceListQuery" resultType="java.util.Map"> |
451 | 475 | SELECT |
... | ... | @@ -455,6 +479,8 @@ |
455 | 479 | IFNULL(ps.serviceWeek, 24) as "serviceWeek", |
456 | 480 | ps.ser_type as "serType", |
457 | 481 | ps.ser_doct as "serDoct", |
482 | + ps.create_user as "createUser", | |
483 | + ps.update_user as "updateUser", | |
458 | 484 | CASE ps.ser_status |
459 | 485 | WHEN 1 THEN |
460 | 486 | '开通中' |
461 | 487 | |
... | ... | @@ -487,9 +513,21 @@ |
487 | 513 | <if test="param.areaId != null and param.areaId != ''"> |
488 | 514 | AND o.area_id = #{param.areaId} |
489 | 515 | </if> |
490 | - <if test="param.serStatus != null"> | |
516 | + <if test="param.serStatus != null and param.serStatus != ''"> | |
491 | 517 | AND ps.ser_status = #{param.serStatus} |
492 | 518 | </if> |
519 | + <if test="param.serType != null and param.serType != ''"> | |
520 | + AND ps.ser_type = #{param.serType} | |
521 | + </if> | |
522 | + <if test="param.createUser != null and param.createUser != '' "> | |
523 | + AND ps.create_user = #{param.createUser} | |
524 | + </if> | |
525 | + <if test="param.operator != null and param.operator != '' "> | |
526 | + AND ps.update_user = #{param.operator} | |
527 | + </if> | |
528 | + <if test="param.serDoct != null and param.serDoct != '' "> | |
529 | + AND ps.ser_doct = #{param.serDoct} | |
530 | + </if> | |
493 | 531 | <if test="param.sort != null and param.sort != '' "> |
494 | 532 | order by "createDate" ${param.sort} |
495 | 533 | <if test="param.need != null"> |
496 | 534 | |
... | ... | @@ -516,9 +554,21 @@ |
516 | 554 | <if test="param.areaId != null and param.areaId != ''"> |
517 | 555 | AND o.area_id = #{param.areaId} |
518 | 556 | </if> |
519 | - <if test="param.serStatus != null"> | |
557 | + <if test="param.serStatus != null and param.serStatus != ''"> | |
520 | 558 | AND ps.ser_status = #{param.serStatus} |
521 | 559 | </if> |
560 | + <if test="param.serType != null and param.serType != ''"> | |
561 | + AND ps.ser_type = #{param.serType} | |
562 | + </if> | |
563 | + <if test="param.createUser != null and param.createUser != '' "> | |
564 | + AND ps.create_user = #{param.createUser} | |
565 | + </if> | |
566 | + <if test="param.operator != null and param.operator != '' "> | |
567 | + AND ps.update_user = #{param.operator} | |
568 | + </if> | |
569 | + <if test="param.serDoct != null and param.serDoct != '' "> | |
570 | + AND ps.ser_doct = #{param.serDoct} | |
571 | + </if> | |
522 | 572 | and ps.create_date >= #{param.startTime} |
523 | 573 | AND ps.create_date <= #{param.endTime} |
524 | 574 | </select> |
... | ... | @@ -526,7 +576,13 @@ |
526 | 576 | select |
527 | 577 | o.id as "hospitalId" |
528 | 578 | from organization o |
529 | - join (select ps.hospital_id from patient_service ps where ps.create_date >= #{param.startTime} and ps.create_date <= #{param.endTime} group by ps.hospital_id) | |
579 | + join (select ps.hospital_id from patient_service ps | |
580 | + where ps.create_date >= #{param.startTime} and ps.create_date <= #{param.endTime} | |
581 | + <if test="param.serType != null and param.serType != ''">and ps.ser_type = #{param.serType}</if> | |
582 | + <if test="param.createUser != null and param.createUser != ''">and ps.create_user = #{param.createUser}</if> | |
583 | + <if test="param.operator != null and param.operator != ''">and ps.update_user = #{param.operator}</if> | |
584 | + <if test="param.serDoct != null and param.serDoct != ''">and ps.ser_doct = #{param.serDoct}</if> | |
585 | + group by ps.hospital_id) | |
530 | 586 | t on t.hospital_id = o.id |
531 | 587 | where t.hospital_id in |
532 | 588 | <foreach collection="ids" item="item" open="(" close=")" separator=","> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AreaCountFacade.java
View file @
d136fe9
... | ... | @@ -1151,12 +1151,24 @@ |
1151 | 1151 | return response; |
1152 | 1152 | } |
1153 | 1153 | |
1154 | + /** | |
1155 | + * | |
1156 | + * @param object | |
1157 | + * @return | |
1158 | + */ | |
1154 | 1159 | private String getString(Object object){ |
1155 | 1160 | if (object != null){ |
1156 | 1161 | return object.toString(); |
1157 | 1162 | } |
1158 | 1163 | return ""; |
1159 | 1164 | } |
1165 | + | |
1166 | + /** | |
1167 | + * 增值服务详情list和导出公用方法:查出符合条件的list | |
1168 | + * | |
1169 | + * @param param | |
1170 | + * @return | |
1171 | + */ | |
1160 | 1172 | private List<Map<String, Object>> getServiceDetailListMap(ServiceListQuery param) { |
1161 | 1173 | List<Map<String, Object>> mapList = patientServiceService.getServeDetailList(param); |
1162 | 1174 | if (CollectionUtils.isNotEmpty(mapList)){ |
... | ... | @@ -1170,6 +1182,10 @@ |
1170 | 1182 | Object serDoctObj = map.get("serDoct"); |
1171 | 1183 | String serDoct = getString(serDoctObj); |
1172 | 1184 | Date createDate = (Date) map.get("createDate"); |
1185 | + Object createUserObj = map.get("createUser"); | |
1186 | + String createUser = getString(createUserObj); | |
1187 | + Object updateUserObj = map.get("updateUser"); | |
1188 | + String updateUser = getString(updateUserObj); | |
1173 | 1189 | String userName = ""; |
1174 | 1190 | if ("1".equals(perType)){ |
1175 | 1191 | // 孕妇 |
... | ... | @@ -1197,6 +1213,8 @@ |
1197 | 1213 | map.put("patientName", userName); |
1198 | 1214 | String serTypeName = getSerTypeName(serType); |
1199 | 1215 | map.put("serTypeName", serTypeName); |
1216 | + | |
1217 | + // 指定医生 | |
1200 | 1218 | String doctorName = ""; |
1201 | 1219 | if (serDoct != null && !"".equals(serDoct)){ |
1202 | 1220 | Users users = usersService.getUsers(Integer.parseInt(serDoct)); |
1203 | 1221 | |
... | ... | @@ -1204,12 +1222,26 @@ |
1204 | 1222 | doctorName = users.getName(); |
1205 | 1223 | } |
1206 | 1224 | } |
1207 | - | |
1225 | + // 开通人 | |
1226 | + String createUserName = ""; | |
1227 | + if (StringUtils.isNotEmpty(createUser)){ | |
1228 | + Users users = usersService.getUsers(Integer.parseInt(createUser)); | |
1229 | + if (users != null){ | |
1230 | + createUserName = users.getName(); | |
1231 | + } | |
1232 | + } | |
1233 | + // 操作人 | |
1234 | + String operatorName = ""; | |
1235 | + if (StringUtils.isNotEmpty(updateUser)){ | |
1236 | + Users users = usersService.getUsers(Integer.parseInt(updateUser)); | |
1237 | + if (users != null){ | |
1238 | + operatorName = users.getName(); | |
1239 | + } | |
1240 | + } | |
1241 | + map.put("createUserName", createUserName); | |
1242 | + map.put("operatorName", operatorName); | |
1208 | 1243 | map.put("doctorName", doctorName); |
1209 | - map.remove("parentId"); | |
1210 | - map.remove("perType"); | |
1211 | - map.remove("serType"); | |
1212 | - map.remove("serDoct"); | |
1244 | + removeKey(map); | |
1213 | 1245 | } |
1214 | 1246 | } |
1215 | 1247 | |
... | ... | @@ -1217,6 +1249,20 @@ |
1217 | 1249 | } |
1218 | 1250 | |
1219 | 1251 | /** |
1252 | + * 删除多余的key,方便导出 | |
1253 | + * | |
1254 | + * @param map | |
1255 | + */ | |
1256 | + private void removeKey(Map map) { | |
1257 | + map.remove("parentId"); | |
1258 | + map.remove("perType"); | |
1259 | + map.remove("serType"); | |
1260 | + map.remove("serDoct"); | |
1261 | + map.remove("createUser"); | |
1262 | + map.remove("updateUser"); | |
1263 | + } | |
1264 | + | |
1265 | + /** | |
1220 | 1266 | * 详情导出 |
1221 | 1267 | * |
1222 | 1268 | * @param param |
1223 | 1269 | |
... | ... | @@ -1230,10 +1276,12 @@ |
1230 | 1276 | names.put("createDate","购买日期"); |
1231 | 1277 | names.put("patientName", "姓名"); |
1232 | 1278 | names.put("opnYumSize", "开通孕周"); |
1279 | + names.put("createUserName", "开通人"); | |
1233 | 1280 | names.put("serTypeName", "服务类型"); |
1234 | 1281 | names.put("serviceWeek","服务周期"); |
1235 | 1282 | names.put("doctorName", "指定医生"); |
1236 | 1283 | names.put("serStatus","服务状态"); |
1284 | + names.put("operatorName", "操作人"); | |
1237 | 1285 | ResponseUtil.responseExcel(names,serviceDetailListMap,response); |
1238 | 1286 | } |
1239 | 1287 | } |