|
@@ -2,6 +2,7 @@ package com.ywt.alipaympapi.service.impl;
|
|
|
|
|
|
import com.ywt.alipaympapi.core.ConstantDef;
|
|
import com.ywt.alipaympapi.core.ConstantDef;
|
|
import com.ywt.alipaympapi.core.utils.*;
|
|
import com.ywt.alipaympapi.core.utils.*;
|
|
|
|
+import com.ywt.alipaympapi.models.enums.DatePeriodEnum;
|
|
import com.ywt.alipaympapi.models.enums.SexEnum;
|
|
import com.ywt.alipaympapi.models.enums.SexEnum;
|
|
import com.ywt.alipaympapi.models.union_reg.HospitalCustomInfo;
|
|
import com.ywt.alipaympapi.models.union_reg.HospitalCustomInfo;
|
|
import com.ywt.alipaympapi.service.IsvRegisterService;
|
|
import com.ywt.alipaympapi.service.IsvRegisterService;
|
|
@@ -16,9 +17,8 @@ import com.ywt.gapi.taihe.register.CancelRegisteredRequest;
|
|
import com.ywt.gapi.taihe.register.CancelRegisteredResponse;
|
|
import com.ywt.gapi.taihe.register.CancelRegisteredResponse;
|
|
import com.ywt.gapi.taihe.register.TaiheRegisterServiceGrpc;
|
|
import com.ywt.gapi.taihe.register.TaiheRegisterServiceGrpc;
|
|
import com.ywt.gapi.third.taihe.*;
|
|
import com.ywt.gapi.third.taihe.*;
|
|
-import com.ywt.gapi.user.DoctorServiceGrpc;
|
|
|
|
-import com.ywt.gapi.user.GetDoctorByHisCodeRequest;
|
|
|
|
-import com.ywt.gapi.user.GetDoctorByHisCodeResponse;
|
|
|
|
|
|
+import com.ywt.gapi.user.*;
|
|
|
|
+import com.ywt.model.BaseResponse;
|
|
import com.ywt.model.PageVO;
|
|
import com.ywt.model.PageVO;
|
|
import com.ywt.model.Pagination;
|
|
import com.ywt.model.Pagination;
|
|
import com.ywt.request.queue.QueryQueueListRequest;
|
|
import com.ywt.request.queue.QueryQueueListRequest;
|
|
@@ -67,6 +67,9 @@ public class IsvRegisterServiceImpl implements IsvRegisterService {
|
|
.setSubHospitalId(subHospitalId)
|
|
.setSubHospitalId(subHospitalId)
|
|
.build();
|
|
.build();
|
|
HospitalDeptListResponse res = systemServiceBlockingStub.getHospitalDeptList(req);
|
|
HospitalDeptListResponse res = systemServiceBlockingStub.getHospitalDeptList(req);
|
|
|
|
+ if (res.getResult().getCode() != ResultCode.SUCCEED) {
|
|
|
|
+ throw new AppMessageException(res.getResult().getInfo());
|
|
|
|
+ }
|
|
Result result = res.getResult();
|
|
Result result = res.getResult();
|
|
if (result.getCode() == ResultCode.SUCCEED) {
|
|
if (result.getCode() == ResultCode.SUCCEED) {
|
|
deptList = res.getHospitalDeptListList();
|
|
deptList = res.getHospitalDeptListList();
|
|
@@ -135,7 +138,7 @@ public class IsvRegisterServiceImpl implements IsvRegisterService {
|
|
* 都不为负值时,按照传入的 offset 计算开始结束日期。
|
|
* 都不为负值时,按照传入的 offset 计算开始结束日期。
|
|
*/
|
|
*/
|
|
private List<QueryDepDoctorListResponseData> getScheduleListCommon(int hospitalId, String deptCode, String doctorCode,
|
|
private List<QueryDepDoctorListResponseData> getScheduleListCommon(int hospitalId, String deptCode, String doctorCode,
|
|
- String serviceCode, int startOffset, int endOffset) throws AppMessageException {
|
|
|
|
|
|
+ String serviceCode, int startOffset, int endOffset) throws AppMessageException {
|
|
String redisKeyPattern = "ALI_SCHEDULE_LIST_%s_%s_%d_%s";
|
|
String redisKeyPattern = "ALI_SCHEDULE_LIST_%s_%s_%d_%s";
|
|
String key = String.format(redisKeyPattern, deptCode, doctorCode, hospitalId, serviceCode);
|
|
String key = String.format(redisKeyPattern, deptCode, doctorCode, hospitalId, serviceCode);
|
|
if (startOffset >= 0 && endOffset >= 0) {
|
|
if (startOffset >= 0 && endOffset >= 0) {
|
|
@@ -146,7 +149,7 @@ public class IsvRegisterServiceImpl implements IsvRegisterService {
|
|
if (!StringHelper.isNullOrWhiteSpace(value)) {
|
|
if (!StringHelper.isNullOrWhiteSpace(value)) {
|
|
Map<String, Object> cacheMap = JsonSerializer.from(value, Map.class);
|
|
Map<String, Object> cacheMap = JsonSerializer.from(value, Map.class);
|
|
if (cacheMap != null && !Checker.isNone(cacheMap.get("list"))) {
|
|
if (cacheMap != null && !Checker.isNone(cacheMap.get("list"))) {
|
|
- return (List<QueryDepDoctorListResponseData>)cacheMap.get("list");
|
|
|
|
|
|
+ return (List<QueryDepDoctorListResponseData>) cacheMap.get("list");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -189,8 +192,8 @@ public class IsvRegisterServiceImpl implements IsvRegisterService {
|
|
return lst;
|
|
return lst;
|
|
}
|
|
}
|
|
|
|
|
|
- private List<QueryDepDoctorListResponseData> getConvertedScheduleList(int hospitalId, int startOffset, int endOffset, String deptCode,
|
|
|
|
- String doctorCode, String serviceCode) {
|
|
|
|
|
|
+ private List<QueryDepDoctorListResponseData> getConvertedScheduleList(int hospitalId, int startOffset, int endOffset, String deptCode,
|
|
|
|
+ String doctorCode, String serviceCode) {
|
|
Calendar calendar = Calendar.getInstance();
|
|
Calendar calendar = Calendar.getInstance();
|
|
if (startOffset > 0) {
|
|
if (startOffset > 0) {
|
|
calendar.add(Calendar.DATE, startOffset);
|
|
calendar.add(Calendar.DATE, startOffset);
|
|
@@ -217,7 +220,7 @@ public class IsvRegisterServiceImpl implements IsvRegisterService {
|
|
scheduleList = new LinkedList<>();
|
|
scheduleList = new LinkedList<>();
|
|
}
|
|
}
|
|
List<QueryDepDoctorListResponseData> all = new ArrayList<>();
|
|
List<QueryDepDoctorListResponseData> all = new ArrayList<>();
|
|
- for (int i = startOffset; i < endOffset ; i++) {
|
|
|
|
|
|
+ for (int i = startOffset; i < endOffset; i++) {
|
|
Calendar c = Calendar.getInstance();
|
|
Calendar c = Calendar.getInstance();
|
|
int offset = i;
|
|
int offset = i;
|
|
if (offset > 0) {
|
|
if (offset > 0) {
|
|
@@ -236,7 +239,7 @@ public class IsvRegisterServiceImpl implements IsvRegisterService {
|
|
* 排班记录转为Map
|
|
* 排班记录转为Map
|
|
*/
|
|
*/
|
|
private List<QueryDepDoctorListResponseData> convertToScheduleMap(List<Schedule> scheduleList, Calendar calendar, String strDate,
|
|
private List<QueryDepDoctorListResponseData> convertToScheduleMap(List<Schedule> scheduleList, Calendar calendar, String strDate,
|
|
- int offset, int hospitalId) {
|
|
|
|
|
|
+ int offset, int hospitalId) {
|
|
Map<Integer, QueryDepDoctorListResponseData> doctorSet = new HashMap<>();
|
|
Map<Integer, QueryDepDoctorListResponseData> doctorSet = new HashMap<>();
|
|
|
|
|
|
GetDoctorByHisCodeResponse getDoctorByHisCodeResponse;
|
|
GetDoctorByHisCodeResponse getDoctorByHisCodeResponse;
|
|
@@ -285,13 +288,13 @@ public class IsvRegisterServiceImpl implements IsvRegisterService {
|
|
// continue;
|
|
// continue;
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
- if (s.getScheduleStatus() != 1){
|
|
|
|
|
|
+ if (s.getScheduleStatus() != 1) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
QueryDepDoctorListResponseData item = doctorSet.get(doctorId);
|
|
QueryDepDoctorListResponseData item = doctorSet.get(doctorId);
|
|
- if (Checker.isNone(item)){
|
|
|
|
|
|
+ if (Checker.isNone(item)) {
|
|
item = new QueryDepDoctorListResponseData();
|
|
item = new QueryDepDoctorListResponseData();
|
|
- item.setDoctorId(doctorId+"");
|
|
|
|
|
|
+ item.setDoctorId(doctorId + "");
|
|
item.setName(s.getDoctorName());
|
|
item.setName(s.getDoctorName());
|
|
item.setDesc(s.getDoctorSpec());
|
|
item.setDesc(s.getDoctorSpec());
|
|
item.setPicUrl(avatar);
|
|
item.setPicUrl(avatar);
|
|
@@ -307,22 +310,24 @@ public class IsvRegisterServiceImpl implements IsvRegisterService {
|
|
item.setDeptCode(s.getDeptCode());
|
|
item.setDeptCode(s.getDeptCode());
|
|
}
|
|
}
|
|
List<OrderSource> orderSourceList = item.getOrderSources();
|
|
List<OrderSource> orderSourceList = item.getOrderSources();
|
|
- if (Checker.isNone(orderSourceList)){
|
|
|
|
|
|
+ if (Checker.isNone(orderSourceList)) {
|
|
orderSourceList = new ArrayList<>();
|
|
orderSourceList = new ArrayList<>();
|
|
}
|
|
}
|
|
OrderSource os = new OrderSource();
|
|
OrderSource os = new OrderSource();
|
|
//号源id
|
|
//号源id
|
|
os.setOrderSourceId(s.getScheduleItemCode());
|
|
os.setOrderSourceId(s.getScheduleItemCode());
|
|
//号源开始时间段
|
|
//号源开始时间段
|
|
- os.setStartTime(s.getDatePeriod()+"");
|
|
|
|
|
|
+ os.setStartTime(s.getDatePeriod() + "");
|
|
//号源截止时间段
|
|
//号源截止时间段
|
|
os.setEndTime(s.getDatePeriodName());
|
|
os.setEndTime(s.getDatePeriodName());
|
|
//挂号费用
|
|
//挂号费用
|
|
- os.setCost(s.getFee()+"");
|
|
|
|
|
|
+ os.setCost(s.getFee() + "");
|
|
//剩余数量
|
|
//剩余数量
|
|
os.setRemain(Checker.getIntegerValue(s.getAvailableLeftNum()));
|
|
os.setRemain(Checker.getIntegerValue(s.getAvailableLeftNum()));
|
|
//true:确认挂号时支付,false:就诊时支付
|
|
//true:确认挂号时支付,false:就诊时支付
|
|
os.setOnlinePay(true);
|
|
os.setOnlinePay(true);
|
|
|
|
+ os.setDatePeriodName(s.getDatePeriodName());
|
|
|
|
+ os.setServiceDate(s.getServiceDate());
|
|
orderSourceList.add(os);
|
|
orderSourceList.add(os);
|
|
|
|
|
|
doctorSet.put(doctorId, item);
|
|
doctorSet.put(doctorId, item);
|
|
@@ -332,7 +337,7 @@ public class IsvRegisterServiceImpl implements IsvRegisterService {
|
|
for (Integer doctorIdInt : doctorIdSet) {
|
|
for (Integer doctorIdInt : doctorIdSet) {
|
|
QueryDepDoctorListResponseData data = doctorSet.get(doctorIdInt);
|
|
QueryDepDoctorListResponseData data = doctorSet.get(doctorIdInt);
|
|
List<OrderSource> sourceList = data.getOrderSources();
|
|
List<OrderSource> sourceList = data.getOrderSources();
|
|
- if (!Checker.isNone(sourceList)){
|
|
|
|
|
|
+ if (!Checker.isNone(sourceList)) {
|
|
int remain = sourceList.stream().mapToInt(OrderSource::getRemain).sum();
|
|
int remain = sourceList.stream().mapToInt(OrderSource::getRemain).sum();
|
|
data.setRemain(remain);
|
|
data.setRemain(remain);
|
|
}
|
|
}
|
|
@@ -350,10 +355,244 @@ public class IsvRegisterServiceImpl implements IsvRegisterService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<QueryDoctorOrderSourceListResponseData> queryDoctorOrderSourceList(QueryDoctorOrderSourceListRequest request) {
|
|
|
|
|
|
+ public List<QueryDoctorOrderSourceListResponseData> queryDoctorOrderSourceList(QueryDoctorOrderSourceListRequest request) throws Exception {
|
|
|
|
+ int hospitalId = BizUtil.getCurrentHospitalId();
|
|
|
|
+ String deptCode = request.getDepCode();
|
|
|
|
+ String doctorCode = request.getDoctorCode();
|
|
|
|
+ String serviceDate = request.getServiceDate();
|
|
|
|
+ Integer period = request.getPeriod();
|
|
|
|
+ if (StringHelper.isNullOrWhiteSpace(deptCode)) {
|
|
|
|
+ throw new AppMessageException("科室不存在");
|
|
|
|
+ }
|
|
|
|
+ if (StringHelper.isNullOrWhiteSpace(doctorCode)) {
|
|
|
|
+ throw new AppMessageException("医生不存在");
|
|
|
|
+ }
|
|
|
|
+ if (hospitalId <= 0) {
|
|
|
|
+ hospitalId = BizUtil.getHospitalIdByTerminalId(BizUtil.getCurrentTerminalWrapped());
|
|
|
|
+ }
|
|
|
|
+ List<Map<String, Object>> dataList = new LinkedList<>();
|
|
|
|
+ if (!StringHelper.isNullOrWhiteSpace(serviceDate)) {
|
|
|
|
+ Date date = DateUtil.parseDate(serviceDate, "yyyy-MM-dd");
|
|
|
|
+ if (date == null) {
|
|
|
|
+ throw new AppMessageException("invalid serviceDate");
|
|
|
|
+ }
|
|
|
|
+ //查询医生某一天的排班分时信息
|
|
|
|
+ if (period == null) {
|
|
|
|
+ throw new AppMessageException("请选择时段");
|
|
|
|
+ }
|
|
|
|
+ if (DatePeriodEnum.valueOf(period) == null) {
|
|
|
|
+ throw new AppMessageException("时段不存在");
|
|
|
|
+ }
|
|
|
|
+ String strDate = DateUtil.formatDate(date, "yyyy-MM-dd");
|
|
|
|
+ Map<String, Object> map = getScheduleTimeInfoResponse(deptCode, doctorCode, strDate, period, hospitalId);
|
|
|
|
+ if (map != null) {
|
|
|
|
+ dataList.add(map);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ //取医生8天排班的分时信息
|
|
|
|
+ int[] periods = {DatePeriodEnum.MORNING.getValue(), DatePeriodEnum.AFTERNOON.getValue()};
|
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
|
+
|
|
|
|
+ for (int offset = 0; offset < 8; offset++) {
|
|
|
|
+ calendar.add(Calendar.DATE, 1);
|
|
|
|
+ String strDate = DateUtil.formatDate(calendar.getTime(), "yyyy-MM-dd");
|
|
|
|
+
|
|
|
|
+ for (int p : periods) {
|
|
|
|
+ Map<String, Object> map = getScheduleTimeInfoResponse(deptCode, doctorCode, strDate, p, hospitalId);
|
|
|
|
+
|
|
|
|
+ if (map != null) {
|
|
|
|
+ dataList.add(map);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ String deptName = "";
|
|
|
|
+ String doctorName = "";
|
|
|
|
+ String avatar = "";
|
|
|
|
+ String doctorTitle = "";
|
|
|
|
+ String doctorSpec = "";
|
|
|
|
+ double fee = 0; //单位:元
|
|
|
|
+ int regFee = 0; //单位:分
|
|
|
|
+ int treatFee = 0; //单位:分
|
|
|
|
+ int amount = 0; //单位:分
|
|
|
|
+ String feeStr = "";
|
|
|
|
+ String regFeeStr = "";
|
|
|
|
+ String treatFeeStr = "";
|
|
|
|
+ int doctorId = 0;
|
|
|
|
+
|
|
|
|
+ if (dataList.size() > 0) {
|
|
|
|
+ Map<String, Object> map = dataList.get(0);
|
|
|
|
+ String strDate = map.get("serviceDate").toString();
|
|
|
|
+ GetScheduleListRequest getScheduleListRequest = GetScheduleListRequest.newBuilder()
|
|
|
|
+ .setDeptCode(deptCode)
|
|
|
|
+ .setDoctorCode(doctorCode)
|
|
|
|
+ .setServiceDate(strDate)
|
|
|
|
+ .setHospitalId(hospitalId)
|
|
|
|
+ .build();
|
|
|
|
+ GetScheduleListResponse getScheduleListResponse = taiheServiceBlockingStub.getScheduleList(getScheduleListRequest);
|
|
|
|
+
|
|
|
|
+ if (getScheduleListResponse.getCode() == ResultCode.SUCCEED_VALUE) {
|
|
|
|
+ List<Schedule> scheduleList = getScheduleListResponse.getSchedulesList();
|
|
|
|
+ if (scheduleList.size() > 0) {
|
|
|
|
+ Schedule schedule = scheduleList.stream().filter(s -> s.getDatePeriod() == Checker.getIntegerValue(period)).findFirst().orElse(null);
|
|
|
|
+ if (schedule != null) {
|
|
|
|
+ deptName = schedule.getDeptName();
|
|
|
|
+ doctorName = schedule.getDoctorName();
|
|
|
|
+ avatar = schedule.getAvatar();
|
|
|
|
+ doctorTitle = schedule.getDoctorTitle();
|
|
|
|
+ doctorSpec = schedule.getDoctorSpec();
|
|
|
|
+ amount = schedule.getFee();
|
|
|
|
+ fee = schedule.getFee() / 100d;
|
|
|
|
+ regFee = schedule.getRegFee();
|
|
|
|
+ treatFee = schedule.getCheckupFee();
|
|
|
|
+ } else {
|
|
|
|
+ throw new AppMessageException("当前时间段没有匹配的排班数据");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ GetDoctorByHisCodeResponse getDoctorByHisCodeResponse = getDoctorByHisCode(doctorCode, hospitalId);
|
|
|
|
+ if (getDoctorByHisCodeResponse.getResult().getCode() == ResultCode.SUCCEED) {
|
|
|
|
+ if (!StringHelper.isNullOrWhiteSpace(getDoctorByHisCodeResponse.getAvatar())) {
|
|
|
|
+ avatar = getDoctorByHisCodeResponse.getAvatar();
|
|
|
|
+ } else {
|
|
|
|
+ avatar = ConstantDef.DOCTOR_AVATAR_URL;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ doctorId = getDoctorByHisCodeResponse.getDoctorId();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (systemSrv.checkIsNetDept(deptCode, hospitalId)) {
|
|
|
|
+ //南方医院太和分院(互联网医院名医诊区)
|
|
|
|
+ // v3.2.0 线下就诊费用单独设置
|
|
|
|
+ // v3.3.8 即使咨询关闭,仍然可以线下问诊,问诊费用要正常显示
|
|
|
|
+ DoctorRequest doctorRequest = DoctorRequest.newBuilder()
|
|
|
|
+ .setUserid(doctorId)
|
|
|
|
+ .build();
|
|
|
|
+ DoctorInfoResponse doctorInfoResponse = doctorServiceBlockingStub.getDoctorInfo(doctorRequest);
|
|
|
|
+ if (doctorInfoResponse.getResult().getCode() != ResultCode.SUCCEED) {
|
|
|
|
+ throw new AppMessageException(String.format("无法获取医生信息: %s", doctorInfoResponse.getResult().getInfo()));
|
|
|
|
+ }
|
|
|
|
+ // 线下就诊费用跟问诊费分开,线下就诊费用读取 offline_fee 字段
|
|
|
|
+ int consultFee = Checker.getIntegerValue(doctorInfoResponse.getInfo().getOfflineFee());
|
|
|
|
+ amount = consultFee;
|
|
|
|
+ fee = consultFee / 100d;
|
|
|
|
+ regFee = 0;
|
|
|
|
+ treatFee = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+// amount = 1;
|
|
|
|
+// fee = 0.01;
|
|
|
|
+// regFee = 0;
|
|
|
|
+// treatFee = 1;//测试
|
|
|
|
+
|
|
|
|
+ feeStr = String.format("¥%.2f", fee);
|
|
|
|
+ regFeeStr = String.format("¥%.2f", regFee / 100d);
|
|
|
|
+ treatFeeStr = String.format("¥%.2f", treatFee / 100d);
|
|
|
|
+
|
|
|
|
+ Map<String, Object> data = new HashMap<>();
|
|
|
|
+ data.put("list", dataList);
|
|
|
|
+ data.put("hospitalName", BizUtil.getHospitalNameByIdSimply(hospitalId));
|
|
|
|
+ data.put("deptCode", deptCode);
|
|
|
|
+ data.put("deptName", deptName);
|
|
|
|
+ data.put("doctorCode", doctorCode);
|
|
|
|
+ data.put("doctorName", doctorName);
|
|
|
|
+ data.put("avatar", avatar);
|
|
|
|
+ data.put("doctorTitle", doctorTitle);
|
|
|
|
+ data.put("doctorSpec", doctorSpec);
|
|
|
|
+ data.put("amount", amount);
|
|
|
|
+ data.put("fee", fee);
|
|
|
|
+ data.put("regFee", regFee);
|
|
|
|
+ data.put("treatFee", treatFee);
|
|
|
|
+ data.put("feeStr", feeStr);
|
|
|
|
+ data.put("regFeeStr", regFeeStr);
|
|
|
|
+ data.put("treatFeeStr", treatFeeStr);
|
|
|
|
+ data.put("doctorId", doctorId); //医生ID
|
|
|
|
+
|
|
|
|
+ // todo:20210527 为了提高预约挂号速度,弄一个列表用作缓冲
|
|
|
|
+// String userKey = String.format(ConstantDef.YWT_COVID19_LIST_KEY, userService.getCurrentOpenId());
|
|
|
|
+// if (!checkExistYwtCovid19ListKey(userKey)) {
|
|
|
|
+// return response.failedWithParameterError("请稍后再查询,谢谢!");
|
|
|
|
+// }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 得到分时排班信息
|
|
|
|
+ *
|
|
|
|
+ * @param deptCode
|
|
|
|
+ * @param doctorCode
|
|
|
|
+ * @param serviceDate
|
|
|
|
+ * @param period
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private Map<String, Object> getScheduleTimeInfoResponse(String deptCode, String doctorCode, String serviceDate,
|
|
|
|
+ int period, int hospitalId) {
|
|
|
|
+ List<Map<String, Object>> lst = new LinkedList<>();
|
|
|
|
+
|
|
|
|
+ GetScheduleTimeInfoRequest getScheduleTimeInfoRequest = GetScheduleTimeInfoRequest.newBuilder()
|
|
|
|
+ .setDeptCode(deptCode)
|
|
|
|
+ .setDoctorCode(doctorCode)
|
|
|
|
+ .setServiceDate(serviceDate)
|
|
|
|
+ .setDatePeriod(period)
|
|
|
|
+ .setHospitalId(hospitalId)
|
|
|
|
+ .build();
|
|
|
|
+ GetScheduleTimeInfoResponse getScheduleTimeInfoResponse = taiheServiceBlockingStub.getScheduleTimeInfo(getScheduleTimeInfoRequest);
|
|
|
|
+
|
|
|
|
+ if (getScheduleTimeInfoResponse.getCode() == ResultCode.SUCCEED_VALUE) {
|
|
|
|
+ List<ScheduleTimeInfo> scheduleTimeInfoList = getScheduleTimeInfoResponse.getScheduleTimeInfosList();
|
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
|
+ String strDate = DateUtil.formatDate(calendar.getTime(), "yyyy-MM-dd");
|
|
|
|
+ String strTime = DateUtil.formatDate(calendar.getTime(), "HHmm");
|
|
|
|
+ int time = Integer.parseInt(strTime);
|
|
|
|
+
|
|
|
|
+ String strEndTime;
|
|
|
|
+ String flag;
|
|
|
|
+ int tmp;
|
|
|
|
+ int left;
|
|
|
|
+
|
|
|
|
+ for (ScheduleTimeInfo scheduleTimeInfo : scheduleTimeInfoList) {
|
|
|
|
+ flag = scheduleTimeInfo.getAvailableFlag();
|
|
|
|
+ left = scheduleTimeInfo.getAvailableLeftNum();
|
|
|
|
+
|
|
|
|
+ if (strDate.equals(serviceDate) && !StringHelper.isNullOrWhiteSpace(scheduleTimeInfo.getEndTime())) {
|
|
|
|
+ strEndTime = scheduleTimeInfo.getEndTime();
|
|
|
|
+ tmp = Integer.parseInt(strEndTime.replace(":", ""));
|
|
|
|
+
|
|
|
|
+ if (tmp < time) {
|
|
|
|
+ left = 0;
|
|
|
|
+ flag = "N";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ map.put("scheduleItemCode", scheduleTimeInfo.getScheduleItemCode());
|
|
|
|
+ map.put("startTime", scheduleTimeInfo.getStartTime());
|
|
|
|
+ map.put("endTime", scheduleTimeInfo.getEndTime());
|
|
|
|
+ map.put("availableTotalNum", scheduleTimeInfo.getAvailableTotalNum());
|
|
|
|
+ map.put("availableLeftNum", left);
|
|
|
|
+ map.put("availableFlag", flag);
|
|
|
|
+ map.put("availableNumStr", scheduleTimeInfo.getAvailableNumStr());
|
|
|
|
+
|
|
|
|
+ lst.add(map);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (lst.size() > 0) {
|
|
|
|
+ Map<String, Object> dateMap = new HashMap<>();
|
|
|
|
+ dateMap.put("serviceDate", serviceDate);
|
|
|
|
+ dateMap.put("period", period);
|
|
|
|
+ dateMap.put("datePeriod", DatePeriodEnum.valueOf(period).getDisplayName());
|
|
|
|
+ dateMap.put("schedule", lst);
|
|
|
|
+
|
|
|
|
+ return dateMap;
|
|
|
|
+ }
|
|
|
|
+
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public OrderConfirmResponseData orderConfirm(OrderConfirmRequest request) {
|
|
public OrderConfirmResponseData orderConfirm(OrderConfirmRequest request) {
|
|
log.info("IsvRegisterServiceImpl#orderConfirm--OrderConfirmRequest:{}", JsonSerializer.toJson(request));
|
|
log.info("IsvRegisterServiceImpl#orderConfirm--OrderConfirmRequest:{}", JsonSerializer.toJson(request));
|
|
@@ -526,16 +765,45 @@ public class IsvRegisterServiceImpl implements IsvRegisterService {
|
|
list.add(reportItem);
|
|
list.add(reportItem);
|
|
}
|
|
}
|
|
return list;
|
|
return list;
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public QueryDoctorInfoResponseData queryDoctorInfo(QueryDoctorInfoRequest request) {
|
|
|
|
- return null;
|
|
|
|
|
|
+ public QueryDoctorInfoResponseData queryDoctorInfo(QueryDoctorInfoRequest request) throws Exception {
|
|
|
|
+ int doctorId = Integer.parseInt(Checker.getStringValue(request.getDoctorId(), "0"));
|
|
|
|
+ int hospitalId = BizUtil.getCurrentHospitalId();
|
|
|
|
+ if (doctorId < 1) {
|
|
|
|
+ throw new AppMessageException("invalid doctorId");
|
|
|
|
+ }
|
|
|
|
+ QueryDoctorInfoResponseData responseData = new QueryDoctorInfoResponseData();
|
|
|
|
+
|
|
|
|
+ GetDoctorRequest req = GetDoctorRequest.newBuilder().setDoctorId(doctorId).build();
|
|
|
|
+ GetDoctorResponse resp = doctorServiceBlockingStub.getDoctor(req);
|
|
|
|
+ Result result = resp.getResult();
|
|
|
|
+
|
|
|
|
+ if (result.getCode() != ResultCode.SUCCEED) {
|
|
|
|
+ throw new AppMessageException(result.getInfo());
|
|
|
|
+ }
|
|
|
|
+ DoctorInfo info = resp.getDoctorInfo();
|
|
|
|
+ responseData.setDoctorId(info.getDoctorid() + "");//医生id
|
|
|
|
+ responseData.setName(info.getName());//医生姓名
|
|
|
|
+ responseData.setLevel(info.getTitle());//医生职级
|
|
|
|
+ responseData.setPicUrl(info.getAvatar());//医生头像地址
|
|
|
|
+ responseData.setDescription(info.getBriefIntro());//医生简介
|
|
|
|
+ responseData.setSpecialty(info.getSpecialty());//擅长领域
|
|
|
|
+ responseData.setDistrictName(systemSrv.getHospitalNameById(hospitalId));//院区名称
|
|
|
|
+
|
|
|
|
+ List<Department> departmentList = new ArrayList<>();
|
|
|
|
+ Department department = new Department();
|
|
|
|
+ department.setName(info.getDept());
|
|
|
|
+ department.setDepartmentId(info.getDeptIds());
|
|
|
|
+ departmentList.add(department);
|
|
|
|
+ responseData.setDepartments(departmentList);
|
|
|
|
+ return responseData;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
- public PageVO<QueryDoctorListResponseData> queryDoctorList(QueryDoctorListRequest request) {
|
|
|
|
|
|
+ public PageVO<QueryDoctorListResponseData> queryDoctorList(QueryDoctorListRequest request) throws Exception {
|
|
log.info("IsvRegisterServiceImpl#queryDoctorList--QueryDoctorListRequest:{}", JsonSerializer.toJson(request));
|
|
log.info("IsvRegisterServiceImpl#queryDoctorList--QueryDoctorListRequest:{}", JsonSerializer.toJson(request));
|
|
int pageIndex = request.getPageIndex();
|
|
int pageIndex = request.getPageIndex();
|
|
int pageSize = request.getPageSize();
|
|
int pageSize = request.getPageSize();
|