Pārlūkot izejas kodu

feature: 挂号列表过滤比当期时间早的

wuyongyi 2 gadi atpakaļ
vecāks
revīzija
18cd827025

+ 15 - 1
onemini-hospital-empty/src/main/java/com/ywt/alipaympapi/service/impl/IsvRegisterServiceImpl.java

@@ -227,8 +227,11 @@ public class IsvRegisterServiceImpl implements IsvRegisterService {
                 .build();
                 .build();
         GetScheduleListResponse getScheduleListResponse = taiheServiceBlockingStub.getScheduleList(getScheduleListRequest);
         GetScheduleListResponse getScheduleListResponse = taiheServiceBlockingStub.getScheduleList(getScheduleListRequest);
         List<Schedule> scheduleList;
         List<Schedule> scheduleList;
+        Date date = getCurrentDate();
         if (getScheduleListResponse.getCode() == ResultCode.SUCCEED_VALUE) {
         if (getScheduleListResponse.getCode() == ResultCode.SUCCEED_VALUE) {
             scheduleList = getScheduleListResponse.getSchedulesList();
             scheduleList = getScheduleListResponse.getSchedulesList();
+            scheduleList = scheduleList.stream()
+                    .filter(p -> date.compareTo(DateUtil.parseDate(p.getServiceDate() + " " + p.getEndTime(), "yyyy-MM-dd HH:mm"))< 0).collect(Collectors.toList());
         } else {
         } else {
             log.error("NfyyByfyRegisterController#getConvertedScheduleList(): HIS 获取排班接口出错:{}", getScheduleListResponse.getMsg());
             log.error("NfyyByfyRegisterController#getConvertedScheduleList(): HIS 获取排班接口出错:{}", getScheduleListResponse.getMsg());
             scheduleList = new LinkedList<>();
             scheduleList = new LinkedList<>();
@@ -598,7 +601,7 @@ public class IsvRegisterServiceImpl implements IsvRegisterService {
                 .build();
                 .build();
         GetCommonOrderListResponse res = taiheRegisterServiceBlockingStub.getCommonOrderList(req);
         GetCommonOrderListResponse res = taiheRegisterServiceBlockingStub.getCommonOrderList(req);
         if (res.getCode() == ResultCode.SUCCEED_VALUE) {
         if (res.getCode() == ResultCode.SUCCEED_VALUE) {
-            total = res.getOrderList().size();
+
             for (CommonOrder item : res.getOrderList()) {
             for (CommonOrder item : res.getOrderList()) {
                 if(item.getHisPatientId().equals(request.getHisPatientId())) {
                 if(item.getHisPatientId().equals(request.getHisPatientId())) {
                     String deptCode = item.getDeptCode();
                     String deptCode = item.getDeptCode();
@@ -623,6 +626,7 @@ public class IsvRegisterServiceImpl implements IsvRegisterService {
                 }
                 }
             }
             }
         }
         }
+        total = list.size();
         Pagination pagination = new Pagination(request.getPageIndex(), request.getPageSize(), total);
         Pagination pagination = new Pagination(request.getPageIndex(), request.getPageSize(), total);
         PageVO<QueryOrderListResponseData> resp = new PageVO<>(pagination, list);
         PageVO<QueryOrderListResponseData> resp = new PageVO<>(pagination, list);
         return resp;
         return resp;
@@ -885,4 +889,14 @@ public class IsvRegisterServiceImpl implements IsvRegisterService {
         }
         }
         return 0;
         return 0;
     }
     }
+
+    private Date getCurrentDate() {
+        try {
+            String value = DateUtil.formatDate(new Date(), DateUtil.DADE_FROMAT_YMDHMS);
+            return DateUtil.parseDate(value, DateUtil.DADE_FROMAT_YMDHMS);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
 }
 }