|
@@ -24,6 +24,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 会诊订单相关方法
|
|
@@ -71,6 +72,27 @@ public class OfflineNewService {
|
|
|
return jdbcTemplate.query(sqlBuilder, paramList.toArray(), new BeanPropertyRowMapper<>(OfflineConsultation.class));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 把医院后台查询的 hospitalId 转换为线下就诊订单的 source 来源
|
|
|
+ * v2.4.4_nfth 版本新增,需求描述:从“南方医院太和分院公众号”和现场扫码“太和医务通互联网医院”下单的订单,均显示在太和后台
|
|
|
+ *
|
|
|
+ * @param hospitalId 医院后台查询携带的 hospitalId
|
|
|
+ * @return 该医院可以查看的线下就诊订单来源列表
|
|
|
+ */
|
|
|
+ private List<Integer> convertHospitalId2OfflineSources(int hospitalId) {
|
|
|
+ List<Integer> list = new ArrayList<>();
|
|
|
+ switch (hospitalId) {
|
|
|
+ case ConstantDef.TAIHE_HOSPITAL_ID:
|
|
|
+ list.add(OfflineConsultationSourceEnum.TAIHE_WX_OFFICIAL.getValue());
|
|
|
+ list.add(OfflineConsultationSourceEnum.SCENE_SCAN.getValue());
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ list.add(OfflineConsultationSourceEnum.UNKNOWN.getValue());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public Map queryOfflineListCommon(DownloadOfflineListNewRequest request) {
|
|
|
Map map = new HashMap();
|
|
@@ -143,11 +165,13 @@ public class OfflineNewService {
|
|
|
whereSql += " and ( doctor_name like ? )";
|
|
|
paramList.add("%" + doctorName.trim() + "%");
|
|
|
}
|
|
|
-
|
|
|
+ String source = request.getSource();
|
|
|
int searchHospitalId = request.getHospitalId();
|
|
|
- if (searchHospitalId > -1) {
|
|
|
- whereSql += " and ( hospital_id = ? )";
|
|
|
- paramList.add(searchHospitalId);
|
|
|
+ if (searchHospitalId > -1 && StringHelper.isNullOrWhiteSpace(source)) {
|
|
|
+ List<Integer> filteredSources = convertHospitalId2OfflineSources(searchHospitalId);
|
|
|
+ if (!Checker.isNone(filteredSources)) {
|
|
|
+ whereSql += String.format(" and ( source in (%s) )", filteredSources.stream().map(String::valueOf).collect(Collectors.joining(",")));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
String hisClinicCode = request.getHisClinicCode();
|
|
@@ -224,7 +248,6 @@ public class OfflineNewService {
|
|
|
Date date = format.parse(refundTimeStart);
|
|
|
paramList.add(date);
|
|
|
}
|
|
|
- String source = request.getSource();
|
|
|
if (!StringHelper.isNullOrWhiteSpace(source)) {
|
|
|
whereSql += " and ( source = ?)";
|
|
|
paramList.add(Integer.parseInt(source));
|