Parcourir la source

添加获取科室地点接口

lighter il y a 1 an
Parent
commit
7fe2d7be92

+ 5 - 0
src/main/java/thyyxxk/wxservice_server/controller/AppointmentController.java

@@ -137,4 +137,9 @@ public class AppointmentController {
         }
         return ResultVoUtil.success("退号成功。");
     }
+
+    @GetMapping("/getDeptPos")
+    public ResultVo<String> getDeptPos(@RequestParam("deptCode") String deptCode) {
+        return ResultVoUtil.success(service.getDeptPos(deptCode));
+    }
 }

+ 3 - 0
src/main/java/thyyxxk/wxservice_server/dao/RedisLikeDao.java

@@ -24,4 +24,7 @@ public interface RedisLikeDao {
 
     @Select("select rtrim(name) from mz_zd_work_time WITH(NOLOCK) where code=#{code} and del_flag=0")
     String selectAmpmName(@Param("code") String code);
+
+    @Select("select office_pos from zd_unit_code where code=#{code}")
+    String selectDeptPos(@Param("code") String code);
 }

+ 4 - 0
src/main/java/thyyxxk/wxservice_server/service/AppointmentService.java

@@ -304,4 +304,8 @@ public class AppointmentService {
                 || null == mzyReq.getPaymode() || mzyReq.getVisitedMark().equals("1")
                 || mzyReq.getCancelMark().equals("1");
     }
+
+    public String getDeptPos(String deptCode) {
+        return redis.getDeptPos(deptCode);
+    }
 }

+ 15 - 0
src/main/java/thyyxxk/wxservice_server/service/RedisLikeService.java

@@ -15,6 +15,7 @@ public class RedisLikeService {
     private final static Map<String, String> regionMap = new HashMap<>();
     private final static Map<String, String> regionParentMap = new HashMap<>();
     private final static Map<String, String> ampmMap = new HashMap<>();
+    private final static Map<String, String> deptPosMap = new HashMap<>();
     private final RedisLikeDao dao;
 
     public RedisLikeService(RedisLikeDao dao) {
@@ -92,4 +93,18 @@ public class RedisLikeService {
         }
         return ampmName;
     }
+
+    public String getDeptPos(String code) {
+        if (StringUtil.isBlank(code)) {
+            return null;
+        }
+        String deptPos = deptPosMap.get(code);
+        if (null == deptPos) {
+            deptPos = dao.selectDeptPos(code);
+            if (StringUtil.notBlank(deptPos)) {
+                deptPosMap.put(code, deptPos);
+            }
+        }
+        return deptPos;
+    }
 }