浏览代码

添加检查检验预约维护。

lighter 4 年之前
父节点
当前提交
03f97e3b58

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>7.6</version>
+    <version>7.7</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
 

+ 36 - 0
src/main/java/thyyxxk/webserver/controller/examinations/BookableManageController.java

@@ -0,0 +1,36 @@
+package thyyxxk.webserver.controller.examinations;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.examinations.bookablemanage.SearchParam;
+import thyyxxk.webserver.service.examinations.BookableManageService;
+
+import java.util.Map;
+
+/**
+ * @author: DingJie
+ * @create: 2021-04-25 11:32:57
+ **/
+@RestController
+@RequestMapping("/bookableManage")
+public class BookableManageController {
+    private final BookableManageService service;
+
+    @Autowired
+    public BookableManageController(BookableManageService service) {
+        this.service = service;
+    }
+
+    @PostMapping("/searchItems")
+    public ResultVo<Map<String, Object>> searchItems(@RequestBody SearchParam param) {
+        return service.searchItems(param);
+    }
+
+    @GetMapping("/updateWxBookableFlag")
+    public ResultVo<Integer> updateWxBookableFlag(@RequestParam("tableName") String tableName,
+                                                  @RequestParam("code") String code,
+                                                  @RequestParam("flag") Integer flag) {
+        return service.updateWxBookableFlag(tableName, code, flag);
+    }
+}

+ 2 - 2
src/main/java/thyyxxk/webserver/controller/lisdock/LisDockController.java → src/main/java/thyyxxk/webserver/controller/examinations/LisDockController.java

@@ -1,4 +1,4 @@
-package thyyxxk.webserver.controller.lisdock;
+package thyyxxk.webserver.controller.examinations;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -6,7 +6,7 @@ import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.examinations.inspections.InspectionsIndex;
 import thyyxxk.webserver.entity.examinations.inspections.QueryInspectionParam;
 import thyyxxk.webserver.entity.examinations.lisdock.PushResultParam;
-import thyyxxk.webserver.service.lisdock.LisDockService;
+import thyyxxk.webserver.service.examinations.LisDockService;
 
 import java.util.List;
 import java.util.Map;

+ 39 - 0
src/main/java/thyyxxk/webserver/dao/his/examinations/InspectionsDao.java

@@ -0,0 +1,39 @@
+package thyyxxk.webserver.dao.his.examinations;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+import thyyxxk.webserver.entity.examinations.bookablemanage.ExamItem;
+
+/**
+ * @author dj
+ */
+@Mapper
+public interface InspectionsDao {
+
+    @Select("select rtrim(max(tj_no)) from mz_patient_mi where social_no=#{socialNo}")
+    String selectTjNo(@Param("socialNo") String socialNo);
+
+    @Select("select rtrim(code) as code, rtrim(name) as name, rtrim(exec_unit) as execUnit, " +
+            "execUnitName=(select rtrim(name) from zd_unit_code where code=exec_unit), " +
+            "rtrim(py_code) as pyCode, rtrim(d_code) as wbCode, wx_bookable_flag " +
+            "from ${tableName} where isnull(del_flag,0)!=1")
+    IPage<ExamItem> searchItems(IPage<ExamItem> iPage,
+                                @Param("tableName") String tableName);
+
+    @Select("select rtrim(code) as code, rtrim(name) as name, rtrim(exec_unit) as execUnit, " +
+            "execUnitName=(select rtrim(name) from zd_unit_code where code=exec_unit), " +
+            "rtrim(py_code) as pyCode, rtrim(d_code) as wbCode, wx_bookable_flag " +
+            "from ${tableName} where isnull(del_flag,0)!=1 and ${method} like #{content}")
+    IPage<ExamItem> searchItemsByCondition(IPage<ExamItem> iPage,
+                                           @Param("tableName") String tableName,
+                                           @Param("method") String method,
+                                           @Param("content") String content);
+
+    @Update("update ${tableName} set wx_bookable_flag=#{flag} where code=#{code}")
+    void updateWxBookableFlag(@Param("tableName") String tableName,
+                              @Param("code") String code,
+                              @Param("flag") Integer flag);
+}

+ 0 - 12
src/main/java/thyyxxk/webserver/dao/his/inspections/InspectionsDao.java

@@ -1,12 +0,0 @@
-package thyyxxk.webserver.dao.his.inspections;
-
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-
-@Mapper
-public interface InspectionsDao {
-
-    @Select("select rtrim(max(tj_no)) from mz_patient_mi where social_no=#{socialNo}")
-    String selectTjNo(@Param("socialNo") String socialNo);
-}

+ 3 - 4
src/main/java/thyyxxk/webserver/dao/his/managedoctorinfo/ManageDoctorInfoDao.java

