瀏覽代碼

优化挂号

lighter 2 年之前
父節點
當前提交
44b3e4cabe

+ 0 - 15
src/main/java/thyyxxk/wxservice_server/entity/appointment/DoctorSource.java

@@ -1,15 +0,0 @@
-package thyyxxk.wxservice_server.entity.appointment;
-
-import lombok.Data;
-
-/**
- * @author dj
- */
-@Data
-public class DoctorSource {
-    private String fee;
-    private String doctorCode;
-    private String doctorName;
-    private String doctorTitle;
-    private Integer leftNum;
-}

+ 7 - 11
src/main/java/thyyxxk/wxservice_server/service/AppointmentService.java

@@ -41,8 +41,8 @@ public class AppointmentService {
     @Value("${hrgApiUrl}")
     private String hrgApiUrl;
 
-    private static final int[] ampmValue = new int[]{830, 900, 930, 1000, 1030, 1100, 1130, 1200, 1430, 1500, 1530, 1600, 1630, 1700};
-    private static final String[] ampmLabel = new String[]{"a1","a2","a3","a4","a5","a6","a7","a8","p1","p2","p3","p4","p5","p6"};
+    private static final int[] ampmValue = new int[]{830, 900, 930, 1000, 1030, 1100, 1130, 1200, 1430, 1500, 1530, 1600, 1630, 1700, 1730};
+    private static final String[] ampmLabel = new String[]{"a1","a2","a3","a4","a5","a6","a7","a8","p1","p2","p3","p4","p5","p6","p7"};
 
     @Autowired
     public AppointmentService(AppointmentDao dao, RedisLikeService redis, ElectronicHealthCardService healthCardService, WxRefundService wxRefundService) {
@@ -160,16 +160,14 @@ public class AppointmentService {
                 continue;
             }
             for (Map<String, Object> item : hrgResponse.getData()) {
-                if ((int) item.get("leftNum") > 0) {
-                    if (param.getNightClinic()) {
-                        if ((Boolean) item.get("isP4Request")) {
-                            sourceArray[i] = 1;
-                            break;
-                        }
-                    } else {
+                if (param.getNightClinic()) {
+                    if ((Boolean) item.get("isP4Request")) {
                         sourceArray[i] = 1;
                         break;
                     }
+                } else {
+                    sourceArray[i] = 1;
+                    break;
                 }
             }
         }
@@ -187,7 +185,6 @@ public class AppointmentService {
         if (data.getResultCode() == -1) {
             return ResultVoUtil.fail(ExceptionEnum.SLIGHTLY_ERROR, data.getResultMessage());
         }
-        data.getData().removeIf(map -> (int) map.get("leftNum") == 0);
         if (data.getData().size() == 0) {
             return ResultVoUtil.fail(ExceptionEnum.SLIGHTLY_ERROR);
         }
@@ -221,7 +218,6 @@ public class AppointmentService {
         if (data.getResultCode() == -1) {
             return ResultVoUtil.fail(ExceptionEnum.SLIGHTLY_ERROR, data.getResultMessage());
         }
-        data.getData().removeIf(map -> (int) map.get("leftNum") == 0);
         String today = DateUtil.formatDatetime(new Date(), "yyyy-MM-dd");
         if (param.getNeedExcludePassedTime() && param.getDate().equals(today)) {
             int currentHourMinute = DateUtil.parseHourMinuteToInteger();