Browse Source

优化可预约检验检查项目的维护。

lighter 4 năm trước cách đây
mục cha
commit
bec3c628cb

+ 4 - 5
src/main/java/thyyxxk/webserver/controller/examinations/BookableManageController.java

@@ -3,6 +3,7 @@ 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.ExamItem;
 import thyyxxk.webserver.entity.examinations.bookablemanage.SearchParam;
 import thyyxxk.webserver.service.examinations.BookableManageService;
 
@@ -27,10 +28,8 @@ public class BookableManageController {
         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);
+    @PostMapping("/updateWxBookableFlag")
+    public ResultVo<Integer> updateWxBookableFlag(@RequestBody ExamItem param) {
+        return service.updateWxBookableFlag(param);
     }
 }

+ 4 - 6
src/main/java/thyyxxk/webserver/dao/his/examinations/InspectionsDao.java

@@ -18,22 +18,20 @@ public interface InspectionsDao {
 
     @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 " +
+            "rtrim(py_code) as pyCode, rtrim(d_code) as wbCode, wx_bookable_flag, book_tip " +
             "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 " +
+            "rtrim(py_code) as pyCode, rtrim(d_code) as wbCode, wx_bookable_flag, book_tip " +
             "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);
+    @Update("update ${tableName} set wx_bookable_flag=#{wxBookableFlag},book_tip=#{bookTip} where code=#{code}")
+    void updateWxBookableFlag(ExamItem item);
 }

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

@@ -15,4 +15,6 @@ public class ExamItem {
     private String pyCode;
     private String wbCode;
     private Integer wxBookableFlag;
+    private String bookTip;
+    private String tableName;
 }

+ 7 - 3
src/main/java/thyyxxk/webserver/service/examinations/BookableManageService.java

@@ -2,6 +2,7 @@ package thyyxxk.webserver.service.examinations;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import thyyxxk.webserver.constants.Capacity;
@@ -11,6 +12,7 @@ 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 thyyxxk.webserver.utils.TokenUtil;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -19,6 +21,7 @@ import java.util.Map;
  * @author: DingJie
  * @create: 2021-04-25 11:33:49
  **/
+@Slf4j
 @Service
 public class BookableManageService {
     private final InspectionsDao dao;
@@ -42,8 +45,9 @@ public class BookableManageService {
         return ResultVoUtil.success(map);
     }
 
-    public ResultVo<Integer> updateWxBookableFlag(String tableName, String code, Integer flag) {
-        dao.updateWxBookableFlag(tableName, code, flag);
-        return ResultVoUtil.success(flag);
+    public ResultVo<Integer> updateWxBookableFlag(ExamItem param) {
+        dao.updateWxBookableFlag(param);
+        log.info("操作员:{},编辑检验检查预约信息:{}", TokenUtil.getTokenUserId(), param);
+        return ResultVoUtil.success();
     }
 }