@@ -19,18 +19,17 @@ public interface ManageDoctorInfoDao {
     @Select("select rtrim(code) code, rtrim(name) name, rtrim(py_code) pyCode from zd_unit_code where mz_flag=1")
     List<CodeName> getAllMzDept();
 
-    @Select("select rtrim(b.name) titleName, " +
-            "rtrim(b.code) titleCode, " +
+    @Select("select titleName=(select rtrim(name) from zd_emp_title where code=a.emp_tit_code), " +
+            "rtrim(a.emp_tit_code) titleCode, " +
             "rtrim(a.name) name, " +
             "isnull(a.sex_code, 9) sex, " +
             "rtrim(a.code) code, " +
             "isnull(a.wx_homepage_flag, 0) wxHomepageFlag, " +
             "rtrim(a.dept_code) deptCode, " +
             "deptName=(select rtrim(name) from zd_unit_code where code=a.dept_code) " +
-            "from a_employee_mi a,zd_emp_title b " +
+            "from a_employee_mi a " +
             "where a.dept_code like #{deptCode} " +
             "and a.name like #{doctorName} " +
-            "and a.emp_tit_code=b.code " +
             "and a.code not in ('00000', '00026') " +
             "and isnull(a.del_flag,0)<>1 " +
             "and a.show_manage_flag=1")

+ 18 - 0
src/main/java/thyyxxk/webserver/entity/examinations/bookablemanage/ExamItem.java

@@ -0,0 +1,18 @@
+package thyyxxk.webserver.entity.examinations.bookablemanage;
+
+import lombok.Data;
+
+/**
+ * @author: DingJie
+ * @create: 2021-04-25 11:39:22
+ **/
+@Data
+public class ExamItem {
+    private String code;
+    private String name;
+    private String execUnit;
+    private String execUnitName;
+    private String pyCode;
+    private String wbCode;
+    private Integer wxBookableFlag;
+}

+ 16 - 0
src/main/java/thyyxxk/webserver/entity/examinations/bookablemanage/SearchParam.java

@@ -0,0 +1,16 @@
+package thyyxxk.webserver.entity.examinations.bookablemanage;
+
+import lombok.Data;
+
+/**
+ * @author: DingJie
+ * @create: 2021-04-25 11:36:14
+ **/
+@Data
+public class SearchParam {
+    private String tableName;
+    private String searchMethod;
+    private String searchContent;
+    private Integer currentPage;
+    private Integer pageSize;
+}

+ 49 - 0
src/main/java/thyyxxk/webserver/service/examinations/BookableManageService.java

@@ -0,0 +1,49 @@
+package thyyxxk.webserver.service.examinations;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import thyyxxk.webserver.constants.Capacity;
+import thyyxxk.webserver.dao.his.examinations.InspectionsDao;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.examinations.bookablemanage.ExamItem;
+import thyyxxk.webserver.entity.examinations.bookablemanage.SearchParam;
+import thyyxxk.webserver.utils.ResultVoUtil;
+import thyyxxk.webserver.utils.StringUtil;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author: DingJie
+ * @create: 2021-04-25 11:33:49
+ **/
+@Service
+public class BookableManageService {
+    private final InspectionsDao dao;
+
+    @Autowired
+    public BookableManageService(InspectionsDao dao) {
+        this.dao = dao;
+    }
+
+    public ResultVo<Map<String, Object>> searchItems(SearchParam param) {
+        IPage<ExamItem> iPage = new Page<>(param.getCurrentPage(), param.getPageSize());
+        if (StringUtil.isBlank(param.getSearchContent())) {
+            iPage = dao.searchItems(iPage, param.getTableName());
+        } else {
+            String content = "%" + param.getSearchContent().trim().toUpperCase() + "%";
+            iPage = dao.searchItemsByCondition(iPage, param.getTableName(), param.getSearchMethod(), content);
+        }
+        Map<String, Object> map = new HashMap<>(Capacity.TWO);
+        map.put("list", iPage.getRecords());
+        map.put("totalSize", iPage.getTotal());
+        return ResultVoUtil.success(map);
+    }
+
+    public ResultVo<Integer> updateWxBookableFlag(String tableName, String code, Integer flag) {
+        dao.updateWxBookableFlag(tableName, code, flag);
+        return ResultVoUtil.success(flag);
+    }
+}

+ 2 - 4
src/main/java/thyyxxk/webserver/service/lisdock/LisDockService.java → src/main/java/thyyxxk/webserver/service/examinations/LisDockService.java

@@ -1,4 +1,4 @@
-package thyyxxk.webserver.service.lisdock;
+package thyyxxk.webserver.service.examinations;
 
 import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
@@ -9,7 +9,7 @@ import org.springframework.web.client.RestTemplate;
 import thyyxxk.webserver.config.exception.ExceptionEnum;
 import thyyxxk.webserver.constants.Capacity;
 import thyyxxk.webserver.constants.ExternalAddr;
-import thyyxxk.webserver.dao.his.inspections.InspectionsDao;
+import thyyxxk.webserver.dao.his.examinations.InspectionsDao;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.examinations.inspections.InspectionsIndex;
 import thyyxxk.webserver.entity.examinations.inspections.QueryInspectionParam;
@@ -20,11 +20,9 @@ import thyyxxk.webserver.entity.examinations.lisdock.CustomerInfo;
 import thyyxxk.webserver.entity.examinations.lisdock.HealthCardResult;
 import thyyxxk.webserver.entity.examinations.lisdock.ItemResults;
 import thyyxxk.webserver.entity.examinations.lisdock.PushResultParam;
-import thyyxxk.webserver.service.examinations.InspectionsService;
 import thyyxxk.webserver.utils.Md5Util;
 import thyyxxk.webserver.utils.ResultVoUtil;
 
-import java.text.DateFormat;
 import java.util.*;
 import java.util.concurrent.ExecutionException;