Browse Source

技术文档修改权限内容为下拉选;新增字典查询配置功能

hsh 1 year ago
parent
commit
a8727dd974

+ 38 - 0
src/main/java/thyyxxk/webserver/controller/dictionary/SelectionOptionsController.java

@@ -0,0 +1,38 @@
+package thyyxxk.webserver.controller.dictionary;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.dictionary.CodeName;
+import thyyxxk.webserver.service.dictionary.SelectionOptionsService;
+
+import java.util.List;
+
+/**
+ * @ClassName SelectionOptionsController
+ * @Author hsh
+ * @Date 2024/8/21 9:14
+ * @Version 1.0
+ * @Description 字典下拉选
+ **/
+@RestController
+@RequestMapping("/selectionOptions")
+public class SelectionOptionsController {
+
+    private final SelectionOptionsService service;
+
+    @Autowired
+    public SelectionOptionsController(SelectionOptionsService service) {
+        this.service = service;
+    }
+
+    @GetMapping("/selectDictByCode")
+    public ResultVo<List<CodeName>> selectDictByCode(@RequestParam("code") String code){
+        return service.selectDictByCode(code);
+    }
+
+
+}

+ 21 - 0
src/main/java/thyyxxk/webserver/dao/his/dictionary/SelectionOptionsDao.java

@@ -0,0 +1,21 @@
+package thyyxxk.webserver.dao.his.dictionary;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import thyyxxk.webserver.entity.dictionary.CodeName;
+import thyyxxk.webserver.entity.dictionary.ZdSelectionOptions;
+
+import java.util.List;
+
+@Mapper
+public interface SelectionOptionsDao extends BaseMapper<ZdSelectionOptions> {
+
+    @Select(" select * from zd_selection_options where flag = 'Y' and code = #{code} ")
+    ZdSelectionOptions selectionOptionsByCode(@Param("code") String code);
+
+    @Select("<script> ${sql} </script>")
+    List<CodeName> selectDictByCode(@Param("sql") String sql);
+
+}

+ 6 - 0
src/main/java/thyyxxk/webserver/dao/his/technologyArchives/TechnologyArchives15Dao.java

@@ -56,6 +56,12 @@ public interface TechnologyArchives15Dao extends BaseMapper<TechnologyArchives15
             "<if test=\"comment != null and comment != '' \">" +
             "comment = #{comment}, " +
             "</if>" +
+            "<if test=\"nameStr != null and nameStr != '' \">" +
+            "name_str = #{nameStr}, " +
+            "</if>" +
+            "<if test=\"contentStr != null and contentStr != '' \">" +
+            "content_str = #{contentStr}, " +
+            "</if>" +
             "<if test=\"account != null and account != '' \">" +
             "account = #{account}, " +
             "</if>" +

+ 26 - 0
src/main/java/thyyxxk/webserver/entity/dictionary/ZdSelectionOptions.java

@@ -0,0 +1,26 @@
+package thyyxxk.webserver.entity.dictionary;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * @ClassName ZdSelectionOptions
+ * @Author hsh
+ * @Date 2024/8/21 9:07
+ * @Version 1.0
+ * @Description 下拉选字典配置结果
+ **/
+@Data
+@TableName("zd_selection_options")
+public class ZdSelectionOptions {
+
+    @TableId(value = "code", type = IdType.NONE)
+    private String code;
+    private String name;
+    private String sql;
+    private String remark;
+    private String flag;
+
+}

+ 4 - 2
src/main/java/thyyxxk/webserver/entity/technologyArchives/TechnologyArchives15.java

@@ -21,13 +21,15 @@ public class TechnologyArchives15 {
     private String socialNo; // 身份证号
     private Integer id; // id
     private String time; // 时间
-    private String name; // 权限名称(1、临床技能|2、病历书写与审核|3、处方权限|4、值班|5、会诊|6、门诊|7、分级麻醉|8、分级手术/操作授权|9、精麻处方|10、抗菌素处方分级)
-    private String content; // 权限内容
+    private String name; // 父权限编码(1、临床技能|2、病历书写与审核|3、处方权限|4、值班|5、会诊|6、门诊|7、分级麻醉|8、分级手术/操作授权|9、精麻处方|10、抗菌素处方分级)
+    private String content; // 权限内容编码
     private String delFlag; // 权限资格(0: 授予  1: 除去)
     private String comment; // 备注
     private String account; // 授权人工号
     private String accountAuthor; //被授权人工号
     private String accountName; //被授权人姓名
+    private String nameStr; // 父权限名称
+    private String contentStr; // 子权限名称(多权限用,分割)
     @TableField(exist = false)
     private String oldSocialNo; // 修改前身份证号
 

+ 42 - 0
src/main/java/thyyxxk/webserver/service/dictionary/SelectionOptionsService.java

@@ -0,0 +1,42 @@
+package thyyxxk.webserver.service.dictionary;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import thyyxxk.webserver.config.exception.ExceptionEnum;
+import thyyxxk.webserver.dao.his.dictionary.SelectionOptionsDao;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.dictionary.CodeName;
+import thyyxxk.webserver.entity.dictionary.ZdSelectionOptions;
+import thyyxxk.webserver.utils.ResultVoUtil;
+import thyyxxk.webserver.utils.StringUtil;
+
+import java.util.List;
+
+/**
+ * @ClassName SelectionOptionsService
+ * @Author hsh
+ * @Date 2024/8/21 9:19
+ * @Version 1.0
+ * @Description 字典下拉选
+ **/
+@Service
+@Slf4j
+public class SelectionOptionsService {
+
+    private final SelectionOptionsDao dao;
+
+    @Autowired
+    public SelectionOptionsService(SelectionOptionsDao dao) {
+        this.dao = dao;
+    }
+
+    public ResultVo<List<CodeName>> selectDictByCode(String code){
+        ZdSelectionOptions options = dao.selectionOptionsByCode(code);
+        if(null == options || StringUtil.isBlank(options.getSql())){
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "未查到【" + code + "】相关的字典信息,请检查!");
+        }
+        return ResultVoUtil.success(dao.selectDictByCode(options.getSql()));
+    }
+
+}